Microgrid space-time anomaly detection and optimization method and device

By acquiring microgrid data and applying symbolic dynamics and reaction-diffusion models, spatiotemporal anomalies in microgrids are detected and optimized, solving voltage or frequency fluctuation problems caused by the complexity of the microgrid operating environment and improving system stability and efficiency.

CN120879550APending Publication Date: 2025-10-31HUANGHUA POWER SUPPLY COMPANY OF STATE GRID QINGHAI ELECTRIC POWER +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511007973.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-22
Publication Date
2025-10-31

AI Technical Summary

Technical Problem

Microgrids operate in a complex environment, affected by load fluctuations, uncertainties in renewable energy sources, and changes in topology, which can lead to abnormal voltage or frequency fluctuations, reducing system stability and operating efficiency.

Method used

By acquiring microgrid operation data and topology data, the symbolic dynamics method is applied to transform time series into symbolic sequences, calculate transition probabilities and mode entropy, construct reaction diffusion models, detect spatiotemporal anomaly modes, and dynamically adjust operating parameters or topology configurations to optimize operating strategies.

Benefits of technology

It improves the stability and operating efficiency of microgrids, enhances the accuracy and real-time performance of anomaly detection, and is suitable for microgrid management in complex operating environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120879550A_ABST
    Figure CN120879550A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a micro-grid space-time anomaly detection and optimization method and device. The method comprises the steps that micro-grid operation data and topological structure data are acquired; a symbolic dynamics method is applied to convert the time sequence of the operation data into a symbol sequence, the transition probability and the mode entropy of the symbol sequence are calculated, and dynamic feature representation of the time dimension of the micro-grid is generated; a reaction and diffusion model of the micro-grid is constructed, a reaction term is determined based on dynamic characteristic representation of the symbol sequence, and a diffusion term is determined based on a power transmission path in the topological structure data; solving the reaction diffusion model, and based on a solving result of the reaction diffusion model, detecting space-time abnormal mode movement in the micro-grid; and according to the space-time abnormal mode, dynamically adjusting operation parameters or topological configuration of the micro-grid to obtain an optimized operation strategy. The stability and efficiency of the power grid are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microgrid operation and management technology, and in particular to a method and apparatus for detecting and optimizing spatiotemporal anomalies in microgrids. Background Technology

[0002] Microgrids, as small-scale distributed power systems, integrate power generation equipment, energy storage devices, and load points, offering flexibility and high efficiency. However, due to the complex operating environment of microgrids, they are susceptible to abnormal voltage or frequency fluctuations caused by load fluctuations, uncertainties in renewable energy sources, and changes in topology. These anomalies can lead to decreased microgrid stability and even system failures.

[0003] Therefore, there is an urgent need for a method that can comprehensively consider the spatiotemporal characteristics of microgrids, detect anomalies in real time, and dynamically optimize operating strategies to improve the stability and operating efficiency of microgrids. Summary of the Invention

[0004] This application provides a method and apparatus for detecting and optimizing spatiotemporal anomalies in microgrids, which improves the stability and efficiency of the power grid.

[0005] This application provides the following solution:

[0006] According to a first aspect, a method for detecting and optimizing spatiotemporal anomalies in microgrids is provided. The method includes: acquiring microgrid operation data and topology data, wherein the operation data includes the output power of power generation equipment, and the topology data includes the connection relationships between nodes and edges, where nodes represent power generation equipment, energy storage equipment, or load points, and edges represent power transmission paths; applying a symbolic dynamics method to convert the time series of the operation data into a symbolic sequence, and calculating the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid in the time dimension; constructing a reaction-diffusion model of the microgrid, wherein reaction terms are determined based on the dynamic feature representation of the symbolic sequence, and diffusion terms are determined based on the power transmission paths in the topology data; solving the reaction-diffusion model; and based on the solution results of the reaction-diffusion model, detecting spatiotemporal anomaly patterns in the microgrid, wherein the spatiotemporal anomaly patterns include abnormal fluctuations in voltage or frequency; and dynamically adjusting the operating parameters or topology configuration of the microgrid according to the spatiotemporal anomaly patterns to obtain an optimized operating strategy, wherein the operating strategy includes the charging and discharging strategy of energy storage equipment or the node connection status.

[0007] According to one achievable method in this application embodiment, the application of symbol dynamics to convert the time series of the operating data into a symbol sequence includes: segmenting the time series of the operating data according to a predetermined time window; setting a dynamic threshold interval based on the topology data; mapping the data value into discrete symbols by comparing the data value in each time window with the dynamic threshold interval, wherein each discrete symbol corresponds to a symbol state, and the symbol state represents the power intensity of the data value; and arranging the discrete symbols in chronological order to obtain a symbol sequence reflecting the dynamic operating law of the microgrid.

[0008] According to one achievable method in an embodiment of this application, setting a dynamic threshold interval based on the topology data includes: determining a reference range for the data values ​​within each time window; determining key load nodes in the microgrid based on the topology data; and obtaining a dynamic threshold interval for each time window based on the key load nodes and the reference range, wherein the data values ​​related to the key load nodes correspond to more subdivided dynamic threshold intervals.

[0009] According to one achievable method in an embodiment of this application, calculating the transition probability and mode entropy of the symbol sequence includes: statistically analyzing the occurrence frequency of adjacent symbol pairs in the symbol sequence, calculating the transition probability between each symbol pair based on the occurrence frequency, and constructing a transition probability matrix; based on the transition probability matrix, statistically analyzing the occurrence frequency of each symbol state in the symbol sequence, and calculating the proportion of each symbol state in the symbol sequence; identifying the transition path of each symbol state in different time windows, statistically analyzing the occurrence frequency of each transition path, and weighting the occurrence frequency of each transition path to obtain a weighted transition path proportion, wherein transition paths related to key load nodes are given higher weights; and generating a mode entropy characterizing the dynamic complexity of the microgrid's operating state based on the weighted transition path proportion and the connection strength between nodes in the microgrid topology.

[0010] According to one achievable method in an embodiment of this application, the determination of the reaction term based on the dynamic feature representation of the symbol sequence includes: determining the dynamic behavior parameters of each node according to the transition probability matrix of the symbol sequence, the dynamic behavior parameters including the rate of change of node power output; mapping the dynamic behavior parameters to reaction terms, and modifying the reaction terms according to the mode entropy.

[0011] According to one achievable method in an embodiment of this application, the determination of the diffusion term based on the power transmission path in the topology data includes: extracting the length and transmission capacity of the power transmission path based on the topology data; calculating the diffusion coefficient of power flow between nodes based on the path length and transmission capacity; and combining the diffusion coefficient with the edge connection relationship in the topology to generate a diffusion term characterizing the spatial power distribution of the microgrid.

[0012] According to one achievable method in an embodiment of this application, detecting spatiotemporal anomaly patterns in a microgrid based on the solution results of the reaction-diffusion model includes: initializing the boundary conditions of the reaction-diffusion model, wherein the boundary conditions are determined based on the rated voltage and frequency range of the microgrid; analyzing the interaction between reaction and diffusion terms through step-by-step iteration, and, in conjunction with the complexity of the mode entropy, prioritizing the analysis of nodes or time windows with higher complexity to generate a dynamic operating state diagram of the microgrid; and, based on the dynamic operating state diagram, identifying nodes or paths whose voltage or frequency deviates from the rated range, and determining them as spatiotemporal anomaly patterns.

