Training method and device of united network cluster for micro-grid energy management

By employing an asynchronous iterative training method with a joint network cluster, the problem of neural networks struggling to converge and getting trapped in local optima in microgrid energy management is solved, achieving faster training speed and more efficient energy management results.

CN120956618APending Publication Date: 2025-11-14CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511171782.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-20
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Neural network-based microgrid energy management methods are difficult to converge in complex environments, are prone to getting stuck in local optima, and have slow training speeds, which affect the actual energy management effect.

Method used

An asynchronous iterative training method using joint network clusters is adopted. By asynchronously uploading gradients and updating parameters of parent and child joint networks, and by processing historical data with forgetting and fusion matrices, the temporal features of microgrid feature vectors and the determination of control vectors are realized. The network parameters are optimized using objective and error functions.

Benefits of technology

It accelerates the convergence speed of neural networks, avoids getting trapped in local optima, and improves the training efficiency and effectiveness of microgrid energy management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120956618A_ABST
    Figure CN120956618A_ABST
Patent Text Reader

Abstract

The invention discloses a training method and device of a united network cluster for micro-grid energy management. The method comprises the following steps: acquiring a historical data sequence; performing asynchronous iterative training on a parent joint network and a plurality of sub joint networks of the joint network cluster according to the historical data sequence, wherein each sub joint network uploads a gradient to the parent joint network every preset iteration round in the iterative training process; after the gradient uploaded by any child joint network is received in the iterative training process of the parent joint network, network parameters of the parent joint network are updated at least according to the gradient, and the iterative training process of the parent joint network is continuously executed by using the updated network parameters; and when the average error difference after any round of iterative training of the parent joint network is finished is smaller than a preset error threshold value, stopping the iterative training of the parent joint network and the child joint network. According to the invention, a technical problem that a micro-grid energy management network based on a neural network is difficult to converge or is liable to fall into local optimum in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microgrids, and more specifically, to a training method and apparatus for a joint network cluster for microgrid energy management. Background Technology

[0002] With the transformation of the global energy structure and the booming development of distributed energy resources, microgrids are playing an increasingly prominent role as a crucial component in realizing the energy internet. Microgrids not only support energy self-sufficiency for local loads but also promote the efficient allocation and utilization of energy through grid connection with the main grid. However, while rapidly responding to consumer demand and achieving optimal energy allocation, microgrid management systems face significant challenges, such as ensuring efficient and coordinated operation of equipment, reducing overall system operating costs, and addressing the complexity arising from uncertainties in energy demand and supply. Among related technologies, neural network-based microgrid energy management methods exhibit weak generalization ability. In the complex environment of microgrid energy management, due to high input-output dimensionality, insufficient utilization of input data, and inadequate exploration of the microgrid environment, neural networks struggle to converge or easily converge to local optima, and training speeds are slow, impacting the effectiveness of practical energy management.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a training method and apparatus for a joint network cluster for microgrid energy management, which at least solves the technical problem in related technologies that microgrid energy management networks based on neural networks are difficult to converge or are prone to getting trapped in local optima.

[0005] According to one aspect of the embodiments of this application, a training method for a joint network cluster for microgrid energy management is provided, comprising: acquiring a historical data sequence, wherein the historical data sequence contains feature vectors of the microgrid at multiple time steps; asynchronously iteratively training a parent joint network and multiple child joint networks of the joint network cluster based on the historical data sequence, wherein the joint network cluster includes multiple joint networks, the parent joint network is a pre-defined joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network, each child joint network uploading its gradient to the parent joint network every preset iteration round during the iterative training process; after receiving the gradient uploaded by any child joint network during the iterative training process of the parent joint network, updating the network parameters of the parent joint network at least according to the gradient, and continuing to execute the iterative training process of the parent joint network using the updated network parameters; when the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, stopping the iterative training of the parent joint network and the child joint networks, and determining the parent joint network after stopping the iterative training as the target network for microgrid energy management.

[0006] According to some embodiments of this application, obtaining historical data sequences includes: dividing the power units in a microgrid into uncontrolled energy sources, controlled energy sources, energy storage devices, loads, and the main grid, wherein uncontrolled energy sources are power generation devices whose power is uncontrollable or does not require control, controlled energy sources are power generation devices whose power is adjustable, loads include various types of electrical equipment, and the main grid is a power network connected to the microgrid; dividing a preset historical time period into multiple time steps, and determining the power of uncontrolled energy sources, the power of loads, the unit price of transactions between the microgrid and the main grid, and the state of charge of energy storage devices corresponding to each time step as the feature vector of the microgrid for that time step; and sorting the feature vectors of the microgrid for multiple time steps in chronological order to obtain the historical data sequence.

[0007] According to some embodiments of this application, the method further includes: determining the target control vector corresponding to each time step based at least on historical data sequences and an objective function, and multiple constraints of the objective function; sorting the multiple target control vectors in order of time steps from first to last to obtain a target control vector solution set, wherein the target control vector includes the power generation of the controlled energy source, the power traded between the microgrid and the main grid, and the charging and discharging power of the energy storage device.

[0008] According to some embodiments of this application, the parent joint network of the joint network cluster is trained iteratively for one round based on historical data sequences in the following manner: Step 1: Extract the temporal features of the historical data sequences through the sequence processing network of the parent joint network to obtain a temporal feature vector sequence, wherein the temporal feature vector sequence contains a temporal feature vector corresponding to each time step, and the parent joint network includes a sequence processing network, a regulation network, and an evaluation network; Step 2: Process the temporal feature vector sequence through the regulation network of the parent joint network to obtain a control vector corresponding to each time step; process the temporal feature vector of each time step through the evaluation network of the parent joint network. The process involves obtaining an estimate of the actual error at each time step, where the actual error is determined at least based on the corresponding control vector and the target control vector. After executing steps 1 and 2, the network parameters of the parent joint network are updated based on the error functions of the sequence processing network, the regulation network, and the estimate network. The error functions of the estimate network and the regulation network are determined at least based on the cumulative error and the estimate of the actual error at all time steps. The error function of the sequence processing network is determined based on the error functions of the estimate network and the regulation network. The cumulative error at each time step is determined at least based on the actual error at all time steps.

