Micro-grid integrated control method and system, storage medium and program product

By integrating non-electrical and electrical quantity data and utilizing a context classifier and multi-objective optimization algorithm, the microgrid control strategy is dynamically adjusted. This solves the problems of insufficient emergency response and system instability in the face of sudden changes in the physical environment, achieves efficient local event identification and global coordination, and improves the system's stability and emergency response capabilities.

CN121770046APending Publication Date: 2026-03-31HUBEI XINGYI ELECTRIC GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing microgrid control systems struggle to identify real-world scenarios when faced with sudden changes in the physical environment, leading to a mismatch between control strategies and actual needs, insufficient emergency response capabilities, low resource allocation efficiency during complex multi-point events, and potential system instability when optimization algorithms fail to provide solutions.

Method used

By introducing the fusion of non-electrical quantity data and electrical quantity data, identifying system scenarios through a scenario classifier, dynamically switching the running objective function, and employing a multi-objective collaborative optimization algorithm and an autonomous control unit response capability declaration mechanism, the system achieves accurate identification of local areas and global coordination, and possesses fault protection and graceful degradation capabilities.

Benefits of technology

It improves the emergency response speed and decision-making accuracy of microgrids, enhances the robustness and fault tolerance of the system, ensures stable operation of the system under extreme events, and avoids large-scale power outages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121770046A_ABST
    Figure CN121770046A_ABST
Patent Text Reader

Abstract

A micro-grid integrated control method and system, a storage medium and a program product relate to the field of general control or regulation systems.The method comprises the steps that non-electrical quantity data and electrical quantity data are acquired, and a classification result identifying the type of a situation where a current system is located is determined; determining a current operation objective function corresponding to the classification result; generating an operation intention consulting message based on the current operation objective function; broadcasting the operation intention consulting message to a plurality of autonomous control units in the micro-grid, and receiving a feedback response capability declaration message; all the received response capability declaration messages are substituted into a constraint optimization algorithm for solving, and a power distribution instruction set is obtained; and respectively issuing the power instructions in the power distribution instruction set to the corresponding autonomous control units, so that the autonomous control units execute power adjustment. According to the invention, the emergency response capability of the system to the security event can be enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the general field of control or regulation systems, and more particularly to an integrated microgrid control method, system, storage medium, and program product. Background Technology

[0002] Currently, microgrids, with distributed photovoltaics, energy storage, and controllable loads as their core components, are widely used. The stable operation of a microgrid depends on a reliable control system, which needs to balance power supply and demand within the grid in real time, optimize energy flow, and ensure power quality and system security in different modes, such as connection to the main grid (grid-connected) or disconnection (islanding).

[0003] In related technologies, a centralized predictive optimization-based control method has been proposed in the prior art. This method typically deploys a central controller in the microgrid, which periodically collects network-wide operational data from various terminals (such as photovoltaic inverters, energy storage converters, and smart meters). Based on this collected data, time series analysis, neural networks, and other algorithms are used to predict the photovoltaic output and load curves for future cycles. With the goal of minimizing the total system operating cost, the charging and discharging power plans for each controllable unit in the future cycle are calculated, and specific control commands are issued for execution.

[0004] However, when the physical environment of the microgrid changes—for example, high-temperature steam causes the energy storage container to overheat and triggers over-temperature protection, while the high-power fire pumps and ventilation systems that start in an emergency create a huge impact load on the power grid—the relevant technologies only perceive the energy storage disconnection and load surge based on electrical quantity data, treating them as routine faults and load fluctuations. They fail to recognize that the system has entered a safety emergency situation and continue to allocate power according to cost optimization objectives. This leads to a mismatch between the control strategy and the actual situational needs, resulting in insufficient emergency response capabilities for system safety events. Summary of the Invention

[0005] This application provides an integrated microgrid control method, system, storage medium, and program product to enhance the system's emergency response capability to security incidents.

[0006] Firstly, this application provides an integrated microgrid control method applied to a microgrid control system. The method includes: acquiring non-electrical quantity data characterizing the physical environment of the microgrid from non-electrical quantity sensors, and acquiring electrical quantity data characterizing the operating status of each device from electrical quantity sensors; inputting the non-electrical quantity data and electrical quantity data into a preset scenario classifier to obtain a classification result identifying the current system scenario type; determining the current operating objective function corresponding to the classification result from a preset set of control objectives based on the classification result; generating an operating intent solicitation message containing system power requirements and safety constraint parameters based on the current operating objective function; broadcasting the operating intent solicitation message to multiple autonomous control units within the microgrid, and receiving response capability declaration messages fed back by the autonomous control units; the response capability declaration message being generated by the autonomous control unit based on its internal operating status and the operating intent solicitation message; substituting all received response capability declaration messages into a preset constraint optimization algorithm for solution, obtaining a globally coordinated power allocation instruction set; and issuing the power instructions in the power allocation instruction set to the corresponding autonomous control units, causing the autonomous control units to perform power adjustments.

[0007] In the above embodiments, the microgrid control system, by adopting the above technical solution, introduces non-electrical quantity data to perceive the physical environment of the microgrid, identifies the current real situation of the system, and enables the control system to dynamically switch to a safety-oriented operating objective function according to different situations such as fire and equipment overheating. Through the collaborative mechanism of intent solicitation and response capability declaration, global optimal power coordination is achieved while preserving the autonomy of each unit, thereby improving the emergency response speed and decision-making accuracy of the microgrid in the face of physical safety events.

[0008] In conjunction with some embodiments of the first aspect, in some embodiments, the step of determining the current operating objective function corresponding to the classification result from a preset set of control objectives specifically includes: dividing the microgrid into at least two local regions in terms of electrical topology based on the source identifier attached to the non-electrical quantity data; collecting the electrical quantity data and non-electrical quantity data in each local region to determine the local classification result that identifies the local situation type; determining the local operating objective function of the corresponding local region based on the local classification result, generating an objective function set containing multiple local operating objective functions as the current operating objective function; and substituting the objective function set into a multi-objective collaborative optimization algorithm for solving to obtain a partitioned power configuration instruction set.

[0009] In the above embodiments, the microgrid control system, by adopting the above technical solution, divides the microgrid into different local areas according to the physical location of non-electrical quantity sensors, and performs independent situation assessment for each area, thereby achieving accurate identification and differentiated response to local events. This avoids the limitations of a single global target in handling complex, multi-point concurrent events and improves the targeting and efficiency of resource allocation.

[0010] In conjunction with some embodiments of the first aspect, in some embodiments, after determining the local operational objective function of the corresponding local region based on the local classification result and generating an objective function set containing multiple local operational objective functions as the current operational objective function, the method further includes: generating a corresponding optimization weight coefficient for each local operational objective function based on a preset risk level associated with the local scenario type; and adjusting the constraint satisfaction priority of each local operational objective function in the solution process based on the optimization weight coefficient.

[0011] In the above embodiments, the microgrid control system, by adopting the above technical solution, assigns optimization weights based on risk levels to the objective functions of different local areas. When performing multi-objective collaborative optimization, the system will prioritize meeting the control objectives of high-risk areas (such as areas where fires occur), for example, prioritizing the power demand of fire-fighting loads in that area. This enables the system to make safe decisions when resources are scarce, prioritizing the allocation of limited power resources to the most critical tasks and enhancing the effectiveness of emergency response.

[0012] In conjunction with some embodiments of the first aspect, in some embodiments, after broadcasting an operation intent solicitation message to multiple autonomous control units within the microgrid and receiving a response capability declaration message from the autonomous control units, the method further includes: comparing the set of controllable units that have received the response capability declaration message with a pre-stored full list of controllable units to determine offline units that have not responded; and adding offline constraints to the current operating objective function to ensure that the power exchange of nodes directly electrically connected to offline units does not exceed a preset safety limit.

[0013] In the above embodiments, the microgrid control system adopts the above technical solution to actively identify offline units by comparing the response list and the pre-stored list, thereby promptly detecting communication interruptions or unit failures, limiting power exchange with nodes connected to the unit, preventing problems such as power flow runaway or voltage over-limit caused by local unit disconnection, isolating the potential negative impact of offline units within a local area, ensuring the stable operation of the rest of the microgrid, and improving the robustness and fault tolerance of the entire control system.

[0014] In conjunction with some embodiments of the first aspect, in some embodiments, after comparing the set of controllable units that have received response capability declaration messages with a pre-stored full list of controllable units to determine the offline units that have not responded, the method further includes: selecting neighboring units that are adjacent to the offline units in the electrical topology from the set of controllable units; issuing status detection commands to the neighboring units so that the neighboring units monitor the characteristic parameters of the electrical ports connected to the offline units; and updating the preset safety limits in the offline constraints according to the characteristic parameters reported by the neighboring units.

[0015] In the above embodiments, the microgrid control system adopts the above technical solution to indirectly detect the electrical status of the offline unit by using neighboring units adjacent to the offline unit. By monitoring characteristic parameters such as voltage and current of the connection port, it can infer whether the offline unit is in an unloaded disconnected state or a fault short circuit state. This enables the system to maximize the use of the power grid's transmission capacity while ensuring safety, and improves the intelligence level and operating efficiency of offline event handling.

