A multi-port dc microgrid converter for building energy management

By using synchronous sampling, data framing, and state estimation of a multi-port DC microgrid converter, predictive constraints are generated to optimize power allocation, thus solving the problems of high energy conversion losses and unstable control in building energy management and achieving efficient and stable energy management.

CN122437375APending Publication Date: 2026-07-21SHENZHEN ON XI GREEN ENERGY TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN ON XI GREEN ENERGY TECH
Filing Date
2026-04-30
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing building energy management systems, the multi-stage DC-AC-DC conversion results in high energy conversion losses, unstable control, difficulty in coping with load fluctuations and photovoltaic output disturbances, lack of unified time alignment and quality verification of multi-source data, and the failure to explicitly transform prediction uncertainties into feasible domain constraints. Traditional control strategies are unable to meet battery safety and efficiency requirements.

Method used

A multi-port DC-DC microgrid converter is adopted. The port status acquisition unit performs synchronous sampling, the data normalization and framing unit aligns multi-source data, the state estimation unit constructs the operating state vector, the prediction and scene generation unit generates the prediction set, the constraint compilation unit compiles the feasible region constraints, the power allocation solution unit generates the target power command, the modulation parameter generation unit maps the control quantity, and the closed-loop correction unit updates the parameters to achieve optimized energy transmission.

Benefits of technology

Reduce energy conversion losses, improve control stability and efficiency, enhance adaptability to load and photovoltaic output, ensure battery safety, and improve system robustness and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122437375A_ABST
    Figure CN122437375A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of direct current microgrid converter, and discloses a kind of multi-port direct current microgrid converter for building energy management, comprising: port state acquisition unit synchronous sampling photovoltaic port, energy storage battery port and direct current load port voltage, current, temperature;Data normalization and framing unit timestamp alignment generates state data frame containing port identification, control cycle identification, data validity mark;State estimation unit obtains operating state vector;Predictive and scenario generation unit outputs prediction set;Constraint compilation unit generates feasible domain constraint set;Power distribution solving unit solves target power instruction set;Modulation parameter generation unit generates modulation control quantity set and drive control sequence;Closed-loop correction unit updates parameters;Power conversion execution unit completes energy transmission.The present application can realize the stable distribution and transmission of port power within the feasible domain constraint set, improve the voltage stabilizing performance of direct current bus and reduce the multi-stage energy conversion loss.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of DC-DC microgrid converter technology, and more specifically, to a multi-port DC-DC microgrid converter for building energy management. Background Technology

[0002] In building energy management scenarios, the trend towards DC power generation for distributed photovoltaic (PV) power generation, residential energy storage batteries, and various electrical devices is becoming increasingly apparent. To achieve local PV consumption, peak shaving and valley filling, and increase the self-consumption ratio, households or buildings typically need to coordinate the DC power generation from the PV side, the DC power generation from the battery side, and the energy demand from the load side. However, existing building-side energy access systems are mostly centered around AC buses, with PV inverters, energy storage converters, and load-side rectifiers often configured independently. This results in multiple stages of energy conversion between DC and AC, long conversion links, high conversion losses, and problems such as circulating current, dynamic response lag, and decreased system efficiency caused by parallel control of multiple devices.

[0003] On the other hand, building-side loads exhibit random fluctuations and significant short-cycle variations, while photovoltaic output is subject to rapid disturbances due to factors such as shading and cloud cover changes. Traditional multi-port DC-DC converters or DC microgrid control schemes often employ simple voltage outer loop and current inner loop control or fixed-priority power allocation strategies. These typically rely on closed-loop regulation based on instantaneous measurements, lacking a unified time alignment and quality verification mechanism for multi-source data. This makes it difficult to maintain stable and reliable control inputs in the event of sampling loss, noise disturbances, or sensor malfunctions, potentially leading to amplified bus voltage fluctuations or battery current surges. Furthermore, existing controls often rely on static thresholds or manually set limits to address multiple constraints such as battery state of charge, charge / discharge capacity, and thermal safety. This makes it difficult to achieve rapid and feasible power command repair and smooth transition under events such as sudden load changes and photovoltaic power drops, easily resulting in unattainable targets, control saturation, or mode switching oscillations.

[0004] Furthermore, building energy management not only focuses on instantaneous voltage stabilization and current limiting, but also needs to consider long-term indicators such as battery life, curtailment rate, and economic efficiency. Most existing solutions lack predictive modeling of load power and available photovoltaic power, making it difficult to plan port power allocation in advance within the control window. Even when prediction is introduced, it often uses single-point predicted values ​​as input, failing to explicitly transform prediction uncertainties into feasible region constraints, leading to potential bus overruns or battery overcurrent in extreme scenarios. Meanwhile, multi-port DC-DC microgrid converters also face the problem of soft-switching conditions failing as the port voltage ratio and power transmission direction change under high-frequency modulation. Traditional fixed dead-time or fixed modulation strategies struggle to balance efficiency and thermal safety across all operating conditions, resulting in increased switching losses, higher device temperature rise, and reduced system reliability.

[0005] In summary, there is an urgent need for a multi-port DC microgrid converter and its supporting control system for building energy management. This system should be able to achieve unified framing and validity verification of multi-source data based on multi-port synchronous sampling, construct an operating state vector that includes battery state of charge (SOC), DC bus equivalent load power, and upper limit of available photovoltaic power, and combine prediction and scenario generation, constraint compilation, and power allocation solution to generate target power commands that meet DC bus voltage regulation and port safety constraints. It should also have the ability to perform feasibility repair, smooth switching, and parameter backtracking updates when events are triggered, so as to improve the efficiency, robustness, and security of building-side DC microgrid energy dispatch. Summary of the Invention

[0006] The purpose of this invention is to provide a multi-port DC-DC microgrid converter for building energy management to solve the above-mentioned technical problems.

[0007] This invention provides a multi-port DC-DC microgrid converter for building energy management, comprising:

[0008] The port status acquisition unit is configured to synchronously sample the voltage, current and temperature of at least three DC ports, including a photovoltaic port, an energy storage battery port and a DC load port.

[0009] The data normalization and framing unit is configured to align multi-source data obtained by synchronous sampling according to a unified timestamp and generate a status data frame containing port identifier, control cycle identifier and data validity marker.

[0010] The state estimation unit is configured to construct a microgrid operating state vector based on the state data frame. The operating state vector includes the battery state of charge (SOC), DC bus equivalent load power, photovoltaic available power limit, and a set of port constraint parameters.

[0011] The prediction and scene generation unit is configured to generate a prediction set within the prediction window based on historical state data frames and the current running state vector.

[0012] The constraint compilation unit is configured to generate a set of feasible domain constraints within the control window based on the set of port constraint parameters and the prediction set.

[0013] The power allocation solution unit is configured to use the DC bus voltage stabilization target and building energy consumption strategy as objective functions in each control cycle, and to solve for the target power command set of each DC port under the condition of satisfying the feasible domain constraint set.

[0014] The modulation parameter generation unit is configured to map the target power command set to a modulation control quantity set of the power conversion execution unit and generate a drive control sequence;

[0015] The closed-loop correction unit is configured to update the parameters of the power allocation solving unit or the modulation parameter generation unit based on the state data frame of the next control cycle.

[0016] The power conversion execution unit is configured to perform bidirectional or unidirectional energy transfer between the photovoltaic port, the energy storage battery port and the DC load port under the action of the drive control sequence.

[0017] Furthermore, the data normalization and framing unit is configured to perform the following sub-steps:

[0018] The local sampling time of the sampled data from each DC port is read and converted into the system's unified clock to obtain a unified timestamp;

[0019] The data of each DC port is resampled according to the control cycle, so that the port voltage, port current and port temperature fields corresponding to the same frame number are formed in each control cycle.

[0020] Perform validity checks on each field, including range checks, rate of change checks, and sign consistency checks, and generate the data validity tags.

[0021] A confidence factor is calculated for the data that passes the validity check. The confidence factor is related to the estimated sampling noise, the missing rate, and the number of verification failures.

[0022] When the data validity is marked as invalid or the confidence factor is below the threshold, missing data completion is performed on the corresponding field. The missing data completion includes zero-order preservation, linear interpolation, or substitution based on the predicted value of the previous control cycle, and the completion mark and the confidence factor are written into the state data frame.

[0023] Furthermore, the state estimation unit is configured to perform the following sub-steps to generate the operating state vector:

[0024] The first battery state of charge (SOC) estimate is obtained by performing coulomb integration on the battery charge based on the energy storage battery port current.

[0025] When the preset static conditions or low current conditions are met, the estimated value of the first battery's state of charge (SOC) is corrected based on the energy storage battery port voltage and open circuit voltage-state of charge mapping table to obtain the estimated value of the second battery's state of charge (SOC).

[0026] The estimated state of charge (SOC) of the second battery is jointly filtered with the port voltage and port current of the energy storage battery. The joint filtering includes extended Kalman filtering or unscented Kalman filtering, and the final estimated state of charge (SOC) of the battery and its confidence interval are output.

[0027] The equivalent load power of the DC bus is calculated based on the DC bus voltage and the DC load port current, and the equivalent impedance of the DC bus is estimated based on the DC bus voltage disturbance and current response.

[0028] The current available photovoltaic power is calculated based on the photovoltaic port voltage and photovoltaic port current, and the upper limit of available photovoltaic power is generated according to the preset maximum power point tracking upper limit.

[0029] The final estimated state of charge (SOC) of the battery, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of the available photovoltaic power, and the set of port constraint parameters are concatenated to form the operating state vector.

[0030] Furthermore, the prediction and scene generation unit is configured to perform the following sub-steps to generate the prediction set:

[0031] The load power sequence and photovoltaic available power sequence are extracted within the historical sliding time window, and then detrended and periodically decomposed to obtain the residual sequence.

[0032] Quantile prediction is performed on the residual sequence, and the predicted values ​​corresponding to the first quantile, the second quantile, and the third quantile are output, where the first quantile, the second quantile, and the third quantile correspond to 10%, 50%, and 90%, respectively.

[0033] Based on the quantile prediction results, a multi-scenario prediction set is generated, which includes scenario combinations of high load-low PV, medium load-medium PV, and low load-high PV.

[0034] Calculate a scenario weight for each scenario in the multi-scenario prediction set, the scenario weight being related to the historical similarity day matching degree or short-term prediction error;

[0035] The output includes the quantile prediction results, the multi-scene prediction set, and the prediction set of the scene weights.

[0036] Furthermore, the constraint compilation unit is configured to perform the following sub-steps to generate the feasible domain constraint set:

[0037] Read the set of port constraint parameters and form hard constraints. The hard constraints include the upper limit of the charging and discharging current of the energy storage battery port, the upper and lower limits of the battery state of charge (SOC), the upper and lower limits of the DC bus voltage, and the upper limit of the device temperature.

[0038] Opportunity constraints are constructed based on the quantile prediction results in the prediction set, and the opportunity constraints include: the probability of DC bus voltage exceeding the limit does not exceed a threshold under a preset confidence level;

[0039] Slope constraints are constructed based on the upper limit of the power change rate.

[0040] Robust constraints are constructed based on the multi-scenario prediction set. The robust constraints include: satisfying the DC bus voltage regulation and energy storage battery port current limit under the high load-low photovoltaic scenario.

[0041] Thermal budget constraints are generated based on device temperature and switching current statistics. These thermal budget constraints are used to limit the allowable equivalent switching loss index per unit time to not exceed a threshold.

[0042] The hard constraints, chance constraints, slope constraints, robust constraints, and thermal budget constraints are combined to form the feasible region constraint set.

[0043] Furthermore, the power allocation solution unit includes a feasibility repair module and an optimization solution module, and is configured to perform the following sub-steps:

[0044] The net power requirement of the DC bus is calculated based on the operating state vector and the prediction set, and an initial port power candidate instruction set is generated.

[0045] Substitute the initial port power candidate instruction set into the feasible region constraint set for constraint checking to obtain the constraint violation vector;

[0046] When the constraint violation vector is non-zero, the feasibility repair module is triggered to perform repair according to a preset priority. The priority includes reducing interruptible load power over limiting energy storage battery port discharge, limiting energy storage battery port discharge over reducing critical load power, and generating a first repair power instruction set.

[0047] During the repair process, current limiting and power ramp are applied to the power at the energy storage battery port to ensure that the rate of change of the energy storage battery port current does not exceed the threshold.

[0048] When the first set of repair power commands satisfies the set of feasible domain constraints, the optimization solution module is triggered to perform secondary optimization with DC bus voltage deviation cost, battery degradation cost and photovoltaic curtailment cost as objective functions, and outputs the target power command set.

[0049] The target power command set is written into the drive control sequence to generate the link.

[0050] Furthermore, the modulation parameter generation unit is configured to perform the following sub-steps to map the target power command set to the modulation control quantity set:

[0051] A local linearization model is established between port power and modulation control quantity. The local linearization model includes the gain coefficient of power with respect to phase shift angle or the gain coefficient of power with respect to duty cycle.

[0052] In each control cycle, the gain coefficient is updated based on the port voltage ratio and the actual power feedback of the previous control cycle. The update includes recursive least squares identification or gain table lookup correction.

[0053] Calculate a first set of modulation control quantities that satisfies the target power command set based on the updated gain coefficient, and apply a limiting effect to the first set of modulation control quantities;

[0054] A slope limit is applied to the first set of modulation control quantities to form a second set of modulation control quantities;

[0055] The drive control sequence is generated based on the second set of modulation control quantities and the dead time parameter.

[0056] Furthermore, the modulation parameter generation unit is further configured to perform soft-switching feasible window adaptation, which includes the following sub-steps:

[0057] The peak value and direction of the commutation current are estimated based on the port voltage ratio, the equivalent value of the transmission inductance, and the target power command set.

[0058] Based on the peak commutation current and the output capacitor parameters of the switching device, the equivalent voltage blanking condition at the moment of turn-on is calculated, and the soft-switching margin index is obtained.

[0059] When the soft switching margin index is lower than the threshold, the dead time is adjusted first to increase the commutation time window.

[0060] When adjusting the dead time still does not meet the threshold, a soft-switching hold correction is further applied to the second modulation control set. The soft-switching hold correction includes reducing the upper limit of the phase shift amplitude, introducing a phase shift bias, or switching to a standby modulation mode.

[0061] The equivalent switching loss index in the thermal budget constraint is updated synchronously when the soft switch hold correction is triggered.

[0062] Furthermore, the closed-loop correction unit is configured to perform event-driven mode switching and parameter backtracking updates, and includes the following sub-steps:

[0063] The status data frame is used to determine events, including photovoltaic power drop events, energy storage battery port undervoltage events, DC bus overvoltage events, DC bus undervoltage events, and overtemperature events.

[0064] When an event is triggered, the integral term of the DC bus voltage regulator loop is frozen and a transition control trajectory is generated, which satisfies the port power slope constraint.

[0065] The target mode is selected based on the event type. The target mode includes photovoltaic priority power supply mode, energy storage battery voltage stabilization mode and current limiting load reduction mode.

[0066] Furthermore, a mode switching log is recorded during the execution of the transition control trajectory. The mode switching log includes the event type, trigger time, target power command set before and after the switch, and DC bus voltage deviation.

[0067] The error correction parameters of the prediction and scene generation unit or the gain coefficient of the modulation parameter generation unit are updated based on the DC bus voltage deviation and port power deviation before and after mode switching, and the updated parameters are written into the next control cycle.

[0068] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0069] By enabling bidirectional or unidirectional energy transfer between photovoltaic ports, energy storage battery ports, and DC load ports within the same multi-port DC microgrid converter, energy is preferentially collected and distributed on the DC side, reducing multi-stage conversion links such as DC-AC-DC, thereby reducing conversion losses and improving building-side self-consumption efficiency.

[0070] Based on the unified timing caliber of state data frames, the availability and consistency of control inputs are improved. Multi-port synchronous sampling data is aligned and framed according to a unified timestamp, and port identifiers, control cycle identifiers and data validity markers are carried in the state data frames. This can avoid control errors caused by asynchronous multi-source data and provide a consistent data caliber for subsequent state estimation, prediction and solution, thereby improving control stability and repeatability.