[0009] According to some embodiments of this application, the temporal feature vector corresponding to any time step is determined in the following way: the temporal feature matrix of the second time step is determined at least based on the forgetting matrix, the fusion matrix, and the temporal feature matrix of the first time step, and the last dimension of the temporal feature matrix of the second time step is determined as the temporal feature vector corresponding to the second time step. Here, the second time step is any time step other than the first time step in the historical data sequence, the first time step is the time step before the second time step in the historical data sequence, the forgetting matrix is ​​determined based on the historical data sequence, the weight parameters of the forgetting matrix, the bias parameters of the forgetting matrix, and the temporal feature matrix of the first time step, and the fusion matrix is ​​determined based on the historical data sequence, the weight parameters of the fusion matrix, the bias parameters of the fusion matrix, and the temporal feature matrix of the first time step.

[0010] According to some embodiments of this application, the control vector corresponding to any time step is determined in the following way: the target temporal feature vector in the temporal feature vector sequence is passed through the input layer of the control network to multiple intermediate layers of the control network, wherein the target temporal feature vector is the temporal feature vector corresponding to the target time step, and the target time step is any time step; the intermediate layer output result of the last intermediate layer among the multiple intermediate layers is passed to multiple output layers of the control network to obtain multiple output layer output results; the multiple output layer output results are sampled and scaled in multiple preset intervals to obtain the control vector corresponding to the target time step.

[0011] According to some embodiments of this application, the average error difference after any round of iterative training of the parent joint network is determined in the following way: at least based on the total number of iterations and the difference in the average error of any two adjacent iteration rounds in the total number of iterations, the average error difference of the parent joint network after the iterative training of the target iteration round is determined, wherein the iterative training of the target iteration round is any round of iterative training, the total number of iterations is the sum of the number of iterations before the iterative training of the target iteration round is executed, and the value of the total number of iterations is greater than or equal to 1.

[0012] According to another aspect of the embodiments of this application, a training device for a joint network cluster for microgrid energy management is also provided, comprising: an acquisition module for acquiring historical data sequences, wherein the historical data sequences contain feature vectors of the microgrid at multiple time steps; a training module for asynchronously iteratively training a parent joint network and multiple child joint networks of the joint network cluster based on the historical data sequences, wherein the joint network cluster includes multiple joint networks, the parent joint network is a pre-defined joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network, and each child joint network uploads its gradient to the parent joint network every preset iteration round during the iterative training process; an update module for updating the network parameters of the parent joint network at least according to the gradient after receiving the gradient uploaded by any child joint network during the iterative training process of the parent joint network, and continuing to execute the iterative training process of the parent joint network using the updated network parameters; and a determination module for stopping the iterative training of the parent joint network and the child joint networks when the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, and determining the parent joint network after stopping the iterative training as the target network for microgrid energy management.

[0013] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, wherein a program is stored in the non-volatile storage medium, wherein, when the program is running, the device where the non-volatile storage medium is located executes the above-mentioned training method for a joint network cluster for microgrid energy management.

[0014] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the above-described training method for a joint network cluster for microgrid energy management.

[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including computer instructions, which, when executed by a processor, implement the above-described training method for a joint network cluster for microgrid energy management.

[0016] In this embodiment, historical data sequences are acquired, containing feature vectors of the microgrid at multiple time steps. Asynchronous iterative training is performed on the parent joint network and multiple child joint networks of the joint network cluster based on these historical data sequences. The joint network cluster includes multiple joint networks, with the parent joint network being a pre-defined one among them. The child joint networks are all joint networks other than the parent joint network. Each child joint network uploads its gradient to the parent joint network every preset iteration interval during the iterative training process. Upon receiving a gradient uploaded by any child joint network during the iterative training of the parent joint network, the network parameters of the parent joint network are updated at least based on the gradient, and the iterative training process continues using the updated network parameters. The iterative training of both the parent and child joint networks is stopped when the average error difference after any iteration of the parent joint network's training is less than a preset error threshold. This paper proposes a method to determine the target network for microgrid energy management by identifying the parent joint network after iterative training has stopped. The method involves asynchronously training the parent joint network and multiple child joint networks within a joint network cluster. Each child joint network uploads its gradient to the parent joint network every preset iteration during training. While training itself, the parent joint network updates its network parameters based on each gradient received from the child joint networks, and then continues training with the new parameters. This accelerates convergence and avoids getting trapped in local optima. When the average error difference after any iteration of training of the parent joint network is less than a preset error threshold, the iterative training of both the parent and child joint networks is stopped, and the parent joint network after iterative training is identified as the target network for microgrid energy management. This solves the technical problem in related technologies where neural network-based microgrid energy management networks struggle to converge or easily get trapped in local optima. Attached Figure Description

[0017] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a hardware structure block diagram of a computer terminal for implementing a training method for a joint network cluster for microgrid energy management, according to an embodiment of this application.

[0019] Figure 2 This is a flowchart of a training method for a joint network cluster for microgrid energy management according to an embodiment of this application;

[0020] Figure 3This is a flowchart of another training method for a joint network cluster for microgrid energy management according to an embodiment of this application;

[0021] Figure 4 This is a schematic diagram of the structure of a training device for a joint network cluster for microgrid energy management, provided according to an embodiment of this application. Detailed Implementation

[0022] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0023] The information collected in this application embodiment is information and data authorized by the user or fully authorized by all parties. The collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data all comply with the relevant laws, regulations and standards of the relevant regions, and necessary confidentiality measures have been taken. It does not violate public order and good morals, and provides corresponding operation entry points for users to choose to authorize or reject the automated decision results. If the user chooses to reject, the process will proceed to the expert decision-making process.

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

[0025] To better understand the embodiments of this application, the technical terms involved in the embodiments of this application are explained below:

[0026] Microgrid: A microgrid is a small-scale power generation and distribution system consisting of distributed power sources, energy storage devices, energy conversion devices, loads, monitoring and protection devices, etc. Microgrids can also be connected to the main grid to receive power from it or sell surplus power back to the main grid.

[0027] Microgrid energy management: Using certain optimization techniques to achieve intelligent control and autonomous dispatching decisions for microgrids, while ensuring that equipment is within safe electrical boundaries, the power of power-controllable equipment in the microgrid is regulated to adapt to the fluctuations of factors such as renewable energy generation, load, and real-time electricity prices, so as to meet load demand, avoid waste of power resources, and minimize operating costs or other objectives.

[0028] In related technologies, neural network-based microgrid energy management methods have weak generalization ability. In the complex environment of microgrid energy management, due to high input-output dimensions, insufficient utilization of input data, and insufficient exploration of the microgrid environment, neural networks are difficult to converge or easily converge to local optima. Therefore, there is a technical problem in related technologies where neural network-based microgrid energy management networks are difficult to converge or easily get trapped in local optima. To solve this problem, this application provides relevant solutions, which are described in detail below.