[0016] In conjunction with some embodiments of the first aspect, in some embodiments, the step of substituting all received response capability declaration messages into a preset constraint optimization algorithm to obtain a globally coordinated power allocation instruction set specifically includes: substituting the power response parameters in the response capability declaration messages into the constraint optimization algorithm in the current running objective function to determine the solution state; when the solution state is a feasible solution state, extracting the obtained power allocation scheme as the power allocation instruction set; when the solution state is an unsolvable state, suspending the solution process of the current running objective function; generating a degraded operation instruction set according to the preset reduction priority of each controlled load and the preset output limit of each power unit, and using the degraded operation instruction set as the power allocation instruction set.

[0017] In the above embodiments, the microgrid control system, by adopting the aforementioned technical solution, finds the optimal solution through optimization algorithms under normal circumstances. When the system faces extreme situations, such as excessive power shortages leading to no solution in optimization, the system will not crash or stop responding, but will automatically switch to a preset degraded operation mode. Based on load priority and the principle of guaranteed power output, secondary loads are systematically reduced to ensure the power supply to core loads, ensuring that the system can provide stable and feasible control commands under any circumstances, thus enhancing the microgrid's survivability under extreme events.

[0018] In conjunction with some embodiments of the first aspect, in some embodiments, after inputting non-electrical quantity data and electrical quantity data into a preset scenario classifier to obtain a classification result identifying the scenario type of the current system, the method further includes: querying a load reduction priority configuration scheme corresponding to the scenario type from a pre-stored priority mapping table according to the scenario type identified by the classification result; and binding the corresponding dynamic reduction priority to the controlled load in the microgrid according to the priority configuration scheme.

[0019] In the above embodiments, the microgrid control system dynamically links load reduction priorities with the current system situation by adopting the aforementioned technical solution. For example, under normal economic operating conditions, comfort loads (such as air conditioning) can be prioritized for reduction; however, in a fire emergency situation, the priority of loads such as fire pumps and emergency lighting will be increased, while non-critical loads such as office areas will be reduced. This ensures that when degraded operation is triggered, the load reduction behavior can accurately match the core needs of the current situation, ensuring that the most important functions are maintained under different crises, making the degraded strategy more intelligent and situation-adaptive.

[0020] In a second aspect, embodiments of this application provide a microgrid control system, which includes: one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, which includes computer instructions, and the one or more processors call the computer instructions to cause the microgrid control system to perform the method described in the first aspect and any possible implementation thereof.

[0021] Thirdly, embodiments of this application provide a computer program product containing instructions that, when the computer program product is run on a microgrid control system, cause the microgrid control system to perform the method described in the first aspect and any possible implementation thereof.

[0022] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on a microgrid control system, cause the microgrid control system to perform the method described in the first aspect and any possible implementation thereof.

[0023] Understandably, the microgrid control system provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the methods provided in the embodiments of this application. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods, and will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0025] 1. By employing a control method that acquires both non-electrical and electrical quantity data, utilizes a situation classifier to identify the system's current situation, and then determines the current operating objective function from a preset set based on the situation results, the microgrid control system can transcend the traditional scope of economic dispatching based solely on electrical quantities. By integrating physical environmental information such as temperature and smoke detection, it can accurately determine whether the system is in a normal operating state or in special safety situations such as fires or equipment overheating. This effectively solves the problem in existing technologies where, when faced with chain reactions caused by sudden changes in the physical environment, the root cause of the situation cannot be identified, and control is still performed according to conventional economic objectives, resulting in a serious mismatch between control strategies and actual needs, and insufficient emergency response capabilities.

[0026] 2. By employing a refined control strategy that divides the microgrid into local regions based on the source identifiers of non-electrical quantity data, independently classifies each region into scenarios to determine the local operational objective function, and finally solves the problem through a multi-objective collaborative optimization algorithm, the system can decompose a complex global problem into multiple related local problems for processing. When different events of different natures occur simultaneously in different physical locations of the microgrid, such as a fire in region A and a sudden drop in photovoltaic output in region B, the system can establish an objective function centered on ensuring power supply safety for region A, and simultaneously establish an objective function centered on power balance for region B, and perform collaborative optimization within a unified framework.

[0027] 3. Because it employs a two-tiered decision-making mechanism—which suspends the current solution process when no feasible solution is found and then generates a degraded operation instruction set based on preset load reduction priorities and power output limits—the control system possesses clear fault protection and graceful degradation capabilities. When the microgrid, due to severe power deficits or network constraints, cannot find any power allocation scheme that satisfies all constraints under the current objective function, the system will not be paralyzed or output invalid instructions. It will immediately switch to a predefined emergency plan to ensure that the grid does not collapse and maintain basic power supply to the most critical equipment. This effectively solves the risk in existing technologies where optimization algorithms may cause control system interruptions when no solution is found, resulting in the inability to provide any effective control measures and thus leading to system instability or even large-scale power outages. Attached Figure Description

[0028] Figure 1 This is a flowchart illustrating the integrated microgrid control method in an embodiment of this application;

[0029] Figure 2 This is another flowchart illustrating the integrated microgrid control method in this application embodiment;

[0030] Figure 3 This is a schematic diagram of the physical device structure of a microgrid control system in the embodiments of this application. Detailed Implementation

[0031] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification of this application, the singular expressions “a,” “an,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0032] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0033] In the specific implementation scenario of this application, the microgrid, as a complex system integrating distributed power sources (such as photovoltaics and energy storage), controllable loads, and monitoring equipment, depends not only on its internal power balance but also on the influence of its physical environment for safe and stable operation. The control method proposed in this application is precisely designed to address this complexity. Non-electrical quantity sensors refer to devices installed in key equipment or areas of the microgrid to monitor physical environment parameters, such as temperature sensors and smoke detectors installed inside energy storage containers, or infrared thermal imagers installed in important load areas. The non-electrical quantity data they provide, such as temperature, smoke concentration, and abnormal hotspots, are crucial for judging physical safety events. Electrical quantity sensors refer to traditional smart meters, power analyzers, etc., used to measure electrical quantity data such as voltage, current, and power, reflecting the electrical operating status of the equipment. The context classifier is a pre-trained intelligent algorithm model (such as decision trees, support vector machines, or neural networks). It acts like an experienced dispatcher, comprehensively analyzing the above two types of data to determine the current system's true context type, such as "normal economic operation," "energy storage compartment fire risk," or "critical load area overload." The objective function is a mathematical description of the control objective under a specific scenario. For example, the objective during economic operation is to minimize the cost of electricity purchase, while the objective during a fire scenario is to maximize the power supply for fire-fighting loads. Autonomous control units refer to devices in a microgrid that possess a certain degree of autonomous decision-making capability, such as power storage converters (PCS) and photovoltaic inverters. They can not only execute commands from higher levels but also provide feedback on their response capabilities based on their own status.

[0034] The following describes the process of the method provided in this implementation. Please refer to [link / reference]. Figure 1This is a flowchart illustrating the integrated microgrid control method in this application.

[0035] S101. Obtain non-electrical quantity data from non-electrical quantity sensors that characterize the physical environment of the microgrid, and obtain electrical quantity data from electrical quantity sensors that characterize the operating status of each device.

[0036] Non-electrical quantity sensors refer to devices used to monitor physical environmental parameters, such as temperature sensors and smoke detectors; non-electrical quantity data is used to represent the quantified values ​​of these physical parameters. Electrical quantity sensors refer to devices used to measure electrical parameters, such as smart meters and voltage transformers; electrical quantity data is used to represent the operating status of devices such as voltage, current, and power.

[0037] Specifically, the microgrid control system periodically or event-triggeredly collects data from various sensors deployed within the microgrid. For example, the control system acquires temperature data once per second from the temperature sensor of the energy storage container and smoke concentration data from the smoke detector; simultaneously, it acquires real-time active / reactive power, port voltage, frequency, and other electrical quantity data from devices such as the energy storage converter (PCS), photovoltaic inverter, and smart switches. These data collectively constitute a multi-dimensional snapshot of the current microgrid state.

[0038] In some embodiments, data quality issues exist, such as sensor malfunctions leading to data anomalies or loss. To address this, the microgrid control system incorporates a data preprocessing module containing data verification rules. For example, it performs range checks on received data (e.g., the temperature cannot be lower than -50°C), performs abrupt change checks on continuous data (e.g., power instantaneously jumps to 0 without operation), and fills in missing data using interpolation of nearby time-series data or model-based state estimation, ensuring that the data input to the subsequent context classifier is valid and reliable.

[0039] It should be noted that the data processing logic of this data preprocessing module is multi-stage. First, for each received data point (e.g., energy storage compartment temperature), the module performs range verification based on physical or empirical rules. For example, the system pre-stores the safe operating temperature range for this type of energy storage compartment as -20°C to 60°C; any data point exceeding this range will be marked as anomaly. Second, the module performs abrupt change detection on the time series data. It calculates the rate of change between the current data point and the previous data point and compares it with the preset maximum reasonable rate of change threshold for this data type (e.g., temperature change not exceeding 2°C per second). Abrupt changes exceeding the threshold are also marked. For data marked as anomaly or missing, the module initiates data imputation logic. If only a single data point is missing, the system preferentially uses linear interpolation, i.e., taking the average of the two valid data points before and after it for imputation. If multiple consecutive data points are lost, the system will switch to a model-based state estimation method. For example, it can use a simplified device thermodynamic model or Kalman filter to predict and fill in the missing temperature sequence based on the device's last effective state, relevant electrical quantity data (such as charging and discharging current), and ambient temperature data, so as to ensure the continuity and effectiveness of the data input to the subsequent context classifier.

