A method and system for regulating the output power of an intelligent box
By establishing a serial communication link in the solar intelligent box, the battery SOC value and photovoltaic charging current data are collected and processed in real time, realizing the linkage control between the power supply status and the POE port. This solves the problems of battery over-discharge and core load power failure, ensuring the stable operation of the system under dynamic power supply conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-04-03
AI Technical Summary
In the existing power supply system of the solar smart box, the solar controller cannot transmit the battery SOC value and photovoltaic charging current data to the POE switch in real time. This causes the POE switch to be unable to dynamically adjust the power supply, resulting in problems such as battery over-discharge, power outage of core loads, and poor operation and maintenance visibility.
By establishing a serial communication link between the solar controller and the POE power supply unit, the battery SOC value and photovoltaic charging current data are collected in real time. The three-level operating condition level with dual thresholds is matched with the priority level of the POE port to realize the linkage between power supply status and POE port control, and to implement tiered power supply limitation according to energy status.
It effectively avoids damage from over-discharge of batteries, ensures continuous operation of core loads, avoids crude power supply strategies and difficult operation and maintenance, and achieves stable and reliable operation of the system when solar power supply conditions change dynamically.
Smart Images

Figure CN121584808B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power regulation technology, and in particular to a method and system for regulating the output power of an intelligent box. Background Technology
[0002] Solar-powered smart boxes are widely used due to their advantages of zero carbon emissions and no need for mains power connection. These boxes use PoE (Power over Ethernet) technology to power the load, allowing for simultaneous data and power transmission via a single Ethernet cable, significantly simplifying outdoor wiring.
[0003] In existing technologies, the power supply system of a solar smart box consists of a solar charge / discharge management module and a regular PoE switch. These two modules operate independently, linked only by simple on / off signals, without a deep collaborative control mechanism. The solar controller cannot transmit core energy status data such as battery SOC and photovoltaic charging current to the PoE switch, causing the PoE switch to output at a fixed power level, unable to dynamically adjust according to the solar power supply capacity. Existing technologies suffer from the following technical problems: 1. When sunlight is insufficient or battery power is low, the PoE switch continues to supply full power, causing over-discharge damage to the battery; 2. The PoE port lacks a priority control mechanism, failing to guarantee the continuous operation of core loads during power shortages; 3. The use of a single voltage threshold to trigger power outages cannot adapt to the multi-condition fluctuations of solar power supply, resulting in a crude power supply strategy and poor operation and maintenance visibility. Summary of the Invention
[0004] This invention provides a method and system for regulating the output power of a smart box. This invention solves the technical problems of battery over-discharge, core load power failure, and difficult operation and maintenance management in the practical application of solar smart boxes. By establishing a serial communication link between the solar controller and the POE power supply unit, core energy status data such as battery SOC value and photovoltaic charging current are collected in real time, realizing the linkage between solar power supply status and POE port control.
[0005] The first aspect of this invention provides a method for adjusting the output power of a smart box, the method comprising:
[0006] Create a port class configuration table for the PoE port of the smart box, and set high power threshold and normal power threshold;
[0007] Read the serial port data of the solar controller and verify it to obtain valid data. Filter the SOC value in the valid data to obtain the SOC filtered value.
[0008] The SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level;
[0009] According to the port level configuration table and the operating condition level, perform a power-off operation or a power-on operation on the POE port.
[0010] In conjunction with the first aspect, in a first implementation of the first aspect of the present invention, a port level configuration table is created for the PoE port of the smart box, and a high power threshold and a normal power threshold are set, including:
[0011] The port level configuration table is obtained by mapping the PoE port of the smart box to the first port level, the second port level, or the third port level through the configuration interface.
[0012] Set high battery threshold and normal battery threshold.
[0013] In conjunction with the first aspect, in the second implementation of the first aspect of the present invention, the serial port data of the solar controller is read and verified to obtain valid data. The SOC value in the valid data is then filtered to obtain a filtered SOC value, including:
[0014] A query frame containing the slave address, function code, register start address, and number of registers is constructed according to the Modbus RTU protocol, and the query frame is sent to the solar controller through the serial port interface;
[0015] Receive the response frame returned by the solar controller, extract the SOC value of the battery and the photovoltaic charging current from the data field of the response frame, and obtain serial port data;
[0016] The serial port data is verified to obtain valid data, and the SOC value in the valid data is filtered to obtain the SOC filtered value.
[0017] The SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level.
[0018] In conjunction with the first aspect, in a third implementation of the first aspect of the present invention, a response frame returned by the solar controller is received, and the SOC value of the battery and the photovoltaic charging current are extracted from the data field of the response frame to obtain serial port data, including:
[0019] Receive the response frame returned by the solar controller, and locate the start position and byte length of the data field from the response frame;
[0020] The first byte in the data field is parsed as the SOC value of the battery, the second byte is parsed as the photovoltaic charging current, and the serial port data is returned.
[0021] In conjunction with the first aspect, in a fourth implementation of the first aspect of the present invention, the SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level, including:
[0022] The SOC filter value is compared with the high power threshold;
[0023] When the SOC filter value is greater than or equal to the high power threshold, the operating condition level is determined to be the third operating condition level.
[0024] When the SOC filter value is less than the high power threshold, the SOC filter value is compared with the normal power threshold;
[0025] When the SOC filter value is greater than or equal to the normal power threshold, the operating condition level is determined to be the second operating condition level; when the SOC filter value is less than the normal power threshold, the operating condition level is determined to be the first operating condition level.
[0026] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present invention, performing a power-off operation or a power-on operation on the PoE port according to the port level configuration table and the operating condition level includes:
[0027] Traverse the port level configuration table, filter out POE ports whose port level is higher than the operating condition level, generate a power-off command and send it to the POE power supply unit to control the electronic switch of the POE port to turn off.
[0028] The port level configuration table is traversed to filter out POE ports whose port level is less than or equal to the operating condition level. Power supply commands are generated and sent to the POE power supply unit to control the closing of the electronic switch of the POE port.
[0029] In conjunction with the first aspect, in the sixth implementation of the first aspect of the present invention, the process includes traversing the port level configuration table, filtering out PoE ports whose port level is less than or equal to the operating condition level, generating a power supply command and sending it to the PoE power supply unit, and controlling the closing of the electronic switch of the PoE port, including:
[0030] Traverse the port level configuration table, filter out PoE ports whose port level is less than or equal to the operating condition level, and generate control words according to the filtered PoE port numbers. The control words use bitmasks to identify the power supply status of each PoE port to obtain power supply commands.
[0031] The power supply command is sent to the chip of the POE power supply unit. The chip uses a soft-start method to control the closing of the electronic switch of the corresponding POE port and increase the output power of the POE port to the rated power.
[0032] In conjunction with the first aspect, in the seventh implementation of the first aspect of the present invention, the intelligent box output power adjustment method further includes:
[0033] The SOC filter value is continuously collected for multiple cycles. If the SOC filter value of each cycle remains within the threshold range corresponding to the operating condition level after the switch and the SOC change rate of adjacent cycles is less than the preset value, the operating condition level switch is determined to be stable.
[0034] For PoE ports that are in a power-off state, power supply commands for each PoE port are generated sequentially and sent to the PoE power supply unit at preset intervals, controlling the electronic switches of each PoE port to close sequentially.
[0035] In conjunction with the first aspect, in the eighth implementation of the first aspect of the present invention, for PoE ports in a power-off state, power supply commands for each PoE port are generated sequentially and sent to the PoE power supply unit at preset time intervals, controlling the electronic switches of each PoE port to close sequentially, including:
[0036] Extract the port number and port level of the PoE port in the power-off state from the port level configuration table, sort them in ascending order of port level, and obtain the port recovery queue.
[0037] Starting from the head of the port recovery queue, the port number of each PoE port is retrieved in sequence to generate the corresponding power supply command and send it to the PoE power supply unit. After each power supply command is sent, a timer is started to delay for a preset time interval before sending the next power supply command, thereby controlling the electronic switches of each PoE port to close in sequence.
[0038] A second aspect of the present invention provides an intelligent box output power regulation system, the intelligent box output power regulation system comprising:
[0039] Create a module to create a port level configuration table for the PoE port of the smart box and set high power threshold and normal power threshold;
[0040] The verification module is used to read the serial port data of the solar controller and verify it to obtain valid data. The SOC value in the valid data is filtered to obtain the SOC filtered value.
[0041] The comparison module is used to compare the SOC filter value with the high power threshold and the normal power threshold to determine the operating condition level;
[0042] The execution module is used to perform a power-off operation or a power-on operation on the PoE port according to the port level configuration table and the operating condition level.
[0043] Compared to existing technologies, this invention establishes a serial communication link between the solar controller and the PoE power supply unit to collect core energy status data such as battery SOC value and photovoltaic charging current in real time, achieving linkage between solar power supply status and PoE port control. Based on a three-level operating condition classification with dual thresholds, it matches the three-level priority levels of the PoE ports. Through the control rule of "power off when port level is higher than operating condition level," it achieves power supply regulation under different solar power supply conditions, prioritizing the continuous operation of core loads during periods of power shortage and preventing battery over-discharge damage. Compared to the single threshold control and non-priority management mode of existing technologies, this invention can implement tiered power supply restrictions based on gradual changes in energy status, avoiding the impact of sudden power outages on system operation. The operating condition recovery mechanism, through stability judgments over multiple acquisition cycles and a sequential recovery strategy based on port level values from smallest to largest, avoids surge current impacts caused by simultaneous power-on of multiple ports, ensuring stable and reliable system operation under dynamic changes in solar power supply conditions. This invention solves the technical problems of battery over-discharge, core load power outages, and difficult operation and maintenance management in practical applications of solar intelligent boxes. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art 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.
[0045] The structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0046] Figure 1 This is a flowchart illustrating the intelligent box output power adjustment method provided in an embodiment of the present invention;
[0047] Figure 2 This is a schematic block diagram of the intelligent box output power regulation system provided in an embodiment of the present invention. Detailed Implementation
[0048] 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, not all, of the embodiments of the present invention. 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.
[0049] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0050] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0051] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items, and all possible combinations, and includes such combinations. See also Figure 1 One embodiment of the intelligent box output power adjustment method in this invention includes:
[0052] Step 100: Create a port level configuration table for the PoE port of the smart box, and set the high power threshold and normal power threshold;
[0053] Step 200: Read the serial port data of the solar controller and verify it to obtain valid data. Filter the SOC value in the valid data to obtain the SOC filtered value.
[0054] Step 300: Compare the SOC filter value with the high power threshold and the normal power threshold to determine the operating condition level;
[0055] Step 400: Perform a power-off operation or a power-on operation on the POE port according to the port level configuration table and the operating condition level.
[0056] In one specific embodiment, a port level configuration table is created for the PoE port of the smart box, and high power threshold and normal power threshold are set, including:
[0057] The port level configuration table is obtained by mapping the PoE port of the smart box to the first port level, the second port level, or the third port level through the configuration interface.
[0058] Set high battery threshold and normal battery threshold.
[0059] Specifically, after power-on, the main control chip (such as A40i) loads the configuration management module. This module automatically calls the configuration interface service and establishes an access channel with non-volatile memory (such as EEPROM or Flash). It retrieves historically saved port configuration templates from the storage area. If it detects first-time operation or configuration loss, it enters configuration initialization mode. In this mode, all available PoE ports are listed and displayed to the user for tier classification. Each port is marked as Level 1, Level 2, or Level 3. Level 1 corresponds to critical loads, such as data acquisition terminals or government platform communication modules; Level 2 corresponds to important sensor loads; and Level 3 is assigned to ordinary loads such as LED lighting or auxiliary equipment. Tier classification information is selected and confirmed through drop-down menus or interactive forms provided in the configuration interface. After user confirmation, the configuration management module establishes a mapping relationship between each port number and its corresponding level and writes it to the port level configuration table. The configuration table is saved in structured JSON format, containing fields such as port number, level value, load description, and update timestamp. Meanwhile, to enable the system to classify operating conditions based on the battery's energy state during operation, a dedicated threshold setting window is provided for inputting these two parameters: a high-charge threshold and a normal-charge threshold. The default values are 80% and 20%, respectively, to distinguish between a fully charged battery and a critically charged battery. After configuration, these values are also written to the configuration storage area, forming a corresponding relationship with the port level configuration table. During the configuration process, the reasonableness of the input values is verified in real time. For example, the port level is limited to three valid levels, and the threshold settings meet the requirement that the high-charge threshold is greater than the normal-charge threshold and both are between 0% and 100%. If an abnormal input is detected, the configuration interface will automatically display a prompt to prevent submission. The configuration data is solidified by the processor into static parameters used by the control logic and is invoked in real time when entering the power supply regulation process.
[0060] In one specific embodiment, serial port data from the solar controller is read and verified to obtain valid data. The SOC value in the valid data is then filtered to obtain a filtered SOC value, including:
[0061] A query frame containing the slave address, function code, register start address, and number of registers is constructed according to the Modbus RTU protocol, and the query frame is sent to the solar controller through the serial port interface;
[0062] Receive the response frame returned by the solar controller, extract the SOC value of the battery and the photovoltaic charging current from the data field of the response frame, and obtain serial port data;
[0063] The serial port data is verified to obtain valid data, and the SOC value in the valid data is filtered to obtain the SOC filtered value.
[0064] The SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level.
[0065] Specifically, a query frame conforming to the Modbus RTU standard is constructed in the main control unit of the smart box. The query frame includes four fields: slave address, function code, register start address, and register quantity. The slave address is set to 0x01, representing the target device address; the function code is specified as 0x03, representing the "read holding register" function; the register start address is set to 0x0000 according to the controller protocol definition, used to read information such as the battery SOC value, photovoltaic charging current, and battery terminal voltage; the register quantity is set to 0x0003, indicating that three 16-bit registers will be read consecutively, covering the above three data items. After the query frame is constructed, the main control processor encodes it into a data stream in Modbus RTU standard format and adds a CRC-16 checksum to form a complete communication frame. This frame is then sent to the solar controller via the RS485 serial port interface. The RS485 bus uses differential signal transmission at the physical layer, providing good anti-interference capabilities and ensuring stable data transmission in complex outdoor electromagnetic environments. After receiving the query frame, the solar controller's internal Modbus protocol stack performs the corresponding data reading operation based on the function code and register address, and generates a response frame to return to the master control unit within a preset response time. The response frame includes the slave address, function code, number of bytes, data field, and CRC check field. The data field is a continuous 6-byte segment, storing the SOC value, charging current value, and battery voltage value in sequence, with each parameter occupying 2 bytes (16 bits). After receiving the response frame, the master control unit parses the data structure and extracts the original serial port data corresponding to the battery SOC value and photovoltaic charging current in the data field. Simultaneously, it executes the CRC-16 redundancy check algorithm specified by the Modbus protocol, calculating the check value for all bytes before the frame and comparing it with the CRC field at the end of the frame. If they match, the data transmission is considered complete and valid; otherwise, the data is discarded and a communication anomaly event is recorded. After successful verification, the extracted SOC value is stored in 0.1% units; for example, the hexadecimal value 0x0320 represents an SOC of 80.0%. The photovoltaic charging current is stored in 0.1A units, with the positive or negative sign used to distinguish between charging and discharging states. The valid SOC values that pass verification are filtered to suppress judgment errors caused by short-term fluctuations. A three-point moving average algorithm is used to average the current SOC value with the SOC values of the previous two periods, forming a smooth filtered SOC value. This avoids drastic changes in SOC value caused by changes in sunlight or instantaneous load fluctuations, which could lead to frequent switching of power supply strategies.The SOC filter value is input into the threshold judgment module and continuously compared with the preset high charge threshold and normal charge threshold. It is determined whether the value is greater than or equal to the high charge threshold T1. If it is, the system is classified as operating condition level 3, indicating that the battery charge is sufficient. If not, it is then judged whether the value is greater than or equal to the normal charge threshold T2. If it is, the system is classified as operating condition level 2, indicating that the system is in a medium charge state. If the value is lower than T2, the system is classified as operating condition level 1, indicating that the battery is approaching an over-discharge critical state and the load power supply needs to be immediately limited. The entire process is executed once every acquisition cycle (e.g., 6 seconds) within the main control system.
[0066] The step of verifying the serial port data to obtain valid data includes: performing CRC-16 cyclic redundancy check on the response frame of the serial port data, comparing the calculated check value with the check code at the end of the response frame, marking the CRC check as passed when they match, and discarding the current frame data and recording a check failure event when they do not match; performing a numerical range check on the battery SOC value and photovoltaic charging current in the serial port data that passed the CRC check, determining whether the battery SOC value is within a preset SOC range and whether the photovoltaic charging current is within a preset current range, and marking the data as valid when both are within the range; performing a consecutive failure count on the check failure event, and triggering a communication fault alarm and outputting a fault signal through a status indicator when the number of consecutive failures reaches a preset threshold, while retaining the valid data from the previous cycle for operating condition judgment; storing the valid data that passed the check into a dual buffer, and using a ping-pong buffering mechanism to switch the buffer pointer when updating data to ensure that the data reading process is not affected by data writing.
[0067] The filtering process for the SOC values in the valid data to obtain filtered SOC values includes: extracting the battery SOC value and photovoltaic charging current value for the current period from the valid data; extracting the battery SOC value and photovoltaic charging current value for the previous period from the historical data cache; calculating the SOC change and photovoltaic charging current change between the current period and the previous period; judging abnormal jumps in the SOC change; marking suspected abnormal data when the absolute value of the SOC change is greater than a preset SOC jump threshold, and marking normal change data when the absolute value of the SOC change is less than or equal to the preset SOC jump threshold; performing correlation verification on the SOC values marked as suspected abnormal data, and converting the photovoltaic charging current value into a variable value. The change in current is compared with the change in SOC. When the change in photovoltaic charging current is positive and the change in SOC is negative, or when the change in photovoltaic charging current is negative and the change in SOC is positive, it is determined to be an inconsistent state and the SOC value of the current period is confirmed as abnormal data. When the two change in the same direction, it is determined to be consistent and the SOC value of the current period is confirmed as real fluctuation data. The SOC value confirmed as abnormal data is corrected by adding the SOC value of the previous period to the theoretical change in SOC estimated based on the change in photovoltaic charging current to obtain the corrected SOC value. The corrected SOC value is then used as the effective SOC value of the current period for subsequent filtering.
[0068] In one specific embodiment, a response frame returned by the solar controller is received, and the SOC value of the battery and the photovoltaic charging current are extracted from the data field of the response frame to obtain serial port data, including:
[0069] Receive the response frame returned by the solar controller, and locate the start position and byte length of the data field from the response frame;
[0070] The first byte in the data field is parsed as the SOC value of the battery, the second byte is parsed as the photovoltaic charging current, and the serial port data is returned.
[0071] Specifically, a stable serial communication channel is established, and a query frame is sent in Modbus RTU protocol format. When the solar controller receives the query frame and completes register reading, it returns a response frame according to the frame structure specified by the Modbus protocol. The response frame includes the slave address (1 byte), function code (1 byte), number of data bytes (1 byte), data field (N bytes), and CRC checksum (2 bytes). The starting position of the data field is fixed at the 4th byte in the frame structure, i.e., the first valid data bit after the first three bytes. Its byte length is explicitly given by the "number of data bytes" field in the third byte of the frame structure. Therefore, after receiving the response frame, the master control system must first parse the first three bytes to locate the starting index and total length of the data field, ensuring that other structure fields or checksum contents are not misread. After confirming the starting position and length of the data field, the data parsing stage begins. At this point, the first byte in the data field is processed as the original SOC value of the battery. If the solar controller uses a 1-byte unsigned integer to represent the SOC percentage, then reading this byte will yield the SOC value. For example, a value of 0x50 indicates that the battery capacity is 80%. The second byte in the data field is extracted as the raw representation of the photovoltaic charging current. If the controller uses a 1-byte signed integer to represent the current value in units of 0.1A, then 0x0A indicates a charging current of 1.0A. A negative value (e.g., 0xF6, corresponding to decimal -10) indicates a discharge state. The battery's SOC value and the photovoltaic charging current are combined and packaged into a structured serial port data object, and returned to the upper-layer data processing module as key-value pairs of SOC value and photovoltaic charging current.
[0072] Before comparing the SOC filtered value with the high power threshold and the normal power threshold to determine the operating condition level, the method further includes: extracting the SOC filtered values from the most recent consecutive periods from the historical data cache, calculating the SOC change between adjacent periods to obtain the SOC change sequence; performing linear regression fitting on the SOC change sequence to calculate the slope of the SOC change rate; when the slope of the SOC change rate is negative and the absolute value is greater than a preset decline rate threshold, it is determined that the battery SOC is showing a rapid decline trend; when it is determined to be a rapid decline trend, based on the slope of the SOC change rate and the current SOC filtered value, predicting the value that the battery SOC will reach within a preset time period in the future to obtain the SOC predicted value; comparing the SOC predicted value with the normal power threshold; when the SOC predicted value is lower than the normal power threshold, reducing the operating condition level from the current level by one level in advance, and adjusting the power supply strategy of the POE port accordingly to achieve preventive power supply limitation and avoid the battery SOC from rapidly dropping to the over-discharge range.
[0073] In one specific embodiment, the SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level, including:
[0074] The SOC filter value is compared with the high power threshold;
[0075] When the SOC filter value is greater than or equal to the high power threshold, the operating condition level is determined to be the third operating condition level.
[0076] When the SOC filter value is less than the high power threshold, the SOC filter value is compared with the normal power threshold;
[0077] When the SOC filter value is greater than or equal to the normal power threshold, the operating condition level is determined to be the second operating condition level; when the SOC filter value is less than the normal power threshold, the operating condition level is determined to be the first operating condition level.
[0078] Specifically, a high-power threshold T1 is extracted from the preset configuration and set to 80%. The SOC filter value is compared with the high-power threshold. When the SOC filter value is greater than or equal to the high-power threshold, it indicates that the current battery power is sufficient and has a high energy storage margin. The current operating condition level is determined to be the third operating condition level, meaning that all PoE ports are in a power-available state and the load operation is unrestricted. When the SOC filter value does not reach the high-power threshold, the next layer of judgment logic is entered. The SOC filter value is compared with the normal power threshold T2, which is set to 20%. If the SOC filter value is greater than or equal to the normal power threshold, the current system is determined to be in an acceptable but not ideal energy state. The operating condition level is set to the second operating condition level, corresponding to the need to disconnect some low-priority loads to ensure the continuous operation of the core loads. If the SOC filter value is still lower than the normal power threshold, it indicates that the battery is close to the critical discharge level. The operating condition level is determined to be the first operating condition level, and the power supply limitation mechanism is triggered accordingly. Only the critical ports of level 1 are kept powered to avoid battery over-discharge and protect the stable operation of the system.
[0079] Before determining the operating condition level as the third operating condition level when the SOC filter value is greater than or equal to the high power threshold, the process further includes: extracting the photovoltaic charging current value from the valid data and determining whether the photovoltaic charging current value is greater than or equal to a preset charging current threshold; when the photovoltaic charging current value is greater than or equal to the preset charging current threshold, confirming that the solar panel is in a charging state, determining the operating condition level as the third operating condition level and marking it as a continuous energy replenishment state; when the photovoltaic charging current value is less than the preset charging current threshold, determining that the solar panel is not charging or is weakly charging, determining the operating condition level as the third operating condition level and marking it as a no-charging state, and recording the current SOC value and photovoltaic charging current value in the system log; based on the marked state of the operating condition level, in the subsequent POE port control process, extending the full port power supply time for the operating condition level marked as a continuous energy replenishment state, and shortening the non-core port power supply time for the operating condition level marked as a no-charging state.
[0080] Before performing a power-off or power-on operation on the PoE port according to the port level configuration table and the operating condition level, the process further includes: comparing the operating condition level determined in the current cycle with the historical operating condition level of the previous cycle to determine whether the operating condition level has changed; if the operating condition level has not changed, directly maintaining the current power supply state of the PoE port; if the operating condition level has changed, entering the hysteresis judgment process; in the hysteresis judgment process, comparing the SOC filter value with the hysteresis threshold corresponding to the operating condition switching direction, the hysteresis threshold including a rising hysteresis threshold and a falling hysteresis threshold, the rising hysteresis being used when the operating condition level switches from low to high. The threshold is set as follows: when the operating condition level switches from high to low, the hysteresis threshold is used; when the SOC filter value meets the hysteresis threshold condition, the switching confirmation counter is started. The switching confirmation counter is incremented when the hysteresis condition is met continuously for multiple consecutive acquisition cycles. When the switching confirmation counter reaches the preset number of confirmations, the operating condition level switch is confirmed to be valid; when the switching confirmation counter does not reach the preset number of confirmations and the SOC filter value falls back to the original operating condition level threshold range, the switching confirmation counter is cleared and the original operating condition level remains unchanged to avoid frequent power outages or restorations of the POE port caused by short-term fluctuations of SOC near the threshold.
[0081] In one specific embodiment, according to the port level configuration table and the operating condition level, performing a power-off operation or a power-on operation on the PoE port includes:
[0082] Traverse the port level configuration table, filter out POE ports whose port level is higher than the operating condition level, generate a power-off command and send it to the POE power supply unit to control the electronic switch of the POE port to turn off.
[0083] The port level configuration table is traversed to filter out POE ports whose port level is less than or equal to the operating condition level. Power supply commands are generated and sent to the POE power supply unit to control the closing of the electronic switch of the POE port.
[0084] Specifically, the system calls the preset port level configuration table in the embedded main control unit and sequentially traverses all records in the table. The port level configuration table is a structured data set that records the number of each PoE port and its corresponding priority level. The level values are integers, with smaller values indicating more critical loads. Through this traversal, the level value of each port is compared with the current operating condition level. If a port's level value is greater than the current operating condition level, it means the load connected to that port has a priority lower than the power supply level supported by the current energy state. Therefore, that port should not continue to supply power under the current operating condition, and a power-off command is immediately generated for such ports. The power-off command format is a control structure containing the port number and status bits. The command is packaged and sent via the SPI bus to the control chip (e.g., RTL239C) in the PoE power supply unit. Upon receiving the command, the PoE power supply unit executes its internal electronic switch control logic, turning off the MOSFET of the target port, thereby cutting off the output power, avoiding energy waste, and reducing the battery load. After screening and controlling the ports that need to be powered off, a second round of traversal is performed using the same port level configuration table to filter out all ports whose level values are less than or equal to the current operating condition level. The load importance of these ports matches the power supply range of the current energy state, and the system needs to ensure that they are in a continuous power supply state. Therefore, a power supply command is generated for them and sent to the PoE power supply unit. The structure of the power supply command is the same as that of the power off command, which also includes the target port number and power supply status bit. After being written into the control register, the RTL239C chip executes the electronic switch closing operation. The closing process adopts a soft-start mechanism, which gradually increases the voltage by gradually increasing the PWM duty cycle to avoid system instability or voltage disturbance to the load equipment caused by instantaneous large current surges.
[0085] The process of generating a power-off command and sending it to the PoE power supply unit to control the electronic switch of the PoE port to open includes: generating a power-off control command based on the selected PoE port number that needs to be powered off, the power-off control command including the port number and power attenuation parameters; sending the power-off control command to the chip of the PoE power supply unit, the chip adjusting the PWM duty cycle of the corresponding PoE port after receiving the power-off control command, so that the output power of the PoE port decreases linearly from the current power value to a preset holding power value at a preset attenuation rate; controlling the PoE port to maintain the preset holding power value for a preset holding time, so that the connected load device smoothly enters a low-power standby state; after the preset holding time ends, controlling the electronic switch of the PoE port to completely open, so that the output power of the PoE port drops to zero, and feeding back the power-off completion status to the control unit.
[0086] In one specific embodiment, the port level configuration table is traversed to filter out PoE ports whose port level is less than or equal to the operating condition level, a power supply command is generated and sent to the PoE power supply unit, and the electronic switch of the PoE port is controlled to close, including:
[0087] Traverse the port level configuration table, filter out PoE ports whose port level is less than or equal to the operating condition level, and generate control words according to the filtered PoE port numbers. The control words use bitmasks to identify the power supply status of each PoE port to obtain power supply commands.
[0088] The power supply command is sent to the chip of the POE power supply unit. The chip uses a soft-start method to control the closing of the electronic switch of the corresponding POE port and increase the output power of the POE port to the rated power.
[0089] Specifically, the operating condition level is used as a filtering condition. The port level configuration table is traversed line by line to filter out all PoE port numbers that meet the condition that the port level is less than or equal to the current operating condition level. The loads corresponding to these ports still have stable power supply conditions under the current battery energy storage state. Based on the filtering results, a power supply control word is constructed. The power supply control word adopts a standard bitmask format, such as an 8-bit or 16-bit unsigned integer variable, where each bit corresponds to a PoE port. A bit value of "1" indicates that power supply is allowed, and a bit value of "0" indicates that the power is off. For example, bit 0 corresponds to port 1, bit 1 corresponds to port 2, and so on. If the filtering results include ports 1, 2, and 3, the control word is 00000111 (0x07), that is, the first three ports are allowed to be powered, and the last five ports remain powered off. The control word is encapsulated as a power supply command, which is sent to the control chip in the PoE power supply unit via the SPI bus, such as the RTL239C chip. After receiving the power supply control word, the chip enters the power supply activation stage. It does not directly trigger the full-power closure of the electronic switch, but controls the conduction curve of the MOSFET according to the internal soft-start mechanism. The soft-start process gradually increases the output voltage and output current by linearly increasing the PWM duty cycle, so that the output power of each target PoE port gradually increases from zero to the rated power value of the corresponding load. The entire power-on process is divided into several time segments, each segment increasing the power by 10% or less in steps. For example, the complete power-on time is 100 milliseconds to 200 milliseconds, thereby effectively preventing surge current impact or power supply voltage fluctuations caused by sudden load connection. Meanwhile, the RTL239C chip monitors the output status of each channel in real time during power supply, ensuring that the electronic switch does not experience abnormal jumps or load anomalies as the power curve steadily increases. If a short circuit, voltage drop, or overcurrent event is detected, the chip immediately interrupts the power supply and feeds back the abnormal information to the main control processor. The main control system records the alarm and marks the faulty port to prevent the power supply risk from escalating.
[0090] After the chip uses a soft-start method to control the closing of the electronic switch of the corresponding PoE port and increase the output power of the PoE port to the rated power, the method further includes: acquiring the real-time output current and output voltage of each PoE port through the chip of the PoE power supply unit, calculating the actual output power of each PoE port, and obtaining port power monitoring data; matching and verifying the port power monitoring data with the expected power supply status of the corresponding port in the power supply command; when the PoE port should be in a power supply state but the actual output power is zero or lower than a preset minimum power threshold, it is determined that the PoE port has a load abnormality; for those determined to be... The PoE port with abnormal load is identified by analyzing the numerical characteristics of the output voltage and output current. When the output voltage is normal but the output current is zero, it is identified as an open circuit fault. When the output voltage is close to zero and the output current exceeds the rated current, it is identified as a short circuit fault. The corresponding protection operation is executed according to the fault type. The electronic switch of the PoE port identified as having a short circuit fault is immediately disconnected and the fault code is recorded. The PoE port identified as having an open circuit fault is kept powered and the alarm information is recorded. The fault code and alarm information are uploaded to the management platform via serial port.
[0091] In one specific embodiment, the intelligent box output power adjustment method further includes:
[0092] The SOC filter value is continuously collected for multiple cycles. If the SOC filter value of each cycle remains within the threshold range corresponding to the operating condition level after the switch and the SOC change rate of adjacent cycles is less than the preset value, the operating condition level switch is determined to be stable.
[0093] For PoE ports that are in a power-off state, power supply commands for each PoE port are generated sequentially and sent to the PoE power supply unit at preset intervals, controlling the electronic switches of each PoE port to close sequentially.
[0094] Specifically, based on a timer scheduler, continuous data is collected from the solar controller at fixed intervals (e.g., every 6 seconds). Within each cycle, serial port response frames are parsed, SOC values are extracted, CRC checks are performed, and filtering is conducted to obtain a set of SOC filtered value data with time-series characteristics. When the system detects that the operating condition level is about to switch from a low level to a high level (e.g., from level 1 to level 2, or from level 2 to level 3), it enters the operating condition switching stability judgment stage. In this stage, a continuous observation window is started, covering multiple adjacent sampling cycles, such as three consecutive cycles. The SOC filtered values generated in each cycle are recorded and cached, and their range is determined and their rate of change is evaluated. It is determined whether all SOC filtered values in each cycle are within the threshold range corresponding to the new target operating condition level. For example, if the target is level 2, all SOC filtered values must be greater than or equal to the normal power threshold T2 (e.g., 20%) and less than the high power threshold T1 (e.g., 80%) to eliminate misjudgments caused by short-term fluctuations. The SOC value between adjacent cycles is calculated using a percentage increase or decrease rate obtained by dividing the absolute difference by the previous cycle value. This percentage is then compared to a preset threshold. For example, if the threshold is set to 2%, the SOC change rate between any two consecutive cycles must not exceed this limit. If any change rate exceeds the limit, the operating condition is deemed unstable, the current operating condition switchover is canceled, and the original state is maintained. When the SOC filter value for three consecutive cycles is within the legal range, and adjacent change rates are all below the preset threshold, the current operating condition switchover is officially confirmed as effective and stable, and the power restoration phase begins. During the power restoration phase, a port restoration queue is constructed. Power supply control words for each target port are generated sequentially according to port number or preset priority order and sent one by one at timer-driven intervals. For example, if one port is set to be restored every 5 seconds, the controller will send the power supply control word for the first target port at the first moment, then wait 5 seconds before sending the control word for the second port, and so on, until all target ports are restored. Each power supply control word is still constructed using a bitmask format, only enabling the corresponding bit of the current target port to ensure that other ports remain in their original state. The control word is transmitted to the control chip inside the PoE power supply unit, such as the RTL239C, via the SPI interface. After receiving the instruction, the chip performs a soft-start closing operation on the target port, gradually increasing the output power until the rated level, preventing surge current impact caused by multiple ports being powered on simultaneously.
[0095] In one specific embodiment, for PoE ports in a power-off state, power supply commands for each PoE port are generated sequentially and sent to the PoE power supply unit at preset intervals, controlling the electronic switches of each PoE port to close sequentially, including:
[0096] Extract the port number and port level of the PoE port in the power-off state from the port level configuration table, sort them in ascending order of port level, and obtain the port recovery queue.
[0097] Starting from the head of the port recovery queue, the port number of each PoE port is retrieved in sequence to generate the corresponding power supply command and send it to the PoE power supply unit. After each power supply command is sent, a timer is started to delay for a preset time interval before sending the next power supply command, thereby controlling the electronic switches of each PoE port to close in sequence.
[0098] Specifically, the system extracts information on all PoE ports in a power-off state from the current port level configuration table. The configuration table records the port number, port level, and power status flag of each PoE port in a structured data format. The main control unit traverses the port level configuration table and combines it with the status cache of the previous round of power supply commands to filter out port entries marked as "power off" in the current power supply state. It then extracts the port number and port level value contained in each record, forms a temporary dataset, and sorts it in ascending order using the port level value as the primary sorting key. This constructs a port recovery queue arranged in descending order of level, where a smaller value indicates a higher level, meaning that ports that are prioritized for recovery are placed at the head of the queue. The main control logic module processes each port recovery task sequentially according to the queue order. It retrieves the first port number from the head of the queue and constructs a power supply control word based on that number. The control word is generated using a standard bitmask method. For example, if port 3 needs recovery, bit 2 of the constructed control word is set to "1" to indicate that port is enabled, while other bits are set to "0" to avoid affecting other ports whose execution timing has not yet arrived. The power supply control word is transmitted to the control chip of the PoE power supply unit via the SPI interface. After receiving the chip, it closes the electronic switch of the corresponding port according to a preset soft-start mode and gradually increases the output power to the rated power value using a linearly increasing duty cycle, ensuring a smooth power-on of the load. After the control word is successfully sent and the chip's execution response is received, the main control system starts a high-precision timer to control the interval between the next power supply command transmissions. The time interval is a system-preset safe recovery interval, such as 5 to 10 seconds, to prevent a sudden increase in load caused by multiple ports recovering simultaneously. After the timer countdown ends, it triggers the next round of queue dequeueing, retrieves the second port number to generate a power supply control word, and repeats the above steps until the port recovery queue is empty. Once all ports have completed power restoration in sequence, the port power status table is refreshed and key data such as the timestamp, control word sequence, and power response code of this restoration operation are recorded. At the same time, this information is uploaded to the remote monitoring platform via the RS485 bus so that maintenance personnel can remotely view the power restoration process and the restoration order of each port.
[0099] The above describes the intelligent box output power regulation method in the embodiments of the present invention. The following describes the intelligent box output power regulation system in the embodiments of the present invention. Please refer to [link / reference]. Figure 2 One embodiment of the intelligent box output power regulation system of the present invention includes:
[0100] Create module 11 to create a port level configuration table for the PoE port of the smart box and set the high power threshold and normal power threshold;
[0101] The verification module 12 is used to read the serial port data of the solar controller and verify it to obtain valid data. The SOC value in the valid data is filtered to obtain the SOC filtered value.
[0102] Comparison module 13 is used to compare the SOC filter value with the high power threshold and the normal power threshold to determine the operating condition level;
[0103] The execution module 14 is used to perform a power-off operation or a power-on operation on the POE port according to the port level configuration table and the operating condition level.
[0104] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0105] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0106] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for regulating the output power of an intelligent box, characterized in that, include: Create a port class configuration table for the PoE port of the smart box, and set high power threshold and normal power threshold; Read the serial port data of the solar controller and verify it to obtain valid data. Filter the SOC value in the valid data to obtain the SOC filtered value. The SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level; Specifically, this includes: comparing the SOC filter value with the high battery threshold; when the SOC filter value is greater than or equal to the high battery threshold, determining the operating condition level as the third operating condition level; when the SOC filter value is less than the high battery threshold, comparing the SOC filter value with the normal battery threshold; when the SOC filter value is greater than or equal to the normal battery threshold, determining the operating condition level as the second operating condition level; and when the SOC filter value is less than the normal battery threshold, determining the operating condition level as the first operating condition level. Based on the port level configuration table and the operating condition level, a power-off operation or a power-on operation is performed on the PoE port; specifically, this includes: traversing the port level configuration table, filtering out PoE ports whose port level is greater than the operating condition level, generating a power-off command and sending it to the PoE power supply unit to control the electronic switch of the PoE port to open; traversing the port level configuration table, filtering out PoE ports whose port level is less than or equal to the operating condition level, generating a power-on command and sending it to the PoE power supply unit to control the electronic switch of the PoE port to close.
2. The intelligent box output power adjustment method according to claim 1, characterized in that, Create a port level configuration table for the PoE port of the smart box, and set high power threshold and normal power threshold, including: The port level configuration table is obtained by mapping the PoE port of the smart box to the first port level, the second port level, or the third port level through the configuration interface. Set high battery threshold and normal battery threshold.
3. The intelligent box output power adjustment method according to claim 1, characterized in that, Read and verify the serial port data from the solar controller to obtain valid data. Filter the SOC value in the valid data to obtain the filtered SOC value, including: A query frame containing the slave address, function code, register start address, and number of registers is constructed according to the Modbus RTU protocol, and the query frame is sent to the solar controller through the serial port interface; Receive the response frame returned by the solar controller, extract the SOC value of the battery and the photovoltaic charging current from the data field of the response frame, and obtain serial port data; The serial port data is verified to obtain valid data, and the SOC value in the valid data is filtered to obtain the SOC filtered value. The SOC filter value is compared with the high power threshold and the normal power threshold to determine the operating condition level.
4. The intelligent box output power adjustment method according to claim 3, characterized in that, The system receives a response frame from the solar controller, extracts the battery's SOC value and photovoltaic charging current from the data field of the response frame, and obtains serial port data, including: Receive the response frame returned by the solar controller, and locate the start position and byte length of the data field from the response frame; The first byte in the data field is parsed as the SOC value of the battery, the second byte is parsed as the photovoltaic charging current, and the serial port data is returned.
5. The intelligent box output power adjustment method according to claim 1, characterized in that, Traverse the port level configuration table, filter out PoE ports whose port level is less than or equal to the operating condition level, generate a power supply command and send it to the PoE power supply unit, and control the closing of the electronic switch of the PoE port, including: Traverse the port level configuration table, filter out PoE ports whose port level is less than or equal to the operating condition level, and generate control words according to the filtered PoE port numbers. The control words use bitmasks to identify the power supply status of each PoE port to obtain power supply commands. The power supply command is sent to the chip of the POE power supply unit. The chip uses a soft-start method to control the closing of the electronic switch of the corresponding POE port and increase the output power of the POE port to the rated power.
6. The intelligent box output power adjustment method according to claim 1, characterized in that, The intelligent box output power adjustment method further includes: The SOC filter value is continuously collected for multiple cycles. If the SOC filter value of each cycle remains within the threshold range corresponding to the operating condition level after the switch and the SOC change rate of adjacent cycles is less than the preset value, the operating condition level switch is determined to be stable. For PoE ports that are in a power-off state, power supply commands for each PoE port are generated sequentially and sent to the PoE power supply unit at preset intervals, controlling the electronic switches of each PoE port to close sequentially.
7. The intelligent box output power adjustment method according to claim 6, characterized in that, For PoE ports that are in a power-off state, power supply commands are generated sequentially for each PoE port and sent to the PoE power supply unit at preset intervals, controlling the electronic switches of each PoE port to close sequentially, including: Extract the port number and port level of the PoE port in the power-off state from the port level configuration table, sort them in ascending order of port level, and obtain the port recovery queue. Starting from the head of the port recovery queue, the port number of each PoE port is retrieved in sequence to generate the corresponding power supply command and send it to the PoE power supply unit. After each power supply command is sent, a timer is started to delay for a preset time interval before sending the next power supply command, thereby controlling the electronic switches of each PoE port to close in sequence.
8. A smart box output power regulation system, characterized in that, The method for performing the intelligent box output power regulation method as described in any one of claims 1-7 includes: Create a module to create a port level configuration table for the PoE port of the smart box and set high power threshold and normal power threshold; The verification module is used to read the serial port data of the solar controller and verify it to obtain valid data. The SOC value in the valid data is filtered to obtain the SOC filtered value. The comparison module is used to compare the SOC filter value with the high power threshold and the normal power threshold to determine the operating condition level; The execution module is used to perform a power-off operation or a power-on operation on the PoE port according to the port level configuration table and the operating condition level.
Citation Information
Patent Citations
Intelligent box power supply method, system and device and storage medium
CN117458723A
Low-power-consumption vehicle-mounted intelligent Internet of Things terminal device and control method thereof
CN121325683A