[0029] According to an embodiment of this application, an embodiment of a training method for a joint network cluster for microgrid energy management is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0030] The methods and embodiments provided in this application can be executed on a computer terminal or similar computing device. Figure 1 A hardware block diagram of a computer terminal for implementing a training method for a joint network cluster used in microgrid energy management is shown. Figure 1 As shown, the computer terminal 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0031] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10. As involved in the embodiments of this application, the data processing circuits serve as a form of processor control (e.g., selection of a variable resistor termination path connected to an interface).

[0032] The memory 104 can be used to store software programs and modules for application software, such as the program instructions / data storage device corresponding to the training method for the joint network cluster for microgrid energy management in this embodiment of the application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned training method for the joint network cluster for microgrid energy management. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0033] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0034] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10.

[0035] Under the above operating environment, this application provides an embodiment of a training method for a joint network cluster for microgrid energy management. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Also, although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than that shown here.

[0036] like Figure 2 The diagram shown is a flowchart of a training method for a joint network cluster for microgrid energy management according to an embodiment of this application, including:

[0037] Step S202: Obtain historical data sequences, wherein the historical data sequences contain feature vectors of the microgrid at multiple time steps.

[0038] In the technical solution provided in step S202, there are multiple ways to obtain historical data sequences. For example, the power units in the microgrid are divided into uncontrolled energy, controlled energy, energy storage devices, loads, and the main grid. Uncontrolled energy refers to power generation equipment whose power is uncontrollable or does not require control, controlled energy refers to power generation equipment whose power is adjustable, loads include various types of electrical equipment, and the main grid is the power network connected to the microgrid. The preset historical time period is divided into multiple time steps, and the power of uncontrolled energy, the power of loads, the unit price of the microgrid's transaction with the main grid, and the state of charge of energy storage devices corresponding to each time step are determined as the feature vector of the microgrid for that time step. The feature vectors of the microgrid for multiple time steps are sorted in order from first to last to obtain the historical data sequence.

[0039] In some embodiments of this application, all power units in the microgrid are acquired, classified, and uniformly modeled: the power units in the microgrid are classified into uncontrolled energy, controlled energy, energy storage devices, loads, and the main grid. Uncontrolled energy refers to power generation equipment whose power output is uncontrollable or does not require control, such as photovoltaic power generation, wind power generation, and hydropower generation equipment, which are uniformly denoted as U. This type of energy is characterized by utilizing natural energy sources for power generation. On the one hand, the power generation of this type of energy is greatly affected by weather factors, making it difficult to artificially regulate upwards (i.e., increase power generation). On the other hand, given that the goal of the microgrid is to maximize the utilization of these clean energy resources, downward regulation (i.e., reducing power generation) will not be implemented to avoid wasting renewable energy. This represents the power of the uncontrolled energy source at time step t, which is the sum of the power generated by all such devices (where t represents the t-th time slot (time step), and t can be any time step, the same below). Let represent the lower and upper limits of the power of the uncontrolled energy source, respectively. Then the constraint condition for the uncontrolled energy source is:

[0040] Controlled energy refers to power generation equipment whose power can be adjusted, such as diesel generators and micro gas turbines. The power output of these devices can be adjusted to adapt to fluctuations in uncontrolled energy and load. A key characteristic of these devices is that their power generation can be manually controlled. Let the controlled energy be denoted as C. This represents the power generation capacity of controlled energy sources, that is, the total power generation capacity of all such devices. Let represent the lower limit and upper limit of the power generation capacity of the controlled energy source, respectively. Then the constraint condition for the controlled energy source is:

[0041] Energy storage devices (including lithium-ion batteries, lead-acid batteries, sodium-sulfur batteries, flow batteries, flywheel energy storage devices, supercapacitors, etc., characterized by their ability to store electrical energy and release it when needed) are denoted as ESS, and their charging and discharging power satisfies the following constraints: ,in, This indicates the charging and discharging power of the energy storage device. This indicates the lower and upper limits of the charging and discharging power of the energy storage device. SOC t The state of charge (SOC) of the energy storage device (which can be indirectly controlled by adjusting the charging and discharging power of the energy storage device) must meet the constraint condition. min ≤SOC t ≤SOC max (4), where SOC min and SOC max These represent the lower and upper limits of the state of charge (SOC) of an energy storage device. The relationship between them satisfies:

[0042]

[0043] Among them, SOC t+1 Let η be the state of charge of the energy storage device at the next time step after the t-th time step, Δt be the charging / discharging time, and η be the state of charge of the energy storage device at the next time step. cha η dis These are the charging coefficient and the discharging coefficient, respectively; E ESS This refers to the capacity of the energy storage device.

[0044] The main power grid is denoted as MG. This represents the power exchanged between the microgrid and the main grid at time step t, satisfying the constraints.

[0045] condition: in, These represent the lower and upper limits of the power exchanged between the microgrid and the main grid, respectively. If... This indicates that the microgrid purchases electricity from the main grid, and conversely, it indicates that the microgrid sells electricity to the main grid. The power balance constraints for a microgrid are: in, This represents the power of the load, meaning that the power generated by all energy sources in the microgrid is exactly absorbed by the load. The load includes various types of electrical equipment, such as household appliances, industrial machinery, lighting systems, and electric vehicle charging stations, which consume electrical energy to provide the required services or functions. The main grid refers to the large power network connected to the microgrid; it is the interface between the microgrid and the external power system.

[0046] After the above classification, the preset historical time period is divided into multiple time steps (e.g., divided into T time steps, where t ranges from 1 to T; for example, the preset historical time period is T with a value of 100, with each 15 minutes as a time step). The power of uncontrolled energy sources, the power of loads, the unit price of microgrid transactions with the main grid, and the state of charge of energy storage devices corresponding to each time step are determined as the feature vector of the microgrid for that time step. The power of uncontrolled energy sources, the power of loads, the unit price of microgrid transactions with the main grid, and the state of charge of energy storage devices can be obtained through microgrid monitoring and data acquisition systems, smart meters, third-party data service providers, etc. For example, the feature vector of the microgrid at the t-th time step is... in, This represents the unit price for transactions between the microgrid and the main grid. The feature vectors of the microgrid at multiple time steps are sorted in chronological order to obtain the historical data sequence D = {s}. t}, t=1,2…T.

[0047] After obtaining the historical data sequence through the above steps, the target control vector corresponding to each time step is determined based on at least the historical data sequence and the objective function and multiple constraints of the objective function. The multiple target control vectors are sorted in order of time steps from first to last to obtain the target control vector solution set. The target control vectors include the power generation of the controlled energy source, the power traded between the microgrid and the main grid, and the charging and discharging power of the energy storage device.