[0040] S102. Input the non-electrical quantity data and the electrical quantity data into a preset situation classifier to obtain a classification result that identifies the current situation type of the system.

[0041] The context classifier represents a pre-trained algorithm model that can determine the system state based on the input data; the classification result refers to an identifier or label used to indicate the current context type of the system, such as "normal operation", "equipment overheat warning", "fire alarm", etc.

[0042] Specifically, after acquiring the multidimensional data in step S101, the microgrid control system integrates this data into a feature vector and provides it as input to the context classifier. The algorithm inside the classifier (e.g., a decision tree model) makes judgments based on its preset rules. For example, the rule might be: if "energy storage compartment temperature > 80°C" and "smoke concentration > threshold", the classification result is "energy storage compartment fire alarm"; if all data are within the normal range, the classification result is "normal operation".

[0043] In some embodiments, context classification can be implemented in several ways: Optionally, a rule-based expert system can be used, where domain experts predefine a series of "IF-THEN" rules, and the system strictly follows these rules for logical reasoning and classification. Optionally, a machine learning-based approach can be used, for example, using historical data (containing sensor data under various normal and abnormal operating conditions and their corresponding manually labeled contexts) to train a support vector machine (SVM) or deep neural network (DNN) model. This model can automatically learn the complex mapping relationship between data and context, achieving more intelligent and adaptive classification. It is understood that a hybrid model can also be used to implement context classification, combining the explicitness of expert rules with the generalization ability of machine learning; this is not limited here.

[0044] It should be noted that the context classifier is an intelligent decision-making model, and its construction and application follow a strict machine learning paradigm, specifically employing the Gradient Boosting Decision Tree (GBDT) model. The model's training relies on a large amount of historical operational data. First, a comprehensive dataset needs to be constructed, where each sample contains a feature vector at a specific timestamp and a corresponding context label. The feature vector consists of non-electrical quantity data (such as temperature, smoke concentration, and humidity in each area) and electrical quantity data (such as voltage at each node, line current, active / reactive power of equipment, and frequency) obtained from S101. All data has been preprocessed and normalized. The context labels are manually annotated by experienced schedulers or domain experts based on the data and event logs at that moment, such as "normal economic operation," "overheating warning of the energy storage compartment," "sudden drop in photovoltaic output," and "fire alarm in Area B." Before training, the dataset is divided into training, validation, and test sets. The training standard is to minimize the model's classification loss function (such as cross-entropy loss) while achieving the highest possible macro-average F1 score on the validation set, ensuring good recognition performance across various scenarios (including rare scenarios with limited sample sizes). During training, hyperparameters of the model (such as the number of trees, learning rate, and tree depth) are tuned using methods such as grid search.

[0045] As a GBDT model, the context classifier itself is an additive model composed of multiple decision trees. It iteratively trains new decision trees to fit the negative gradient of the residuals from the previous iteration, thereby gradually improving the overall model's prediction accuracy. Its input is a feature vector that is collected in real-time and preprocessed, with the same dimensions as during training. The model's output is a probability distribution vector, where each dimension corresponds to a predefined context category, and its value represents the probability that the current input data belongs to that context. For example, for an input, the model might output {"Normal economic operation": 0.1, "Energy storage compartment overheat warning": 0.85, "B-zone fire alarm": 0.05}.

[0046] In actual operation, the microgrid control system periodically integrates real-time acquired non-electrical and electrical quantity data into a feature vector and inputs it into a pre-trained GBDT model. The model performs forward propagation calculations and outputs the aforementioned probability distribution vector. The system then selects the category with the highest probability value as the final classification result. For example, in the above example, the system would determine the current situation as an overheating warning for the energy storage compartment. Furthermore, to handle unknown situations, the system sets a probability threshold (e.g., 0.7). If the highest probability value is lower than this threshold, it indicates that the model's confidence in the current situation is low, and it may be marked as an "unknown abnormal situation," triggering manual intervention and alarms.

[0047] In some embodiments, it is necessary to identify newly emerging unknown situations, but the preset classifier can only identify situations that have been trained or defined. To address this, an anomaly detection mechanism can be introduced. While the classifier is performing classification, an unsupervised learning model (such as an isolated forest or autoencoder) runs in parallel. When input data cannot be well matched with existing situations and is determined to be highly anomalous by the anomaly detection model, the system marks it as an "unknown anomalous situation," triggers the highest level of alarm, and stores the data sample in a database awaiting manual analysis for future iterations and upgrades of the classifier model.

[0048] S103. Based on the classification result, determine the current running objective function corresponding to the classification result from the preset control objective set.

[0049] The control objective set refers to a library that stores various operational objective functions, each function corresponding to one or more scenario types; the current operational objective function refers to the specific mathematical expression selected to guide the optimization of this round of control cycle.

[0050] Specifically, after obtaining the classification result in step S102, the microgrid control system queries a preset "scenario-objective function" mapping table. For example, when the classification result is "normal operation," the system selects an objective function from the set with "minimizing operating costs" as its core objective; when the classification result is "energy storage compartment fire alarm," it selects a safety objective function with "maximizing power supply to the fire pump while disconnecting from the fire area" as its core objective. This switching process is completed automatically, ensuring a high degree of consistency between the control objective and actual needs.

[0051] In some embodiments, the objective function can be determined in several ways: Optionally, a simple direct mapping can be used, where each scenario type strictly corresponds to a fixed objective function. Optionally, a parameterized combination generation method can be used, where the objective function is composed of multiple weighted sub-objectives (such as economy, safety, and environmental protection). The system dynamically generates the current running objective function by querying the corresponding weight coefficients from a preset weight configuration library based on the scenario type (e.g., in a fire, the safety weight is 1 and the economy weight is 0). It is understood that other methods can also be used to determine the objective function, such as dynamically adjusting the weights of each sub-objective based on fuzzy logic; this is not limited here.

[0052] In some embodiments, system oscillations may be triggered by objective function switching. For example, near a critical state, the scenario classification result may switch rapidly between two states, causing the objective function to change frequently and resulting in control command jitter. To address this, a "hysteresis" or "debouncing" mechanism is introduced into the objective function switching logic. For instance, when the scenario switches from A to B, the objective function is switched immediately; however, when the scenario switches back from B to A, state A needs to remain for a certain period of time (such as several seconds or several control cycles) before the objective function is switched back. This effectively filters out brief scenario jumps caused by data fluctuations, ensuring the stability of the control objective.

[0053] S104. Based on the current operating objective function, generate an operating intent query message containing system power requirements and safety constraint parameters.

[0054] Among them, the Operation Intent Inquiry Message is a data packet with a specific format used to convey the overall objectives of the central controller to the devices in the microgrid; System Power Demand refers to the amount of power that the system as a whole needs to adjust in order to achieve the objective function; Safety Constraint Parameters refer to the boundary conditions that must be followed during the adjustment process, such as the upper limit of line transmission power and the range of node voltage.

[0055] Specifically, based on the current operating objective function determined in step S103 and combined with the current system status (such as total load and total photovoltaic output), the microgrid control system initially calculates an ideal, global power adjustment direction and magnitude. For example, if the objective is to fill a power gap, the power demand in the message might be a positive value; if the objective is to absorb excess photovoltaic power, it might be a negative value. Simultaneously, the message will include key constraints decomposed from the objective function, such as "the power exchanged at the PCC point must not exceed 500kW." This message is equivalent to a "task outline" issued by the central controller to all units.

[0056] In some embodiments, message generation can be achieved in several ways: Optionally, a general message containing overall power requirements (e.g., "The entire network needs to increase power generation by 50kW") and universal constraints (e.g., "Voltage range 0.95-1.05 pu") can be generated. Optionally, a more instructive message can be generated, which, in addition to the overall requirements, includes suggested power adjustment ranges for different types of units (e.g., "Recommended energy storage unit discharge, range 0-100kW; recommended load reduction with reduced power, range 0-20kW"), providing a clearer reference for the response of each unit. It is understood that other methods can also be used to generate the message, and this is not limited here.

[0057] In some embodiments, it is necessary to ensure that the solicitation messages clearly convey the intent without unduly restricting the autonomy of each unit. To address this, a hierarchical information design is adopted. The messages contain two types of information: "mandatory" and "suggestive." Mandatory information consists of safety constraints that must be followed, such as voltage and frequency ranges; suggestive information is the expected power contribution to achieve the goal, and each unit can make autonomous decisions based on these suggestions according to its own state. This design maximizes the flexibility of distributed autonomous control while ensuring system safety and goal orientation.

[0058] S105. Broadcast the operation intention query message to multiple autonomous control units within the microgrid, and receive the response capability declaration message fed back by the autonomous control units.

