Modularized AI light storage and charging integrated micro-grid control system

By optimizing the integrated photovoltaic-storage-charging microgrid control system through sparse communication and multi-agent reinforcement learning protocols, the problems of bus voltage fluctuation and energy storage unit state of charge deviation were solved, achieving high-precision power allocation and fast response, extending battery life and improving system stability.

CN121036348AInactive Publication Date: 2025-11-28HANGZHOU SUNWELL TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511251060.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2025-11-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing integrated photovoltaic, energy storage, and charging microgrid control systems suffer from large bus voltage fluctuations and significant deviations in the state of charge of energy storage units when faced with intermittent fluctuations in photovoltaic output and sudden changes in charging pile load. This affects the stable operation of the system and the lifespan of the batteries. Furthermore, the distributed secondary control is easily affected by communication failures, and traditional controllers cannot effectively solve this problem.

Method used

A sparse communication module is used to generate a dynamic communication link. Combined with a multi-agent reinforcement learning protocol, data is exchanged to generate global bus voltage and power reference values. The control signal is optimized through adaptive compensation and AI timing prediction modules. The local control module continues to perform state estimation when the communication link fails, ensuring system stability.

Benefits of technology

It achieves extremely low deviation of global bus voltage reference value, improves power distribution accuracy, shortens system recovery time, avoids overcharging and over-discharging of energy storage units, extends battery life, and maintains system stability in the event of a fault.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121036348A_ABST
    Figure CN121036348A_ABST
Patent Text Reader

Abstract

The invention provides a modular AI optical storage and charging integrated micro-grid control system, and relates to the technical field of smart grids, and the system comprises a sparse communication module which is used for setting three types of core data collection positions at a DC bus convergence point, the output end of each energy storage unit and a charging pile access point, and dynamically generating a sparse communication link through an AI decision module; and the state fusion module is used for exchanging local voltage, power and state-of-charge data through a multi-agent reinforcement learning protocol based on a sparse communication link, and fusing to generate a global bus voltage reference value, a global power distribution reference value and a global average state-of-charge value. Through sparse communication dynamic generation, multi-agent state fusion, adaptive power compensation, AI time sequence prediction, reinforcement learning optimization and communication fault local control, efficient communication, accurate control and energy storage balanced operation of the microgrid are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart grid technology, and in particular to a modular AI-integrated photovoltaic-storage-charging microgrid control system. Background Technology

[0002] With the widespread application of renewable energy, integrated photovoltaic, energy storage, and charging microgrids, as an important form of integrating photovoltaic, energy storage, and charging facilities, play a key role in the energy transition. However, existing technologies have significant shortcomings: Traditional droop control relies on preset parameters for power distribution, which is not adaptable enough to the intermittent fluctuations in photovoltaic output and sudden changes in charging pile load. This results in large fluctuations in bus voltage and significant deviations in the state of charge (SoC) of the energy storage unit, affecting the stable operation of the system and the lifespan of the battery.

[0003] While existing distributed secondary control systems achieve data interaction through multi-agent protocols, they employ a fixed communication topology. When a communication link fails, global state estimation is easily affected, and the time required for voltage recovery increases significantly. Furthermore, traditional secondary control based on PI controllers requires accurate system models, but parameters such as line impedance are often difficult to obtain accurately in engineering applications. This mismatch between the model and the actual system leads to large power distribution errors, affecting control performance. Summary of the Invention

[0004] The technical problem to be solved by this invention is to provide a modular AI photovoltaic-storage-charging integrated microgrid control system that keeps the global bus voltage reference value deviation at an extremely low level.

[0005] To solve the above-mentioned technical problems, the technical solution of the present invention is as follows: Firstly, a modular AI-integrated photovoltaic-storage-charging microgrid control system includes: The sparse communication module is used to set up three types of core data acquisition locations at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point, and dynamically generates sparse communication links through the AI ​​decision module. The state fusion module is used to exchange local voltage, power and state of charge data through a multi-agent reinforcement learning protocol based on a sparse communication link, and to fuse and generate a global bus voltage reference value, a global power allocation reference value and a global average state of charge value. The adaptive compensation module is used to calculate the adaptive power compensation amount by using the difference between the global average state of charge value and the real-time state of charge of the local energy storage unit, and dynamically correct the output power reference value of each energy storage unit. The timing prediction module is used to input the corrected power reference value and the global bus voltage reference value into the preset AI timing prediction model and generate multi-step control sequences in a rolling manner. The control optimization module uses a reinforcement learning optimization algorithm to convert a multi-step control sequence into a secondary control signal, which is then superimposed onto the output of the local droop controller. The local control module is used to ensure that the remaining communication function nodes continue to perform reinforcement learning state estimation when the communication link fails, and input the generated local voltage reference value and local power allocation reference value into the preset AI time series prediction model to maintain the continuous generation of multi-step control sequences.

[0006] Furthermore, three types of core data acquisition locations are set up at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point. A sparse communication link is dynamically generated through an AI decision-making module, including: The DC bus junction point is used as the voltage stability monitoring node, the energy storage unit output terminal is used as the power distribution monitoring node, and the charging pile access point is used as the load disturbance monitoring node. Based on the physical distribution of the three types of nodes, the minimum connected communication path covering all nodes is generated through the AI ​​decision module. When a new energy unit is connected, the AI ​​decision-making module expands the communication path in real time and outputs the updated sparse communication link.

[0007] Furthermore, based on sparse communication links, local voltage, power, and state of charge data are exchanged through a multi-agent reinforcement learning protocol, and fused to generate a global bus voltage reference value, a global power allocation reference value, and a global average state of charge value, including: Each monitoring node sends locally collected voltage, output power, and state of charge data to neighboring monitoring nodes via sparse communication links; Each monitoring node receives data from neighboring monitoring nodes and updates the local bus voltage reference value, power distribution reference value, and average state of charge value. Repeatedly perform data interaction and iterative calculation until each monitoring node meets the convergence conditions, including the difference in the local bus voltage reference value is less than the set threshold, the power distribution reference value meets the preset capacity ratio, and the average state of charge is the same. When the convergence condition is met, each monitoring node outputs the same global bus voltage reference value, global power distribution reference value, and global average state of charge value.

[0008] Furthermore, by utilizing the difference between the global average state of charge (SOC) and the real-time SOC of the local energy storage unit, an adaptive power compensation amount is calculated to dynamically correct the output power reference value of each energy storage unit, including: Calculate the difference between the real-time state of charge of the local energy storage unit and the global average state of charge. If the difference is greater than zero, generate a compensation command to reduce the discharge power; if the difference is less than zero, generate a compensation command to increase the discharge power. The compensation amount is generated based on the absolute value of the difference, the local current power reference value, and the preset scaling factor; The compensation amount is added to the current local power reference value, and the corrected power reference value is output.

[0009] Furthermore, the corrected power reference value and the global bus voltage reference value are input into a preset AI timing prediction model to generate a multi-step control sequence, including: The corrected power reference value and the global bus voltage reference value are used as the initial control target inputs into the preset AI time-series prediction model; Based on the historical operating data of the energy storage unit, the voltage regulation and power allocation for the next moment are generated by an AI time-series prediction model to obtain the prediction results. The prediction results are fed back to the input of the AI ​​time series prediction model, and the future multi-step control variables are continuously iterated and output. Multiple control quantities are arranged in chronological order to form a multi-step control sequence that includes voltage regulation commands and power distribution commands.

[0010] Furthermore, based on historical operating data of the energy storage unit, an AI time-series prediction model is used to generate the voltage regulation and power allocation for the next moment, yielding prediction results including: The three operating patterns of the energy storage unit within a preset time window are analyzed, including the bus voltage fluctuation mode, the output power response mode, and the state of charge change mode. Using the previous moment's prediction result as a new benchmark, and combining it with historical operating patterns, the voltage regulation amount for the next moment is generated, and the power allocation amount is also generated. The output includes a binary pair of voltage regulation and power allocation as the prediction result.

[0011] Furthermore, a reinforcement learning optimization algorithm is used to transform the multi-step control sequence into a secondary control signal, which is then superimposed on the output of the local droop controller, including: The deviation between the current bus voltage and the corrected global bus voltage reference value, the deviation between the output power and the corrected power reference value, and the state of charge offset are obtained to form the reinforcement learning state input data. After the main network selects the first control action based on the state input data, it simulates the bus voltage fluctuation amplitude, detects the power distribution deviation value, and records the change in the state of charge balance under the first control action. The stability score is calculated based on the bus voltage fluctuation amplitude, power distribution deviation, and changes in state of charge balance. The output includes the evaluation results containing the stability score and risk warning level. The action selection strategy of the main network is dynamically adjusted based on the evaluation results to obtain the optimized control actions. The optimized control action is converted into a secondary control signal and directly superimposed on the voltage reference value output of the local droop controller.