[0071] The state estimation unit summarizes the battery state of charge (SOC), DC bus equivalent load power, photovoltaic available power limit, and port constraint parameters into an operating state vector, so that control decisions not only rely on instantaneous measurements, but also include available supply capacity and safety boundary information, thereby improving the rationality and interpretability of power dispatch.

[0072] In each control cycle, the set of feasible domain constraints within the control window is compiled based on the prediction set of the prediction window. This enables the power allocation solution unit to simultaneously satisfy the DC bus voltage regulation target, port current / temperature and other constraint boundaries when solving the target power command set. This can reduce the risks of bus over-limit and battery overcurrent caused by photovoltaic sudden changes or load fluctuations.

[0073] The target power command set is further mapped to a modulation control quantity set and a drive control sequence is generated, so that energy management decisions can be directly applied to the control input of the power conversion execution unit, reducing the deviation caused by intermediate manual rule conversion and improving the real-time performance and closed-loop convergence speed of the control link. Attached Figure Description

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

[0075] Figure 1 This is a functional framework diagram of a multi-port DC-DC microgrid converter provided in an embodiment of the present invention. Detailed Implementation

[0076] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0077] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0078] For ease of understanding, some key terms in this embodiment are explained below: Multi-port DC microgrid converter: This converter is a core device for building energy management. It is configured to connect multiple DC power sources (e.g., photovoltaic), energy storage devices (e.g., batteries), and various DC loads to achieve efficient management and transmission of energy on the DC bus.

[0079] DC port: refers to the DC side interface connected to the converter, such as the output terminal of the photovoltaic array, the charging and discharging terminal of the energy storage battery, and the power supply terminal of the DC load.

[0080] Uniform timestamp: Standard time information used to mark the moment of data acquisition or processing, its function is to ensure time alignment of data from different sources.

[0081] Status data frame: A processed and encapsulated data structure that contains key operational information of each DC port at a specific point in time or within a control cycle.

[0082] Microgrid operating state vector: A set of key parameters that comprehensively reflect the current operating status of the microgrid, which are used for decision-making and control.

[0083] State of charge (SOC): The percentage of remaining charge in an energy storage battery, which is an important indicator for assessing the usable energy of a battery.

[0084] DC bus equivalent load power: The equivalent value of the total load power carried by the DC bus, which reflects the total energy demand of the system.

[0085] Photovoltaic available power limit: The maximum power that a photovoltaic power generation system can output under current light and temperature conditions.

[0086] Port constraint parameter set: A set of parameters that describe the operating limitations of each DC port (e.g., voltage, current, power, temperature range).

[0087] Forecast window: refers to the time range within which the system needs to predict and plan its operating status in the future.

[0088] Prediction set: A dataset containing various possible operating scenarios within a future prediction window and their corresponding predicted values.

[0089] Control window: refers to the time range within the current control cycle during which the system needs to make decisions and execute control commands.

[0090] Feasible region constraint set: Boundary conditions that describe all acceptable operating states of the system within the current control cycle.

[0091] DC bus voltage regulation target: The control target that maintains the DC bus voltage within a preset range, its function is to ensure stable system operation.

[0092] Building energy strategy: Optimization plans for energy use within buildings, such as peak shaving and valley filling, maximizing self-consumption of photovoltaic power, etc.

[0093] Target power command set: The expected power value allocated to each DC port after optimization.

[0094] Modulation control parameters: parameters used to control the switching devices of power conversion execution units (e.g., DC-DC converters), such as duty cycle and phase shift angle.

[0095] Drive control sequence: Instructions containing modulation control quantities and timing information, which directly drive the power conversion execution unit to work.

[0096] Closed-loop correction: The process of adjusting and optimizing control parameters or models based on actual operational feedback.

[0097] Bidirectional or unidirectional energy transfer: refers to the ability of energy to flow bidirectionally between ports (e.g., battery charging and discharging) or unidirectionally (e.g., photovoltaic power generation).

[0098] See Figure 1As shown, this embodiment of the invention provides a multi-port DC-DC microgrid converter for building energy management, comprising: a port status acquisition unit configured to synchronously sample the voltage, current, and temperature of at least three DC ports, including a photovoltaic port, an energy storage battery port, and a DC load port. As one implementation, separate sensors and data acquisition modules can be used to measure the voltage, current, and temperature of the photovoltaic port, energy storage battery port, and DC load port respectively. The measured value of each port is converted into a digital signal by its own analog-to-digital converter and transmitted independently to the central controller. As another implementation, a multiplexer can be used in conjunction with a single analog-to-digital converter with high conversion accuracy to sequentially sample the voltage, current, and temperature signals of each DC port at different time points. The switching of the multiplexer is controlled by a time synchronization signal to achieve synchronous sampling.

[0099] The data normalization and framing unit is configured to align multi-source data obtained from synchronous sampling according to a unified timestamp, generating a status data frame containing a port identifier, a control cycle identifier, and a data validity flag. In one implementation, this unit receives raw sampled data from the port status acquisition unit and aligns data with different sampling frequencies or different start times to a preset unified time point using an interpolation method based on linear relationships. Subsequently, the aligned data is packaged into data frames according to a preset length and order, and port identifiers and control cycle identifiers are manually added. Data validity flags can be based on threshold judgments; for example, voltage or current exceeding a preset range is marked as invalid. In another implementation, an event-triggered data normalization method can be used, associating new sampled data with the most recent system clock cycle. Missing data can be filled in using valid data from the previous moment. The framing process simply concatenates valid data from all ports within the same control cycle, adding a flag indicating data completeness.

[0100] The state estimation unit is configured to construct a microgrid operating state vector based on the state data frame. This operating state vector includes the battery state of charge (SOC), the equivalent load power of the DC bus, the upper limit of available photovoltaic power, and a set of port constraint parameters. In one implementation, the unit directly reads the battery port current and performs preliminary coulomb integration based on the state data frame output by the data normalization and framing unit to obtain a preliminary estimate of the battery SOC. The equivalent load power of the DC bus can be obtained by measuring the product of the DC bus voltage and the total load current. The upper limit of available photovoltaic power can be found by looking up the voltage and current measurements at the photovoltaic ports, combined with a preset maximum power point tracking curve. The set of port constraint parameters can be directly read from a preset configuration file. In another implementation, a lookup table-based method can be used for state estimation. For example, the battery SOC can be obtained by consulting a pre-stored voltage-SOC or current-SOC relationship table. The equivalent load power of the DC bus can be calculated based on the instantaneous values ​​of the bus voltage and load current. The upper limit of available photovoltaic power can be obtained by consulting a preset power-environment parameter table based on data from a light intensity sensor or an ambient temperature sensor.

[0101] The prediction and scenario generation unit is configured to generate a prediction set within a prediction window based on historical state data frames and the current operating state vector. In one implementation, this unit predicts load power and available photovoltaic power using a calculation method based on moving average or exponential smoothing, based on historical state data frames. The prediction result is the predicted value at a single moment within the future prediction window. Scenario generation can generate a limited number of preset scenarios based on these single-moment prediction values, by manually setting three preset deviation ratios: high, medium, and low. Examples include "high load - low photovoltaic," "medium load - medium photovoltaic," and "low load - high photovoltaic." Scenario weights can be evenly distributed. Alternatively, a linear regression-based model can be used to fit historical data to obtain trend predictions of future load power and available photovoltaic power. The prediction set can contain only these trend prediction values. Scenario generation can then create a limited number of deterministic scenarios based on these trends, by adjusting preset percentage fluctuations, such as adding or subtracting 10% from the predicted values ​​to create high and low scenarios.

[0102] The constraint compilation unit is configured to generate a set of feasible domain constraints within the control window based on the port constraint parameter set and the prediction set. In one implementation, this unit directly reads preset thresholds from the port constraint parameter set, such as the upper limit of battery charge / discharge current, preset upper and lower limits of battery state of charge (SOC), preset upper and lower limits of DC bus voltage, and preset upper limits of device temperature, and uses these preset values ​​as hard constraints. Chance constraints, slope constraints, robust constraints, and thermal budget constraints can be temporarily ignored, or only preset default values ​​can be used. In another implementation, the unit directly encodes the hard constraints in the port constraint parameter set into a set of inequalities. For the prediction set, only the prediction values ​​at a single moment can be used, and based on these single-moment prediction values, a set of static constraints that do not change with prediction uncertainty can be generated by superimposing safety margins. For example, the predicted load power can be added to a preset safety margin as the upper limit of power allocation.

[0103] The power allocation solution unit is configured to solve for the target power command set for each DC port within each control cycle, using the DC bus voltage stabilization target and building energy consumption strategy as objective functions and satisfying the feasible region constraint set. As one implementation, within each control cycle, this unit employs a power allocation strategy based on preset priority rules. For example, priority is given to DC bus voltage stabilization, followed by local photovoltaic consumption, and finally, the charging and discharging of energy storage batteries. The objective function can be simplified to minimizing the square of the DC bus voltage deviation. The feasible region constraint set can contain only hard voltage and current limits. The solution process can be a simple lookup table or a rule-based decision tree, directly outputting the target power command set for each DC port. Alternatively, a linear programming method can be used. The objective function can be set to minimize the absolute deviation between the DC bus voltage and the setpoint. The constraints are directly derived from the set of linear inequalities generated by the constraint compilation unit. The solver outputs the target power command set for each DC port that satisfies these linear constraints. The feasibility repair module can be a limiter that directly truncates commands when they exceed the range.

[0104] The modulation parameter generation unit is configured to map the target power command set to a modulation control quantity set of the power conversion execution unit and generate a drive control sequence. In one implementation, this unit establishes a preset linear relationship model between port power and modulation control quantity; for example, it assumes a preset gain coefficient between power and phase shift angle or duty cycle. Within each control cycle, this preset gain coefficient is directly used to convert the target power command set into a first modulation control quantity set. Preset upper and lower limits are applied to this set. Slope limiting can be ignored, or a preset default value can be used, allowing rapid changes in modulation quantity. The drive control sequence is then directly generated from these modulation control quantities and a preset fixed dead time parameter. In another implementation, a pre-established lookup table can be used to directly retrieve the corresponding modulation control quantity based on the target power command and the current port voltage ratio. This lookup table is preset and does not dynamically update with the operating state. The modulation control quantity obtained from the lookup table is limited, and the drive control sequence is directly generated.

[0105] The closed-loop correction unit is configured to update the parameters of the power allocation solver or the modulation parameter generation unit based on the state data frame of the next control cycle. As one implementation, this unit employs a parameter update mechanism based on a preset time interval. For example, at regular intervals, the parameters of the power allocation solver or the modulation parameter generation unit are manually or in batches, regardless of specific operational events. The update can be based on the average value of historical operational data or empirical data. As another implementation, when the DC bus voltage is detected to continuously exceed a preset threshold, a reset operation is triggered, clearing certain parameters of the power allocation solver (e.g., the integral term) to zero in an attempt to restore system stability. This correction does not distinguish between specific event types and does not consider transient control trajectories.

[0106] The power conversion execution unit is configured to perform bidirectional or unidirectional energy transfer between the photovoltaic port, the energy storage battery port, and the DC load port under the action of the drive control sequence. In one implementation, the unit consists of multiple separate DC-DC converters, each responsible for energy conversion at one DC port. For example, the photovoltaic port is connected to a boost converter, the energy storage battery port to a bidirectional DC-DC converter, and the DC load port to a buck converter. These converters receive their respective drive control sequences and perform energy transfer independently. In another implementation, an integrated multi-port DC-DC converter can be used, containing multiple switching arms and inductors, achieving energy conversion between multiple ports through shared magnetic integrated elements. This unit receives a unified drive control sequence and performs unidirectional or bidirectional energy transfer according to the instructions.

[0107] The following example will provide a more detailed explanation of the above technical solution:

[0108] Consider a smart building at location A equipped with a rooftop photovoltaic array, a battery storage system, and various DC loads, such as LED lighting, DC air conditioning, and electric vehicle charging stations. User A wants to maximize self-consumption of photovoltaic power while ensuring stable DC bus voltage and extending battery life.

[0109] On a clear morning, the port status acquisition unit synchronously samples the voltage, current, and temperature of the photovoltaic port, energy storage battery port, and DC load port. For example, the photovoltaic port voltage is 300V and the current is 10A; the energy storage battery port voltage is 48V and the current is 5A (charging); the DC load port voltage is 48V and the current is 15A. This raw data is collected precisely at the same time.

[0110] The acquired raw data is sent to the data normalization and framing unit. This unit timestamps the data according to a unified system clock. For example, all data is marked as "10:00:00.000". Subsequently, this aligned data is encapsulated into a status data frame, which includes identifiers for the photovoltaic port, energy storage battery port, and DC load port, as well as an identifier for the current control cycle. Simultaneously, an initial validity check is performed on each data field, such as checking if the voltage is within a reasonable range; if a sensor reading is abnormal, it is marked as invalid.

[0111] Based on this state data frame, the state estimation unit constructs a microgrid operating state vector. For example, by accumulating the current at the energy storage battery ports and combining it with the battery voltage, the battery's state of charge (SOC) is estimated to be 70%. Based on the DC bus voltage and DC load port current, the equivalent load power of the DC bus is calculated to be 720W. Simultaneously, based on the voltage and current at the photovoltaic ports, the current available photovoltaic power limit is estimated to be 3000W. Furthermore, port constraint parameters such as battery charge / discharge current limits and voltage limits are also incorporated into this vector.

[0112] The prediction and scenario generation unit uses historical operational data and the currently constructed operational state vector to predict possible changes in photovoltaic (PV) output and load demand over a future period (e.g., the next 15 minutes). For example, it predicts that within the next 15 minutes, PV output may decrease due to cloud cover, while load demand may increase as user A activates more devices. This unit generates a prediction set containing multiple possible scenarios, such as "moderate PV - moderate load" and "low PV - high load," and assigns corresponding probability weights to each scenario.

[0113] Based on the set of port constraint parameters (e.g., battery SOC must be maintained between 20% and 90%, and DC bus voltage must be maintained between 47V and 49V) and the prediction set, the constraint compilation unit generates a set of feasible domain constraints within the control window. For example, considering predictions of a potential decrease in photovoltaic power and an increase in load in the future, the unit will generate a constraint requiring the energy storage battery not to over-discharge within the next 15 minutes to address a potential power deficit, while ensuring that the DC bus voltage does not fall below the lower limit.

[0114] Within the current control cycle, the power allocation solution unit prioritizes maintaining the DC bus voltage at 48V. Combined with the building energy consumption strategy set by user A (e.g., prioritizing photovoltaics, followed by batteries, and lastly the grid), and under the constraints of this feasible region set, it solves for the target power command set for each DC port. For example, the calculation shows that the photovoltaic port should output 2800W, the energy storage battery port should discharge 200W, and the DC load port should consume 3000W.

[0115] The modulation parameter generation unit maps the target power command set (e.g., 2800W photovoltaic, 200W battery discharge) to a set of modulation control quantities for the power conversion execution unit. For example, the duty cycle of the photovoltaic boost converter is adjusted to 0.85, and the phase shift angle of the energy storage battery bidirectional converter is adjusted to 15 degrees. Subsequently, a drive control sequence containing these modulation control quantities and corresponding timing is generated.

[0116] In the next control cycle, the closed-loop correction unit receives a new state data frame. If a significant deviation in the DC bus voltage is detected, or if there is a significant difference between the battery SOC and the predicted value, the unit updates the optimization parameters (e.g., weighting coefficients) in the power allocation solution unit or the gain coefficients in the modulation parameter generation unit based on this new feedback information, thereby improving the accuracy and robustness of subsequent control. For example, if the actual photovoltaic output is found to be lower than the prediction, the photovoltaic priority weight will be adjusted.

[0117] Under the control sequence, the photovoltaic boost converter, the energy storage battery bidirectional converter, and the DC load buck converter in the power conversion execution unit work together to realize the transmission of photovoltaic energy to the DC bus, the charging and discharging of the energy storage battery, and the power supply from the DC bus to the load. For example, the photovoltaic system boosts 2800W of power to the 48V DC bus, and the energy storage battery provides 200W of power to the bus, together meeting the 3000W load demand and maintaining the stability of the bus voltage.

[0118] Based on the above examples, the technical concept of this embodiment has the following technical contributions:

[0119] Regarding multi-source data processing and reliability, existing technologies mostly rely on instantaneous measurements for closed-loop regulation, lacking a unified time alignment and quality verification mechanism for multi-source data. In cases of sampling loss, noise disturbances, or sensor malfunctions, control input instability can lead to bus voltage fluctuations or battery current surges. This application uses a port status acquisition unit for synchronous sampling, and a data normalization and framing unit aligns multi-source data according to a unified timestamp, generating status data frames containing data validity markers. This mechanism ensures the accuracy and reliability of the control input. For example, in the above example, even if a sensor experiences a brief malfunction, the data normalization and framing unit can still provide reliable input data through validity markers and possible completion mechanisms, avoiding system instability caused by data quality issues.

[0120] In terms of comprehensive perception of operational status and handling of prediction uncertainties, existing technologies offer relatively simple estimations of battery state of charge, load power, and available photovoltaic power, and most lack predictive modeling for future power. Even when predictions are introduced, they often use single-moment predictions as input, failing to explicitly transform prediction uncertainties into feasible region constraints. This makes it difficult to plan ahead for extreme scenarios such as sudden load changes or photovoltaic power drops, easily leading to bus exceeding limits or battery overcurrent. The state estimation unit of this application constructs a microgrid operational state vector based on state data frames, including battery state of charge (SOC), equivalent DC bus load power, upper limit of available photovoltaic power, and a set of port constraint parameters, achieving comprehensive perception of the system's operational status. The prediction and scenario generation unit generates a prediction set within a prediction window based on historical data and the current state, considering multiple scenarios. The constraint compilation unit then generates a feasible region constraint set within a control window based on these prediction sets, transforming prediction uncertainties into quantifiable constraints. In the example above, by predicting future scenarios of declining photovoltaic output and increased load, and converting them into constraints that prevent batteries from over-discharging, the system can plan ahead and avoid passively responding only when a power shortage actually occurs, thereby effectively preventing bus voltage drops or battery over-discharge.

[0121] In terms of intelligent power allocation and dynamic constraint management, existing technical solutions mostly adopt simple voltage outer loop and current inner loop control or preset priority power allocation strategies. These often rely on preset thresholds or manually set limits to implement multiple constraints, making it difficult to achieve rapid and feasible power command repair and smooth transition when events occur. The power allocation solution unit of this application uses the DC bus voltage stabilization target and building energy consumption strategy as objective functions in each control cycle, and solves for the target power command set for each DC port under the condition of satisfying the feasible region constraint set. This method achieves intelligent power allocation and can dynamically adapt to operating conditions. For example, in the above example, the power allocation solution unit not only considers instantaneous voltage stabilization but also takes into account user A's building energy consumption strategy and battery SOC constraints, making the power allocation more reasonable and optimized.

[0122] Regarding closed-loop correction and system robustness, existing control systems lack effective closed-loop correction mechanisms. Updates to control parameters are typically preset or delayed, leading to poor adaptability and insufficient robustness in long-term operation. The closed-loop correction unit in this application updates the parameters of the power allocation solution unit or modulation parameter generation unit based on the state data frame of the next control cycle. This real-time closed-loop correction mechanism enables the system to continuously optimize its parameters based on actual operational feedback, improving the system's adaptability and robustness. In the example above, if there is a deviation between the actual photovoltaic output and the prediction, the closed-loop correction unit can promptly adjust the parameters of the prediction model, making subsequent power allocation more accurate and thus maintaining the long-term stable operation of the system.

[0123] In other embodiments, this application proposes a multi-port DC-DC microgrid converter for building energy management. This converter synchronously samples the voltage, current, and temperature of at least three DC ports through a port status acquisition unit, and processes this multi-source data through a data normalization and framing unit. However, in real-world operating environments, sampled data from different ports may exhibit time asynchrony, inconsistent data quality, or even missing or abnormal data. If this raw data is used directly for subsequent state estimation and power allocation without effective processing, it may lead to inaccurate judgments of the microgrid's operating status, thereby affecting the accuracy of the control strategy and the overall stability and reliability of the system.

[0124] In this regard, this application further proposes that the data normalization and framing unit be configured to perform the following sub-steps:

[0125] The local sampling time of the sampled data from each DC port is read and converted into the system's unified clock to obtain a unified timestamp;

[0126] The data of each DC port is resampled according to the control cycle, so that the port voltage, port current and port temperature fields corresponding to the same frame number are formed in each control cycle.

[0127] Perform validity checks on each field, including range checks, rate of change checks, and sign consistency checks, and generate data validity tags accordingly;

[0128] For data that passes the validity check, a confidence factor is calculated. The confidence factor is related to at least the estimated sampling noise, the missing rate, and the number of validation failures.

[0129] When data validity is marked as invalid or the confidence factor is below the threshold, missing data completion is performed on the corresponding field. Missing data completion includes zero-order preservation, linear interpolation, or substitution based on the predicted value of the previous control cycle, and the completion mark and confidence factor are written into the status data frame.

[0130] Specifically, to ensure consistency in time across all sampled data from different ports, the data normalization and framing unit is configured to read the local sampling time of each DC port and convert it to the system's unified clock, thus obtaining a unified timestamp. This helps eliminate time deviations caused by clock drift and transmission delays from different sampling modules or sensors, providing an accurate time reference for subsequent data alignment and processing. For example, each DC port sampling module can be equipped with a high-precision local clock and include a local timestamp during data transmission. The data normalization and framing unit calculates the deviation between the local clock and the system's master clock by periodically synchronizing or calibrating with the system's master clock, and compensates for the local timestamp accordingly. Alternatively, a distributed time synchronization protocol, such as Network Time Protocol (NTP) or Precision Time Protocol (PTP), can be used to keep the clocks of each sampling module highly synchronized with the system's master clock, directly adding the synchronized system timestamp when the sampled data is generated.

[0131] Based on this, the data normalization and framing unit is configured to resample the data of each DC port according to the control cycle, so that the port voltage, port current, and port temperature fields corresponding to the same frame number are formed in each control cycle. This aims to convert the raw data with different sampling frequencies or irregular sampling into a data sequence with a fixed frequency and aligned with the control cycle, forming a structured data frame, thereby simplifying the subsequent data processing logic and ensuring that all relevant port data can be accessed and processed in a consistent format and at a consistent time point in each control cycle. Resampling can use interpolation algorithms, such as linear interpolation, spline interpolation, or nearest neighbor interpolation, to map the raw sampled data to a fixed time point within the control cycle; alternatively, data averaging or filtering methods can be used to average or median filter all raw sampled data in each control cycle to generate representative data values ​​for that control cycle.

[0132] To identify and flag outliers or erroneous data in the raw sampled data, preventing inaccurate data from contaminating subsequent system state estimation and control decisions, the data normalization and framing unit is configured to perform validity checks on each field. Validity checks include range verification, rate of change verification, and sign consistency verification, generating data validity tags accordingly. Range verification checks whether data values ​​fall within a preset physical range; rate of change verification checks whether the magnitude of data change within a continuous control cycle exceeds a preset upper limit for the physical rate of change; and sign consistency verification checks whether the sign logic between related physical quantities is consistent. Additionally, statistical methods, such as outlier detection based on standard deviation, or establishing a port physical model and comparing the sampled data with the model's predicted values, can also be used.

[0133] Furthermore, the data normalization and framing unit is configured to calculate a confidence factor for the data that passes the validity check. This confidence factor is related at least to the sampled noise estimate, the missing rate, and the number of validation failures. This aims to further quantify the reliability of the data that passes the initial validity check, providing a more refined basis for subsequent data use and missing data completion. The sampled noise estimate can be obtained from the covariance matrix of the Kalman filter or the variance within a sliding window; the missing rate can be calculated based on the missing frequency of the field in historical data; and the number of validation failures can be a cumulative counter. The confidence factor can be designed as a weighted average or product function of these factors, or it can be output using fuzzy logic or a machine learning model.

[0134] When data validity is marked as invalid or the confidence factor is below a threshold, the data normalization and framing unit is configured to perform missing data completion on the corresponding field. Missing data completion includes zero-order hold, linear interpolation, or substitution based on the predicted value of the previous control cycle. A completion flag and confidence factor are written into the state data frame. This ensures that when data anomalies or unreliability are detected, missing or erroneous data is filled in using a reasonable estimation method, guaranteeing the integrity of the state data frame and preventing subsequent algorithms from failing or producing erroneous results due to data interruption. Zero-order hold can be filled using data values ​​from the previous valid control cycle; linear interpolation can be estimated based on two valid data points; substitution based on the predicted value of the previous control cycle can utilize the prediction result from the state estimation unit of the previous control cycle. The completion flag can be a Boolean value or an enumeration type, indicating whether the data has been completed and the completion method. The confidence factor of the completed data field can be re-evaluated based on the reliability of the completion method.

[0135] The solution presented in this application effectively addresses the issues of time asynchrony, inconsistent quality, and missing data in original multi-source data through the refined processing flow of the aforementioned data normalization and framing unit. This unit first reads the local sampling time of each DC port and converts it into a unified system clock, thereby assigning a unified timestamp to all sampled data and resolving the time synchronization problem between different data sources. Based on this, the data normalization and framing unit resamples these time-synchronized data according to a preset control cycle, organizing the original data into structured data frames to ensure consistent and complete port voltage, current, and temperature fields are obtained in each control cycle. To further improve data quality, this unit performs rigorous validity checks on each field in the data frame, including range checks, rate of change checks, and sign consistency checks, to identify and mark abnormal or erroneous data, generating data validity markers. For data that passes the validity checks, the system calculates a reliability factor, which comprehensively considers factors such as the estimated sampling noise, missing rate, and number of verification failures, thereby quantifying the reliability of the data. When data is marked as invalid or its confidence factor falls below a preset threshold, the data normalization and framing unit immediately performs missing data completion. This can be achieved by using methods such as zero-order hold, linear interpolation, or alternative methods based on the previous control cycle's predicted values ​​to fill in missing or erroneous data, ensuring the integrity of the data frame. Simultaneously, the completion flag and the updated confidence factor are written into the state data frame. Through this series of processes, the data normalization and framing unit transforms raw, discrete, and potentially defective sampled data into high-quality state data frames with a unified time base, structured, verified, and completed. These high-quality state data frames are then passed to the state estimation unit, providing a reliable foundation for constructing accurate microgrid operating state vectors. This significantly improves the accuracy and robustness of the entire multi-port DC-DC microgrid converter in state estimation, prediction, and power allocation under complex operating environments, avoiding control errors and system instability caused by data quality issues.

[0136] The following is a concrete example to illustrate this. The data normalization and framing unit can be implemented using a high-performance digital signal processor (DSP) or a field-programmable gate array (FPGA). For example, when the port status acquisition unit synchronously acquires voltage, current, and temperature data from the photovoltaic port, energy storage battery port, and DC load port, each sampling point is accompanied by a local timestamp generated by the crystal oscillator inside its respective sampling module. The data normalization and framing unit first uses a hardware module based on Precision Time Protocol (PTP) to synchronize these local timestamps with the system master clock with high precision, calculates the time deviation, and then corrects the local timestamps to generate a unified timestamp. Subsequently, the unit resamples these original data with unified timestamps according to a preset 100-millisecond control cycle. Specifically, for each control cycle, it collects the sampled data from all ports within that cycle and uses a linear interpolation algorithm to map these data to a fixed time point at the beginning of the control cycle, thereby forming structured data fields containing the voltage, current, and temperature of the photovoltaic port, the energy storage battery port, and the DC load port. After a data field is generated, the unit immediately performs validity checks. For example, for photovoltaic port voltage, it checks whether it falls within the physical range of 0V to 1000V; for energy storage battery port current, it checks whether its rate of change exceeds 5A / 100ms over two consecutive control cycles; for DC load ports, it checks whether the power direction is always consuming power. If any check fails, a corresponding data validity marker is generated as invalid. Simultaneously, for data that passes the checks, the unit calculates its reliability factor. For example, it estimates sampling noise by analyzing the sliding window variance of the port current sample values, counts the number of missing values ​​for the field in the past hour, and records the number of validation failures for the field in the past ten minutes. These parameters are used to calculate a reliability factor between 0 and 1 using a preset weighting function. When a data field is marked as invalid, or its reliability factor falls below the threshold of 0.7, the unit triggers missing data completion. For example, if the energy storage battery port current data is invalid, it will preferentially use zero-order hold, that is, use the effective current value from the previous control cycle to fill it; if multiple consecutive cycles are invalid, it may switch to linear interpolation, using the most recent effective data for estimation; in extreme cases, if the data is missing for a long time, the predicted value of the port current from the state estimation unit in the previous control cycle will be used to replace it. After completion, the completion flag of the data field will be set to "Completed (Zero-order Hold)" or "Completed (Predictive Replacement)", and its confidence factor will be adjusted according to the reliability of the completion method. All this information will be written into the final state data frame for reference by subsequent modules.

[0137] Through the above technical solutions, the multi-port DC-DC microgrid converter can effectively solve problems such as time asynchrony, unstable data quality, and missing data that may occur during the acquisition, transmission, and processing of multi-source heterogeneous data. By unifying timestamps, resampling, and constructing structured data frames, the alignment of data from all ports in the time dimension and the consistency of format are ensured, providing a well-organized data foundation for subsequent processing. Furthermore, through multi-dimensional validity verification and the calculation of reliability factors, abnormal or low-quality data can be identified and quantified in a timely manner, avoiding interference from inaccurate information on system state estimation and control decisions. When invalid or unreliable data occurs, the system can intelligently perform missing data completion, ensuring the continuity and integrity of the data stream, thereby significantly improving the reliability and availability of state data frames. This enables the state estimation unit to construct the microgrid operating state vector based on more accurate and complete data, thereby improving the operational stability, control accuracy, and energy management efficiency of the entire microgrid system under complex operating conditions, and reducing the risk of system failure due to data quality issues.

[0138] In other embodiments, this application proposes a multi-port DC-DC microgrid converter for building energy management. This converter synchronously acquires voltage, current, and temperature data from at least three DC ports via a port status acquisition unit. A data normalization and framing unit aligns the synchronously sampled multi-source data according to a unified timestamp, generating a status data frame containing port identifiers, control cycle identifiers, and data validity markers. However, raw or preliminarily processed data alone cannot accurately and comprehensively reflect the real-time operating status of the microgrid. In particular, the lack of refined estimations for key information such as the state of charge of energy storage batteries, the actual load characteristics of the DC bus, and the power generation potential of photovoltaics will directly affect the accuracy of subsequent power allocation decisions and the overall operating efficiency and stability of the system.

[0139] To address this, this application further proposes that the state estimation unit is configured to perform the following sub-steps to generate an operating state vector: performing a coulomb integral on the battery charge based on the energy storage battery port current to obtain a first battery state of charge (SOC) estimate; when preset resting conditions or low current conditions are met, correcting the first battery SOC estimate based on the energy storage battery port voltage and open-circuit voltage-state of charge mapping table to obtain a second battery SOC estimate; and jointly filtering the second battery SOC estimate with the energy storage battery port voltage and energy storage battery port current, the joint filtering including extended Kalman filtering. The system employs filtering or unscented Kalman filtering to output the final estimated state of charge (SOC) value of the battery and its confidence interval; it calculates the equivalent load power of the DC bus based on the DC bus voltage and DC load port current, and estimates the equivalent impedance of the DC bus based on the DC bus voltage disturbance and current response; it calculates the current available power of the photovoltaic (PV) based on the PV port voltage and PV port current, and generates the upper limit of available PV power according to the preset maximum power point tracking upper limit; it then concatenates the final estimated SOC value of the battery, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of available PV power, and the set of port constraint parameters into an operating state vector.

[0140] Specifically, a coulomb integral is performed on the battery charge based on the battery port current to obtain the estimated first state of charge (SOC). Coulomb integration is a commonly used method for estimating battery SOC; its principle is to calculate the change in battery charge by integrating the battery charging and discharging current over time. This method can reflect the dynamic changes in battery charge in real time and has the advantages of simple implementation and low computational complexity. In practical applications, the change in battery charge can be obtained by sampling the battery port current and accumulating the data over the sampling period, thereby estimating the first SOC. For example, a digital integrator or accumulator can be used, or a microcontroller can be used to periodically sum the sampled current values.