[0059] Among them, broadcasting refers to sending messages to all relevant units within the network; autonomous control unit refers to a device controller with local computing and decision-making capabilities, such as an energy storage PCS; response capability declaration message is the autonomous control unit's response to the query message, containing information such as the power regulation range it is willing and able to provide.

[0060] Specifically, the microgrid control system sends the query message generated in step S104 out through an internal communication network (such as an industrial Ethernet). Upon receiving the message, each autonomous control unit parses the power demand and constraints, and, combined with its own real-time status (such as the SOC of the energy storage, the current output of the inverter, and the operating status of the controllable load), calculates the power response range it can safely and reliably provide. Then, it encapsulates this range (e.g., "can provide power regulation from -20kW to +50kW") into a response capability declaration message and sends it back to the microgrid control system.

[0061] In some embodiments, response and reception can be implemented in several ways: Optionally, a synchronous blocking method can be used, where the system broadcasts a message and waits for responses from all units within a set timeout period, proceeding to the next step after all responses have been collected or the timeout has occurred. Optionally, an asynchronous non-blocking method can be used, where the system sets up a listening port to continuously receive response messages sent back by each unit within a specified window period; this method offers higher communication efficiency. It is understood that other communication protocols and mechanisms can also be used to implement this step, such as the publish-subscribe pattern based on MQTT, which is not limited here.

[0062] It's important to note that the decision-making logic within the autonomous control unit is a rigorous, multi-constrained computational process. Taking an energy storage PCS as an example, upon receiving a request for operation intent, its internal processor first acquires a series of real-time internal state parameters, primarily including the battery's state of charge (SOC), the highest / lowest individual cell voltage of the battery cluster, the current temperature, and its own rated power. Next, it calculates the physical power limit range at the current moment based on these parameters. For instance, its maximum discharge power is not only limited by the PCS's rated power but may also be restricted by an internal protection curve function (Derating Curve) due to excessively low SOC or high temperature, which outputs a dynamic safe power limit. Similarly, the maximum charging power is also limited by SOC, temperature, and voltage. After calculating this physical limit range [P_min_phy, P_max_phy], the controller further considers the system-level safety constraints contained in the request message, such as the system voltage range required in the message. The PCS estimates the port voltage variation under different power outputs based on its impedance model, ensuring that its regulation behavior does not cause the port voltage to exceed the constraints in the message, thus obtaining a grid-allowed power range [P_min_grid, P_max_grid] that takes into account grid constraints. Finally, the controller intersects these two ranges to obtain the final, safely declarable comprehensive response capability range.

[0063] [max(P_min_phy, P_min_grid), min(P_max_phy, P_max_grid)]. This final range is encapsulated in a response capability declaration message and reported to the microgrid control system.

[0064] In some embodiments, a "response storm" can occur, where a large number of units reply to messages simultaneously, potentially causing network congestion. To address this, a suggested response delay mechanism can be included when broadcasting query messages. For example, each unit could be required to calculate a small, random delay (e.g., 0-100 milliseconds) based on the hash value of its device ID before sending its response message. This staggers the responses in time, effectively avoiding instantaneous communication spikes and improving communication reliability.

[0065] S106. Substitute all received response capability declaration messages into a preset constraint optimization algorithm for solving to obtain a globally coordinated power allocation instruction set.

[0066] Among them, constrained optimization algorithm refers to a mathematical method for finding the optimal solution of the objective function under a series of constraints, such as linear programming and quadratic programming; power allocation instruction set refers to a list containing specific power adjustment values ​​for each response unit.

[0067] Specifically, the microgrid control system collects all response capability declaration messages received from step S105. The power response ranges in these messages are used as boundary conditions for decision variables and substituted into the current operating objective function determined in step S103. For example, the objective function is to minimize cost, and the constraints include overall grid power balance and the power regulation range declared by each unit. Then, the system calls its internal optimization solver to calculate this mathematical problem. The solver will provide a set of specific power allocation values ​​(such as "energy storage A discharges 30kW, photovoltaic B is limited to 10kW, load C is reduced to 5kW"), which can be a globally coordinated set of power allocation instructions.

[0068] In some embodiments, the optimization solution can be achieved in several ways: Optionally, if the objective function and constraints are linear, efficient linear programming (LP) or mixed-integer linear programming (MILP) algorithms can be used. Optionally, if nonlinear relationships (such as network losses) are involved, more complex algorithms such as nonlinear programming (NLP) or quadratic programming (QP) can be used. It is understood that heuristic algorithms such as particle swarm optimization (PSO) and genetic algorithms (GA) can also be used to solve the problem, especially when the model is highly complex and difficult to solve using traditional methods; this is not limited here.

[0069] It should be noted that the constraint optimization algorithm pre-set here is essentially a mathematical programming model, usually constructed as a mixed-integer linear programming (MILP) model, in order to achieve a specific operational goal while ensuring that all physical and operational constraints are met.

[0070] The model is not built through data-driven training, but rather based on a precise mathematical description of the physical laws and operating rules of the microgrid. The criteria for its construction are model accuracy and solution efficiency. First, decision variables need to be defined, including the active power P_i and reactive power Q_i (continuous variables) of each controllable unit (such as energy storage, photovoltaic inverters, and controllable loads) within the microgrid, and the switching states δ_j (binary integer variables) of certain devices (such as circuit breakers and load switches). Second, the objective function is constructed, directly derived from the current operating objective function determined in S103. For example, in an economic operating scenario, the objective function is to minimize the total operating cost minΣ(c_i*P_i), where c_i is the generation or consumption cost coefficient of each unit. In a safety emergency scenario, the objective function might be to maximize the power supply to critical loads maxP_critical_load. Finally, and most importantly, a set of constraints is constructed. This includes: 1) Power balance constraints, i.e., the algebraic sum of the power injected by all nodes in the network must be zero (or equal to the power exchanged with the main grid); 2) Equipment operation constraints, i.e., the power output of each unit must be within the range [P_min_i, P_max_i] declared in its response capability declaration message; 3) Network security constraints, such as the line power flow (power transmission) must not exceed its thermal stability limit, and the voltage amplitude of each node must be within the safe range [V_min, V_max]. This is usually approximated by DC power flow models or piecewise linearized AC power flow models to maintain the linearity of the model.

[0071] As a MILP model, the constrained optimization algorithm consists of a linear objective function and a set of linear equality / inequality constraints. Its inputs are all the parameters required by the model, specifically including: coefficients of the objective function (such as electricity price and weights), the coefficient matrix of the constraint equations (determined by network topology and equipment parameters), and constant terms on the right-hand side of the constraint equations (such as load forecasts, declared power and voltage limits for each unit, etc.). The model's output is a set of decision variables that optimize the objective function while satisfying all constraints, i.e., the specific power allocation instruction set {P_1*, Q_1*, P_2*, Q_2*, ..., δ_j*, ...}.

[0072] During each control cycle, the microgrid control system dynamically aggregates all input parameters (especially the response capability declaration messages reported by each unit, which define the boundaries of decision variables) to construct a MILP problem instance for the current moment. Then, the system invokes a high-efficiency commercial or open-source optimization solver (such as Gurobi, CPLEX, or CBC) to solve this instance. The solver searches for the optimal solution using algorithms such as branch and bound. After the solution is completed, the system retrieves the returned solution status (feasible solution, no solution, etc.) and the variable values ​​of the optimal solution from the solver. If the solution is successful, these variable values ​​constitute a globally coordinated power allocation instruction set, ready for execution.

[0073] In some embodiments, the excessively long solution time makes it difficult to meet the real-time requirements of microgrid control at the second level. To address this, a model reduction and step-by-step solution strategy is adopted. First, the power grid model is simplified, for example, by using a DC power flow model instead of an AC power flow model to linearize the problem. Second, the optimization problem can be decomposed, first optimizing the allocation of active power, and then optimizing reactive power and voltage regulation based on this. By reducing model complexity and decomposing the problem scale, the computation time can be significantly shortened while maintaining a certain level of accuracy, thus meeting the requirements of real-time control.

[0074] S107. The power commands in the power allocation command set are sent to the corresponding autonomous control units, so that the autonomous control units perform power adjustment.

[0075] Among them, the power command is a single entry in the command set that explicitly indicates the target power value that a certain unit should adjust to; issuing refers to sending the command to the specific device through the communication network.

[0076] Specifically, the microgrid control system analyzes the power distribution instruction set generated in step S106 and extracts the instructions for each autonomous control unit. For example, it extracts "Energy storage unit A, target active power: 30kW" from the instruction set. Then, the system encapsulates this instruction into a message conforming to the corresponding device communication protocol and sends it point-to-point to the controller of energy storage unit A through its unique device address. After receiving the instruction, energy storage unit A adjusts the operating state of its inverter to achieve an output power of 30kW.

[0077] In some embodiments, command issuance and execution can be implemented in several ways: Optionally, a "write" operation can be used, where the control system directly writes a value to the target power register of the device, and the device passively executes the command. Optionally, a "request-acknowledge" mechanism can be used, where after the control system issues a command, it waits for the device to return an acknowledgment of success or failure, thus forming a closed-loop control to ensure that the command is executed correctly. It is understood that other advanced control commands can also be used, such as issuing a power change curve instead of a single power point, to achieve smoother power adjustment; this is not limited here.

