Blue coordination method, coordination unit, system, and storage medium

Through the partitioning and layered division and encoding-decoding structure of the power grid, combined with the GTransformer model and multiplexing method, the coordination and optimization problems of new energy, electric vehicles and energy storage in large-scale power grids are solved, and effective division and reduction of computing volume of the whole network coordination is achieved.

WO2025130346A1PCT designated stage expired Publication Date: 2025-06-26LIU JIAYU

Patent Information

Application Number
PCT/CN2024/127560
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-18
Filing Date
2024-10-26
Publication Date
2025-06-26

AI Technical Summary

Technical Problem

It is difficult for the existing technology to effectively coordinate and optimize new energy, electric vehicles and energy storage in large-scale power grids, especially to achieve the challenges of reactive and active optimization while meeting massive computing needs.

Method used

A blue coordination method is proposed, through the partitioning and layering of the power grid, the encoding-decoding structure and the GTransformer model are adopted to achieve top-down and bottom-up optimization, reduce the amount of computing, and further optimize through multiplexing and minimal coding methods.

Benefits of technology

It realizes effective division of the whole network coordination, resolves the conflict between local optimization and overall optimization, reduces the amount of computing, makes the whole network coordination possible, and at the same time improves the overall stability and optimization efficiency of the power grid.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024127560_26062025_PF_FP_ABST
    Figure CN2024127560_26062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present invention are a blue coordination method, a coordination unit, a system, and a storage medium. The method comprises the following steps: finding a core network and related networks thereof, and dividing the core network into partitions and layers; S0, establishing a power grid model; S1: setting an optimization objective for planning, encoding model information from bottom to top until a layer where the core network is located is reached, and then performing decoding from top to bottom to obtain a planned index; and S2, execution: correcting the planned index on the basis of current data, first determining active power of each device, then determining reactive power of each device, and finally, in view of a high similarity to Trm, proposing an optimized attention mechanism for coordination. The method resolves the contradiction between local optimization and overall optimization caused by division, greatly reduces the amount of calculation, coordinates the whole network balance by means of communication and computers, enables further whole network active power / reactive power optimization coordination on this basis to become possible, and lays foundation for large models, AIGC and AGI for coordination.
Need to check novelty before this filing date? Find Prior Art

Description

A blue coordination method, coordination unit, system and storage medium Technical Field

[0001] It involves the fields of coordinated control of new energy, electric vehicles and energy storage, and specifically involves methods of large-scale centralized control and optimized coordination. Background Art

[0002] Traditional generator control methods aren't necessarily fully suitable for large-scale power grids integrating distributed energy resources and electric vehicles. Current methods employ unified modeling, using voltage ratios or transformer ratios to convert impedance for different levels of equipment, establishing a unified grid model for optimization and solution. While this approach offers the advantage of a unified model, it also presents challenges when the model becomes too large. The introduction of energy storage or similar devices further complicates the grid. my country's power grid is characterized by its division into six regional grids, interconnected by DC networks with appropriate exchange capacities. Given the complexity and scale of this grid, achieving coordinated optimization of adjustable resources such as new energy, electric vehicles, and energy storage while meeting massive computing demands remains a challenge.

[0003] To this end, post-segmentation regional control methods have become the primary means of addressing massive computational demands. However, solving for segmented power grids can easily lead to conflicts between local and global optimization, making optimal scheduling of the entire power grid a challenging research topic. We identify potential future research and application directions: either focusing on improving computational capabilities to achieve precise, unified solutions for the entire grid, aiming for the holy grail of novel power systems and virtual grids, or researching and implementing simplified and practical engineering methods for segmented solutions within a rational architecture.

[0004] In 2018, we observed the trend toward electric vehicles and new energy sources, and learned about the challenges of integrating new energy sources into the grid. At this time, 5G technology was booming, making connectivity virtually ubiquitous. We believed that electric vehicles' sensitivity to power supply stability decreased during charging, and that charging, controlled through information technology aggregation, was far less expensive than discharging. This could sacrifice charging power supply stability for improved overall grid stability. This led to a strategy of initially aggregating electric vehicle charging as a starting point, followed by paid discharging adjustments based on circumstances. In 2018, we proposed "A Method for Harmonizing New Energy and Electric Vehicle Integration into the Grid" (Chinese Patent CN111463822A, January 21, 2019), known as "Blue Charging." Currently, it appears that since electric vehicle batteries are designed for comfortable driving, a reduction in their lifespan will result in a proportional reduction in the vehicle's price. The impairment caused by electric vehicle discharge not only includes the battery itself, but also the vehicle's price, proportional to the battery's impairment. Therefore, the actual discharge cost is far higher than the battery's price. We are grateful for the path we chose.

[0005] On this basis, the subsequent applications for "A Blue Charging Method" (Chinese Patent 2023100768994, January 10, 2023) and "A Coordination Method" (Chinese Patent 2023106042789, May 18, 2023) are attempts to research and implement simplified and practical engineering methods for segmentation solutions within a reasonable framework. Correspondingly, the proposed invention application is an attempt to integrate methods such as "A Blue Charging Method" with traditional unified modeling to resolve the problem of unified solution for the entire network or large-scale power grid. Technical issues

[0006] Effective and meaningful active power optimization is fraught with difficulties. The question is how to optimize reactive power and active power meaningfully. This requires finding a large and suitable power grid, simplifying the calculation process or variables when coordinating it, and moving closer to a solvable problem. Current power grid calculation methods map devices of different voltage levels to devices of the same voltage level, unifying the modeling and solution. However, segmentation and division are uncommon in power grids, and a suitable method, principle, or criterion for segmentation and division is needed.

[0007] Active power optimization refers to the optimization objectives including network loss optimization, charging electricity price cost, discharging electricity price revenue, the cost of switching between charging and discharging states, the cost of charging and discharging cycles, the active power fluctuations in each area of ​​the power grid that need to be balanced and the corresponding rewards, the voltage nodes that need to be optimized and the corresponding rewards, etc.; constraints include grid safety and stability constraints, the maximum storage capacity Wh limit of energy storage equipment, etc. Technical Solutions

[0008] In view of this, the proposed invention provides a blue coordination method, criteria for reasonable grid segmentation and division, reuse, an encoding-decoding structure and method for processing grid data, a minimalist encoding structure and method, a GTransformer model structure for grid coordination, a coordination unit, a system, and a storage medium;

[0009] A first aspect of the embodiments of the present invention is a blue coordination method, which finds a core network and its related power grids according to Principle 3.3, divides the power grids into zones and layers, or further divides the zones and layers, and is characterized by comprising the following steps:

[0010] Initialize, segment and divide the grid according to principles 3, 3.1 and 3.2, find the core network and its related grids, and divide the grid into zones and layers or perform unified zone and layer division;

[0011] S0: Modeling, grid model 0 is obtained based on grid data. Model 0 has the highest accuracy, including 4.5;

[0012] S1: Planning. Model 0 is expanded and discretized in time but not used directly. Instead, the model information is encoded layer by layer from bottom to top and then decoded from the core network from top to bottom to obtain planning indicators composed of time series of active indicators at each layer. The steps are as follows:

[0013] S11: Model 0 is expanded and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. The frames are arranged in chronological order to form a frame sequence, which becomes the model time series. The predicted quantity of the power grid data is imported into the model time series to form the future state model of the power grid. The variables in the future state model are adjustable quantities, including active adjustable quantities and reactive adjustable quantities. Since changing the adjustable quantities can have an impact on the future state of the power grid, the objective function is established in this way.

[0014] S12: Encode the future state model layer by layer from bottom to top to obtain the future state model with a precision of 3 at each layer and the original accuracy;

[0015] S13: The core network layer is the starting layer, and top-down optimization is performed, i.e., top-down decoding is performed. The core network layer is the focus layer, and the focus layer is decoded and optimized according to the objective function, i.e., numerical optimization is performed within a limited amount of computation to search for adjustable quantities, and an instance value of the adjustable quantity with the minimum objective function value or the value closest to the target is obtained. The instance value is used as the result of optimization or decoding, and the active power of the equipment in this layer and the total active power of the next layer partition corresponding to the super node are obtained, i.e., the total adjustable quantity instance value of the super node corresponding area is obtained. The next layer becomes the focus layer, and in any area of ​​the focus layer, the total adjustable quantity instance value is used as a constraint to decode the focus layer. After optimization or decoding, the total active power of the focus layer and any area of ​​the next layer is obtained. In this way, optimization is performed layer by layer from top to bottom to the bottom layer. During optimization, the focus layer uses the highest precision model, and the lower layers of the focus layer use lower precision models. Assume that the Nth layer is the starting layer, and let n=N, and the following steps are included:

[0016] S131: Determine whether n is the top level, if so, jump to step S132, otherwise jump to step S133;

[0017] S132: The nth layer is the focus layer, and the nth layer model has the highest accuracy. The accuracy of the layers below n is lower, thus forming the future state model n. In the future state model n, existing algorithms are used to numerically optimize the instance values ​​of the adjustable quantities, including genetic algorithms, gradient descent direction propagation algorithms and their variants (preferred because the power grid is an inertial system), etc., to find the solution closest to the target in the adjustable quantities within a limited amount of computation. The instance value of the active adjustable quantity in the nth layer is used as the active indicator of the nth layer. In the nth layer, if the highest accuracy partition model of the n-1th layer is encoded as a super node with lower accuracy in the nth layer, the instance value of the active adjustable quantity of the super node is used as the instance value of the total active adjustable quantity in the corresponding area of ​​the n-1th layer. Jump to step 134.

[0018] S133: The total active adjustable quantity instance value of the area corresponding to the nth layer obtained at the n+1th layer is used as the active constraint of the area. The nth layer is the focus layer, with the highest accuracy in the nth layer, and the layers below the nth layer have lower accuracy, forming the future state model n. The instance value of the adjustable quantity in the future state model n is numerically optimized using existing algorithms, including genetic algorithms, gradient descent direction propagation algorithms, and their variants, to find the solution closest to the target in the adjustable quantity within a limited amount of computation. The active adjustable quantity instance value of the current layer is used as the active indicator of the current layer. For nodes in the current layer that are encoded as nodes in the lower layer, the instance value of the active adjustable quantity of the node is used as the total active adjustable quantity instance value of the corresponding area in the lower layer.

[0019] S134: n=n-1; determine whether n-1 is 0, if so, jump to step S135, otherwise jump to step S131;

[0020] S135: Output active power indicators of each layer;

[0021] S14: The time series of active indicators at each layer constitute the planning indicators;

[0022] S2: Execution, first determine the active power and then the reactive power. The plan has been optimized according to the target, and the instance value of the active and adjustable quantity of each adjustable device or adjustable point has been calculated in advance, which is called the index. However, the actual situation deviates from the plan. This deviation is transmitted to each adjustable device or adjustable point to correct the instance value of its adjustable quantity; the corrected active power is used as a parameter and brought into the current state model to optimize the reactive power of the model, including: for any partition, the optimization target 1 or the focus function is the cost of the total active power P fluctuation in the area. The purpose of the cost is to expect the P fluctuation to be as small as possible; the adjustable quantity in the area takes the planning index and we can get The value of the total active power P in this area is P1, P1 is called the predicted value, the actual active power at the current moment is P2, P2 is called the actual value, the difference between the actual value P2 and the predicted value P1 is used as the deviation, and the deviation is used as the loss function. Based on the current state model, numerical optimization algorithms such as gradient descent back propagation are used to adjust the adjustable quantity to correct the index so that the deviation is minimized and the instance value of each active adjustable quantity is obtained; then, the instance values ​​of these active adjustable quantities are used as constants and substituted into the current state of the power grid to perform reactive power optimization and obtain the instance value of the reactive adjustable quantity; the process of reactive power optimization after the active power is determined is an existing technology and will not be described here.

