A flexible configuration method for microgrid network topology based on matrix topology

By building a heterogeneous database and using graph neural networks and reinforcement learning algorithms to optimize the microgrid topology structure, the problem of poor robustness of topology optimization in traditional methods is solved, and efficient and robust microgrid operation is achieved in a heterogeneous environment.

CN119651751BActive Publication Date: 2025-09-26NORTHWESTERN POLYTECHNICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510061591.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-15
Publication Date
2025-09-26
Estimated Expiration
2045-01-15

AI Technical Summary

Technical Problem

Traditional microgrid topology optimization methods have poor robustness, making it difficult to accurately characterize the complex relationship between microgrid topology and device parameters, and fail to effectively deal with the differential impact of heterogeneous hardware.

Method used

Using graph neural networks and reinforcement learning algorithms, a heterogeneous database is constructed, and the microgrid network is mapped into a graph structure. Combined with multi-objective optimization functions, the topology structure and hardware scheduling strategy are optimized to achieve flexible configuration.

Benefits of technology

The representation ability and generalization performance of the topology model are improved, ensuring the robust operation and efficient computing of the microgrid in heterogeneous environments, taking into account energy consumption, robustness and computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119651751B_ABST
    Figure CN119651751B_ABST
Patent Text Reader

Abstract

This application discloses a flexible configuration method for microgrid network topology based on matrix topology, which relates to the field of microgrids. The method includes: constructing a heterogeneous database of microgrid networks and devices; mapping the microgrid network and devices into a graph structure and constructing a graph neural network model; setting different mapping strategies for heterogeneous hardware units based on the heterogeneous characteristics of different heterogeneous hardware units, and using a reinforcement learning algorithm to construct a scheduling model for heterogeneous hardware units; inputting preprocessed data into the graph neural network model to obtain the correlation between the microgrid network topology structure and device parameters as a constraint condition; inputting the preprocessed data into the scheduling model to obtain the scheduling strategy of the heterogeneous hardware units as an optimization target; constructing a multi-objective function for microgrid network topology optimization; and using an intelligent algorithm to solve the multi-objective function for microgrid network topology optimization and generate a microgrid network topology solution. This application improves the robustness of the topology solution.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of microgrids, and in particular to a flexible configuration method for microgrid network topology based on matrix topology. Background Art

[0002] With the rapid development of new energy, distributed power sources, and intelligent power equipment, microgrids have become an essential component of future power systems. By integrating distributed energy resources, energy storage devices, and controllable loads, microgrids can achieve local power balancing and self-sufficiency, improving the reliability and affordability of power supply. However, the complex and changing environment in which microgrids operate, characterized by large fluctuations in supply and demand and strong device heterogeneity, poses significant challenges to their planning and operation. As the fundamental architecture connecting various power devices, the optimized configuration of microgrid network topology is crucial for the safe, stable, and economical operation of microgrids. However, the complex nonlinear relationships between microgrid topology and device parameters and operating status make it difficult for traditional methods, using simplified linear models, to accurately represent these relationships, resulting in significant modeling errors. Summary of the Invention

[0003] In response to the problem of poor robustness of microgrid network topology optimization methods in the existing technology, the present application provides a flexible configuration method for microgrid network topology based on matrix topology. By collecting data from the microgrid network and constructing a heterogeneous database, mapping the microgrid into a graph structure and constructing a graph neural network and a heterogeneous hardware scheduling model, and using intelligent algorithms to solve multi-objective optimization functions, flexible optimization configuration of the microgrid topology structure can be achieved, and the robustness of the topology scheme can be improved while meeting multiple heterogeneous constraints.

[0004] The purpose of this application is achieved through the following technical solutions.

[0005] The present application provides a microgrid network topology flexible configuration method based on matrix topology, comprising: collecting data of the microgrid network and preprocessing the collected data; wherein the data of the microgrid network includes network topology structure, device parameters, operating parameters, and heterogeneous characteristics of different heterogeneous hardware units; the heterogeneous hardware units represent hardware devices with different computing capabilities and communication delays in the microgrid network; based on the preprocessed data, constructing a heterogeneous database of the microgrid network and devices, the heterogeneous database including structured data, semi-structured data and unstructured data; mapping the microgrid network and devices into a graph structure based on the data in the heterogeneous database, and constructing a graph neural network model; based on the heterogeneous hardware units, Based on the heterogeneous characteristics, different mapping strategies for heterogeneous hardware units are set, and a reinforcement learning algorithm is used to construct a scheduling model for heterogeneous hardware units; the preprocessed data is input into the graph neural network model to obtain the correlation between the microgrid network topology structure and the device parameters as a constraint condition; the preprocessed data is input into the scheduling model to obtain the scheduling strategy of the heterogeneous hardware units as the optimization target; according to the constraint conditions and optimization targets, a multi-objective function for microgrid network topology optimization is constructed; an intelligent algorithm is used to solve the multi-objective function for microgrid network topology optimization and generate a microgrid network topology scheme; wherein the topology scheme includes the microgrid network topology structure, device connection relationship and the scheduling strategy of heterogeneous hardware units.

[0006] Furthermore, mapping relationships are established within heterogeneous databases, including: establishing a mapping relationship between the node table and the device document collection to associate the device parameters with the network topology; establishing a mapping relationship between the node table, the branch table, and the operation parameter measurement point table to associate the operation parameters with the network topology; establishing a mapping relationship between the node table and the hardware feature table to associate the heterogeneous hardware features with the network topology.

[0007] Furthermore, based on the data in the heterogeneous database, the microgrid network and the equipment are mapped into a graph structure, and a graph neural network model is constructed, including: extracting data from the node table, branch table and device document collection based on the microgrid heterogeneous database, mapping the microgrid network nodes into nodes of the graph structure, and mapping the microgrid network branches into edges of the graph structure to obtain a microgrid network topology diagram; based on the mapping relationship between the node table and the device document collection, the equipment parameters are added to the corresponding microgrid network nodes as attributes of the graph structure nodes; based on the mapping relationship between the node table, branch table and operating parameter measurement point table, the operating parameters are added to the corresponding microgrid network nodes and branches as attributes of the graph structure nodes and edges; based on the mapping relationship between the node table and the hardware feature table, the heterogeneous hardware features are added to the corresponding microgrid network nodes as attributes of the graph structure nodes; based on the microgrid network topology diagram and the attributes of the nodes and edges, a graph neural network model of the microgrid is constructed.

[0008] Furthermore, based on the microgrid network topology and the attributes of nodes and edges, a graph neural network model of the microgrid is constructed, including: mapping the microgrid network nodes as input layer nodes of the graph neural network, and mapping the microgrid network branches as edges of the graph neural network; initializing the feature vectors of the input layer nodes of the graph neural network based on the node attribute information; the node attribute information includes device parameters, operating parameters and heterogeneous hardware characteristics; setting the hidden layer and aggregation function of the graph neural network, and updating the feature vector of the node through feature aggregation; setting the output layer of the graph neural network, and generating the association relationship between the microgrid network topology structure and the device parameters based on the node feature vector;

[0009] Furthermore, according to the heterogeneous characteristics of different heterogeneous hardware units, different mapping strategies for heterogeneous hardware units are set, and a reinforcement learning algorithm is used to construct a scheduling model for heterogeneous hardware units, including: extracting the computing power and communication delay data of different heterogeneous hardware units according to the established hardware feature table; setting a mapping strategy for heterogeneous hardware units according to the extracted data: mapping heterogeneous hardware units with computing power greater than a preset computing power threshold and communication delay less than a preset communication delay threshold to hidden layer nodes in the graph neural network model for performing feature aggregation and updating of the graph neural network; mapping heterogeneous hardware units with computing power less than or equal to the preset computing power threshold and communication delay greater than or equal to the preset communication delay threshold to input layer nodes of the graph neural network for providing initial feature vectors; according to the mapping strategy, Initialize the reinforcement learning environment: define the state space to represent the working state of the heterogeneous hardware units and the operating state of the microgrid system; define the action space to represent the scheduling decision of the heterogeneous hardware units, which includes the task allocation and node mapping of the heterogeneous hardware units; define the reward function to represent the performance evaluation of the scheduling decision of the heterogeneous hardware units, which includes the computing power and communication delay of the microgrid system; use the reinforcement learning algorithm to learn the optimal scheduling strategy of the heterogeneous hardware units through the interaction between the intelligent agent and the environment; use the optimal scheduling strategy of the heterogeneous hardware units as the output of the reinforcement learning algorithm to construct a scheduling model for the heterogeneous hardware units; the scheduling model of the heterogeneous hardware units uses the operating state of the microgrid and the working state of the heterogeneous hardware as input to generate the corresponding hardware scheduling strategy, which includes task allocation and node mapping.

[0010] Furthermore, a reinforcement learning algorithm is used to learn the optimal scheduling strategy for heterogeneous hardware units through the interaction between the intelligent agent and the environment, including: using the network topology, device parameters, operating parameters in the heterogeneous database, and the computing power and communication delay in the hardware feature table as the state input of the reinforcement learning environment; wherein the network topology, device parameters and operating parameters represent the operating state of the microgrid, and the computing power and communication delay represent the working state of the heterogeneous hardware units; the scheduling decision of the heterogeneous hardware units is defined as the action of the reinforcement learning algorithm, and the scheduling decision includes mapping the heterogeneous hardware units to the nodes of the graph neural network model and allocating computing and communication tasks to the heterogeneous hardware units; using the output of the graph neural network model as an evaluation indicator, a reward function of the reinforcement learning algorithm is constructed, and the reward function represents the performance evaluation of the heterogeneous hardware unit scheduling decision, and the performance evaluation includes the computing power and communication delay of the microgrid system; the Q-value table of the reinforcement learning algorithm is initialized, the state space and action space are discretized, and the Q-learning algorithm is used to train the Q-value table to obtain the optimal heterogeneous hardware unit scheduling strategy; the optimal scheduling strategy is a set of heterogeneous hardware unit task allocation and node mapping combinations that maximizes the reward function.