[0013] According to the second aspect, a microgrid spatiotemporal anomaly detection and optimization device is provided. The device includes: a microgrid data acquisition unit configured to acquire microgrid operating data and topology data, wherein the operating data includes the output power of power generation equipment, and the topology data includes the connection relationships between nodes and edges, where nodes represent power generation equipment, energy storage equipment, or load points, and edges represent power transmission paths; a dynamic feature representation generation unit configured to apply a symbolic dynamics method to convert the time series of the operating data into a symbolic sequence, and calculate the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid in the time dimension; and a reaction-diffusion model construction unit configured to... The system is configured to construct a reaction-diffusion model for the microgrid, wherein the reaction term is determined based on the dynamic feature representation of the symbol sequence, and the diffusion term is determined based on the power transmission path in the topology data; a spatiotemporal anomaly detection unit is configured to solve the reaction-diffusion model and, based on the solution results, detect spatiotemporal anomaly patterns in the microgrid, the spatiotemporal anomaly patterns including abnormal fluctuations in voltage or frequency; and an optimized operation strategy generation unit is configured to dynamically adjust the operating parameters or topology configuration of the microgrid according to the spatiotemporal anomaly patterns to obtain an optimized operation strategy, the operation strategy including the charging and discharging strategy of energy storage devices or the node connection status.

[0014] According to a third aspect, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects above.

[0015] According to the fourth aspect, an electronic device is provided, comprising:

[0016] One or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any one of the first aspects above.

[0017] According to the specific embodiments provided in this application, the following technical effects are disclosed:

[0018] This application acquires microgrid operation and topology data, transforms time series data into symbolic sequences using symbolic dynamics, calculates transition probabilities and mode entropy, and generates dynamic feature representations. Based on this, a reaction-diffusion model is constructed, with reaction and diffusion terms representing temporal and spatial characteristics, respectively. After solving the model, abnormal fluctuations in voltage or frequency are detected, and operating parameters or topology configurations are dynamically adjusted to optimize microgrid operation strategies. This method effectively captures the spatiotemporal dynamic characteristics of microgrids, improves the accuracy and real-time performance of anomaly detection, and the optimized operation strategy significantly enhances the stability and operating efficiency of microgrids, making it suitable for microgrid management in complex operating environments.

[0019] Of course, any product implementing this application does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a system architecture diagram applicable to the embodiments of this application;

[0022] Figure 2 A flowchart of the microgrid spatiotemporal anomaly detection and optimization method provided in the embodiments of this application;

[0023] Figure 3 This is a structural block diagram of the microgrid spatiotemporal anomaly detection and optimization device provided in the embodiments of this application;

[0024] Figure 4 A schematic block diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0026] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0027] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0028] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0029] In existing technologies, microgrid anomaly detection mainly relies on traditional signal processing methods or machine learning algorithms. For example, methods based on Fourier transform or wavelet transform can analyze time series data, but they struggle to capture the spatiotemporal coupling characteristics of microgrids. While machine learning-based methods can identify complex patterns, they are highly dependent on training data and have high computational complexity, making it difficult to meet real-time requirements. Furthermore, existing methods lack dynamic optimization schemes for microgrid operating parameters or topology configurations after anomaly detection, resulting in low system recovery efficiency.

[0030] In view of this, this application provides a new approach. To facilitate understanding of this application, the system architecture on which this application is based will first be described. Figure 1 An exemplary system architecture that can be applied to embodiments of this application is shown, such as Figure 1 As shown, the system architecture may include: user equipment and a microgrid spatiotemporal anomaly detection and optimization device located on the server side.

[0031] Users can input operational and topology data through user equipment, which then sends this data to the microgrid spatiotemporal anomaly detection and optimization device on the server side. The microgrid spatiotemporal anomaly detection and optimization device can use the method provided in the embodiments of this application to obtain an optimized operational strategy. The server can then send the optimized operational strategy to the user terminal, which can then use the operational strategy to manage the microgrid.

[0032] User devices can include, but are not limited to, smart mobile terminals, smart home devices, wearable devices, and PCs (Personal Computers). Smart mobile devices can include mobile phones, tablets, laptops, PDAs (Personal Digital Assistants), and connected cars. Smart home devices can include smart TVs, smart refrigerators, and so on. Wearable devices can include smartwatches, smart glasses, virtual reality devices, augmented reality devices, and mixed reality devices.

[0033] The microgrid spatiotemporal anomaly detection and optimization device can be configured as a standalone server, a server cluster, or a cloud server. A cloud server, also known as a cloud computing server or cloud host, is a host product within the cloud computing service system, designed to address the management difficulties and weak service scalability inherent in traditional physical hosts and Virtual Private Servers (VPS) services. Besides... Figure 1 In addition to the architecture shown, the microgrid spatiotemporal anomaly detection and optimization device can also be set on a computer terminal with strong computing power.

[0034] It should be understood that Figure 1 The user equipment and microgrid spatiotemporal anomaly detection and optimization devices shown are merely illustrative. Depending on implementation needs, any number of user equipment and microgrid spatiotemporal anomaly detection and optimization devices can be included.

[0035] Figure 2 This is a flowchart of a microgrid spatiotemporal anomaly detection and optimization method provided in an embodiment of this application. The method can be... Figure 1 The microgrid spatiotemporal anomaly detection and optimization device in the system shown is executed. For example... Figure 2 As shown, the method may include the following steps:

[0036] Step 201: Obtain microgrid operation data and topology data. The operation data includes the output power of the power generation equipment, and the topology data includes the connection relationship between nodes and edges, where nodes represent power generation equipment, energy storage equipment, or load points, and edges represent power transmission paths.

[0037] Step 202: Apply the symbolic dynamics method to convert the time series of the running data into a symbolic sequence, and calculate the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid's time dimension.

[0038] Step 203: Construct the reaction-diffusion model of the microgrid, wherein the reaction term is determined based on the dynamic feature representation of the symbol sequence, and the diffusion term is determined based on the power transmission path in the topology data.

[0039] Step 204: Solve the reaction-diffusion model. Based on the solution results of the reaction-diffusion model, detect spatiotemporal anomaly patterns in the microgrid. The spatiotemporal anomaly patterns include abnormal fluctuations in voltage or frequency.

[0040] Step 205: Based on the spatiotemporal anomaly mode, dynamically adjust the microgrid's operating parameters or topology configuration to obtain an optimized operating strategy, which includes the charging and discharging strategy of energy storage devices or the node connection status.

[0041] As can be seen from the above process, this application acquires microgrid operation data and topology data, combines symbolic dynamics to transform time series into symbolic sequences, calculates transition probabilities and mode entropy, and generates dynamic feature representations. Based on this, a reaction-diffusion model is constructed, with reaction and diffusion terms representing temporal and spatial characteristics, respectively. After solving the model, abnormal fluctuations in voltage or frequency are detected, and operating parameters or topology configurations are dynamically adjusted to optimize the microgrid operation strategy. This method effectively captures the spatiotemporal dynamic characteristics of the microgrid, improves the accuracy and real-time performance of anomaly detection, and the optimized operation strategy significantly enhances the stability and operating efficiency of the microgrid, making it suitable for microgrid management in complex operating environments.

[0042] First, the above step 201, namely "acquiring microgrid operation data and topology data, wherein the operation data includes the output power of the power generation equipment, and the topology data includes the connection relationship between nodes and edges, wherein nodes represent power generation equipment, energy storage equipment or load points, and edges represent power transmission paths", will be described in detail with reference to the embodiments.

[0043] Operational data primarily refers to the dynamic data generated by various devices in a microgrid during operation, with the output power of power generation equipment being a core indicator. Power generation equipment includes photovoltaic generators, wind turbines, or diesel generators, and their output power reflects the energy supply situation of the microgrid. For example, the output power of a photovoltaic generator may vary with sunlight intensity, ranging from 100 to 500 kilowatts. Operational data may also include the charging and discharging power of energy storage devices and the power demand at load points. This data is recorded in time series format, reflecting the dynamic behavior of the microgrid over time. By collecting this data, the method can monitor the operational status of the microgrid in real time, providing a foundation for subsequent anomaly detection.