[0023] In a second aspect of the embodiment of the invention, in a blue coordination method, the model 0 in step S1 preferably includes simplifying the model 0 using a reuse method, including the following steps:

[0024] Step 1: Initially, a small amount of reactive power is reserved; the default value of the dedicated parallel reactive power regulation device is substituted into the constraint on the active power adjustable quantity. Most of the reactive power adjustable quantity of model 0 in the planning of the blue coordination method becomes the constraint on the active power, and only the reactive power adjustable quantity in one frame is retained;

[0025] Step 2: Execute the blue coordination method to obtain data for one cycle;

[0026] Step 3: Use the historical data of the reactive adjustable quantity instance value in the previous cycle to bring most of the reactive adjustable quantities planned by the blue coordination method or coordination method 0 into constraints on the active adjustable quantity, and only retain the reactive adjustable quantity in one frame;

[0027] Step 4: Execute the blue coordination method to obtain data for multiple cycles;

[0028] Step 5: Statistical analysis is performed on multiple reactive adjustable variable instance values ​​from the same historical period. The statistical features are substituted into most reactive adjustable variables in the blue coordination method plan to become constraints on the active adjustable variable. Only the reactive adjustable variable in one frame is retained.

[0029] Step 6: Execute the blue coordination method and jump to step 5;

[0030] The third aspect of the embodiment of the proposed invention is a blue coordination method in which the model information is encoded layer by layer from bottom to top and then decoded from top to bottom from the core network. Preferably, it includes an encoding-decoding structure and method, characterized in that it includes a structure in which multiple encoding modules are connected in series and the same number of decoding modules are connected in series, the number of encoding and decoding modules is consistent with the number of model layers, the model is passed as input to the encoding module of the first layer, and the multiple encoding modules encode the model data in layers multiple times and then pass it to the decoding modules of the corresponding layers for layered decoding, thereby obtaining the instance value of the adjustable quantity at each layer; each encoding module encodes the bottom layer of the model by encoding the original model into a lower-precision code.

[0031] The fourth aspect of the embodiment of the proposed invention is a minimalist encoding structure and method, which is used for the blue coordination method described in the first aspect or the planning indicators composed of the time series of active indicators of each layer described in step S1 of the second aspect; it is characterized in that, in the encoding-decoding structure, all decoding modules are deleted and only the encoding module is retained, with an encoding accuracy of 1 or 3. According to principle 1, when encoding from the local to the whole and from the bottom up and solving in combination with the objective function and the constraints, the active network loss optimization is not considered, and only the grid safety and stability constraints are considered; in addition, after the network loss optimization is eliminated from the optimization target, the reactive adjustable amount is substituted with statistical characteristics or experience or default values, and the variables related to reactive power in the optimization target and the constraints are reduced to 0; in this way, the active power optimization is consistent with the grid topology. Complete decoupling means that the network loss F(X) in any zone is estimated using empirical values. The active quantities in the zone are linearly related to each other and to dp, and are only constrained by the safety and stability of the power grid. Since optimization is carried out from the local to the whole, the active fluctuations of the local power grid are always reduced during coordination, which rarely touches the safety and stability constraint boundaries, further reducing the dependence on power grid data. In addition, reactive power optimization is decoupled from active power optimization, greatly reducing the amount of computation. It is easy to prove that this structure and method are the methods with the highest utilization rate of adjustable quantities, which can maximize the value of adjustable equipment such as energy storage. After the active power optimization is completely decoupled from the power grid topology, and after the reactive power optimization is decoupled from the active power optimization, reactive power optimization can be performed based on power grid data, without relying on the power grid topology. Reactive power optimization can adopt an on-site mode, and reactive power balance is sufficient at the access point where the reactive power adjustable equipment is located.

[0032] The minimalist encoding structure and method are suitable for active and reactive power optimization tasks where personal capabilities and resources are limited and grid data is almost unavailable, or for tasks that require extreme cost reduction. For example, Elon Musk has almost unlimited personal capabilities and resources but is obsessed with reducing all costs. Its significance lies in maximizing the utilization of adjustable resources and promoting the promotion of adjustable equipment.

[0033] The fifth aspect of the embodiment of the invention is a method for applying Transformer to coordination and an improved G attention mechanism, which is used for the blue coordination method of the first aspect or step S1 of the second aspect to encode layer by layer from bottom to top, and then decode from the core network from top to bottom to obtain planning indicators; it is characterized in that it includes, after dividing the power grid into layers, encoding the bottom layer with an accuracy of 1, 2 or 3 as new power grid data, and inputting the new power grid data into Transformer; it also includes a GTransformer, which is a Trm model based on the G attention mechanism; the G attention mechanism means that the point q corresponds to the vector z q , the set of all points is {z q}; sampling point k belongs to {z q} corresponds to z k, there is an update z for sampling point k k = G-Attn(z k ,{z} k ), {z} k is {z q} in the vector set corresponding to the point set related to the sampling point, G-Attn(z k ,{z} k ) = self-Attn(z k ,{z} k ), self-Attn({points}) means including, calculating and updating the Self-Attention mechanism for the point set {points} in the brackets; the sampling point k is an important node, including the important nodes determined according to the partition hierarchical structure, and also including the important nodes determined according to the unified partition hierarchical structure.

[0034] The TRM model based on the G attention mechanism refers to using the G attention mechanism as the attention mechanism in the Encoder module in the existing TRM model, or G attention as the attention mechanism in the Decoder module in the existing TRM model;

[0035] The sixth aspect of the embodiment of the proposed invention is a coordination unit, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the blue coordination algorithm described in the first aspect when executing the computer program.

[0036] A seventh aspect of the embodiments of the invention is a coordination system, characterized by including: the coordination units described in the sixth aspect being arranged according to power grid divisions, with one coordination unit responsible for one zone; each coordination unit being responsible for aggregating and cleaning data collected by all terminal devices in the zone and data encoded by lower-layer coordination units, then encoding the data, and transmitting the encoded data to an upper layer via a signal channel; simultaneously receiving data from the upper layer, decoding the data, and transmitting it to each terminal device in the zone and the lower-layer coordination unit; a single coordination unit integrating both encoding and decoding for the zone;

[0037] The eighth aspect of the embodiments of the invention is a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the blue coordination method described in the first aspect.

[0038] A ninth aspect of the embodiments of the proposed invention application is a power grid segmentation, division principle or criterion applicable to power grid coordination, characterized by including: unified partitioning and hierarchical division;

[0039] In a tenth aspect of the embodiments of the invention application, a coordination method 0 is provided, which obtains power grid data, performs state estimation, Kalman filtering, and other cleaning operations on the data to obtain optimal or relatively optimal power grid data, and determines a core network and its related power grids. The coordination method 0 is characterized by comprising the following steps:

[0040] Step 0: Modeling, obtaining the grid attribute model including network equations based on grid data;

[0041] Step 1: Planning. To plan energy storage or similar energy storage equipment, the model is expanded in time and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. They are arranged in chronological order to form a frame sequence, which becomes a discrete model time series. The predicted amount of power grid data is imported into the discrete model time series to become a discretized future state model of the power grid. In this way, the objective function is established, and the instance value of the adjustable quantity is numerically optimized using the existing algorithm. Within the limited computational effort, the solution closest to the target in the adjustable quantity is found. The active instance value of the active adjustable quantity is used as the active indicator and passed to step 2. In step 2, a part of the objective function is selected as the focus target of step 2. When the planning indicator is substituted into the adjustable quantity, the focus target value is taken as the focus value.

[0042] Step 2: Execute. Import the current grid data or the optimized data after cleaning into the grid model to obtain the current state of the grid. Alternatively, you can estimate the value of interest based on actual measurements and use it as the tracking target. The difference between the tracking target and the current state value of the target of interest is used as the deviation. This deviation is used to correct the current frame of the indicator to obtain the instance values ​​of each active adjustable variable. Then, these instance values ​​of active adjustable variables are used as constants and substituted into the current state of the grid to perform reactive power optimization, obtaining the instance values ​​of the reactive adjustable variables. The reactive power optimization process is not detailed here.

[0043] The objective function includes: a target 1 for grid balance; a target 2 for optimizing one or more electrical quantities of the future grid, including reactive power and voltage; and a target 3 for the price or cost of using adjustable quantities and their stored electricity. Targets 1, 2, and 3 constitute the overall target. Physically-based constraints are also established, including that the active and reactive power of a device that can provide both active and reactive power follows physical-based constraints. When the planning indicator is substituted into the adjustable quantity, the focus target is the focus value. The price or cost of using the adjustable quantity and its stored electricity includes the cost of switching between charging and discharging states of the energy storage. Active power fluctuation refers to, for any zone, the AC quantity contained in the time series of the total active power P in that zone, obtained by integrating or filtering the P series to obtain the DC quantity, and subtracting the DC quantity from P to obtain the AC quantity. Active power balance refers to, for any zone, mobilizing the adjustable quantity in that zone to absorb and smooth the AC quantity of the total active power P in that zone, and mobilizing the adjustable quantity outside the zone to absorb or smooth the portion of the AC quantity of the total active power P in that zone that is injected outside the zone.

[0044] The beneficial effect of coordination method 0 is that the optimization task is decomposed into two parts, planning and execution, which are executed separately and organically combined, so that the planned goals can be implemented during execution. When the execution exceeds the planned situation, it can timely take into account both attention and optimization, and ultimately achieve the goal.

[0045] The encoding is to extract and condense (reduce dimension) features.

[0046] The power grid data includes topological relationships, parameters of power grid-related equipment, topological relationships and measurement data during equipment operation, and other available and valid equipment-related factor data. Principle 3.3 states that, based on core network segmentation, the core network refers to the hub network that supports smaller networks, and smaller networks support each other through the core network. For a partitioned and layered structure, the core network is located in the middle and upper layers. The fluctuation in active power between the lower layers of the core network and the core network is much greater than the fluctuation in active power between the core network and the upper layers. This is determined by the fact that the total capacity of the active power transferred between the lower layers and the core network is much greater than the total capacity of the active power transferred between the core network and the upper layers.

[0047] The adjustable quantity refers to the mathematical meaning and the meaning in the power grid; the mathematical meaning refers to the attribute similar to the statistical feature. When it does not occur, the variable may take values ​​within the adjustable value range. When it occurs, its value is determined, and the adjustable quantity attribute disappears, that is, the adjustable quantity disappears. The adjustable quantity corresponds to the variable one-to-one, and the range of the variable value corresponds to its adjustable value one-to-one. The value of the variable is the instance value of its adjustable quantity; in addition, the adjustable quantity value can also be a probabilistic event. In the planning, the statistical characteristics including expectations can be taken and substituted as the adjustable quantity value. The adjustable quantity can be a function of certain variables in one or more probability events. For example, the adjustable quantity EX is EX=D×p(X / Y). When D is determined, any valid value of Y has a corresponding probability value p(X / Y). Then the adjustable quantity EX is a function of Y. These variables are regarded as a certain type of adjustable quantity, and the cost function of these variables is added to the objective function described in step S1 of the blue coordination method. Further optimization can be performed in the planning. In this way, the model accuracy is higher. The adjustable quantity can be considered as a function of the probability event variable, and the model accuracy is 5.

[0048] The meaning of the term "adjustable quantity" in the power grid is that an adjustable quantity is a characteristic of a quantity that can be adjusted in the power grid. An adjustable quantity corresponds to a node or device in the power grid. A node can correspond to multiple adjustable quantities, including active adjustable quantities, reactive adjustable quantities, adjustable quantities of related attributes, and adjustable quantities that may cause changes in model-related factors and attributes.

[0049] Partitioning and stratification refer to power grid partitioning and stratification by default. Power grid partitioning and stratification include partitioning and stratification. The stratification refers to dividing the power grid according to voltage levels. One voltage level is a layer, the lower voltage level is the lower layer, and the higher voltage level is the upper layer. Partitioning refers to dividing the same layer according to the electromagnetic circuit within the same layer. The same electrically connected area that does not contain the electromagnetic circuit is a partition; the electromagnetic circuit refers to the electromagnetic circuit of the transformer, the electromagnetic circuit of the converter, and the electromagnetic circuit of the DC step-up and step-down equipment.