[0011] Furthermore, based on the constraints and optimization objectives, a multi-objective function for microgrid network topology optimization is constructed, including: taking the output of the graph neural network model as a constraint, and constructing a constraint set C: C = {c1, c2, ..., c m}, where c i represents the i-th association constraint, i=1,2,......,m; m represents the number of constraints; c i Is a logical expression that takes the value True or False. If and only if the microgrid network topology meets the device parameter requirements, c i True; take the output of the heterogeneous hardware unit scheduling model as the optimization target and construct the optimization target set O: O = {o1,o2,o3}, where o1 represents minimizing the energy consumption of the microgrid system; o2 represents maximizing the computing power of the heterogeneous hardware unit; and o3 represents minimizing the communication delay. Based on the constraint set C and the optimization target set O, a multi-objective function for microgrid network topology optimization is constructed:

[0012] minF(x)=[f1(x),f2(x),f3(x)]. Constraints: x∈X,c i(x) = True, i = 1, 2, ..., m; where x represents the decision variables of the microgrid network topology and the scheduling strategy of the heterogeneous hardware units, x = [topo, sche]; topo represents the microgrid network topology, and sche represents the scheduling strategy of the heterogeneous hardware units; X represents the feasible domain of the decision variable x, which is determined by the physical connection of the microgrid network, device parameters, hardware constraints, and other conditions;

[0013] f1(x) represents the energy consumption of the microgrid system, which is obtained according to the operating parameter measurement point table in the heterogeneous database;

[0014] Among them, P i (x) represents the active power of the i-th node under the topology and scheduling strategy x; N represents the node set of the microgrid; f2(x) represents the computing power of the heterogeneous hardware unit, Among them, a j represents the computing power of the jth heterogeneous hardware unit, M represents the set of heterogeneous hardware units, u j (x) is a 0-1 variable, representing the scheduling state of heterogeneous hardware unit j under decision x, u j (x) = 1 means scheduling, u j (x) = 0 means no scheduling; f3(x) represents the communication delay,

[0015] Among them, t l (x) represents the end-to-end delay of the communication link l under the topology structure and scheduling strategy x, and L represents the set of all communication links in the microgrid network; [f1(x), f2(x), f3(x)] represents a multi-objective function, which consists of three sub-objectives: energy consumption, computing power, and communication delay. It requires that energy consumption and communication delay be minimized and computing power be maximized.

[0016] Furthermore, an intelligent algorithm is used to solve the multi-objective function of microgrid network topology optimization and generate a microgrid network topology solution, including: randomly generating an initial population P, which consists of a group of individuals with microgrid network topology structures and heterogeneous hardware unit scheduling strategies, each individual corresponds to a decision variable x, and the population size is N; performing non-dominated sorting on the population P, and calculating the non-dominated level and congestion distance of each individual in the population based on the three optimization goals of energy consumption, computing power, and communication delay; using a binary tournament selection operator to select N individuals from the population P to generate a parent population P parent ; For the parent population P parent Perform crossover and mutation operations to generate the offspring population P offspring ; The parent population P parent and the offspring population P offspring Merge to obtain a merged population P of size 2Ncombine ; For the combined population P combine Repeat the selection, crossover and mutation operations until the preset termination conditions are met, perform non-dominated sorting on the last generation of population, and obtain non-dominated solutions as the Pareto optimal solution set for the microgrid network topology optimization problem; cluster the solutions in the Pareto optimal solution set, and according to the clustering results, use the TOPSIS method to select an optimal solution from each cluster to form a set of candidate topology solutions; including: performing maximum and minimum normalization on the Pareto optimal solution set, mapping the three target values ​​of energy consumption, computing power and communication delay of each solution to the interval [0, 1]; calculating the density distribution of the Pareto optimal solution set, and the density Among them, x i represents the i-th solution, K represents the size of the Pareto optimal solution set, ||x i -x j || represents the solution x i and x j Euclidean distance in normalized target space; select the point x with the largest density max As the first cluster center, let Ω1={x max}; Repeat the following steps until k cluster centers are obtained: Calculate each solution x i Minimum distance to the current cluster center: Select d i The largest solution x i * as the new cluster center, Ω t+1 =Ω t ∪{x i *}, t'=t+1; according to the Euclidean distance, each solution is divided into the class corresponding to the cluster center closest to it; for each class, the center of all solutions in the class is calculated As the new cluster center of the class; repeat until the clustering results converge and get k clusters; use the TOPSIS method to calculate the relative closeness C of the solution in each cluster to the ideal point i : in, Represents the solution x i and the optimal ideal point The Euclidean distance of the optimal ideal point is the minimum, maximum and minimum value of all solutions respectively; Represents the solution x i and the worst ideal point The Euclidean distance of the worst ideal point is the maximum, minimum and maximum values ​​of all solutions respectively for energy consumption, computing power and communication delay; the closeness C is selected from each cluster class. iThe largest solution constitutes a set of candidate topology solutions; based on the candidate topology solution set and combined with the microgrid operation requirements, the optimal topology solution is selected; the individuals corresponding to the optimal topology solution are decoded to obtain the microgrid network topology structure, device connection relationship and heterogeneous hardware unit scheduling strategy as the result output of the microgrid network topology optimization, and generate a microgrid network topology solution.

[0017] Compared with the existing technology, the advantages of this application are:

[0018] Traditional microgrid topology optimization is typically based on homogeneous data and struggles to handle the growing amount of heterogeneous data. This solution uses image recognition, NLP, and other technologies to collect multi-source heterogeneous data, build a unified heterogeneous database, and map unstructured data to structured data, enabling associative management of microgrid data and reducing data redundancy and access overhead. Existing methods mostly use simplified electrical models, making it difficult to accurately represent the complex relationships between microgrid topology and device parameters. This solution innovatively maps the microgrid into a graph structure and, leveraging the relational reasoning capabilities of graph neural networks, establishes an associative mapping between devices and topology, improving the representational capabilities and generalization performance of the topology model.

[0019] Differences in heterogeneous hardware can significantly affect the performance of microgrid topologies, while traditional methods generally fail to consider hardware heterogeneity. This solution addresses the heterogeneity of hardware by designing a hardware mapping strategy based on computing power and communication latency. It leverages reinforcement learning to dynamically optimize hardware scheduling, matching heterogeneous hardware capabilities with microgrid requirements and ensuring robust operation and efficient computing in heterogeneous environments. Previous topology optimization efforts mostly employed single-objective models, making it difficult to comprehensively balance multiple performance metrics. This solution uses the output of a graph neural network as a constraint set and the output of reinforcement learning as an optimization objective. It constructs a multi-objective function and uses a non-dominated sorting genetic algorithm to search for the Pareto optimal solution set, while simultaneously taking into account objectives such as energy consumption, robustness, and computational efficiency. The TOPSIS method is then combined to select the optimal topology that meets actual needs, achieving flexible optimization configuration of microgrids under multiple heterogeneous constraints. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flow chart of a flexible configuration method of a microgrid network topology based on matrix topology of the present application;

[0021] Figure 2 is an exemplary flow chart of obtaining pre-processed data of the present application;

[0022] Figure 3 is an exemplary flow chart of constructing a heterogeneous database of the present application;

[0023] Figure 4 This is an exemplary flow chart of the present application for generating an optimal scheduling strategy for heterogeneous hardware units. DETAILED DESCRIPTION

[0024] The method and system provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0025] like Figure 1 and Figure 2 As shown in Figure 1, to fully characterize the true state of a microgrid, multi-source heterogeneous data must be collected and preprocessed. First, the microgrid network's topology, device parameters, operating parameters, and heterogeneous feature data of heterogeneous hardware units are collected. Heterogeneous hardware units represent hardware devices within the microgrid with varying computing capabilities and communication latency, such as intelligent controllers and edge servers. Image recognition technology is used to automatically extract microgrid topology data. Specifically, using topological images such as electrical CAD drawings or single-line diagrams, image segmentation and feature extraction algorithms are used to identify nodes (such as busbars, switches, and transformers) and branches (such as transmission lines and transformers) within the diagrams. Attribute information, such as their location and connection relationships, is extracted to construct complete network topology data. This automated image recognition approach reduces manual annotation errors and labor intensity, improving the accuracy and efficiency of topological data. Natural language processing (NLP) technology is used to analyze the unstructured parameters of microgrid devices. Microgrid devices (such as wind turbines, photovoltaics, and energy storage systems) typically come with unstructured text data, such as nameplates and manuals, containing key parameters such as the device model, capacity, material, and lifespan. By leveraging NLP text mining and information extraction methods, such as regular expressions and named entity recognition, we can automatically extract key parameter information from equipment nameplates and manuals and convert it into structured equipment parameter data. This method can process unstructured text in various formats and languages, offering a high degree of automation and reducing the risk of manual entry errors.

[0026] Microgrid operating parameters are collected in real time through data acquisition devices. IoT sensors such as smart meters and microMUs sample electrical parameters such as voltage, current, and active / reactive power at each node and branch of the microgrid at a constant frequency. Data quality testing and exception handling are also used to cleanse and correct missing and outliers in the collected data, improving the integrity and reliability of the operating parameter data. High-quality, real-time operating data reflects the dynamic operating status of the microgrid and provides decision support for subsequent topology optimization. Data fusion algorithms are used to correlate the performance parameters of heterogeneous hardware. Microgrids deploy communication and computing hardware from different manufacturers and models. Their technical manuals and test reports contain key characteristics reflecting hardware heterogeneity, such as CPU frequency, memory capacity, cache size, communication bandwidth, and latency. Data fusion algorithms, such as similarity matching and entity alignment, are used to correlate hardware data from different sources and formats, extracting heterogeneous characteristic metrics such as hardware computing power and communication latency. This fused heterogeneous characteristic data can quantify hardware performance differences and guide heterogeneity-aware microgrid topology optimization.