[0141] When preset resting or low-current conditions are met, the estimated SOC of the first battery is corrected based on the mapping table of battery port voltage and open-circuit voltage to obtain the estimated SOC of the second battery. The preset resting or low-current conditions refer to the battery being in an open-circuit state or with extremely low charging / discharging current, where the battery terminal voltage is close to its open-circuit voltage (OCV). A relatively stable nonlinear mapping relationship exists between the open-circuit voltage and the battery's SOC, which can be pre-calibrated experimentally and stored as an open-circuit voltage-SOC mapping table. When these conditions are met, the ohmic internal resistance voltage drop and polarization voltage drop of the battery are negligible. Therefore, a relatively accurate SOC value can be directly obtained by measuring the battery port voltage and consulting this mapping table to correct the accumulated error caused by coulomb integration, thereby improving the accuracy of the SOC estimation. For example, a static condition can be defined as a situation where the battery current is continuously below a certain minimum threshold (such as C / 100 or C / 200) for a period of time (such as 10 minutes); a low current condition can be defined as a situation where the absolute value of the battery current is below a certain preset threshold (such as 0.05C).

[0142] The estimated state of charge (SOC) of the second battery is jointly filtered with the port voltage and current of the energy storage battery. This joint filtering includes either extended Kalman filtering (EKF) or unscented Kalman filtering (UKF) to output the final estimated SOC and its confidence interval. The joint filtering aims to integrate multiple information sources to further improve the accuracy and robustness of the SOC estimation and provide a confidence interval for the estimation results. EKF and UKF are two commonly used nonlinear state estimation algorithms. EKF applies Kalman filtering by locally linearizing the nonlinear system, making it suitable for systems with low nonlinearity. UKF, on the other hand, uses an unscented transformation to approximate the mean and covariance of the nonlinear function, avoiding the calculation of the Jacobian matrix and exhibiting better performance for strongly nonlinear systems. By using the estimated state of charge (SOC) of the second battery, the port voltage of the energy storage battery, and the port current of the energy storage battery as observations or state variables, and combining them with the battery's equivalent circuit model or electrochemical model, these filtering algorithms can effectively suppress measurement noise and model errors, output a more accurate final SOC estimate of the battery, and quantify its uncertainty (confidence interval).

[0143] The equivalent load power of the DC bus is calculated based on the DC bus voltage and the DC load port current, and the equivalent impedance of the DC bus is estimated based on the DC bus voltage disturbance and current response. The equivalent load power of the DC bus directly reflects the current total load power consumption of the microgrid system and can be calculated by real-time monitoring of the product of the DC bus voltage and the DC load port current. This provides crucial load demand information for subsequent power allocation. The equivalent impedance of the DC bus reflects the dynamic response characteristics of the DC bus to power changes and is essential for maintaining bus voltage stability. The equivalent impedance can be estimated by applying a small disturbance to the DC bus voltage (e.g., by making minor adjustments to the power at a certain port) and monitoring the resulting DC bus current response. For example, the equivalent impedance can be estimated by online identification of the disturbance and response data using the least squares method or recursive least squares method.

[0144] The currently available photovoltaic (PV) power is calculated based on the PV port voltage and current, and an upper limit for the available PV power is generated according to a preset maximum power point tracking (MPPT) limit. The currently available PV power refers to the maximum power that the PV array can output under current environmental conditions (illuminance, temperature). This can be obtained by measuring the PV port voltage and current in real time and calculating their product. To avoid excessive power output from the PV system under extreme conditions (such as excessively high illuminance or excessively low temperature), or to align with the overall power balance strategy of the system, a preset maximum power point tracking (MPPT) limit is usually set. This limit can be a fixed value or dynamically adjusted based on the system's operating status. The generation of the upper limit for the available PV power ensures that the PV power output is within a safe and acceptable range for the system, avoiding overload or unnecessary power waste.

[0145] The final estimated state of charge (SOC) of the batteries, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of available photovoltaic power, and the set of port constraint parameters are concatenated into an operating state vector. This operating state vector is a comprehensive and quantitative representation of the current operating status of the microgrid system and forms the basis for subsequent decision-making and control. By concatenating these key estimates and parameters into a unified vector, all necessary information can be provided to the power allocation solution unit. The set of port constraint parameters may include voltage, current, and power limits for each DC port, as well as the upper and lower limits of battery SOC and temperature limits. This structured data representation allows the system to efficiently access and process this information, providing standardized input for complex optimization algorithms. For example, this data can be organized into an array or structure and stored and accessed in a predetermined order.

[0146] The proposed solution transforms the state data frames output by the data normalization and framing unit into high-confidence operating state vectors through a series of refined processing steps. First, for the energy storage battery port, the state estimation unit employs a hierarchical, progressive strategy to estimate the battery's state of charge (SOC). It first performs a coulomb integral based on the energy storage battery port current to quickly obtain a first estimated SOC value. This method is fast but suffers from accumulated errors. To correct this error, when the system is under preset static or low-current conditions, the energy storage battery port voltage is corrected using a pre-calibrated open-circuit voltage-state of charge mapping table to obtain a more accurate second estimated SOC value. Subsequently, to further improve estimation accuracy and quantify uncertainty, the state estimation unit performs joint filtering on the second estimated SOC value, the energy storage battery port voltage, and the energy storage battery port current, such as using extended Kalman filtering or unscented Kalman filtering, thereby outputting the final estimated SOC value and its confidence interval. This multi-stage SOC estimation method combines the real-time performance of Coulomb integration, the accuracy of the open-circuit voltage method, and the robustness of Kalman filtering, effectively addressing the limitations of single methods in terms of accuracy and dynamic response, and providing a reliable basis for refined battery management. Simultaneously, the state estimation unit is also responsible for evaluating the microgrid's load characteristics and photovoltaic power generation potential. It calculates the equivalent load power of the DC bus using the DC bus voltage and DC load port current, directly reflecting the current system's energy demand. To better understand the bus's dynamic characteristics, this unit also estimates the equivalent impedance of the DC bus based on DC bus voltage disturbances and current response, which is crucial for subsequent bus voltage regulation control and fault diagnosis. For the photovoltaic port, the state estimation unit calculates the current available photovoltaic power based on the photovoltaic port voltage and current, and, combined with a preset maximum power point tracking upper limit, generates an upper limit for the available photovoltaic power, ensuring the rational utilization of photovoltaic energy and system safety. Ultimately, all these meticulously estimated key parameters, including the final estimated state of charge (SOC) of the batteries, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of available photovoltaic power, and the set of port constraint parameters, are integrated and stitched together into a comprehensive operating state vector. This operating state vector serves as a "snapshot" of the current operating status of the microgrid, providing accurate and reliable input for subsequent prediction and scenario generation units, constraint compilation units, and power allocation solution units. This allows the energy management and control decisions of the entire microgrid to be based on a solid data foundation, thereby significantly improving the operating efficiency, stability, and reliability of the microgrid. In this way, the solution proposed in this application overcomes the limitations of relying solely on raw sampled data for decision-making, providing crucial support for the intelligent management of microgrids.

[0147] The following is a concrete example to illustrate this. The state estimation unit can be implemented by a high-performance digital signal processor (DSP) or an embedded microcontroller (such as the ARM Cortex-M series). Within this processor, a corresponding software module can run to perform the estimation task described above. For example, for coulomb integration, the processor can periodically read the sampled values ​​of the energy storage battery port current and accumulate them into a preset charge variable. Then, it calculates the first battery state of charge (SOC) estimate based on the battery's rated capacity. When the system detects that the absolute value of the energy storage battery port current is below 0.01C (C being the battery's rated capacity) for 10 consecutive minutes, the low current condition is met, and the processor triggers a correction mechanism. At this time, it reads the energy storage battery port voltage and consults an open-circuit voltage-state of charge mapping table stored in non-volatile memory (such as EEPROM or Flash). This mapping table can be a lookup table containing hundreds of data points. The corresponding SOC value is obtained through linear interpolation or polynomial fitting, thereby correcting the first battery SOC estimate and obtaining the second battery SOC estimate. Subsequently, the processor can run an Extended Kalman Filter (EKF) algorithm. The battery model in this EKF algorithm can be a first-order RC equivalent circuit model, with state variables including the battery state of charge (SOC) and polarization voltage, and observed variables being the energy storage battery port voltage and current. The EKF algorithm uses a second estimated battery SOC as the initial state and iteratively updates it by combining real-time measurements of the energy storage battery port voltage and current, ultimately outputting an accurate estimated battery SOC and its covariance matrix, from which confidence intervals can be extracted. For calculating the equivalent load power of the DC bus, the processor can read the sampled values ​​of the DC bus voltage and DC load port current in real time and perform multiplication operations. To estimate the equivalent impedance of the DC bus, the system can periodically perform small, controlled step perturbations on the power command of a certain port through the power conversion execution unit, and simultaneously collect the response data of the DC bus voltage and current. This data can be input into a recursive least squares algorithm module to identify the equivalent impedance of the DC bus online. The current available photovoltaic (PV) power is calculated directly by multiplying the PV port voltage and PV port current. The upper limit of available PV power can be preset to 1.2 times the rated power of the PV array to cope with extreme light conditions, and is compared and limited in real time by the processor. Finally, all these calculated and estimated values, including the final estimated state of charge (SOC) of the battery, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of available PV power, and the pre-configured port constraint parameters (such as battery charge and discharge current limits, SOC upper and lower limits, bus voltage upper and lower limits, etc.), are packaged into a unified data structure as an operating state vector for use by the subsequent energy management module.

[0148] Through the above technical solutions, this application can provide accurate and comprehensive perception of the key operating states of the microgrid. By employing a hierarchical, progressive battery state-of-charge (SOC) estimation method, combined with the real-time performance of Coulomb integration, the correction capability of the open-circuit voltage method, and the robustness of joint filtering, the accuracy and reliability of battery SOC estimation are significantly improved, and the estimation uncertainty is quantified, providing a solid foundation for battery health management and lifespan optimization. Simultaneously, the accurate calculation and estimation of the equivalent load power and equivalent impedance of the DC bus enables the system to more accurately grasp load demand and bus dynamic characteristics, thus providing crucial information for DC bus voltage regulation and power balance. Furthermore, the generation of available photovoltaic power and its upper limit ensures the effective utilization of photovoltaic energy and the safety of system operation. These finely estimated and integrated operating state vectors provide high-confidence input for subsequent microgrid energy management and control decisions, effectively avoiding problems such as power distribution imbalance, bus voltage fluctuations, or battery overcharging and over-discharging caused by inaccurate state information, thereby improving the overall operating efficiency, stability, and reliability of the multi-port DC microgrid converter.

[0149] In some embodiments described above in this application, a multi-port DC-DC microgrid converter for building energy management is proposed. This converter can synchronously sample the voltage, current, and temperature of at least three DC ports, align the multi-source data obtained from the synchronous sampling with a unified timestamp, and generate a state data frame containing port identifiers, control cycle identifiers, and data validity markers. The microgrid operating state vector is then constructed based on this state data frame. However, in actual microgrid operation, photovoltaic power generation and load power exhibit significant fluctuations and uncertainties. Relying solely on a single predicted value for subsequent power allocation may lead to insufficient system response to unforeseen circumstances, or even operational instability, thereby affecting the efficiency and reliability of energy management.

[0150] In response, this application further proposes that the prediction and scenario generation unit be configured to perform the following sub-steps to generate a prediction set: extract the load power sequence and the photovoltaic available power sequence within a historical sliding time window, and perform detrending and periodic decomposition on them to obtain a residual sequence; perform quantile prediction on the residual sequence, and output the predicted values ​​corresponding to at least the first quantile, the second quantile, and the third quantile, where the quantiles include 10%, 50%, and 90%; generate a multi-scenario prediction set based on the quantile prediction results, where the multi-scenario prediction set includes scenario combinations of high load-low photovoltaic, medium load-medium photovoltaic, and low load-high photovoltaic; calculate the scenario weight for each scenario in the multi-scenario prediction set, where the scenario weight is at least related to the historical similar day matching degree or short-term prediction error; and output a prediction set containing the quantile prediction results, the multi-scenario prediction set, and the scenario weights.

[0151] The process involves extracting load power and available photovoltaic power sequences within a historical sliding time window, and then detrending and decomposing them to obtain residual sequences. This step aims to separate deterministic components, such as trends and periodicity, from the raw historical data, as well as stochastic components, i.e., residuals, to more accurately model and predict stochasticity. For example, moving averages or exponential smoothing can be used to identify and remove trend components, and then Fourier transforms or wavelet analysis can be used to extract periodic components. Alternatively, methods such as Seasonal Autoregressive Integrated Moving Average (SARIMA) models or Empirical Mode Decomposition (EMD) can be used to directly decompose the sequence into trend, periodic, and residual components. Quantile prediction is then performed on the residual sequence, outputting predicted values ​​for at least the first, second, and third quantiles, including 10%, 50%, and 90%. Quantile prediction provides not only a single predicted value, such as a mean prediction, but also upper and lower limits of the prediction interval, thus quantifying the uncertainty of the prediction. This is crucial for risk assessment and robust decision-making. For example, quantile regression models can be used to directly model and predict different quantiles. Alternatively, a probability distribution model of the prediction error, such as a Gaussian mixture model, can be constructed, and the predicted value corresponding to a specified quantile can be calculated based on this distribution. A multi-scenario prediction set is generated based on the quantile prediction results, including combinations of scenarios such as high load - low PV, medium load - medium PV, and low load - high PV. Transforming the quantile prediction results into discrete, representative operating scenarios helps to transform continuous uncertainty problems into manageable discrete decision problems, providing input for subsequent optimization. For example, the predicted values ​​of load and PV can be combined based on the upper and lower limits of the quantile predictions, such as the 10th percentile representing low values, the 90th percentile representing high values, and the 50th percentile representing median values, to form different scenarios. Alternatively, clustering algorithms, such as K-means, can be used to cluster historical data or quantile prediction results to identify representative typical scenarios. A scenario weight is calculated for each scenario in the multi-scenario prediction set, and the scenario weight is at least related to the historical similarity day matching degree or short-term prediction error. Scenario weights reflect the probability or importance of different scenarios, enabling optimization decisions to prioritize scenarios that are more likely to occur or have a greater impact, thus improving the robustness and effectiveness of the decisions. For example, the historical frequency of similar days can be used as scenario weights by calculating the matching degree between the current date and historical similar days, such as those with similar weather patterns or holiday types. Alternatively, the probability of different scenarios can be estimated by combining the prediction error distribution of short-term prediction models, such as ARIMA and LSTM, with the current prediction value and the historical error distribution. The output includes quantile prediction results, a multi-scenario prediction set, and scenario weights.This step integrates all prediction information into a structured output for use by subsequent constraint compilation and power allocation solution units, ensuring the integrity and usability of the information. For example, this information can be encapsulated in a data structure, such as a JSON object or a custom class, containing an array of quantile prediction values, a list of scenario sets, with each scenario containing load and photovoltaic prediction values, and a corresponding weight array. Alternatively, this data can be stored in a database or an in-memory table structure, accessible to other units via a specific API interface.

[0152] The prediction and scenario generation unit of this application transforms raw historical data into structured future predictions containing quantified uncertainty information through a series of refined processing steps. First, the unit extracts the load power sequence and available photovoltaic power sequence within a historical sliding time window and performs detrending and periodic decomposition on them, thereby breaking down the original sequences into more easily analyzable residual sequences. This decomposition helps separate predictable trend and periodic components from random fluctuations, laying the foundation for subsequent predictions. Subsequently, the unit performs quantile prediction on these residual sequences. This not only provides a single predicted value, but more importantly, it outputs predicted values ​​corresponding to multiple quantiles, such as the 10%, 50%, and 90% quantiles, thus quantifying the range of future uncertainty. Based on these quantile prediction results, the system further constructs a multi-scenario prediction set, such as typical scenarios like high load - low photovoltaic, medium load - medium photovoltaic, and low load - high photovoltaic, representing different possible future operating conditions. To make these scenarios more practical, the unit also calculates scenario weights for each scenario. These weights can be determined based on the matching degree of historical similar days or short-term prediction errors, reflecting the probability of each scenario occurring. Finally, the prediction and scenario generation unit integrates these quantile prediction results, multi-scenario prediction sets, and scenario weights, and outputs them as a prediction set. In this way, the unit can transform raw, uncertain historical data into structured future predictions containing quantified uncertainty information, providing a more comprehensive and robust decision-making basis for subsequent constraint compilation and power allocation solution units. This solves the problem that relying solely on a single prediction value may lead to inaccurate decisions or system instability, especially in photovoltaic power generation and microgrid environments with large load fluctuations, significantly improving the predictability and adaptability of the entire multi-port DC microgrid converter to future operating conditions.