[0044] Topology data describes the physical or electrical connections of a microgrid, represented as nodes and edges. Nodes represent functional units within the microgrid, including power generation equipment, energy storage devices, and load points. For example, a photovoltaic power station can be considered a power generation node, a battery bank a energy storage node, and a residential electricity area a load node. Edges represent power transmission paths between nodes, such as transmission lines or transformer connections, and include attributes such as path length and transmission capacity. The acquisition of topology data provides a foundation for analyzing the spatial characteristics of microgrids, such as the direction of power flow, the interactions between nodes, and the identification of critical nodes. This information is crucial for constructing the diffusion term in reaction-diffusion models.

[0045] The following describes in detail step 202, namely, "applying symbolic dynamics to convert the time series of the running data into a symbolic sequence, and calculating the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid time dimension," with reference to an embodiment.

[0046] This application uses symbolic dynamics to transform continuous operating data into discrete symbol sequences, and then extracts their statistical characteristics to generate feature representations that can characterize the dynamic behavior of microgrids in the time dimension, providing a key basis for subsequent anomaly detection and optimization.

[0047] Symbolic dynamics is an analytical tool that transforms continuous time series into discrete symbol sequences, widely used in the study of the dynamic behavior of complex systems. In this application, the operational data of a microgrid, such as the output power of generators and the charging and discharging power of energy storage devices, exists in time series form, for example, power values ​​are recorded once per second. Symbolic dynamics first segments this continuous data, typically according to predetermined time windows, such as 1 second or 5 seconds, determined based on the microgrid's operating cycle. The data values ​​within each time window are mapped to discrete symbols, such as high power, medium power, low power, or abnormal states, by comparing them with a dynamic threshold interval. This mapping simplifies complex continuous data into a finite number of symbol states, facilitating subsequent statistical analysis while preserving the dynamic characteristics of the time series.

[0048] As an feasible approach, the symbol dynamics method is applied to transform the time series of the operating data into a symbol sequence, which includes: segmenting the time series of the operating data according to a predetermined time window; setting a dynamic threshold interval based on the topology data; comparing the data value within each time window with the dynamic threshold interval and mapping it to discrete symbols, wherein each discrete symbol corresponds to a symbol state, and the symbol state represents the power intensity of the data value; and arranging the discrete symbols in chronological order to obtain a symbol sequence reflecting the dynamic operating law of the microgrid.

[0049] Specifically, firstly, the time series of operational data is segmented according to predetermined time windows. Operational data is typically recorded in time series format, for example, power values ​​are collected once per second. The selection of the time window is based on the microgrid's operating characteristics, such as 1 second or 5 seconds, depending on the system's dynamic response speed or data acquisition frequency. After segmentation, each time window contains a set of data values; for example, the photovoltaic power values ​​within a certain window are [300kW, 320kW, 310kW]. Segmentation decomposes the continuous time series into multiple discrete analysis units, facilitating subsequent symbolic processing while preserving the dynamic information of the time dimension.

[0050] Based on segmentation, dynamic threshold intervals are set according to topology data. Topology data describes the connectivity between nodes (such as generators, energy storage devices, and load points) and edges (such as power transmission paths) in the microgrid, including the importance of nodes and power flow characteristics. The setting of dynamic threshold intervals takes into account these spatial characteristics; for example, the power demand of critical load nodes fluctuates greatly, and their threshold intervals may be more granular.

[0051] Preferably, setting a dynamic threshold interval based on the topology data includes: determining a reference range for data values ​​within each time window; determining key load nodes in the microgrid based on the topology data; and obtaining a dynamic threshold interval for each time window based on the key load nodes and the reference range, wherein data values ​​related to the key load nodes correspond to more subdivided dynamic threshold intervals.

[0052] First, the dynamic threshold interval is established by defining a reference range for data values ​​within each time window. The reference range is typically determined using statistical methods, such as calculating the mean and standard deviation of the data values ​​within each time window, and setting the reference range as the mean plus or minus twice the standard deviation. For example, if the power value within a certain time window has a mean of 300 kW and a standard deviation of 50 kW, then the reference range is 200 kW to 400 kW. This reference range provides a benchmark for setting the subsequent threshold interval, ensuring that the threshold interval reflects the distribution characteristics of the data values ​​while also considering the dynamic fluctuations of the microgrid operation.

[0053] Next, key load nodes in the microgrid are identified using topology data. The determination of key load nodes is based on their importance within the microgrid, such as nodes with high power demand, high connectivity, or those that significantly impact system stability. Specific methods may include analyzing node power demand (e.g., nodes with power demand above average) or calculating node connectivity (e.g., nodes connected to more than three power transmission paths). The identification of key load nodes reflects the spatial heterogeneity of the microgrid, as these nodes typically have a greater impact on system operation and anomalous fluctuations. By clearly defining key load nodes, the method can selectively adjust threshold ranges, enhancing the accuracy of analysis for important nodes.

[0054] Based on the reference range and critical load nodes, the method further defines dynamic threshold intervals for each time window. For non-critical nodes, the threshold intervals are typically simpler, such as dividing the reference range into high-power, medium-power, and low-power intervals. However, for critical load nodes, since fluctuations in their operating states have a greater impact on the overall stability of the microgrid, the method sets more granular threshold intervals. For example, the medium-power interval can be further subdivided into medium-high power and medium-low power, or an abnormal state interval can be added to more accurately capture the dynamic changes of critical nodes. Specific subdivision methods may be based on the node's power demand characteristics or the connection strength in the topology; for example, nodes corresponding to paths with large transmission capacity may require more granular threshold divisions. This dynamic threshold design ensures that the symbolization process can adapt to the differences in importance of different nodes in the microgrid.

[0055] Subsequently, the method compares the data values ​​within each time window with a dynamic threshold interval, mapping them to discrete symbols. These discrete symbols correspond to predefined symbol states. A "symbol state" refers to the specific operating state represented by each symbol after the time series of microgrid operating data is mapped to discrete symbols using the symbol dynamics method. Symbol states can be flexibly defined according to specific implementations; for example, they can be two-level states (high, low), multi-level states (high, medium-high, medium-low, low), or even abnormal states. "Power intensity" refers to the relative level of operating data (such as power value) relative to the rated value or reference range. For example, high power can be defined as data values ​​exceeding 80% of the rated power, medium power as 50%-80%, and low power as below 50%. Taking a power value of 300kW in a certain time window as an example, if the rated power is 400kW, then 300kW / 400kW = 75%, mapped to a medium power symbol. Each symbol state reflects the distribution characteristics of the data values ​​at a specific power level; for example, a medium power symbol indicates that the data values ​​are concentrated in the 50%-80% range of the rated power. This mapping transforms continuous numerical data into discrete symbolic states, simplifying data complexity while preserving the dynamic characteristics of the running state.

[0056] Finally, the method arranges the discrete symbols for each time window in chronological order, forming a symbol sequence. For example, if the power values ​​of a certain time series are mapped sequentially as [high, medium, medium, low], then the symbol sequence is "high-medium-medium-low". The symbol values ​​"high" or "medium" represent the symbol states. This symbol sequence reflects the dynamic operating patterns of the microgrid in the time dimension, such as the evolution trend of power from high to low. Through the symbol sequence, the method can capture the temporal characteristics of the microgrid's operating state, providing a data foundation for subsequent calculations of transition probabilities and mode entropy, and laying the foundation for constructing the reaction term in the reaction-diffusion model.

[0057] After generating the symbol sequence, the transition probabilities and mode entropy are further calculated to extract the statistical regularities of the microgrid's operating state. The transition probability reflects the transition pattern of adjacent symbol pairs in the symbol sequence, such as the probability of transitioning from a high-power state to a medium-power state. Specifically, the calculation method involves statistically analyzing the frequency of each symbol pair in the symbol sequence and constructing a transition probability matrix accordingly. For example, if the transition from "high power" to "medium power" occurs 10 times in the symbol sequence, and "high power" occurs a total of 50 times, then the transition probability is 10 / 50 = 0.2. The transition probability matrix captures the dynamic evolution of the microgrid's operating state over time, providing data support for the reaction terms in the subsequent reaction diffusion model.