[0048] In some embodiments of this application, determining the target control vector corresponding to each time step requires first selecting a mathematical optimization algorithm based on the constraints of the objective function under multiple constraints. This selection is achieved by analyzing the mathematical properties of the objective function (e.g., linear, quadratic, nonlinear, convex / non-convex) and the type of constraints (e.g., linear, nonlinear, integer constraints). For example, linear programming (LP) is used when both the objective function and all constraints are linear. It is suitable for scenarios such as cost minimization (linear cost) and simple power balance. Quadratic programming (QP) is used when the objective function is quadratic (e.g., considering the generation cost curve as a quadratic function) and the constraints are linear. Mixed-integer linear programming (MILP) is used when the objective function is linear, and the constraints include linear constraints and integer / Boolean variables (e.g., mutual exclusion of energy storage charging / discharging states (0 / 1), equipment start / stop states (0 / 1), piecewise linear cost approximation). This is a commonly used model in microgrid optimization. Mixed-integer quadratic programming (MIQP): Used when the objective function is quadratic and the constraints include linear constraints and integer variables. Nonlinear programming (NLP): Used when the objective function or constraints are nonlinear and do not contain integer variables. Suitable for more accurate equipment models (e.g., considering efficiency curves) or nonlinear costs / objectives. Mixed-integer nonlinear programming (MINLP): Used when the objective function or constraints are nonlinear and contain integer variables. This is the most complex but potentially most accurate model. Heuristic / meta-heuristic algorithms (e.g., Genetic Algorithm GA, Particle Swarm Optimization PSO): Can be used as alternatives when the problem size is too large, the model is highly nonlinear / nonconvex, or a satisfactory solution (not strictly optimal) needs to be obtained quickly. For example, in the example of the target model where the microgrid energy optimization objective is to minimize operating costs, after substituting the historical data sequence D into the objective function, the target control vector solution set can be obtained by solving mixed-integer quadratic programming.

[0049] After determining the mathematical optimization algorithm, the target control vector corresponding to the microgrid's characteristic vector at each time step in the historical data sequence is solved using the algorithm. The target control vector is the theoretically optimal control vector (the optimal value of the objective function under all constraints at that time step). Multiple target control vectors are sorted in chronological order to obtain the target control vector solution set. This solution set is the theoretically optimal solution set for microgrid energy management over a preset historical time period. For example, the target control vector solution set is... Let be the target control vector for time step t. The target control vector for each time step includes the power generation of the controlled energy source calculated by the mathematical optimization algorithm, the power traded between the microgrid and the main grid, and the charging and discharging power of the energy storage device. The target control vector will serve as the standard for subsequent joint network cluster training, helping the network learn and approximate the optimal control strategy.

[0050] The objective function described above can be designed in various forms depending on the specific energy optimization objectives of the microgrid. These objectives can include minimizing operating costs, reducing carbon emissions and environmental impact, and maximizing power supply reliability. For example, if the energy optimization objective of the microgrid is to minimize operating costs, the objective function can be expressed as follows:

[0051]

[0052] Where st represents multiple constraints of the objective function, and these multiple constraints of the objective function are the constraints (1) to (6) mentioned above. F t Let be the total cost at time step t. This represents the cost of the microgrid's transaction with the main grid at time step t. This represents the cost of generating electricity from the controlled energy source at time step t. This represents the cost of energy storage device losses at time step t.

[0053] in, This refers to the unit price for transactions between the microgrid and the main grid. Let t represent the power exchanged between the microgrid and the main grid at time step t, where Δt is the charging and discharging time.

[0054] Where a, b, and c are the corresponding cost coefficients, and Δt is the charging and discharging time. This indicates the power generation capacity of controlled energy sources.

[0055] Among them, c ESS This represents the loss cost coefficient for energy storage equipment. These are the charging power and discharging power of the energy storage device, respectively. These are the charging coefficient and the discharging coefficient, respectively.

[0056] Step S204: Asynchronous iterative training is performed on the parent joint network and multiple child joint networks of the joint network cluster based on historical data sequences.

[0057] In the technical solution provided in step S204, the joint network cluster includes multiple joint networks. The parent joint network is a pre-defined joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network. During the iterative training process, each child joint network uploads its gradient to the parent joint network every preset iteration round.

[0058] In some embodiments of this application, a set of isomorphic joint network clusters is constructed, comprising a sequence processing network, a regulation network, and a valuation network. One joint network in the cluster is pre-designated as the parent joint network, and the rest are child joint networks; all network parameters are initialized synchronously. Multiple rounds of management are performed, and each joint network includes a sequence processing network (with overall parameters denoted as θ). s ), and the control network (with overall parameters denoted as θ) c ) and valuation network (overall parameters denoted as θ) v When initializing the network parameters, the gradients of the sequence processing network, regulation network, and estimation network of the parent joint network are reset to dθ. s =0, dθ c =0, dθ v =0, update the gradients of the sequence processing network, regulation network, and estimation network of the sub-joint network to θ. s ′=θ s θ s ′=θ s θ v ′=θ v The sequence processing network includes a forgetting matrix, a fusion matrix, and a temporal feature matrix. The forgetting matrix determines how much microgrid feature information from past time steps (time steps before time step t) needs to be forgotten. The fusion matrix determines how much microgrid feature information from the current time step (time step t) is introduced. The temporal feature matrix at time step t is calculated by combining the forgetting matrix, the fusion matrix, and the temporal feature matrix from the previous time step. Asynchronous iterative training is performed on the parent joint network and multiple child joint networks of the joint network cluster based on historical data sequences. That is, the parent joint network and multiple child joint networks are trained asynchronously and concurrently using historical data sequences. The parent joint network and each child joint network undergo iterative training separately. During iterative training, each child joint network uploads its gradient to the parent joint network every preset number of iterations (e.g., 10 iterations). Upon receiving the gradient, the parent joint network immediately updates its network parameters based on the gradient and continues iterative training with the new network parameters. Additionally, after each iteration, the parent joint network updates its network parameters based on its gradient. Continue the above process until the average error difference after a certain round of iterative training of the parent joint network is less than the preset error threshold. Then stop the iterative training of the parent joint network and the child joint network, and determine the parent joint network after the iterative training stops as the target network for microgrid energy management.

