A solar energy and power grid collaborative power supply control method for an intelligent cabinet
By dynamically adjusting the switching threshold based on the energy supply trend index and environmental condition deviation, the problem that fixed thresholds in existing technologies cannot adapt to changes in sunlight has been solved, thus achieving efficient utilization of solar energy resources and extending battery life.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- WUHAN HAHA BIANLI TECH CO LTD
- Filing Date
- 2026-02-03
- Publication Date
- 2026-05-08
AI Technical Summary
Existing methods for coordinating solar energy and grid power supply control rely on fixed thresholds and cannot detect changes in sunlight in real time, resulting in low utilization of clean energy or excessive battery discharge and shortened battery life.
By collecting photovoltaic input power, load power consumption, battery surface temperature, and battery state of charge, the energy supply trend index and environmental condition deviation are calculated, and the switching threshold is dynamically adjusted to achieve intelligent power supply mode switching.
While ensuring the reliability of power supply, we will maximize the use of solar energy resources, extend battery life, and avoid excessive battery discharge.
Smart Images

Figure CN121618658B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology. More specifically, this invention relates to a method for coordinated solar and grid power supply control for smart cabinets. Background Technology
[0002] With the rapid development and widespread adoption of IoT technology, a massive number of outdoor smart terminal devices have been deployed in fields such as smart cities and environmental monitoring. To reduce the expensive cost of laying power lines and to respond to the global call for green energy and low-carbon environmental protection, these outdoor smart cabinets typically employ independent power supply systems. Currently, the mainstream power supply architecture uses a hybrid power supply mode with "solar photovoltaic + battery" as the primary source and the mains power grid as a supplement. Its core operating logic is: based on real-time data collection, it monitors the battery's charge status and switches to mains power when it cannot meet load demands, ensuring uninterrupted 24 / 7 operation of the equipment.
[0003] However, existing collaborative power supply control methods have significant technical limitations. First, the control strategies are too rigid. Most existing technologies use fixed threshold judgment logic, such as switching to grid power when the battery's remaining SOC is below 20% and switching back to photovoltaic power when it is above 80%. This static strategy cannot perceive dynamic changes in the external environment. For example, in the early morning, although the battery SOC is low (e.g., 19%), the sunlight intensity is rapidly increasing, and energy replenishment is imminent. If the grid power is switched to simply because the SOC is below the fixed threshold, the utilization rate of clean energy will be reduced. In harsh environments with continuously deteriorating sunlight, the actual usable capacity of the battery will shrink significantly. If the fixed threshold (e.g., 20%) at room temperature is still used for switching judgment, it is very easy to cause the battery to over-discharge, resulting in irreversible chemical damage and severely shortening the battery's lifespan. Summary of the Invention
[0004] To address the technical problem that fixed-threshold power supply switching strategies cannot detect changes in sunlight in real time, leading to the misuse of mains power and waste of clean energy during periods of increased sunlight, while delayed switching during periods of decreased sunlight results in battery over-discharge and accelerated battery lifespan degradation, this invention proposes a solar and grid coordinated power supply control method for smart cabinets. This method includes the following steps:
[0005] Collect photovoltaic input power, load power consumption, battery surface temperature, and battery state of charge at each moment;
[0006] Obtain the historical window for the current moment; obtain the slope of the change in battery state of charge at the current moment; based on the difference between photovoltaic input power and load power consumption at each moment in the historical window for the current moment and the slope of the change in battery state of charge, obtain the energy supply trend index for the current moment; based on the difference between battery surface temperature and preset reference temperature, obtain the environmental condition deviation for the current moment.
[0007] Based on the deviation between the energy supply trend index and environmental conditions, the dynamic switching threshold at the current moment is obtained; the dynamic switching threshold at the current moment is compared with the battery state of charge at the current moment, and the system switches the power supply mode.
[0008] The innovation of this invention lies in the introduction of dynamic analysis of the energy supply trend index and the deviation of environmental conditions to obtain a dynamic switching threshold. This allows the system to no longer rely on fixed parameters. When the light data is good and the environmental data is stable, the system can automatically lower the fixed threshold to obtain a dynamic switching threshold and make full use of solar photovoltaic power. In harsh environments, the system automatically raises the fixed threshold and switches to the grid power supply in advance, which allows the system to trigger the battery protection mechanism in advance and avoid over-discharge of the battery.
[0009] Preferably, obtaining the historical window at the current moment includes:
[0010] The number of historical moments is preset to N. The window consisting of the current moment and the N moments before it is used as the historical window of the current moment.
[0011] Preferably, obtaining the slope of the change in the battery state of charge at the current moment includes:
[0012] The series of battery states of charge (SOCs) at all times in the historical window at the current time is taken as the battery SOC sequence at the current time. The least squares method is used to perform a linear fit on the battery SOC sequence at the current time, and the slope of the fitted line is taken as the slope of the change in battery SOC at the current time.
[0013] Preferably, obtaining the energy supply trend index at the current moment includes:
[0014] ;
[0015] In the formula, An index representing the current energy supply trend; Represents the photovoltaic input power at the i-th moment in the historical window at the current moment; This represents the load power consumption at the i-th time point in the historical window at the current time. The number of times in the history window representing the current moment; This represents the reference value for the maximum power of the equipment; The slope representing the change in the battery's state of charge at the current moment; Represents the current power gain weight; The weight represents the rate of change of electricity.
[0016] It can capture trends of rising energy supply, such as the net energy increase at sunrise.
[0017] Preferably, obtaining the environmental condition deviation at the current moment includes:
[0018] ;
[0019] In the formula, This represents the deviation of the environmental operating conditions at the current moment; This represents the current battery surface temperature. Represents the preset reference temperature; exp() represents an exponential function with the natural constant as the base. This represents the standard deviation of the preset temperature distribution.
[0020] It can identify risky environments such as high or low temperatures that affect battery performance, making it easier to adjust the dynamic switching threshold in the future.
[0021] Preferably, obtaining the dynamic switching threshold at the current moment includes:
[0022] ;
[0023] In the formula, The dynamic switching threshold represents the current moment; A fixed threshold representing the state of charge of the battery; This represents the adjustment range of a fixed threshold. An index representing the current energy supply trend; Represents the deviation of the current environmental operating conditions; tanh() represents the hyperbolic tangent function; This represents the deviation penalty coefficient.
[0024] Lower the threshold when the light is good and the trend is favorable to maximize the use of battery power; raise the threshold when the environment is harsh so as to switch to mains power in advance to protect the battery.
[0025] Preferably, the step of comparing the current dynamic switching threshold with the current battery state of charge and controlling the system to switch power supply modes includes:
[0026] If the current state of charge of the battery is greater than the current dynamic switching threshold, the system controls the mains relay to remain open and only closes the photovoltaic charging circuit, so that the battery and photovoltaic together supply power to the load and charge the battery at the same time.
[0027] If the current state of charge of the battery is less than or equal to the current dynamic switching threshold, the system closes the mains relay and switches to grid power supply mode, where the mains power supplies the load and replenishes the battery.
[0028] By comparing the real-time battery state of charge with the dynamic switching threshold, intelligent switching of power supply mode is achieved, which maximizes the use of solar energy resources and extends battery life while ensuring power supply reliability.
[0029] Preferably, the acquisition of photovoltaic input power, load power consumption, and battery surface temperature at each moment includes:
[0030] Every second is a sampling moment, and the photovoltaic input power, load power consumption and battery surface temperature of the outdoor smart cabinet are collected sequentially at each moment.
[0031] Preferably, the acquisition of photovoltaic input power, load power consumption, and cell surface temperature includes:
[0032] The photovoltaic voltage is acquired by a voltage divider circuit and an ADC connected to the input terminal of the photovoltaic controller; the photovoltaic input current is acquired by a Hall current sensor; and the photovoltaic input power is obtained by Ohm's law calculation based on the photovoltaic voltage and photovoltaic input current inside the controller.
[0033] The total load current is collected by a low-resistance sampling resistor deployed on the system bus, and the bus voltage is collected by a voltage sensor to calculate the load power consumption.
[0034] The terminal voltages of the positive and negative terminals of the battery are read directly using a high-precision ADC; the surface temperature of the battery is collected by an NTC thermistor attached to the battery surface.
[0035] Preferably, obtaining the battery state of charge includes:
[0036] The battery's state of charge is determined by directly reading the actual charge level of the outdoor smart cabinet's battery at each moment.
[0037] The present invention has the following beneficial effects: The purpose of the present invention is to obtain a dynamic switching threshold by introducing an energy supply trend index and environmental condition deviation, so that the system no longer relies on fixed parameters. When the light data is good and the environmental data is stable, the system can automatically reduce the fixed threshold to obtain the dynamic switching threshold, so as to make full use of solar photovoltaic power supply. In harsh environments, the system automatically increases the fixed threshold to obtain the dynamic switching threshold, and switches to the grid power supply in advance, so that the system triggers the battery protection mechanism in advance, avoiding battery damage caused by over-discharge. The present invention maximizes the utilization of solar energy resources and extends battery life while ensuring power supply reliability. Attached Figure Description
[0038] Figure 1 This is a flowchart illustrating the steps of a solar and grid coordinated power supply control method for smart cabinets according to an embodiment of the present invention.
[0039] Figure 2 A comparison chart of power supply strategies representing periods of increased sunlight in the early morning;
[0040] Figure 3 This diagram represents a battery protection power supply strategy under extreme conditions. Detailed Implementation
[0041] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0042] Please see Figure 1 The diagram illustrates a flowchart of a method for coordinated solar and grid power supply control for smart cabinets, according to an embodiment of the present invention. The method includes the following steps:
[0043] S001. Collect the photovoltaic input power, load power consumption, battery surface temperature, and battery state of charge at each moment.
[0044] In this embodiment of the invention, a sampling time is defined as every second, and four data types are collected sequentially at each time point: photovoltaic input power, load power consumption, battery surface temperature, and battery state of charge. The specific method for collecting these four data types is as follows:
[0045] The photovoltaic voltage is acquired by a voltage divider circuit and an ADC connected to the input terminal of the photovoltaic controller; the photovoltaic input current is acquired by a Hall current sensor; and the photovoltaic input power is obtained by Ohm's law calculation based on the photovoltaic voltage and photovoltaic input current inside the controller.
[0046] The total load current is collected by a low-resistance sampling resistor deployed on the system bus, and the bus voltage is collected by a voltage sensor to calculate the load power consumption.
[0047] The terminal voltages of the positive and negative terminals of the battery are read directly using a high-precision ADC; the surface temperature of the battery is collected by an NTC thermistor (negative temperature coefficient thermistor) attached to the surface of the battery.
[0048] The battery's state of charge is determined by directly reading the actual charge level of the outdoor smart cabinet's battery at each moment.
[0049] S002. Based on the average difference between photovoltaic input power and load power consumption within a historical window and the slope of change in battery state of charge, obtain the energy supply trend index; based on the difference between battery surface temperature and preset reference temperature, obtain the environmental operating condition deviation.
[0050] It should be noted that if the battery power is low (close to a fixed threshold), but it is morning and the sunlight is increasing, directly triggering mains power supply based on the fixed threshold will lead to unnecessary mains power consumption. In the case of deteriorating environment, the failure to predict the trend of environmental degradation will cause the battery to continue to discharge under harsh environmental conditions until the battery power drops further, resulting in over-discharge and damage to the battery. Therefore, in order to address the problem that the fixed threshold in the existing technology cannot adapt to dynamic environmental changes, this step calculates a dynamic switching threshold that is adapted to the current environment by analyzing data.
[0051] First, analyze the difference between the photovoltaic input power and the load power consumption at the current moment. If the photovoltaic input is consistently higher than the load and the battery charge is continuously increasing, it indicates that the sunlight is increasing at the current moment and the battery is in a charging state. Therefore, by combining the difference between the photovoltaic input power and the load power consumption, as well as the changes in the battery charge, obtain the energy supply trend index at the current moment. The larger the value, the more the energy supply of the battery is increasing, and there is no need to switch to mains power.
[0052] In this embodiment of the invention, the preset number of historical moments N=15. In other embodiments, the implementer can preset the value of N according to the specific implementation situation. The window consisting of the current moment and the N moments before it is used as the historical window of the current moment. The series consisting of the battery state of charge of all moments in the historical window of the current moment is used as the battery state of charge sequence of the current moment. The least squares method is used to perform linear fitting on the battery state of charge sequence of the current moment, and the slope of the fitted line is used as the slope of the change of battery state of charge at the current moment. The slope of the change of battery state of charge directly reflects whether the battery is charging rapidly (positive slope) or consuming power rapidly (negative slope).
[0053] Obtain the energy supply trend index at the current moment:
[0054] ;
[0055] In the formula, An index representing the current energy supply trend; Represents the photovoltaic input power at the i-th moment in the historical window at the current moment; This represents the load power consumption at the i-th time point in the historical window at the current time. The number of times in the history window representing the current moment; This represents the reference value for the maximum power of the equipment; The slope representing the change in the battery's state of charge at the current moment; Represents the current power gain weight; The weight representing the rate of change of electricity is preset in this embodiment of the invention. , Used for balance and The weight of the value on the result is determined by setting the maximum power reference value to the maximum power value specified in the equipment specification. ;
[0056] The value represents the solar power generation capacity minus the power consumption of the equipment, therefore The larger the value, the more the photovoltaic input has consistently exceeded the load over a period of time, indicating a stronger self-sufficiency of the system. This represents the rate of change of battery charge; the larger the value, the faster the battery charge is increasing.
[0057] Therefore, if the input of photovoltaic power has consistently exceeded the load over a period of time, and the power generation shows a steady upward trend, the energy supply trend index of the battery at the current moment will be greater.
[0058] It should be noted that the current battery surface temperature is compared with the optimal operating temperature recommended in the battery specifications to assess whether there is any risk from the current ambient temperature.
[0059] In this embodiment of the invention, the deviation of the environmental operating conditions at the current moment is obtained:
[0060] ;
[0061] In the formula, This represents the deviation of the environmental operating conditions at the current moment; This represents the current battery surface temperature. This represents the preset reference temperature, which is usually set to the optimal operating temperature recommended in the battery specifications, such as 25°C; exp() represents an exponential function with the natural constant as the base. Representing the standard deviation of a preset temperature distribution, in this embodiment of the invention, the preset... This parameter controls the algorithm's sensitivity to temperature deviations. In other words, when the temperature deviates from the reference temperature by 15°C, the deviation from the environmental operating conditions will increase significantly. In other embodiments, implementers can preset this parameter according to specific implementation conditions. The value;
[0062] If the current battery surface temperature is close to the preset reference temperature, it means the current environment is suitable. The value will approach 0 if the current battery surface temperature is much greater than or much less than the preset reference temperature. The value will quickly approach 1, indicating that there is a risk in the current environment.
[0063] S003. Obtain the dynamic switching threshold at the current moment based on the deviation between the energy supply trend index and the environmental operating conditions.
[0064] It should be noted that the energy supply trend index calculated above is combined with the environmental condition deviation to obtain the dynamic switching threshold at the current moment. When the energy supply of the battery is continuously increasing and the environment is good, it indicates that the current light is continuously improving or extremely good. At this time, the fixed threshold of the battery state of charge is lowered, allowing the system to make full use of the battery under safe conditions and wait for the photovoltaic power to recover. When the energy supply of the battery is continuously decreasing and the environment is extreme, it indicates that the current environment is in a harsh scenario. At this time, the fixed threshold of the battery state of charge is raised, allowing the system to cut off the photovoltaic power supply in advance and switch to grid power supply to mitigate losses.
[0065] In this embodiment of the invention, the dynamic switching threshold at the current moment is obtained:
[0066] ;
[0067] In the formula, The dynamic switching threshold represents the current moment; A fixed threshold representing the state of charge of the battery; This represents the adjustment range of a fixed threshold. An index representing the current energy supply trend; This represents the deviation of the current environmental operating conditions; tanh() represents the hyperbolic tangent function, used to map the input data to the range (-1, 1); The deviation penalty coefficient is preset in this embodiment of the invention. =1.5, used to amplify the negative weight of environmental condition deviation on decision-making; in this embodiment of the invention, a fixed threshold for the battery state of charge is preset. The adjustment range of the preset fixed threshold In other embodiments, implementers may pre-set according to specific implementation conditions. as well as The value;
[0068] when Positive (the larger the energy supply trend index) and When very young (in a suitable environment), A positive value lowers the dynamic switching threshold, allowing the system to utilize the battery more fully while waiting for the photovoltaic power to recover, provided that it is safe to do so.
[0069] when Negative (the smaller the energy supply trend index) or When the value in parentheses is very large (due to extreme environmental conditions), the value in parentheses is negative. A negative value increases the dynamic switching threshold, allowing the system to cut off photovoltaic power supply in advance and switch to grid power supply to mitigate losses.
[0070] S004. Compare the current dynamic switching threshold with the current battery state of charge, and control the system to switch the power supply mode.
[0071] In this embodiment of the invention, if the current state of charge of the battery is greater than the current dynamic switching threshold, the system controls the mains relay to remain in the open state and only closes the photovoltaic charging circuit, so that the battery and photovoltaic together supply power to the load and charge the battery at the same time.
[0072] If the current state of charge of the battery is less than or equal to the current dynamic switching threshold, the system closes the mains relay and switches to grid power supply mode, where the mains power supplies the load and replenishes the battery.
[0073] Figure 2 The diagram shows a comparison of power supply strategies during periods of enhanced morning sunlight. The solid blue line represents the trajectory of the battery's state of charge (SOC) during operation. The gray dashed line represents the fixed threshold of SOC, and the red dashed line represents the trajectory of the dynamic switching threshold obtained by this invention. Throughout the process where the solid blue line falls below 20% (gray dashed line), the red dashed line remains below the blue line. This means that although the battery's SOC is already below the traditional fixed threshold of 20%, because the time period corresponding to the solid blue line falling below 20% falls during the period of enhanced morning sunlight, this invention lowers the dynamic switching threshold even further. The system determines that the current battery power is still safe and continues to use photovoltaic power. Figure 2 The green-filled area in the image visually demonstrates that this invention continues to use photovoltaic power when the battery level is below 20%, avoiding the mains power switching that occurs in existing technologies.
[0074] Figure 3 The diagram illustrates the battery protection power supply strategy under extreme environments. The solid blue line represents the trajectory of the battery's state of charge (SOC) during operation (continuously decreasing), the gray dashed line represents the fixed threshold of the SOC, and the red dashed line represents the trajectory of the dynamic switching threshold obtained by this invention. As shown by the solid blue line, the continuous decrease in the SOC indicates that the current environment is extremely low temperature. Existing technologies only switch to mains power supply mode when the SOC continuously decreases to the fixed threshold, leading to over-discharge and battery damage. In contrast, the dynamic switching threshold line of this invention intersects with the solid blue line at approximately 28%, at which point the mains power supply is switched, triggering the battery protection mechanism in advance.
[0075] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for coordinated solar and grid power supply control for intelligent cabinets, characterized in that, include: Collect photovoltaic input power, load power consumption, battery surface temperature, and battery state of charge at each moment; Obtain the historical window for the current moment; obtain the slope of the change in battery state of charge at the current moment; based on the difference between photovoltaic input power and load power consumption at each moment in the historical window for the current moment and the slope of the change in battery state of charge, obtain the energy supply trend index for the current moment; based on the difference between battery surface temperature and preset reference temperature, obtain the environmental condition deviation for the current moment. Based on the deviation between the energy supply trend index and environmental conditions, the dynamic switching threshold for the current moment is obtained. The system compares the current dynamic switching threshold with the current battery state of charge and controls the system to switch power supply modes, including: if the current battery state of charge is greater than the current dynamic switching threshold, the system controls the mains relay to remain open and only closes the photovoltaic charging circuit, so that the battery and photovoltaic power supply the load together and charge the battery at the same time; if the current battery state of charge is less than or equal to the current dynamic switching threshold, the system closes the mains relay and switches to grid power supply mode, so that the mains power supplies the load and charges the battery. Obtain the energy supply trend index at the current moment, including: ; An index representing the current energy supply trend; Represents the photovoltaic input power at the i-th moment in the historical window at the current moment; This represents the load power consumption at the i-th time point in the historical window at the current time. The number of times in the history window representing the current moment; This represents the reference value for the maximum power of the equipment; The slope representing the change in the battery's state of charge at the current moment; Represents the current power gain weight; Weights representing the rate of change of electricity; Obtain the dynamic switching threshold at the current moment, including: ; The dynamic switching threshold represents the current moment; A fixed threshold representing the state of charge of the battery; This represents the adjustment range of a fixed threshold. Represents the deviation of the current environmental operating conditions; tanh() represents the hyperbolic tangent function; This represents the deviation penalty coefficient.
2. The solar and grid coordinated power supply control method for intelligent cabinets according to claim 1, characterized in that, The process of obtaining the historical window at the current moment includes: The number of historical moments is preset to N. The window consisting of the current moment and the N moments before it is used as the historical window of the current moment.
3. The solar and grid coordinated power supply control method for intelligent cabinets according to claim 1, characterized in that, The step of obtaining the slope of the change in the battery state of charge at the current moment includes: The series of battery states of charge (SOCs) at all times in the historical window at the current time is taken as the battery SOC sequence at the current time. The least squares method is used to perform a linear fit on the battery SOC sequence at the current time, and the slope of the fitted line is taken as the slope of the change in battery SOC at the current time.
4. The solar and grid coordinated power supply control method for intelligent cabinets according to claim 1, characterized in that, The process of obtaining the environmental operating condition deviation at the current moment includes: ; In the formula, This represents the deviation of the environmental operating conditions at the current moment; This represents the current battery surface temperature. Represents the preset reference temperature; exp() represents an exponential function with the natural constant as the base. This represents the standard deviation of the preset temperature distribution.
5. A method for coordinated solar and grid power supply control for intelligent cabinets according to claim 1, characterized in that, The data collection of photovoltaic input power, load power consumption, and battery surface temperature at each moment includes: Every second is a sampling moment, and the photovoltaic input power, load power consumption and battery surface temperature of the outdoor smart cabinet are collected sequentially at each moment.
6. A solar and grid coordinated power supply control method for intelligent cabinets according to claim 5, characterized in that, The acquisition of photovoltaic input power, load power consumption, and cell surface temperature includes: The photovoltaic voltage is acquired by a voltage divider circuit and an ADC connected to the input terminal of the photovoltaic controller; the photovoltaic input current is acquired by a Hall current sensor; and the photovoltaic input power is obtained by Ohm's law calculation based on the photovoltaic voltage and photovoltaic input current inside the controller. The total load current is collected by a low-resistance sampling resistor deployed on the system bus, and the bus voltage is collected by a voltage sensor to calculate the load power consumption. The terminal voltages of the positive and negative terminals of the battery are read directly using a high-precision ADC; the surface temperature of the battery is collected by an NTC thermistor attached to the battery surface.
7. A solar and grid coordinated power supply control method for intelligent cabinets according to claim 1, characterized in that, The acquisition of the battery state of charge includes: The battery's state of charge is determined by directly reading the actual charge level of the outdoor smart cabinet's battery at each moment.
Citation Information
Patent Citations
Charging chip real-time power scheduling control method
CN120327332A
Energy-storage-free type photovoltaic air conditioner dynamic power supply method and system
CN120414518A