[0078] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating the integrated microgrid control method in this application.

[0079] S201. Acquire non-electrical quantity data from non-electrical quantity sensors that characterize the physical environment of the microgrid, and acquire electrical quantity data from electrical quantity sensors that characterize the operating status of each device.

[0080] Refer to step S101, which will not be repeated here.

[0081] S202. Input the non-electrical quantity data and electrical quantity data into the preset situation classifier to obtain the classification result that identifies the current situation type of the system.

[0082] Refer to step S102, which will not be repeated here.

[0083] In some embodiments, after completing the scenario classification in step S202, the microgrid control system will, in order to make the subsequent possible degraded operation strategies more in line with the needs of the current scenario, query the load reduction priority configuration scheme corresponding to the scenario type from the pre-stored priority mapping table according to the scenario type identified by the classification result; and bind the corresponding dynamic reduction priority to the controlled load in the microgrid according to the priority configuration scheme.

[0084] The priority mapping table is a database that stores multiple priority configuration schemes, each corresponding to one or more system scenarios; dynamic priority reduction means that the order of load shedding is no longer fixed, but can be dynamically changed according to the current situation.

[0085] Specifically, after obtaining the scenario classification result in step S202, such as "energy storage compartment fire alarm," the microgrid control system immediately uses this result as an index to query the priority mapping table. It finds the load reduction priority configuration scheme corresponding to the "fire alarm" scenario. This scheme may be defined in detail as: "fire pump: priority 1 (highest, cannot be reduced)," "emergency lighting: priority 2," "data center: priority 3," and "office air conditioning: priority 4 (lowest)." The system loads this priority list as the currently effective configuration, overriding the default or previous cycle's priority settings. In this way, if the degraded operation in step S212 is triggered in a subsequent process due to a lack of solutions, the system can strictly follow this newly loaded order tailored to the fire scenario when performing load reduction, ensuring that the most important safety loads are preserved.

[0086] In some embodiments, dynamic priority binding can be implemented in several ways: Optionally, a full replacement can be used, meaning a completely new priority list is loaded for each scenario change. Optionally, differentiated adjustment can be used, where the system has a basic priority list, and different scenario configuration schemes only define modifications to the basic list. For example, the "fire scenario" scheme only includes the instruction to "upgrade the fire pump priority to 1," while the priorities of other loads remain unchanged. This method is simpler to configure. It is understood that priorities themselves can also be multi-dimensional, such as priority for restoring power supply in addition to priority reduction; this is not limited here.

[0087] In some embodiments, it is necessary to accurately manage and maintain these complex priority configuration schemes. To address this, a visual configuration interface is provided to microgrid operators. Operators can use intuitive operations such as drag-and-drop and sorting to pre-customize and optimize load priority schemes for different, foreseeable system scenarios (such as "holidays," "critical power supply events," and "extreme weather"). The system saves these configurations as standardized files and calls them on demand during real-time operation. This human-computer interaction design makes complex policy management simple and feasible.

[0088] S203. Based on the source identifiers accompanying the non-electrical quantity data, divide the microgrid into at least two local regions in terms of electrical topology.

[0089] Among them, the source identifier refers to the information in the data packet that can indicate the physical location of the source sensor or the subsystem to which it belongs; the electrical topology refers to the electrical connection diagram of each device and line in the microgrid; and the local area refers to a sub-network that has a certain degree of independence or common physical environment characteristics in terms of electrical topology.

[0090] Specifically, when the microgrid control system receives the non-electrical quantity data in step S201, it parses the source identifier in the metadata, such as "temperature sensor No. 1 in energy storage compartment" or "smoke detector in plant B". According to a preset area division rule, the system associates each sensor with a specific physical area and maps that physical area to a set of electrical nodes and devices on the electrical topology. For example, all the devices associated with sensors located in the "energy storage area" (energy storage units, air conditioners, lighting, etc.) together constitute a local area. In this way, the entire microgrid can be divided into several sub-regions with clearly defined physical and electrical boundaries.

[0091] In some embodiments, area division can be implemented in several ways: Optionally, static division based on geographical location: during system deployment, the electrical topology map is manually partitioned and fixed in the system according to the geographical distribution of the factory area, buildings, etc. Optionally, dynamic division based on electrical distance: the system dynamically aggregates a group of nodes with close electrical connections and short impedance distances into a local area based on the real-time topology. It is understood that division based on functional attributes can also be used, for example, all production-related loads are divided into a "production area" and all office loads are divided into an "office area," which is not limited here.

[0092] In some embodiments, there is ambiguity in the boundaries of regions, meaning that a device may be physically or electrically associated with multiple regions. To address this, a fuzzy membership degree or overlapping region delineation method is employed. A boundary device can be considered to belong to multiple regions simultaneously with different membership degrees. For example, a trunk cable connecting two factories can be defined as belonging 50% to region A and 50% to region B. In subsequent calculations, its state and parameters will be assigned to the objective functions and constraints of their respective regions based on their membership degrees, thereby handling boundary problems more accurately.

[0093] S204. Collect electrical quantity data and non-electrical quantity data in each of the local regions to determine the local classification result that identifies the local situation type.

[0094] Here, aggregation refers to classifying the data according to the division results of step S203; local classification results refer to the situation type judgment obtained independently for each local area.

[0095] Specifically, the microgrid control system creates an independent dataset for each defined local area. It iterates through all the data acquired in step S201, placing the data into the corresponding local area dataset based on the data's source identifier or the region to which its associated device belongs. Then, for each local area's dataset, it calls a context classifier similar to that in step S102 (which can be the same classifier or a classifier specifically trained for that area) to obtain the local classification result for that area. For example, it might obtain multiple parallel results such as "Area A: Normal Operation" and "Area B: Fire Alarm".

[0096] In some embodiments, local context determination can be achieved in several ways: Optionally, distributed classification can be used, where an edge computing node is deployed in each local area. This node is responsible for collecting and processing the data in its local area and reporting the classification results to the central controller. Optionally, centralized classification can be used, where the central controller collects all data and performs data grouping and parallel classification processing at the software level. It is understood that a master-slave combination approach can also be used, where edge nodes perform preliminary classification and data compression, and the central controller performs final verification and confirmation; this is not limited here.

[0097] In some embodiments, there are correlations and conflicts between local and global scenarios. For example, an "overload" scenario in one local area may be caused by a fault in another area. To address this, a scenario correlation analysis module is established. After obtaining all local classification results, this module comprehensively evaluates these local scenarios based on preset topology correlation rules and a fault propagation knowledge base. For example, if two local scenarios, "feeder switch tripping in area B" and "voltage loss in area C," occur simultaneously, and B is the upstream power source of C, the system can infer that this is a causal relationship event, rather than two independent events, thus forming a more accurate understanding of the global situation.

[0098] S205. Determine the local operating objective function for the corresponding local region based on the local classification result, and generate an objective function set containing multiple local operating objective functions as the current operating objective function.

[0099] Among them, the local objective function is a mathematical model specifically established for the control objective of a certain local region; the set of objective functions is a summary of these local objective functions.

[0100] Specifically, after obtaining the local classification results in step S204, the microgrid control system independently performs an operation similar to step S103 for each region. That is, based on each local classification result, it queries and determines a corresponding local operational objective function from the control objective set. For example, for region A, whose classification result is "normal operation," the objective function of "lowest cost for region A" is selected; for region B, whose classification result is "fire alarm," the objective function of "maximizing the power supply to the fire-fighting load of region B" is selected. Finally, all these generated local objective functions are combined to form a set of objective functions containing multiple sub-objectives. This set as a whole constitutes the overall operational objective function for the current control cycle.

[0101] In some embodiments, the objective function can be generated in several ways: Optionally, a modular function library can be used, with the system pre-storing a large number of standardized objective function modules (such as cost modules, safety modules, and power balance modules). These modules are then combined like building blocks to generate the final local objective function based on the local context. Optionally, a template-filling method can be used, where the system presets several objective function templates. Based on the local context and the device parameters within that region, specific parameters are filled into the templates to generate a customized objective function. It is understood that more flexible methods can also be used, and no limitation is made here.

[0102] In some embodiments, after the microgrid control system determines the objective function of each local region according to step S205, in order to handle the urgency of different regions more precisely, the microgrid control system generates corresponding optimization weight coefficients for each local operating objective function according to the preset risk level associated with the local scenario type; and adjusts the constraint satisfaction priority of each local operating objective function in the solution process according to the optimization weight coefficients.

[0103] Among them, the preset risk level refers to a configuration table that maps scenario types (such as "equipment overheating" and "fire alarm") to risk values ​​(such as levels 1 to 5); the optimization weight coefficient is a value generated based on the risk level, used to reflect the importance of the objective in multi-objective optimization; the constraint satisfaction priority means that when there is a resource conflict, the solver will prioritize ensuring that the constraints associated with the objective function with the higher weight are satisfied.