[0058] Model entropy is an indicator of the complexity of a symbol sequence, reflecting the dynamic diversity of microgrid operating states. It is calculated by analyzing the distribution of symbol states and the statistical characteristics of transition paths. Higher model entropy indicates a more complex microgrid operating state and a potential risk of abnormal fluctuations. By combining transition probabilities and model entropy, the method generates a dynamic characteristic representation of the microgrid in the time dimension. This representation, in vector or matrix form, comprehensively reflects the dynamic patterns and complexity of the operating data.

[0059] As an implementable approach, calculating the transition probabilities and mode entropy of the symbol sequence to generate a dynamic feature representation of the microgrid in the time dimension includes: statistically analyzing the occurrence frequency of adjacent symbol pairs in the symbol sequence, calculating the transition probability between each symbol pair based on the occurrence frequency, and constructing a transition probability matrix; based on the transition probability matrix, statistically analyzing the occurrence frequency of each symbol state in the symbol sequence, and calculating the proportion of each symbol state in the symbol sequence; identifying the transition path of each symbol state in different time windows, statistically analyzing the occurrence frequency of each transition path, and weighting the occurrence frequency of each transition path to obtain a weighted transition path proportion, wherein transition paths related to key load nodes are given higher weights; and generating a mode entropy characterizing the dynamic complexity of the microgrid's operating state based on the weighted transition path proportion and the connection strength between nodes in the microgrid topology.

[0060] First, the method calculates the transition probability and constructs a transition probability matrix by statistically analyzing the frequency of occurrence of adjacent symbol pairs in a symbol sequence. For example, a symbol sequence of "high-medium-medium-low" represents the evolution of power intensity over time. Adjacent symbol pairs refer to two consecutive symbols in the sequence, such as "high-medium" or "medium-low". By counting the occurrences of each symbol pair, for example, if "high-medium" occurs 10 times and "high" occurs a total of 50 times, the transition probability is 10 / 50 = 0.2. The transition probability matrix is ​​a matrix whose elements represent the probability of transitioning from one symbol state to another; for example, matrix element P(high→medium) = 0.2. This matrix captures the transition patterns of microgrid operating states over time. For instance, frequent switching of power from high to medium intensity may reflect normal operation, while frequent transitions to low intensity may indicate anomalies.

[0061] Based on the transition probability matrix, the frequency of occurrence of each symbol state is further counted, and its proportion is calculated. The frequency of occurrence of symbol states, such as high power intensity, medium power intensity, or low power intensity, in the symbol sequence reflects the overall distribution characteristics of microgrid operation. For example, if the symbol sequence length is 100, and the "medium" state occurs 60 times, its proportion is 60 / 100 = 0.6. This proportion information quantifies the relative importance of each state, providing a basis for subsequent analysis. For example, a high proportion of "low" states may indicate insufficient overall power in the microgrid, requiring further detection of any anomalies.

[0062] Next, the transition paths of symbol states within different time windows are identified, and the frequency of each path is counted to calculate the weighted proportion of transition paths. A transition path refers to the sequence of symbol state changes over time; for example, "high-medium-low" is a three-step transition path. After counting the frequency of each path, the method weights the transition paths according to the characteristics of critical load nodes. The operating state of critical load nodes has a greater impact on microgrid stability, therefore, transition paths related to these nodes are assigned higher weights, such as a weight of 1.5, while the weight of paths from non-critical nodes is 1.0. The weighted proportion of transition paths reflects the dynamic behavior of important nodes in the microgrid; for example, frequent switching from high power intensity to low power intensity by critical load nodes may indicate voltage anomalies.

[0063] Finally, based on the weighted transfer path proportions and the connection strength between nodes in the microgrid topology, the method calculates the mode entropy to generate a dynamic feature representation characterizing the dynamic complexity of the microgrid's operating state. Mode entropy is an indicator of the complexity of a symbol sequence, calculated using the formula H = -∑p i ·log(p i ), where p i This represents the weighted percentage of transfer paths.

[0064] Connection strength is based on topology data, such as the transmission capacity or length of power transmission paths, reflecting the impact of power flow between nodes. Optionally, connection strength can be defined as the ratio of transmission capacity to path length, for example, S. ij =C ij / L ij C ij L represents the path transmission capacity (in kilowatts) from node i to j. ij This represents the path length (in kilometers). For example, if a path has a transmission capacity of 500 kW and a length of 2 km, then the connection strength is 250 kW / km. Another approach is to consider the electrical impedance of the edges; the lower the impedance, the higher the connection strength. In implementation, the topology data is stored as an adjacency matrix, with matrix elements recording the connection strength of each edge.

[0065] Before calculating the mode entropy, the weighted transfer path proportions need to be combined with the connection strength between nodes to reflect the spatial and temporal characteristics of the microgrid. This is achieved by using connection strength as an adjustment factor for the transfer path proportions to enhance the impact of critical paths. Specifically, for each transfer path, it is checked whether its associated nodes are critical load nodes, and a weighted adjustment is made based on the connection strength of the relevant edges. For example, if the power change of a critical load node corresponding to a "high-medium" transfer path is p... i Multiply by connection strength S ij The normalized value forms a new weighted proportion p' i =p i ·w s , where w s The weights are based on connection strength, w s =S ij / max(S ij This step ensures that the mode entropy reflects not only the state transition patterns in the time dimension but also the influence of power flow between nodes in the spatial dimension. In implementation, this can be achieved through matrix operations, such as multiplying the transition path proportion vector with the connection strength matrix to generate a comprehensive weighted proportion.