[0027] like Figure 3As shown in the figure, a heterogeneous microgrid database is constructed based on preprocessed multi-source heterogeneous data using different database technologies to adapt to the data's structuredness and access characteristics. This heterogeneous database contains structured, semi-structured, and unstructured data. Data mapping enables the associated management of these data types, including the use of a relational database to store microgrid topology data. A microgrid topology consists of nodes and branches, which have a fixed attribute structure and are suitable for structured storage using two-dimensional tables. A node table (Node) and a branch table (Branch) are designed to store node and branch attribute information, respectively. The node table contains the following fields: node ID, which serves as the primary key and uniquely identifies each node; name, such as "Substation A"; type, such as "Bus" or "Switch"; and region, which represents the geographic region in which the node is located. The node table provides a complete description of each node and its attributes in the microgrid topology. The branch table contains the following fields: the branch ID serves as the primary key, uniquely identifying each branch; the start and end nodes represent the branch's starting and ending points, respectively, and are linked to the node IDs in the node table by foreign keys; the line type represents the branch's conductor type, such as "overhead line" or "cable"; and the length represents the branch's physical length. The branch table describes the connection relationships between nodes and the line properties. Relational databases provide a powerful SQL query language, making it easy to query and modify topological data. SQL statements can be used to query all nodes within a region, all adjacent branches of a node, and so on. Furthermore, the relational database's indexing and constraint mechanisms ensure data consistency and integrity, avoiding data redundancy and anomalies. Furthermore, because relational databases naturally support the storage and query of graph data, graph theory algorithms can be applied directly within the database for network topology analysis. SQL statements can be used to implement algorithms such as depth-first search and shortest path calculation for analyzing microgrid connectivity and path optimization.

[0028] A document-based database is used to store microgrid device parameter data. Unlike topological structures, the attribute structure of device parameters is relatively flexible and changeable. The parameter names and quantities may vary across different device types, making semi-structured documents suitable for storage. A device document collection was designed, with each document representing a device and containing various parameter information. The document fields include: device ID, which uniquely identifies the document; model, which represents the device's model and specifications; capacity, which represents the device's rated capacity; and rated parameters, which represent other rated indicators such as voltage and current. Because documents are a loose data structure, different parameter fields can be flexibly added for different devices without modifying the entire collection's schema. Document databases provide a powerful query language that supports both structured and unstructured queries on document content. Queries can be used to match devices of a specific model, count the number of devices of different capacity levels, and more. The schemaless nature of document databases makes it easy to accommodate the scalability and diversity of device parameters, adding parameters for new device types without requiring database reconstruction.

[0029] An object storage system is used to store unstructured data, such as nameplates and manuals, for microgrid equipment. This data typically exists in the form of large object files like images and PDFs, lacking a fixed structure or schema, making it unsuitable for relational or document-based databases. Object storage is an object-oriented data storage architecture that stores data as objects in a flat address space. Each object consists of a data body and metadata. The data body is the actual content of the object, such as the binary data of an image or PDF file; metadata are key-value pairs describing the object's properties, such as the file name, type, size, and creation time. Object storage allows unstructured equipment data to be stored directly as objects, without having to worry about its internal structure and organization. Object storage provides a highly scalable and cost-effective storage solution. Its distributed architecture allows for easy expansion of storage capacity and throughput to accommodate the storage needs of massive amounts of unstructured data. Furthermore, object storage offers low data redundancy and storage costs through optimized data replication and fault tolerance. This makes it possible to cost-effectively store large amounts of equipment nameplate and manual data. Object storage also provides flexible metadata management capabilities. Custom metadata tags, such as device ID, nameplate type, and upload time, can be added to each object to facilitate subsequent data retrieval and management. Metadata can be stored and accessed independently of the object, enabling quick querying and filtering of objects based on specific attributes without having to retrieve the entire object's contents. Furthermore, object storage supports versioning, retaining multiple historical versions of an object. This is particularly useful in scenarios where device nameplates and manuals are frequently updated, allowing data change history to be tracked and restored to previous versions when necessary. Versioning ensures data traceability and resilience, improving system reliability. For data access, object storage provides a RESTful API based on HTTP / HTTPS for convenient object upload, download, and management. Unstructured device data can be accessed and manipulated using standard HTTP requests, such as PUT, GET, and DELETE. Object storage also supports a rich set of access control and security mechanisms, including authentication, permission control, and data encryption, ensuring data security and privacy.

[0030] A time series database is used to store time-series measurement data of microgrid operating parameters. Operating parameters such as voltage, current, and power are time-varying numerical sequences characterized by large data volumes, frequent writes, and frequent aggregate queries. This makes them well-suited for optimized storage and querying using a time series database. A time series database is a database system specifically optimized for the storage and querying of time series data. It uses timestamps as the primary data dimension, supporting fast data writes and aggregate queries. A table of operating parameter measurement points is designed, with each measurement point containing fields such as timestamp, numeric value, and quality stamp, representing the data acquisition time, measurement value, and data quality status, respectively. A time series database utilizes columnar storage and compression technology to efficiently store large amounts of time series data. Data in the same time series are grouped together, reducing disk I / O operations and improving write and query performance. Furthermore, the database utilizes specific compression algorithms, such as delta encoding and run-length encoding, to significantly reduce data storage space and save storage costs. For data writes, the database provides batch and streaming write interfaces to support highly concurrent data insertion scenarios. Data from multiple measurement points can be written in batches to reduce the number of network interactions; or streaming writing can be used to continuously write measurement point data to the database in real time. The time series database also supports data retention policies, which can automatically delete expired historical data and control the data life cycle. In terms of data query, the time series database provides a rich set of aggregation functions and query languages, which can facilitate time series data analysis. You can use built-in aggregation functions such as sum, average, maximum and minimum values ​​to summarize and count measurement point data over a period of time; you can also use SQL-like query languages ​​to perform complex data filtering and calculations based on time range, measurement point ID and other conditions. The time series database also supports technologies such as Down Sampling, which can downsample high-frequency data to speed up query response speed.

[0031] A relational database is used to store the structured feature data of heterogeneous hardware. Heterogeneous hardware includes edge computing nodes, gateways, communication links, etc., which have some inherent performance indicators, such as computing power and communication latency. These indicators have a certain attribute structure and are suitable for normalized storage using two-dimensional tables in relational databases. A hardware feature table (Hardware Feature) is designed to store the performance feature data of different hardware. The table contains the following fields: Hardware ID (Hardware ID): Serves as the primary key to uniquely identify each hardware device. CPU Frequency (CPU Frequency): Indicates the computing power of the hardware, such as the processor's main frequency. Memory Size (Memory Size): Indicates the memory capacity of the hardware. Network Bandwidth (Network Bandwidth): Indicates the network transmission capability of the hardware. Latency (Latency): Indicates the communication latency characteristics of the hardware. Other related fields include storage capacity, energy consumption, etc. The hardware feature table allows the performance indicators of heterogeneous hardware to be stored in a structured manner. This standardized storage method has the following advantages: Easy to query and compare: You can use SQL statements to easily query and compare the performance indicators of different hardware, such as finding hardware with a CPU frequency greater than a certain threshold, or sorting hardware by memory size. Support for indexes and constraints: Relational databases provide index and constraint mechanisms. You can create indexes on key fields such as hardware IDs to speed up data retrieval and filtering; at the same time, you can set non-null, unique and other constraints on fields to ensure data integrity and consistency. Easy to use for statistics and analysis: You can use SQL aggregate functions such as AVG, MAX, MIN, etc. to perform statistical analysis on hardware feature data, such as calculating the average CPU frequency, finding the hardware with the largest memory, etc. In short, storing the structured feature data of heterogeneous hardware in a relational database provides a standardized storage method, facilitates data query, comparison and analysis, and provides data support for hardware performance evaluation and selection in heterogeneous environments.

[0032] Mapping relationships need to be established within heterogeneous databases to connect different databases. Since heterogeneous data is stored in multiple databases, such as relational databases, document databases, and object stores, a mechanism is needed to link these seemingly independent data sets and form semantic connections. The specific implementation of this mapping relationship depends on the database type and data model. For relational databases, foreign keys can be used to establish relationships between tables. For example, a device ID field can be added to the node table, acting as a foreign key to the device ID field in the device document collection. This allows nodes to be associated with device parameters, providing information about the device associated with each node. For document databases and object stores, associated IDs or references can be embedded within documents or objects. A node ID field can be added to the device document to indicate the node to which the device belongs; a node ID or device ID can be added to the metadata of the object store to indicate the node or device to which the object corresponds. This embedded association method allows data from different databases to be linked. In addition to using foreign keys and embedded references, mapping relationships between data can also be maintained within application-layer code. At the application layer, nodes can be associated with their operating status parameters by mapping node IDs to measurement point IDs between the node table and the operating parameter measurement point table. While this approach requires additional code implementation, it offers greater flexibility and customizability. The ultimate goal of establishing mapping relationships is to enable cross-database associations and queries. By associating heterogeneous data, complex joint queries and data analysis are possible. Device parameters and operating status data for nodes within a specific area can be queried, and the results can be visualized alongside the network topology. Furthermore, the relationship between a node's hardware characteristics and its connected branches and devices can be analyzed to optimize network topology and resource allocation.

[0033] Based on the data in the heterogeneous database, the microgrid network and devices are mapped into a graph structure to construct a graph neural network model. To extract microgrid topology data and construct a network topology graph, the microgrid network topology data is extracted from the node and branch tables in the heterogeneous database and mapped into a graph structure. First, each row of data in the node table is traversed, and each node is mapped into a node in the graph structure. The node's unique identifier (ID) and other attribute information, such as node name and node type, remain unchanged and are directly used as attributes of the graph node. Through this mapping, all nodes in the node table are converted into nodes in the graph structure. Next, each row of data in the branch table is traversed, and each branch is mapped into an edge in the graph structure. The branch table typically contains fields such as the starting node ID (From Node ID) and the ending node ID (To Node ID), indicating the two nodes connected by the branch. Based on these fields, the corresponding starting and ending nodes are found in the graph structure, and an edge is created between them. Edge attributes, such as branch type, length, and capacity, can also be stored as edge attributes in the graph structure. Through the above steps, the data in the node table and branch table are mapped into a graph structure, resulting in an undirected graph representing the microgrid network topology. The nodes in the graph represent microgrid nodes, such as busbars, switches, and transformers; the edges represent the physical connections between nodes, such as lines and cables. This undirected graph fully describes the microgrid network topology, including connectivity and adjacency relationships between nodes. This graph structure facilitates various topological analyses and algorithm applications, such as connectivity checking, shortest path calculation, and key node identification.