[0059] The parent joint network of the joint network cluster is trained iteratively for any one round based on historical data sequences using the following method: Step 1: Extract the temporal features of the historical data sequences through the sequence processing network of the parent joint network to obtain a temporal feature vector sequence. This sequence contains a temporal feature vector corresponding to each time step. The parent joint network includes a sequence processing network, a regulation network, and an evaluation network. Step 2: Process the temporal feature vector sequence through the regulation network of the parent joint network to obtain a control vector corresponding to each time step. Process the temporal feature vector at each time step through the evaluation network of the parent joint network to obtain a control vector for each time step. The estimated actual error for each time step is determined, where the actual error is determined at least based on the corresponding control vector and the target control vector. After executing steps 1 and 2, the network parameters of the parent joint network are updated based on the error functions of the sequence processing network, the regulation network, and the estimation network. The error functions of the estimation network and the regulation network are determined at least based on the estimated cumulative error and the actual error for all time steps. The error function of the sequence processing network is determined based on the error functions of the estimation network and the regulation network. The cumulative error for each time step is determined at least based on the actual error for all time steps.

[0060] The temporal feature vector corresponding to any time step is determined as follows: the temporal feature matrix of the second time step is determined based on at least the forgetting matrix, the fusion matrix, and the temporal feature matrix of the first time step, and the last dimension of the temporal feature matrix of the second time step is determined as the temporal feature vector corresponding to the second time step. The second time step is any time step other than the first time step in the historical data sequence, and the first time step is the time step before the second time step in the historical data sequence. The forgetting matrix is ​​determined based on the historical data sequence, the weight parameters of the forgetting matrix, the bias parameters of the forgetting matrix, and the temporal feature matrix of the first time step. The fusion matrix is ​​determined based on the historical data sequence, the weight parameters of the fusion matrix, the bias parameters of the fusion matrix, and the temporal feature matrix of the first time step.

[0061] The control vector corresponding to any time step is determined as follows: the target temporal feature vector in the temporal feature vector sequence is passed through the input layer of the control network to multiple intermediate layers of the control network, where the target temporal feature vector is the temporal feature vector corresponding to the target time step, and the target time step is any time step; the output result of the last intermediate layer among the multiple intermediate layers is passed to multiple output layers of the control network to obtain multiple output layer output results; the output results of the multiple output layers are sampled and scaled in multiple preset intervals to obtain the control vector corresponding to the target time step.

[0062] In some embodiments of this application, when performing any round of iterative training on the parent joint network of the joint network cluster based on historical data sequences, step 1 involves extracting the temporal features of the historical data sequence through the sequence processing network of the parent joint network to obtain a temporal feature vector sequence, wherein the temporal feature vector sequence contains the temporal feature vector corresponding to each time step. Step 2 involves processing the temporal feature vector sequence through the control network of the parent joint network to obtain the control vector corresponding to each time step; and processing the temporal feature vector of each time step through the estimation network of the parent joint network to obtain the estimated actual error corresponding to each time step. It should be noted that in step 1, the temporal feature vector corresponding to each time step in the historical data sequence can also be extracted concurrently, and then step 2 is executed concurrently for all time steps to process the temporal feature vector of each time step to obtain the control vector corresponding to each time step.

[0063] For example, the temporal feature vector h corresponding to time step t can be extracted in the following way. t (i.e., the time-series feature vector corresponding to the second time step mentioned above): In n time steps (n refers to the preset time window, n is less than T, for example, n is 3, that is, 3 time steps are taken each time, i.e., the two time steps before t and t), the system input is the time step sequence under the preset time window in the historical data sequence: Let d represent the set of real numbers, d be the dimension of the eigenvectors, and s be the eigenvectors. t-n+1 ,s t-n+2 ,…s t The feature vector representing the preset time window from time step t to time step t. For example, if t is 4 and n is 3, then s t-n+1 ,s t-n+2 ,…s t (This represents the feature vectors of time steps 2 to 4), and the temporal feature matrix of the previous time step (i.e., the first time step mentioned above) is... (h is the dimension of the time series feature vector, h) t-n ,h t-n+1 ,…h t-1 (This represents all temporal eigenvectors contained in the temporal feature matrix). The forgetting matrix at time step t is R. t =sigmoid(X t W xr +H t-1 W hr +b r ),in, These are the weight parameters of the forgetting matrix. It is the bias parameter of the forgetting matrix.

[0064] Z t =sigmoid(X t Wxz +H t-1 W hz +b z ), where Z t This represents the fusion matrix at time step t. These are the weight parameters of the fusion matrix. is the bias parameter of the fusion matrix, and sigmoid is the activation function.

[0065] The temporal feature matrix corresponding to the current time step t (i.e., the temporal feature matrix of the second time step mentioned above) is as follows:

[0066] H t =Z t ⊙H t +(1-Z t )tanh(X t W xh +(R t ⊙H t-1 W hh +b h ), where ⊙ represents

[0067] Hadamard product operator, and These are weight parameters. is the bias term, ⊙ is the Hadamard product operator, and tanh is the hyperbolic tangent activation function. The last dimension of this temporal feature matrix is ​​determined as the temporal feature vector h corresponding to the second time step. t The above method can be used to determine the temporal feature vectors corresponding to all time steps, and form a sequence of temporal feature vectors according to the chronological order of the time steps.

[0068] When processing the temporal feature vector sequence through the control network of the parent joint network to obtain the control vector corresponding to each time step, multiple temporal feature vectors can be processed concurrently. The control network of the parent joint network contains one input layer, L intermediate layers (the number and dimension of the intermediate layers are determined by the complexity of the target problem being optimized, for example, L is 5), and two output layers. The input of the input layer is the temporal feature vector f0. Taking the above time step t as an example, the input temporal feature vector h... t The intermediate layer can be represented as f l =max(W l f l-1 +b l ,0),l=1,2…L, where, Let d be the weight matrix of the intermediate layer. l-1 Let d be the dimension of the output of the (l-1)th intermediate layer. l This is the dimension output by the l-th intermediate layer. f is the intermediate layer bias vector. l-1This represents the intermediate layer preceding layer l. Output layer 1 is μ = tanh(W μ f L +b μ ), where μ represents the output of the first output layer, W μ Let b be the weight matrix. μ f represents the bias vector of output layer 1. L This represents the output of the last intermediate layer. Output layer 2 is σ = tanh(W σ f L +b σ ), where σ represents the output of the second output layer, W σ Let b be the weight matrix. σ This represents the bias vector of output layer 2. It uses sigmoid[N(μ,σ]). 2 Sampling is performed where N represents a normal distribution and sigmoid represents the activation function. The control vector at time step t is obtained by scaling within the interval.

[0069] After obtaining the control vector at time step t, the actual error at time step t can be further calculated. Among them, the first item It is the square of the Euclidean distance, used to quantify the distance between the control vector at time step t and the optimal solution at time step t (i.e., the target control vector mentioned above). The second term max(0, g(a) t )) 2 This is a penalty term, quantifying the punishment for violating multiple constraints in the objective function. For example, we can take... Where λ is a coefficient used to guide the controllable power equipment to ensure that its controllable range is not exceeded. Then, the time-series feature vector at time step t is processed by the estimation network of the parent joint network to obtain the corresponding estimate of the actual error: the estimation network contains one input layer, L intermediate layers, and one output layer. The input is the time-series feature vector at time step t, and the intermediate layers can be represented as f. l =max(W l f l-1 +b l ,0),l=1,2…L, where, Let d be the weight matrix of the intermediate layer. l-1 Let d be the dimension of the output of the (l-1)th intermediate layer. l This is the dimension output by the l-th intermediate layer. This is the bias vector for the intermediate layers. The output layer can be represented as o = W. o f L +b o Where o represents the output layer, This represents the weight matrix of the output layer. d represents the output layer bias vector. l-1 Let d be the dimension of the output of the (l-1)th intermediate layer. l f is the dimension of the output of the l-th intermediate layer. L This represents the output of the last intermediate layer. The output is the estimated value V(s) of the actual error at time step t. t ;θ v The actual error estimate is an output value of the parent joint network during training, representing the actual error. Through this method, the actual error generated in the energy management of the microgrid at each time step, and the estimated actual error for each time step, can be obtained.