[0153] As a specific implementation method, the prediction and scenario generation unit can operate as follows: First, within a historical sliding time window, such as the past 7 or 30 days, hourly load power sequences and available photovoltaic power sequences are extracted from stored historical data. For detrending and periodic decomposition, the Seasonal-Trend Decomposition using Loess (STL) method can be used to decompose each sequence into trend, seasonal, and residual components. Then, for the obtained residual sequences, a Gradient Boosting Quantile Regression (GBR) model can be used to predict quantiles, outputting predicted values ​​corresponding to the 10%, 50%, and 90% quantiles. Based on these quantile prediction results, for example, the 90% quantile of load and the 10% quantile of photovoltaic power can be combined to form a high load-low photovoltaic scenario, the 50% quantile of load and photovoltaic power can be combined to form a medium load-medium photovoltaic scenario, and the 10% quantile of load and the 90% quantile of photovoltaic power can be combined to form a low load-high photovoltaic scenario, thereby generating a multi-scenario prediction set. Scene weights can be calculated by matching the current date's weather forecast with weather data from similar historical dates. For example, if the current forecast is sunny, historical sunny scenes are given higher weights. Finally, the prediction and scene generation unit packages these quantile prediction data, multi-scene combinations, and their corresponding weights into a prediction set for use by other parts of the system.

[0154] Through the aforementioned technical solution, the prediction and scenario generation unit can effectively extract trend, periodic, and random fluctuation information from historical data, and quantify the uncertainty of future load and photovoltaic power using quantile prediction. This method avoids the bias that may be caused by traditional single prediction values, enabling the system to more comprehensively understand the potential future operating conditions. By generating a set of multi-scenario predictions and assigning scenario weights, the system can transform complex uncertainty problems into manageable discrete decision problems, providing more robust input for subsequent constraint compilation units and power allocation solution units. This significantly enhances the adaptability and decision accuracy of the multi-port DC microgrid converter in the face of photovoltaic power generation and load fluctuations, effectively reducing the system operation risks caused by inaccurate predictions, and improving the efficiency and reliability of energy management.

[0155] In some of the above implementations, the system can estimate the microgrid's operating status and generate a prediction set. However, if there is a lack of comprehensive consideration of the system's operating boundaries and uncertainties, and power allocation is directly based on the prediction results, it may lead to the system exceeding physical limits, equipment damage, or unstable operation.

[0156] To address this, this application further proposes a constraint compilation unit, configured to perform the following sub-steps to generate a feasible domain constraint set: reading the port constraint parameter set and forming hard constraints, including the upper limit of the charging and discharging current of the energy storage battery port, the upper and lower limits of the battery's state of charge (SOC), the upper and lower limits of the DC bus voltage, and the upper limit of the device temperature; constructing opportunity constraints based on the quantile prediction results in the prediction set, including: the probability of the DC bus voltage exceeding the limit does not exceed a threshold under a preset confidence level; constructing slope constraints based on the upper limit of the power change rate, ensuring that the port power change does not exceed a preset value in any control cycle; constructing robust constraints based on the multi-scenario prediction set, including: satisfying the DC bus voltage regulation and energy storage battery port current limits in the high load-low photovoltaic scenario; generating thermal budget constraints based on device temperature and switching current statistics, the thermal budget constraints being used to limit the allowable equivalent switching loss index per unit time from exceeding a threshold; and merging the hard constraints, opportunity constraints, slope constraints, robust constraints, and thermal budget constraints to form a feasible domain constraint set.

[0157] Reading the set of port constraint parameters and forming hard constraints refers to acquiring the physical and safety limitations that the system must strictly adhere to during operation. These parameters can be pre-stored in the system's non-volatile memory and loaded during system startup; alternatively, the system can communicate in real time with an external management system (such as a Battery Management System (BMS) or Energy Management System (EMS)) to dynamically acquire or update these parameters. Hard constraints are insurmountable absolute boundaries, such as the upper limit of charging and discharging current at the energy storage battery port, the upper and lower limits of the battery's State of Charge (SOC), the upper and lower limits of the DC bus voltage, and the upper temperature limit of devices in the power conversion execution unit. These limitations ensure the safe operation and lifespan of the equipment.

[0158] Constructing opportunity constraints based on quantile forecasts from a forecast set refers to setting soft constraints that can be satisfied at a certain confidence level, while considering future uncertainties. Quantile forecasts provide probability distribution information for future load and photovoltaic power. Constructing opportunity constraints can utilize these quantile forecasts to model the distribution of future DC bus voltage using probability density functions or cumulative distribution functions, thereby calculating the probability of DC bus voltage exceeding limits at a specific confidence level (e.g., 95%). Alternatively, Monte Carlo simulations or scenario analysis methods can be used to generate a large number of possible future scenarios based on the quantile forecasts and statistically analyze the proportion of scenarios where the constraints are satisfied. This constraint aims to balance system performance and risk, avoiding sacrificing efficiency due to excessive conservatism.

[0159] Slope constraints based on the upper limit of the power change rate limit refer to restricting the magnitude of power change at each DC port within adjacent control cycles. The purpose of this constraint is to prevent sudden changes in power commands from impacting the power conversion execution unit, protecting hardware devices, and maintaining the dynamic stability of the system. This can be achieved by introducing differential constraint terms into the optimization model to directly limit the absolute change in power commands within adjacent control cycles; or by using a limiting filter to smooth the power command after its generation, ensuring that its rate of change remains within the allowable range.

[0160] Robust constraints based on multi-scenario prediction ensembles ensure stable system operation even under the most unfavorable predicted scenarios. Multi-scenario prediction ensembles provide various possible future operating conditions, such as extreme cases like high load versus low photovoltaic load. Robust constraints can identify these most challenging scenarios and impose additional restrictions on key operating parameters (such as DC bus voltage and energy storage battery port current) under these scenarios; alternatively, by introducing additional penalty terms or stricter boundary conditions into the power allocation optimization problem, they ensure that the system meets core voltage regulation and current limiting requirements even under extreme conditions, thereby enhancing the system's disturbance rejection capability.

[0161] Thermal budget constraints based on device temperature and switching current statistics limit the losses of switching devices in power conversion execution units to prevent overheating damage and extend device lifespan. These constraints can be generated by estimating the equivalent switching losses per unit time based on the switching device model, heat dissipation conditions, and real-time monitored device temperature, combined with switching frequency and current statistics. Alternatively, a thermal model of the device can be established to predict the device junction temperature in real time and set a maximum allowable equivalent switching loss threshold, which is then used as a constraint during power allocation to prevent devices from operating in an overheated state for extended periods.

[0162] Merging hard constraints, chance constraints, slope constraints, robust constraints, and thermal budget constraints into a feasible region constraint set means integrating all the aforementioned constraints of different natures into a unified mathematical model. These constraints can be expressed in the form of mathematical inequalities or systems of equations, collectively defining the decision space of the subsequent power allocation solution unit.

[0163] This application's solution utilizes the current microgrid operating state, port constraint parameter set, and future prediction set provided by the port state acquisition unit, data normalization and framing unit, state estimation unit, and prediction and scenario generation unit. The constraint compilation unit first transforms the port constraint parameter set into hard constraints that must be strictly adhered to, ensuring the system operates within a safe range. To address the uncertainty of predictions, it constructs opportunity constraints using quantile prediction results, allowing operation at an acceptable risk level, thereby improving system flexibility while ensuring stability. Simultaneously, slope constraints limit the power change rate, avoiding the impact of drastic power command fluctuations on the hardware. Furthermore, for extreme operating conditions, robust constraints utilize a multi-scenario prediction set to ensure that the system still meets critical voltage regulation and current limiting requirements under the most unfavorable scenarios, enhancing system resilience. In addition, thermal budget constraints consider the physical limitations of the power conversion execution unit, protecting devices by limiting equivalent switching losses. Finally, all these constraints of different natures are integrated into a comprehensive feasible domain constraint set, providing a safe and flexible decision space for the subsequent power allocation solution unit, effectively addressing the challenge of stable microgrid operation in dynamic and uncertain environments.

[0164] The following is a concrete example to illustrate this. Suppose that within a certain control cycle, the constraint compilation unit needs to generate a feasible region constraint set for the power allocation solver. First, it reads hard constraints from the system configuration, such as the maximum charging current of the energy storage battery port being 50A and the maximum discharging current being 80A; the battery state of charge (SOC) range being 20% ​​to 90%; the DC bus voltage range being 48V to 54V; and the upper limit of the device temperature for the power conversion execution unit being 120°C. Next, based on the quantile prediction results in the prediction set, opportunistic constraints are constructed. For example, if the prediction shows that there is a 10% probability that the DC bus voltage will fall below 48V in the future, and the system's preset confidence level requires that the voltage exceedance probability not exceed 5%, then the opportunistic constraint will require the power allocation scheme to be adjusted to reduce the probability of voltage exceedance, for example, by increasing the discharge priority of the energy storage battery or reducing the DC load power. Simultaneously, slope constraints are constructed. For example, the upper limit of the power change rate at the energy storage battery port is set at 10kW / s. This means that if the energy storage battery discharge power in the previous cycle was 20kW, then its discharge power in this cycle cannot exceed 30kW, and its charging power cannot be lower than 10kW. Furthermore, robust constraints are constructed based on a multi-scenario prediction set. For example, in the extreme scenario of "high load - low PV," robust constraints may require the energy storage battery port to maintain a discharge capacity of at least 20kW to keep the DC bus voltage above 50V. Finally, based on the current device temperature and historical switching current statistics, thermal budget constraints are generated, and the maximum allowable equivalent switching loss within the current control cycle is calculated as a preset value. When solving for power allocation, it must be ensured that the allocated power does not cause the switching loss to exceed this preset value. These hard constraints, opportunity constraints, slope constraints, robust constraints, and thermal budget constraints are combined to form a comprehensive set of feasible region constraints, providing a clear and comprehensive decision boundary for the power allocation solution unit.

[0165] Through the above technical solutions, this application significantly enhances the safety, stability, and reliability of microgrid operation by introducing multi-dimensional and multi-type constraints, including hard constraints, opportunity constraints, slope constraints, robust constraints, and thermal budget constraints. Hard constraints ensure that the system does not exceed physical and safety limits, effectively preventing equipment damage. Opportunity constraints provide necessary flexibility while considering uncertainty, avoiding overly conservative power allocation and thus improving energy utilization efficiency. Slope constraints effectively suppress abrupt changes in power commands, protecting the power conversion execution unit. Robust constraints enable the system to maintain critical performance even in extreme prediction scenarios, significantly improving the system's resilience. Thermal budget constraints guarantee the long-term stable operation and lifespan of the system at the device level. The comprehensive compilation of these constraints enables the power allocation solution unit to make decisions that satisfy voltage regulation targets and energy consumption strategies while strictly adhering to various operational limitations in complex and ever-changing environments, thereby effectively solving the challenge of stable microgrid operation in dynamic and uncertain environments and optimizing system performance.

[0166] In other embodiments, this application proposes a multi-port DC-DC microgrid converter for building energy management. This converter can synchronously sample the voltage, current, and temperature of the DC ports, normalize and frame multi-source data, construct a microgrid operating state vector based on the state data frames, generate a prediction set within a prediction window, and finally generate a feasible domain constraint set within a control window based on the port constraint parameter set and the prediction set. However, in actual operation, the initial port power command set calculated directly from the operating state and prediction information may not fully meet the complex and ever-changing operating constraints, leading to system instability or low efficiency.

[0167] In response, this application further proposes a power allocation solution unit, which includes a feasibility repair module and an optimization solution module, and is configured to perform the following sub-steps: calculate the net power demand of the DC bus based on the operating state vector and the prediction set, and generate an initial port power candidate instruction set; substitute the initial port power candidate instruction set into the feasible region constraint set for constraint checking to obtain a constraint violation vector; when the constraint violation vector is non-zero, trigger the feasibility repair module to perform repair according to a preset priority, the priority including reducing interruptible load power over limiting energy storage battery port discharge, limiting energy storage battery port discharge over reducing critical load power, and generate a first repair power instruction set; during the repair process, apply current limiting and power ramp to the energy storage battery port power so that the energy storage battery port current change rate does not exceed a threshold; when the first repair power instruction set satisfies the feasible region constraint set, trigger the optimization solution module to perform secondary optimization with DC bus voltage deviation cost, battery degradation cost and photovoltaic curtailment cost as objective functions, and output a target power instruction set; write the target power instruction set into the drive control sequence to generate the link.

[0168] The power allocation solution unit is the core decision-making component of the entire microgrid energy management system. Its function is to calculate the power command for each DC port (such as the photovoltaic port, energy storage battery port, and DC load port) in the next control cycle based on the microgrid's current operating status, future forecasts, and preset operating constraints. This unit ensures the stable, efficient, and safe operation of the microgrid. This unit can be implemented using a high-performance digital signal processor (DSP) or an embedded controller, such as TI's C2000 series DSP or NXP's ARM Cortex-M series microcontroller.

[0169] The feasibility repair module is a key component of the power allocation solution unit. Its main function is to adjust the power commands according to preset priority rules when the initial power allocation scheme does not meet preset constraints, so as to satisfy all constraints and thus ensure the safe and stable operation of the system. This module can be implemented using rule-based expert systems or finite state machine logic, for example, by using a series of if-then rules to judge and execute repair actions.

[0170] The optimization solution module is another important component of the power allocation solution unit. Based on the power command satisfying all constraints, it further uses optimization algorithms to find the optimal power allocation scheme. This module aims to improve the overall system performance, such as reducing operating costs, extending equipment lifespan, or improving energy efficiency. This module can be implemented using convex optimization algorithms, such as a quadratic programming (QP) solver, or optimization algorithms based on model predictive control (MPC).

[0171] The process of calculating the net power demand of the DC bus based on the operating state vector and the prediction set, and generating an initial set of candidate power commands for the ports, marks the starting point for power allocation. The operating state vector provides real-time information about the microgrid, such as the battery state of charge (SOC), the equivalent load power of the DC bus, and the upper limit of available photovoltaic (PV) power. The prediction set provides the expected changes in load and PV power over a future period. By combining this information, the total power required by the DC bus in the next control cycle can be preliminarily estimated, and a preliminary, unconstrained power allocation scheme for each DC port can be generated accordingly. For example, the available PV power can be simply used as the primary power source, with any shortfall supplemented by the energy storage battery port and any excess absorbed by the energy storage battery port, while still meeting the power demands of the DC load ports.

[0172] Substituting the initial set of candidate port power commands into the feasible region constraint set for constraint checking yields a constraint violation vector. This step aims to evaluate the compliance of the initial power allocation scheme. The feasible region constraint set contains all operational constraints that must be met, such as port current, voltage, temperature limits, and the upper and lower limits of the battery's state of charge (SOC). By comparing the initial power commands with these constraints, it is possible to identify which constraints are violated and quantify the degree of violation, forming a constraint violation vector. For example, if the charging current at the energy storage battery port exceeds the upper limit, the corresponding component in the constraint violation vector will show a positive value.

[0173] When a constraint violation vector is non-zero, the feasibility repair module is triggered to perform repairs according to a preset priority and generate a first set of repair power instructions. This step is crucial for handling non-compliant initial solutions. The preset priority mechanism ensures that the system can make trade-offs according to a predetermined strategy when resources are limited or conflicting. For example, when system power is insufficient, interruptible load power is reduced first to ensure power supply to critical loads; when the discharge capacity of the energy storage battery port is limited, the power of critical loads is then considered for reduction. This hierarchical repair strategy avoids blind adjustments, improving repair efficiency and system robustness. The repair process can be an iterative process, adjusting the power of one or more ports each time until all constraints are satisfied.