[0050] Device hierarchical partitioning means that factors related to devices are grouped into a layer, which is one layer lower than the devices. Any partition in this layer corresponds to a device in the upper layer, and the elements in this partition are the relevant factors of the partition corresponding to the upper layer device. Any element in any partition corresponds to a partition in the lower layer, and the elements in this partition are the relevant factors of the partition corresponding to the upper layer factors. In this way, through large-scale data analysis, device hierarchical partitioning can be obtained, and the analysis can be carried out by humans or artificial intelligence.

[0051] The elements in the device hierarchical partition can be regarded as nodes, which have node types and node attributes. Through the common device layer, the hierarchical partition is unified with the grid partition layer, which is called unified partition hierarchical partitioning. The corresponding structure is the unified partition hierarchical structure.

[0052] Partition subdivision means subdividing the partition according to the partition criterion 0;

[0053] The division criterion 0 refers to, when the power grid topology is represented by the node-branch association relationship, whether the branch or node network loss is always higher than the threshold (the example threshold is 1%), and whether it is the parent node or whether the load is always higher than other branches as the criterion. If both are yes, the nodes at both ends are divided with the branch as the boundary, and the upstream and downstream relationships are established according to the long-term power supply and consumption relationship on both sides of the branch or the power direction of the branch, that is, the one that requires other power supply support for a longer time is the downstream, and the one that provides power supply support for a longer time is the upstream. It cannot be determined that the power supply and consumption relationship is at the same level.

[0054] The current calculation method for power grids is unified modeling and solving. Devices of different voltage levels are mapped to devices of the same voltage level. Segmentation and division are not common in power grids. The following principles and inferences are proposed for reasonable segmentation and division of power grids:

[0055] Principle 1: The smaller the area, the less accurate it is: For active power optimization, the smaller the area of ​​any local non-isolated small grid in the power grid, the greater the error in its detailed modeling and optimization. This is because when the small grid relies on external power generation equipment, modeling only the small grid cannot include all the power generation equipment and their topology that supply power to the small grid, resulting in incomplete and inaccurate models. When the small grid supplies power to power-consuming equipment in the external power grid, modeling only the small grid cannot include all power-consuming equipment, resulting in incomplete and inaccurate models. Generally speaking, the smaller the area of ​​the small grid, the more inaccuracies there are. In other words, for local optimization, active power loss optimization should be excluded, and only the safety and stability bundle should be considered, including the line current carrying capacity limit. As long as it is within the limit, the optimization focus can be shifted to other aspects to perform active power optimization in another sense.

[0056] Principle 2 is to optimize the whole first and then the parts. The power grid is an inertial system, so the smaller the disturbance, the smaller the impact. Only when the power grid gradually loses stability to the critical point can a small disturbance break the critical point. Therefore, based on Principle 1, the reasonable approach is to give priority to the support and optimization between small grids, and then consider the optimization within the small grid. This is Principle 2.

[0057] Corollary 2.1 refers to top-down optimization. Principle 2 can be applied to the hierarchical structure of power grid partitions to obtain Corollary 2.1. Corollary 2.1 refers to top-down optimization, that is, optimization from large to small, from upper to lower layers. This is because, in a hierarchical structure of partitions, if you optimize from the bottom up, that is, first solve each small area in the lower layer, and then solve the larger area in the upper layer that is merged from the small areas, and so on, from small to large, from bottom to top, then according to Principle 1, it will be inaccurate from the beginning, and even more inaccurate when it is pushed upwards, so if you want to do optimization, you should abandon this approach;

[0058] Principle 3 is segmentation and its strict criteria. Adjustable quantities are used to balance grid fluctuations. Considering the effect of adjustable quantities, the grid can be strictly segmented. The criterion is that for adjustable quantities, the greater the fluctuation of active power transmission between the small grid and the outside, the greater the loss of the small grid model. In particular, if this fluctuation is always zero for a long time, then for the adjustable quantity, the small grid model has no loss.

[0059] However, the small network gates are interconnected to form a large network, and the small networks almost support each other. The relaxed criteria of Principle 3 include Principles 3.1, 3.2, and 3.3;

[0060] Principle 3.1 addresses segmentation and its criteria: the fluctuation in active power transmission between the grid and other grids is very small compared to the active power consumed or generated within the grid and can be ignored and considered zero. In particular, the ratio of the fluctuation to the active power consumed or generated within the grid can be used to measure the accuracy of the grid model. When this ratio is close to or less than the grid loss within the grid, the grid model is considered complete, indicating that the grid model is accurate and grid losses can be estimated based on empirical values.

[0061] Principle 3.2 is about conditional segmentation and its criteria: at certain moments, the fluctuation in active power transmission between a small grid and other small grids is large, while at other moments, the fluctuation in active power transmission between the small grid and other small grids is very small compared to the active power consumed or generated within the small grid and can be ignored and considered to be zero. In particular, when the ratio of the fluctuation to the active power consumed or generated within the small grid is close to or less than the network loss within the small grid or the empirical value of network loss, the small grid model can be considered to be complete, that is, the small grid model is accurate. When the ratio is much greater than the network loss within the small grid or the empirical value of network loss, the small grid model can be considered inaccurate, with an error range equal to the network loss generated by the fluctuation. The network loss can be estimated based on empirical values. Principle 3.2 should be used with caution.

[0062] Principle 3.3 is based on the division of the core network. The core network refers to the hub network that supports small networks and small networks support each other through the core network. For the partitioned and layered structure, the core network is located in the middle and upper layers. The fluctuation of active power between the lower layers of the core network and the core network is much greater than the fluctuation of active power between the core network and the upper layers. The judgment basis is that the total capacity of the active power transmitted between the lower layers and the core network is much greater than the total capacity of the active power transmitted between the core network and the upper layers.

[0063] Principle 4 is local reactive balancing. Principle 4 applied to reactive adjustable quantities in a zoned and hierarchical structure means that the reactive adjustable quantity is limited to the zone in which it is located, i.e., the reactive adjustable quantity in this zone is only regulated in this zone and not in other zones.

[0064] The power grid model accuracy includes 1 degree, 2 degrees, 3 degrees, 4.5 degrees, and 5 degrees; according to the degree of precision, they are sorted from coarse to fine as 1 degree, 2 degrees, 3 degrees, 4.5 degrees, and 5 degrees; precision 1 means that after encoding the model, the model variable is reduced to only 1; precision 2 means that after encoding the model, the model variables are reduced to only M2; fineness 3 means that after encoding the model, the model variables are reduced to only M3; precision 4.5 refers to the model accuracy close to physical; precision 5 is based on the precision 4.5 model, the factors related to the adjustable quantity are quantified, and probability statistical analysis is performed to obtain the conditional probability relationship between certain adjustable quantities and related factors, and the probability model is established based on this;

[0065] Objective function and constraint conditions refer to finding the optimal input under certain constraints in the optimization problem so that the objective function can achieve the expected extreme value.

[0066] Particularly, the control method of ordinary power generation equipment differs from the coordinated control method of the proposed invention. If the control system or controller of the ordinary power generation equipment does not establish a connection with the coordination unit system to achieve data communication, then it cannot be executed as an adjustable quantity in the blue coordination, and its adjustable quantity cannot be collected in the planning. Even if the adjustable quantity is obtained, the obtained adjustable quantity instance value time series is only used as a power generation suggestion. Similarly, similar equipment with different control methods cannot be used as adjustable quantities. Equipment with the same coordinated control method as the proposed invention includes controllable or adjustable equipment such as power electronic switches and converters connected to the power grid, and may also include adjustable equipment with traditional or non-similar control methods that can interact with system data and accept system coordination. Beneficial effects

[0067] a) The entire network can be correctly segmented to identify the core power grid, and the coordination task of the entire network can be decomposed into separate coordination tasks for multiple core power grids. For any core power grid, it can be divided into zones and layers, and the coordination task can be decomposed into subtasks for coordinating each zone. In this way, the computational complexity of the entire network coordination is reduced from the nth power of a certain positive number to the product of n and the number (n is the number of zones), which greatly reduces the computational complexity and makes the coordination of the entire network possible. However, the division into multiple zones creates a contradiction between local optimization and overall optimization.

[0068] b) Resolving the conflict between local and overall optimization: To achieve effective active power optimization, the approach of optimizing the local first and then the overall is abandoned. Instead, a method of simultaneous optimization of the overall and local is proposed. This method, based on a partitioned and hierarchical structure, provides a bottom-up encoding and top-down decoding method for the power grid model. This method first transfers local grid information to the overall system, and then optimizes the system from the overall system to the local system, thus resolving the conflict between local and overall optimization.

[0069] c) Inspired by the high similarity between this bottom-up encoding and top-down decoding architecture of power grid information and TRM, the TRM artificial intelligence framework is used for coordination. This AI learns blue coordination and can independently design a set of grid data encoding and decoding algorithms for coordination. When storage and computing resources are in excess, a unified partitioning, layering, and precision 5 model is fed into this AI. This may reveal difficult-to-find model features that are effective for coordination and can be used to improve the optimization effect. This is a new attempt.

[0070] d) To reduce the computational load required by AI, an AI architecture called GTrm (GTransformer) was proposed for power grid coordination. GTrm's G attention mechanism focuses only on important nodes (sampling points) and their associated nodes. Due to the sparse nature of power grids, important nodes are quite sparse, significantly reducing the computational load. Furthermore, by partitioning the power grid into different layers and encoding the underlying layers into a low-precision model for input into AI, this can mitigate the storage and computational constraints faced in the early stages of AI development.

[0071] e) Reuse of adjustable instance values ​​evenly distributes the planned computational workload to each time period, further reducing the computational workload. This allows for more refined optimization using a more accurate model within limited time and computing power. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] FIG1 is a flowchart of the blue coordination method implementation.

[0073] Figure 2 is a diagram of the encoding-decoding framework.

[0074] Figure 3 is a schematic diagram of a super node.

[0075] Figure 4 is a diagram of the Transformer framework for coordination.

[0076] Figure 5 is a diagram of the GTransformer model framework for coordination.

[0077] FIG6 is a schematic diagram of the coordination unit system structure.

[0078] FIG7 is a schematic structural diagram of a coordination unit. Best Mode for Carrying Out the Invention

[0079] In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are provided to provide a thorough understanding of the embodiments of the proposed invention. However, it should be clear to those skilled in the art that the proposed invention can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the proposed invention with unnecessary details. The embodiments of the proposed invention include Examples 0, 1, 2, 3, 4, 5, and 6, and Example 1 can be used as the best embodiment of the present invention;

[0080] Example 1

[0081] Figure 1 is a flowchart for implementing the blue coordination method. In Figure 1, after obtaining cleaned and optimized grid data through state estimation or Kalman filtering, the core network and its related grids are found according to Principle 3.3. The grid is then divided into zones and layers, or further subdivided. The blue coordination method includes the following steps:

[0082] Initialize, segment and divide the grid according to principles 3, 3.1 and 3.2, find the core network and its related grids, and divide the grid into zones and layers or perform unified zone and layer division;

[0083] S0: Modeling, grid model 0 is obtained based on grid data. Model 0 has the highest accuracy, including 4.5;

[0084] S1: Planning. Model 0 is expanded and discretized in time but not used directly. Instead, the model information is encoded layer by layer from bottom to top and then decoded from the core network from top to bottom to obtain planning indicators composed of time series of active indicators at each layer. The steps are as follows:

[0085] S11: Model 0 is expanded and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. The frames are arranged in chronological order to form a frame sequence, which becomes the model time series. The predicted quantity of the power grid data is imported into the model time series to form the future state model of the power grid. The variables in the future state model are adjustable quantities, including active adjustable quantities and reactive adjustable quantities. Since changing the adjustable quantities can have an impact on the future state of the power grid, the objective function is established in this way.

[0086] S12: Encode the future state model layer by layer from bottom to top to obtain the future state model with a precision of 3 at each layer and the original accuracy;

[0087] S13: The core network layer is the starting layer, and top-down optimization is performed, i.e., top-down decoding is performed. The core network layer is the focus layer, and the focus layer is decoded and optimized according to the objective function, i.e., numerical optimization is performed within a limited amount of computation to search for adjustable quantities, and an instance value of the adjustable quantity with the minimum objective function value or the value closest to the target is obtained. The instance value is used as the result of optimization or decoding, and the active power of the equipment in this layer and the total active power of the next layer partition corresponding to the super node are obtained, i.e., the total adjustable quantity instance value of the super node corresponding area is obtained. The next layer becomes the focus layer, and in any area of ​​the focus layer, the total adjustable quantity instance value is used as a constraint to decode the focus layer. After optimization or decoding, the total active power of the focus layer and any area of ​​the next layer is obtained. In this way, optimization is performed layer by layer from top to bottom to the bottom layer. During optimization, the focus layer uses the highest precision model, and the lower layers of the focus layer use lower precision models. Assume that the Nth layer is the starting layer, and let n=N, and the following steps are included:

[0088] S131: Determine whether n is the top level, if so, jump to step S132, otherwise jump to step S133;

[0089] S132: The nth layer is the focus layer, and the nth layer model has the highest accuracy. The accuracy of the layers below n is lower, thus forming the future state model n. In the future state model n, existing algorithms are used to numerically optimize the instance values ​​of the adjustable quantities, including genetic algorithms, gradient descent direction propagation algorithms and their variants (preferred because the power grid is an inertial system), etc., to find the solution closest to the target in the adjustable quantities within a limited amount of computation. The instance value of the active adjustable quantity in the nth layer is used as the active indicator of the nth layer. In the nth layer, if the highest accuracy partition model of the n-1th layer is encoded as a super node with lower accuracy in the nth layer, the instance value of the active adjustable quantity of the super node is used as the instance value of the total active adjustable quantity in the corresponding area of ​​the n-1th layer. Jump to step 134.

[0090] S133: The total active adjustable quantity instance value of the area corresponding to the nth layer obtained at the n+1th layer is used as the active constraint of the area. The nth layer is the focus layer, with the highest accuracy in the nth layer, and the layers below the nth layer have lower accuracy, forming the future state model n. The instance value of the adjustable quantity in the future state model n is numerically optimized using existing algorithms, including genetic algorithms, gradient descent direction propagation algorithms, and their variants, to find the solution closest to the target in the adjustable quantity within a limited amount of computation. The active adjustable quantity instance value of the current layer is used as the active indicator of the current layer. For nodes in the current layer that are encoded as nodes in the lower layer, the instance value of the active adjustable quantity of the node is used as the total active adjustable quantity instance value of the corresponding area in the lower layer.

[0091] S134: n=n-1; determine whether n-1 is 0, if so, jump to step S135, otherwise jump to step S131;

[0092] S135: Output active power indicators of each layer;

[0093] S14: The time series of active indicators at each layer constitute the planning indicators;

[0094] S2: Execution, first determine the active power and then the reactive power. The plan has been optimized according to the target, and the instance value of the active and adjustable quantity of each adjustable device or adjustable point has been calculated in advance, which is called the index. However, the actual situation deviates from the plan. This deviation is transmitted to each adjustable device or adjustable point to correct the instance value of its adjustable quantity; the corrected active power is used as a parameter and brought into the current state model to optimize the reactive power of the model, including: for any partition, the optimization target 1 or the focus function is the cost of the total active power P fluctuation in the area. The purpose of the cost is to expect the P fluctuation to be as small as possible; the adjustable quantity in the area takes the planning index and we can get The value of the total active power P in this area is P1, P1 is called the predicted value, the actual active power at the current moment is P2, P2 is called the actual value, the difference between the actual value P2 and the predicted value P1 is used as the deviation, and the deviation is used as the loss function. Based on the current state model, numerical optimization algorithms such as gradient descent back propagation are used to adjust the adjustable quantity to correct the index so that the deviation is minimized and the instance value of each active adjustable quantity is obtained; then, the instance values ​​of these active adjustable quantities are used as constants and substituted into the current state of the power grid to perform reactive power optimization and obtain the instance value of the reactive adjustable quantity; the process of reactive power optimization after the active power is determined is an existing technology and will not be described here.

[0095] The adjustable quantity in the area is taken as the planning indicator, and the value of the total active power P of the area can be obtained as P1, which means that for any partition, according to the current moment t, the instance value of the adjustable quantity in the partition is the planning indicator pa plus the current correction pb, pa and pb correspond to the actual total active power P2 of the area, and then based on the current state model, according to P2 and pb, it can be estimated that the instance value of the adjustable quantity is the planning indicator pa, and the total active power value P1 of the area at this time; in addition, it also includes, as an example, performing estimation once every few seconds to 2 minutes, and planning to calculate a planning indicator frame every 0.5 to 2 hours. During the execution of S2, the estimated P1 during this period is statistically averaged and used as the P1 of the next one or more moments. At the next one or more moments, the difference between the actual value P2 and P1 is used as a deviation to correct the planning indicator; in addition, it also includes, during the execution of step S2, the estimated P1 during this period is statistically averaged as a scale, that is, the mean is used as one of the estimates of the next moment; and is fused with the current estimate (another scale) to obtain the optimal estimate as the P1 of the next one or more moments by multi-scale;

[0096] The encoding described in S12 in step S1 planning includes models encoded as precision 1 and precision 3. The encoding as precision 1 means encoding the model as a supernode, reducing the model's variables to 1, including self-scaling all X in the encoded object, reducing X to a 1-dimensional variable c, and substituting the new 1-dimensional variable c into the constraints and objective function to obtain a new objective function and constraints. In particular, a special c and adjustable variable x are used for devices that can charge and discharge.

[0097] Encoding with precision 2 means encoding the model as a supernode, reducing the number of model variables to M. This includes using p2, which has M variables, as dp. The p2 variable set C contains only M real variables, i.e., C = {c1, c2, c3…cM}. Similarly, substituting the new M-dimensional variable C into the constraints and objective function yields a new objective function and constraints.

[0098] Encoding as precision 3 means encoding the model as a super node, reducing the number of model variables to M3, including using p3 with M3 variables as dp, and the p3 variable set C contains only M3 real variables, that is, C={c1, c2, c3…cM3}. The difference from precision 2 is that the adjustable quantities in the node are divided into categories, and the adjustable quantities in each category are subdivided using a clustering algorithm. Each subcategory after clustering is self-standardized, and new constraints and objective functions are obtained in the same way. The basis for clustering includes classification according to typical charge and discharge rate curves. As an example, based on the current power and charge and discharge status, the future charge and discharge rate curves are estimated, and then the covariance of the two curves is calculated. The covariance value is the distance between the two curves.

[0099] In addition, the minimalist encoding structure and method in Example 2 and the Transformer coordination method in Example 4, which are used to obtain planning indicators in step S1 of the blue coordination method, are both preferred implementations. Minimal encoding is suitable for tasks with a lack of grid data and scarce computing and storage resources, while Transformer is suitable for tasks with abundant data and abundant computing and storage resources. Their characteristics can be vividly understood as extreme efficiency: a minimalist encoding structure and method; balance: the original blue coordination method; and extreme quality: a Transformer coordination method. Modes for Carrying Out the Invention

[0100] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obstructing the description of the present invention with unnecessary details. In addition to the best embodiment described, the embodiments of the present invention also include Examples 0, 2, 3, 4, 5, and 6.

[0101] Example 0

[0102] A coordination method 0, after obtaining power grid data, performs state estimation or Kalman filtering on the data to obtain optimal or relatively optimal power grid data, and determines a core network and its related power grids. The coordination method 0 includes the following steps:

[0103] Step 0: Modeling, obtaining the grid attribute model including network equations based on grid data;

[0104] Step 1: Planning. To plan energy storage or similar energy storage equipment, the model is expanded in time and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. They are arranged in chronological order to form a frame sequence, which becomes a discrete model time series. For any energy storage equipment, the energy storage change is obtained by multiplying the active adjustable quantity instance value x(t0) by the storage efficiency or discharge efficiency and integrating it over the time interval T. The energy storage change is added to the current storage quantity Wh(t0) to obtain the storage quantity Wh(t1) of the next frame. The active adjustable quantity X(t1) at time t1 is obtained from the storage quantity Wh(t1). Then, the instance value x(t1) of the adjustable quantity X(t1) is obtained according to the optimization target. This is done frame by frame in chronological order.

[0105] The predicted quantities of power grid data include historical values ​​for the same period. These quantities are imported into the model time series to form the future state model of the power grid. The variables in the future state model are adjustable quantities, including active adjustable quantities and reactive adjustable quantities. Since changing the adjustable quantities can affect the future state of the power grid, an objective function is established, and the instance values ​​of the adjustable quantities are numerically optimized using existing algorithms. Within a limited amount of computation, the solution closest to the target is found among the adjustable quantities. The active instance values ​​of the active adjustable quantities are used as active indicators and passed to step 2. Since the future state model of the power grid is a time series, the active indicators are also a time series, and any moment corresponds to one frame in the active indicator time series.

[0106] The objective function includes target 1 for grid balance, target 2 for optimizing one or more electrical quantities of the future grid, including reactive power and voltage, and target 3 for the price or cost of using adjustable quantities and stored electricity. Targets 1, 2, and 3 constitute the overall objective, and physics-based constraints are established, including that the active and reactive power of the same device that can provide both active and reactive power must comply with the physics-based constraints.

[0107] The grid balancing includes, for any zone, calculating the fluctuation amount based on the predicted sequence of active power P in that zone, taking the inverse of the fluctuation amount as target 1, in order to adjust the adjustable amount so that the fluctuation amount and the active power gap fluctuation amount are offset;

[0108] The price or cost of using the adjustable amount and the amount of stored electricity includes the cost of switching between the energy storage charging state and the energy storage discharging state;

[0109] When the adjustable measurement is used to obtain the planning indicator, the focus target value is the focus value, which can be obtained based on the model or based on actual measurement estimation, and the focus value is used as the tracking target; as an example, the focus target is target 1;

[0110] Step 2: Execute, use the current grid data to perform state estimation or Kalman filtering to obtain the optimal grid data, import it into the grid model, and become the current state of the grid;

[0111] The difference between the tracking target and the target value obtained in the current state is used as the deviation, and the deviation is used to correct the current frame of the indicator to obtain the instance value of each active adjustable quantity; then, these instance values ​​of active adjustable quantities are used as constants and substituted into the current state of the power grid to perform reactive power optimization and obtain the instance value of the reactive adjustable quantity. The process of reactive power optimization is not described in detail here.

[0112] The correction includes correcting the indicator according to the deviation and the network equation of the current power grid model to obtain a corrected active adjustable quantity instance value, that is, performing partial differentiation on each adjustable quantity, using the partial differential value as a distribution ratio, back-propagating the deviation to the instance value of each adjustable quantity, and adding the value transferred by the deviation to the instance power of each adjustable quantity to become the corrected active adjustable quantity instance value, so that the target value is changed and its deviation from the tracking target is 0;

[0113] The advantage is that in step 1, active and reactive power are optimized simultaneously. Unlike step 1, step 2 first determines the current active power based on the planned indicators, and then determines the reactive power. This optimizes the solution process and appropriately reduces the computational complexity. The disadvantage of coordination method 0 is that the simultaneous optimization of active and reactive power during planning leads to coupling of previously independent reactive power at each moment, resulting in a larger model. Furthermore, when adjusting branches with series capacitance or inductance, the assumption is that their impedance can always be optimized, so changes in the active power flowing through the branch have no effect on the reactive power injected into the node of that branch.