[0066] Mode entropy is a metric that measures the complexity of a symbol sequence and characterizes the dynamic complexity of a microgrid's operating state. Based on the weighted transfer path proportions, the formula for calculating mode entropy is: H = -∑p' i ·log(p' i ), where p' i This is a weighted proportion that incorporates connection strength. In implementation, first ensure that all p' i Normalization, i.e., ∑p' i=1, and then calculate the entropy contribution of each transfer path item by item. For example, if there are three transfer paths with comprehensive weighted proportions of 0.5, 0.3, and 0.2 respectively, then the model entropy is H = -(0.5·log(0.5) + 0.3·log(0.3) + 0.2·log(0.2)). The higher the entropy value, the more uniform the distribution of transfer paths, the higher the dynamic complexity of the microgrid's operating state, which may indicate the risk of abnormal fluctuations.

[0067] The mode entropy, combined with the transition probability matrix, generates a dynamic feature representation of the microgrid in the time dimension. In implementation, the dynamic feature representation is typically output as a vector or matrix, including elements of the transition probability matrix and mode entropy values. For example, the dynamic feature representation could be a vector [P] containing transition probabilities and mode entropy. 11 ,P 12 ,…,P mn [,H], where P ij Here, H represents the transition probability matrix elements, and H represents the mode entropy. This representation integrates the temporal patterns and complexity of microgrid operating states, providing input for the reaction terms in the reaction-diffusion model.

[0068] The following describes in detail step 203, namely, "constructing the reaction-diffusion model of the microgrid, wherein the reaction term is determined based on the dynamic feature representation of the symbol sequence, and the diffusion term is determined based on the power transmission path in the topology data," with reference to the embodiments.

[0069] This application constructs a mathematical model that comprehensively characterizes the spatiotemporal properties of microgrids by combining dynamic feature representations in the time dimension with topological data in the spatial dimension, providing a theoretical foundation for subsequent anomaly detection and optimization. The reaction-diffusion model is a classic mathematical tool widely used to describe the spatial propagation and temporal evolution of dynamic behavior in complex systems. The reaction-diffusion model consists of two parts: a reaction term and a diffusion term.

[0070] The process of constructing a reaction-diffusion model involves integrating the reaction and diffusion terms into a unified mathematical framework, typically expressed as partial differential equations, for example, Where u represents the node's operating state, such as power or voltage, and D is the diffusion coefficient. R(u) is the diffusion term, and R(u) is the reaction term. The reaction term R(u) is based on dynamic characteristics and describes the local variation of node power; the diffusion term... Based on the topology, the propagation of electricity between nodes is described. The construction of the model requires initializing boundary conditions, such as the rated voltage and frequency range of the microgrid, and solving them using numerical methods such as the finite difference method to generate an operating state diagram characterizing the spatiotemporal dynamics of the microgrid.

[0071] The response term reflects the dynamic changes in the microgrid's operating state over time, determined by a dynamic feature representation based on a sequence of symbols. For example, the dynamic feature representation might include a transition probability matrix describing the transition probability from high to medium power intensity, and mode entropy, quantifying the dynamic complexity of the operating state. The response term is determined by mapping these features to mathematical expressions, such as generating functions characterizing the local dynamic behavior of nodes through power change rates or complexity indices in the dynamic feature representation. The response term captures the power fluctuation characteristics of nodes in the microgrid, such as generators or load points, providing dynamic information in the time dimension for the model.

[0072] The diffusion term reflects the spatial characteristics of power flow in a microgrid, determined based on power transmission paths in the topology data. By analyzing the characteristics of these paths, the diffusion term quantifies the propagation behavior of electricity or energy between nodes. In implementation, the diffusion term is typically represented as a function of the diffusion coefficient, calculated based on the path's transmission capacity and length; for example, edges with large transmission capacity and short paths have higher diffusion coefficients. The diffusion term mathematically describes the spatial propagation of power between nodes, for example, using the Laplace operator to represent the flow of power from high-power nodes to low-power nodes. This spatial characteristic reflects the heterogeneity of the microgrid topology; for example, critical load nodes may have a greater impact on diffusion behavior due to their high connectivity.

[0073] As one feasible approach, the determination of the reaction term based on the dynamic feature representation of the symbol sequence includes: determining the dynamic behavior parameters of each node according to the transition probability matrix of the symbol sequence, the dynamic behavior parameters including the rate of change of node power output; mapping the dynamic behavior parameters to the reaction term, and modifying the reaction term according to the mode entropy.

[0074] First, the determination of the response term is based on the dynamic characteristic representation of the symbol sequence, specifically by extracting the dynamic behavior parameters of each node through the transition probability matrix. These dynamic behavior parameters quantify the temporal dynamic characteristics of the nodes based on the transition probability matrix, specifically including the rate of change of node power output. The rate of change of power output is defined as the change in power value within a time window, for example, ΔP / Δt, where ΔP is the amount of power change and Δt is the length of the time window. For example, if a node's power changes from 300 kW to 320 kW in 1 second, the rate of change is 20 kW / s. The transition probability matrix provides statistical regularities of state changes; for example, a high-probability "high-to-medium" transition may correspond to a larger rate of power change, reflecting the activity level of the node's dynamic behavior.

[0075] Next, the method maps dynamic behavior parameters to reaction terms. In this application, dynamic behavior parameters such as the rate of power change are transformed into reaction terms through linear or nonlinear mapping.

[0076] For example, the reaction term can be defined as

[0077]

[0078] Among them, R i Let k be the response term for node i, and k be a scaling factor that adjusts the magnitude of the response term to suit the model requirements. The mapping process may incorporate elements of the transition probability matrix; for example, if a node has a higher transition probability from high power intensity to medium power intensity, its response term may reflect more frequent power fluctuations. In implementation, the response term can be a scalar function representing the dynamic behavior of a single node, or it can be a vector form integrating multiple dynamic behavior parameters. This mapping ensures that the response term accurately reflects the local time dynamic characteristics of each node in the microgrid, such as rapid changes in power output of generating equipment or demand fluctuations at load points.

[0079] Furthermore, the response terms are modified based on the model entropy to incorporate the complexity of the microgrid's operating state. Model entropy reflects the dynamic complexity of the symbol sequence, and the modification of response terms is typically done by adjusting the weights or magnitudes of the response terms based on the model entropy. For example, if the model entropy is higher than a preset threshold, such as 2.0, it indicates a high level of operating state complexity, and the response terms can be adjusted by amplification factors, such as...

[0080] R' i =R i ·(1+α·H) (2)

[0081] Here, α is an adjustment factor, for example, 0.2. This modification enhances the sensitivity of the response term to complex operating states; for example, in high-entropy scenarios, the response term may more significantly reflect the anomalous trend of power fluctuations.

[0082] As an implementable approach, the diffusion term determination based on the power transmission paths in the topology data includes: extracting the length and transmission capacity of the power transmission paths from the topology data; calculating the diffusion coefficient of power flow between nodes based on the path length and transmission capacity; and combining the diffusion coefficient with the edge connectivity in the topology to generate a diffusion term characterizing the spatial power distribution of the microgrid.

[0083] First, the length and capacity of power transmission paths are extracted from the topology data. Topology data describes the connections between nodes in the microgrid, such as generators, energy storage devices, load points, and edges. Edges represent power transmission paths, such as transmission lines or transformer connections. Path length typically refers to physical or electrical distance, such as a transmission line being 2 kilometers long, or electrical distance expressed as impedance. Transmission capacity refers to the maximum power carrying capacity of the path, such as 500 kilowatts, reflecting the path's power transmission capability. Extracting these attributes is usually achieved by storing the topology data as an adjacency matrix or graph structure, where matrix elements or edge attributes record the length and transmission capacity of each path. For example, the path from node A to node B is 2 kilometers long and has a transmission capacity of 500 kilowatts. This data provides the basis for subsequent calculations of the diffusion coefficient, reflecting the physical characteristics of the microgrid's spatial structure.

[0084] Based on path length and transmission capacity, the method calculates the diffusion coefficient of power flow between nodes. The diffusion coefficient is a parameter in the reaction diffusion model that quantifies the intensity of spatial propagation and reflects the rate of power flow from one node to another. The diffusion coefficient is calculated as a function of path length and transmission capacity:

[0085]

[0086] Among them, C ij L represents the path transmission capacity from node i to j. ij Where D is the path length. This formula shows that the larger the transmission capacity or the shorter the path, the larger the diffusion coefficient, meaning faster power flow. In practice, the diffusion coefficient can be calculated in batches through matrix operations, for example, generating a diffusion coefficient matrix based on the adjacency matrix, where each element D... ij This corresponds to the diffusion intensity of a pair of nodes. This design takes into account the spatial heterogeneity of power propagation in microgrids; for example, critical load nodes may have a larger diffusion coefficient due to high transmission capacity paths.

[0087] Subsequently, the method combines the diffusion coefficient with the edge connectivity in the topology to generate a diffusion term characterizing the spatial power distribution of the microgrid. The diffusion term is the mathematical expression describing spatial propagation in the reaction-diffusion model, typically represented by a Laplace operator, such as... Where u represents the node's operating state, such as power or voltage. The diffusion term is generated by applying the diffusion coefficient to the state differences between nodes, for example...

[0088] diffusion term = ∑ j D ij (u i -u j (4) Where, u i ,u j Let D be the power values ​​of nodes i and j.ij Let $D$ be the diffusion coefficient, and the summation is performed across all nodes $j$ connected to node $i$. This formula quantifies the propagation of power from high-power nodes to low-power nodes, reflecting the spatial power distribution characteristics of a microgrid. In implementation, the diffusion term is output as a vector or matrix, and combined with the adjacency matrix of the topology, it ensures that the diffusion term for each node considers the influence of all its connected paths. For example, if node $A$ connects nodes $B$ and $C$, the diffusion term is $D$. AB (u A -u B )+D AC (u A -u C This method captures the spatial dynamics of power flow in a microgrid.

[0089] The following describes in detail step 204, namely, "solving the reaction-diffusion model and detecting spatiotemporal anomaly patterns in the microgrid based on the solution results of the reaction-diffusion model, wherein the spatiotemporal anomaly patterns include abnormal fluctuations in voltage or frequency," with reference to an embodiment.

[0090] The purpose of solving the model is to calculate the changes in the operating state of each node over time and space using numerical methods, generating dynamic operating state data. This can be achieved using the finite difference method or the finite element method. The finite difference method discretizes time and space, for example, setting the time step to 0.1 seconds, and the spatial step based on the path length between nodes. Initial conditions are based on the rated operating parameters of the microgrid, such as a rated voltage of 220 volts or a rated frequency of 50 Hz, while boundary conditions are based on the physical constraints of the topology, such as the connection range between nodes. The solution process simulates the propagation of electricity in the microgrid and the dynamic evolution of node states through iterative calculations, generating the voltage, frequency, or power values ​​for each node at each time step.

[0091] Based on the solution results, the method detects spatiotemporal anomaly patterns in microgrids. The solution results are typically presented as time series or spatial distributions, such as the dynamic changes in voltage or frequency at each node over time, or the distribution of power flow between nodes. Spatiotemporal anomaly patterns are defined as fluctuations in voltage or frequency deviating from the rated range, such as voltage exceeding 220V ± 5% or frequency exceeding 50Hz ± 0.5Hz. The detection process identifies anomalous nodes or paths by analyzing the solution results. For example, if the voltage value of a node is consistently higher than 231V or lower than 209V over multiple time steps, it is marked as a voltage anomaly pattern. Similarly, if the frequency fluctuation on a path exceeds ± 0.5Hz, it is marked as a frequency anomaly pattern. In implementation, a threshold detection algorithm can be used to compare the operating state of each node with the rated range, generating anomaly pattern distribution maps, such as displaying the spatiotemporal location of anomalous nodes in the form of a heatmap.

[0092] Preferably, based on the solution results of the reaction-diffusion model, detecting spatiotemporal anomaly patterns in the microgrid includes: initializing the boundary conditions of the reaction-diffusion model, wherein the boundary conditions are determined based on the rated voltage and frequency range of the microgrid; analyzing the interaction between reaction and diffusion terms through step-by-step iteration, and, in conjunction with the complexity of the mode entropy, prioritizing the analysis of nodes or time windows with higher complexity to generate a dynamic operating state diagram of the microgrid; and, based on the dynamic operating state diagram, identifying nodes or paths whose voltage or frequency deviates from the rated range, and determining them as spatiotemporal anomaly patterns.

[0093] First, the solution process is initiated by initializing the boundary conditions of the reaction-diffusion model. The boundary conditions are determined based on the microgrid's rated voltage and frequency range; for example, the rated voltage is 220 volts, the rated frequency is 50 Hz, and the allowable fluctuation ranges are ±5% and ±0.5 Hz, respectively. The boundary conditions define constraints on the operating states of nodes in the model, such as ensuring that the voltage of edge nodes does not exceed 231 volts or falls below 209 volts. In implementation, the boundary conditions can be further refined using topology data, for example, setting stricter voltage ranges for critical load nodes to reflect their importance. The initial conditions are based on the initial state of the operating data, such as the initial power or voltage values ​​of each node. These conditions provide a starting point for the partial differential equations of the reaction-diffusion model, and the initialization process ensures that the model can accurately simulate the actual operating environment of the microgrid.

[0094] Next, the interaction between the reaction and diffusion terms is analyzed through step-by-step iterative analysis. Considering the complexity of the mode entropy, nodes or time windows with higher complexity are prioritized for analysis. Step-by-step iteration typically employs numerical methods such as the finite difference method, discretizing time and space, for example, a time step of 0.1 seconds and a spatial step based on the path length between nodes. In each iteration, the reaction term reflects changes in the node's local voltage or frequency, while the diffusion term simulates the propagation of electricity between nodes. Their interaction generates the spatiotemporal evolution of the node state. High mode entropy values, such as those greater than 2.0, indicate complex operating states and potential risks of abnormal fluctuations. Prioritizing the analysis of high-entropy nodes or time windows, such as critical load nodes or periods of frequent state transitions, improves detection efficiency. In implementation, the mode entropy values ​​of nodes or time windows can be sorted using an algorithm, prioritizing the processing of regions with the highest entropy values ​​to reduce computational resource waste.

[0095] Based on the iterative results, the method generates a dynamic operating state diagram of the microgrid. This dynamic operating state diagram is a visual representation of the solution results, showing the voltage or frequency distribution of each node in time and space. For example, it can display the voltage fluctuations of nodes over time as a heatmap, or the frequency changes along a path as a network diagram. In implementation, visualization tools such as Python's Matplotlib library can be used to generate two-dimensional or three-dimensional charts, with the horizontal axis representing time, the vertical axis representing nodes, and color intensity representing voltage or frequency values. The dynamic operating state diagram intuitively reflects the operating characteristics of the microgrid, such as a node's voltage consistently being too high or a path experiencing frequent frequency fluctuations, providing a direct basis for anomaly detection.

[0096] Finally, nodes or paths whose voltage or frequency deviates from the rated range are identified based on the dynamic operating state diagram, and these are determined to be spatiotemporal anomaly modes. The definition of anomaly modes is based on preset thresholds, such as a voltage exceeding 220V ± 5% (i.e., 231V or 209V), or a frequency exceeding 50Hz ± 0.5Hz. In implementation, the data in the dynamic operating state diagram is traversed, and the voltage or frequency value of each node is compared with the rated range. For example, if the voltage u of node i at time t... i (t) satisfies |u i If (t)-220|>11, it is marked as a voltage anomaly pattern. Similarly, anomalies on the path are detected by analyzing the voltage or frequency difference between adjacent nodes. For example, if the frequency difference between nodes i and j exceeds 0.5 Hz, it is marked as a path anomaly. The detection results are stored in list or matrix form, recording the anomalous nodes, paths, and timestamps, confirming it as a spatiotemporal anomaly pattern.

[0097] The following describes in detail step 205, namely, "dynamically adjusting the operating parameters or topology configuration of the microgrid according to the spatiotemporal anomaly mode to obtain an optimized operating strategy, wherein the operating strategy includes the charging and discharging strategy of the energy storage device or the node connection status," with reference to the embodiments.

[0098] This step analyzes spatiotemporal anomaly patterns and adjusts the microgrid's operating parameters or topology configuration accordingly to generate optimized operating strategies, thereby restoring system stability and improving operational efficiency. Its core objective is to achieve dynamic control using anomaly detection results, specifically by adjusting the charging and discharging strategies of energy storage devices or the node connection status.

[0099] Spatiotemporal anomaly patterns, identified through the preceding steps, manifest as abnormal fluctuations in voltage or frequency. These anomaly patterns are generated using the solution results of the reaction-diffusion model and are typically presented as a dynamic operating state diagram, indicating the nodes, paths, and times of anomaly occurrence. Dynamic adjustment is implemented based on this anomaly information, selecting appropriate optimization strategies for the specific characteristics of the anomaly. For example, if the voltage at a load node is detected to be consistently below 209 volts, it may be due to insufficient output from generating equipment or limited power transmission paths; the adjustment strategy needs to specifically increase power supply or optimize the path. Dynamic adjustment emphasizes real-time performance and adaptability, ensuring the stability of the microgrid in complex operating environments through real-time monitoring and rapid response.

[0100] Adjusting the operating parameters of a microgrid primarily involves the charging and discharging strategies of energy storage devices. Energy storage devices, such as battery packs, play a role in balancing supply and demand in a microgrid, and their charging and discharging power can be dynamically adjusted to cope with anomalies. For example, if the voltage at a node is too low, the method might increase the discharging power of the energy storage devices to inject more power into that node; if the voltage is too high, the charging power would be increased to absorb the excess power. In practice, the optimization algorithm determines the power adjustment amount of the energy storage devices based on the anomaly pattern, for example, by solving the maximum ∑P using a linear programming model. storage , where P storage The charging and discharging power of the energy storage device is defined by constraints including energy storage capacity and node voltage range. The adjusted charging and discharging strategy is output in time-series form, for example, discharging 50 kW per second for 10 seconds. This strategy can quickly respond to voltage or frequency anomalies and restore system stability.

[0101] Adjusting the topology configuration involves changing the node connection states, such as opening or closing certain power transmission paths. The microgrid topology consists of nodes such as generators, energy storage devices, load points, and edges such as transmission lines; the connection states can be controlled by switches. For example, if abnormal frequency fluctuations are detected on a path, possibly due to path overload or loop interference, the method can optimize power flow by disconnecting secondary paths or reconnecting. In practice, an adjacency matrix is ​​constructed based on the topology data, critical paths are identified using anomaly pattern recognition, and graph optimization algorithms such as minimum spanning trees are used to adjust the connection states. The adjusted topology configuration is represented by an updated adjacency matrix, ensuring maximum power transmission efficiency while preventing the spread of anomalies.

[0102] The optimized operating strategy is output as a sequence of energy storage device charge / discharge power or a node connection state matrix, comprehensively considering the spatiotemporal characteristics of abnormal modes. For example, for a voltage anomaly at a critical load node, the operating strategy might include increasing the energy storage device's discharge power to 100 kW while disconnecting a low-capacity path to reduce interference. In implementation, the strategy can be executed through a real-time control system, such as using a SCADA system to send control signals to the energy storage device or switching equipment. The optimization process may also incorporate predictive models to estimate the evolution trend of abnormal modes, further improving the effectiveness of the strategy.

[0103] The method provided in this application can be applied to various scenarios, including but not limited to: First, in distributed energy systems, such as microgrids containing photovoltaic, wind power, and energy storage, this method can monitor voltage or frequency anomalies in real time, dynamically adjust the charging and discharging strategies of energy storage devices, optimize power distribution, and ensure stable system operation, making it particularly suitable for independent microgrids in remote areas. Second, in smart city power grids, facing complex topologies and diverse load demands, this method effectively prevents the spread of local faults and improves grid reliability by detecting abnormal fluctuations in key load nodes and adjusting their connection status. Furthermore, in industrial park microgrids, this method can cope with highly dynamic load changes, optimize operating parameters to improve energy efficiency, and reduce operating costs. By combining symbolic dynamics and reaction-diffusion models, the method can accurately capture spatiotemporal anomalies and quickly optimize in these scenarios, meeting the requirements for real-time performance and stability.

[0104] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0105] According to another embodiment, a microgrid spatiotemporal anomaly detection and optimization device is provided. Figure 3 A schematic block diagram of a microgrid spatiotemporal anomaly detection and optimization device according to one embodiment is shown. Figure 3 As shown, the device 300 includes:

[0106] The microgrid data acquisition unit 301 is configured to acquire microgrid operation data and topology data. The operation data includes the output power of the power generation equipment, and the topology data includes the connection relationship between nodes and edges, where nodes represent power generation equipment, energy storage equipment or load points, and edges represent power transmission paths.

[0107] The dynamic feature representation generation unit 302 is configured to apply a symbolic dynamics method to convert the time series of the running data into a symbolic sequence, and calculate the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid time dimension.

[0108] The reaction-diffusion model construction unit 303 is configured to construct the reaction-diffusion model of the microgrid, wherein the reaction terms are determined based on the dynamic feature representation of the symbol sequence, and the diffusion terms are determined based on the power transmission paths in the topology data.

[0109] The spatiotemporal anomaly detection unit 304 is configured to solve the reaction-diffusion model and, based on the solution results of the reaction-diffusion model, detect spatiotemporal anomaly patterns in the microgrid, the spatiotemporal anomaly patterns including abnormal fluctuations in voltage or frequency.

[0110] The optimized operation strategy generation unit 305 is configured to dynamically adjust the operating parameters or topology configuration of the microgrid according to the spatiotemporal anomaly mode to obtain an optimized operation strategy, which includes the charging and discharging strategy of the energy storage device or the node connection status.

[0111] As an implementable approach, the dynamic feature representation generation unit 302, when applying the symbol dynamics method to convert the time series of the operating data into a symbol sequence, can be configured as follows: segmenting the time series of the operating data according to a predetermined time window, setting a dynamic threshold interval based on the topology data; mapping the data value to discrete symbols by comparing the data value within each time window with the dynamic threshold interval, wherein each discrete symbol corresponds to a symbol state, and the symbol state represents the power intensity of the data value; arranging the discrete symbols in chronological order to obtain a symbol sequence reflecting the dynamic operating law of the microgrid.

[0112] As an implementable approach, the dynamic feature representation generation unit 302, when setting dynamic threshold intervals based on the topology data, can be configured to: determine a reference range for the data values ​​within each time window; determine key load nodes in the microgrid based on the topology data; and obtain dynamic threshold intervals for each time window based on the key load nodes and the reference ranges, wherein the data values ​​associated with the key load nodes correspond to more subdivided dynamic threshold intervals.

[0113] As an implementable approach, the dynamic feature representation generation unit 302 can be configured to: count the occurrence frequency of adjacent symbol pairs in the symbol sequence, calculate the transition probability between each symbol pair based on the occurrence frequency, and construct a transition probability matrix; based on the transition probability matrix, count the occurrence frequency of each symbol state in the symbol sequence, and calculate the proportion of each symbol state in the symbol sequence; identify the transition path of each symbol state in different time windows, count the occurrence frequency of each transition path, and weight the occurrence frequency of each transition path to obtain a weighted transition path proportion, wherein the transition path related to key load nodes is given a higher weight; based on the weighted transition path proportion and combined with the connection strength between nodes in the microgrid topology, generate a mode entropy characterizing the dynamic complexity of the microgrid's operating state.

[0114] As an implementable approach, the reaction-diffusion model building unit 303, when the reaction term is determined based on the dynamic feature representation of the symbol sequence, can be configured to: determine the dynamic behavior parameters of each node according to the transition probability matrix of the symbol sequence, the dynamic behavior parameters including the rate of change of node power output; map the dynamic behavior parameters to the reaction term, and modify the reaction term according to the mode entropy.

[0115] As an implementable approach, the reaction diffusion model construction unit 303, when the diffusion term is determined based on the power transmission path in the topology data, can be configured to: extract the length and transmission capacity of the power transmission path according to the topology data; calculate the diffusion coefficient of power flow between nodes based on the path length and transmission capacity; and combine the diffusion coefficient with the edge connection relationship in the topology to generate a diffusion term characterizing the spatial power distribution of the microgrid.

[0116] As an implementable approach, the spatiotemporal anomaly detection unit 304, when detecting spatiotemporal anomaly modes in a microgrid based on the solution results of the reaction-diffusion model, can be configured to: initialize the boundary conditions of the reaction-diffusion model, the boundary conditions being determined based on the rated voltage and frequency range of the microgrid; analyze the interaction between reaction and diffusion terms through step-by-step iteration, and, in conjunction with the complexity of the mode entropy, prioritize the analysis of nodes or time windows with higher complexity to generate a dynamic operating state diagram of the microgrid; and, based on the dynamic operating state diagram, identify nodes or paths where the voltage or frequency deviates from the rated range, determining them as spatiotemporal anomaly modes.

[0117] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0118] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0119] In addition, embodiments of this application also provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0120] And an electronic device comprising: one or more processors; and a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method described in any of the foregoing method embodiments.