[0012] Furthermore, when the communication link fails, the remaining communication function nodes continue to perform reinforcement learning state estimation and input the generated local voltage reference value and local power allocation reference value into the preset AI time series prediction model to maintain the continuous generation of multi-step control sequences, including: The remaining DC bus junction nodes exchange locally collected voltage data with the output nodes of adjacent energy storage units, calculate a local voltage reference value by averaging adjacent data, and allocate a local power reference value according to the ratio of the rated capacity of each energy storage unit. The local voltage reference value and the current locally corrected power reference value are combined into an input vector, which is then loaded into the AI ​​time series prediction model to generate a multi-step control sequence with reduced step size.

[0013] In a second aspect, a computing device includes: One or more processors; A storage device for storing one or more programs that, when executed by one or more processors, enable the one or more processors to implement the system.

[0014] Thirdly, a computer-readable storage medium storing a program that, when executed by a processor, implements the system.

[0015] The above-described solution of the present invention has at least the following beneficial effects: By dynamically generating minimum connectivity communication links covering core nodes using AI, the number of communication links is reduced, lowering hardware deployment costs and data transmission pressure. When new devices are added, communication paths are automatically expanded, enabling flexible access and shortening system expansion and debugging cycles. Based on a multi-agent reinforcement learning protocol, nodes iteratively interact with data, keeping the global bus voltage reference value deviation at an extremely low level. Power allocation ratios are highly matched with energy storage capacity, solving the capacity-power mismatch problem in traditional control. When facing fluctuations in photovoltaic output or sudden changes in charging pile load, the global state fusion mechanism can complete data updates and reference value corrections in a short time, with a response speed significantly superior to traditional centralized control.

[0016] By calculating the difference between the global and local System of Units (SoC) in real time and generating power compensation, the SoC deviation of energy storage units with different capacities is significantly reduced, avoiding battery overcharging / over-discharging and effectively extending the overall lifespan of the energy storage system. The compensation algorithm dynamically adjusts based on the current power reference value of the energy storage, significantly reducing power allocation errors during load surges and improving allocation accuracy compared to traditional PI control schemes. The AI ​​time-series prediction model generates future control sequences based on historical operating data, shortening the bus voltage recovery time and reducing overshoot, thus improving system stability. By inputting voltage deviation, power allocation error, and other state data into the reinforcement learning algorithm, the control actions are dynamically adjusted, effectively avoiding the frequent oscillations of traditional control in high-power charging scenarios, and improving system stability. When some communication links fail, the remaining nodes generate voltage and power reference values ​​based on local data, maintaining continuous output of the control sequence and ensuring that bus voltage fluctuations are within a reasonable range, improving voltage stability during faults compared to traditional distributed control. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of the various modules of a modular AI photovoltaic-storage-charging integrated microgrid control system provided by an embodiment of the present invention.

[0018] Figure 2 This is a schematic diagram of the process provided by an embodiment of the present invention, which uses a reinforcement learning optimization algorithm to convert a multi-step control sequence into a secondary control signal and superimpose it onto the output of a local droop controller. Detailed Implementation

[0019] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.

[0020] like Figure 1 As shown, an embodiment of the present invention proposes a modular AI photovoltaic-storage-charging integrated microgrid control system, comprising: The sparse communication module is used to set up three types of core data acquisition locations at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point, and dynamically generates sparse communication links through the AI ​​decision module. The state fusion module is used to exchange local voltage, power and state of charge data through a multi-agent reinforcement learning protocol based on a sparse communication link, and to fuse and generate a global bus voltage reference value, a global power allocation reference value and a global average state of charge value. The adaptive compensation module is used to calculate the adaptive power compensation amount by using the difference between the global average state of charge value and the real-time state of charge of the local energy storage unit, and dynamically correct the output power reference value of each energy storage unit. The timing prediction module is used to input the corrected power reference value and the global bus voltage reference value into the preset AI timing prediction model and generate multi-step control sequences in a rolling manner. The control optimization module uses a reinforcement learning optimization algorithm to convert a multi-step control sequence into a secondary control signal, which is then superimposed onto the output of the local droop controller. The local control module is used to ensure that the remaining communication function nodes continue to perform reinforcement learning state estimation when the communication link fails, and input the generated local voltage reference value and local power allocation reference value into the preset AI time series prediction model to maintain the continuous generation of multi-step control sequences.

[0021] In this embodiment of the invention, sparse communication links between core nodes are dynamically generated to reduce network complexity and communication costs, and to support automatic expansion of communication paths when new devices are added. Through multi-agent protocol data exchange, globally unified voltage and power reference values ​​and average state of charge (SOC) are generated, improving system state consistency and collaborative response capabilities. Power compensation is dynamically adjusted based on the difference between the global and local SOC to balance the SOC of energy storage units, avoid overcharging and over-discharging, and optimize power allocation. By generating multi-step control sequences, load changes are predicted in advance, shortening voltage recovery time and reducing system fluctuations. Reinforcement learning is used to transform the predicted sequences into secondary control signals, which are then superimposed on the droop controller to enhance control adaptability under dynamic operating conditions. When a communication link fails, local reference values ​​are generated based on the remaining nodes, and the control sequence output is maintained to ensure stable system operation during faults.

[0022] In a preferred embodiment of the present invention, three types of core data acquisition locations are set at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point. A sparse communication link is dynamically generated through an AI decision module, which may include: The DC bus junction point is used as the voltage stability monitoring node, the energy storage unit output terminal is used as the power distribution monitoring node, and the charging pile access point is used as the load disturbance monitoring node. Based on the physical distribution of the three types of nodes, the minimum connected communication path covering all nodes is generated through the AI ​​decision module. When a new energy unit is connected, the AI ​​decision-making module expands the communication path in real time and outputs the updated sparse communication link.

[0023] In this embodiment of the invention, voltage sensors are deployed at the connection points between the DC bus and each distributed power source, energy storage unit, and load to collect bus voltage data in real time. These sensors must cover all voltage levels of the bus within the microgrid (e.g., the 400V main bus and the 100V sub-bus) to monitor global voltage fluctuations. The sensor sampling frequency is set to 10kHz to ensure the capture of instantaneous voltage changes (such as voltage drops when a charging pile is connected).

[0024] The output of the energy storage unit serves as a power distribution monitoring node. The specific process involves installing a power sensor at the output of the DC / DC converter of each energy storage unit to collect real-time output power and current data. For parallel energy storage units (such as a hybrid system of lithium batteries and supercapacitors), monitoring points need to be set at the output of each unit to distinguish the power distribution of energy storage units of different capacities and types. The sensors synchronously collect voltage and current signals, and the real-time power value is calculated using the instantaneous power formula (power = voltage × current).

[0025] Charging pile access points serve as load disturbance monitoring nodes: Specific process: Set up a load monitoring point at the AC / DC input terminal of each charging pile to collect charging power, current, and start / stop status data. For fast charging piles (e.g., 60kW and above) and slow charging piles (e.g., 7kW), configure sensors of different accuracies respectively—the sampling frequency of fast charging piles is no less than 5kHz, and that of slow charging piles is no less than 1kHz, in order to capture the disturbance characteristics of different load levels (e.g., the power step during fast charging start-up).

[0026] Minimum Connectivity Communication Path Generation Based on AI Decision-Making: The specific process is as follows: The physical locations of the three types of monitoring nodes are transformed into a node set V = {v1, v2, ..., vn} in graph theory, where v1 is the bus node, v2 to vm+1 are energy storage nodes, and vm+2 to vn are charging pile nodes. The three-dimensional coordinates of each node are obtained through GPS positioning, and the Euclidean distance between nodes is calculated as the edge weight wij. An undirected weighted network model is constructed, which includes the node set V and the edge set E (E is the set of communication links between nodes).

[0027] The specific process of constructing an undirected weighted network model: First, the node composition of the network model is determined. The three core data acquisition locations—DC bus junction point, output terminals of each energy storage unit, and charging pile access point—are all identified as nodes in the network. For example, the DC bus junction point is designated as a node related to voltage stability monitoring, each energy storage unit output terminal as a node related to power distribution monitoring, and each charging pile access point as a node related to load disturbance monitoring. These nodes are then organized into a unified set that includes all nodes.

[0028] Next, the physical location information of the nodes is obtained. By using GPS positioning and other methods, the three-dimensional coordinate data of each node is collected, which means determining the specific location of each node in the actual space.

[0029] Next, determine the potential connections between nodes. Since the network is undirected, there is a possibility of bidirectional communication between any two nodes. Therefore, every connection between two nodes is considered as a potential communication link, which is an edge in the network.

[0030] Next, the base weight of each potential link is calculated. Based on the physical locations of the two nodes, the straight-line distance between them is calculated, and this distance serves as the base value for the weight of that potential link.