[0114] As an example, for coordination method 0, suppose there are n active adjustable quantities and m reactive adjustable quantities in the core and its related power grids, then the variables of the power grid model are n+m; in step 1 planning, consider the future state model of size(T) moments, whose variables are size(T) multiplied by n+m; due to principle 1, n+m will not be too small. For example, for distributed charging loads, energy storage and new energy, n+m is set to 10 million, size(T) is 96, then the number of variables is 960 million, close to 1 billion; assuming that each adjustable quantity has 128 levels of adjustment, it is necessary to find the optimal solution or a better solution among 128 billion possible solutions. Even if each adjustable quantity has 2 levels of adjustment, it is still 2 billion; with such calculation, coordination method 1 cannot be solved; it is inevitable to reasonably simplify the model.

[0115] The invention application provides a coordination method 02 for obtaining grid data, performing state estimation or Kalman filtering on the data, and obtaining optimal grid data. The coordination method 02 is characterized by comprising the following steps:

[0116] Step 1: Initially, for nodes or devices with both adjustable active and reactive power, the adjustable active and reactive power are constrained by limited apparent power. The adjustable active power is not fully generated, and a small amount is reserved for reactive power. Experienced default values ​​are substituted into the dedicated parallel reactive power regulation equipment to become constraints on the adjustable active power. These constraints include the reactive current generated by the parallel capacitor or inductor changing the line current, thereby changing the line's capacity for active current. Furthermore, the impedance of the branch connected in series with the capacitor or inductor can always be optimized, so that changes in the active power flowing through the branch have no effect on the reactive power injected into the node. Therefore, most of the reactive power in the coordination method 0, step 1, planning becomes constraints on the active power, and only the reactive power in a frame is retained.

[0117] Step 2: Execute coordination method 0 to obtain data for one cycle;

[0118] Step 3: Use the historical data of the reactive adjustable quantity instance value in the previous cycle to bring most of the reactive adjustable quantities planned in step 1 of coordination method 0 into the constraints on the active adjustable quantity, and only retain the reactive adjustable quantity in one frame;

[0119] Step 4: Execute coordination method 0 to obtain data for multiple cycles;

[0120] Step 5: Collect statistics on multiple reactive adjustable variable instance values ​​from the same historical period, and substitute the statistical features into most of the reactive adjustable variables planned in step 1 of coordination method 0 to become constraints on the active adjustable variable, retaining only the reactive adjustable variable in one frame;

[0121] Step 6: Execute coordination method 0 and jump to step 5;

[0122] It can be seen that the advantage of coordination method 02 is that only the reactive power and active power of one frame are optimized simultaneously during planning. The reactive power adjustable quantity of other frames is replaced by historical data and converted into constraints on active power. This historical data is solved by planning at other times. In this way, the planning calculation amount is evenly distributed to each time period. This practice is called reuse.

[0123] As an example, for coordination method 02, the grid model variables are also assumed to be n adjustable active power and m adjustable reactive power. In step 1, the variables are m + size(T) × n. For distributed charging loads, energy storage, and renewable energy, n is 5 million, m is 5 million, and size(T) is 96. This means the number of variables is reduced by 50% compared to coordination method 0.

[0124] Example 1

[0125] Figure 1 is a flowchart for implementing the blue coordination method. In Figure 1, after obtaining cleaned and optimized grid data through state estimation or Kalman filtering, the core network and its related grids are found according to Principle 3.3. The grid is then divided into zones and layers, or further subdivided. The blue coordination method includes the following steps:

[0126] Initialize, segment and divide the grid according to principles 3, 3.1 and 3.2, find the core network and its related grids, and divide the grid into zones and layers or perform unified zone and layer division;

[0127] S0: Modeling, grid model 0 is obtained based on grid data. Model 0 has the highest accuracy, including 4.5;

[0128] S1: Planning. Model 0 is expanded and discretized in time but not used directly. Instead, the model information is encoded layer by layer from bottom to top and then decoded from the core network from top to bottom to obtain planning indicators composed of time series of active indicators at each layer. The steps are as follows:

[0129] S11: Model 0 is expanded and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. The frames are arranged in chronological order to form a frame sequence, which becomes the model time series. The predicted quantity of the power grid data is imported into the model time series to form the future state model of the power grid. The variables in the future state model are adjustable quantities, including active adjustable quantities and reactive adjustable quantities. Since changing the adjustable quantities can have an impact on the future state of the power grid, the objective function is established in this way.

[0130] S12: Encode the future state model layer by layer from bottom to top to obtain the future state model with a precision of 3 at each layer and the original accuracy;

[0131] S13: The core network layer is the starting layer, and top-down optimization is performed, i.e., top-down decoding is performed. The core network layer is the focus layer, and the focus layer is decoded and optimized according to the objective function, i.e., numerical optimization is performed within a limited amount of computation to search for adjustable quantities, and an instance value of the adjustable quantity with the minimum objective function value or the value closest to the target is obtained. The instance value is used as the result of optimization or decoding, and the active power of the equipment in this layer and the total active power of the next layer partition corresponding to the super node are obtained, i.e., the total adjustable quantity instance value of the super node corresponding area is obtained. The next layer becomes the focus layer, and in any area of ​​the focus layer, the total adjustable quantity instance value is used as a constraint to decode the focus layer. After optimization or decoding, the total active power of the focus layer and any area of ​​the next layer is obtained. In this way, optimization is performed layer by layer from top to bottom to the bottom layer. During optimization, the focus layer uses the highest precision model, and the lower layers of the focus layer use lower precision models. Assume that the Nth layer is the starting layer, and let n=N, and the following steps are included:

[0132] S131: Determine whether n is the top level, if so, jump to step S132, otherwise jump to step S133;

[0133] S132: The nth layer is the focus layer, and the nth layer model has the highest accuracy. The accuracy of the layers below n is lower, thus forming the future state model n. In the future state model n, existing algorithms are used to numerically optimize the instance values ​​of the adjustable quantities, including genetic algorithms, gradient descent direction propagation algorithms and their variants (preferred because the power grid is an inertial system), etc., to find the solution closest to the target in the adjustable quantities within a limited amount of computation. The instance value of the active adjustable quantity in the nth layer is used as the active indicator of the nth layer. In the nth layer, if the highest accuracy partition model of the n-1th layer is encoded as a super node with lower accuracy in the nth layer, the instance value of the active adjustable quantity of the super node is used as the instance value of the total active adjustable quantity in the corresponding area of ​​the n-1th layer. Jump to step 134.

[0134] S133: The total active adjustable quantity instance value of the area corresponding to the nth layer obtained at the n+1th layer is used as the active constraint of the area. The nth layer is the focus layer, with the highest accuracy in the nth layer, and the layers below the nth layer have lower accuracy, forming the future state model n. The instance value of the adjustable quantity in the future state model n is numerically optimized using existing algorithms, including genetic algorithms, gradient descent direction propagation algorithms, and their variants, to find the solution closest to the target in the adjustable quantity within a limited amount of computation. The active adjustable quantity instance value of the current layer is used as the active indicator of the current layer. For nodes in the current layer that are encoded as nodes in the lower layer, the instance value of the active adjustable quantity of the node is used as the total active adjustable quantity instance value of the corresponding area in the lower layer.

[0135] S134: n=n-1; determine whether n-1 is 0, if so, jump to step S135, otherwise jump to step S131;

[0136] S135: Output active power indicators of each layer;

[0137] S14: The time series of active indicators at each layer constitute the planning indicators;

[0138] S2: Execution, first determine the active power and then the reactive power. The plan has been optimized according to the target, and the instance value of the active and adjustable quantity of each adjustable device or adjustable point has been calculated in advance, which is called the index. However, the actual situation deviates from the plan. This deviation is transmitted to each adjustable device or adjustable point to correct the instance value of its adjustable quantity; the corrected active power is used as a parameter and brought into the current state model to optimize the reactive power of the model, including: for any partition, the optimization target 1 or the focus function is the cost of the total active power P fluctuation in the area. The purpose of the cost is to expect the P fluctuation to be as small as possible; the adjustable quantity in the area takes the planning index and we can get The value of the total active power P in this area is P1, P1 is called the predicted value, the actual active power at the current moment is P2, P2 is called the actual value, the difference between the actual value P2 and the predicted value P1 is used as the deviation, and the deviation is used as the loss function. Based on the current state model, numerical optimization algorithms such as gradient descent back propagation are used to adjust the adjustable quantity to correct the index so that the deviation is minimized and the instance value of each active adjustable quantity is obtained; then, the instance values ​​of these active adjustable quantities are used as constants and substituted into the current state of the power grid to perform reactive power optimization and obtain the instance value of the reactive adjustable quantity; the process of reactive power optimization after the active power is determined is an existing technology and will not be described here.

[0139] The adjustable quantity in the area is taken as the planning indicator, and the value of the total active power P of the area can be obtained as P1, which means that for any partition, according to the current moment t, the instance value of the adjustable quantity in the partition is the planning indicator pa plus the current correction pb, pa and pb correspond to the actual total active power P2 of the area, and then based on the current state model, according to P2 and pb, it can be estimated that the instance value of the adjustable quantity is the planning indicator pa, and the total active power value P1 of the area at this time; in addition, it also includes, as an example, performing estimation once every few seconds to 2 minutes, and planning to calculate a planning indicator frame every 0.5 to 2 hours. During the execution of S2, the estimated P1 during this period is statistically averaged and used as the P1 of the next one or more moments. At the next one or more moments, the difference between the actual value P2 and P1 is used as a deviation to correct the planning indicator; in addition, it also includes, during the execution of step S2, the estimated P1 during this period is statistically averaged as a scale, that is, the mean is used as one of the estimates of the next moment; and is fused with the current estimate (another scale) to obtain the optimal estimate as the P1 of the next one or more moments by multi-scale;

[0140] The encoding described in S12 in step S1 planning includes models encoded as precision 1 and precision 3. The encoding as precision 1 means encoding the model as a supernode, reducing the model's variables to 1, including self-scaling all X in the encoded object, reducing X to a 1-dimensional variable c, and substituting the new 1-dimensional variable c into the constraints and objective function to obtain a new objective function and constraints. In particular, a special c and adjustable variable x are used for devices that can charge and discharge.

[0141] Encoding with precision 2 means encoding the model as a supernode, reducing the number of model variables to M. This includes using p2, which has M variables, as dp. The p2 variable set C contains only M real variables, i.e., C = {c1, c2, c3…cM}. Similarly, substituting the new M-dimensional variable C into the constraints and objective function yields a new objective function and constraints.

[0142] Encoding as precision 3 means encoding the model as a super node, reducing the number of model variables to M3, including using p3 with M3 variables as dp, and the p3 variable set C contains only M3 real variables, that is, C={c1, c2, c3…cM3}. The difference from precision 2 is that the adjustable quantities in the node are divided into categories, and the adjustable quantities in each category are subdivided using a clustering algorithm. Each subcategory after clustering is self-standardized, and new constraints and objective functions are obtained in the same way. The basis for clustering includes classification according to typical charge and discharge rate curves. As an example, based on the current power and charge and discharge status, the future charge and discharge rate curves are estimated, and then the covariance of the two curves is calculated. The covariance value is the distance between the two curves.

[0143] Example 2

[0144] FIG2 is a diagram of the encoding-decoding framework. In FIG2 , the core network is at layer 5. The bottom-up encoding and top-down decoding described in S12 and S13 of step S1 in Example 1 include the following steps:

[0145] Step 1: Encode from bottom to top: The bottom area of ​​Model 0 corresponds to a node in the upper layer. Encode the model data of this area and use it as the attribute of the node. Then delete this area. In this way, all the bottom areas are encoded and deleted to become Model 1. The bottom of Model 1 is the second layer of Model 0. Similarly, the bottom of Model 1 is encoded to become Model 2, the bottom of Model 2 is encoded to become Model 3, and Model 3 is encoded to become Model 4.

[0146] Step 2: Optimize from top to bottom: Optimize model 4 with target 5 as the optimization target, and solve for the instance values ​​of all adjustable variables in model 4, i.e., solution 5. Substitute solution 5 into model 3 to obtain a new model and related constraints, which is the decoded model of model 4. Similarly, with target 4 as the optimization target, the new model and related constraints are optimized to obtain solution 4 and the decoded model. In this way, optimization from top to bottom is carried out to obtain solutions 3, 2, and 1.

[0147] Step 3: Output the instance value of the adjustable quantity of each area and each layer;

[0148] Simply, according to Principle 1, the network loss optimization is eliminated from the optimization objectives. The remaining optimization objectives include the charging price cost, the electricity price income obtained from discharging, the cost of switching between the charging and discharging states, the charging and discharging cycle cost, the active power fluctuations of each area of ​​the power grid that need to be balanced and the corresponding rewards, the voltage nodes that need reactive power optimization and the corresponding rewards, and the constraints include the current carrying capacity safety limit of the line equipment and the Wh limit of the energy storage equipment. According to the optimization objectives, the corresponding objective function or loss function is obtained, and according to the constraints, the corresponding inequality group, i.e., the constraint conditions, is obtained. According to the reuse, most of the reactive adjustable quantities are substituted with constants. The number of variables related to reactive power in the objective function and constraints will be greatly reduced. In Figure 2, all decoding modules are deleted, and only the encoding module is retained. The simplified power grid data processing structure is used to solve the problem by combining the optimization objectives and constraints. At the same time, the model information is encoded and condensed into feature data. The problem is coded from bottom to top and solved by combining the objective function and constraints. The objective function constraints can be divided into two parts: objective function constraint 1 related to the layer of interest and objective function constraint 2 related only to other layers. The steps are as follows:

[0149] Initialization: Focus on the bottom layer

[0150] Step 1: Solve; the accuracy of the focus layer model is 4.5, and each zone of the focus layer is coordinated. The coordination refers to optimizing and solving each adjustable quantity in each zone according to the objective function constraint condition 1 to obtain the adjustable quantity instance value; based on the adjustable quantity instance value, calculate the remaining adjustable quantity of each device in each zone; substitute the adjustable quantity instance value and the remaining adjustable quantity into the objective function constraint condition, and update to obtain the new objective function constraint condition;

[0151] Step 2: Encoding: The remaining adjustable quantities are used as adjustable quantities, and all partitions within the focus layer are encoded as super nodes with precision 3, and the previous layer is used as the focus layer;

[0152] Step 3: Solve the problem in the same way as step 1 to obtain the instance values ​​of the adjustable variables in each area of ​​the focus layer, the remaining adjustable variables, and the updated objective function constraints. Encode them in the same way as step 2. Repeat this process from bottom to top, combining the optimization objectives and constraints to solve and encode them until the top layer is reached.

[0153] Step 4: Output the instance value of each layer's adjustable quantity, and then end;

[0154] The method is very simple. After eliminating grid loss optimization from the optimization objective, the reactive power is substituted with statistical features. The variables related to reactive power in the optimization objective and constraints are reduced to 0. The statistical features include average, maximum, and minimum values. For any area, the dp is dp = 1.06X and compressed to a precision of 3. The dp is dp = 1.06 (D1×c1+D2×c2+D3×c3+...DM3×cM3), and g(C) ≤ 0, C = {c1, c2, c3…cM3}.

[0155] This completely decouples active power optimization from grid topology. The grid loss F(X) in any zone is estimated using empirical values. For example, if the grid loss is 6% of X, then dp = 1.06X. The active power quantities within the zone are linearly related to each other and to dp, and are subject only to grid security and stability constraints. Furthermore, since optimization is performed from a local to global perspective, coordination always minimizes active power fluctuations in the local grid, rarely crossing the security and stability constraint boundaries. This further reduces reliance on grid data. Furthermore, reactive power optimization is decoupled from active power optimization, significantly reducing computational complexity.

[0156] Example 3

[0157] Figure 3 is a schematic diagram of a super node. The left side (31) of the figure is the information contained in the super node corresponding to the partition, and the right side (32) of the figure is the active power P and dp model structure of the super node. In the right side (32), dp is the active power related to the adjustable quantity X in the partition or super node, dp=ΣX+F(X), X is the set of adjustable quantities in the super node. If there are N adjustable quantities in the node, then X is expanded to X={X1, X2, X3...}N, and F(X) is the network loss caused by the adjustable quantity in the node. F(X) can be calculated based on the topological relationship in the node, device parameters, measurement data information, and adjustable quantity X, and is expanded to F(X) = F(X1,X2,X3...XN) =X T AX+BX+b; A is the time-varying parameter positive definite matrix, B is the time-varying parameter matrix, and b is the time-varying parameter vector;

[0158] The model accuracy of a partition on the left (31) is 4.5. The partition contains topology and equipment, including topological relationships, equipment parameters, and measurement data information. From the outside of the partition, the partition can be regarded as a super node. The node contains power Wh, active power P, reactive power Q, and constraint information. Reactive power Q is a constant. This is because according to Principle 4, reactive power is balanced locally. The reactive adjustable quantity only participates in the reactive balance within the partition, but not in the balance outside the partition. The power Wh can be obtained based on the time integral and initial moment value of the active power. The active power information includes the information of the power Wh. When necessary, the active power is used to calculate the power, so we only need to focus on the active power information. Active power P = dp + b, b is a constant, dp is the active power related to the adjustable quantity X in the node, dp = X + F(X), X is the set of adjustable quantities in the node. If there are N adjustable quantities in the node, then X is expanded to X = {X1, X2, X3...} N , F(X) is the network loss caused by the adjustable quantity in the node. According to the topological relationship in the node, equipment parameters, measurement data information, and adjustable quantity X, F(X) can be calculated and expanded into F(X)=F(X1,X2,X3...). The adjustable quantity X can also be divided into X according to reactive power adjustable quantity and active power adjustable quantity. Q and X P , that is, X={X Q , X P}, with the constraint g(X Q ,X P )<0, expand it into a set of constraint inequalities, and then reuse it according to Example 0. Most of X Q is a constant.

[0159] Example 1: The encoding described in S12 in step S1 planning refers to models encoded as precision 1 and precision 3; encoding as precision 1 means that all X are self-scaled, and X is reduced to 1 dimension, that is, X=c×x is substituted into X, c is a real number between 0 and 1, and x is the adjustable value of X, that is, the range size, which is expanded to X={c×x1, c×x2, c×x3...}N; X=c×x is substituted into F(X) to obtain F(X)=F(c×x), which is expanded to F(X)=F(c×x1, c×x2,, c×x3...); similarly, X=c×x is substituted into the objective function E(X) and the constraints and conditions to obtain E(c) and g(c)≤0; wherein a special c and adjustable value x are used for devices that can charge and discharge;

[0160] Precision 2 means that the model is encoded and the number of variables of the model is reduced to M. P2 with M variables is used as dp, and the nonlinearity of the power grid is not considered for the time being. The p2 includes dividing the adjustable quantities in the node into M categories, and standardizing the adjustable quantities in each category, that is, the adjustable quantities in each category are accumulated to form the total adjustable quantities of the category, so as to obtain M total adjustable quantities, which are D1, D2, D3...DM. Then

[0161] dp=p2=D⊙C+H2(C) and g(C)≤0

[0162] Where D⊙C=D1×c1+D2×c2+D3×c3+...DM×cM, H2(C)=F(c1×D1, c2×D2, c3×D3...cM×DM); then use the constraint g(X)≤0 to modify the same type of D, and list the constraints involving different D to form new constraints. All new constraints form the constraint g(C)≤0; for example, in g(X)≤0, there is an inequality X1+X2+bias≤0, X1 is divided into category 1, X2 is divided into category 2, and X1 and X2 do not belong to the same category. Substituting X1=c1×d1 and X2=c2×d2 into the inequality, we get a new inequality, that is, c1×d1+c2×d2+biaS≤0, and this new inequality is the new constraint; finally, substituting it into the objective function, we get E(C)

[0163] The p2 variable set C obtained in this way has only M real variables, that is, C={c1, c2, c3…cM}

[0164] Precision 3 means encoding the model, reducing the number of model variables to M3. There are only M3 real variables in the p3 variable set C, that is, C={c1, c2, c3…cM3}. The difference from precision 2 is that the adjustable quantities in the node are divided into categories, and the adjustable quantities in each category are subdivided using a clustering algorithm. Each subcategory after clustering is self-standardized. Similarly, dp=p3=D⊙C+H3(C) and g(C)≤0; the basis for clustering includes classification according to typical charge and discharge rate curves. For example, based on the current power and charge and discharge status, the future charge and discharge rate curves are estimated, and then the covariance of the two curves is calculated. The covariance value is the distance between the two; there are only M3 real variables in the p3 variable set C, that is, C={c1, c2, c3…cM3}

[0165] The charge and discharge rate curve refers to the charge and discharge current / rated capacity to standardize the charge and discharge curve. For example, when a battery with a rated capacity of 100A·h is discharged at 20A, its discharge rate is 0.2;

[0166] Example 4

[0167] Figure 4 is a diagram of the Transformer framework for coordination. In Figure 4, the A and B matrices are the active P = X of the partition. T The A and B matrices in AX + BX + b; for power grid data, the following steps are included:

[0168] Step 1: Data embedding: Encoding grid data. Nodes are coded according to attributes such as type, voltage level, active / reactive power, adjustable capacity, and ID. Node types include common nodes, adjustable capacity nodes, super nodes, branches, and special branches. The type is coded as 1 for common nodes, 2 for super nodes, 3 for adjustable capacity nodes, and so on.

[0169] Step 2: Encoding time and position. Each frame of power grid data is sorted by time, or its sequence number is position-encoded. The encoded position information is added to the corresponding frame and then input into the Transformer, or initially input into the decoder's adjustable nodes with IDs. The Transformer outputs the target frame. If the Transformer is not trained, the target frame is invalid.

[0170] To train the Transformer, the adjustable variable instance value frame sequence obtained in Example 1 and the corresponding power grid data frame sequence form the input and output pair training data. The Transformer network can be trained by minimizing the loss function, which is defined as the deviation between the output and the training data plus the cross entropy. Algorithms such as backpropagation, gradient descent, and Adam are used to optimize the training process. After training, the valid target frame sequence can be obtained by following steps 1 and 2.

[0171] This achieves a fully automated encoding-decoding structure for grid coordination. The disadvantage is that the node capacity is limited. Therefore, according to Principle 1, the underlying grid model after partitioning and layering is compressed into a model with precision 1 or 2 and then input into the Transformer as grid data, which can greatly reduce the number of nodes.

[0172] Figure 5 is a diagram of the GTransformer model framework for coordination. In Figure 5, the encoder part of the GTransformer is composed of G-Trm encoding blocks 1, 2, 3, and 4 connected in series. G-Trm encoding block 1 is composed of M encoders G connected in series, where M is a minimum of 1. Encoder G is an encoder that uses the G attention mechanism and includes the following steps:

[0173] Step 1: Data embedding: Treat branches and nodes as different types of nodes and organize the power grid model data into a unified format with type codes and related attributes. Type codes include common nodes, adjustable nodes, super nodes, branches, and approximate branches, with common nodes being 1, super nodes being 2, adjustable nodes being 3, and so on. Approximate branches are used to indicate that the specific connection between nodes cannot be determined, but their final connection relationship can be determined.

[0174] Step 2: One-dimensional encoding of the time series. Each frame of power grid data is sorted by time, its sequence number is position-encoded, and the spatial position is determined by index (reference);