[0174] During the repair process, current limiting and power ramping are applied to the power at the energy storage battery port to ensure that the rate of change of the battery port current does not exceed a threshold. This measure is to protect the energy storage battery and extend its service life. Energy storage batteries are highly sensitive to transient changes in charging and discharging current. Excessive current or a too-rapid rate of change of current may lead to battery overheating, accelerated degradation, or even safety issues. By applying current limiting, the battery current is ensured not to exceed its physical limits; by controlling the power ramp, the rate of change of battery power is limited, thereby smoothing the battery's charging and discharging process and improving the battery's operational reliability and lifespan. For example, a maximum power change per second can be set so that the change in battery power within adjacent control cycles does not exceed this value.

[0175] When the first set of repair power commands satisfies the feasible region constraints, the optimization solution module is triggered to perform secondary optimization with DC bus voltage deviation cost, battery degradation cost, and photovoltaic curtailment cost as objective functions, outputting the target power command set. This step further improves the system's economic efficiency and effectiveness while ensuring feasibility. By introducing the DC bus voltage deviation cost, the system can maintain the stability of the DC bus voltage; by introducing the battery degradation cost, the system can be guided to reduce excessive or improper use of batteries, thereby extending battery life; by introducing the photovoltaic curtailment cost, the system can be encouraged to maximize the utilization of photovoltaic power generation and reduce energy waste. Secondary optimization can comprehensively consider these objectives and find an optimal power allocation scheme while satisfying all constraints.

[0176] The target power command set is written into the drive control sequence generation link, which is the final output of the power allocation solution unit. After feasibility repair and secondary optimization, the target power command set contains the precise power values ​​that each DC port should execute in the next control cycle. These commands are then passed to the modulation parameter generation unit to generate specific drive control sequences to control the power conversion execution unit to achieve energy transfer.

[0177] This application's solution effectively addresses the issue of initial power allocation schemes potentially failing to meet constraints in complex and variable microgrid environments by decomposing the power allocation process into two stages: feasibility repair and secondary optimization. First, constraint checking and priority repair mechanisms ensure that any generated power command set strictly conforms to system operating limits, preventing system instability or equipment damage due to constraint violations. Second, based on feasibility, multi-objective secondary optimization is introduced, comprehensively considering key performance indicators such as DC bus voltage regulation, battery life, and photovoltaic utilization rate, thereby maximizing system economic benefits and energy efficiency while ensuring safe operation. For example, when photovoltaic power generation is sufficient and the load is low, the system prioritizes storing excess photovoltaic power in energy storage batteries instead of directly discarding it, while ensuring that the battery charging current does not exceed the limit and maintaining DC bus voltage stability. When the load suddenly increases, the system can quickly obtain power from the energy storage battery port for supplementation, but will smooth the battery discharge process through power ramp control to avoid impacting the battery, and prioritize reducing non-critical loads to ensure core power supply. This phased, multi-objective decision-making mechanism enables microgrid converters to manage energy more intelligently and robustly during dynamic operation.

[0178] The following is a concrete example to illustrate this. The power allocation solution unit can be integrated onto a high-performance industrial-grade controller, such as the Infineon AURIX series microcontroller. This microcontroller possesses powerful floating-point arithmetic capabilities, sufficient to support complex optimization algorithms. The feasibility repair module can be implemented as a software module based on lookup tables and state machines, where preset priority rules are encoded into a series of conditional judgment statements. For example, when the DC bus voltage is detected to be below the lower limit, the system first checks if any interruptible load is running. If so, it immediately sends a command to reduce the load power; if not, it checks if the energy storage battery port is in a discharging state with sufficient capacity. If so, it increases the discharge power of the energy storage battery port, but simultaneously uses a digital filter to ramp up the power command of the energy storage battery port to ensure that its rate of change does not exceed a preset threshold of 10 kW / s. The optimization solution module can call an embedded quadratic programming solver library, such as OSQP (Proximal Operator based Quadratic Programming Solver). This solver can use the square of the DC bus voltage deviation, the absolute value of the battery charging and discharging energy (as an approximate cost of battery degradation), and the linear term of the photovoltaic curtailment power as objective functions. Under the premise of satisfying all hard constraints, chance constraints, slope constraints, robust constraints, and thermal budget constraints, it can quickly calculate the optimal power commands for each DC port. Finally, these optimized power commands are sent to the modulation parameter generation unit via a high-speed serial communication interface (such as SPI or CAN).

[0179] Through the above technical solutions, the power allocation solution unit of this application can effectively cope with various uncertainties and constraints in microgrid operation, ensuring the real-time feasibility and optimality of the power allocation scheme. This not only significantly improves the operational stability, reliability, and security of DC microgrids, avoiding equipment damage or system collapse caused by improper power allocation, but also effectively reduces operating costs, extends the service life of energy storage batteries, and maximizes the utilization efficiency of renewable energy through refined multi-objective optimization, thereby achieving a dual improvement in the economic and environmental benefits of building energy management systems.

[0180] In some embodiments described above in this application, the power allocation solving unit obtains the target power command set for each DC port within each control cycle, using the DC bus voltage stabilization target and building energy consumption strategy as objective functions and satisfying the feasible region constraint set. However, when converting these high-level target power commands into actually executable low-level modulation control quantities, direct and accurate mapping of power commands to modulation control quantities is challenging due to the inherent nonlinear characteristics of power electronic converters and the dynamic changes in the microgrid operating environment. This may lead to decreased control accuracy, system response lag, or unnecessary circulating current impacts, thereby affecting the stability of the DC bus and the reliability of converter devices.

[0181] To address this, this application further proposes that the modulation parameter generation unit be configured to perform the following sub-steps to map the target power command set to a modulation control quantity set: establishing a local linearization model between port power and modulation control quantity, the local linearization model including the gain coefficient of power with respect to phase shift angle or the gain coefficient of power with respect to duty cycle; updating the gain coefficient based on the port voltage ratio and the actual power feedback of the previous control cycle in each control cycle, the update including recursive least squares identification or gain table lookup correction; calculating a first modulation control quantity set that satisfies the target power command set according to the updated gain coefficient, and applying a limiting to the first modulation control quantity set; applying a slope limit to the first modulation control quantity set to form a second modulation control quantity set to suppress the circulating current impact caused by the sudden change in modulation quantity; and generating a drive control sequence by combining the second modulation control quantity set with the dead time parameter.

[0182] The local linearization model aims to approximate the complex nonlinear power transfer characteristics as a linear relationship near a specific operating point, thereby simplifying controller design and implementation. This model can be obtained by performing a Taylor series expansion of the converter's power transfer equations and retaining the first-order terms, or through small-signal modeling methods. For example, for a phase-shifted full-bridge converter, there is a nonlinear relationship between power and phase shift angle; the local linearization model can approximate this as the power gain coefficient with respect to the phase shift angle. A similar relationship exists between power and duty cycle controlled converters such as Buck-Boost converters; the local linearization model can approximate this as the power gain coefficient with respect to the duty cycle.

[0183] The purpose of updating the gain coefficient is to enable the locally linearized model to adapt to changes in the microgrid's operating conditions and maintain mapping accuracy. Since factors such as the converter's operating point, input and output voltages, and load characteristics change dynamically, a fixed gain coefficient cannot guarantee accuracy under all operating conditions. The gain coefficient can be updated using a recursive least squares identification method, estimating and correcting model parameters online using real-time collected port voltage ratios and actual power feedback data. Another update method is gain table lookup correction, where a gain coefficient lookup table for different operating conditions is pre-established through simulation or experimentation. During runtime, the initial gain is obtained by looking up the table based on the current operating condition, and then fine-tuned using actual power feedback.

[0184] The calculation of the first set of modulation control quantities is based on the updated gain coefficient, directly converting the target power command into the corresponding modulation control quantity. For example, if the target power is P_target and the gain coefficient is K, the corresponding modulation control quantity (such as phase shift angle or duty cycle) can be calculated using modulation control quantity = P_target / K. Applying a limit to the calculated first set of modulation control quantities ensures that the modulation control quantity remains within the physical limits allowed by the converter hardware, avoiding overmodulation or undermodulation, thereby protecting the power devices and maintaining the normal operation of the converter. The limit value is typically determined by the converter's design parameters and safety margin.

[0185] Applying a slope limit to the first set of modulation control variables to form the second set of modulation control variables is to prevent drastic changes in the modulation control variables between adjacent control cycles. Sudden changes in the modulation variables can cause transient surges in the converter's output current or voltage, generating large circulating currents and even damaging power devices. Slope limiting, by limiting the maximum rate of change of the modulation variables per unit time, smooths out the change process of the modulation variables, thereby suppressing circulating current surges and improving the stability and reliability of the system.

[0186] The generation of the drive control sequence involves taking a second set of modulated control quantities, limited by amplitude and slope, and combining it with a dead-time parameter to ultimately convert it into a gate drive signal for the power conversion actuator. The dead time is set to prevent shoot-through of the upper and lower transistors in the half-bridge or full-bridge arm, ensuring that one switch can only be turned on after the other has been completely turned off. By feeding the modulated control quantities (such as phase shift angle and duty cycle) along with the dead-time parameter into a PWM (Pulse Width Modulation) generator, a precise gate drive pulse sequence can be generated, thereby controlling the power conversion actuator to perform energy transfer.

[0187] This application's solution establishes a locally linearized model between port power and modulation control quantity, and dynamically updates the gain coefficient based on the port voltage ratio and the actual power feedback from the previous control cycle within each control cycle, achieving a precise and adaptive mapping from the target power command to the modulation control quantity. This adaptive mechanism enables the converter to effectively cope with dynamic changes in microgrid operating conditions, ensuring accurate execution of the power command. Furthermore, by applying a limiting effect to the calculated first modulation control quantity set, over-modulation or under-modulation is effectively avoided, protecting the power devices. Further, applying a slope limit to the first modulation control quantity set to form a second modulation control quantity set significantly suppresses circulating current surges caused by sudden modulation changes, thereby improving the system's dynamic stability and reliability. Finally, the refined second modulation control quantity set, together with the dead-time parameter, generates a drive control sequence, ensuring that the power conversion execution unit can stably and efficiently transfer energy, thus providing a solid foundation for precise power distribution and stable DC bus voltage in the entire multi-port DC microgrid converter.

[0188] The following is a concrete example. Assume the energy storage battery port in a multi-port DC-DC microgrid converter uses a bidirectional DC / DC converter, and its power transfer is related to the duty cycle D. First, a locally linearized model is established between the port power P and the duty cycle D, for example, P = K * D, where K is the gain coefficient. In each control cycle, the modulation parameter generation unit reads the voltage ratio of the energy storage battery port (e.g., the ratio of battery voltage to DC bus voltage) and the actual power feedback of the energy storage battery port from the previous control cycle. Based on this data, a recursive least squares identification algorithm can be used to update the gain coefficient K in real time. For example, the K value is iteratively updated by minimizing the error between the actual power and the model-predicted power. After obtaining the updated K value, the first duty cycle D1 = P_target / K is calculated based on the target power command P_target output by the power allocation solution unit. Subsequently, a limit is applied to D1 to ensure it is between 0.1 and 0.9 (e.g., to avoid extreme duty cycles). Next, to prevent sudden changes in the duty cycle, a slope limit is applied to D1, for example, limiting the change in D within adjacent control cycles to no more than 0.05, thus obtaining the second duty cycle D2. Finally, D2, along with a preset dead time parameter (e.g., 500ns), is fed into the PWM controller to generate the gate drive signal for driving the power transistor of the DC / DC converter at the energy storage battery port.

[0189] Through the above technical solution, the modulation parameter generation unit can accurately and stably map the target power command set output by the power allocation solution unit to the modulation control quantity set of the power conversion execution unit. This adaptive, multi-stage modulation quantity generation process effectively solves the problem of inaccurate mapping between power commands and actual modulation quantities under dynamic operating conditions, significantly suppresses circulating current impacts that may be caused by sudden changes in modulation quantities, thereby improving the control accuracy, dynamic response speed, and operational reliability of the DC microgrid converter, and ensuring the stability of the DC bus voltage and the smoothness of energy transmission at each DC port.

[0190] In some embodiments described above in this application, a method is proposed to map the target power command set to a modulation control quantity set of the power conversion execution unit, and to suppress abrupt changes in modulation quantity by applying amplitude limiting and slope limiting. However, in actual operation, due to dynamic changes in system operating conditions, the switching devices of the power conversion execution unit may be unable to achieve soft switching, thereby increasing switching losses and affecting the efficiency and reliability of the converter.

[0191] In response, this application further proposes that the modulation parameter generation unit be further configured to perform soft-switching feasible window adaptation, which includes the following sub-steps: estimating the peak value and direction of the commutation current based on the port voltage ratio, the equivalent value of the transmission inductance, and the target power command set; calculating the equivalent voltage blanking condition at the moment of turn-on based on the peak value of the commutation current and the output capacitance parameters of the switching device, and obtaining the soft-switching margin index; when the soft-switching margin index is lower than the threshold, prioritizing the adjustment of the dead time to increase the commutation time window; when adjusting the dead time still does not meet the threshold, further applying soft-switching hold correction to the second modulation control quantity set, the soft-switching hold correction including reducing the upper limit of the phase shift amplitude, introducing a phase shift bias, or switching to a standby modulation mode; and synchronously updating the equivalent switching loss index in the thermal budget constraint when the soft-switching hold correction is triggered.

[0192] Adaptive soft-switching feasible window refers to the system's ability to dynamically evaluate and adjust modulation parameters based on the current operating state and target power command, ensuring that the switching devices in the power conversion unit achieve soft-switching operation over the widest possible operating range. The concept lies in proactively optimizing switching conditions through real-time monitoring and prediction, thereby reducing switching losses and improving converter efficiency and reliability. Implementation methods can include model predictive control-based approaches, which optimize modulation strategies by predicting system behavior over a future period; or lookup table-based and real-time correction methods, which make rapid decisions and adjustments based on a pre-established soft-switching condition database.

[0193] The peak value and direction of the commutation current are estimated based on the port voltage ratio, the equivalent value of the transmission inductance, and the target power command set. This aims to obtain key electrical parameters of the power conversion execution unit during the commutation process. The peak value and direction of the commutation current are crucial for determining whether soft switching can be achieved. The estimation method can be based on the equivalent circuit model of the converter, using the port voltage ratio, the equivalent value of the transmission inductance, and the target power command set. For example, for a phase-shifted full-bridge converter, the peak value and direction of the commutation current can be estimated using the phase shift angle, input and output voltages, and transmission inductance; for an LLC resonant converter, they can be estimated using the resonant frequency, gain curve, and target power.

[0194] The equivalent voltage blanking condition at turn-on is calculated based on the peak commutation current and the output capacitance parameters of the switching device, yielding a soft-switching margin index. This step quantifies the ease or margin of soft-switching implementation. The equivalent voltage blanking condition at turn-on refers to the condition under which the voltage across the switching device can be completely or sufficiently reduced to zero (or close to zero) before the switching device is turned on. This is typically related to the charging and discharging capability of the switching device's output capacitance by the commutation current. The soft-switching margin index can be a dimensionless value, for example, obtained by comparing the actual commutation time with the minimum time required to achieve zero-voltage switching (ZVS), or by calculating the ratio of the residual voltage at turn-on to the rated voltage. During calculation, the output capacitance parameters provided in the switching device datasheet can be used, combined with the estimated peak commutation current, to determine the voltage blanking process through integration or simulation.

[0195] When the soft-switching margin is below a threshold, the dead time is adjusted first to increase the commutation time window. When the soft-switching margin indicates poor soft-switching conditions, the system will first attempt to adjust the dead time. Dead time, in a half-bridge or full-bridge topology, refers to the non-conducting time between the upper and lower switches to avoid shoot-through. Increasing the dead time prolongs the commutation process, providing more time for the output capacitors of the switching devices to charge and discharge, thus making voltage blanking easier and increasing the commutation time window. For example, this adjustment can be achieved by software-controlled dead time registers of the PWM generator.

[0196] If adjusting the dead time still fails to meet the threshold, a soft-switching hold correction is further applied to the second modulation control set. This correction includes lowering the upper limit of the phase shift amplitude, introducing a phase shift bias, or switching to a standby modulation mode. If adjusting the dead time alone is insufficient to restore the soft-switching margin, the system will take further corrective measures. Lowering the upper limit of the phase shift amplitude reduces the converter's operating range, allowing it to operate in a region where soft switching is more easily achieved. Introducing a phase shift bias optimizes commutation conditions by adjusting the starting point of the phase shift angle without changing the power command. Switching to a standby modulation mode refers to, in extreme cases, the system switching to a modulation strategy that sacrifices some performance but ensures soft switching or at least reduces hard switching losses. For example, switching from phase-shifted full-bridge mode to PWM mode, or adopting a quasi-resonant mode.