[0121] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the foregoing method embodiments.

[0122] in, Figure 4 An exemplary architecture of an electronic device is shown, which may include a processor 410, a video display adapter 411, a disk drive 412, an input / output interface 413, a network interface 414, and a memory 420. The processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420 can communicate with each other via a communication bus 430.

[0123] The processor 410 can be implemented using a general-purpose CPU, microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits to execute relevant programs in order to implement the technical solution provided in this application.

[0124] The memory 420 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 420 can store the operating system 421 for controlling the operation of the electronic device 400, and the basic input / output system (BIOS) 422 for controlling the low-level operations of the electronic device 400. Additionally, it can store a web browser 423, a data storage management system 424, and a microgrid spatiotemporal anomaly detection and optimization device 425, etc. The aforementioned microgrid spatiotemporal anomaly detection and optimization device 425 can be the application program that specifically implements the aforementioned steps in this embodiment. In summary, when implementing the technical solution provided in this application through software or firmware, the relevant program code is stored in the memory 420 and executed by the processor 410.

[0125] Input / output interface 413 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components in the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touch screens, microphones, various sensors, etc., and output devices may include displays, speakers, vibrators, indicator lights, etc.

[0126] Network interface 414 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0127] Bus 430 includes a pathway for transmitting information between various components of the device, such as processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, and memory 420.