[0175] Step 30: After embedding the power grid data into Embedding, add it to the temporal code and input it into the G-Trm encoding block 1 of GTransformer;

[0176] Step 31: In the G-Trm encoding block 1, the sampling points and their related nodes are determined based on the division of the first layer of the power grid and the connection relationship between the first layer and the second layer. That is, in any area of ​​the first layer of the power grid, the nodes that are connected to the second layer of the grid are used as sampling points. The sampling points are related to all nodes in the area and are independent of all nodes outside the area. Then, based on the sampling points and their related nodes, the G attention mechanism is performed to calculate and update the vector value corresponding to the node, and pass it to the upper layer encoder G. This is repeated M times and passed to the G-Trm encoding block 2.

[0177] Step 32: Similarly, encoding block 2 determines the sampling points and their related nodes based on the division of the second layer of the power grid and the connection relationship between the second layer and the third layer. Then, the G attention mechanism is calculated based on the sampling points and their related nodes, and the vector value corresponding to the node is updated and passed to the upper encoder G. This is repeated multiple times and passed to G-Trm encoding block 3;

[0178] Step 33: Similarly, it is passed to G-Trm encoding block 4... until the core power grid layer is located, completing the entire GTransformer encoding process;

[0179] Step 4: GTransformer's decoder and its decoding process are exactly the same as traditional Transformer decoding;

[0180] Step 5: GTransformer outputs the target frame. If the Transformer is not trained, the target frame is invalid, otherwise it is valid. In the example, the target frame is the instance value frame of the adjustable quantity at each adjustable point at each moment.

[0181] Training: The adjustable variable instance value frame sequence obtained in Example 1 and the corresponding power grid data frame sequence are combined into input and output pairs of training data to train GTransformer. The training process and algorithm are exactly the same as those of traditional Transformer training, including: After training, a valid target frame sequence can be obtained by following steps 1 to 7;

[0182] In this way, a fully automated encoding-decoding structure for power grid coordination is achieved. The disadvantage is that it is limited by the maximum number of nodes or vectors that can be accommodated by attention calculation. Therefore, according to Principle 1, the underlying power grid model after partitioning and layering is compressed into a model with precision 1 or 2 and then input into GTransformer as new power grid data, which can greatly reduce the number of distributed device nodes.

[0183] Example 5

[0184] Figure 6 is a schematic diagram of the coordination unit system structure. In Figure 6, the first floor is 220V, 380V with 5 partitions, the second floor is 10kV with 2 partitions, and the third floor is 110kV with only one partition. The coordination unit is an aggregation processing node composed of a processor, a memory, a communication, and a power supply module. The memory stores a computer program. When the computer program is executed by the processor, the steps in the above coordination method embodiment are implemented, including that each partition has a coordination unit, which is responsible for aggregating and filtering the data collected by all terminal devices in the partition and the data encoded by the lower-layer coordination unit, and then encoding the data and transmitting the encoded data to the upper layer through the signal channel; at the same time, receiving the data from the upper layer, After data is decoded, it is transmitted to each terminal device in the zone and the coordination unit at the lower level. Thus, a single coordination unit integrates both the encoding and decoding of the zone. Terminal devices include electric vehicles with adjustable quantities, energy storage, new energy power supplies, and common load devices. Specifically, the control method of common power generation equipment differs from the coordinated control method of the proposed invention at the execution layer. If the control system or controller of a common power generation device lacks an exchange interface with the coordination unit, it cannot be executed as an adjustable quantity in blue coordination. Typically, its adjustable quantity is not collected in planning. Even if the adjustable quantity is obtained, the obtained time series of the adjustable quantity instance value is only used as a power generation recommendation.

[0185] Example 6

[0186] Figure 7 is a schematic diagram of the coordination unit. As shown in Figure 7, one embodiment of the proposed invention provides a coordination unit 7, which includes a processor 70, a memory 71, and a computer program 72 stored in memory 71 and executable by processor 70. When processor 70 executes computer program 72, it implements the steps described in the various blue coordination method embodiments, such as the steps shown in Figure 1. Alternatively, when processor 70 executes computer program 72, it implements the functions of the modules / units in the various system embodiments described above, such as the functions of the modules shown in Figures 2 and 5.

[0187] Exemplarily, computer program 72 may be divided into one or more modules / units, one or more of which are stored in memory 71 and executed by processor 70 to implement the present invention. One or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of computer program 72 in power distribution terminal 7.

[0188] The coordination unit 7 may be a mobile phone, an MCU, an ECU, an industrial computer, etc., without limitation herein. The server may be a physical server, a cloud server, etc., without limitation herein. The coordination unit 7 may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that FIG7 is merely an example of the coordination unit 7 and does not constitute a limitation on the coordination unit 7. The coordination unit 7 may include more or fewer components than shown, or a combination of certain components, or different components. For example, the coordination unit may also include input and output devices, network access devices, buses, etc.

[0189] The processor 70 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0190] Memory 71 can be an internal storage unit of coordination unit 7, such as the coordination unit's hard drive or memory. Memory 71 can also be an external storage device of coordination unit 7, such as a plug-in hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard equipped with coordination unit 7. Furthermore, memory 71 can include both the coordination unit's internal storage unit and an external storage device. Memory 71 is used to store computer programs and other programs and data required by the coordination unit. Memory 71 can also be used to temporarily store data that has been output or is about to be output.

[0191] Memory 71 can be an internal storage unit of the coordination unit, such as the coordination unit's hard drive or memory. Memory 71 can also be an external storage device of the coordination unit, such as a plug-in hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, or FlashCard. Furthermore, memory 71 can include both the coordination unit's internal storage unit and an external storage device. Memory 71 is used to store computer programs and other programs and data required by the coordination unit. Memory 71 can also be used to temporarily store data that has been output or is about to be output.

[0192] The embodiment of the invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned blue coordination method embodiment are implemented.

[0193] A computer-readable storage medium stores a computer program 72, which includes program instructions. When executed by the processor 70, the program instructions implement all or part of the process steps in the above-described method embodiments. Alternatively, the computer program 72 can instruct related hardware to perform the process steps. The computer program 72 can be stored in a computer-readable storage medium. When executed by the processor 70, the computer program 72 can implement the steps of each of the above-described method embodiments. The computer program 72 includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. Computer-readable media can include any entity or device capable of carrying computer program code, recording media, USB flash drives, removable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.

[0194] The computer-readable storage medium may be the internal storage unit of the coordination unit of any of the aforementioned embodiments, such as the hard disk or memory of the coordination unit. The computer-readable storage medium may also be an external storage device of the coordination unit, such as a plug-in hard disk equipped on the coordination unit, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. Furthermore, the computer-readable storage medium may also include both the internal storage unit and the external storage device of the coordination unit. The computer-readable storage medium is used to store computer programs and other programs and data required by the coordination unit. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output. It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the invention.

[0195] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0196] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant description of other embodiments.

[0197] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the invention.

[0198] In the embodiments provided herein, it should be understood that the disclosed devices / coordination units and methods may be implemented in other ways. For example, the device / coordination unit embodiments described above are merely illustrative. For example, the division of modules or units is merely a logical functional division, and actual implementations may employ other divisions, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interface, or the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms.

[0199] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, the functional units in the various embodiments of the proposed invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware or in the form of software functional units.

[0200] If the integrated module / unit is implemented as a software functional unit and sold or used as a standalone product, it can be stored in a computer-readable storage medium. Based on this understanding, the invention can implement all or part of the process steps in the above-mentioned method embodiments by using a computer program to instruct the relevant hardware. The computer program can be stored in a computer-readable storage medium. When executed by a processor, the computer program can implement the steps of each of the above-mentioned method embodiments. The computer program includes computer program code, which can be in source code form, object code form, executable file, or some intermediate form. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, mobile hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media.

[0201] The above embodiments are only used to illustrate the technical solutions of the proposed invention, rather than to limit it. Although the proposed invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the proposed invention, and should all be included in the scope of protection of the proposed invention. Industrial Applicability

[0202] Example 1, the first aspect of the embodiment of the proposed invention, a blue coordination method, solves the problem of reasonable segmentation of the entire network. Without increasing the amount of computation, it resolves the conflict between local optimization and overall optimization caused by division into multiple partitions. The computational complexity of network-wide coordination is reduced from the nth power of a positive number to the product of n and the number (n is the number of partitions), and there are no side effects. The side effect refers to the fact that after the entire network is reasonably segmented into the core network, further partitioning and layering are performed, which greatly reduces the computational complexity and makes network-wide coordination possible. However, the division into multiple partitions causes a contradiction between local optimization and overall optimization, which is difficult to reconcile.

[0203] Example 2: The blue coordination method focuses its demand for computing and storage resources on the planning of step S1, and greatly simplifies the planning of step S1 to obtain a minimalist encoding structure and method. This method takes absorption and balance as the primary purpose and is suitable for tasks with scarce computing resources, scarce power grid data or no power grid data. Only one server can coordinate the entire core network, and several servers can achieve full network coordination and full network balance, which is extremely valuable.

[0204] Example 4: The encode-decode structure in step S1 planning of the blue coordination method is highly similar to that of Trm. Inspired by this, the Trm artificial intelligence framework is used for coordination. The intelligent learning blue coordination designs a set of power grid data encoding and decoding algorithms for coordination. It can discover model features that are effective for coordination but difficult to find, and use these features to improve the optimization effect. It is suitable for tasks with rich data, computing, and storage resources, and has great potential.

[0205] Example 4: The improved G attention mechanism optimizes the attention calculation based on the pyramid-like or tree-like partitioned hierarchical structure of the power grid, greatly reducing the amount of computation.

[0206] Reuse resolves the future state model in the blue coordination method planning, reduces the number of adjustable quantities in the planning solution, and greatly reduces the amount of calculation required for the solution. However, it is only used for reactive adjustable quantities, and its use for active adjustable quantities is still under study or improvement. Specifically, in Example 0, a coordination method 0 is reused to become coordination method 02. When planning, coordination method 0 needs to solve the adjustable quantities in the frames of all future moments. Coordination method 02 only solves the adjustable quantities of one frame, and the adjustable quantities of other frames are replaced by historical data. These historical data are solved by the planning at other moments. In this way, the amount of calculation is evenly distributed to each time period, which has the advantage of reducing a large number of calculations. However, when there is energy storage in the power grid, the active adjustable quantities at each moment are tightly coupled, while the reactive quantities at each moment are not coupled. Therefore, the proposed patent reuses the reactive adjustable quantities, and the reuse of the active adjustable quantities is still under study or improvement.

[0207] The planning in step S1 is based on the prediction. Since the prediction is inaccurate, it is corrected in combination with the immediate or real-time situation when step S2 is executed. For the origin, evolution process and related examples of the correction method, please refer to "A Method for Harmonizing New Energy and Electric Vehicle Access to the Grid" (Chinese Patent CN111463822A, 2019.01.21), "A Blue Charging Method" (Chinese Patent 2023100768994, 2023.01.10), and "A Coordination Method" (Chinese Patent 2023106042789, 2023.05.18), which will not be repeated here. Sequence Listing Free Content

[0208] none

Claims