[0034] To add device parameters as node attributes, it is necessary to add the device parameters as attributes to the corresponding microgrid network nodes based on the mapping relationship between the node table and the device document collection (DeviceCollection). First, traverse each node in the graph structure. For each node, find the corresponding row in the node table through the node's unique identifier (ID) to obtain the device ID (Device ID) associated with the node. Then, use the obtained device ID to find the corresponding device document in the device document collection. Device documents are usually stored in JSON or BSON format and contain various parameter information of the device, such as device model, capacity, rated parameters, etc. Parse the device document and extract the required device parameter information. Next, add the extracted device parameter information as attributes to the corresponding graph node. This can be achieved by adding new key-value pairs in the attribute dictionary or attribute object of the graph node. You can add "deviceType" to represent the device model, "capacity" to represent the device capacity,

[0035] "ratedVoltage" indicates the rated voltage, for example. Through the above steps, device parameter information is associated with nodes in the graph structure, enriching the node attribute information. Now, each graph node contains not only basic node properties but also detailed parameter information for the associated device. This approach of using device parameters as node attributes allows direct access and utilization of device-level information within the graph structure. Nodes can be filtered and sorted based on device capacity, grouped and clustered by device type, and device parameters can be used for power flow calculations and fault analysis.

[0036] To add operating parameters as node and edge attributes, the operating parameters must be added as attributes to the corresponding microgrid network nodes and branches based on the mapping between the node table, branch table, and operating parameter measurement point table. First, for each node in the graph structure, the corresponding row in the node table is searched using the node's unique identifier (ID) to obtain a list of measurement point IDs associated with the node. A node may be associated with multiple measurement points, which collect different operating parameters for that node. Then, the obtained list of measurement point IDs is traversed. For each measurement point ID, the corresponding row in the operating parameter measurement point table is searched to obtain the operating parameter value for that measurement point. Operating parameters may include voltage, current, active power, reactive power, etc., depending on specific monitoring requirements and data availability. Next, the obtained operating parameter values ​​are added as attributes to the corresponding graph nodes. Similar to device parameters, new key-value pairs can be added to the graph node's attribute dictionary or attribute object, such as "voltage" for voltage, "current" for current, and "active power" for active power. For each edge in the graph, the corresponding row in the branch table is searched using the edge's start and end node IDs to obtain the list of measurement point IDs associated with the branch. A branch may be associated with multiple measurement points, which collect different operating parameters for the branch. The obtained list of measurement point IDs is then traversed, and for each measurement point ID, the corresponding row is searched in the operating parameter measurement point table to obtain the operating parameter value for that measurement point. Branch operating parameters may include flow, loss, current, and other parameters, depending on specific monitoring requirements and data availability. Finally, the obtained operating parameter values ​​are added as attributes to the corresponding graph edge. Similar to node attributes, new key-value pairs can be added to the graph edge's attribute dictionary or attribute object, such as "flow" for flow, "loss" for loss, and "current" for current. Through these steps, operating parameters are associated with nodes and edges in the graph, enriching the dynamic information of the microgrid network model. This approach of using operating parameters as node and edge attributes enables direct access and analysis of the microgrid's real-time operating status within the graph. It can calculate the voltage amplitude and phase angle of the node and evaluate the voltage quality of the node; it can calculate the power flow and loss of the branch and optimize the power flow distribution of the network; it can perform state estimation and fault location based on the operating parameters of the node and edge.

[0037] To add heterogeneous hardware features as node attributes, the features of the heterogeneous hardware must be added as attributes to the corresponding microgrid network nodes based on the mapping relationship between the node table and the hardware feature table (HardwareFeature). First, each node in the graph structure is traversed. For each node, the node's unique identifier (ID) is used to search the corresponding row in the node table to obtain the node's associated hardware ID (Hardware ID). Then, using the obtained hardware ID, the corresponding row in the hardware feature table is searched to obtain the characteristic information of the hardware device. Hardware features may include CPU frequency, memory size, network bandwidth, latency, etc., depending on the specific hardware type and performance indicators. Next, the obtained hardware feature information is added as attributes to the corresponding graph node. Similar to device parameters and operating parameters, new key-value pairs can be added to the attribute dictionary or attribute object of the graph node, such as "CPU Frequency" for CPU frequency, "Memory Size" for memory size, "Network Bandwidth" for network bandwidth, and "Latency" for latency. Through these steps, the characteristic information of the heterogeneous hardware is associated with the nodes in the graph structure, further enriching the node attribute information. Each graph node now contains not only the microgrid's business-level topology, device parameters, and operating status, but also the performance characteristics of the underlying heterogeneous hardware. This approach, incorporating heterogeneous hardware characteristics as node attributes, allows for the comprehensive consideration of both the microgrid's business characteristics and hardware performance within the graph structure. This allows for optimized task allocation and scheduling based on node computing power and network bandwidth; optimal data storage and transmission strategies can be configured based on node memory size and latency; and adaptive control and optimization algorithms can be designed leveraging the characteristics of heterogeneous hardware.

[0038] A graph neural network (GNN) model is constructed based on the microgrid network topology graph constructed above, as well as node and edge attribute information, to learn and analyze microgrid characteristics. First, microgrid network nodes are mapped as GNN input layer nodes, and microgrid network branches are mapped as GNN edges. The feature vectors of the input layer nodes are initialized with node attribute information, including device parameters, operating parameters, and heterogeneous hardware characteristics. These attributes are converted from discrete attributes into continuous feature vectors through an embedding layer. Next, the GNN's hidden layer and aggregation function are set. The hidden layer learns the node's feature representation, while the aggregation function aggregates the feature information of neighboring nodes. Common aggregation functions include summation, averaging, and max pooling. The GNN iteratively aggregates and updates features, ensuring that each node's feature vector not only contains its own attribute information but also incorporates the feature information of neighboring nodes, capturing the influence of network topology. Finally, the GNN's output layer generates predictions based on the node's feature vectors. Here, the output layer is designed to predict the correlation between the microgrid network topology and device parameters. By learning the interactive effects of network structure and device parameters, GNN can discover implicit association patterns, such as the matching degree between device parameters and network topology, and the impact of device parameters on network performance.

[0039] In a specific embodiment of the present application, there is a microgrid network topology diagram containing 10 nodes, wherein the nodes are represented as N1, N2, ... N 10 Each node represents a microgrid device, such as a photovoltaic power station, a wind turbine, an energy storage battery, etc. The connection between nodes represents the power line. There are 15 edges, which are represented as E1, E2, ..., E 15. For each node, the following attribute information is collected: equipment type: photovoltaic power station (PV), wind turbine (WT), energy storage battery (ES), load (LD); equipment capacity: in kW, indicating the rated power of the equipment; rated voltage: in kV, indicating the rated voltage of the equipment; CPU frequency: in GHz, indicating the CPU main frequency of the equipment controller; memory size: in GB, indicating the memory capacity of the equipment controller. For each edge, the following attribute information is collected: voltage amplitude: in kV, indicating the real-time voltage amplitude of the line; current amplitude: in A, indicating the real-time current amplitude of the line; active power: in kW, indicating the real-time active power of the line; reactive power: in kVar, indicating the real-time reactive power of the line. First, the attribute information of the node is encoded into a feature vector. For device types, one-hot encoding is used to convert them into 4-dimensional binary vectors. Photovoltaic power plants are encoded as [1, 0, 0, 0], wind turbines as [0, 1, 0, 0], energy storage batteries as [0, 0, 1, 0], and loads as [0, 0, 0, 1]. For device capacity, rated voltage, CPU frequency, and memory size, their values ​​are directly used as elements of the feature vector. Therefore, the feature vector dimension for each node is 8.

[0040] Next, set the hidden layer and aggregation function of the GNN. A two-layer MLP is used as the hidden layer, with 16 neurons in the first layer and 8 neurons in the second layer. The averaging function is selected as the aggregation function, averaging the feature vectors of neighboring nodes. The GNN computational process is as follows: Initialize the node feature vector and encode the node attributes into an 8-dimensional vector. For each node, average its feature vector with the feature vectors of its neighboring nodes according to edge weights to obtain an aggregated feature vector. Edge weights can be calculated based on edge attribute information, such as voltage amplitude and current amplitude. The aggregated feature vector is input to the first MLP layer, where it undergoes a nonlinear transformation to obtain a 16-dimensional hidden feature vector. The hidden feature vector is again subjected to neighbor aggregation to obtain a new aggregated feature vector. The aggregated feature vector is input to the second MLP layer, where it undergoes a nonlinear transformation to obtain a final 8-dimensional feature vector. Repeat steps 2-5 several times, using the final feature vector obtained in each iteration as input. Iterate three times. Finally, set the GNN output layer to predict the match between device parameters and network topology. To predict the suitability of energy storage battery capacity parameters within the current network topology, an MLP is used as the output layer. The final feature vector of the energy storage battery node is used as input. After passing through a fully connected layer and a sigmoid activation function, the algorithm outputs a matching score between 0 and 1. The closer the matching score is to 1, the more suitable the current capacity parameters are for the current network topology. During the training phase, a batch of training samples is prepared. Each sample includes a microgrid network topology, the energy storage battery capacity parameters, and the corresponding matching labels (given by experts or statistically derived from historical data). The mean squared error (MSE) is used as the loss function to calculate the difference between the matching score output by the GNN and the true label. The GNN parameters are then updated using a backpropagation algorithm. After multiple rounds of iterative training, the GNN learns the correlation between the network topology and device parameters, predicting the optimal capacity parameters for the energy storage battery in the new microgrid network. Furthermore, the node feature vectors learned by the GNN can be analyzed to identify key nodes and branches that have a significant impact on energy storage battery capacity, providing a reference for grid planning and construction.

[0041] like Figure 4As shown, different mapping strategies are set based on the heterogeneous characteristics of different heterogeneous hardware units. A reinforcement learning algorithm is then used to construct a scheduling model for these units. The computing power and communication latency data for these units must be extracted from the hardware feature table. The hardware feature table is stored in CSV format, with each row corresponding to a heterogeneous hardware unit and columns including attributes such as hardware type, clock frequency, number of cores, number of CUDA cores, memory bandwidth, communication protocol, and communication latency. The hardware feature table CSV file is read and the data is loaded into an in-memory data structure, such as a list or array. Each element corresponds to an attribute tuple for a heterogeneous hardware unit. The heterogeneous hardware unit list is traversed, and branch decisions are made based on the hardware type attribute to extract the corresponding computing power metrics. If the hardware type is "CPU," the clock frequency and core count attributes are extracted. The peak floating-point computing power of the CPU is calculated using the formula: CPU peak FLOPS = freq * cores * 16. Here, each CPU clock cycle can execute 16 floating-point operations. If the hardware type is "GPU", extract the CUDA core number cuda_cores and memory bandwidth attributes according to the formula: GPU peak