[0128] It should be noted that although the above-described device only shows the processor 410, video display adapter 411, disk drive 412, input / output interface 413, network interface 414, memory 420, bus 430, etc., in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the solution of this application, and does not necessarily include all the components shown in the figures.

[0129] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer program product. This computer program product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.

[0130] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for detecting and optimizing spatiotemporal anomalies in microgrids, characterized in that, The method includes: Acquire microgrid operation data and topology data. The operation data includes the output power of the power generation equipment, and the topology data includes the connection relationship between nodes and edges, where nodes represent power generation equipment, energy storage equipment, or load points, and edges represent power transmission paths. By applying the symbolic dynamics method, the time series of the operating data is transformed into a symbolic sequence, and the transition probability and mode entropy of the symbolic sequence are calculated to generate a dynamic feature representation of the microgrid in the time dimension. A reaction-diffusion model for the microgrid is constructed, wherein the reaction term is determined based on the dynamic feature representation of the symbol sequence, and the diffusion term is determined based on the power transmission path in the topology data; The reaction-diffusion model is solved, and based on the solution results, spatiotemporal anomaly patterns in the microgrid are detected, including abnormal fluctuations in voltage or frequency. Based on the spatiotemporal anomaly pattern, the operating parameters or topology configuration of the microgrid are dynamically adjusted to obtain an optimized operating strategy, which includes the charging and discharging strategy of energy storage devices or the node connection status.