[0031] Next, the base weights are adjusted by introducing communication medium factors. Based on the actual type of communication medium that may be used, such as optical fiber or wireless communication, the base weights are modified. If it is an optical fiber link, the base weight (i.e., physical distance) is used directly as an adjustment item for the link. If it is a wireless link, since its transmission delay is relatively high, the base weight is multiplied by a coefficient greater than 1 (e.g., 3) as an adjustment item for the link.

[0032] Subsequently, a reliability factor is introduced to further adjust the weights. A reliability coefficient is determined based on the link's installation environment, such as outdoor or indoor. For links in outdoor environments, where reliability is relatively low, the current weight value is multiplied by a coefficient less than 1 (e.g., 0.8). For links in indoor environments, where reliability is high, the current weight value is multiplied by 1.0. This reflects the impact of different environments on link reliability.

[0033] Next, consider the data transmission load factor. Estimate the amount of data transmission that each potential link may carry. For example, some nodes (such as DC bus junctions) need to transmit a large amount of voltage data. When the estimated load of a link exceeds a set threshold (such as 70% of the maximum bandwidth), the weight of that link is multiplied by a coefficient greater than 1 to reflect the additional cost or impact of high load.

[0034] Finally, by combining all the above adjustments, the final weight of each potential link is determined. Integrating all nodes, the potential links between nodes, and the final weight of each link forms a complete undirected weighted network model. This model reflects the connection possibilities between each node and the overall cost or price of each connection.

[0035] The minimum connected path is generated using an improved Prim's algorithm: Prim's algorithm process: Starting from the main node v1, each time the algorithm selects the unconnected node with the smallest distance to the set of connected nodes, until all nodes are connected. During this process, loops are avoided to ensure the minimum number of links. In addition to physical distance, the edge weight wij also needs to consider the transmission delay of the communication medium (such as fiber optic or wireless)—the weight of a fiber optic link is set to physical distance × 1, and the weight of a wireless link is set to physical distance × 3 (because wireless transmission delay is higher). Lower-weighted links are prioritized to reduce communication latency.

[0036] Calculate the theoretical data transmission volume of each link (e.g., the bus node needs to transmit voltage data to all energy storage nodes, resulting in a large data volume). If the load on a link exceeds a threshold (e.g., 70% of the maximum bandwidth), adjust the path branches to divert some data to adjacent low-load links. For links spanning buildings or laid outdoors, multiply by a reliability coefficient (e.g., 0.8 for outdoor wireless links and 1.0 for indoor fiber optic links), prioritizing high-reliability links to reduce the probability of failure.

[0037] When a new energy unit (such as a photovoltaic array or energy storage battery) is connected, the AI ​​decision-making module is triggered by a hardware handshake signal (such as a device online message in the Modbus protocol). The module first obtains the physical location coordinates, communication interface type (such as RS485 or Ethernet), and data transmission requirements of the new node (such as the photovoltaic system needing to transmit voltage, current, and power data at a sampling frequency of 1kHz).

[0038] When a new node (vn+1) joins, it is incorporated into the existing communication network. The link weights (w(n+1)j) between this node and all existing nodes are calculated, and the communication path is extended according to the following rules: Determine the attributes and data requirements of the new node: First, determine the type of new node (such as energy storage unit, photovoltaic array, etc.) and the core data transmission requirements (such as energy storage unit needs to transmit state of charge and output power, with a sampling frequency of 5kHz; photovoltaic array needs to transmit voltage, current and power, with a sampling frequency of 1kHz), as the basis for path expansion.

[0039] Calculate the link weights between the new node and existing nodes: The weights are calculated based on the physical distance between the new node and each existing node (measured using GPS coordinates), combined with the communication medium type (fiber optic or wireless) and the installation environment (indoor / outdoor / across buildings): If a fiber optic link is used, the physical distance is used as the base weight; if a wireless link is used, the physical distance is multiplied by 3 (because wireless latency is higher). For links in the open air or across buildings, multiply by the corresponding reliability coefficient (e.g., 0.8 for open-air wireless and 1.0 for indoor fiber optic) to finally obtain the link weight between the new node and each existing node.

[0040] Expand paths based on node type: If the new node is an energy storage unit, the weight values ​​between it and the existing energy storage nodes and bus nodes are selected from the calculated weights. The node with the smallest weight (i.e., close distance, superior medium, and high reliability) is selected as the connection target, and the communication link is established first to reduce the number of transfers (hops) when power distribution data transmission. If the new node is a photovoltaic unit: filter out the weight values ​​between it and the bus node, and select the bus node with the smallest weight as the connection target (because the photovoltaic power needs to participate in voltage stability control in real time); if the physical distance between the two exceeds 500 meters, add a wireless repeater in the middle to form an extended path of "new node - repeater - target bus node" to ensure stable signal transmission.

[0041] After extending the path, recalculate the link load of the entire network: If a new link causes an existing link to exceed a threshold load, an AI-based greedy algorithm adjusts some data transmission paths (e.g., switching data transmission from an energy storage node from the original link to the new link). This outputs an updated list of sparse communication links, including node connections, communication medium type, and data transmission priority (e.g., voltage data has higher priority than power data). The communication parameters of each node are automatically updated via a network configuration protocol (e.g., SNMP). Minimum connectivity path generation reduces hardware costs such as fiber optic cables and switches, improving real-time control response speed. When adding new energy units, AI automatically expands paths without manual configuration, adapting to the microgrid's "build-and-operate" requirements. Path optimization based on physical location and transmission medium reduces the proportion of open-air links. Prioritization by node function (voltage data transmission prioritized) ensures the transmission of critical control signals (e.g., bus voltage), meeting the real-time requirements of microgrid stability control.

[0042] The specific construction process of the aforementioned AI decision-making module is as follows: Step 1: Initial Node Information Collection and Classification First, collect basic information on all core nodes within the microgrid; obtain the physical location coordinates of the DC bus junction point, the output terminals of each energy storage unit, and the access points of each charging pile through GPS positioning, and record the specific installation location of each node; at the same time, manually input or automatically read the type of each node (such as "voltage stability monitoring node", "power distribution monitoring node", "load disturbance monitoring node"), communication interface specifications (such as RS485, Ethernet) and data transmission requirements (such as voltage data sampling frequency of 10kHz and power data sampling frequency of 5kHz) through the equipment interface.

[0043] Next, the nodes are classified and labeled: the DC bus junction point is labeled as the "core voltage node", the energy storage unit output end is labeled as the "power node", and the charging pile access point is labeled as the "load node". The data is then labeled with priority according to its importance (e.g., voltage data is labeled as "highest priority", power data is labeled as "high priority", and normal state data is labeled as "general priority").

[0044] Step 2: Generation of the initial sparse communication link Based on the physical distribution and classification of nodes, generate the minimum connected communication path covering all nodes.

[0045] First, calculate the straight-line distance between any two nodes (based on the GPS coordinates collected in the first step, use a ruler to measure or map tools to calculate the actual spatial distance). Adjust the distance weight based on the type of communication medium: If optical fiber can be laid between two nodes, use the physical distance as the basic weight of the link directly; if only wireless communication can be used, multiply the physical distance by 3 (because wireless latency is higher). Starting from the core voltage node (DC bus junction point), the unconnected nodes with the lowest weight are selected sequentially to join the link (i.e., nodes that are close to each other and use optical fibers are connected first), until all nodes are included in the link, forming the initial sparse communication link.

[0046] Step 3: Calculation of theoretical data transmission volume and load monitoring of the link Estimate the theoretical data transmission volume for each initial link and determine whether it exceeds the load threshold.

[0047] Based on node data transmission requirements: For example, the core voltage node needs to transmit voltage data to all power nodes. At a sampling frequency of 10kHz and each voltage data point occupying 2 bytes, the transmission rate is "10,000 times / second × 2 bytes = 20,000 bytes / second". The power nodes transmit power data to the core voltage node at a sampling frequency of 5kHz and each data point occupying 2 bytes, resulting in a transmission rate of "5,000 times / second × 2 bytes = 10,000 bytes / second". Calculate the total amount of data transmitted on each link, and then divide it by the maximum bandwidth of that link (e.g., the maximum bandwidth of a certain fiber optic link is 100,000 bytes / second) to obtain the load ratio (e.g., 20,000 bytes / second ÷ 100,000 bytes / second = 20%). If the load ratio of a link exceeds 70% (preset threshold), an adjustment is initiated: find the adjacent low-load links (load ratio below 50%), and transfer some low-priority data (such as non-real-time status data of power nodes) to the adjacent links for transmission until the load of the original link drops below 70%.

[0048] Step 4: Application of Reliability Factors and Link Optimization During the initial link and adjustment process, a reliability coefficient is introduced to screen the links.