[0042] FLOPS = cuda_cores * bandwidth * 2; Calculate the peak floating-point computing power of the GPU in FLOPS. Each CUDA core can perform two floating-point operations simultaneously. If the hardware type is "FPGA" or "ASIC," estimate its peak FLOPS based on the hardware specifications and benchmark test results. For a particular FPGA, its peak FLOPS can be obtained by consulting the datasheet or running a specialized performance test program. Store the calculated peak FLOPS in the attribute tuple of the corresponding heterogeneous hardware unit, for example, hardware_specs[i]['flops'] = flops. Iterate through the list of heterogeneous hardware units again and extract the inter-device communication latency attribute: If the communication protocol is "PCIe," set the communication latency to a predefined constant, such as 0.1ms: latency = 0.1; if the communication protocol is "Ethernet," set the communication latency to a predefined constant, such as 1ms: latency = 1.0; for other communication protocols, estimate the communication latency based on the specific network topology and inter-device communication protocol. For InfiniBand-based communication, latency can be on the order of 0.01ms; for TCP / IP-based communication, latency can be on the order of 1-10ms. The estimated communication latency is stored in the attribute tuple corresponding to the heterogeneous hardware unit, for example, hardware_specs[i]['latency'] = latency. This generates a list of heterogeneous hardware units, hardware_specs, where each element is an attribute tuple containing key performance indicators such as hardware type, peak FLOPS, and communication latency. This data can be used to subsequently design heterogeneous hardware mapping strategies and build a reinforcement learning environment.

[0043] Set the corresponding mapping strategy according to the computing power and communication latency data of heterogeneous hardware units. Define the computing power threshold and communication latency threshold, named FLOPS_THRESHOLD and LATENCY_THRESHOLD respectively. Let FLOPS_THRESHOLD be 10 TFLOPS and LATENCY_THRESHOLD be 0.5 ms. Traverse the list of heterogeneous hardware units hardware_specs. For each hardware unit, extract its peak FLOPS and communication latency attributes: flops = hardware_specs[i]['flops']; latency = hardware_specs[i]['latency']; Compare the peak FLOPS with the computing power threshold and the communication latency with the latency threshold: If the conditions are met: flops > FLOPS_THRESHOLD and latency < LATENCY_THRESHOLD, then map this heterogeneous hardware unit to the hidden layer node of the graph neural network model. The mapping result can be stored in a dictionary, with the unique identifier of the hardware unit as the key and "hidden" as the value, indicating the hidden layer node: mapping[hardware_id] = "hidden"; where hardware_id can be the number or name of the hardware unit, used to uniquely identify a hardware unit. If the above conditions are not met, that is, flops <= FLOPS_THRESHOLD or latency >= LATENCY_THRESHOLD, then map this heterogeneous hardware unit to the input layer node of the graph neural network model.

[0044] Similarly, store the mapping result in a dictionary, with the unique identifier of the hardware unit as the key and "input" as the value, indicating the input layer node: mapping[hardware_id] = "input". After the above steps, a mapping dictionary mapping from heterogeneous hardware units to graph neural network node types is obtained. For the hardware units with the value of "hidden" in mapping, assign them to the hidden layer of the graph neural network to perform computationally intensive feature aggregation and update operations. For the mapping result mapping = {"GPU_0": "hidden",

[0045] "ASIC_1": "hidden"}, the two high-performance hardware units GPU_0 and ASIC_1 are used for hidden layer calculations of the graph neural network. For the hardware unit with the value "input" in the mapping, it is assigned to the input layer of the graph neural network to provide the initial feature vector, perform data preprocessing and communication tasks. For the case where the mapping result is mapping = {"CPU_0": "input", "FPGA_1": "input"}, the two hardware units CPU0 and FPGA1 are used for input layer calculations and data preparation of the graph neural network. In subsequent steps, the mapping dictionary mapping will be used to select appropriate heterogeneous hardware units for different levels of the graph neural network and build an efficient computing and communication scheduling scheme. At the same time, mapping also provides an important basis for the design of the state and action space of the reinforcement learning environment.

[0046] Initialize the state space, action space, and reward function of the reinforcement learning environment according to the mapping strategy of the heterogeneous hardware units. Initialization of the state space: Define the working state vector hardware_state of the heterogeneous hardware units, including properties such as computing load, memory usage memory_util, and power consumption. For N heterogeneous hardware units, hardware state It can be represented as an N*3 matrix:

[0047] Among them, load i 、memory_util i 、power i Represent the computational load, memory usage, and power consumption of the i-th hardware unit respectively. Define the microgrid system operation state vector grid state , including network topology, device parameters, real-time operation data runtime and other attributes. For M microgrid devices, grid_state can be represented as an M*3 matrix: Among them, topology i 、parameters i 、runtime i Represent the network topology, device parameters and real-time operation data of the i-th microgrid device respectively. state and grid state Spliced ​​into a (N+M)*3 state matrix state, as the observation value of the reinforcement learning agent: Initialization of action space: define task assignment action task allocation, which means that different computing tasks of the graph neural network are assigned to heterogeneous hardware units for execution. There are T computing tasks and N heterogeneous hardware units, task allocation Can be represented as a T-dimensional discrete vector: task allocation =[unit1,unit2,......,unit T ]; among them, unit i Indicates that the i-th computing task is assigned to the unit i It is executed on multiple hardware units and its value range is [0, N-1].

[0048] Define node mapping action node mapping , which means mapping different nodes of the graph neural network to heterogeneous hardware units for storage and calculation. The graph neural network has V nodes, node mapping Can be represented as a V-dimensional discrete vector: node mapping =[unit1,unit2,......,unit V ]; among them, unit i Indicates mapping the i-th node to the unit i The value range is [0, N-1]. allocation and node mapping spliced ​​into a (T+V)-dimensional discrete action vector action, as the action space of the reinforcement learning agent: action = [task allocation ,node mapping Initialization of the reward function: define the computing power evaluation function compute reward , assign actions according to tasks allocation And the peak FLOPS of heterogeneous hardware units, the execution speed and efficiency of computing graph neural network computing tasks. reward It is the inverse of the task execution time, in TFLOPS / s. Define the communication delay evaluation function latency penalty , according to the node mapping action node mapping The communication delay between heterogeneous hardware units is calculated to calculate the delay overhead of data transmission.

[0049] is the weighted sum of the communication delays between nodes, in ms. Define the reward function as compute reward and latency penalty The weighted combination of α and β is adjusted according to the specific application requirements: reward = α × compute reward -β×latency penalty; Among them, the larger the value of α, the more emphasis is placed on computing power; the larger the value of β, the more emphasis is placed on communication latency.

[0050] The Q-Learning reinforcement learning algorithm is used to learn the optimal scheduling strategy of heterogeneous hardware units through the interaction between the intelligent agent and the environment. Discretization of state space: The microgrid operating state grid state and heterogeneous hardware working status hardware state As the state input of the reinforcement learning environment. state and hardware state Perform appropriate discretization to convert the continuous state space into a discrete state space. For network topology, it can be discretized into K categories, each category corresponds to a typical topology; for device parameters and runtime parameters, it can be discretized into L levels, each level corresponds to a parameter interval; for computing power flops and communication latency, it can be discretized into M levels, each level corresponds to a performance interval. state and hardware state Combined into a state dictionary state dict , as the row index of the Q value table: state_dict = {"topology": topology_category,

[0051] "parameters": parameters_level, "runtime": runtime_level, "flops": flops_level, "latency": latency_level}.

[0052] Discretization of action space: Scheduling decisions (task assignment) of heterogeneous hardware units allocation and node mapping node mapping ) is defined as the action of the reinforcement learning algorithm. allocation and node mapping Perform appropriate discretization to transform the continuous action space into a discrete action space. allocation , which can be discretized into P typical task allocation schemes; for node mapping node mapping , it can be discretized into Q typical node mapping schemes. The discretized task allocation and node mappingCombine into an action dictionary action_dict, which serves as the column index of the Q-value table: action_dict = {"task_allocation": task_allocation_plan, "node_mapping": node_mapping_plan}. Design of reward function: Use the performance indicators of the graph neural network model (such as computing speed, communication delay, energy consumption, etc.) as evaluation indicators to construct the reward function of the reinforcement learning algorithm. For computing speed, it can be measured by the inverse of the task execution time, in TFLOPS / s; for communication delay, it can be measured by the weighted sum of the data transmission time between nodes, in ms; for energy consumption, it can be measured by the product of the power consumption of the hardware unit and the task execution time, in J. Combine these performance indicators into a weighted sum as the reward function of the reinforcement learning algorithm: reward = w1×compute speed -w2×communication latency -w3×energy consumption ; Among them, w1, w2, w3 are weight coefficients, which are adjusted according to specific application requirements.

[0053] Initialization and update of the Q value table: Initialize a state dictionary state dict and action dictionary action dict The Q value table Q of the Cartesian product size table , and initialize all Q values ​​to 0. In each round of training iteration, the agent is based on the current state state dict , use the ε-greedy strategy to select an action action dict , execute the scheduling decision. After executing the scheduling decision, the agent observes the next state next_state of the environment feedback dict and reward value.

[0054] According to the update formula of the Q-Learning algorithm, update the Q value estimate of the corresponding state-action pair in the Q value table:

[0055] Among them, learning rate is the learning rate, discount factor is the discount factor, max(Q table [next_state dict ]) is the maximum Q value of the next state. Generation of the optimal scheduling strategy: Repeat multiple rounds of training iterations until the Q value table converges or reaches the preset number of training rounds. After the training converges, for any state state dict, find the corresponding row in the Q value table and find the action with the largest Q value dict , which is the optimal scheduling decision under this state. The optimal scheduling decisions under all states are combined into a complete optimal scheduling policy dict , used to guide task allocation and node mapping of heterogeneous hardware units.