[0197] Synchronously updating the equivalent switching loss parameter in the thermal budget constraint when soft-switching hold correction is triggered ensures that the impact of soft-switching hold correction on the converter's thermal performance is accurately reflected and managed. The equivalent switching loss parameter is a key component of the thermal budget constraint, directly related to device temperature rise and reliability. Switching loss characteristics may change when soft-switching hold correction is applied. Synchronously updating this parameter ensures the effectiveness of the thermal budget constraint, prevents device overheating, and thus maintains the long-term stable operation of the converter.

[0198] In the aforementioned multi-port DC-DC microgrid converter, the modulation parameter generation unit, in the process of mapping the target power command set to the modulation control quantity set of the power conversion execution unit and generating the drive control sequence, introduces a soft-switching feasible window adaptive mechanism to further optimize the converter's operating efficiency and reliability. This mechanism first accurately estimates the peak value and direction of the commutation current of the power conversion execution unit during the commutation process by using real-time acquired port voltage ratios, equivalent transmission inductance values, and the target power command set output by the power allocation solution unit. This estimated current information, combined with the output capacitance parameters of the switching devices, enables the system to calculate the equivalent voltage blanking condition required at the moment the switching devices are turned on, thus obtaining a quantified soft-switching margin index. This index intuitively reflects the ease or difficulty of achieving soft switching under the current operating conditions. When the system detects that the soft-switching margin index is lower than a preset threshold, it indicates that the soft-switching conditions may deteriorate under the current operating conditions. To avoid the high losses and device stress caused by hard switching, the modulation parameter generation unit will prioritize adjusting the dead time. By appropriately increasing the dead time, the commutation time window can be effectively extended, providing more time for the output capacitor of the switching device to charge and discharge, thereby improving the voltage blanking conditions and increasing the probability of soft switching. If adjusting the dead time alone is insufficient to restore the soft switching margin index above the safe threshold, the system will further apply more aggressive soft-switching hold corrections to the second modulation control set. These corrections include, but are not limited to, lowering the upper limit of the phase shift amplitude to limit the converter to operate in a region more conducive to soft switching, introducing a phase shift bias to optimize the commutation point, or switching to a backup modulation mode when necessary to ensure basic soft-switching operation. It is worth noting that when these soft-switching hold corrections are triggered, the system will synchronously update the equivalent switching loss index of the thermal budget constraint in the constraint compilation unit. This synchronous update mechanism ensures that while adjusting the modulation strategy to maintain soft switching, the overall thermal management strategy of the converter can also respond in a timely manner, avoiding the risk of device overheating caused by changes in loss characteristics due to changes in the modulation mode. Through this series of adaptive adjustments, the modulation parameter generation unit can dynamically optimize the switching conditions of the power conversion execution unit, effectively reducing switching losses and improving the overall efficiency and reliability of the converter. Especially in the complex environment of frequent changes in microgrid operating conditions, it can significantly improve the robustness of the system.

[0199] As a specific implementation, the modulation parameter generation unit described above can be implemented using a digital signal processor or a field-programmable gate array (FPGA). When performing soft-switching feasible window adaptation, the processor first obtains real-time port voltage data from the port status acquisition unit, and combines this with preset converter topology parameters and the target power instruction set output by the power allocation solution unit. Using a built-in mathematical model, it estimates the peak value and direction of the commutation current in each switching cycle. Subsequently, the processor consults the output capacitor parameter table of the switching devices stored in memory, and, combined with the estimated peak commutation current, calculates the equivalent voltage blanking condition at the moment of turn-on. For example, it calculates whether the output capacitor can be fully discharged within the dead time. Based on this calculation result, a soft-switching margin index is generated. This index can be a normalized value between 0 and 1, where 1 represents ideal soft switching. When the soft-switching margin index is lower than a preset threshold of 0.8, the processor will preferentially increase the dead time by modifying the dead time register of the PWM generator, for example, increasing the dead time from 500ns to 700ns to increase the commutation time window. If adjusting the dead time still doesn't achieve a soft-switching margin of 0.8, the processor will further apply soft-switching hold corrections to the second set of modulation control variables. For example, if the current modulation mode is a phase-shifted full-bridge, the processor might reduce the upper limit of the phase shift amplitude from 180 degrees to 150 degrees, or introduce a small phase shift bias (e.g., 5 degrees) to optimize commutation conditions. In more extreme cases, if the above corrections are still ineffective, the processor might switch to a quasi-resonant modulation mode, which, while potentially slightly reducing efficiency, ensures soft switching. Each time a soft-switching hold correction is triggered, the processor synchronously sends a signal to the constraint compilation unit, instructing it to update the equivalent switching loss metric in the thermal budget constraints, ensuring the real-time performance and accuracy of the thermal management strategy.

[0200] Through the above technical solution, this application effectively solves the hard-switching problem of switching devices caused by dynamic changes in operating conditions during the operation of multi-port DC microgrid converters. By adaptively adjusting the modulation parameters in real time, it ensures that the switching devices in the power conversion execution unit achieve soft switching within a wider operating range, significantly reducing switching losses and thus improving the overall operating efficiency of the converter. Furthermore, the implementation of soft switching reduces the electrical and thermal stress on the switching devices, extending their lifespan and improving the reliability and stability of the converter. Simultaneously updating the equivalent switching loss index in the thermal budget constraint further optimizes the system's thermal management strategy, avoiding the risk of device overheating due to modulation mode changes, enabling the converter to operate more safely and efficiently in complex and variable microgrid environments.

[0201] In some embodiments described above, this application proposes a multi-port DC-DC microgrid converter for building energy management. Through refined data acquisition, state estimation, prediction, and power allocation solutions, it aims to stabilize the DC bus voltage and optimize building energy consumption strategies. However, in actual operation, microgrid systems may face sudden external disturbances or internal faults, such as sudden changes in photovoltaic power, over-discharge of energy storage batteries, or abnormal DC bus voltage. These events can lead to a sharp decline in system performance or even operational instability. Traditional control cycle-based solutions are insufficient to respond quickly and effectively to such emergencies, thus affecting the system's reliability and security.

[0202] In response, this application further proposes that the closed-loop correction unit be configured to perform event-driven mode switching and parameter backtracking updates, which specifically includes the following sub-steps: determining events on the state data frame, including photovoltaic power drop events, energy storage battery port undervoltage events, DC bus overvoltage events, DC bus undervoltage events, and overtemperature events; freezing the integral term of the DC bus voltage regulator loop and generating a transition control trajectory when the event is triggered, the transition control trajectory at least satisfies the port power slope constraint; selecting the target switching mode according to the event type, including photovoltaic priority power supply mode, energy storage battery supported voltage regulation mode, and current limiting load reduction mode.

[0203] The closed-loop correction unit is a key component of the system's control loop, its function being to adjust and optimize the control strategy based on actual operational feedback. Event-driven control means the system does not rely on fixed time periods but triggers corresponding control actions based on the occurrence of specific events, providing a faster response speed compared to periodic control. Mode switching refers to the system dynamically switching from one control strategy or operating mode to another based on its operating state or external events. Parameter backtracking update means that after an event occurs, the system not only responds immediately but also retrospectively adjusts or optimizes relevant control parameters based on data before and after the event to improve the robustness and accuracy of subsequent operations. Event-driven mode switching and parameter backtracking update can be implemented using state machines, rule-based expert systems, or machine learning models to identify events and implement mode switching logic. Parameter backtracking update can employ adaptive filtering, online identification, or correction algorithms based on historical data analysis.

[0204] Event determination on status data frames aims to ensure the system can promptly identify and respond to critical operational anomalies that may lead to system instability or damage. Event determination refers to judging whether a predefined abnormal situation has occurred by monitoring system operating status data. Status data frames contain status data including port identifiers, control cycle identifiers, and data validity markers, serving as a real-time snapshot of the system's operating status. A photovoltaic power drop event refers to a significant decrease in photovoltaic power generation within a short period, such as due to cloud cover or a malfunction. A battery port undervoltage event refers to a battery port voltage falling below a safe operating threshold, potentially leading to over-discharge. A DC bus overvoltage event refers to a DC bus voltage exceeding the safe upper limit, potentially damaging connected equipment. A DC bus undervoltage event refers to a DC bus voltage falling below the safe lower limit, potentially causing system collapse. An overtemperature event refers to the temperature of critical system components (such as converter power devices and battery packs) exceeding a safe threshold. Event determination can be achieved through methods such as setting thresholds, monitoring rates of change, trend analysis, or based on model prediction errors. For example, a photovoltaic power drop can be determined by comparing the current power with the previous or predicted power; voltage events can be triggered by comparing with preset upper and lower limits.

[0205] Freezing the integral term of the DC bus voltage regulator loop and generating a transitional control trajectory upon event triggering aims to prevent integral saturation of the regulator loop from causing excessive control input or oscillations during emergency events, while ensuring smooth power changes and avoiding shocks. Freezing the integral term of the DC bus voltage regulator loop means pausing or resetting the accumulation of the integral term in the PID controller when an event occurs, to avoid excessive accumulation of the integral term leading to control loss during drastic system changes. Generating a transitional control trajectory means that during mode switching or event response, the system does not directly jump to the new control objective, but instead plans a smooth, constrained path for control input change. Port power slope constraints limit the maximum rate of change of power at each DC port per unit time to avoid power surges causing system shocks or equipment damage. Freezing the integral term can be achieved by setting a flag in the controller. The transitional control trajectory can be generated using linear interpolation, S-curve programming, or a trajectory generation algorithm based on model predictive control (MPC), while incorporating port power slope constraints as an optimization objective or hard constraint into the trajectory generation process.

[0206] The selection of target switching modes based on event type aims to adopt the most appropriate response strategy according to the nature of different events, thereby maximizing system stability and security. Event type refers to the specific abnormal situation identified through event judgment, such as a sudden drop in photovoltaic power or battery undervoltage. The target switching mode refers to a new operating mode preset for a specific event, with specific control logic and priorities. The photovoltaic priority power supply mode prioritizes photovoltaic power to meet load demands when photovoltaic power generation is sufficient but load demand is high, reducing reliance on energy storage batteries. The energy storage battery-supported voltage stabilization mode responds quickly to provide or absorb power to maintain stable bus voltage when DC bus voltage fluctuates or photovoltaic power is insufficient. The current limiting and load reduction mode protects the system by limiting output current or actively reducing non-critical loads when the system faces extreme situations such as overload, overcurrent, or insufficient resources (e.g., extremely low battery power). Mode selection can be achieved through lookup tables, decision trees, or rule-based logic. Each mode has a preset set of specific power allocation strategies, control parameters, and priority rules.

[0207] During normal operation, the multi-port DC-DC microgrid converter of this application synchronously samples multi-source data through the port status acquisition unit. After processing by the data normalization and framing unit, the state estimation unit constructs the operating state vector. The prediction and scenario generation unit generates a prediction set based on historical data and the current state, while the constraint compilation unit generates a feasible region constraint set based on the port constraint parameter set and the prediction set. Under the condition of satisfying these constraints, the power allocation solution unit solves for the target power command set of each DC port using the DC bus voltage stabilization target and building energy consumption strategy as objective functions. The modulation parameter generation unit converts these commands into a set of modulation control quantities for the power conversion execution unit to drive energy transmission. However, to cope with sudden emergency situations that may occur during microgrid operation, this application further introduces a closed-loop correction unit, the core of which lies in realizing event-driven mode switching and parameter backtracking updates. Specifically, the closed-loop correction unit continuously monitors and determines events in real time on the state data frames generated by the data normalization and framing unit. Once a predefined anomaly is identified, such as a sudden drop in photovoltaic power, an undervoltage event at the energy storage battery port, an overvoltage event on the DC bus, or an overtemperature event, the system will immediately trigger a response mechanism. At the moment of event triggering, to avoid integral saturation or control overshoot that might occur in the traditional PID voltage regulator loop under severe disturbances, the closed-loop correction unit freezes the integral term of the DC bus voltage regulator loop. Simultaneously, the system no longer relies entirely on periodic power allocation solutions, but instead quickly selects and switches to a preset switching target mode based on the type of the current event, such as a photovoltaic priority power supply mode, an energy storage battery-supported voltage regulation mode, or a current-limiting load reduction mode. During mode switching, the closed-loop correction unit generates a smooth transition control trajectory that strictly satisfies the port power slope constraint, thereby effectively suppressing the impact of sudden power changes on the system and ensuring a smooth transition to the new operating state. This event-driven rapid response mechanism, combining the freezing of key parameters and the generation of constrained trajectories, significantly improves the system's robustness and safety in emergency situations, compensating for the shortcomings of traditional periodic optimization control in dynamic response.

[0208] The following is a concrete example to illustrate this. Assume that during a certain control cycle, a multi-port DC-DC microgrid converter is operating stably according to the target power command set calculated by the power distribution solution unit. Suddenly, due to a rapid obstruction by a cloud, the power output at the photovoltaic (PV) port drops sharply from 10kW to 1kW in a very short time. At this time, the closed-loop correction unit continuously monitors the status data frames provided by the data normalization and framing unit. When it detects a sharp change in the PV port current and voltage and determines that a PV power drop event has occurred, the closed-loop correction unit immediately triggers a response. First, it freezes the integral term of the DC bus voltage regulator loop to prevent excessive control output due to integral saturation when PV power drops significantly. Next, based on the event type of "PV power drop," the closed-loop correction unit selects to switch the target mode to "energy storage battery-supported voltage regulation mode." In this mode, the system prioritizes instructing the energy storage battery port to quickly release power to compensate for the insufficient PV power and maintain the stability of the DC bus voltage. To avoid the converter being impacted by sudden changes in the power output of the energy storage battery, the closed-loop correction unit generates a transition control trajectory that satisfies the port power slope constraint. For example, it smoothly increases the discharge power of the energy storage battery from 0 to the target supported power at a rate of 1kW per second, rather than abruptly changing it. In this way, the system can quickly and smoothly switch operating strategies in emergency situations such as sudden drops in photovoltaic power, ensuring the stability of the DC bus voltage and the continuous power supply of the system.

[0209] Through the above technical solutions, the multi-port DC microgrid converter of this application significantly enhances the system's ability to cope with sudden emergencies, building upon the existing refined power management. The event-driven mode switching and parameter backtracking update mechanism enables the system to monitor and respond quickly to critical events such as photovoltaic power drop events, energy storage battery port undervoltage events, DC bus overvoltage events, DC bus undervoltage events, and overtemperature events in real time. Upon event triggering, by freezing the integral term of the DC bus voltage regulator loop and generating a transition control trajectory that satisfies the port power slope constraint, the integral saturation, control overshoot, or power surge that may occur under severe disturbances in traditional control strategies are effectively avoided, thus ensuring a smooth transition of the system in emergency situations. Furthermore, by selecting an appropriate switching target mode based on the event type, such as photovoltaic priority power supply mode, energy storage battery-supported voltage regulation mode, or current-limiting load reduction mode, the system can adopt the most optimized and safe response strategy, greatly improving the operational reliability, stability, and security of the microgrid system. This effectively avoids system crashes or equipment damage caused by sudden events, ensuring the continuity and efficiency of building energy management.

[0210] In some embodiments described above, a multi-port DC-DC microgrid converter for building energy management is proposed. This converter achieves refined management and energy transmission of the DC microgrid through the collaborative operation of a port status acquisition unit, a data normalization and framing unit, a state estimation unit, a prediction and scenario generation unit, a constraint compilation unit, a power allocation solution unit, a modulation parameter generation unit, a closed-loop correction unit, and a power conversion execution unit. However, in actual operation, when the system encounters events such as sudden drops in photovoltaic power, undervoltage at the energy storage battery port, overvoltage or undervoltage on the DC bus, or overtemperature, the closed-loop correction unit triggers event-driven mode switching and parameter backtracking updates, and executes a transitional control trajectory to quickly respond to and stabilize the system. During this process, although the system can quickly switch to a new operating mode, due to the suddenness and complexity of the event, the original prediction model parameters and modulation parameters may not be fully adapted to the new operating state. This can lead to certain control deviations or efficiency losses in the recovery phase after the event or in subsequent operation, affecting the long-term stability and optimization performance of the system.