[0049] First, determine the laying environment and media type of each link: if it is an indoor fiber optic link, mark the reliability coefficient as 1.0; if it is an outdoor wireless link, mark it as 0.8; if it is a wireless link across buildings, mark it as 0.6. Compare the reliability coefficients of each potential link and prioritize the link with the higher coefficient. For example, when there are two possible links between two nodes, namely "indoor fiber optic (coefficient 1.0, distance 50 meters)" and "outdoor wireless (coefficient 0.8, distance 40 meters)," the indoor fiber optic link should be preferred even if the outdoor wireless link is closer. If a low-reliability link must be used (e.g., outdoor wireless is only an option due to building obstruction), add signal monitoring points at both ends of the link and record signal stability (e.g., number of signal loss times) every 10 seconds. If the stability is below 80% for three consecutive times, it will be automatically marked as a "link to be replaced" and subsequently prioritized for adjustment to a high-reliability link.

[0050] Step 5: Triggering and Information Acquisition for New Device Access When a new energy unit (such as a photovoltaic array or energy storage battery) is connected, the dynamic expansion process is initiated.

[0051] After a new device is connected, it sends a Modbus protocol online message (such as "Device X has started") through the hardware interface to trigger the AI ​​decision module. The module automatically reads information about new devices: it obtains the physical location coordinates via GPS; it records the communication interface type (such as RS485 or Ethernet) through the device manual or interface feedback; and it determines the data transmission requirements (such as photovoltaics requiring the transmission of voltage, current, and power at a sampling frequency of 1kHz; and energy storage requiring the transmission of SOC and output power at a sampling frequency of 5kHz).

[0052] Step 6: New Node Path Extension and Relay Evaluation Add the new node to the existing network and generate an extended path.

[0053] Calculate the straight-line distance between the new node and all existing nodes (based on GPS coordinates) to obtain the distance value between the new node and each old node; Select the connection target according to the new node type: If it is an energy storage unit, select the node with the closest distance to the existing energy storage node or core voltage node from the distance values ​​and connect to that node first (e.g., if the new energy storage is closest to the old energy storage A at a distance of 30 meters, then connect to A first); if it is a photovoltaic unit, select the node with the closest distance to the core voltage node and connect to that node first (e.g., if the photovoltaic is closest to the busbar at a distance of 80 meters, then connect to the busbar node). If the distance between the new node and the target connection node exceeds the threshold (e.g., the photovoltaic system is more than 500 meters away from the busbar), then it is determined that a new relay node needs to be added: a wireless repeater is added at the midpoint between the new node and the target node (based on distance calculation), and the new node → repeater → target node is used as the extension path.

[0054] Step 7: Recalculate Link Load and Update Parameters after Extension After the extended path is generated, the overall network load is reassessed and the parameters are updated.

[0055] Calculate the theoretical data transmission volume of the new link (e.g., data transmission from photovoltaic to the bus, estimating the transmission volume per second based on a 1kHz sampling frequency), and at the same time recalculate the load ratio of the original link (because the new node may increase the data volume of the original link). If the load ratio of an existing link exceeds 70%, a greedy algorithm is used to adjust it: from the low-priority data carried by that link, the type with the largest transmission volume (such as the status data of a power node) is selected and transferred to the new link for transmission until the load of all links is below 70%. An updated list of sparse communication links is generated, recording the connection relationships of each node (e.g., "new energy storage → old energy storage A", "photovoltaic → repeater → bus"), communication medium type (e.g., "fiber optic" or "wireless"), and data transmission priority (e.g., "voltage data priority"). This information is then automatically sent to the communication modules of each node via the SNMP protocol to complete parameter updates (e.g., modifying the communication object and transmission priority settings of the node).

[0056] Through the above steps, the AI ​​decision-making module completes the entire process of calculation from initial construction to dynamic expansion, achieving efficient generation of sparse communication links, load balancing, high reliability assurance, and automatic adaptation when new devices are connected.

[0057] In a preferred embodiment of the present invention, based on a sparse communication link, local voltage, power, and state of charge data are exchanged through a multi-agent reinforcement learning protocol, and fused to generate a global bus voltage reference value, a global power allocation reference value, and a global average state of charge value, which may include: Each monitoring node sends locally collected voltage, output power, and state of charge data to neighboring monitoring nodes via sparse communication links; Each monitoring node receives data from neighboring monitoring nodes and updates the local bus voltage reference value, power distribution reference value, and average state of charge value. Repeatedly perform data interaction and iterative calculation until each monitoring node meets the convergence conditions, including the difference in the local bus voltage reference value is less than the set threshold, the power distribution reference value meets the preset capacity ratio, and the average state of charge is the same. When the convergence condition is met, each monitoring node outputs the same global bus voltage reference value, global power distribution reference value, and global average state of charge value.

[0058] In this embodiment of the invention, each monitoring node (bus, energy storage, charging pile) encapsulates the collected real-time data into communication messages in a fixed format. For example, the energy storage node packages information such as the locally measured bus voltage value, its own output power, state of charge, node number, and timestamp. Before sending, it checks the data's validity—if the state of charge exceeds the range of 0 to 100, or the output power exceeds the rated power of the energy storage by a certain margin (e.g., 110% of the rated value), the data is marked as invalid and skipped from transmission. To capture voltage changes in a timely manner, the bus node sends voltage data every 10 milliseconds; the energy storage node sends power and state of charge data every 50 milliseconds; and the charging pile node sends load power data every 100 milliseconds. The data is compressed and transmitted using a lightweight protocol to reduce communication bandwidth usage. After receiving the message, the receiving node first performs verification; if the verification fails, it discards the message; if the verification passes, it further verifies the data. For example, after the bus node receives voltage data from the adjacent energy storage node, it will compare it with the locally measured voltage value. If the difference between the two exceeds the preset abnormal threshold (e.g., 5 volts), it is considered that the data may be interfered with or the equipment is faulty, and thus the data is discarded. If the difference is within the normal range, the data is stored in the local cache queue, and the queue can retain up to 10 sets of historical data sorted by timestamp.

[0059] Dynamic updates of bus voltage reference values: When the system starts up, the bus node uses its rated voltage (e.g., 400 volts) as the initial reference value, and the energy storage and charging pile nodes are synchronized with the bus's initial value by default. Each time effective voltage data is received from an adjacent node, the local reference value is updated using a weighted average: the existing local reference value has a larger weight (e.g., 80%), and the newly received data has a smaller weight (e.g., 20%). For example, if the current reference value of an energy storage node is 395 volts, after receiving 400 volt data from an adjacent bus node, the new reference value is 395 volts multiplied by 80% plus 400 volts multiplied by 20%, resulting in 396 volts. If the voltage data received from the same node three times consecutively deviates by more than 2 volts, a smoothing mechanism is activated to limit the magnitude of each update to within 0.5 volts, preventing drastic fluctuations in the reference value.

[0060] Cooperative calculation of power allocation baseline values: The preset power allocation benchmark value needs to be proportional to the energy storage capacity. For example, if the capacity ratio of energy storage node A to node B is 3:5, then their power allocation benchmark value ratio should also be 3:5. After receiving power data from neighboring node B, energy storage node A calculates the deviation between its current local power benchmark value and the capacity-ratio allocation value. If the ratio exceeds a certain range (e.g., 1.1 times or less than 0.9 times), an update is triggered. The new benchmark value is calculated by adding a convergence coefficient (e.g., 0.1) to the original local benchmark value and multiplying it by the difference between the capacity-ratio calculated power value and the original benchmark value. Each energy storage node initially calculates the average of its local state of charge (SOC) and the SOC of neighboring nodes. Each time new SOC data from neighboring nodes is received, a sliding window averaging method is used to update the value. If a node's SOC is below 20% or above 90%, it will be given a lower weight (e.g., 0.5 times) when calculating the average to avoid extreme values ​​having an excessive impact on the global average.

[0061] The voltage reference value of all monitoring nodes deviates from the system average reference value by less than 1 volt, and this state continues for 5 iteration cycles (10 milliseconds per cycle, 50 milliseconds in total). The deviation between the power allocation reference value of each energy storage node and the value calculated according to the capacity ratio is within a reasonable range (e.g., no more than 5%), that is, the actual power allocation ratio is within a certain multiple of the capacity ratio (e.g., for a capacity ratio of 3:5, the actual power ratio is between 2.85:5 and 3.15:5); the mean state of charge converges: the difference between the mean state of charge values ​​of all energy storage nodes is less than 2%.

[0062] When all the above conditions are met, each node stops iterating and outputs the current local reference value as the global value. For example, the bus node outputs a voltage reference value of 400 volts, and the energy storage nodes output power reference values ​​of 3.75 kW and 6.25 kW respectively according to their capacity ratios. The global average state of charge is 83%. If the iteration fails to converge after more than 100 iterations (lasting 500 milliseconds), a fault diagnosis process will be triggered to check whether the communication link is interrupted or whether the data of a certain node is continuously abnormal. After automatically isolating the faulty node, the iteration will be restarted.