[0070] The training of the parent joint network across all time steps is considered one round of iterative training. After obtaining the control vector, actual error, and estimated actual error for each time step, the parent joint network interacts with the microgrid environment in each round of training to obtain the trajectory {s}. i ,a i ,r i ,s i+1}, i = t start ,…t end Among them, t start For the starting time step, t end This marks the end of the training time step. After each iteration, the network parameters of the parent joint network are updated based on the error functions of the sequence processing network, the regulation network, and the estimation network. For example, the error function of the estimation network is defined as: Among them, t start t represents the starting time step of the historical data sequence used for iterative training. end This represents the end time step of the historical data sequence used for iterative training (e.g., start is 1, end is T). The error function for controlling the network is defined as: Wherein, π(a τ |s τ ;θ c ) represents the mapping fitted by the control network, and γ is the discount factor. Let r be the cumulative error for all time steps starting from time step t. kThis represents the actual error at the k-th time step. The parent joint network calculates the error values ​​of the sequence processing network, regulation network, and estimation network based on the aforementioned error functions. Then, the error functions of the sequence processing network, regulation network, and estimation network are propagated back along the network, and the corresponding gradients are calculated using the chain rule. The gradient is the partial derivative of the error with respect to the network parameters, indicating in which direction to move in the parameter space will reduce the error. Finally, the network parameters of the sequence processing network, regulation network, and estimation network are adjusted using gradient descent.

[0071] Step S206: After receiving gradients (including gradients of sequence processing network, regulation network and estimating network) uploaded by any child joint network during the iterative training of the parent joint network, update the network parameters of the parent joint network (specifically the network parameters of the sequence processing network, regulation network and estimating network of the parent joint network) at least according to the gradients, and continue to execute the iterative training process of the parent joint network using the updated network parameters.

[0072] In the technical solution provided in step S206, the iterative training process of the sub-joint network is the same as that of the parent joint network, and will not be repeated here. The difference is that when the sub-joint network performs the iterative training process, it updates its network parameters after each round of iterative training and uploads the current gradient to the parent joint network every preset number of iterations (e.g., 10 rounds). During the iterative training process, the parent joint network updates its network parameters in each round. The factor networks adopt an asynchronous update strategy, and each sub-network may push its gradient to the parent network at different times. During the iterative training process, as long as the parent joint network receives any gradient uploaded by the sub-joint network, it immediately aggregates the gradient and updates its own network parameters (if only the gradient of one sub-joint network is received, the network parameters of the sequence processing network, regulation network, and estimation network are updated according to the gradient; if the gradients of multiple sub-joint networks are received simultaneously, the gradients of the multiple sub-joint networks are aggregated, for example, by taking the average value, etc.), and the updated network parameters are used to continue the iterative training process.

[0073] Step S208: When the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, stop the iterative training of the parent joint network and the child joint network, and determine the parent joint network after stopping the iterative training as the target network for microgrid energy management.

[0074] The average error difference after any iteration training of the parent joint network is determined as follows: at least based on the total number of iterations and the difference in the average error of any two adjacent iterations within the total number of iterations, the average error difference of the parent joint network after the iteration training of the target iteration round is determined. The iteration training of the target iteration round is any iteration training, and the total number of iterations is the sum of the number of iterations before the iteration training of the target iteration round. The value of the total number of iterations is greater than or equal to 1.

[0075] The average error difference in any round of training iterations of the parent joint network can be expressed by the following formula:

[0076] Where ΔR is the average error difference, n is the number of evaluation cycles (i.e., the total number of iterations mentioned above), and G i G i+1 It is the average error of two consecutive training cycles (the i-th and i+1th iterations), |G i+1 -G i | represents the difference in average error between two consecutive training cycles (the i-th and i+1-th iterations). The average error of any iteration is equal to the average of the cumulative errors of all time steps in that iteration. When the average error difference of the parent joint network is less than a preset error threshold, training is completed, confirming the convergence of the parent joint network. Iterative training of the parent and child joint networks is stopped, and the parent joint network after stopping iterative training is determined as the target network for microgrid energy management. Specifically, the sequence processing network and control network of the parent joint network are applied to the actual real-time energy management system of the microgrid, and the real-time decision (i.e., control vector) output by the control network is used to guide the operation of the microgrid. In order to perform iterative learning and optimization of the joint network cluster, new historical data sequences are obtained every preset time period. Based on the existing joint network cluster, steps S202 to S208 are re-executed to perform iterative learning and optimization of the joint network cluster.

[0077] In related technologies, microgrid energy management methods based on traditional algorithms mainly rely on metaheuristic algorithms, mathematical programming, stochastic and robust optimization methods. While these methods can theoretically optimize the allocation of microgrid resources, they suffer from significant shortcomings such as high computational costs, reliance on precise predictions, susceptibility to the curse of dimensionality, and sensitivity to problem scale, making it difficult to meet the real-time requirements of microgrid energy management. Furthermore, given the highly dynamic and uncertain nature of energy supply and demand, these methods require prediction of numerous influencing factors before optimization, increasing the complexity and uncertainty of practical applications. Deviations in prediction results can lead to improper resource allocation, affecting system performance and stability. Related technologies such as artificial neural network-based microgrid energy management methods still have some problems: 1. Weak generalization ability: In a microgrid environment, the types and numbers of devices are numerous. Therefore, adding new types of devices requires redesigning the network architecture and retraining, which not only reduces the model's generalization ability but also wastes valuable computational resources. 2. Convergence effect and training speed issues: In the complex environment of microgrid energy management, due to the high input-output dimension, failure to fully utilize input data, and insufficient exploration of the microgrid environment, neural networks are difficult to converge or easily converge to local optima, and the training speed is slow, which may lead to poor actual energy management results.