[0211] In response, this application further proposes to record a mode switching log during the execution of the transition control trajectory. The mode switching log includes the event type, trigger time, target power command set before and after the switch and DC bus voltage deviation. Based on the DC bus voltage deviation and port power deviation before and after the mode switch, the error correction parameters of the prediction and scene generation unit are updated or the gain coefficient of the modulation parameter generation unit is updated, and the updated parameters are written into the next control cycle.

[0212] The mode switching log is a system operation data recording mechanism used to capture and store key operating parameters and status information when a mode switching event occurs. This log includes at least the event type, such as a sudden drop in photovoltaic power or undervoltage at the energy storage battery port, to identify the specific reason triggering the switch; the trigger time, accurately recording the exact moment the event occurred for subsequent analysis; the set of target power commands before and after the switch, recording the system's power allocation decisions before and after the switch and reflecting changes in control strategy; and the DC bus voltage deviation, used to evaluate the system's voltage regulation performance during the switchover process. This mode switching log can be stored in non-volatile memory, such as flash memory or EEPROM, or it can be recorded in real time using a dedicated data logging module.

[0213] Updating the error correction parameters of the prediction and scenario generation units refers to adjusting the parameters used to correct prediction errors in the prediction model based on actual observed system operation data. For example, when there is a persistent deviation between the predicted photovoltaic power or load power and the actual value after a certain event, the deviation of DC bus voltage and port power in the mode switching log can be analyzed, and adaptive algorithms (such as recursive least squares or Kalman filtering) can be used to adjust the deviation or gain terms of the prediction model, thereby improving the accuracy of future predictions.

[0214] Updating the gain coefficient of the modulation parameter generation unit refers to optimizing the mapping relationship between the modulation control quantity of the power conversion execution unit and the target power command based on the actual response of the system after mode switching. For example, in the energy storage battery-supported voltage regulation mode, if a deviation is found between the actual power output of the battery port and the target power command, or if the dynamic response of the DC bus voltage is not ideal, the gain coefficient of the power pair phase shift angle or duty cycle in the modulation parameter generation unit can be adjusted by analyzing the data in the mode switching log and using online system identification technology or lookup table correction methods. This ensures that the power command can be more accurately converted into the actual modulation control quantity, thereby improving the accuracy of power transmission and the dynamic performance of the system.

[0215] Writing the updated parameters to the next control cycle means immediately applying the revised and optimized prediction error correction parameters and modulation gain coefficients to subsequent control cycles. This ensures that the system can promptly "learn" from past events and improve its control strategy, avoiding the recurrence of similar control deviations. These parameters can be directly written to the corresponding control registers, memory areas, or configuration tables for use by the prediction and scene generation unit and the modulation parameter generation unit at the beginning of the next control cycle.

[0216] This application's solution records mode-switching logs during the execution of the transition control trajectory and updates the error correction parameters of the prediction and scene generation unit or the gain coefficient of the modulation parameter generation unit based on key data in the logs, forming an effective adaptive learning closed loop. When a photovoltaic power drop event occurs, the closed-loop correction unit triggers a mode switch and records the event type, trigger time, target power command set for each DC port before and after the switch, and DC bus voltage deviation. Subsequently, the system analyzes this log data. For example, if it finds that the photovoltaic power prediction remains high after the event, or that the voltage deviation of the energy storage battery port is large when supporting voltage stabilization, it will adjust the error correction parameters in the prediction and scene generation unit based on this deviation information to improve the prediction accuracy of future photovoltaic power and load power. Simultaneously, if the modulation parameter generation unit fails to accurately convert the target power command into a modulation control quantity in the new operating mode, causing DC bus voltage fluctuations, the system will also update the gain coefficient of the modulation parameter generation unit based on the recorded port power deviation and DC bus voltage deviation, thereby optimizing the response characteristics of the power conversion execution unit. These updated parameters will be applied immediately to the next control cycle, enabling the system to learn from past events and continuously optimize its prediction and control capabilities. This will allow it to more accurately predict the system state, allocate power more precisely, and maintain the DC bus voltage more stably when facing similar future events.

[0217] The following is a concrete example. Suppose that one afternoon, due to sudden cloud cover, the power output of the photovoltaic (PV) power source drops sharply, triggering a PV power drop event. At this time, the closed-loop correction unit determines that it needs to switch from the PV-priority power supply mode to the energy storage battery-supported voltage regulation mode. During the mode switch, the system records a mode switch log in real time, which includes the event type "PV power drop," the specific timestamp of the trigger time, the target power command of the PV power source being high and that of the energy storage battery power source being low before the switch, the target power command of the PV power source being low and that of the energy storage battery power source being high after the switch, and the instantaneous drop and recovery of the DC bus voltage during the switch. After the transition control trajectory is completed, the closed-loop correction unit analyzes this log. For example, it might find that in the minutes following the PV power drop, the prediction and scenario generation unit's forecast of the available PV power is still higher than the actual value, causing the system to underestimate the power demand of the energy storage battery in the initial stage, resulting in a large deviation in the DC bus voltage. Based on this, the closed-loop correction unit utilizes historical data and current deviations to update the error correction parameters related to photovoltaic power prediction in the prediction and scenario generation unit through an adaptive algorithm (e.g., online identification based on least squares). This includes adjusting a deviation term or a scaling factor to more accurately reflect rapid changes in photovoltaic power. Simultaneously, if a persistent deviation is found between the actual output power and the target command when the energy storage battery port provides high power support, or if the dynamic response of the DC bus voltage is unsatisfactory, the closed-loop correction unit also updates the gain coefficient of the energy storage battery port in the modulation parameter generation unit. For example, it recalculates the power gain relative to the phase shift angle based on the actual port voltage, current, and target power command using recursive least squares, ensuring that the power output of the energy storage battery port can more accurately track the command. These updated error correction parameters and gain coefficients are immediately written into the next control cycle, enabling the system to more accurately predict photovoltaic power and more precisely control the charging and discharging of the energy storage battery in subsequent operations, thereby improving the stability and response speed of the entire DC microgrid.

[0218] Through the above technical solution, the DC microgrid converter of this application can achieve adaptive learning and optimization of system parameters. By recording mode switching logs, the system can capture key operating data and make real-time corrections to the prediction model and modulation parameters based on this data. This enables the system to quickly adjust its internal model and control strategy after experiencing sudden events, improving the prediction accuracy of future operating states and the execution accuracy of power commands. This effectively reduces control deviations caused by model mismatch or inaccurate parameters, enhances the robustness and adaptability of the DC microgrid in complex and variable operating environments, and ensures the stability of the DC bus voltage and the efficiency of energy transmission.

[0219] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.

Claims

1. A multi-port DC-DC microgrid converter for building energy management, characterized in that, include: The port status acquisition unit is configured to synchronously sample the voltage, current and temperature of at least three DC ports, including a photovoltaic port, an energy storage battery port and a DC load port. The data normalization and framing unit is configured to align multi-source data obtained by synchronous sampling according to a unified timestamp and generate a status data frame containing port identifier, control cycle identifier and data validity marker. The state estimation unit is configured to construct a microgrid operating state vector based on the state data frame. The operating state vector includes the battery state of charge (SOC), DC bus equivalent load power, photovoltaic available power limit, and a set of port constraint parameters. The prediction and scene generation unit is configured to generate a prediction set within the prediction window based on historical state data frames and the current running state vector. The constraint compilation unit is configured to generate a set of feasible domain constraints within the control window based on the set of port constraint parameters and the prediction set. The power allocation solution unit is configured to use the DC bus voltage stabilization target and building energy consumption strategy as objective functions in each control cycle, and to solve for the target power command set of each DC port under the condition of satisfying the feasible domain constraint set. The modulation parameter generation unit is configured to map the target power command set to a modulation control quantity set of the power conversion execution unit and generate a drive control sequence; The closed-loop correction unit is configured to update the parameters of the power allocation solving unit or the modulation parameter generation unit based on the state data frame of the next control cycle. The power conversion execution unit is configured to perform bidirectional or unidirectional energy transfer between the photovoltaic port, the energy storage battery port and the DC load port under the action of the drive control sequence.

2. The multi-port DC-DC microgrid converter according to claim 1, characterized in that, The data normalization and framing unit is configured to perform the following sub-steps: The local sampling time of the sampled data from each DC port is read and converted into the system's unified clock to obtain a unified timestamp; The data of each DC port is resampled according to the control cycle, so that the port voltage, port current and port temperature fields corresponding to the same frame number are formed in each control cycle. Perform validity checks on each field, including range checks, rate of change checks, and sign consistency checks, and generate the data validity tags. A confidence factor is calculated for the data that passes the validity check. The confidence factor is related to the estimated sampling noise, the missing rate, and the number of verification failures. When the data validity is marked as invalid or the confidence factor is below the threshold, missing data completion is performed on the corresponding field. The missing data completion includes zero-order preservation, linear interpolation, or substitution based on the predicted value of the previous control cycle, and the completion mark and the confidence factor are written into the state data frame.

3. The multi-port DC-DC microgrid converter according to claim 2, characterized in that, The state estimation unit is configured to perform the following sub-steps to generate the operating state vector: The first battery state of charge (SOC) estimate is obtained by performing coulomb integration on the battery charge based on the energy storage battery port current. When the preset static conditions or low current conditions are met, the estimated value of the first battery's state of charge (SOC) is corrected based on the energy storage battery port voltage and open circuit voltage-state of charge mapping table to obtain the estimated value of the second battery's state of charge (SOC). The estimated state of charge (SOC) of the second battery is jointly filtered with the port voltage and port current of the energy storage battery. The joint filtering includes extended Kalman filtering or unscented Kalman filtering, and the final estimated state of charge (SOC) of the battery and its confidence interval are output. The equivalent load power of the DC bus is calculated based on the DC bus voltage and the DC load port current, and the equivalent impedance of the DC bus is estimated based on the DC bus voltage disturbance and current response. The current available photovoltaic power is calculated based on the photovoltaic port voltage and photovoltaic port current, and the upper limit of available photovoltaic power is generated according to the preset maximum power point tracking upper limit. The final estimated state of charge (SOC) of the battery, the equivalent load power of the DC bus, the equivalent impedance of the DC bus, the upper limit of the available photovoltaic power, and the set of port constraint parameters are concatenated to form the operating state vector.

4. The multi-port DC-DC microgrid converter according to claim 3, characterized in that, The prediction and scene generation unit is configured to perform the following sub-steps to generate the prediction set: The load power sequence and photovoltaic available power sequence are extracted within the historical sliding time window, and then detrended and periodically decomposed to obtain the residual sequence. Quantile prediction is performed on the residual sequence, and the predicted values ​​corresponding to the first quantile, the second quantile, and the third quantile are output, where the first quantile, the second quantile, and the third quantile correspond to 10%, 50%, and 90%, respectively. Based on the quantile prediction results, a multi-scenario prediction set is generated, which includes scenario combinations of high load-low PV, medium load-medium PV, and low load-high PV. Calculate a scenario weight for each scenario in the multi-scenario prediction set, the scenario weight being related to the historical similarity day matching degree or short-term prediction error; The output includes the quantile prediction results, the multi-scene prediction set, and the prediction set of the scene weights.

5. The multi-port DC-DC microgrid converter according to claim 4, characterized in that, The constraint compilation unit is configured to perform the following sub-steps to generate the feasible domain constraint set: Read the set of port constraint parameters and form hard constraints. The hard constraints include the upper limit of the charging and discharging current of the energy storage battery port, the upper and lower limits of the battery state of charge (SOC), the upper and lower limits of the DC bus voltage, and the upper limit of the device temperature. Opportunity constraints are constructed based on the quantile prediction results in the prediction set, and the opportunity constraints include: the probability of DC bus voltage exceeding the limit does not exceed a threshold under a preset confidence level; Slope constraints are constructed based on the upper limit of the power change rate. Robust constraints are constructed based on the multi-scenario prediction set. The robust constraints include: satisfying the DC bus voltage regulation and energy storage battery port current limit under the high load-low photovoltaic scenario. Thermal budget constraints are generated based on device temperature and switching current statistics. These thermal budget constraints are used to limit the allowable equivalent switching loss index per unit time to not exceed a threshold. The hard constraints, chance constraints, slope constraints, robust constraints, and thermal budget constraints are combined to form the feasible region constraint set.

6. The multi-port DC-DC microgrid converter according to claim 5, characterized in that, The power allocation solution unit includes a feasibility repair module and an optimization solution module, and is configured to perform the following sub-steps: The net power requirement of the DC bus is calculated based on the operating state vector and the prediction set, and an initial port power candidate instruction set is generated. Substitute the initial port power candidate instruction set into the feasible region constraint set for constraint checking to obtain the constraint violation vector; When the constraint violation vector is non-zero, the feasibility repair module is triggered to perform repair according to a preset priority. The priority includes reducing interruptible load power over limiting energy storage battery port discharge, limiting energy storage battery port discharge over reducing critical load power, and generating a first repair power instruction set. During the repair process, current limiting and power ramp are applied to the power at the energy storage battery port to ensure that the rate of change of the energy storage battery port current does not exceed the threshold. When the first set of repair power commands satisfies the set of feasible domain constraints, the optimization solution module is triggered to perform secondary optimization with DC bus voltage deviation cost, battery degradation cost and photovoltaic curtailment cost as objective functions, and outputs the target power command set. The target power command set is written into the drive control sequence to generate the link.

7. The multi-port DC-DC microgrid converter according to claim 6, characterized in that, The modulation parameter generation unit is configured to perform the following sub-steps to map the target power command set to the modulation control quantity set: A local linearization model is established between port power and modulation control quantity. The local linearization model includes the gain coefficient of power with respect to phase shift angle or the gain coefficient of power with respect to duty cycle. In each control cycle, the gain coefficient is updated based on the port voltage ratio and the actual power feedback of the previous control cycle. The update includes recursive least squares identification or gain table lookup correction. Calculate a first set of modulation control quantities that satisfies the target power command set based on the updated gain coefficient, and apply a limiting effect to the first set of modulation control quantities; A slope limit is applied to the first set of modulation control quantities to form a second set of modulation control quantities; The drive control sequence is generated based on the second set of modulation control quantities and the dead time parameter.

8. The multi-port DC-DC microgrid converter according to claim 7, characterized in that, The modulation parameter generation unit is further configured to perform soft-switching feasible window adaptation, which includes the following sub-steps: The peak value and direction of the commutation current are estimated based on the port voltage ratio, the equivalent value of the transmission inductance, and the target power command set. Based on the peak commutation current and the output capacitor parameters of the switching device, the equivalent voltage blanking condition at the moment of turn-on is calculated, and the soft-switching margin index is obtained. When the soft switching margin index is lower than the threshold, the dead time is adjusted first to increase the commutation time window. When adjusting the dead time still does not meet the threshold, a soft-switching hold correction is further applied to the second modulation control set. The soft-switching hold correction includes reducing the upper limit of the phase shift amplitude, introducing a phase shift bias, or switching to a standby modulation mode. The equivalent switching loss index in the thermal budget constraint is updated synchronously when the soft switch hold correction is triggered.

9. The multi-port DC-DC microgrid converter according to claim 8, characterized in that, The closed-loop correction unit is configured to perform event-driven mode switching and parameter backtracking updates, and includes the following sub-steps: The status data frame is used to determine events, including photovoltaic power drop events, energy storage battery port undervoltage events, DC bus overvoltage events, DC bus undervoltage events, and overtemperature events. When an event is triggered, the integral term of the DC bus voltage regulator loop is frozen and a transition control trajectory is generated, which satisfies the port power slope constraint. The target mode is selected based on the event type. The target mode includes photovoltaic priority power supply mode, energy storage battery voltage stabilization mode and current limiting load reduction mode.

10. The multi-port DC-DC microgrid converter according to claim 9, characterized in that, During the execution of the transition control trajectory, a mode switching log is recorded, which includes the event type, trigger time, target power command set before and after the switch, and DC bus voltage deviation. The error correction parameters of the prediction and scene generation unit or the gain coefficient of the modulation parameter generation unit are updated based on the DC bus voltage deviation and port power deviation before and after mode switching, and the updated parameters are written into the next control cycle.