[0063] Through multiple rounds of data interaction and weighted iteration, the global voltage reference value deviation is kept within a small range, the power allocation ratio is highly matched with the energy storage capacity, and the difference in the average state of charge is very small, solving the power imbalance problem caused by state asynchrony in traditional control. Distributed computing based on sparse links does not rely on a central controller; when some links fail, the remaining nodes can still converge through adjacent interactions, resulting in higher reliability than centralized control. When facing fluctuations in photovoltaic output or sudden changes in charging pile load, the global state can be updated in a short time, shortening the voltage recovery time and responding more quickly than traditional PI control. Through average state of charge convergence control, overcharging and over-discharging of energy storage units are avoided, extending battery cycle life and reducing system operation and maintenance costs.

[0064] In a preferred embodiment of the present invention, the adaptive power compensation amount is calculated using the difference between the global average state of charge (SOC) value and the real-time SOC value of the local energy storage unit, and the output power reference value of each energy storage unit is dynamically corrected. This may include: Calculate the difference between the real-time state of charge of the local energy storage unit and the global average state of charge. If the difference is greater than zero, generate a compensation command to reduce the discharge power; if the difference is less than zero, generate a compensation command to increase the discharge power. The compensation amount is generated based on the absolute value of the difference, the local current power reference value, and the preset scaling factor; The compensation amount is added to the current local power reference value, and the corrected power reference value is output.

[0065] In this embodiment of the invention, each energy storage unit collects its state of charge (SoC) in real time through built-in sensors. For example, the current SoC of a certain energy storage unit is 75%. Simultaneously, the global average SoC value is obtained through multi-agent protocol interaction, assuming the global average is 80%. The difference between the local SoC and the global average is calculated: 75% - 80% = -5%. If the difference is less than zero, a compensation instruction logic to "increase discharge power" is triggered; if the local SoC is 85% and the difference is +5%, an instruction to "decrease discharge power" is triggered.

[0066] Compensation instruction logic determination: When the difference is greater than zero (local SoC is higher than the global average): it indicates that the energy storage unit is not discharging enough and the current discharge power needs to be reduced to avoid overcharging; When the difference is less than zero (local SoC is lower than the global average): it indicates that the energy storage unit is discharging too much and the current discharge power needs to be increased to avoid over-discharge; When the difference is zero: no compensation command is generated, and the current power reference value is maintained.

[0067] Determine the absolute value of the difference: For example, the absolute value of the -5% difference mentioned above is 5%. Extract the local current power reference value: Assume the current power reference value is 10kW (discharge state); Call the preset scaling factor: The preset value in the project is 0.5 (which can be adjusted according to the energy storage type; 0.5 for lithium batteries and 0.3 for supercapacitors).

[0068] Compensation calculation logic: The amount of compensation is directly proportional to the absolute value of the difference: the larger the difference, the larger the compensation. The compensation amount is proportional to the current power reference value: the higher the current power, the more the compensation amount is adjusted proportionally. The specific calculation method is as follows: Compensation amount = absolute value of the difference × local current power reference value × scaling factor. For example, 5% × 10kW × 0.5 = 0.25kW. Since the difference is negative (power needs to be increased), the final compensation amount is +0.25kW; if the difference is positive (such as +5%), the compensation amount is -0.25kW.

[0069] The corrected power baseline value = local current power baseline value + compensation amount. For example, the current power baseline value is 10kW + compensation amount + 0.25kW = 10.25kW (increasing discharge power); if the compensation amount is -0.25kW, then it is corrected to 9.75kW (reducing discharge power). Power upper limit constraint: If the corrected power exceeds the rated power of the energy storage (e.g., 15kW), then the rated power is used as the correction value; Power lower limit constraint: If the corrected power is lower than zero (i.e., switching from discharge to charging), it needs to be judged in conjunction with the energy storage charging and discharging state—if the current mode is discharge and the corrected power is ≤0, then it switches to charging mode, and the power value is 0 or the minimum charging power (e.g., 0.5kW). The verified power value is sent to the local controller and simultaneously synchronized to adjacent energy storage units through sparse communication links for the next round of global state fusion calculation.

[0070] By using real-time differential calculation and power compensation, the state of charge (SOC) of each energy storage unit converges to the global average, preventing overcharging and over-discharging of some batteries and extending the overall lifespan of the energy storage system. Dynamically adjusting power output based on SOC allows energy storage units of different capacities and SOCs to allocate power according to actual needs, improving the energy utilization efficiency of the microgrid. In the face of sudden load changes or photovoltaic fluctuations, the compensation mechanism can quickly adjust the energy storage power output to help maintain bus voltage stability and reduce system fluctuations.

[0071] In a preferred embodiment of the present invention, the corrected power reference value and the global bus voltage reference value are input into a preset AI time-series prediction model to generate a multi-step control sequence, which may include: The corrected power reference value and the global bus voltage reference value are used as the initial control target inputs into the preset AI time-series prediction model; Based on historical operating data of energy storage units, an AI time-series prediction model is used to generate voltage regulation and power allocation for the next time step, yielding prediction results, specifically including: The three operating patterns of the energy storage unit within a preset time window are analyzed, including the bus voltage fluctuation mode, the output power response mode, and the state of charge change mode. Using the previous moment's prediction result as a new benchmark, and combining it with historical operating patterns, the voltage regulation amount for the next moment is generated, and the power allocation amount is also generated. The output includes a binary pair of voltage regulation and power allocation as the prediction result. The prediction results are fed back to the input of the AI ​​time series prediction model, and the future multi-step control variables are continuously iterated and output. Multiple control quantities are arranged in chronological order to form a multi-step control sequence that includes voltage regulation commands and power distribution commands.

[0072] In this embodiment of the invention, the corrected power reference value (e.g., the output power of a certain energy storage unit is 10.25kW) and the global bus voltage reference value (e.g., 400V) are converted into an input format that the model can recognize, and are usually normalized to the 0-1 range (e.g., power 10.25kW / rated power 15kW=0.683, voltage 400V / rated voltage 400V=1); if the power reference value exceeds the rated power range or the voltage reference value deviates from the rated value by ±10%, an anomaly flag is triggered and the most recent valid data is used instead.

[0073] The system invokes a pre-defined AI time-series prediction model (such as a Long Short-Term Memory (LSTM) network) and loads historically trained weight parameters. The model training data comes from at least 30 days of microgrid operation records, including normal operating conditions, load fluctuations, and photovoltaic fluctuation scenarios. Historical data from the past 10 minutes (or 500 sampling points at a sampling frequency of 1Hz) is extracted, containing three core operational patterns: Bus voltage fluctuation mode: Analyze the voltage drop amplitude and recovery time during load changes (e.g., when the charging pile is started, the voltage drops from 400V to 395V and recovers after 200ms). Output power response mode: Records the response delay of the energy storage unit to the power command (e.g., after receiving the power boost command, the actual power reaches 90% of the target value within 50ms). State of charge change pattern: Statistical analysis of the rate of change of SoC under different power outputs (e.g., when discharging at 10kW, the SoC decreases by 5% per hour).

[0074] The prediction result of the previous moment is used as the new benchmark (e.g., if the voltage at moment t-1 is predicted to be 399V and the power at moment t is 10.5kW, then the prediction at moment t will start from this value); if the current load scenario is similar to a certain period in history (e.g., charging pile charging at the same time yesterday), then the voltage fluctuation and power response pattern of that period will be copied, and the adjustment range will be adjusted to the current benchmark value; for example, if the voltage drops by 5V and the power increases by 1kW under the same load in historical data, then the current predicted voltage adjustment is -5V and the power allocation is +1kW, generating a binary pair (-5V, +1kW).

[0075] Multi-step iterative prediction and control sequence generation: The predicted result at time t (e.g., voltage 395V, power 11kW) is fed back to the model input as the initial condition for the prediction at time t+1. Based on the predicted value at time t and historical patterns, the model generates the adjustment amount at time t+1 (e.g., voltage recovery to +2V, power adjustment to -0.5kW), resulting in a new binary pair (+2V, -0.5kW). The iteration terminates when the prediction continues for the next 5 time steps (500ms), or until the voltage fluctuation is less than 1V and the power change rate is less than 0.1kW / s. The prediction results from the 5 time steps are arranged in chronological order to form a multi-step control sequence. t+100ms: Voltage regulation -5V, power +1kW; t+200ms: Voltage regulation +2V, power -0.5kW; ... (Subsequent steps follow the same pattern).

[0076] The normalized predicted values ​​are inversely transformed into actual control quantities (e.g., voltage regulation -5V corresponds to actual command 395V, power +1kW corresponds to 11kW), and timestamps and priority tags are added (voltage commands have higher priority than power commands).