[0078] The training method for the joint network cluster used in microgrid energy management in this application embodiment effectively reduces the complexity of the algorithm and the dimensionality of decision variables in subsequent steps by uniformly modeling and classifying the power units in the microgrid through a classification module. Simultaneously, this classification method allows the addition of new types of equipment without altering the system network structure, greatly enhancing the system's generalization ability and reducing the cost of redesign and training. It can address the diverse types and equipment in microgrids by utilizing historical data sequences to solve for the theoretically optimal solution set for energy management, providing a high-quality reference standard for network training. This method, through precise analysis of historical data, enables the network to learn decision strategies that approximate the theoretically optimal solution during training. By extracting the time dimension information of feature vectors through sequence processing, a temporal feature vector containing the influence of past states is generated, allowing the network to comprehensively consider the historical state of the microgrid when making decisions, thus making more comprehensive and accurate judgments. The combined use of the control network and the valuation network not only outputs control vectors for controlled energy, energy storage devices, and the main grid, but also uses the valuation network to evaluate the control effect in real time, reducing variance during training and improving the stability of training and the reliability of network decisions. Through an asynchronous update strategy, each sub-joint network interacts independently with the microgrid and collects experience, accelerating data collection. Simultaneously, diverse experience samples enhance the model's generalization ability, driving the parent joint network to converge efficiently. The sub-joint network is essentially a temporary training computing unit, a disposable training component that does not affect the stability of the final deployment architecture. Once the parent joint network converges, the sub-joint network has fulfilled its technical mission. During the application phase, only the parent joint network is deployed for convergence. The parent joint network, through its asynchronous update mechanism, integrates the experience of all sub-joint networks, possessing complete decision-making capabilities and conforming to the principle of minimum computing power consumption in industrial real-time systems. In microgrid energy management, this significantly improves the real-time performance, robustness, generalization ability, and optimization effect of the microgrid energy management system, enabling rapid supply and demand balancing, avoiding grid overload, and timely response to market electricity price changes.

[0079] Figure 3This is a flowchart of another training method for a joint network cluster for microgrid energy management according to an embodiment of this application. The method involves: acquiring all power units in the microgrid, classifying and uniformly modeling them (i.e., classifying power units in the microgrid as uncontrolled energy, controlled energy, energy storage devices, loads, and the main grid); designing an energy management objective function; acquiring historical data sequences of the microgrid; and solving for the theoretical optimal solution set (i.e., determining the target control vector corresponding to each time step based at least on the historical data sequence and the objective function, and multiple constraints of the objective function); constructing the feature vector of the microgrid; and using a sequence processing network to obtain a time-series feature vector (i.e., extracting the time-series features of the historical data sequence through the sequence processing network of the parent joint network to obtain a time-series feature vector sequence); inputting the time-series feature vector into the designed joint network; controlling the network outputs a control vector; and evaluating the network outputs an estimated error between the control vector and the optimal solution (i.e., processing the time-series feature vector sequence through the controlling network of the parent joint network to obtain the control vector corresponding to each time step; and processing the time-series feature vector of each time step through the evaluation network of the parent joint network to obtain an estimated actual error corresponding to each time step). A set of isomorphic joint network clusters is constructed, comprising a parent joint network and multiple child joint networks. Network parameters are updated asynchronously (i.e., each child joint network uploads its gradient to the parent joint network every preset iteration interval during iterative training; after receiving a gradient uploaded by any child joint network during the iterative training of the parent joint network, the network parameters of the parent joint network are updated at least based on the gradient, and the iterative training process of the parent joint network continues using the updated network parameters). After the parent joint network converges, its sequence processing network and control network are applied to the actual microgrid real-time energy management system to achieve intelligent control and efficient energy management. Simultaneously, the network parameters are further optimized using newly collected data (i.e., every preset time period, new historical data sequences are obtained, and steps S202 to S208 are re-executed based on the existing joint network cluster to iteratively learn and optimize the joint network cluster).

[0080] This application also provides a schematic diagram of the structure of a training device for a joint network cluster for microgrid energy management, as shown in the embodiment. Figure 4 As shown, it includes:

[0081] The acquisition module 402 is used to acquire historical data sequences, wherein the historical data sequences contain feature vectors of the microgrid at multiple time steps.

[0082] Training module 404 is used to perform asynchronous iterative training on the parent joint network and multiple child joint networks of the joint network cluster based on historical data sequences. The joint network cluster includes multiple joint networks, the parent joint network is a pre-specified joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network. During the iterative training process, each child joint network uploads its gradient to the parent joint network every preset iteration round.

[0083] The update module 406, after receiving a gradient uploaded by any child joint network during the iterative training of the parent joint network, updates the network parameters of the parent joint network based on the gradient at least once, and continues to execute the iterative training process of the parent joint network using the updated network parameters.

[0084] The determination module 408 is used to stop the iterative training of the parent joint network and the child joint network when the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, and to determine the parent joint network after the iterative training is stopped as the target network for microgrid energy management.

[0085] It should be noted that, Figure 4 The training device shown is used for the joint network cluster for microgrid energy management to execute Figure 2 The training method shown is for a joint network cluster used for microgrid energy management, therefore Figure 2 The relevant explanations in the training method of the joint network cluster for microgrid energy management also apply to the training device of the joint network cluster for microgrid energy management, and will not be repeated here.

[0086] It should be noted that the modules in the training device for the joint network cluster for microgrid energy management described above can be program modules (e.g., a set of program instructions to implement a specific function) or hardware modules. For the latter, they can be in the following forms, but are not limited to these: each of the above modules is represented by a processor, or the functions of each of the above modules are implemented by a processor.

[0087] This application also provides a non-volatile storage medium, which includes a stored program, wherein, during program execution, the device where the non-volatile storage medium is located executes the training method for the joint network cluster for microgrid energy management in any of the above embodiments.

[0088] This application also provides an electronic device, which includes a processor for running a program, wherein the training method for a joint network cluster for microgrid energy management described in any of the above embodiments is executed during program execution.

[0089] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the training method for a joint network cluster for microgrid energy management in any of the above embodiments.