[0104] Specifically, after generating multiple local operational objective functions in step S205, the microgrid control system queries the risk level corresponding to each local scenario type. For example, the risk level for "Area A: Normal Operation" is 1, and the risk level for "Area B: Fire Alarm" is 5. Then, the system calculates the respective optimization weight coefficients based on the risk level using a function (such as a linear or exponential function), for example, the weight for Area A is 0.2, and the weight for Area B is 1.0. These weight coefficients are applied during multi-objective optimization in step S206. When using the weighted summation method, they are directly used as multipliers; when using other algorithms, they can be used to determine the optimization order of objectives or the relaxation priority of constraints. In this way, the solver will naturally tilt towards "sacrificing the economy of Area A to fully ensure the safety of Area B" during the solution search process.

[0105] In some embodiments, weights can be generated and applied in several ways: Optionally, a static weight table can be used, where different risk levels strictly correspond to fixed weight values. Optionally, a dynamic weight function can be used, where the weights are related not only to the risk level but also to other factors such as the duration and scope of the event. For example, the weight of a low-risk event with a long duration may gradually increase. It is understandable that weights can also be combined with the "hard" and "soft" properties of constraints. Constraints for high-weight objectives are defined as hard constraints (must be satisfied), while constraints for low-weight objectives are defined as soft constraints (can deviate within a certain range). The solver will prioritize satisfying all hard constraints during optimization; this is not limited here.

[0106] In some embodiments, there is a subjectivity and optimization problem in weight setting, namely, the need to determine an optimal mapping relationship between risk levels and weights. To address this, a weight self-optimization mechanism based on historical data and simulation learning is introduced. The system can run a large number of simulation scenarios offline, trying different weight configurations in each scenario, and scoring the weight configurations based on simulation results (such as system instability probability, economic losses, etc.). Through techniques such as reinforcement learning or genetic algorithms, the system can iteratively find a weight strategy that performs optimally across various scenarios and use it as the default configuration for online operation.

[0107] S206. Substitute the set of objective functions into the multi-objective collaborative optimization algorithm to solve for the partitioned power configuration instruction set.

[0108] Among them, the multi-objective collaborative optimization algorithm is an optimization technique that can simultaneously process and balance multiple (potentially conflicting) objective functions; the partitioned power configuration instruction set refers to the solution result, which not only includes the global power allocation, but may also reflect the differentiated processing strategies for different regions.

[0109] Specifically, the microgrid control system inputs the set of objective functions generated in step S205, along with constraints such as the response capabilities of each unit collected in subsequent steps, into a multi-objective optimization solver. This solver simultaneously considers all local objective functions and balances them according to preset strategies (such as weights and priorities). For example, if the fire objective weight of region B is much higher than the economic objective of region A, the solver will prioritize meeting the power supply needs of region B, even if this means region A cannot achieve the lowest cost. The final result is a power configuration scheme that satisfies all constraints and achieves an optimal balance among multiple objectives.

[0110] In some embodiments, multi-objective solutions can be implemented in several ways: Optionally, a weighted summation method can be used, where all local objective functions are multiplied by their respective weights and summed to transform the problem into a single-objective optimization problem. This method is simple to implement, but the weight settings rely on experience. Optionally, a hierarchical sequential method can be used, where objectives are ordered according to their priority. The highest priority objective is optimized first, and its result is used as a constraint to optimize the next lower priority objective, and so on. It is understood that Pareto front search algorithms, such as NSGA-II, can also be used. This algorithm can find a series of different compromise solutions at once for the decision-maker to choose from; however, this is not limited here.

[0111] It should be noted that multi-objective collaborative optimization algorithms are used to handle and weigh multiple potentially conflicting local operational objectives. A practical and efficient implementation is the weighted sum method, which transforms the multi-objective problem into an equivalent single-objective problem for solution.

[0112] The core of this model lies in how to reasonably quantify and combine different objectives. First, each local objective function F_k(x) needs to be normalized so that its value falls within a dimensionless interval (e.g., [0, 1]) to eliminate the unfairness caused by differences in units and orders of magnitude between different objectives (e.g., cost $ and safety margin kW). Normalization methods can include:

[0113] F'_k(x) = (F_k(x) - F_k_min) / (F_k_max - F_k_min), where the maximum and minimum values ​​can be obtained from historical data or theoretical analysis. The standard for construction is to ensure that the weights accurately reflect the decision-maker's preferences or the urgency of the situation. Next, based on the optimized weight coefficients w_k generated according to the risk level in S205, all normalized local objective functions are linearly weighted to form a single, comprehensive global objective function F_global(x) = Σ(w_k * F'_k(x)). The sum of the weights w_k here is usually required to be 1. This process is equivalent to "translating" objectives of different regions and different properties into a unified "optimization language".

[0114] The core of the weighted summation model is a composite single-objective function. Its inputs include:

[0115] 1) A series of normalized local objective function expressions;

[0116] 2) A set of weight coefficients w_k corresponding to each local objective. This set of weights directly reflects the preference priority for different objectives in the current context;

[0117] 3) The global constraint set, which is the same as that of a single-objective optimization problem, consists of all local constraints.

[0118] The output of the model is a set of decision variable values ​​that enable the weighted summation of the global objective function F_global(x) to reach its optimal value, i.e., the partitioned power configuration instruction set, under the premise of satisfying the global constraint set.

[0119] During runtime, the system first determines and normalizes the local objective functions based on the local classification results. Then, it queries or calculates the corresponding weight coefficients w_k based on the risk level of each local scenario. Subsequently, the system combines these normalized objective functions and weight coefficients into a single global objective function. This global objective function, along with all constraints of the entire microgrid, constitutes a standard single-objective optimization problem (usually also a MILP problem). Finally, the system calls the same optimization solver as in S106 to solve this transformed single-objective problem. The optimal solution obtained is the globally coordinated set of partitioned power configuration instructions, which comprehensively considers and balances all local objectives (such as the economy of area A and the security of area B).

[0120] S207. Based on the current operating objective function, generate an operating intent solicitation message containing system power requirements and safety constraint parameters.

[0121] Refer to step S104, which will not be repeated here.

[0122] S208 broadcasts operation intent inquiry messages to multiple autonomous control units within the microgrid and receives response capability declaration messages from the autonomous control units.

[0123] Refer to step S105, which will not be repeated here.

[0124] In some embodiments, after broadcasting the message and collecting responses in step S208, the microgrid control system, in order to ensure the robustness of the control system and handle communication failures, compares the set of controllable units that have received the response capability declaration message with the pre-stored full list of controllable units to determine the offline units that have not responded; and adds offline constraints to the current operating objective function so that the power exchange of nodes directly electrically connected to offline units does not exceed a preset safety limit.

[0125] Among them, the list of fully controllable units is a register of all devices in the system that should be able to participate in coordinated control; offline units refer to units on the register that have not returned a declaration message in this round of response; offline constraints are a new type of mathematical constraint used to simulate the impact of offline units in the optimization model; the preset safety limit is a conservative power value to ensure that the power grid connected to the offline unit will not have problems due to the unit's disconnection.

[0126] Specifically, after the response window closes in step S208, the microgrid control system immediately performs a difference operation between the received list of responding units and the full list in the system database to obtain a list of unresponsive offline units. For each offline unit, the system queries its connection point (node) in the electrical topology. Then, in the optimization model of the upcoming step S209, a new constraint equation is dynamically added for these connection points. For example, if energy storage unit C is offline and connected to node N5, the system adds a constraint: "The absolute value of the total injected power at node N5 ≤ the safety limit" (e.g., 5kW). The significance of this constraint is that, since unit C cannot be controlled, to prevent its sudden recovery or unknown state at its port, we must strictly limit the power flowing through this connection point, treating it as a vulnerable and uncertain point.

[0127] In some embodiments, offline processing can be implemented in several ways: Optionally, the power output of the offline unit can be fixed to 0 in the model, and the aforementioned node power exchange constraints can be added. Optionally, if the unit had a stable power output before going offline, its power can be fixed to the last reported value in the model, and node power exchange constraints can also be added; this approach causes less disturbance to the system. It is understood that the safety limit itself can also be dynamic; for example, a stricter limit can be set when the overall system power is sufficient, and appropriately relaxed when power is tight; this is not limited here.

[0128] In some embodiments, it is necessary to accurately distinguish between temporary communication delays and genuine device offline status. Misjudgment could lead to unnecessarily strict constraints, impacting system efficiency. To address this, a multi-level confirmation mechanism is employed. When a unit fails to respond for the first time, the system marks it as "suspected offline" and may send it a high-priority "heartbeat" probe command in the next control cycle. Only when the unit fails to respond for several consecutive cycles, or the heartbeat probe also fails, is it finally confirmed as an "offline unit," and the aforementioned constraint-increasing process is initiated. This mechanism effectively avoids misjudgments caused by transient network jitter.

[0129] In some embodiments, after identifying an offline unit, the microgrid control system, in order to more accurately assess its impact on the power grid, will select neighboring units that are adjacent to the offline unit in the electrical topology from the set of controllable units; issue status detection commands to the neighboring units so that the neighboring units can monitor the characteristic parameters of the electrical ports connected to the offline unit; and update the preset safety limits in the offline constraints based on the characteristic parameters reported by the neighboring units.