[0077] Voltage Limit: If the predicted voltage is below 380V or above 420V, it will be forcibly corrected to the safety boundary value (380V or 420V), and an "emergency voltage regulation" flag will be added at that time step. Power limit: If the predicted power exceeds the energy storage rating (15kW), then 15kW will be used, and the power allocation in subsequent time steps will be adjusted to ensure a smooth transition.

[0078] If the power adjustment in adjacent time steps exceeds 2kW (e.g., a sudden increase from 10kW to 13kW), an intermediate transition value (11kW, 12kW) is inserted to complete the adjustment in two steps, thus avoiding current surges in the energy storage unit.

[0079] By analyzing historical patterns and employing multi-step prediction, voltage regulation and power allocation are planned in advance, enabling the system to adjust its state before load surges and reducing the lag in real-time control. The rolling-generated control sequences are smoothed to avoid drastic power and voltage fluctuations, reducing stress on energy storage units and power electronic devices and extending equipment lifespan. Feedback-based iterative prediction ensures logical continuity of control commands between adjacent time steps, preventing control oscillations caused by data fluctuations at a single moment and improving the stability of microgrid operation.

[0080] The specific construction process of the aforementioned AI time series prediction model is as follows: Step 1: Collection and Filtering of Historical Operational Data First, collect at least 30 days of continuous operation data from the microgrid to ensure coverage of various typical operating conditions.

[0081] Data types: The DC bus voltage (such as the real-time voltage values ​​of the 400V main bus and 100V sub-bus), the output power (discharge / charge power) of each energy storage unit, the state of charge (SoC), the load power of the charging pile, the output power of the photovoltaic array, etc. are collected through sensors and communication links; at the same time, the data collection timestamp (accurate to milliseconds) and the corresponding operating condition labels (such as "normal operation", "fast charging pile start-up", "photovoltaic power drop", "energy storage switching charging and discharging modes") are recorded.

[0082] Data requirements: At a sampling frequency of 1Hz (i.e., 1 time per second), approximately 2.59 million data points can be accumulated in 30 days; these data points must include special scenario data such as at least 50 load surges (e.g., a 60kW fast charging pile suddenly starts), 30 photovoltaic power fluctuations (e.g., cloud cover causing a 50% power drop), and 20 energy storage unit state switching events (e.g., switching from discharging to charging) to ensure that the model can learn various dynamic change patterns.

[0083] Step 2: Data Preprocessing and Feature Extraction The collected raw data is cleaned and organized to form input features that the model can recognize.

[0084] Outlier handling: Check each data point one by one. If the voltage value exceeds the rated range (e.g., 400V bus voltage is lower than 360V or higher than 440V), the power value exceeds 120% of the rated power of the equipment (e.g., a 15kW energy storage unit has a power of more than 18kW), or the state of charge exceeds the 0-100% range, it is marked as an outlier and replaced with the average of the five normal data points before and after it (e.g., if the SoC is 105% at a certain moment, replace it with the average SoC of the first three and the last two data points, which is 98%).

[0085] Missing value imputation: If data for a certain period is missing due to communication interruption (e.g., no data for 10 consecutive seconds), linear interpolation is used to imput it. For example, if the power is 10kW at 10:00:00 and 12kW at 10:00:10, the missing data for the 9 time intervals in between are imputed by increasing the power by 0.2kW every second.

[0086] Feature extraction: Three core features are extracted from the cleaned data and used as input to the model: Voltage fluctuation mode: Statistically analyze the voltage change pattern under different loads, such as "when the fast charging pile is started, the voltage drops from 400V to 395V, starts to recover after 200ms, and returns to 398V after 500ms", and record the drop amplitude, recovery time, and fluctuation frequency; Power response mode: Analyze the response speed of the energy storage unit to the command, such as "After receiving the power increase command, it takes 50ms for the actual power to increase from 8kW to 10kW, and it reaches 9.2kW at 30ms", and record the response delay and the rise slope; State of charge change pattern: Calculate the rate of change of SoC under different power, such as "when discharging at 10kW, SoC decreases by 5% per hour; when charging at 5kW, SoC increases by 3% per hour", and record the trend of SoC change with power and time.

[0087] Step 3: Model Structure Design and Parameter Configuration We chose Long Short-Term Memory (LSTM) network as the basic model structure and designed the number of network layers and nodes.

[0088] Input layer design: The input variables of the model are determined to be "corrected power reference value" and "global bus voltage reference value", and historical features are added as auxiliary inputs. For example, the input includes the power reference value, voltage reference value and SoC value of the current time and the past 10 minutes (a total of 600 time points) to form an input sequence (that is, each input contains 600 sets of continuous data, reflecting the recent operating trend).

[0089] Hidden layer design: Three LSTM hidden layers are set up. The first layer is used to capture short-term fluctuations (such as voltage jumps within 100ms) and has 128 nodes. The second layer is used to extract medium-term patterns (such as power adjustment trends within 1 minute) and has 64 nodes. The third layer is used to integrate long-term patterns (such as SoC changes within 10 minutes) and has 32 nodes. A "dropout" mechanism is added after each layer (randomly and temporarily shutting down 20% of the nodes) to avoid the model from over-relying on a certain type of data.

[0090] Output layer design: The output is the control quantity for future multiple steps, namely the "voltage regulation quantity" (such as +2V, -5V) and "power distribution quantity" (such as +1kW, -0.5kW) for each time step, arranged in time sequence (such as the regulation quantity for 5 time steps in the future 100ms, 200ms, ..., 500ms).

[0091] Step 4: Model Training and Hyperparameter Tuning The model is trained using the preprocessed dataset, and the model parameters are optimized through iterative iteration.

[0092] Dataset partitioning: The 30 days of data were divided into a training set (21 days, approximately 1.81 million records), a validation set (6 days, approximately 520,000 records), and a test set (3 days, approximately 260,000 records) in a ratio of 7:2:1. The training set is used for model learning patterns, the validation set is used to monitor overfitting issues during the training process, and the test set is used to finally evaluate the model's performance.

[0093] Training process: Input features of the training set (such as power, voltage, and SoC sequence of the past 10 minutes) and corresponding output targets (such as voltage regulation and power allocation for the next 5 steps) are input into the model and trained in batches (256 data points are processed per batch). After each training, the prediction error (such as the difference between the predicted voltage and the actual voltage) is calculated using the validation set. If the error of the validation set no longer decreases after 5 consecutive training iterations, training is stopped to avoid overtraining.

[0094] Hyperparameter tuning: If the model's prediction error for the "fast charging pile start-up" scenario is large (e.g., voltage regulation deviation exceeds 3V), increase the proportion of this scenario in the training set (from the original 5% to 10%), and adjust the learning speed (slow down the learning speed to allow the model to learn the pattern of this scenario more meticulously); if the model is inaccurate in predicting long-term trends (e.g., SoC changes after 10 minutes), increase the time window of the input sequence (from 10 minutes to 15 minutes) to allow the model to acquire more historical information.

[0095] Step 5: Model Validation and Error Correction The model's predictive accuracy was verified using a test set, and optimizations were made to address any weaknesses.

[0096] Multi-scenario verification: Select various scenarios in the test set and check the model prediction results: During normal operation, the voltage regulation prediction error should be less than 1V and the power allocation error should be less than 0.5kW; during load changes (such as the start of fast charging piles), the predicted voltage drop amplitude should deviate from the actual value by less than 2V and the recovery time deviation should be less than 100ms; when photovoltaic power fluctuates, the predicted energy storage power adjustment amount should deviate from the actual value by less than 1kW.