1. A blue coordination method, characterized in that: The steps include: Initialize, segment and divide, segment the power grid according to principles 3, 3.1 and 3.2, find the core network and its related power grids, and divide the power grid into zones and layers or perform unified zone and layer division; S0: Modeling, grid model 0 is obtained based on grid data. Model 0 has the highest accuracy, including 4.5; S1: Planning, Model 0 is expanded and discretized in time but is not used directly. Instead, the model information is encoded layer by layer from bottom to top, and then decoded from the core network from top to bottom to obtain the planning indicators composed of the time series of active indicators of each layer; The steps include: S11: Model 0 is expanded in time and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames, which are arranged in time order to form a frame sequence, which becomes a model time series; the predicted amount of power grid data is imported into the model time series to become a future state model of the power grid, and the model has the highest accuracy; the variables in the future state model are adjustable quantities, and the adjustable quantities include active adjustable quantities and reactive adjustable quantities; since changing the adjustable quantities can have an impact on the future state power grid, the objective function is established in this way; S12: Encode the future state model layer by layer from bottom to top to obtain the future state model with lower precision at each layer and the original precision; S13: The core network layer is the starting layer, and top-down optimization means top-down decoding; The core network layer is the focus layer. The focus layer is decoded and optimized according to the objective function, that is, the adjustable quantity is numerically optimized and searched within a limited amount of calculation to obtain the instance value of the adjustable quantity with the minimum objective function value or the closest to the target. The instance value is used as the result of optimization or decoding to obtain the active power of the equipment in this layer and the total active power of the next layer partition corresponding to the super node, that is, the instance value of the total adjustable quantity in the area corresponding to the super node; The next layer becomes the attention layer. In any area of ​​the attention layer, the total adjustable instance value is used as a constraint to decode the attention layer. After optimization or decoding, the total active power of the attention layer and any area of ​​the next layer is obtained. In this way, optimization is performed layer by layer from top to bottom to the bottom layer. When optimizing, the attention layer uses the highest precision model, and the lower layer of the attention layer uses a lower precision model. Assume that the Nth layer is the starting layer, let n=N, and include the following steps: S131: Determine whether n is the top layer, if so, jump to step S132, otherwise jump to step S133; S132: The nth layer is the focus layer, the nth layer model has the highest accuracy, and the accuracy below the nth layer is relatively low, thus forming the future state model n; the existing algorithms are used to numerically optimize the instance values ​​of the adjustable quantities in the future state model n, including genetic algorithms, gradient descent directional propagation algorithms and their variants (preferred because the power grid is an inertial system), etc., to find the solution closest to the target in the adjustable quantities within a limited amount of calculation; the instance values ​​of the active adjustable quantities of the nth layer are used as the active indicators of the nth layer; in the nth layer, if the n-1th layer high-precision partition model is encoded into a n-th layer low-precision super node, the instance value of the active adjustable quantity of the super node is used as the instance value of the total active adjustable quantity of the corresponding area of ​​the n-1th layer; Jump to step 134; S133: the total active adjustable quantity instance value of the n-layer corresponding area obtained by the n+1 layer is used as the active constraint of the area, the n-layer is the focus layer, the n-layer has the highest accuracy, and the layers below the n-layer have lower accuracy to form the future state model n; the instance value of the adjustable quantity is numerically optimized by using existing algorithms in the future state model n, including genetic algorithms, gradient descent direction propagation algorithms and their variants, etc., to find the solution closest to the target in the adjustable quantity within a limited amount of calculation; The active instance value of the active adjustable quantity of this layer is used as the active index of this layer; for the nodes of this layer that are coded as nodes of this layer by the lower layer area, the active adjustable quantity instance value of this node is used as the total active adjustable quantity instance value of the corresponding area of ​​the lower layer; S134: n=n-1; determine whether n-1 is 0, if so, jump to step S135, otherwise jump to step S131; S135: output active indicators of each layer; S14: The time series of active indicators of each layer constitute the planning indicators; S2: Execution. The active power is determined first and then the reactive power. The plan has been optimized according to the target, and the instance values ​​of the active and adjustable quantities of each adjustable device or adjustable point have been calculated in advance, which are called indicators. However, the actual situation deviates from the plan. This deviation is transmitted to each adjustable device or adjustable point, and the instance values ​​of its adjustable quantities are corrected. The corrected active power is used as a parameter and brought into the current state model to optimize the reactive power of the model, including: for any partition, the optimization target 1 or the focus function is the cost of the total active power P fluctuation in the area, and the purpose of the cost is to minimize the expected P fluctuation; If the planning index is taken for the adjustable quantity in the area, the value of the total active power P in the area can be obtained as P1, where P1 is called the predicted value. The actual active power at the current moment is P2, where P2 is called the actual value. The difference between the actual value P2 and the predicted value P1 is taken as the deviation. The deviation is taken as the loss function. Based on the current state model, numerical optimization algorithms such as gradient descent back propagation are used to adjust the adjustable quantity to correct the index so that the deviation is minimized, and the instance values ​​of each active adjustable quantity are obtained. Then, the instance values ​​of these active adjustable quantities are taken as constants and substituted into the current state of the power grid for reactive power optimization to obtain the instance values ​​of the reactive adjustable quantities.

2. A blue coordination method according to claim 1, characterized in that: Step S1: Model 0 is simplified by using the Reuse method, which includes the following steps: Step 1: Initially, a small amount of reactive power is reserved; the default value of experience is substituted into the dedicated parallel reactive power regulation equipment to become the constraint on the adjustable amount of active power, and most of the reactive power adjustable amount of model 0 in the planning of the blue coordination method described in claim 1 becomes the constraint on active power, and only the reactive power adjustable amount in one frame is retained; Step 2: Execute the blue coordination method described in claim 1 to obtain data of one cycle; Step 3: Use the historical data of the reactive adjustable quantity instance value of the previous cycle to bring most of the reactive adjustable quantities in the planning of the blue coordination method described in claim 1 into constraints on the active adjustable quantity, and only retain the reactive adjustable quantity in one frame; Step 4: Execute the blue coordination method of claim 1 to obtain data of multiple cycles; Step 5: Count the reactive adjustable quantity instance values ​​of multiple historical periods, substitute the statistical features into most of the reactive adjustable quantities in step S2 of the blue coordination method of claim 1, and turn them into constraints on the active adjustable quantity, and only retain the reactive adjustable quantity in one frame; Step 6: Execute the blue coordination method described in claim 1 and jump to step 5.

3. A blue coordination method according to claims 1 and 2, characterized in that: The model information is encoded layer by layer from bottom to top and then decoded from top to bottom in the core network in step S1, including an encoding-decoding structure and method, characterized in that it includes a structure in which multiple encoding modules are connected in series and multiple decoding modules are connected in series, the number of encoding and decoding modules is consistent with the number of model layers, the model is passed as input to the encoding module of the first layer, and the multiple encoding modules encode the model data in layers for multiple times and then pass it to the decoding modules of the corresponding layers for layered decoding, so as to obtain the instance values ​​of the adjustable quantities of each layer; each encoding module encodes the bottom layer of the model by encoding the original model into a lower-precision code.

4. A minimalist encoding structure and method, used in step S1 of the blue coordination method described in claims 1 and 2 to implement layer-by-layer encoding of model information from bottom to top while solving planning indicators; characterized in that: Including, in the encoding-decoding structure, all decoding modules are deleted, and only the encoding module is retained, with an encoding accuracy of 1 or 3. According to principle 1, when encoding from the local to the whole, from bottom to top and solving in combination with the objective function and constraint conditions, active network loss optimization is not considered, and only grid security and stability constraints are considered; in addition, after eliminating network loss optimization from the optimization target, the reactive adjustable quantity is substituted with statistical characteristics or experience or default values, and the variables related to reactive power in the optimization target and constraint conditions are reduced to 0; In this way, active power optimization is completely decoupled from the grid topology, that is, the network loss F(X) in any area is estimated using empirical values, and the active quantities in the area are linearly related to each other and to dp, and are only subject to the safety and stability constraints of the grid; and because the optimization is carried out from the local to the whole, the active power fluctuation of the local grid is always reduced during coordination, and the safety and stability constraint boundaries are rarely touched, which further reduces the dependence on grid data, and the reactive power optimization is decoupled from the active power optimization, which greatly reduces the amount of calculation; it is easy to prove that the structure and method are the methods with the highest utilization rate of adjustable quantities, and can maximize the value of adjustable equipment such as energy storage; after the active power optimization is completely decoupled from the grid topology, and the reactive power optimization is decoupled from the active power optimization, reactive power optimization can be performed according to the grid data, or it can be independent of the grid topology. Reactive power optimization can adopt an on-site mode, and reactive power balance can be achieved at the access point where the reactive adjustable equipment is located.

5. A method for applying Transformer to coordination and an improved G attention mechanism, used in the blue coordination method step S1 of claims 1 and 2 to implement model information encoding layer by layer from bottom to top, and then decoding from top to bottom from the core network; characterized in that: It includes dividing the power grid into layers, encoding the bottom layer with precision 1, 2 or 3 as new power grid data, and inputting the new power grid data into Transformer; it also includes a GTransformer, which is a Trm model based on the G attention mechanism; the G attention mechanism means that the point q corresponds to the vector z q , the total point set is {z q }; The sampling point k belongs to {z q } corresponds to z k , there is an update z for sampling point k k = G-Attn(z k ,{z} k ), {z} k Yes q }, the vector set corresponding to the point set related to the sampling point, G-Attn(z k ,{z} k ) = self-Attn(z k ,{z} k ), self-Attn({points}) means including, calculating and updating the Self-Attention mechanism for the point set {points} in the brackets; the sampling point k is an important node, including the important nodes determined according to the partition hierarchical structure, and also including the important nodes determined according to the unified partition hierarchical structure.

6. A grid segmentation, division principle or criterion suitable for grid coordination, characterized in that: Including unified partitioning and hierarchical division.

7. A coordination unit, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the blue coordination method described in any one of claims 1 to 5 are implemented.

8. A coordination system, characterized in that: Including, the coordination units described in claim 7 are arranged according to the division of the power grid, one coordination unit is responsible for one area, each coordination unit is responsible for aggregating and cleaning the data collected by all terminal devices in the area and the data encoded by the lower-level coordination units, and then encoding the data, and transmitting the encoded data to the upper layer through the signal channel; at the same time, receiving the data from the upper layer, decoding the data, and passing it to each terminal device in the area and the lower-level coordination unit; one coordination unit integrates both the encoding and decoding parts of the area.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the blue coordination method described in any one of claims 1 to 5 are implemented.

10. A coordination method 0, characterized in that: The steps include: Step 0: Modeling, obtaining the grid attribute model based on the grid data, including network equations; Step 1: Planning. To plan energy storage or similar energy storage equipment, the model is expanded in time and discretized in time. The model corresponding to a certain moment is a frame, and multiple moments correspond to multiple frames. They are arranged in time order to form a frame sequence, which becomes a discrete model time series. The predicted amount of power grid data is imported into the discrete model time series to become a discrete future state model of the power grid. In this way, the objective function is established, and the instance value of the adjustable quantity is numerically optimized using the existing algorithm. Within the limited amount of calculation, the solution closest to the target in the adjustable quantity is found. The active instance value of the active adjustable quantity is used as the active indicator and passed to step 2. Step 2 selects a part of the objective function as the focus target of step 2. When the planning indicator is substituted into the adjustable quantity, the focus target value is taken as the focus value. Step 2: Execute, import the current power grid data or the optimal data after cleaning into the power grid model to become the current state of the power grid; or you can also get the focus value based on the actual measurement estimate, and use the focus value as the tracking target; the difference between the tracking target and the focus target value obtained in the current state is used as the deviation, and the deviation is used to correct the current frame of the indicator to obtain the instance value of each active adjustable quantity; then, the instance values ​​of these active adjustable quantities are used as constants, substituted into the current state of the power grid, and reactive power optimization is performed to obtain the instance value of the reactive adjustable quantity.

Citation Information

Patent Citations

  • Stability analyzing and optimizing method suitable for layering and zoning of ultra-high voltage electric network

    CN103050970A

  • DC power distribution network control method and device, electronic equipment and storage medium

    CN114566995A

  • Construction method of coordinated optimization model and power distribution network planning method

    CN115276111A

  • Network security situation prediction method and system based on Transformer-CNN model and application of network security situation prediction method and system

    CN116346392A

  • Modeling system for energy systems

    US20170077701A1

Cited By

  • Smart park energy management method and system

    CN121395421A