[0056] Build a scheduling model for heterogeneous hardware units and use the trained Q value table as the core component of the model. Input of the scheduling model: microgrid operation status grid dict , including network topology, device parameters, runtime parameters, etc. Heterogeneous hardware working status hardware state , including computing power flops, communication delay latency, etc. state and hardware state Combined into a state dictionary state dict , as the input of the scheduling model: state_dict = {"topology": topology_category,

[0057] "parameters": parameters_level, "runtime": runtime_level, "flops": flops_level, "latency": latency_level}; where topology_category, parameters_level, runtime_level, flops_level, and latency_level represent the discretized state values. Output of the scheduling model: optimal scheduling decisions for heterogeneous hardware units, including task allocation tasks allocation and node mapping node mapping . allocation and node mapping Combined into an action dictionary action_dict as the output of the scheduling model: action_dict = {"task_allocation": task_allocation_plan,

[0058] "node_mapping": node_mapping_plan}; among them, task_allocation_plan and node_mapping_plan respectively represent the discretized scheduling decision values.

[0059] Query of Q value table: Scheduling model is based on statedict As input, query the corresponding row in the Q value table Q_table. In this row of the Q value table, find the column with the largest Q value and the corresponding action dict This is the optimal scheduling decision under this state. dict As the output of the scheduling model. Application of the scheduling model: The trained Q value table Q table Save as the core component of the dispatch model, you can use Python's pickle library for serialization and deserialization. Integrate the dispatch model into the microgrid control system to monitor the microgrid operation status in real time. state and heterogeneous hardware working status hardware state When the microgrid control system needs to generate a heterogeneous hardware scheduling solution, the current grid state and hardware state Input into the scheduling model. The scheduling model queries the Q value table and outputs the corresponding optimal scheduling decision action dict , including task allocation

[0060] task_allocation plan and node mapping node_mapping plan The microgrid control system performs corresponding task allocation and node mapping operations according to the output of the scheduling model to realize the intelligent scheduling and control of heterogeneous hardware resources. Example scheduling process: The current microgrid operating state is grid_state = {"topology": "ring", "parameters": "medium", "runtime": "high"}, and the heterogeneous hardware working state is hardware_state = {"flops": "high", "latency": "low"}. After discretizing grid_state and hardware_state, the state dictionary state_dict = {"topology": 2,

[0061] "parameters": 1, "runtime": 3, "flops": 3, "latency": 0}. The scheduling model uses state_dict as input, searches the corresponding row in the Q-value table Q_table, finds the column with the largest Q value, and obtains the optimal scheduling decision action_dict = {"task_allocation": 1, "node_mapping": 2}. Based on action_dict, the microgrid control system sets the task allocation plan to task_allocation_plan = 1 and the node mapping plan to node_mapping_plan = 2, and executes the corresponding scheduling operations.

[0062] The preprocessed data is input into the graph neural network model to obtain the association between the microgrid network topology and device parameters as a constraint condition; the preprocessed data is input into the scheduling model to obtain the scheduling strategy of heterogeneous hardware units as the optimization target; based on the constraints and optimization targets, a multi-objective function for microgrid network topology optimization is constructed; Construction of constraints: The preprocessed data is input into the graph neural network model to obtain the association between the microgrid network topology and device parameters. The association relationship is represented as a constraint condition set C = {c1, c2, ....., c m}, where m represents the number of constraints. Each constraint c i This is a logical expression representing the device parameter requirements that the microgrid network topology must meet. c1: "Node A voltage level == Node B voltage level" indicates that nodes A and B must have the same voltage level. c2: "Line AB capacity >= Node A maximum load + Node B maximum load" indicates that the capacity of the line connecting nodes A and B must be greater than or equal to the sum of the maximum loads of the two nodes. Constraints evaluate to True or False and are true only if the microgrid network topology meets the device parameter requirements.

[0063] In a specific embodiment of the present application, a microgrid comprises four nodes (A, B, C, D) and four connecting lines (AB, BC, CD, DA). By inputting the preprocessed data into the graph neural network model, the following correlation relationship between the microgrid network topology and device parameters is obtained: the voltage levels of nodes A and B must be the same; the voltage levels of nodes B and C must be the same; the voltage levels of nodes C and D can be different; the capacity of line AB must be greater than or equal to the sum of the maximum loads of nodes A and B; the capacity of line BC must be greater than or equal to the sum of the maximum loads of nodes B and C; the capacity of line CD must be greater than or equal to the sum of the maximum loads of nodes C and D; the capacity of line DA must be greater than or equal to the sum of the maximum loads of nodes D and A. Based on these associations, a constraint condition set C = {c1, c2, c3, c4, c5, c6, c7} can be constructed, where: c1: "The voltage level of node A == the voltage level of node B"; c2: "The voltage level of node B == the voltage level of node C"; c3: "The voltage level of node C ≠ the voltage level of node D" (note: this is an inequality constraint); c4: "The capacity of line AB > = the maximum load of node A + the maximum load of node B"; c5: "The capacity of line BC > = the maximum load of node B + the maximum load of node C"; c6: "The capacity of line CD > = the maximum load of node C + the maximum load of node D"; c7: "The capacity of line DA > = the maximum load of node D + the maximum load of node A".

[0064] Equipment parameter data: Voltage level of node A: 10kV, maximum load: 50kW; Voltage level of node B: 10kV, maximum load: 80kW; Voltage level of node C: 10kV, maximum load: 60kW; Voltage level of node D: 20kV, maximum load: 100kW; Capacity of line AB: 150kW; Capacity of line BC: 200kW; Capacity of line CD: 250kW; Capacity of line DA: 180kW. For a given microgrid network topology and equipment parameters, the values ​​of the constraints can be calculated: c1 = true (the voltage levels of node A and node B are both 10 kV, the same); c2 = true (the voltage levels of node B and node C are both 10 kV, the same); c3 = true (the voltage level of node C is 10 kV, and the voltage level of node D is 20 kV, different); c4 = true (the capacity of line AB is 150 kW, which is greater than the sum of the maximum loads of node A and node B, 130 kW); c5 = true (the capacity of line BC is 200 kW, which is greater than the sum of the maximum loads of node B and node C, 140 kW); c6 = true (the capacity of line CD is 250 kW, which is greater than the sum of the maximum loads of node C and node D, 160 kW); c7 = true (the capacity of line DA is 180 kW, which is greater than the sum of the maximum loads of node D and node A, 150 kW).

[0065] Optimization target construction: The preprocessed data is input into the heterogeneous hardware unit scheduling model to obtain the scheduling strategy of the heterogeneous hardware unit. The scheduling strategy is represented as an optimization target set O = {o1,o2,o3}, corresponding to the three sub-targets of minimizing the energy consumption of the microgrid system, maximizing the computing power of the heterogeneous hardware units, and minimizing the communication delay. The energy consumption target o1 is obtained based on the operating parameter measurement point table in the heterogeneous database and is expressed as the sum of the active power of each node in the microgrid: Among them, P i (x) represents the active power of the i-th node under the topology and scheduling strategy x, and N represents the set of nodes in the microgrid. The computing power target o2 is obtained based on the computing power and scheduling status of the heterogeneous hardware units and is expressed as the weighted sum of the computing power of the heterogeneous hardware units:

[0066] Among them, a j represents the computing power of the jth heterogeneous hardware unit, M represents the set of heterogeneous hardware units, u j (x) is a 0-1 variable, representing the scheduling state of heterogeneous hardware unit j under decision x, u j (x) = 1 means scheduling, u j (x) = 0 means no scheduling. The communication delay target o3 is obtained based on the end-to-end delay of the communication link in the microgrid network and is expressed as the maximum value of the delay of all communication links:

[0067] Among them, t l (x) represents the end-to-end delay of the communication link l under the topology structure and scheduling strategy x, and L represents the set of all communication links in the microgrid network.

[0068] In a specific embodiment of the present application, a microgrid comprises four nodes (A, B, C, D), each of which is deployed with a heterogeneous hardware unit. By inputting preprocessed data into the heterogeneous hardware unit scheduling model, the following scheduling strategy is obtained: Heterogeneous hardware unit A: scheduled, with a computing power of 10 GFLOPS; Heterogeneous hardware unit B: scheduled, with a computing power of 8 GFLOPS; Heterogeneous hardware unit C: not scheduled, with a computing power of 6 GFLOPS; Heterogeneous hardware unit D: scheduled, with a computing power of 12 GFLOPS. Based on this scheduling strategy, an optimization objective set O = {o1, o2, o3} can be constructed, corresponding to the three sub-goals of minimizing microgrid system energy consumption, maximizing the computing power of heterogeneous hardware units, and minimizing communication latency.

[0069] Energy consumption target o1: The following data is obtained from the operating parameter measurement point table in the heterogeneous database: Active power of node A: P A (x) = 50kW; active power of node B: P B (x) = 30kW; active power of node C: P C (x) = 40kW; active power of node D: P D (x) = 60kW. Then the energy consumption target o1 can be expressed as:

[0070] Computing capacity target o2: Based on the computing capacity and scheduling status of the heterogeneous hardware units, the computing capacity target o2 can be calculated: Communication delay target o3: Get the following end-to-end delay data of the communication link in the microgrid network: The delay of link AB: t AB (x) = 10ms; delay of link BC: t BC (x) = 15ms; Link CD delay: t CD (x) = 20ms; delay of link DA: t DA (x) = 12ms. Then the communication delay target o3 can be expressed as: In summary, for a given microgrid network topology and heterogeneous hardware unit scheduling strategy x, an optimization objective set O = {o1,o2,o3}} is constructed, where: o1 = 180 kW, representing the energy consumption of the microgrid system; o2 = 30 GFLOPS, representing the computing power of the heterogeneous hardware units; and o3 = 20 ms, representing the maximum communication delay in the microgrid network.

[0071] Construction of a Multi-Objective Function: Based on the constraint set C and the optimization objective set O, a multi-objective function for microgrid network topology optimization is constructed: minF(x) = [f1(x), f2(x), f3(x)]; where x represents the decision variables for the microgrid network topology and the scheduling strategy for heterogeneous hardware units, and x = [topo, sche]. topo represents the microgrid network topology, and sche represents the scheduling strategy for heterogeneous hardware units. X represents the feasible region of decision variable x, which is determined by conditions such as the microgrid network's physical connections, device parameters, and hardware constraints. [f1(x), f2(x), f3(x)] represents the multi-objective function, which consists of three sub-objectives: energy consumption, computing power, and communication latency. The goal is to minimize energy consumption and communication latency while maximizing computing power.