[0097] Error correction mechanism: If the prediction error of a certain scenario (such as "power adjustment when energy storage SoC is below 20%) continues to be large, analyze the reasons: if it is due to insufficient data for this scenario, collect 10 days of running data for this scenario and retrain; if it is due to the model being sensitive to SoC, add "difference between SoC and global mean" as a new feature to the input features to enhance the model's attention to SoC changes.

[0098] Step 6: Configure the rolling prediction mechanism Set up a real-time prediction process for the model to achieve dynamic generation of multi-step control sequences.

[0099] Initial input settings: Convert the current "corrected power reference value" (e.g., 10.25kW for a certain energy storage unit) and "global bus voltage reference value" (e.g., 400V) into a format that the model can recognize (e.g., divide the power value by the rated power of 15kW to get 0.683; divide the voltage value by the rated 400V to get 1.0) as the initial input.

[0100] Rolling prediction logic: The model first predicts the voltage regulation and power allocation in the next 100ms (e.g., -5V, +1kW); then it uses this prediction result as a new input (i.e., assuming the voltage is 395V and the power is 11kW after 100ms) to predict the regulation in the next 100ms (i.e., after 200ms) (e.g., +2V, -0.5kW); this process is repeated until a 5-step control sequence for the next 500ms is generated.

[0101] Abnormal input handling: If the input power reference value exceeds the rated range (e.g., 16kW, exceeding the rated value of 15kW), the input will be replaced with the rated value of 15kW; if the voltage reference value deviates from the rated value by ±10% (e.g., 441V), it will be marked as "abnormal voltage", and the model will call the preset "emergency adjustment mode" (prioritizing voltage stability and amplifying the power adjustment range).

[0102] Step 7: Model Deployment and Online Updates The trained model is deployed into the microgrid control system, and a regular update mechanism is established.

[0103] Real-time deployment: Convert the model into a lightweight format that the system can run (adapting to the hardware performance of the microgrid controller) and deploy it in the local control module to ensure that the response time for each prediction is less than 50ms (meeting real-time control requirements).

[0104] Online feedback: After the multi-step control sequence generated by the model is output, the actual operating voltage and power data are recorded and compared with the prediction results to calculate the daily average error; if the error exceeds the preset threshold for 3 consecutive days (e.g., voltage error > 1.5V), the model is triggered to update.

[0105] Regular updates: Collect new operational data every 3 months (including data on new equipment or operating conditions, such as the operational records of 2 new slow charging piles), repeat steps 2 to 5, retrain the model, replace the old model, and ensure that the model adapts to long-term changes in the system.

[0106] Through the above process, the AI ​​time-series prediction model can generate multi-step control sequences in advance based on historical patterns and real-time conditions, providing accurate prediction basis for the voltage stability and power distribution of microgrids and reducing system fluctuations under dynamic operating conditions.

[0107] like Figure 2 As shown, in another preferred embodiment of the present invention, the multi-step control sequence is converted into a secondary control signal by a reinforcement learning optimization algorithm and superimposed on the output of the local droop controller, which may include: The deviation between the current bus voltage and the corrected global bus voltage reference value, the deviation between the output power and the corrected power reference value, and the state of charge offset are obtained to form the reinforcement learning state input data. After the main network selects the first control action based on the state input data, it simulates the bus voltage fluctuation amplitude, detects the power distribution deviation value, and records the change in the state of charge balance under the first control action. The stability score is calculated based on the bus voltage fluctuation amplitude, power distribution deviation, and changes in state of charge balance. The output includes the evaluation results containing the stability score and risk warning level. The action selection strategy of the main network is dynamically adjusted based on the evaluation results to obtain the optimized control actions. The optimized control action is converted into a secondary control signal and directly superimposed on the voltage reference value output of the local droop controller.

[0108] In this embodiment of the invention, the measured value of the current bus voltage (e.g., 398V) and the corrected global voltage reference value (400V) are collected, and the voltage deviation is calculated to be -2V; the measured value of the energy storage unit output power (e.g., 9.8kW) and the corrected power reference value (10.25kW) are collected, and the power deviation is calculated to be -0.45kW; the local state of charge (75%) and the global average state of charge (80%) are collected, and the state of charge offset is calculated to be -5%.

[0109] Data normalization and feature fusion: Normalize the voltage deviation, power deviation, and state of charge offset to the interval [-1, 1]: Voltage deviation normalization: -2V / Rated voltage fluctuation range (±20V) = -0.1; Power deviation normalization: -0.45kW / rated power (15kW) = -0.03; Normalized state of charge offset: -5% / 100% = -0.05; The values ​​are fused into a state vector [-0.1, -0.03, -0.05], which is used as input to the reinforcement learning model.

[0110] The reinforcement learning main network (such as Deep Q-Network DQN) is invoked. After inputting the state vector, the first control action is selected from the action space. The action space contains a combination of voltage adjustment step size (±1V, ±2V) and power adjustment step size (±0.1kW, ±0.5kW). For example, "voltage +2V, power +0.5kW" can be selected.

[0111] The initial control action is executed in the simulation environment to simulate changes in bus voltage and power: Assuming the droop controller gain is 0.001 (V / kW), the original droop equation is: Voltage reference value = 400V - 0.001 × Power reference value; After superimposing the secondary control signal, the new voltage reference value = 400V - 0.001 × 10.25kW + 2V; Simulate and calculate the bus voltage fluctuation amplitude (e.g., from 398V to 401V, fluctuation amplitude +3V), power distribution deviation (the measured power increases from 9.8kW to 10.3kW, and the deviation from the reference value of 10.25kW becomes +0.05kW), and state of charge change rate (assuming that after the power increases by 0.5kW, the SoC decrease rate increases by 0.5% per hour).

[0112] Multi-dimensional indicator quantification Voltage fluctuation range: The actual fluctuation is +3V, which is compared with the allowable range of ±5V and is judged as "slight fluctuation". Power distribution deviation: reduced from -0.45kW to +0.05kW, a significant improvement in deviation; State of charge balance: Assuming the global average SoC change rate is 0.1% / min, the local SoC change rate under the current action is 0.15% / min, and the difference from the global rate is 0.05% / min.

[0113] The stability score is calculated using a weighted summation method: Voltage fluctuation weighting 40%: 3V ÷ 5V = 0.6, corresponding to a score of 60 points (out of 100). Power deviation weighting 35%: 0.05kW ÷ 0.5kW = 0.1, corresponding to a score of 90 points; The weight of the state of charge balance is 25%: 0.05% / min ÷ 0.1% / min = 0.5, corresponding to a score of 50 points; Overall score = 60 × 40% + 90 × 35% + 50 × 25%.

[0114] Risk warning level determination If the voltage fluctuation exceeds ±5V, a "high-risk" warning is triggered; if the power deviation exceeds 10% of the rated power (1.5kW), a "medium-risk" warning is triggered; in this example, all indicators are within the safe range, so it is judged as "low-risk". If the score is below 70 points (e.g., 68 points), the main network updates the parameters through the experience replay mechanism: reducing the Q value of the current action (i.e., the expected reward of selecting this action), increasing the selection probability of other actions (e.g., "voltage +1V, power +0.3kW"); re-entering the state vector, selecting the new action "voltage +1V, power +0.3kW", and after another simulation, the score increases to 75 points, which is determined to be the optimized control action.

[0115] The optimized action is converted into secondary control signals: voltage regulation +1V, power regulation +0.3kW; an analog signal is generated (e.g., a voltage signal of 4~20mA corresponds to 0~10V, +1V is converted to 4+(1 / 10)×16=5.6mA), and superimposed on the voltage reference value output of the droop controller.

[0116] The correction process for the droop control equation is as follows: The original droop control equation states that the voltage reference value equals the rated voltage minus the product of the droop coefficient and the power reference value. Here, the rated voltage is taken as 400 volts, and the droop coefficient is 0.001. After superimposing the secondary control signal, the new voltage reference value is calculated as follows: First, based on 400 volts, subtract the product of 0.001 and the 10.25 kW power reference value, and then add the 1 volt secondary control signal to obtain the final voltage reference value. This value will be sent to the energy storage converter as the new control basis.

[0117] Through real-time deviation feedback and simulation evaluation, the control actions are automatically adjusted to reduce voltage fluctuations and power distribution deviations, thereby improving the stability of microgrid operation. No preset control parameters are required; the reinforcement learning model can autonomously adapt to scenarios such as photovoltaic power output fluctuations and sudden changes in charging pile loads, reducing the workload of manual parameter tuning.

[0118] Through stability scoring and risk warning mechanisms, risks such as voltage exceeding limits and power overload are identified in advance, preventing overcharging and over-discharging of energy storage units and ensuring equipment safety. Compared with traditional PI control, the control signal optimized by reinforcement learning is more in line with actual operating conditions, reducing control oscillations and making the power and voltage regulation process smoother.

[0119] The secondary control signal is directly superimposed on the output of the droop controller without the need to modify the original hardware, making it compatible with the traditional microgrid control architecture and reducing upgrade costs.

[0120] In a preferred embodiment of the present invention, when the communication link fails, the remaining communication function nodes continue to perform reinforcement learning state estimation and input the generated local voltage reference value and local power allocation reference value into a preset AI time series prediction model to maintain the continuous generation of multi-step control sequences, which may include: The remaining DC bus junction nodes exchange locally collected voltage data with the output nodes of adjacent energy storage units, calculate a local voltage reference value by averaging adjacent data, and allocate a local power reference value according to the ratio of the rated capacity of each energy storage unit. The local voltage reference value and the current locally corrected power reference value are combined into an input vector, which is then loaded into the AI ​​time series prediction model to generate a multi-step control sequence with reduced step size.

[0121] In this embodiment of the invention, when the communication link fails, the remaining DC bus junction nodes actively initiate data exchange requests, sending locally collected voltage data to adjacent energy storage unit output nodes. For example, a DC bus node collects a voltage value of 398V, while two adjacent energy storage nodes collect 396V and 400V respectively. Each node summarizes all received voltage data and calculates a local voltage reference value using an arithmetic mean method: adding 398V, 396V, and 400V and dividing by the number of data points (3), the calculated value is used as the local voltage reference value. If a node's data is abnormal (e.g., the voltage value deviates from the rated value by ±10%), it is removed when calculating the average value to avoid interfering with the results.

[0122] The power allocation ratio is determined based on the rated capacity of each energy storage unit. Assuming two adjacent energy storage units A and B have rated capacities of 10kW and 20kW respectively, the capacity ratio is 1:2. If the current total system power demand is 15kW, the power allocation is as follows: the local power base value allocated to energy storage unit A is 15kW × (1 ÷ 3) = 5kW, and the local power base value allocated to energy storage unit B is 15kW × (2 ÷ 3) = 10kW. During the allocation process, fine-tuning is also performed based on the real-time state of charge (SOC) of each energy storage unit: if the SOC of a certain energy storage unit is below 20%, its power allocation value is appropriately reduced to avoid over-discharge.

[0123] The calculated local voltage reference value (e.g., 398V) is combined with the current locally corrected power reference value (e.g., 5kW for energy storage unit A) to form a two-dimensional input vector [398V, 5kW]. Dividing the voltage value by the rated voltage of 400V yields 0.995; dividing the power value by the system's maximum rated power (assumed to be 30kW) yields 0.167. The final normalized input vector is [0.995, 0.167].

[0124] The normalized input vector is loaded into a pre-defined AI time-series prediction model. Due to communication link failure leading to reduced data volume, the step size of the multi-step control sequence generated by the model is automatically reduced from the normal 5 time steps (500ms) to the next 3 time steps (300ms). Based on historical operating data and the current input vector, the model predicts the voltage regulation and power allocation for the next 3 time steps sequentially. For example, the prediction result is: Step 1: Voltage adjustment +1V, power adjustment +0.5kW; Step 2: Adjust voltage to -0.5V, adjust power to -0.2kW; Step 3: Adjust voltage to +0.3V, adjust power to +0.1kW.

[0125] The prediction results are denormalized and converted into actual control commands, which are then arranged in chronological order to form the final multi-step control sequence.

[0126] In the event of a communication failure, the microgrid maintains voltage stability and power distribution through data exchange among remaining nodes and calculation of local reference values, preventing system loss of control due to communication interruption. It does not rely on a global communication network; control sequences can be generated using only data from adjacent nodes, reducing dependence on a complete communication link. The AI ​​time-series prediction model automatically adjusts the prediction step size, generating effective control commands even with limited data, balancing control accuracy and response speed. Combined with dynamic power allocation based on the energy storage's state of charge, it prevents some energy storage units from overcharging or over-discharging due to communication failures, extending equipment lifespan.

[0127] Embodiments of the present invention also provide a computing device, including: a processor and a memory storing a computer program, wherein the computer program, when executed by the processor, performs the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0128] Embodiments of the present invention also provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described above. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effects.