[0130] Among them, the neighboring unit refers to other controllable units that have a direct line connection with the offline unit in the electrical topology; the status detection command is a special command that requires the neighboring unit to perform high-precision, high-frequency measurement on its specific port; the characteristic parameters include voltage amplitude, phase angle, harmonic content, etc., which can indirectly reflect the status of the offline unit.

[0131] Specifically, after identifying the offline unit X, the microgrid control system queries the topology database to find all online units directly connected to X, such as units Y and Z. The system then sends status probe commands to Y and Z, instructing them to focus on monitoring their respective electrical ports connected to X. The controllers of Y and Z utilize their internal measurement resources to perform detailed analysis of the voltage, current, and other parameters of that port, and report the results. For example, if both Y and Z detect normal voltage but zero current on the connection line, the system can infer that the offline unit X is likely in an open-circuit state due to an internal switch being disconnected. Based on this, the system can update the previously set safety limit in the offline constraints from a conservative small value (e.g., 5kW) to a more lenient value, or even remove the constraint entirely, since there is no safety risk in an open-circuit state. Conversely, if a sudden voltage drop with a large current is detected, it may be inferred as a short-circuit fault, requiring the application of stricter zero-power exchange constraints.

[0132] In some embodiments, status detection can be implemented in several ways: Optionally, passive monitoring can be used, where neighboring units only report their routine measurements, which are then analyzed and inferred by the central controller. Optionally, active injection can be used, where, under safe conditions, a small, specific-frequency disturbance signal is injected into the connection line by a neighboring unit. By analyzing the response to this signal, the impedance characteristics at the other end of the line can be determined more accurately, thereby more accurately identifying the status of offline units (such as open circuit, short circuit, or connection to a fixed load). It is understood that data from multiple neighboring units can also be used for cross-validation to improve the accuracy of the judgment; this is not limited here.

[0133] In some embodiments, neighboring units may not possess high-precision measurement capabilities. To address this, during the microgrid planning and design phase, intelligent terminals (such as PMUs or high-precision power analyzers) with advanced power quality monitoring capabilities can be deployed near key collection points or important equipment. In the event of an offline event, the system can prioritize these specialized monitoring devices to perform condition probing tasks to obtain the most reliable characteristic parameters, thereby achieving the most accurate constraint updates.

[0134] S209. Substitute the power response parameters in the response capability declaration message into the constraint optimization algorithm in the current running objective function to solve the problem and determine the solution status.

[0135] Among them, power response parameters refer to the power adjustment range and rate that the autonomous control unit can provide, as declared in the response capability declaration message; solution status refers to the status returned after the optimization algorithm finishes running, which usually includes "feasible solution found", "no solution", "maximum number of iterations reached", etc.

[0136] Specifically, this step is the core of the actual optimization process. The microgrid control system uses the power response ranges fed back by all units (e.g., energy storage A: [-50kW, 50kW]) as the upper and lower bounds of the corresponding decision variables in the optimization problem. Then, it calls the optimization solver to find the optimal power allocation scheme under multiple constraints, including power balance, line capacity, voltage limits, and the response ranges declared by all units, with the objective function determined in step S205 (or S103) as the objective. After the solution process is completed, the solver returns a status code indicating whether the optimization has successfully found a solution that satisfies all conditions.

[0137] In some embodiments, solution and state determination can be achieved in several ways: Optionally, a strict solution mode can be set, where a solution is considered successful only when the solver explicitly returns the state of "optimal feasible solution". Optionally, a lenient solution mode can be set, where a solution is considered successful even if the solver only returns a "feasible solution" (non-optimal) or a "suboptimal solution" found within a specified time, in order to prioritize the real-time performance of control. It is understood that different solution requirements can also be set according to the importance of the objective function; this is not limited here.

[0138] In some embodiments, the solver reports "Infeasible" because the constraints are too stringent (e.g., a large power deficit that the total response capability declared by all elements is insufficient to compensate for). This means that under the current conditions, no power allocation method can satisfy all constraints. Directly using this result for control is dangerous. This application addresses this situation through subsequent steps S211 and S212, demonstrating the completeness of the solution.

[0139] S210. When the solution state is a feasible solution state, extract the power allocation scheme obtained from the solution as the power allocation instruction set.

[0140] Among them, the feasible solution state indicates that the solver has successfully found at least one solution that satisfies all constraints; the power allocation scheme is the specific content of the solution, which includes the value of each decision variable (i.e., the power output of each unit).

[0141] Specifically, when step S209 returns a "feasible solution" or "optimal solution" status, the microgrid control system extracts detailed power allocation data from the solver's results. This data structure is typically a list of key-value pairs or an array, where each element corresponds to an autonomous control unit and its assigned target power value. For example, the result might be {"Energy Storage A": 35.5kW, "Photovoltaic B": -10.2kW, "Load C": -5.0kW}. The system directly adopts this scheme as the final power allocation instruction set for this control cycle and prepares to issue it.

[0142] In some embodiments, solution extraction can be achieved in several ways: Optionally, the standard format file (such as JSON or XML) output by the solver can be directly parsed to extract the values ​​of the required variables. Optionally, the solution results can be read directly from memory using the API (Application Programming Interface) functions provided by the solver, which is more efficient. It is understood that a post-processing step can be added after extraction, such as rounding or formatting the power values ​​to match the instruction format that the device can receive; this is not limited here.

[0143] In some embodiments, even feasible solutions may have undesirable side effects, such as excessively frequent or large power adjustments by a device, affecting its lifespan. To address this, a smoothing or penalty term can be added to the objective function. For example, a term proportional to the square of the difference between the current and previous instruction values ​​can be added to the objective function. This way, when searching for the optimal solution, the optimizer will naturally tend to issue power instructions with smoother changes, thus achieving the main control objective while also ensuring the healthy operation of the device.

[0144] S211. When the solution state is unsolvable, the solution process of the currently running objective function is terminated.

[0145] Among them, the state of no solution means that under the given constraints, there is no set of solutions that can satisfy the requirements of the objective function; stopping the solution process is a decision point, which marks the failure of the conventional optimization path and requires the activation of the emergency plan.

[0146] Specifically, when the solver in step S209 returns an "infeasible" state after calculation, the microgrid control system immediately stops further attempts under the current objective function and constraints. This means the system recognizes that attempting to perfectly solve the current problem through conventional optimization scheduling is no longer feasible. At this point, the system will not freeze or exit with an error message, but will instead guide the control flow to the preset degraded operation strategy, i.e., step S212. This is a crucial logical branch that ensures the system's resilience.

[0147] In some embodiments, abort and switching can be implemented in several ways: Optionally, process jump can be achieved by capturing the "no solution exception" thrown by the solver. Optionally, the status code returned by the solver can be judged, and a simple if-else or switch-case structure can be used to determine whether to proceed to step S210 or step S212. It is understood that before aborting, the system can also record detailed information that led to the no solution, including the objective function and constraints at that time, for post-analysis and system optimization, which is not limited here.

[0148] In some embodiments, it is necessary to accurately define "no solution" and "difficult to solve". Sometimes the solver may fail to find a solution simply because of insufficient computation time, rather than because the problem itself is unsolvable. To address this, reasonable "maximum number of iterations" and "maximum solution time" should be set for the solver. If the solver stops due to timeout, the system can first try relaxing some minor constraints (such as economic constraints) or using a faster heuristic algorithm to solve again. Only when multiple attempts fail, or the solver explicitly reports a logically unsolvable problem, is the unsolvable state finally confirmed, and degraded operation initiated.

[0149] S212. Based on the preset reduction priority of each controlled load and the preset output limit of each power unit, generate a set of degraded operation instructions and use the set of degraded operation instructions as the set of power allocation instructions.

[0150] Among them, the controlled load shedding priority is a list that defines which loads should be cut off first when there is insufficient power; the power unit output floor refers to the minimum output power that the power supply must maintain to ensure its own safety or system stability; the degraded operation instruction set is an unoptimized emergency instruction generated based on these hard rules, which can ensure that the system does not crash.

[0151] Specifically, once this step is reached, the microgrid control system abandons complex optimization calculations and instead executes a simple and rigid set of rules. It first calculates the current power deficit (total load - total power output). Then, according to the load shedding priority list, it generates shedding commands one by one, starting with the lowest priority load, until the power deficit is filled. Simultaneously, it ensures that the output of all power units does not fall below their preset minimum output threshold. The final set of commands (such as "cut off air conditioning load," "cut off office lighting," and "maintain minimum reserve power") constitutes the degraded operation command set, which is passed to the next step as the final result.

[0152] In some embodiments, degradation command generation can be implemented in several ways: Optionally, a one-time full reduction can be used, meaning that once a load is selected, its power can be reduced to zero. Optionally, a tiered partial reduction can be used, meaning that loads of each priority can be reduced proportionally (e.g., 25%, 50%, 75%, 100%), providing finer regulation capabilities. It is understood that the power supply side can also have a similar tiered strategy, such as allowing energy storage units to perform short-term over-discharge in emergencies, which is not limited here.