2. The microgrid spatiotemporal anomaly detection and optimization method according to claim 1, characterized in that, The application of symbolic dynamics to transform the time series of the running data into a symbolic sequence includes: The time series of the running data is segmented according to a predetermined time window, and a dynamic threshold interval is set based on the topological data. By comparing the data value within each time window with the dynamic threshold interval, the data value is mapped to a discrete symbol, wherein each discrete symbol corresponds to a symbol state, and the symbol state represents the power intensity of the data value; The discrete symbols are arranged in chronological order to obtain a symbol sequence that reflects the dynamic operation of the microgrid.

3. The microgrid spatiotemporal anomaly detection and optimization method according to claim 2, characterized in that, Based on the aforementioned topology data, the dynamic threshold range is defined as follows: Determine the reference range for the data values ​​within each time window; The key load nodes in the microgrid are determined based on the topology data; Based on the key load node and the reference range, a dynamic threshold range for each time window is obtained, wherein the data value related to the key load node corresponds to a more granular dynamic threshold range.

4. The microgrid spatiotemporal anomaly detection and optimization method according to claim 2, characterized in that, Calculating the transition probability and mode entropy of the symbol sequence includes: The frequency of occurrence of adjacent symbol pairs in a sequence of symbols is statistically analyzed, and the transition probability between each symbol pair is calculated based on the frequency of occurrence to construct a transition probability matrix; Based on the transition probability matrix, the number of times each symbol state appears in the symbol sequence is counted, and the proportion of each symbol state in the symbol sequence is calculated. Identify the transition path of each symbol state within different time windows, count the occurrence of each transition path, and weight the occurrence of each transition path to obtain the weighted proportion of the transition path, wherein the transition path related to the critical load node is given a higher weight; Based on the weighted transfer path ratio and the connection strength between nodes in the microgrid topology, a mode entropy characterizing the dynamic complexity of the microgrid's operating state is generated.

5. The microgrid spatiotemporal anomaly detection and optimization method according to claim 1, characterized in that, The reaction term is determined based on the dynamic characteristic representation of the symbol sequence, including: Based on the transition probability matrix of the symbol sequence, the dynamic behavior parameters of each node are determined, including the rate of change of node power output; The dynamic behavior parameters are mapped to reaction terms, and the reaction terms are modified according to the mode entropy.

6. The microgrid spatiotemporal anomaly detection and optimization method according to claim 1, characterized in that, The diffusion term, determined based on the power transmission paths in the topology data, includes: Based on the topology data, extract the length and transmission capacity of the power transmission path; Based on the path length and transmission capacity, the diffusion coefficient of power flow between nodes is calculated; By combining the diffusion coefficient with the edge connectivity in the topology, a diffusion term characterizing the spatial power distribution of the microgrid is generated.

7. The microgrid spatiotemporal anomaly detection and optimization method according to claim 1, characterized in that, Based on the solution results of the aforementioned reaction-diffusion model, the spatiotemporal anomaly patterns detected in microgrids include: Initialize the boundary conditions of the reaction-diffusion model, the boundary conditions being determined based on the rated voltage and frequency range of the microgrid; By iteratively analyzing the interaction between reaction and diffusion terms and combining the complexity of the mode entropy, nodes or time windows with higher complexity are analyzed first to generate a dynamic operating state diagram of the microgrid. Based on the dynamic operating status diagram, nodes or paths where the voltage or frequency deviates from the rated range are identified and determined to be spatiotemporal abnormal modes.

8. A microgrid spatiotemporal anomaly detection and optimization device, characterized in that, The device includes: The microgrid data acquisition unit is configured to acquire microgrid operation data and topology data. The operation data includes the output power of the power generation equipment, and the topology data includes the connection relationship between nodes and edges, wherein nodes represent power generation equipment, energy storage equipment or load points, and edges represent power transmission paths. The dynamic feature representation generation unit is configured to apply a symbolic dynamics method to convert the time series of the running data into a symbolic sequence, and calculate the transition probability and mode entropy of the symbolic sequence to generate a dynamic feature representation of the microgrid in the time dimension. The reaction-diffusion model building unit is configured to build a reaction-diffusion model of the microgrid, wherein the reaction term is determined based on the dynamic feature representation of the symbol sequence, and the diffusion term is determined based on the power transmission path in the topology data; The spatiotemporal anomaly detection unit is configured to solve the reaction-diffusion model and, based on the solution results of the reaction-diffusion model, detect spatiotemporal anomaly patterns in the microgrid, the spatiotemporal anomaly patterns including abnormal fluctuations in voltage or frequency. The optimized operation strategy generation unit is configured to dynamically adjust the microgrid's operating parameters or topology configuration based on the spatiotemporal anomaly mode to obtain an optimized operation strategy, which includes the charging and discharging strategy of energy storage devices or the node connection status.

9. An electronic device, characterized in that, include: One or more processors; And a memory associated with the one or more processors, the memory being used to store program instructions that, when read and executed by the one or more processors, perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 7.