[0072] In a specific embodiment of the present application, a multi-objective function for microgrid network topology optimization can be constructed based on the previously constructed constraint set C and optimization target set O. Decision variable x = [topo, sche], where: topo represents the microgrid network topology structure, which is a two-dimensional array, topo[i][j] = 1 indicates that there is a connection between node i and node j, and topo[i][j] = 0 indicates that there is no connection between node i and node j. sche represents the scheduling strategy of heterogeneous hardware units, which is a one-dimensional array, sche[i] = 1 indicates that heterogeneous hardware unit i is scheduled, and sche[i] = 0 indicates that heterogeneous hardware unit i is not scheduled. The constraint set C contains the following constraints: c1: topo[A][B] == topo[B][A] (the connection between node A and node B is bidirectional); c2: topo[B][C] == topo[C][B] (the connection between node B and node C is bidirectional); c3: topo[C][D] == topo[D][C] (the connection between node C and node D is bidirectional); c4: topo[D][A] == topo[A][D] (the connection between node D and node A is bidirectional); c5: sum(topo[i][j], i!= j)>=2, for alli (each node is connected to at least two other nodes); c6: sche[i] == 0or1, for alli (the scheduling state of heterogeneous hardware units can only be 0 or 1). The optimization objective set O consists of the following three sub-objectives: f1(x): minimize microgrid system energy consumption; f2(x): maximize the computing power of heterogeneous hardware units; and f3(x): minimize communication latency. The feasible region X of the decision variable x is determined by the following conditions: Microgrid network physical connectivity: the physical distance between nodes does not exceed a certain range, and the capacity of the transmission line meets the power transmission requirements between nodes. Device parameters: node voltage levels match, and the computing power and power consumption of heterogeneous hardware units meet requirements. Hardware constraints: the number of heterogeneous hardware units is limited, and the scheduling method must meet the constraints of the hardware architecture.

[0073] In summary, the multi-objective function of microgrid network topology optimization can be expressed as:

[0074] minF(x)=[f1(x),f2(x),f3(x)];Constraints:x∈X,c1(x)=true,c2(x)=true,

[0075] c3(x)=true,c4(x)=true,c5(x)=true,c6(x)=true. Among them, f1(x),f2(x),f3(x) are respectively

[0076] for: By solving the multi-objective function, we can obtain the microgrid network topology structure topo and the heterogeneous hardware unit scheduling strategy sche that meet the constraints, so that the energy consumption of the microgrid system is minimized, the computing power of the heterogeneous hardware units is maximized, and the communication delay is minimized.

[0077] An intelligent algorithm is used to solve the multi-objective function of microgrid network topology optimization and generate a microgrid network topology solution; input: microgrid node set: N = {N1, N2, N3, N4, N5}, heterogeneous hardware unit set: M = {M1, M2, M3, M4, M5}, optimization objectives: minimize energy consumption f1(x), maximize computing power f2(x), minimize communication delay f3(x), constraints: C = {c1, c2, c3, c4, c5, c6}, population size: N = 100, termination condition: maximum number of iterations T = 500, number of clusters: k = 3. Output: microgrid network topology structure topo best , heterogeneous hardware unit scheduling strategy sche best . Randomly generate the initial population P, each individual x i =[topo i ,sche i ] represents a microgrid network topology and heterogeneous hardware unit scheduling strategy. The size of the population P is N. Input: Microgrid node set: N = {N1, N2, ....., N n}, where n is the number of nodes; heterogeneous hardware unit set: M={M1,M2,......,M m}, where m is the number of hardware units; population size: N = 100; maximum number of iterations: T = 500; crossover probability: p c =0.8; mutation probability: p m =0.1. Output: Pareto optimal solution set of microgrid network topology optimization problem: P non_dominated Steps: Randomly generate the initial population P: The population P consists of N individuals, each of which is represented by x i =[topo i ,sche i ], where: topo i Represents the microgrid network topology, which is an n×n adjacency matrix. If there is a connection between node i and node j, then topo i [i][j]=1, otherwise 0; sche i Represents the scheduling strategy of heterogeneous hardware units, which is an m-dimensional binary vector. If hardware unit j is scheduled, then sche i [j] = 1, otherwise 0; for each individual x i , randomly generate topo i and sche i, ensuring that the generated topology is connected and satisfies the constraints of the problem. Perform non-dominated sorting on the population P: Calculate the number of each individual x i The objective function value: energy consumption f1(x i ), computing power f2(x i ) and communication delay f3(x i ); for any two individuals x i and x j , if x i All objective function values ​​are better than x j , then x i Dominate x j ; Perform non-dominated sorting on the individuals in the population P and obtain the non-dominated rank of each individual i and crowding distance distance_i ; Non-dominant rank i represents individual x i Rank i The smaller the individual x i The higher the priority, the crowding distance distance_i represents individual x i In the same non-dominated level, the greater the crowding_distance_i, the more likely individual x i The higher the priority, the more likely it is to be a parent population. parent :Initialize the parent population P parent is an empty set. Repeat N times: Randomly select two individuals x from the population P i and x j , if x i Non-dominated rank i Less than x j Non-dominated rank j , then x i Join P parent , if x i and x j The non-dominated rank of is the same, but x i crowding distance distance_i Greater than x j crowding distance

[0078] crowding distance_j , then x i Join P parent Otherwise, x j Join P parent . For the parent population P parent Perform crossover and mutation operations to generate the offspring population Poffspring : Crossover operation: with probability p c P parent The individuals in the pair are paired, and each pair of individuals x i =[topo i ,sche i ] and x j =[topo j ,sche j ] Generate two new individuals x as follows k and x l :In topo i and topo j Randomly select an intersection point on the top, exchange the parts behind the intersection point, and get topo k and topo l ; in sche i and sche j Randomly select an intersection point on the graph, exchange the parts after the intersection point, and get the scheme k and sche l ; The new individual x will be generated k =[topo k ,sche k ] and x l =[topo l ,sche l ]Add the offspring population P offspring . Mutation operation: P offspring Each individual x in i =[topo i ,sche i ], with probability p m Perform mutation: Topo i For each element in, if the random number is less than p m , then negate it (0 becomes 1, 1 becomes 0); i For each element in, if the random number is less than p m , then reverse it (0 becomes 1, 1 becomes 0); add the mutated individuals to the offspring population P offspring , the parent population P parent and the offspring population P offspring Merge to obtain a merged population P of size 2N combine , for the combined population P combine Repeat until the maximum number of iterations T is reached; perform non-dominated sorting on the last generation of population to obtain the non-dominated solution set P non_dominated , as the Pareto optimal solution set for the microgrid network topology optimization problem.

[0079] For the Pareto optimal solution set Pnon_dominated The solution x in i Perform maximum and minimum normalization: For each solution x i , calculate its normalized energy consumption f1'(x i ), computing power f2'(x i ) and communication delay f3'(x i ):