[0153] In some embodiments, the preset priority may not be suitable for all situations. For example, during a fire, the fire pump should have the highest priority, but under normal circumstances it may have a low priority. This problem is solved by claim 7 of this application and its corresponding implementation, that is, by dynamically adjusting and loading the priority configuration scheme that best matches the current situation based on the situation classification result of step S202, so that the degraded operation strategy itself also has situation adaptive capability.

[0154] It should be noted that the generation logic of the degraded operation instruction set is an iterative calculation and decision-making process. When entering this process, the system first accurately calculates the current power gap P_gap, which is (current total load power + estimated line loss) - (current total actual power output). Simultaneously, the system obtains the preset output baseline P_base_i of all power supply units from the power supply side and calculates the total downward adjustment margin on the power supply side. If P_gap is positive (supply is insufficient), the system will initiate the load reduction process. It loads the list of load reduction priorities effective in the current scenario, sorted from low to high priority, and includes the rated power of each load. The system iterates starting with the lowest priority load. In each iteration, it subtracts the rated power of that load from P_gap and generates a "power adjustment to 0" instruction for that load. Then it checks if P_gap is less than or equal to zero. If it is still positive, it continues processing the next priority load until the gap is completely filled. If the gap is still positive after all reduceable loads have been removed, the system will record an alarm. If P_gap is negative (supply exceeds demand), the system will instruct the power units to reduce their output proportionally according to a preset economic or environmental priority order (e.g., prioritizing the reduction of output from high-cost generators), provided that the output does not fall below their minimum output limit, until P_gap approaches zero. Ultimately, all generated load shedding commands and power output reduction commands together constitute a complete set of degraded operation commands.

[0155] S213. The power commands in the power allocation command set are sent to the corresponding autonomous control units, so that the autonomous control units perform power adjustment.

[0156] Refer to step S107, which will not be repeated here.

[0157] In this embodiment, by employing a control strategy that integrates non-electrical and electrical quantities for situational awareness, dynamically adjusts control objectives, and combines distributed coordination and hierarchical response, the microgrid control system can accurately identify and respond to physical safety events such as fires and equipment failures. This effectively solves the problem of existing technologies focusing solely on electrical quantities and economics, resulting in insufficient emergency response capabilities in complex physical scenarios. Furthermore, it achieves a leap in microgrid control from single-economic scheduling to intelligent, adaptive, comprehensive scheduling that prioritizes both safety and economy, significantly improving the system's safety and resilience.

[0158] The microgrid control system in the embodiments of this invention is described below from the perspective of hardware processing. Please refer to [link / reference needed]. Figure 3 This is a schematic diagram of the physical device structure of a microgrid control system in an embodiment of this application.

[0159] It should be noted that, Figure 3The structure of the microgrid control system shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0160] like Figure 3 As shown, the microgrid control system includes a CPU 301, which can perform various appropriate actions and processes according to a program stored in ROM 302 or a program loaded from storage section 308 into RAM 303, such as executing the methods described in the above embodiments. RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via bus 304. I / O interface 305 is also connected to bus 304.

[0161] The following components are connected to I / O interface 305: input section 306 including audio input devices, push-button switches, etc.; output section 307 including liquid crystal display (LCD) and audio output devices, indicator lights, etc.; storage section 308 including hard disks, etc.; and communication section 309 including network interface cards such as LAN (Local Area Network) cards, modems, etc. Communication section 309 performs communication processing via a network such as the Internet. Drive 310 is also connected to I / O interface 305 as needed. Removable media 311, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on drive 310 as needed so that computer programs read from them can be installed into storage section 308 as needed.

[0162] In particular, according to embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing computer programs for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 309, and / or installed from removable medium 311. When the computer program is executed by CPU 301, it performs the various functions defined in the present invention.

[0163] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. Each block in a flowchart or block diagram may represent a module, program segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those shown in the drawings.

[0164] Specifically, the microgrid control system of this embodiment includes a processor and a memory. The memory stores a computer program, and when the computer program is executed by the processor, it implements the integrated microgrid control method provided in the above embodiment.

[0165] In another aspect, the present invention also provides a computer-readable storage medium, which may be included in the microgrid control system described in the above embodiments; or it may exist independently and not incorporated into the microgrid control system. The storage medium carries one or more computer programs that, when executed by a processor of the microgrid control system, cause the microgrid control system to implement the integrated microgrid control method provided in the above embodiments.

[0166] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0167] As used in the above embodiments, depending on the context, the term "when..." can be interpreted as meaning "if...", "after...", "in response to determining...", or "in response to detecting...". Similarly, depending on the context, the phrase "when determining..." or "if (the stated condition or event) is interpreted as meaning "if determining...", "in response to determining...", "when (the stated condition or event) is detected", or "in response to detecting (the stated condition or event)".

Claims

1. A microgrid integrated control method, characterized by, The method is applied to a micro-grid control system, and comprises the following steps: obtaining non-electric quantity data representing a physical environment of the micro-grid from a non-electric quantity sensor, and obtaining electric quantity data representing an operating state of each device from an electric quantity sensor; inputting the non-electric quantity data and the electric quantity data into a preset context classifier to obtain a classification result identifying a context type in which the system currently exists; determining a current operating objective function corresponding to the classification result from a preset control objective set according to the classification result; generating an operating intention inquiry message including a system power demand and a safety constraint parameter based on the current operating objective function; broadcasting the operating intention inquiry message to a plurality of autonomous control units in the micro-grid, and receiving a response capability declaration message fed back by the autonomous control units; the response capability declaration message is generated by the autonomous control units according to their internal operating states and the operating intention inquiry message; substituting all the received response capability declaration messages into a preset constraint optimization algorithm to obtain a globally coordinated power distribution instruction set; distributing power instructions in the power distribution instruction set to corresponding autonomous control units respectively, so that the autonomous control units perform power adjustment.

2. The method of claim 1, wherein, The step of determining a current operating objective function corresponding to the classification result from a preset control objective set according to the classification result specifically comprises the following steps: dividing the micro-grid into at least two local areas according to a source identifier attached to the non-electric quantity data; collecting electric quantity data and non-electric quantity data in each local area to determine a local classification result identifying a local context type; determining a local operating objective function corresponding to a local area according to the local classification result, generating a target function set including a plurality of local operating objective functions as the current operating objective function; substituting the target function set into a multi-objective collaborative optimization algorithm to obtain a partitioned power configuration instruction set.

3. The method of claim 2, wherein, After the step of determining a local operating objective function corresponding to a local area according to the local classification result, generating a target function set including a plurality of local operating objective functions as the current operating objective function, the method further comprises the following steps: generating an optimization weight coefficient corresponding to each local operating objective function according to a preset risk level associated with the local context type; adjusting a constraint satisfaction priority of each local operating objective function in a solving process according to the optimization weight coefficient.

4. The method of claim 1, wherein, After the step of broadcasting the operating intention inquiry message to a plurality of autonomous control units in the micro-grid, and receiving a response capability declaration message fed back by the autonomous control units, the method further comprises the following steps: comparing a set of controllable units that have received the response capability declaration message with a pre-stored full set of controllable units to determine offline units that do not respond; adding an offline constraint condition to the current operating objective function, so that power exchange of a node directly connected to the offline units does not exceed a preset safety limit.

5. The method of claim 4, wherein, After the step of comparing the set of controllable units having received the response capability declaration message with the pre-stored full set of controllable units to determine offline units that do not respond, the method further comprises: Screening, from the set of controllable units, adjacent units adjacent to the offline units in the electrical topology; issuing a state detection instruction to the adjacent units, so that the adjacent units monitor the characteristic parameters of the electrical ports connected to the offline units; updating the preset safety limit value in the offline constraint condition according to the characteristic parameters reported by the adjacent units.

6. The method of claim 1, wherein, The step of substituting all received response capability declaration messages into a preset constraint optimization algorithm to obtain a globally coordinated power distribution instruction set specifically comprises: Substituting the power response parameters in the response capability declaration message into the constraint optimization algorithm in the current running objective function to determine the solution state; When the solution state is a feasible solution state, extracting the power distribution scheme obtained by solving as the power distribution instruction set; When the solution state is a no solution state, aborting the solving process of the current running objective function; According to the preset reduction priority of each controlled load and the preset output bottom line of each power unit, a degraded operation instruction set is generated, and the degraded operation instruction set is used as the power distribution instruction set.

7. The method of claim 6, wherein, After the step of inputting the non-electrical quantity data and the electrical quantity data into a preset context classifier to obtain a classification result identifying the context type in which the current system is located, the method further comprises: According to the context type identified by the classification result, querying a pre-stored priority mapping table for a priority configuration scheme corresponding to the context type for load reduction; According to the priority configuration scheme, binding the corresponding dynamic reduction priority for the controlled load in the microgrid.

8. A microgrid control system, characterized by, The microgrid control system comprises one or more processors and a memory; the memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code comprising computer instructions, and the one or more processors invoke the computer instructions to cause the microgrid control system to perform the method of any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are run on the microgrid control system, the microgrid control system is caused to perform the method of any one of claims 1-7.

10. A computer program product, characterised in that, When the computer program product is run on the microgrid control system, the microgrid control system is caused to perform the method of any one of claims 1-7.