[0090] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0091] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0092] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0093] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0094] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0095] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A training method for a joint network cluster for microgrid energy management, characterized in that, include: Obtain historical data sequences, wherein the historical data sequences contain feature vectors of the microgrid at multiple time steps; Asynchronous iterative training is performed on the parent joint network and multiple child joint networks of the joint network cluster based on the historical data sequence. The joint network cluster includes multiple joint networks, the parent joint network is a pre-specified joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network. Each of the child joint networks uploads its gradient to the parent joint network every preset iteration round during the iterative training process. After receiving any gradient uploaded by the child joint network during the iterative training process of the parent joint network, the network parameters of the parent joint network are updated at least according to the gradient, and the iterative training process of the parent joint network is continued using the updated network parameters. When the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, the iterative training of the parent joint network and the child joint network is stopped, and the parent joint network after the iterative training is stopped is determined as the target network for microgrid energy management.

2. The method according to claim 1, characterized in that, The acquisition of historical data sequences includes: The power units in the microgrid are divided into uncontrolled energy sources, controlled energy sources, energy storage devices, loads, and the main grid. The uncontrolled energy sources are power generation devices whose power is uncontrollable or does not require control, the controlled energy sources are power generation devices whose power is adjustable, the loads include various types of electrical equipment, and the main grid is the power network connected to the microgrid. The preset historical time period is divided into multiple time steps, and the power of the uncontrolled energy, the power of the load, the unit price of the microgrid's transaction with the main grid, and the state of charge of the energy storage device corresponding to each time step are determined as the feature vector of the microgrid for that time step. The feature vectors of the microgrid at multiple time steps are sorted in chronological order to obtain the historical data sequence.

3. The method according to claim 2, characterized in that, The method further includes: The target control vector corresponding to each time step is determined based at least on the historical data sequence and the objective function, and multiple constraints of the objective function. The target control vectors are sorted in order of time step from first to last to obtain the target control vector solution set. The target control vectors include the power generation of the controlled energy source, the power traded between the microgrid and the main grid, and the charging and discharging power of the energy storage device.

4. The method according to claim 2 or 3, characterized in that, The parent joint network of the joint network cluster is trained in any one round based on the historical data sequence in the following manner: Step 1: Extract the temporal features of the historical data sequence through the sequence processing network of the parent joint network to obtain a temporal feature vector sequence, wherein the temporal feature vector sequence contains a temporal feature vector corresponding to each time step, and wherein the parent joint network includes the sequence processing network, the regulation network, and the estimation network; Step 2: Process the temporal feature vector sequence through the control network of the parent joint network to obtain the control vector corresponding to each time step; process the temporal feature vector of each time step through the estimation network of the parent joint network to obtain the estimated actual error corresponding to each time step, wherein the actual error is determined at least based on the corresponding control vector and the target control vector; After performing steps 1 and 2, the network parameters of the parent joint network are updated based on the error functions of the sequence processing network, the regulation network, and the estimation network. The error functions of the estimation network and the regulation network are determined at least based on the estimated cumulative error and the actual error for all time steps. The error function of the sequence processing network is determined based on the error functions of the estimation network and the regulation network. The cumulative error for each time step is determined at least based on the actual error for all time steps.

5. The method according to claim 4, characterized in that, The temporal feature vector corresponding to any one of the time steps is determined in the following way: The temporal feature matrix of the second time step is determined based at least on the forgetting matrix, the fusion matrix, and the temporal feature matrix of the first time step. The last dimension of the temporal feature matrix of the second time step is determined as the temporal feature vector corresponding to the second time step. The second time step is any time step other than the first time step in the historical data sequence, and the first time step is the time step before the second time step in the historical data sequence. The forgetting matrix is ​​determined based on the historical data sequence, the weight parameters of the forgetting matrix, the bias parameters of the forgetting matrix, and the temporal feature matrix of the first time step. The fusion matrix is ​​determined based on the historical data sequence, the weight parameters of the fusion matrix, the bias parameters of the fusion matrix, and the temporal feature matrix of the first time step.

6. The method according to claim 4, characterized in that, The control vector corresponding to any one of the time steps is determined in the following way: The target temporal feature vector in the temporal feature vector sequence is passed through the input layer of the control network to multiple intermediate layers of the control network, wherein the target temporal feature vector is the temporal feature vector corresponding to the target time step, and the target time step is any time step; The output result of the last intermediate layer among the multiple intermediate layers is passed to the multiple output layers of the control network to obtain the output results of multiple output layers; The output results of the multiple output layers are sampled and scaled in multiple preset intervals to obtain the control vector corresponding to the target time step.

7. The method according to claim 1, characterized in that, The average error difference after any round of training iterations of the parent joint network is determined in the following way: The average error difference of the parent joint network after the iterative training of the target iteration round is determined at least based on the total number of iterations and the difference in the average error of any two adjacent iteration rounds in the total number of iterations. The iterative training of the target iteration round is any iteration training, the total number of iterations is the sum of the number of iterations before the iterative training of the target iteration round is performed, and the value of the total number of iterations is greater than or equal to 1.

8. A training device for a joint network cluster for microgrid energy management, characterized in that, include: An acquisition module is used to acquire historical data sequences, wherein the historical data sequences contain feature vectors of the microgrid at multiple time steps; The training module is used to perform asynchronous iterative training on the parent joint network and multiple child joint networks of the joint network cluster based on the historical data sequence. The joint network cluster includes multiple joint networks, the parent joint network is a pre-specified joint network among the multiple joint networks, and the multiple child joint networks are joint networks other than the parent joint network. Each of the child joint networks uploads its gradient to the parent joint network every preset iteration round during the iterative training process. An update module is used to update the network parameters of the parent joint network at least according to the gradient after receiving any gradient uploaded by the child joint network during the iterative training process of the parent joint network, and continue to execute the iterative training process of the parent joint network using the updated network parameters. The determination module is used to stop the iterative training of the parent joint network and the child joint network when the average error difference after any round of iterative training of the parent joint network is less than a preset error threshold, and to determine the parent joint network after the iterative training is stopped as the target network for microgrid energy management.

9. A non-volatile storage medium, characterized in that, The non-volatile storage medium stores a program, wherein when the program is executed, it controls the device containing the non-volatile storage medium to execute the training method for the joint network cluster for microgrid energy management as described in any one of claims 1 to 7.

10. An electronic device, characterized in that, include: A memory and a processor, the processor being configured to run a program stored in the memory, wherein the program, when running, executes the training method for a joint network cluster for microgrid energy management as described in any one of claims 1 to 7.

11. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the training method for the joint network cluster for microgrid energy management as described in any one of claims 1 to 7.