[0080] Get the normalized solution set P norm ={x1',x2',......,x K '}. Calculate the Pareto optimal solution set P norm Density distribution: For each normalized solution x i ', calculate its density ρ(x i '): Calculate x i 'with P norm Other solutions in x j 'Euclidean distance:

[0081] Calculate x i 'Density: Select the point x with the largest density max 'As the first cluster center, let Ω1={x max '}, repeat the following steps until k cluster centers are obtained: Calculate the normalized solution x for each i 'Minimum distance to the current cluster center w': Select d i The largest solution x i * as the new cluster center, Ω t+1 =Ω t ∪{x i *}, t'=t+1, according to the Euclidean distance, each normalized solution x i 'Divided into class C corresponding to its nearest cluster center j For each cluster class C j , calculate the center of all solutions in the class as the new cluster center of the class, repeat until the clustering results converge, and get k cluster classes C1, C2, ..., C k , using the TOPSIS method, for each cluster class C j The solution x in i ', calculate its relative closeness to the ideal point C i : Calculate the optimal ideal point and the worst ideal point For each solution x i ', calculate its difference from the optimal ideal point Euclidean distance and the worst ideal point Euclidean distance Calculate x i ''s relative closeness: From each cluster class C j Select the closeness C i The largest solution Construct a set of candidate topology solutions

[0082] Select the best topology solution x from the candidate topology solution set S' best' , define the evaluation indicators of microgrid operation requirements: Energy utilization rate: the utilization rate of renewable energy in the microgrid, expressed as E u ,Load balancing degree: the degree of load balance of each node in the microgrid, expressed as L b , Power supply reliability: The power supply reliability of the microgrid to important loads, expressed as R s , Operation and maintenance cost: The construction and operation and maintenance cost of the microgrid, expressed as C o For each topology solution x in the candidate topology solution set S' i ', calculate its scores on various evaluation indicators: Energy utilization score: Load balance score: Power supply reliability score: Operation and maintenance cost score: According to the microgrid operation requirements, determine the weight coefficient of each evaluation indicator: w E ,w L ,w R ,w C , satisfying w E +w L +w R +w C =1, calculate each candidate topology solution x i 'The comprehensive score F(x i '):

[0083] F(x i ')=w E ×E u (x i ')+w L ×L b (x i ')+w R ×R s (x i ')+w C ×C o (x i'), select the candidate topology with the highest comprehensive score F(x_i') ​​as the optimal topology solution x best' For the optimal topology solution x best' The decoding process is as follows: x best' Denormalize to get the optimal solution x in the original solution space best : Energy consumption: Computing power: Communication delay: From x best Extract the microgrid network topology topo best and heterogeneous hardware unit scheduling strategy sche best :topo best :x best The first n×n elements of represent the connection relationship between microgrid nodes; best :x best The last m elements of represent the scheduling strategy of heterogeneous hardware units; output microgrid network topology solution: {topo best ,sche best}.

Claims

1. A flexible configuration method for microgrid network topology based on matrix topology, characterized in that: include: Collect and preprocess microgrid network data, including network topology, device parameters, operating parameters, and heterogeneous characteristics of different heterogeneous hardware units. Heterogeneous hardware units represent hardware devices with different computing capabilities and communication delays in the microgrid network. Based on the preprocessed data, a heterogeneous database of microgrid networks and devices is constructed. The heterogeneous database contains structured data, semi-structured data, and unstructured data. Based on the data in the heterogeneous database, the microgrid network and devices are mapped into a graph structure to build a graph neural network model; According to the heterogeneous characteristics of different heterogeneous hardware units, different mapping strategies for heterogeneous hardware units are set, and a reinforcement learning algorithm is used to build a scheduling model for heterogeneous hardware units; The preprocessed data is input into the graph neural network model to obtain the correlation between the microgrid network topology and device parameters as constraints; The pre-processed data is fed into the scheduling model to obtain the scheduling strategy of the heterogeneous hardware units as the optimization target; According to the constraints and optimization objectives, a multi-objective function for microgrid network topology optimization is constructed; An intelligent algorithm is used to solve the multi-objective function of microgrid network topology optimization and generate a microgrid network topology solution; the topology solution includes the microgrid network topology structure, device connection relationship and scheduling strategy of heterogeneous hardware units.

2. The microgrid network topology flexible configuration method based on matrix topology according to claim 1, characterized in that: Collect data from the microgrid network and pre-process the collected data, including: Image recognition is used to identify the topology of the microgrid network and extract the nodes and branches of the microgrid network as network topology data; Natural language processing is used to parse the unstructured data of microgrid equipment to obtain the equipment model, capacity, and parameters as equipment parameter data. The unstructured data of microgrid equipment includes nameplates and instructions. Use data acquisition equipment to collect operating parameter data of the microgrid network, including voltage, current and power; A data fusion algorithm is used to correlate the technical manuals and test reports of heterogeneous hardware units to obtain heterogeneous feature data that reflects the performance differences of heterogeneous hardware units. The heterogeneous feature data includes computing power and communication delay.

3. The flexible configuration method for microgrid network topology based on matrix topology according to claim 2, characterized in that: Based on the preprocessed data, a heterogeneous database of microgrid networks and devices is constructed, including: According to the network topology data, a relational database is used to store the structured data of microgrid nodes and branches, and a node table and a branch table are established; Based on the equipment parameter data, a document-based database is used to store semi-structured data on equipment models, capacities, and parameters, and to establish an equipment document collection; Use object storage to store the unstructured data of microgrid equipment nameplates and manuals; According to the operating parameter data, a time series database is used to store the time series data of the microgrid voltage, current and power, and an operating parameter measurement point table is established; Based on the heterogeneous feature data of heterogeneous hardware units, a relational database is used to store the structured feature data of the computing power and communication delay of the heterogeneous hardware, and a hardware feature table is established; Establish mapping relationships between heterogeneous databases, and build heterogeneous databases of microgrid networks and devices based on the mapping relationships.

4. The flexible configuration method for microgrid network topology based on matrix topology according to claim 3, characterized in that: Establish mapping relationships between heterogeneous databases, including: Establish a mapping relationship between the node table and the device document collection, and associate the device parameters with the network topology; Establish mapping relationships between node tables, branch tables, and operating parameter measurement point tables, and associate operating parameters with network topology; A mapping relationship between the node table and the hardware feature table is established to associate heterogeneous hardware features with the network topology.

5. The flexible configuration method for microgrid network topology based on matrix topology according to claim 4 is characterized in that: Build a graph neural network model, including: According to the heterogeneous database of microgrid, data in the node table, branch table and device document collection are extracted, the microgrid network nodes are mapped into nodes of the graph structure, and the microgrid network branches are mapped into edges of the graph structure to obtain the microgrid network topology graph; According to the mapping relationship between the node table and the device document collection, the device parameters are added to the corresponding microgrid network nodes as the attributes of the graph structure nodes; According to the mapping relationship between the node table, branch table and operating parameter measurement point table, the operating parameters are added as attributes of the graph structure nodes and edges to the corresponding microgrid network nodes and branches respectively; According to the mapping relationship between the node table and the hardware feature table, the heterogeneous hardware features are added as attributes of the graph structure nodes to the corresponding microgrid network nodes; According to the microgrid network topology, as well as the attributes of nodes and edges, a graph neural network model of the microgrid is constructed.

6. The matrix topology-based microgrid network topology flexible configuration method according to claim 5, characterized in that: Based on the microgrid network topology, as well as the attributes of nodes and edges, a microgrid graph neural network model is constructed, including: Map the microgrid network nodes to the input layer nodes of the graph neural network, and map the microgrid network branches to the edges of the graph neural network; Initialize the feature vectors of the nodes in the input layer of the graph neural network based on the node attribute information; the node attribute information includes device parameters, operating parameters, and heterogeneous hardware characteristics; Set the hidden layer and aggregation function of the graph neural network, and update the feature vector of the node through feature aggregation; The output layer of the graph neural network is set to generate the association between the microgrid network topology and device parameters based on the node's feature vector.

7. The flexible configuration method for microgrid network topology based on matrix topology according to claim 5, characterized in that: Build a scheduling model for heterogeneous hardware units, including: Extract computing power and communication delay data of different heterogeneous hardware units based on the established hardware feature table; Based on the extracted data, set the mapping strategy for heterogeneous hardware units: Mapping heterogeneous hardware units with computing power greater than a preset computing power threshold and communication delay less than a preset communication delay threshold into hidden layer nodes in the graph neural network model to perform feature aggregation and update of the graph neural network; Mapping heterogeneous hardware units with computing power less than or equal to a preset computing power threshold and communication delay greater than or equal to a preset communication delay threshold as input layer nodes of the graph neural network to provide initial feature vectors; Initialize the reinforcement learning environment according to the mapping strategy: Define a state space to represent the working states of heterogeneous hardware units and the operating state of the microgrid system; Define an action space to represent the scheduling decision of heterogeneous hardware units. The scheduling decision includes task allocation and node mapping of heterogeneous hardware units. Define a reward function to represent the performance evaluation of the scheduling decision of heterogeneous hardware units. The performance evaluation includes the computing power and communication delay of the microgrid system. Using reinforcement learning algorithms, the optimal scheduling strategy for heterogeneous hardware units is learned through the interaction between the agent and the environment; The optimal scheduling strategy for heterogeneous hardware units is used as the output of the reinforcement learning algorithm to build a scheduling model for heterogeneous hardware units. The scheduling model of heterogeneous hardware units takes the microgrid operating status and the heterogeneous hardware working status as input to generate the corresponding hardware scheduling strategy, which includes task allocation and node mapping.

8. The matrix topology-based microgrid network topology flexible configuration method according to claim 7, characterized in that: Learn the optimal scheduling strategy for heterogeneous hardware units, including: The network topology, device parameters, and operating parameters in the heterogeneous database, as well as the computing power and communication delay in the hardware feature table, are used as the state input of the reinforcement learning environment. The network topology, device parameters, and operating parameters represent the operating state of the microgrid, while the computing power and communication delay represent the working state of the heterogeneous hardware units. The scheduling decision of heterogeneous hardware units is defined as the action of the reinforcement learning algorithm. The scheduling decision includes mapping heterogeneous hardware units to nodes of the graph neural network model and allocating computing and communication tasks to heterogeneous hardware units. The output of the graph neural network model is used as an evaluation metric to construct a reward function for the reinforcement learning algorithm. The reward function represents the performance evaluation of the scheduling decision of heterogeneous hardware units. The performance evaluation includes the computing power and communication delay of the microgrid system. Initialize the Q-value table of the reinforcement learning algorithm, discretize the state space and action space, and use the Q-Learning algorithm to train the Q-value table to obtain the optimal scheduling strategy for heterogeneous hardware units. The optimal scheduling strategy is a set of heterogeneous hardware unit task allocation and node mapping combinations that maximizes the reward function.

9. The matrix topology-based microgrid network topology flexible configuration method according to claim 8, characterized in that: Construct a multi-objective function for microgrid network topology optimization, including: Take the output of the graph neural network model as the constraint condition and construct the constraint condition set C: ,in, represents the i-th association constraint, ; m represents the number of constraints; Is a logical expression that evaluates to True or False; The output of the heterogeneous hardware unit scheduling model is used as the optimization target, and the optimization target set O is constructed: ,in, represents minimizing the energy consumption of the microgrid system; It represents maximizing the computing power of heterogeneous hardware units; It means minimizing communication delay; According to the constraint set C and the optimization target set O, a multi-objective function for microgrid network topology optimization is constructed: , constraints: , where x represents the decision variables of the microgrid network topology and the scheduling strategy of heterogeneous hardware units; X represents the feasible domain of the decision variable x; represents the energy consumption of the microgrid system; Represents the computing power of heterogeneous hardware units; Indicates communication delay; Represents a multi-objective function.

10. The microgrid network topology flexible configuration method based on matrix topology according to claim 9, characterized in that: Intelligent algorithms are used to solve the multi-objective functions of microgrid network topology optimization, including: An initial population P is randomly generated. The population P consists of a set of individuals with different microgrid network topologies and heterogeneous hardware unit scheduling strategies. Each individual corresponds to a decision variable x, and the population size is N. Perform non-dominated sorting on the population P and calculate the non-dominated rank and crowding distance of each individual in the population based on the three optimization objectives of energy consumption, computing power and communication delay. Using the binary tournament selection operator, N individuals are selected from the population P to generate the parent population ; For parent population Perform crossover and mutation operations to generate offspring populations ; The parent population and offspring population Merge to obtain a merged population of size 2N ; For the combined population The selection, crossover and mutation operations are repeated until the preset termination condition is met, and the non-dominated sorting of the last generation of population is performed to obtain the non-dominated solution as the Pareto optimal solution set of the microgrid network topology optimization problem; Cluster the solutions in the Pareto optimal solution set, and based on the clustering results, use the TOPSIS method to select an optimal solution from each cluster to form a set of candidate topology solutions; Select the optimal topology solution based on the candidate topology solution set and the microgrid operation requirements; The individuals corresponding to the optimal topology solution are decoded to obtain the microgrid network topology structure, device connection relationship and heterogeneous hardware unit scheduling strategy, which are output as the result of microgrid network topology optimization to generate a microgrid network topology solution.

Citation Information

Patent Citations

  • Regional multi-microgrid dynamic networking method based on graph theory

    CN107546773A

  • Microgrid network topology flexible configuration method based on matrix topology

    CN117010130A