[0129] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A modular AI-integrated photovoltaic-storage-charging microgrid control system, characterized in that, include: The sparse communication module is used to set up three types of core data acquisition locations at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point, and dynamically generates sparse communication links through the AI ​​decision module. The state fusion module is used to exchange local voltage, power and state of charge data through a multi-agent reinforcement learning protocol based on a sparse communication link, and to fuse and generate a global bus voltage reference value, a global power allocation reference value and a global average state of charge value. The adaptive compensation module is used to calculate the adaptive power compensation amount by using the difference between the global average state of charge value and the real-time state of charge of the local energy storage unit, and dynamically correct the output power reference value of each energy storage unit. The timing prediction module is used to input the corrected power reference value and the global bus voltage reference value into the preset AI timing prediction model and generate multi-step control sequences in a rolling manner. The control optimization module uses a reinforcement learning optimization algorithm to convert a multi-step control sequence into a secondary control signal, which is then superimposed onto the output of the local droop controller. The local control module is used to ensure that the remaining communication function nodes continue to perform reinforcement learning state estimation when the communication link fails, and input the generated local voltage reference value and local power allocation reference value into the preset AI time series prediction model to maintain the continuous generation of multi-step control sequences.

2. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 1, characterized in that, Three types of core data acquisition locations are set up at the DC bus junction point, the output end of each energy storage unit, and the charging pile access point. A sparse communication link is dynamically generated through an AI decision-making module, including: The DC bus junction point is used as the voltage stability monitoring node, the energy storage unit output terminal is used as the power distribution monitoring node, and the charging pile access point is used as the load disturbance monitoring node. Based on the physical distribution of the three types of nodes, the minimum connected communication path covering all nodes is generated through the AI ​​decision module. When a new energy unit is connected, the AI ​​decision-making module expands the communication path in real time and outputs the updated sparse communication link.

3. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 2, characterized in that, Based on sparse communication links, local voltage, power, and state of charge data are exchanged through a multi-agent reinforcement learning protocol, and fused to generate a global bus voltage reference value, a global power allocation reference value, and a global average state of charge value, including: Each monitoring node sends locally collected voltage, output power, and state of charge data to neighboring monitoring nodes via sparse communication links; Each monitoring node receives data from neighboring monitoring nodes and updates the local bus voltage reference value, power distribution reference value, and average state of charge value. Repeatedly perform data interaction and iterative calculation until each monitoring node meets the convergence conditions, including the difference in the local bus voltage reference value is less than the set threshold, the power distribution reference value meets the preset capacity ratio, and the average state of charge is the same. When the convergence condition is met, each monitoring node outputs the same global bus voltage reference value, global power distribution reference value, and global average state of charge value.

4. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 3, characterized in that, By utilizing the difference between the global average state of charge (SOC) and the real-time SOC of the local energy storage unit, an adaptive power compensation amount is calculated to dynamically correct the output power reference value of each energy storage unit, including: Calculate the difference between the real-time state of charge of the local energy storage unit and the global average state of charge. If the difference is greater than zero, generate a compensation command to reduce the discharge power; if the difference is less than zero, generate a compensation command to increase the discharge power. The compensation amount is generated based on the absolute value of the difference, the local current power reference value, and the preset scaling factor; The compensation amount is added to the current local power reference value, and the corrected power reference value is output.

5. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 4, characterized in that, The corrected power reference value and the global bus voltage reference value are input into a preset AI timing prediction model to generate a multi-step control sequence, including: The corrected power reference value and the global bus voltage reference value are used as the initial control target inputs into the preset AI time-series prediction model; Based on the historical operating data of the energy storage unit, the voltage regulation and power allocation for the next moment are generated by an AI time-series prediction model to obtain the prediction results. The prediction results are fed back to the input of the AI ​​time series prediction model, and the future multi-step control variables are continuously iterated and output. Multiple control quantities are arranged in chronological order to form a multi-step control sequence that includes voltage regulation commands and power distribution commands.

6. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 5, characterized in that, Based on historical operating data of energy storage units, an AI time-series prediction model is used to generate voltage regulation and power allocation for the next time step, yielding prediction results including: The three operating patterns of the energy storage unit within a preset time window are analyzed, including the bus voltage fluctuation mode, the output power response mode, and the state of charge change mode. Using the previous moment's prediction result as a new benchmark, and combining it with historical operating patterns, the voltage regulation amount for the next moment is generated, and the power allocation amount is also generated. The output includes a binary pair of voltage regulation and power allocation as the prediction result.

7. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 6, characterized in that, The multi-step control sequence is transformed into a secondary control signal using a reinforcement learning optimization algorithm, which is then superimposed on the output of the local droop controller, including: The deviation between the current bus voltage and the corrected global bus voltage reference value, the deviation between the output power and the corrected power reference value, and the state of charge offset are obtained to form the reinforcement learning state input data. After the main network selects the first control action based on the state input data, it simulates the bus voltage fluctuation amplitude, detects the power distribution deviation value, and records the change in the state of charge balance under the first control action. The stability score is calculated based on the bus voltage fluctuation amplitude, power distribution deviation, and changes in state of charge balance. The output includes the evaluation results containing the stability score and risk warning level. The action selection strategy of the main network is dynamically adjusted based on the evaluation results to obtain the optimized control actions. The optimized control action is converted into a secondary control signal and directly superimposed on the voltage reference value output of the local droop controller.

8. The modular AI photovoltaic-storage-charging integrated microgrid control system according to claim 7, characterized in that, When the communication link fails, the remaining communication function nodes continue to perform reinforcement learning state estimation and input the generated local voltage reference value and local power allocation reference value into the preset AI time series prediction model to maintain the continuous generation of multi-step control sequences, including: The remaining DC bus junction nodes exchange locally collected voltage data with the output nodes of adjacent energy storage units, calculate a local voltage reference value by averaging adjacent data, and allocate a local power reference value according to the ratio of the rated capacity of each energy storage unit. The local voltage reference value and the current locally corrected power reference value are combined into an input vector, which is then loaded into the AI ​​time series prediction model to generate a multi-step control sequence with reduced step size.

9. A computing device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the system as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that, when executed by a processor, implements the system as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Network flow control optimization and dynamic reconstruction method fusing AI decision

    CN121334055A