An energy storage gateway, a power control method, an electronic device, and a program product
By introducing a main control chip and real-time Ethernet protocol into the energy storage gateway, the problem of the energy storage gateway being unable to balance synchronous response and differentiated power distribution when managing multiple energy storage converters is solved, thus realizing the safe and efficient operation of the energy storage power station.
Patent Information
- Application Number
- CN202611429518.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-15
- Publication Date
- 2026-11-24
AI Technical Summary
In existing technologies, when managing multiple energy storage converters, energy storage gateways cannot simultaneously ensure synchronous response and differentiated power distribution, leading to operational safety and efficiency issues.
By introducing a main control chip into the energy storage gateway, the uplink and downlink communication interfaces are expanded, and high-speed real-time communication with multiple energy storage converters is carried out using the real-time Ethernet protocol. The main control chip performs power allocation according to scheduling instructions and status data, and ensures that each energy storage converter executes power regulation instructions synchronously through a clock synchronization mechanism.
It enables synchronous response and differentiated power allocation of multiple energy storage converters, improving the operational safety of energy storage power stations and the real-time and accuracy of power regulation, while reducing resource consumption.
Smart Images

Figure CN123163203A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication control technology, and in particular to an energy storage gateway, a power control method, an electronic device, and a program product. Background Technology
[0002] Power conversion systems (PCS) in large-scale energy storage power plants typically employ a string configuration, offering advantages such as independent battery management, high conversion efficiency, and flexible expansion. Since the response time of individual PCS units varies, multiple PCS units are usually controlled by a single energy storage gateway (also known as a substation controller).
[0003] In existing technologies, energy storage gateways and individual PCSs typically communicate via RS-485 bus or Controller Area Network (CAN) bus. Each PCS is connected to the same bus, and power regulation commands are issued via broadcast or sequential transmission. However, when using broadcast transmission, each PCS can only respond to the same power regulation command, making it difficult to adapt to different states of charge of each PCS and affecting operational safety. When using sequential transmission, there is a time difference in command reception between PCS, leading to untimely responses, and the sequential communication consumes significant bus resources. Summary of the Invention
[0004] This invention provides an energy storage gateway, a power control method, an electronic device, and a program product to solve the problem in the prior art that when the same energy storage gateway manages multiple energy storage converters, it is impossible to simultaneously take into account synchronous response and differentiated power allocation.
[0005] In a first aspect, embodiments of the present invention provide an energy storage gateway, comprising: a main control chip, wherein the main control chip is extended to form an uplink communication interface for communicating with a scheduling system, and multiple downlink communication interfaces for communicating with multiple energy storage converters respectively; The main control chip is used to receive scheduling instructions issued by the scheduling system through the uplink communication interface, and to receive status data fed back by each of the energy storage converters through the downlink communication interface. The main control chip is also used to allocate power to each of the energy storage converters according to the scheduling instructions and the status data, and generate power adjustment instructions corresponding to each of the energy storage converters. The main control chip is also used to send each of the power adjustment commands to the corresponding energy storage converter through the downlink communication interface using the real-time Ethernet protocol.
[0006] In one possible implementation, the main control chip is further configured to send a clock synchronization command carrying a reference clock to each of the energy storage converters, so that each of the energy storage converters adjusts its local clock according to its own transmission delay and the reference clock, so that the local clock of each of the energy storage converters is aligned with the reference clock, so that each of the energy storage converters executes the corresponding power regulation command at the same clock time. The reference clock is the system clock of the first energy storage converter in the series-connected energy storage converters.
[0007] In one possible implementation, the main control chip is further configured to send synchronization frames to each of the energy storage converters and receive the arrival time of the synchronization frames, which are recorded based on their respective local clocks, from each of the energy storage converters; determine the transmission time of the link between adjacent energy storage converters based on the arrival time of each pair of arrival frames, and accumulate the transmission times of each adjacent link segment by segment to obtain the transmission delay of each energy storage converter relative to the reference clock, and send the transmission delay to the corresponding energy storage converter.
[0008] In one possible implementation, the downlink communication interface includes a Fast Peripheral Interconnect (FPI) interface connected to a first switching chip, the first switching chip including multiple downlink ports. Multiple energy storage converters are connected in series. The first downlink port is used to connect to the input port of the first energy storage converter in the series, and the second downlink port is used to connect to the output port of the last energy storage converter in the series, so as to form a ring communication link.
[0009] In one possible implementation, the uplink communication interface includes a native media access control interface, which is expanded into multiple network ports via a second switching chip, and the energy storage gateway communicates with the scheduling system via the network ports.
[0010] In one possible implementation, the main control chip includes multiple processing cores, including a first processing core for processing communication with the scheduling system, and a second processing core for issuing power regulation commands to each of the energy storage converters through the downlink communication interface; the processing cores transfer data with lock-free atomic operations. The energy storage gateway further includes a ring buffer for instruction distribution and a ring buffer for status upload based on lock-free read and write operations using atomic variables. The ring buffer for instruction distribution is used to transmit the scheduling instructions between the first processing core and the second processing core, and the ring buffer for status upload is used to transmit the status data of each of the energy storage converters between the second processing core and the first processing core.
[0011] In one possible implementation, the real-time Ethernet protocol is the EtherCAT protocol.
[0012] Secondly, embodiments of the present invention provide a power control method applied to an energy storage gateway, the energy storage gateway including a main control chip, the main control chip being extended to form an uplink communication interface for communicating with a scheduling system, and multiple downlink communication interfaces for communicating with multiple energy storage converters respectively, the method including: The system receives scheduling instructions from the scheduling system through the uplink communication interface and status data fed back by each energy storage converter through the downlink communication interface. Based on the scheduling instructions and the status data, power is allocated to each of the energy storage converters, and power adjustment instructions corresponding to each of the energy storage converters are generated. Through the downlink communication interface, the power adjustment commands are sent one by one to the corresponding energy storage converter using the real-time Ethernet protocol.
[0013] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the power control method described in the second aspect above.
[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the power control method described in the second aspect above.
[0015] Fifthly, embodiments of the present invention provide a computer program product, including a computer program that, when executed by a processor, implements the power control method described in the second aspect above.
[0016] This invention expands the main control chip to form an uplink communication interface for communication with the scheduling system and multiple downlink communication interfaces for communication with multiple energy storage converters. The downlink communication interfaces use the real-time Ethernet protocol to achieve high-speed real-time communication with multiple energy storage converters. The main control chip performs power allocation based on scheduling instructions and status data fed back by each energy storage converter, generates power adjustment instructions for each energy storage converter, and sends them to the corresponding energy storage converter one by one. This enables differentiated power allocation for each converter while allowing each energy storage converter to execute power adjustment instructions synchronously. This solves the problem in the prior art where a single substation controller cannot simultaneously achieve synchronous response and differentiated power allocation when managing multiple energy storage converters, and reduces the resource consumption caused by communication with each converter individually. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the structure of the energy storage gateway provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of the energy storage gateway provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of the energy storage gateway provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of each processing core in the main control chip provided by an embodiment of the present invention; Figure 5 This is a flowchart illustrating the implementation of the power control method provided in this embodiment of the invention. Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0019] Before introducing the technical solution of this invention, the application scenarios of this technical solution will be described first. The technical solution provided by the embodiments of this invention can be applied to any scenario that requires unified management and power regulation of multiple energy storage converters.
[0020] In practical applications, one Power Conversion System (PCS) manages one string of batteries. In large-scale energy storage power plants, multiple string power conversion systems are typically connected in parallel, with each system managing its corresponding battery string, and all controlled by a single energy storage gateway.
[0021] For example, when power control of each energy storage converter is required, based on the technical solution provided in this embodiment, the energy storage gateway receives power scheduling instructions issued by the scheduling system through the uplink communication interface, and allocates power according to the state of charge and other status data reported by each energy storage converter, generating differentiated power adjustment instructions corresponding to each energy storage converter. For example, a larger discharge power is allocated to energy storage converters with a higher state of charge, and a larger charging power is allocated to energy storage converters with a lower state of charge, so that the state of charge of each battery cluster tends to be balanced, avoiding overcharging or over-discharging of individual battery clusters and ensuring the safe operation of the energy storage power station. The energy storage gateway establishes a high-speed real-time communication link with each energy storage converter through the real-time Ethernet protocol, and sends the differentiated power adjustment instructions to each energy storage converter at high speed and in real time, so that each energy storage converter executes synchronously, achieving the goal of taking into account the differentiated power allocation of each energy storage converter while ensuring the synchronous response of multiple energy storage converters.
[0022] It should be noted that the energy storage gateway in this embodiment of the invention can be applied to an energy storage power station. It communicates with the scheduling system (specifically, the energy management system) to receive scheduling instructions and report the status data of each energy storage converter. It also communicates with multiple energy storage converters to issue power adjustment instructions to each converter, thereby realizing unified scheduling and precise control of the power of the energy storage power station.
[0023] like Figure 1 As shown, the energy storage gateway in this embodiment of the invention may include: a main control chip 1, which is extended to form an uplink communication interface for communicating with the scheduling system 2, and multiple downlink communication interfaces for communicating with multiple energy storage converters 3 respectively. The main control chip 1 is used to receive scheduling instructions issued by the scheduling system 2 through the uplink communication interface, and to receive status data fed back by each energy storage converter 3 through the downlink communication interface. The main control chip 1 is used to allocate power to each energy storage converter 3 according to the scheduling instructions and status data, and generate power adjustment instructions corresponding to each energy storage converter 3. The main control chip 1 is used to send power adjustment commands to the corresponding energy storage converter 3 through the downlink communication interface using the real-time Ethernet protocol.
[0024] The energy storage gateway is a device that connects the dispatch system 2 to multiple energy storage converters 3, and is used for unified management and power control of these converters. It is equivalent to a substation controller in an energy storage power station. The main control chip 1 is the processor in the energy storage gateway used to execute data processing and control logic; specifically, it can be a microcontroller unit (MCU). Expansion refers to the main control chip 1 connecting to corresponding communication devices to form corresponding communication interfaces. The uplink communication interface is the interface between the energy storage gateway and the dispatch system 2; the downlink communication interface is the interface between the energy storage gateway and each energy storage converter 3.
[0025] Dispatch system 2 refers to the upper-level control system that issues dispatch commands to the energy storage gateway. Specifically, it can be an Energy Management System (EMS), a grid dispatch system 2, or a voltage stabilization system. For example, when the energy storage power station needs to adjust the charging and discharging power of each energy storage converter 3 according to grid dispatch requirements, the energy management system can issue dispatch commands to the energy storage gateway; or, when grid voltage fluctuates and the energy storage power station needs to regulate voltage to maintain grid voltage stability, the voltage stabilization system can issue dispatch commands to the energy storage gateway. In other words, dispatch system 2 can be any system that requires unified power dispatch and precise control of the energy storage power station. Energy storage converter 3 refers to the equipment in the energy storage power station used to convert DC to AC power and perform power regulation.
[0026] Dispatch instructions refer to the instructions issued by dispatch system 2 to indicate the overall power regulation target of the energy storage power station. Status data refers to data reflecting the operating status of the energy storage converter 3 itself, specifically including information such as the state of charge, operating power, and operating status of the energy storage converter 3. Power regulation instructions refer to instructions issued to each energy storage converter 3 to instruct it to perform specific power regulation. Real-time Ethernet protocol refers to an Ethernet protocol with real-time transmission capabilities that guarantees the real-time and deterministic nature of data transmission, specifically including EtherCAT (Ethernet for Control Automation Technology), PROFINET (Process Field Network), and EtherNet / IP (Ethernet Industrial Protocol), etc.
[0027] In this embodiment, the uplink communication interface can communicate with the scheduling system 2 based on the Ethernet protocol, and the downlink communication interface 10 can communicate with each energy storage converter 3 based on the real-time Ethernet protocol. That is, the uplink and downlink communication of the energy storage gateway can be implemented using different communication protocols. The main control chip 1 can parse the scheduling command and obtain the target power carried in the scheduling command; determine the available power of each energy storage converter 3 based on the status data of each energy storage converter 3; determine the power allocation ratio corresponding to each energy storage converter 3 based on the available power and target power of each energy storage converter 3, and allocate the target power to each energy storage converter 3 according to the power allocation ratio, generating the power adjustment command corresponding to each energy storage converter 3. Among them, the available power of each energy storage converter 3 can be determined based on the state of charge of each energy storage converter 3. For example, for energy storage converter 3 with a higher state of charge, it is determined that it has a larger available discharge power; for energy storage converter 3 with a lower state of charge, it is determined that it has a larger available charging power. In this way, the energy storage gateway can perform differentiated power allocation according to the actual operating status of each energy storage converter 3, so that each energy storage converter 3 can perform power regulation actions according to the power matching its own operating status, avoid overcharging or over-discharging of individual energy storage converters 3, and ensure the operational safety of the energy storage power station.
[0028] Furthermore, the main control chip 1 can communicate with each energy storage converter 3 via the downlink communication interface using the real-time Ethernet protocol. The real-time Ethernet protocol is used to send each power adjustment command to the corresponding energy storage converter 3, so that each energy storage converter 3 receives the corresponding power adjustment command and executes the corresponding power adjustment action, thereby ensuring that each energy storage converter 3 executes the power adjustment command synchronously.
[0029] The specific implementation of the real-time Ethernet protocol is as follows: Taking the EtherCAT protocol as an example, the main control chip 1 acts as the EtherCAT master station, and each energy storage converter 3 acts as an EtherCAT slave station. The main control chip 1, through the downlink communication interface, uses the EtherCAT protocol to write each power regulation command into the data segment corresponding to each energy storage converter 3 in the Ethernet data frame, and then sends the Ethernet data frame to each energy storage converter 3. The Ethernet data frame is transmitted sequentially among the series-connected energy storage converters 3. When the Ethernet data frame passes through itself, each energy storage converter 3 reads its corresponding power regulation command from the Ethernet data frame and executes the corresponding power regulation action. Furthermore, each energy storage converter 3 executes the corresponding power regulation action within the same communication cycle, thereby achieving synchronous response of multiple energy storage converters 3. Because the real-time Ethernet protocol has a defined communication cycle and real-time transmission capability, it can ensure that each power regulation command is sent to each energy storage converter 3 within the defined communication cycle, thus ensuring that each energy storage converter 3 executes the power regulation command synchronously.
[0030] Optionally, the main control chip 1 can also report the status data of each energy storage converter 3 to the scheduling system 2 through the uplink communication interface, so that the scheduling system 2 can make scheduling decisions based on the status data of each energy storage converter 3. Furthermore, the main control chip 1 can also periodically send power regulation commands to each energy storage converter 3 through each downlink communication interface using the real-time Ethernet protocol, so as to periodically refresh the power regulation commands corresponding to each energy storage converter 3, enabling each energy storage converter 3 to perform corresponding power regulation actions according to the updated power regulation commands.
[0031] This invention expands the main control chip 1 to form an uplink communication interface for communication with the scheduling system 2 and multiple downlink communication interfaces for communication with multiple energy storage converters 3 respectively. The downlink communication interface uses the real-time Ethernet protocol to conduct high-speed real-time communication with multiple energy storage converters 3. The main control chip 1 performs power allocation according to the scheduling instructions and the status data fed back by each energy storage converter 3, generates power adjustment instructions corresponding to each energy storage converter 3 and sends them to the corresponding energy storage converter 3 one by one. This enables differentiated power allocation for each energy storage converter 3, while enabling each energy storage converter 3 to execute the power adjustment instructions synchronously. This solves the problem in the prior art that the same substation controller cannot take into account both synchronous response and differentiated power allocation when managing multiple energy storage converters 3, and reduces the resource occupation caused by communication with each energy storage converter 3, thereby improving the real-time performance, accuracy and operational safety of power regulation in energy storage power stations.
[0032] It should be noted that for some energy storage converters 3 that do not support the real-time Ethernet protocol, a communication conversion chip can be installed in the energy storage converter 3. This communication conversion chip integrates the real-time Ethernet protocol. Optionally, the communication conversion chip may include two network ports, which are used to connect to the previous and next communication nodes of the energy storage converter 3 in the real-time Ethernet communication link, respectively. The communication conversion chip receives real-time Ethernet protocol data through the two network ports and converts the real-time Ethernet protocol data into Serial Peripheral Interface (SPI) protocol data. Then, it communicates with the microcontroller unit (MCU) of the energy storage converter 3 through the SPI protocol, thereby enabling the energy storage converter 3 that does not support the real-time Ethernet protocol to connect to the real-time Ethernet communication link and realize real-time communication with the energy storage gateway.
[0033] In order to enable each energy storage converter 3 to execute power regulation commands based on a unified clock reference and ensure the synchronization of power regulation actions of each energy storage converter 3, optionally, the main control chip 1 is also used to send a clock synchronization command carrying a reference clock to each energy storage converter 3, so that each energy storage converter 3 adjusts its local clock according to its own transmission delay and reference clock, so that the local clock of each energy storage converter 3 is aligned with the reference clock, so that each energy storage converter 3 executes the corresponding power regulation command at the same clock time.
[0034] Clock synchronization refers to the process of aligning the local clock of each energy storage converter 3 with a reference clock. The clock synchronization command is a command sent by the main control chip 1 to each energy storage converter 3, instructing each energy storage converter 3 to perform clock synchronization. The clock synchronization command carries a reference clock. The reference clock is the clock used as the local clock adjustment reference for each energy storage converter 3. In this embodiment, the reference clock is the system clock of the first energy storage converter in the series-connected energy storage converters 3. The system clock is the clock in the energy storage converter 3 used to provide a time reference. The local clock is the clock maintained by the energy storage converter 3 itself, used to determine the execution time of the action. Transmission delay refers to the time delay experienced by data transmission in the communication link. In this embodiment, it can be the time delay experienced by data transmission between the energy storage converter 3 and the first energy storage converter. The same clock moment refers to the same point in time determined by each energy storage converter 3 based on its aligned local clock, used to execute the power regulation command. Series connection refers to a connection method formed by connecting multiple energy storage converters 3 sequentially. In the series-connected energy storage converters 3, each energy storage converter 3 is arranged in the connection order; the first energy storage converter refers to the energy storage converter 3 that is the first in the connection order, and its system clock is used as the reference clock. The energy storage converters 3 are connected in series via real-time Ethernet protocol, and the energy storage gateway is connected to this series network through a downlink communication interface.
[0035] In this embodiment, the main control chip 1 sends a clock synchronization command carrying a reference clock to each energy storage converter 3 via a downlink communication interface using a real-time Ethernet protocol. The clock synchronization command is transmitted step-by-step along the series link formed by the sequentially connected energy storage converters 3. Since the reference clock is the system clock of the first energy storage converter in the series-connected energy storage converters 3, the main control chip 1 can obtain the system clock of the first energy storage converter through the downlink communication interface and determine the system clock of the first energy storage converter as the reference clock. After receiving the clock synchronization command, each energy storage converter 3 adjusts its local clock according to its own transmission delay and the reference clock carried in the clock synchronization command, so that the local clock of each energy storage converter 3 is aligned with the reference clock. After the local clock is aligned with the reference clock, each energy storage converter 3 executes the corresponding power adjustment action at the same clock time according to its corresponding power adjustment command, thereby realizing that multiple energy storage converters 3 synchronously execute power adjustment commands at the same clock time.
[0036] Furthermore, each energy storage converter 3 adjusts its local clock according to its own transmission delay and reference clock. Specifically, each energy storage converter 3 determines a delay compensation value for adjusting its local clock based on its transmission delay with the first energy storage converter, and adjusts its local clock according to the delay compensation value and the reference clock to align the local clock of each energy storage converter 3 with the reference clock. Since the transmission delays of energy storage converters 3 located at different positions in the series link are different, by determining the delay compensation value according to their respective transmission delays, the clock deviation caused by the different times when the clock synchronization command is received between the energy storage converters 3 can be eliminated, thereby improving the accuracy of the alignment between the local clock of each energy storage converter 3 and the reference clock.
[0037] As an example, the clock offset of each energy storage converter 3 can be calculated according to the following formula: ΔT = Tlocal - D - Tref; In the formula, Tref is the current value of the reference clock; D is the transmission delay of the energy storage converter 3 relative to the reference clock (i.e., the delay compensation value); Tlocal is the local clock reading of the energy storage converter 3; ΔT is the clock deviation (the amount used to backtrack / forward the local clock). When ΔT is positive, it indicates that the local clock is ahead, and the local clock of the energy storage converter 3 is backtracked by the corresponding time length of ΔT; when ΔT is negative, it indicates that the local clock is lagging, and the local clock of the energy storage converter 3 is advanced by the corresponding time length of ΔT; and the larger the absolute value of ΔT, the greater the time adjustment required. After compensation, the local clocks of each energy storage converter 3 are aligned with the reference clock, thus obtaining a unified time reference.
[0038] For example, suppose the transmission delay D is 20 microseconds (i.e., the delay compensation value), the current value of the reference clock Tref is 1000 microseconds, and the local clock reading Tlocal of the energy storage converter 3 is 1040 microseconds. Then, when the reference clock is transmitted to the energy storage converter 3, the corresponding reading is 1020, and the local clock lead is 1040-1020=20, that is, ΔT=1040-20-1000=20. Since ΔT is positive, the local clock is reversed by 20 microseconds. It can be seen that this 20 microsecond deviation is determined by the difference relationship between the local clock, the transmission delay, and the reference clock.
[0039] The aforementioned clock synchronization can be achieved through the Distributed Clocks (DC) mechanism of the EtherCAT protocol. Specifically, the main control chip 1 sends a clock synchronization command carrying a reference clock to each energy storage converter 3 via the downlink communication interface based on the EtherCAT protocol. Each energy storage converter 3 determines its transmission delay with the first energy storage converter based on the distributed clock mechanism, and adjusts its local clock according to its own transmission delay and reference clock to align the local clock of each energy storage converter 3 with the system clock of the first energy storage converter.
[0040] The main control chip 1 can periodically send clock synchronization commands carrying reference clocks to each energy storage converter 3 via the downlink communication interface using the real-time Ethernet protocol. After receiving the clock synchronization command each time, each energy storage converter 3 periodically adjusts its local clock according to its current transmission delay and reference clock to keep the local clock of each energy storage converter 3 continuously aligned with the reference clock.
[0041] After clock synchronization is completed, the main control chip 1 can send agreed-upon power execution cycle information to each energy storage converter 3, for example, agreeing on a power execution cycle of 1 millisecond. Each energy storage converter 3 performs power adjustment at the beginning of each power execution cycle. Each energy storage converter 3 uses its aligned local clock to determine the target clock time for executing the power adjustment command, and automatically triggers the execution of the corresponding power adjustment command when the target clock time is reached. Since the local clocks of each energy storage converter 3 are aligned with the reference clock, the target clock time determined by each energy storage converter 3 is the same clock time. Therefore, even if the time when each energy storage converter 3 receives the power adjustment command differs, each energy storage converter 3 can synchronously execute the corresponding power adjustment command at the same clock time, thereby achieving synchronous power adjustment of multiple energy storage converters 3.
[0042] Based on the aforementioned clock synchronization mechanism, the main control chip 1 sends a clock synchronization command carrying a reference clock to each energy storage converter 3, enabling each energy storage converter 3 to adjust its local clock according to its own transmission delay and the reference clock, thus aligning the local clock of each energy storage converter 3 with the reference clock. Since the reference clock is the system clock of the first energy storage converter in the series-connected energy storage converter 3, each energy storage converter 3 uses a unified reference clock for clock alignment, eliminating clock deviations introduced by different transmission delays between the energy storage converter 3. After the local clock of each energy storage converter 3 is aligned with the reference clock, it can execute the corresponding power regulation command at the same clock moment. Even if the time when each energy storage converter 3 receives the power regulation command differs, it can still ensure that each energy storage converter 3 executes the power regulation action synchronously at the same clock moment, thereby avoiding power regulation deviations caused by inconsistent clocks of each energy storage converter 3 executing the power regulation command. By synchronizing the clocks, each energy storage converter 3 executes power regulation commands synchronously at the same clock time, which improves the synchronicity and accuracy of power regulation of multiple energy storage converters 3 and ensures the safe operation of the energy storage power station.
[0043] In order to enable each energy storage converter 3 to correct its local clock according to its transmission delay relative to the reference clock, and to ensure that the local clock of each energy storage converter 3 can be accurately aligned with the reference clock, the main control chip 1 is optionally also used to send synchronization frames to each energy storage converter 3 and receive the arrival time of the synchronization frames recorded by each energy storage converter 3 based on its local clock; according to each arrival time, the transmission time of the link between adjacent energy storage converters 3 is determined, and the transmission time of each adjacent link is accumulated segment by segment to obtain the transmission delay of each energy storage converter 3 relative to the reference clock, and the transmission delay is sent to the corresponding energy storage converter 3.
[0044] In this context, a synchronization frame refers to a data frame sent by the main control chip 1 to each energy storage converter 3 to determine the transmission delay of each energy storage converter 3 relative to the reference clock. The arrival time refers to the moment when an energy storage converter 3 receives the synchronization frame; each energy storage converter 3 records this arrival time based on its local clock. Adjacent energy storage converters 3 refer to two adjacent energy storage converters 3 connected in series. A link refers to the transmission channel for communication between adjacent energy storage converters 3. Transmission time refers to the time elapsed for the synchronization frame to be transmitted on the link between adjacent energy storage converters 3. Segment-by-segment accumulation refers to the process of sequentially adding the transmission times of each adjacent link according to the series connection order.
[0045] The main control chip 1 can send synchronization frames to each energy storage converter 3 via the downlink communication interface using the real-time Ethernet protocol. These synchronization frames are transmitted sequentially among the series-connected energy storage converters 3. Each energy storage converter 3 records the arrival time of the synchronization frame based on its local clock as the frame passes through it, and feeds this arrival time back to the main control chip 1. Based on the arrival times fed back by each energy storage converter 3, the main control chip 1 determines the transmission time of the link between adjacent energy storage converters 3, and accumulates the transmission times of each adjacent link segment to obtain the transmission delay of each energy storage converter 3 relative to the reference clock. The main control chip 1 then sends the corresponding transmission delay of each energy storage converter 3 to its respective energy storage converter 3, so that each energy storage converter 3 adjusts its local clock according to its corresponding transmission delay, aligning its local clock with the reference clock.
[0046] Optionally, the main control chip 1 determines the transmission time of the link between adjacent energy storage converters 3 based on the arrival times. Specifically, for any two adjacent energy storage converters 3 connected in series, the main control chip 1 obtains the arrival times of the synchronization frames fed back by the two adjacent energy storage converters 3, and determines the transmission time of the link between the two adjacent energy storage converters 3 based on the difference between the arrival times recorded by the two adjacent energy storage converters 3. For example, for energy storage converters A and B that are adjacent in the series connection sequence, where energy storage converter B is the next stage energy storage converter after energy storage converter A in the series connection sequence, the transmission time of the link between energy storage converter A and energy storage converter B can be determined based on the difference between the arrival time recorded by energy storage converter B and the arrival time recorded by energy storage converter A.
[0047] Furthermore, the main control chip 1 can sequentially accumulate the transmission times of each adjacent link between the first energy storage converter and the target energy storage converter 3 according to the series connection order to obtain the transmission delay of the target energy storage converter 3 relative to the reference clock. Since the reference clock is the system clock of the first energy storage converter, the transmission delay of the first energy storage converter relative to the reference clock is zero. For the kth energy storage converter 3 located after the first energy storage converter in the series connection order, where k is a positive integer greater than 1, the transmission delay of the kth energy storage converter 3 relative to the reference clock is the sum of the transmission times of each adjacent link between the first energy storage converter and the kth energy storage converter 3.
[0048] Furthermore, the main control chip 1 can periodically send synchronization frames to each energy storage converter 3 via the downlink communication interface using the real-time Ethernet protocol, and periodically receive the arrival times of the synchronization frames recorded by each energy storage converter 3 based on their respective local clocks. Based on the arrival times of each feedback, the main control chip 1 periodically determines the transmission delay of each energy storage converter 3 relative to the reference clock, and sends the updated transmission delay to the corresponding energy storage converter 3. This allows each energy storage converter 3 to adjust its local clock in real time according to the updated transmission delay, maintaining continuous alignment between the local clock of each energy storage converter 3 and the reference clock. Since the link state between the energy storage converters 3 may change, periodically sending synchronization frames and updating the transmission delay ensures that the transmission delay used by each energy storage converter 3 matches the current link state, improving the accuracy of clock synchronization.
[0049] It should be noted that the synchronization frame and the aforementioned clock synchronization command can be the same data frame. Specifically, the main control chip 1 can send a synchronization frame carrying a reference clock to each energy storage converter 3 via the downlink communication interface using the real-time Ethernet protocol. After receiving the synchronization frame, each energy storage converter 3 records the arrival time of the synchronization frame based on its local clock and feeds back the arrival time to the main control chip 1. The main control chip 1 determines the transmission delay of each energy storage converter 3 relative to the reference clock based on each arrival time and sends each transmission delay to the corresponding energy storage converter 3. By simultaneously achieving clock synchronization and transmission delay determination through the same data frame, the number of data interactions between the main control chip 1 and each energy storage converter 3 can be reduced, thus reducing the consumption of communication resources.
[0050] Based on the aforementioned transmission delay determination method, the main control chip 1 sends synchronization frames to each energy storage converter 3 and receives the arrival time of the synchronization frames recorded by each energy storage converter 3 based on its own local clock. It can determine the transmission time of the link between adjacent energy storage converters 3 based on each arrival time, and accumulate the transmission times of each adjacent link segment by segment to obtain the transmission delay of each energy storage converter 3 relative to the reference clock. Therefore, there is no need to configure additional delay measurement devices in each energy storage converter 3. The transmission delay of each energy storage converter 3 relative to the reference clock can be accurately determined based on the transmission process of the synchronization frames between the series-connected energy storage converters 3, improving the accuracy of transmission delay determination. Simultaneously, since the main control chip 1 sends the corresponding transmission delay of each energy storage converter 3 to the corresponding energy storage converter 3, each energy storage converter 3 can adjust its own local clock based on its accurate transmission delay, ensuring that the local clock of each energy storage converter 3 is precisely aligned with the reference clock. This guarantees that each energy storage converter 3 synchronously executes the corresponding power regulation command at the same clock time.
[0051] To ensure redundant transmission paths for communication between the energy storage gateway and each energy storage converter 3, guaranteeing continued communication even if a segment of the ring communication link fails, optionally, in some embodiments, see [reference needed]. Figure 2 The downlink communication interface 10 includes a fast peripheral interconnect interface, which connects to the first switching chip 4. The first switching chip 4 includes multiple downlink ports. Multiple energy storage converters 3 are connected in series. The first downlink port 40 is used to connect to the input port of the first energy storage converter in the series connection, and the second downlink port 41 is used to connect to the output port of the last energy storage converter in the series connection, to form a ring communication link. It should be noted that... Figure 2 The number of energy storage converters 3 is just an example. There can be 3 or 12 energy storage converters, which can be set according to actual needs. This embodiment does not limit the number of energy storage converters 3.
[0052] The high-speed peripheral interconnect interface refers to the interface for high-speed data communication between the main control chip 1 and the first switching chip 4, used to realize data transmission between the main control chip 1 and the first switching chip 4. The first switching chip 4 is a switching chip used to expand and form multiple downlink ports, realizing the forwarding and switching of data between the energy storage gateway and the energy storage converter 3. For example, the first switching chip 4 can be a PCIe (Peripheral Component Interconnect Express) switching chip. The downlink port refers to the port on the first switching chip 4 used to connect to the energy storage converter 3 and perform data communication.
[0053] In the series-connected energy storage converters 3, each energy storage converter 3 is arranged sequentially according to the connection order. The first energy storage converter refers to the energy storage converter that is the first in the connection order among the series-connected energy storage converters. The last energy storage converter refers to the energy storage converter that is the last in the connection order among the series-connected energy storage converters. The input port refers to the port on the energy storage converter 3 used to receive data, which is used to receive data transmitted from the preceding communication node. The output port refers to the port on the energy storage converter 3 used to output data, which is used to transmit data to the following communication node. The ring communication link refers to the communication link formed by connecting the first and last ends of the series-connected energy storage converters 3 to the first switching chip 4, which enables data to be transmitted in a ring between the energy storage converters 3.
[0054] The first downlink port 40 of the first switching chip 4 is connected to the input port of the first energy storage converter in the series-connected energy storage converters, and the second downlink port 41 of the first switching chip 4 is connected to the output port of the last energy storage converter in the series-connected energy storage converters. Thus, the first switching chip 4 and the series-connected energy storage converters together form a ring communication link. The main control chip 1 sends the power regulation command to be sent to the first switching chip 4 through the fast peripheral interconnect interface. The first switching chip 4 sends the power regulation command to the input port of the first energy storage converter through the first downlink port 40. The power regulation command is transmitted sequentially among the series-connected energy storage converters 3 and returns to the second downlink port 41 of the first switching chip 4 through the output port of the last energy storage converter, thus completing the transmission of the power regulation command among the energy storage converters 3.
[0055] Optionally, in the ring communication link, the first switching chip 4 can also send the power regulation command to the output port of the last energy storage converter through the second downlink port 41. This allows the power regulation command to be transmitted sequentially among the series-connected energy storage converters 3 in the opposite direction to the aforementioned transmission direction, and then return to the first downlink port 40 of the first switching chip 4 via the input port of the first energy storage converter. Since the ring communication link provides two transmission directions for communication between the energy storage gateway and each energy storage converter 3, if a link in one transmission direction fails, the power regulation command can still be sent to each energy storage converter 3 through the other transmission direction, thereby improving the reliability of communication between the energy storage gateway and each energy storage converter 3.
[0056] Optionally, the first switching chip 4 can monitor the communication status of each downlink port in real time. When a fault is detected in a segment of the ring communication link, the first switching chip 4 sends power regulation commands to each energy storage converter 3 through a link in another transmission direction. For example, when a fault occurs in the link between two adjacent energy storage converters connected in series, the first switching chip 4 can send the power regulation commands sequentially through the last energy storage converter to each energy storage converter through the second downlink port 41, thereby ensuring that the power regulation commands can still be transmitted to each energy storage converter 3, avoiding communication interruption due to a single point of failure, and ensuring the normal management of multiple energy storage converters 3 by the energy storage gateway.
[0057] Optionally, the multiple downlink ports of the first switching chip 4 can be divided into multiple groups, with each group of downlink ports forming a ring communication link. For example, the first and second downlink ports of the first switching chip 4 form a first ring communication link, the third and fourth downlink ports of the first switching chip 4 form a second ring communication link, and so on. Each group of ring communication links is connected to a corresponding group of series-connected energy storage converters 3, thereby enabling the energy storage gateway to manage multiple groups of series-connected energy storage converters 3 simultaneously through the same first switching chip 4, improving the management capacity and expansion flexibility of the energy storage gateway for the energy storage converters 3.
[0058] Based on the downlink communication interface configuration, the main control chip 1 connects to the first switching chip 4 via a fast peripheral interconnect interface. The first switching chip 4 then connects to the series-connected energy storage converters 3 via multiple downlink ports, enabling the energy storage gateway to forward and manage data from multiple energy storage converters 3 through the first switching chip 4. Since the first downlink port 40 connects to the input port of the first energy storage converter in the series-connected energy storage converters 3, and the second downlink port 41 connects to the output port of the last energy storage converter in the series-connected energy storage converters 3, a connection is formed between the first switching chip 4 and the series-connected energy storage converters 3. The ring communication link provides two transmission directions for communication between the energy storage gateway and each energy storage converter 3. When a section of the ring communication link fails, communication between the energy storage gateway and each energy storage converter 3 can still be achieved through the other transmission direction, avoiding communication interruption caused by single-point link failure and improving the reliability of communication between the energy storage gateway and each energy storage converter 3. At the same time, the main control chip 1 is connected to the first switching chip 4 through the fast peripheral interconnect interface, and the number of connected energy storage converters 3 is expanded by using multiple downlink ports of the first switching chip 4, which improves the expansion flexibility of the energy storage gateway.
[0059] To enable the energy storage gateway to communicate with the dispatch system 2 via multiple network ports, thereby improving the flexibility and reliability of uplink communication and meeting the interface requirements for uplink communication between the energy storage gateway and the dispatch system 2, optionally, in some embodiments, see [reference needed]. Figure 3 The uplink communication interface includes a native media access control interface 11, which is expanded into multiple network ports by the second switching chip 5. The energy storage gateway communicates with the scheduling system 2 through the network ports.
[0060] Media Access Control (MAC) refers to the mechanism that controls the transmission of data over a communication medium. The native MAC interface 11 refers to the MAC interface integrated into the main control chip 1, through which the main control chip 1 connects to the second switching chip 5. The second switching chip 5 is a switching chip used to expand the native MAC interface 11 of the main control chip 1 into multiple network ports, enabling data forwarding and switching between the energy storage gateway and the dispatching system 2. It is used for uplink communication of the energy storage gateway. A network port refers to a port used for network communication with external devices. The second switching chip 5 expands the native MAC interface 11 into multiple network ports, through which the energy storage gateway communicates with the dispatching system 2. For example, the second switching chip 5 can be a one-to-two switching chip, expanding into two network ports for communication with the dispatching system 2. The two network ports respectively receive different types of messages sent by the dispatching system 2.
[0061] In this embodiment, the main control chip 1 connects to the second switching chip 5 through its integrated native media access control interface 11. The second switching chip 5 expands the native media access control interface 11 into multiple network ports. The energy storage gateway communicates with the scheduling system 2 through at least one of the multiple network ports expanded by the second switching chip 5 to receive scheduling instructions issued by the scheduling system 2 and report the status data of each energy storage converter 3 to the scheduling system 2.
[0062] Optionally, the multiple network ports formed by the second switching chip 5 can be used to communicate with different external devices. For example, the energy storage gateway can communicate with the dispatch system 2 through the first network port among the multiple network ports, and communicate with other external devices through the other network ports. These other external devices can specifically be local monitoring equipment, remote maintenance equipment, or the backup dispatch system 2, etc. By setting up multiple network ports, the energy storage gateway can communicate with multiple external devices simultaneously, improving the flexibility and scalability of the energy storage gateway's uplink communication.
[0063] Optionally, the energy storage gateway can communicate with the dispatch system 2 simultaneously through at least two of its multiple network ports to form a redundant communication link. When the network port currently used by the energy storage gateway to communicate with the dispatch system 2 fails, the energy storage gateway can switch to another network port to communicate with the dispatch system 2, thereby ensuring the continuity of communication between the energy storage gateway and the dispatch system 2 and improving the reliability of uplink communication.
[0064] In practical implementation, the main control chip 1 sends data to be sent to the dispatch system 2 to the second switching chip 5 through the native media access control interface 11. The second switching chip 5 sends the data to the dispatch system 2 through the corresponding network port according to the communication status of each network port. The second switching chip 5 is also used to receive data sent by the dispatch system 2 through each network port and forward the received data to the main control chip 1 through the native media access control interface 11. The second switching chip 5 performs data forwarding management and port status management for each network port to realize data interaction between the energy storage gateway and the dispatch system 2.
[0065] It should be noted that the uplink communication interface includes two native media access control interfaces 11. The two native media access control interfaces 11 are respectively connected to a second switching chip 5. Both second switching chips 5 communicate with the energy storage gateway to achieve redundant communication.
[0066] Based on the above-mentioned uplink communication interface configuration, the native media access control interface 11 is expanded into multiple network ports through the second switching chip 5, enabling the energy storage gateway to communicate with the dispatch system 2 through multiple network ports. When one network port fails, the energy storage gateway can switch to other network ports to communicate with the dispatch system 2, ensuring the continuity of communication between the energy storage gateway and the dispatch system 2 and improving the reliability of uplink communication. At the same time, multiple network ports can also be used to communicate with multiple external devices, improving the flexibility and scalability of the energy storage gateway's uplink communication.
[0067] To enable parallel processing of multiple tasks within the energy storage gateway, ensuring that each task does not interfere with the others, guaranteeing the real-time performance and consistency of data transmission between processing cores within the energy storage gateway, and avoiding system jitter, the main control chip 1 may optionally include multiple processing cores. These multiple processing cores include a first processing core for handling communication with the scheduling system 2, and a second processing core for issuing power regulation commands to each energy storage converter 3 via the downlink communication interface 10. Data is transmitted between the processing cores using lock-free atomic operations. The multiple processing cores also include a third processing core for responding to system interrupts and a fourth processing core for handling blocking communication tasks.
[0068] A processing core refers to the processor core in the main control chip 1 that independently executes instructions and processes data. Each processing core can execute different processing tasks. The first processing core is the one among multiple processing cores used for communication with the scheduling system 2, specifically for data interaction with the scheduling system 2 via the uplink communication interface. The second processing core is the one among multiple processing cores used to issue power regulation commands to each energy storage converter 3 via the downlink communication interface 10. The third processing core is the one among multiple processing cores used to respond to system interrupts, which can include timer interrupts, communication interrupts, etc. The third processing core responds immediately upon detecting a system interrupt to ensure timely system handling of interrupts. The fourth processing core is the one among multiple processing cores used to handle blocking communication tasks. Blocking communication tasks can specifically be communication tasks that require waiting for a response from the communication peer and will block the current task execution until the response returns. By having the fourth processing core handle blocking communication tasks independently, the processing resources of other processing cores can be avoided, thus ensuring that real-time processing tasks with high requirements, such as the power regulation commands issued by the second processing core, can be executed in a timely manner.
[0069] In this embodiment, data can be transferred between processing cores using lock-free atomic operations, thereby enabling multiple processing cores to process their respective tasks in parallel while avoiding lock contention issues when multiple processing cores concurrently access shared data.
[0070] The energy storage gateway also includes a ring buffer for instruction distribution and a ring buffer for status upload based on lock-free read and write based on atomic variables. The ring buffer for instruction distribution is used to transmit scheduling instructions between the first processing core and the second processing core, and the ring buffer for status upload is used to transmit the status data of each energy storage converter 3 between the second processing core and the first processing core.
[0071] Among these, "lock-free" means that multiple processing cores can access shared data without mutual exclusion through locking mechanisms. An atomic operation is an operation that cannot be interrupted and whose execution cannot be interrupted by other operations; its atomicity can be guaranteed by hardware. Lock-free atomic operations refer to a method of safely transferring data between multiple processing cores without locking, based on atomic operations. An atomic variable is a variable that supports atomic operations; read and write operations on atomic variables will not be interrupted by concurrent operations on other processing cores, thus ensuring data consistency. A circular buffer is a buffer with a fixed storage capacity that uses read and write pointers to cyclically utilize storage space to transfer data. An instruction delivery circular buffer is a circular buffer based on atomic variables for lock-free read and write operations, used to transfer scheduling instructions between the first and second processing cores. A status upload circular buffer is a circular buffer based on atomic variables for lock-free read and write operations, used to transfer status data of each energy storage converter 3 between the second and first processing cores.
[0072] Specifically, the first processing core can receive scheduling instructions from the scheduling system 2 via the uplink communication interface, and then write the scheduling instructions into the instruction distribution ring buffer through lock-free atomic operations. The second processing core can read the scheduling instructions from the instruction distribution ring buffer through lock-free atomic operations, and generate power regulation instructions corresponding to each energy storage converter 3 according to the scheduling instructions, and then send them to each energy storage converter 3 through the downlink communication interface 10. The second processing core can also receive status data fed back from each energy storage converter 3 via the downlink communication interface 10, and then write the status data into the status upload ring buffer through lock-free atomic operations. The first processing core can read the status data from the status upload ring buffer through lock-free atomic operations, and then report the status data to the scheduling system 2 through the uplink communication interface. Each processing core writes and reads data based on atomic variables. The atomicity of atomic variable read and write operations is guaranteed by hardware. That is, the read and write operations of atomic variables will not be interrupted by concurrent operations of other processing cores during the execution process. This ensures the consistency of data when processing cores access shared data concurrently. There is no need to serialize the access of each processing core to shared data through locking, avoiding the processing delay and performance overhead caused by lock contention.
[0073] For example, in an implementation running a Linux system, the above lock-free read and write can be achieved using C11 standard atomic variables, without using operating system mutexes and semaphores, avoiding threads getting trapped in kernel scheduling, thereby reducing software jitter and improving the determinism of communication.
[0074] Optionally, the instruction issuance ring buffer and the status upload ring buffer can implement data reading and writing based on read pointers and write pointers, respectively. Specifically, the data writing processing core updates the write pointer through atomic variables and writes the data to be transferred to the storage location pointed to by the write pointer in the ring buffer; the data reading processing core updates the read pointer through atomic variables and reads the data from the storage location pointed to by the read pointer in the ring buffer. Since the updates of both the read and write pointers are based on atomic variables, lock-free data reading and writing can be achieved between the data writing processing core and the data reading processing core without the need for locking, thereby avoiding the processing delay caused by locking and ensuring the correctness of data transfer between processing cores.
[0075] Based on the aforementioned multi-core architecture, the main control chip 1 sets up multiple processing cores and assigns tasks such as communication with the scheduling system 2, issuing power regulation commands to each energy storage converter 3, responding to system interrupts, and handling blocking communication tasks to different processing cores. This allows each processing core to execute its tasks in parallel, avoiding processing delays caused by serial processing by a single processing core and improving the data processing efficiency and real-time performance of the energy storage gateway. Since data is transferred between processing cores using lock-free atomic operations, and through a circular buffer for instruction issuance based on atomic variables and a circular buffer for status upload in the first... The first and second processing cores can exchange scheduling instructions and status data without the need for locking to mutually exclude access to shared data. This avoids processing delays and performance overhead caused by lock contention, further improving the efficiency of data transfer between the first and second processing cores and ensuring the real-time performance and consistency of scheduling instructions and status data transmission within the energy storage gateway. Simultaneously, by having the third processing core respond to system interrupts and the fourth processing core handle blocking communication tasks, tasks with high real-time requirements are separated from blocking communication tasks. This prevents blocking communication tasks from affecting the system's response to real-time tasks, further ensuring the real-time performance of power regulation commands.
[0076] To meet the requirements for high real-time and high deterministic communication between multiple energy storage converters 3 and to ensure the real-time and synchronous issuance of power regulation commands by each energy storage converter 3, the EtherCAT protocol can be selected as the real-time Ethernet protocol.
[0077] Among them, EtherCAT (Ethernet for Control Automation Technology) is an industrial real-time communication protocol based on Ethernet. It adopts a communication structure consisting of a master station and slave stations. The master station communicates with multiple slave stations through Ethernet frames. Each slave station processes the data corresponding to itself in the Ethernet frame in real time when the Ethernet frame passes through it, thereby achieving high real-time and high deterministic communication with multiple slave stations in a single communication cycle.
[0078] In this embodiment, the energy storage gateway can communicate with each energy storage converter 3 via the downlink communication interface 10 using the EtherCAT protocol. The main control chip 1 acts as the EtherCAT master, and each energy storage converter 3 acts as an EtherCAT slave. The main control chip 1 encapsulates the power regulation commands corresponding to each energy storage converter 3 into Ethernet frames via the downlink communication interface 10 using the EtherCAT protocol, and sends the Ethernet frames to each energy storage converter 3. The Ethernet frames are transmitted sequentially among the series-connected energy storage converters 3. Each energy storage converter 3 reads its corresponding power regulation command from the Ethernet frame as it passes through it, and writes its own status data into the Ethernet frame. After the Ethernet frame returns to the main control chip 1, the main control chip 1 reads the status data of each energy storage converter 3 from the Ethernet frame. Through this method, the main control chip 1 can complete the issuance of power regulation commands to each energy storage converter 3 and the acquisition of status data of each energy storage converter 3 within a single communication cycle.
[0079] Optionally, the EtherCAT protocol supports each slave station in processing data in the Ethernet frame in real time as the Ethernet frame passes through it. Each energy storage converter 3 can read its corresponding power regulation command and write its own status data from the Ethernet frame without waiting for the entire Ethernet frame to be received, thereby shortening the communication cycle to the microsecond level. By adopting the EtherCAT protocol, the main control chip 1 can send each power regulation command to each energy storage converter 3 within a defined communication cycle, and each energy storage converter 3 can synchronously execute the corresponding power regulation command within the defined communication cycle, thus ensuring the real-time and deterministic nature of the power regulation command issuance.
[0080] In conjunction with the aforementioned clock synchronization mechanism, the EtherCAT protocol supports a distributed clock mechanism, enabling the energy storage gateway to synchronize the clocks of each energy storage converter 3 based on this distributed clock mechanism. Specifically, the main control chip 1 sends a synchronization frame carrying a reference clock to each energy storage converter 3 via the downlink communication interface 10 using the EtherCAT protocol. Each energy storage converter 3 determines its transmission delay relative to the reference clock based on the distributed clock mechanism of the EtherCAT protocol, and adjusts its local clock according to its own transmission delay and the reference clock, aligning the local clock of each energy storage converter 3 with the reference clock, thereby ensuring that each energy storage converter 3 synchronously executes the corresponding power regulation command at the same clock time.
[0081] In conjunction with the aforementioned ring communication link, the EtherCAT protocol supports communication redundancy in a ring topology. Specifically, a ring communication link is formed between the energy storage gateway and the series-connected energy storage converters 3. The main control chip 1 sends power regulation commands to each energy storage converter 3 along the first transmission direction via the EtherCAT protocol. When a segment of the ring communication link fails, the main control chip 1 can send power regulation commands to each energy storage converter 3 along the second transmission direction via the EtherCAT protocol, ensuring that each energy storage converter 3 can still receive the corresponding power regulation commands. This avoids communication interruption between the energy storage gateway and each energy storage converter 3 due to a single point of failure, thus improving communication reliability.
[0082] When the main control chip 1 issues power regulation commands to each energy storage converter 3 via the EtherCAT protocol, it can determine the corresponding energy storage converter 3 using either location addressing or station address addressing. Location addressing refers to determining the data area corresponding to each energy storage converter 3 in the Ethernet frame by following the sequential passage of the Ethernet frame through each energy storage converter 3; station address addressing refers to determining the data area corresponding to each energy storage converter 3 in the Ethernet frame according to the pre-configured station address. The main control chip 1 writes each power regulation command into the data area corresponding to each energy storage converter 3 in the Ethernet frame, enabling each energy storage converter 3 to read its corresponding power regulation command from the Ethernet frame.
[0083] Based on the aforementioned EtherCAT protocol configuration, since the EtherCAT protocol adopts a communication structure consisting of a master station and slave stations, with the master control chip 1 acting as the master station and each energy storage converter 3 acting as a slave station, it can complete the issuance of power regulation commands and the acquisition of status data for multiple energy storage converters 3 within a single communication cycle via Ethernet frames. Furthermore, each energy storage converter 3 processes the data in the frame in real time as the Ethernet frame passes through it, without waiting for the entire Ethernet frame to be received, thus shortening the communication cycle to the microsecond level and ensuring the real-time and deterministic nature of the power regulation command issuance. Simultaneously, the EtherCAT protocol supports a distributed clock mechanism, which can cooperate with the aforementioned clock synchronization mechanism to ensure that the local clock of each energy storage converter 3 is precisely aligned with the reference clock, guaranteeing that each energy storage converter 3 executes the corresponding power regulation command synchronously at the same clock moment. The EtherCAT protocol also supports communication redundancy in a ring topology, which can cooperate with the aforementioned ring communication link to ensure communication between the energy storage gateway and each energy storage converter 3 even in the event of a single-point link failure, improving communication reliability.
[0084] To further clarify the technical solutions of the embodiments of this application for those skilled in the art, the following description is provided in conjunction with specific application scenarios. This embodiment provides an energy storage gateway with high real-time redundant communication based on a multi-port composite architecture, which can run on a hardware architecture equipped with an i.MX 8M Plus processor (i.MX8MP) with four processing cores. This embodiment takes a centralized controller that controls multiple energy storage converters as an example, which is the energy storage gateway (also called a substation controller). This embodiment aims to solve the problems of improving power response speed, avoiding sudden data interference from large traffic volumes on multiple ports, and ensuring effective communication with the dispatching system (specifically, an Energy Management System, EMS) in complex network environments when the energy storage gateway manages multiple energy storage converters.
[0085] In this embodiment, the system network communication architecture of the main control chip in the energy storage gateway consists of two parts: a native dual-media access control interface extended by a second switching chip (Ethernet switch chip), and a Peripheral Component Interconnect Express (PCIe) interface extended by a first switching chip (PCIe switch chip). Upward communication between the energy storage gateway and the scheduling system is achieved through the second switching chip, while downward communication between the energy storage gateway and each energy storage converter is achieved through a dual-redundant EtherCAT (Ethernet for Control Automation Technology) protocol (i.e., real-time Ethernet protocol) extended by the first switching chip, ensuring the reliability and stability of communication.
[0086] Specifically, in terms of upward communication, the two native media access control interfaces of the main control chip, through the second switching chip, define a fast network for Generic Object Oriented Substation Events (GOOSE) and a slow communication network for Manufacturing Message Specifications (MMS), respectively. The energy storage gateway communicates upward with the dispatching system through the native media access control interfaces and the second switching chip, thereby avoiding mutual interference between upward and downward communication.
[0087] For downstream communication, the main control chip connects to the first switching chip via a high-speed peripheral interconnect interface (HSI). The first switching chip then expands the network port, and hardware physical isolation prevents interference between upstream and downstream communication. The HSI channels can carry both EtherCAT and Modbus TCP protocols (based on Transmission Control Protocol, TCP) to enable communication between the control network and the data network. The use of EtherCAT ensures precise control and rapid data synchronization for each energy storage converter.
[0088] To achieve inter-core isolation, the four processing cores of the main control chip each undertake different processing tasks. For example, see [link to example]. Figure 4 The first processing core is the core of the GOOSE data and software main task. It receives high-priority GOOSE messages stripped and forwarded by the first processing core at the data link layer, runs the main control business process, and executes control algorithms for multiple energy storage converters in combination with GOOSE event status and station control instructions to generate power regulation instructions for each energy storage converter. The first processing core can also store the power regulation instructions in the instruction distribution ring buffer. The second processing core is the real-time control core, which completely shields external hardware interrupts, runs the EtherCAT redundant master station thread, obtains power regulation instructions from the instruction distribution ring buffer, and distributes power regulation instructions to each energy storage converter, executing stably at a period of 150 microseconds. The third processing core is a general-purpose task processing core, used to take over the system timer and all non-critical peripheral interrupts, and run general system tasks; the fourth processing core is a general-purpose protocol interrupt processing core, used to receive mixed messages, and through the kernel's network card multi-queue or soft interrupt diversion mechanism, to intercept the parsing work of standard network stacks such as Manufacturing Message Specification (MMS) in IEC61850 standard and Modbus TCP in the fourth processing core. It can also send messages with high priority processing in mixed messages to the first processing core, so that the first processing core can run the main control business process, execute the control algorithm of multiple energy storage converters, and generate power regulation commands corresponding to each energy storage converter.
[0089] Furthermore, the energy storage gateway can perform the aforementioned inter-core isolation allocation and interrupt isolation in an operating system equipped with a real-time preemption (PREEMPT_RT) patch. System interrupts are centrally placed on the corresponding processing cores, ensuring that system interrupts do not affect communication with upstream or downstream systems. This guarantees that each real-time processing core only executes its own processing tasks without being interrupted by other tasks or functions. Specifically, to prevent the hardware interrupts and protocol stack parsing of the first and second Ethernet controllers (specifically, an Enhanced Quality of Service (EQOS) Ethernet controller and a Fast Ethernet Controller (FEC) integrated into the main control chip from dragging down the entire system when simultaneously receiving large volumes of MMS data and GOOSE real-time messages, the underlying hardware interrupts of the first Ethernet controller, the second Ethernet controller, and the Fast Peripheral Interconnect Ethernet controller (specifically, a LAN743x series Ethernet controller) can be strictly bound to the fourth processing core. The fourth processing core will then handle these hardware interrupts uniformly and, through the kernel's network card multi-queue or soft interrupt offloading mechanism, retain the MMS and Modbus TCP standard network stack parsing work within the fourth processing core.
[0090] This embodiment also modifies the driver layer by establishing an independent channel through modifications to the driver code. For fast data such as GOOSE and EtherCAT, the application directly reads Direct Memory Access (DMA) data without going through the Linux driver layer and Linux Ethernet protocol stack. The fast channel responds immediately, thus bypassing all intermediate steps such as memory copying and directly responding to data.
[0091] This embodiment employs a completely lock-free software architecture, utilizing C11-based atomic variables to avoid the use of Linux system mutexes and semaphores, thus preventing system crashes in kernel scheduling and reducing software jitter. Specifically, all mutexes, semaphores, and queues in the Linux system are removed, and C11 atomic variables are used to establish instruction distribution and status upload circular buffers. When GOOSE data arrives, it is placed in the instruction distribution circular buffer, where the core computing unit in the main control chip performs power calculations and distributes the data to each energy storage converter. After the energy storage converter responds, the data is transmitted to the status upload circular buffer, which then sends the received data out via GOOSE. The entire process is lock-free and does not involve the Linux driver layer or the Linux Ethernet protocol stack.
[0092] The power response process in this embodiment is as follows: When GOOSE data (i.e., scheduling instructions) arrives, the data is directly transmitted to the application layer channel via hardware, and then directly to the downstream real-time control core via a lockless queue. After calculating the power of each energy storage converter, a power adjustment instruction is sent via hardware DMA using the EtherCAT protocol with a communication control cycle of 150 microseconds. After the energy storage converter responds, it reads directly from the EtherCAT channel to the energy storage gateway in the next control cycle with a cycle of 150 microseconds. The energy storage gateway bypasses the Linux driver layer and Linux network protocol stack to directly transmit the GOOSE hardware, thereby achieving extremely fast power response in complex controllers. The power response in this embodiment can reach the 1-millisecond level, while traditional control methods can usually only maintain within 100 milliseconds, generally around 50 milliseconds.
[0093] This embodiment avoids data source conflicts through hardware-level chip and data source isolation, as well as driver-level layering and priority definition; it avoids communication failures caused by system jitter through a completely lock-free software approach; and it achieves ultra-fast power response through the above architecture. While ensuring differentiated power allocation and synchronous response of multiple energy storage converters, it improves the real-time performance and reliability of the energy storage gateway in complex network environments, ensuring that the energy storage gateway can effectively respond to the communication of the scheduling system when managing multiple energy storage converters, and guaranteeing the stable realization of unified power scheduling and precise control of the energy storage power station.
[0094] like Figure 5 As shown, this embodiment of the invention provides a power control method, which can be applied to the aforementioned energy storage gateway. The energy storage gateway includes a main control chip, which is extended to form an uplink communication interface for communicating with a scheduling system, and multiple downlink communication interfaces for communicating with multiple energy storage converters respectively. The method includes the following steps: Step S1: Receive scheduling instructions issued by the scheduling system through the uplink communication interface, and receive status data fed back by each energy storage converter through the downlink communication interface.
[0095] Step S2: Based on the scheduling instructions and status data, power is allocated to each energy storage converter, and power adjustment instructions corresponding to each energy storage converter are generated.
[0096] Step S3: Through the downlink communication interface, the power adjustment commands are sent one by one to the corresponding energy storage converters using the real-time Ethernet protocol.
[0097] In one possible implementation, the main control chip is also used to send a clock synchronization command carrying a reference clock to each energy storage converter, so that each energy storage converter adjusts its local clock according to its own transmission delay and the reference clock, so that the local clock of each energy storage converter is aligned with the reference clock, so that each energy storage converter executes the corresponding power regulation command at the same clock time; wherein, the reference clock is the system clock of the first energy storage converter in the series-connected energy storage converters.
[0098] In one possible implementation, the main control chip is also used to send synchronization frames to each energy storage converter and receive the arrival time of the synchronization frames recorded by each energy storage converter based on its local clock; based on each arrival time, it determines the transmission time of the link between adjacent energy storage converters, and accumulates the transmission time of each adjacent link segment by segment to obtain the transmission delay of each energy storage converter relative to the reference clock, and sends the transmission delay to the corresponding energy storage converter.
[0099] In one possible implementation, the downlink communication interface includes a fast peripheral interconnect interface connected to a first switching chip, which includes multiple downlink ports; multiple energy storage converters are connected in series, with the first downlink port used to access the input port of the first energy storage converter in the series connection, and the second downlink port used to access the output port of the last energy storage converter in the series connection, to form a ring communication link.
[0100] In one possible implementation, the uplink communication interface includes a native media access control interface, which is expanded into multiple network ports by a second switching chip, and the energy storage gateway communicates with the scheduling system via the network ports.
[0101] In one possible implementation, the main control chip includes multiple processing cores, including a first processing core for processing communication with the scheduling system, and a second processing core for issuing power regulation commands to each energy storage converter through a downlink communication interface; data is transferred between the processing cores using lock-free atomic operations; the energy storage gateway also includes a command sending ring buffer and a status uploading ring buffer for lock-free reading and writing based on atomic variables, the command sending ring buffer is used to transfer scheduling commands between the first and second processing cores, and the status uploading ring buffer is used to transfer status data of each energy storage converter between the second and first processing cores.
[0102] In one possible implementation, the real-time Ethernet protocol is the EtherCAT protocol.
[0103] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0104] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. For example... Figure 6 As shown, the electronic device 6 in this embodiment includes a processor 60 and a memory 61. The memory 61 stores a computer program 62. When the processor 60 executes the computer program 62, it implements the steps in the various method embodiments described above. Alternatively, when the processor 60 executes the computer program 62, it implements the functions of the energy storage gateway described above.
[0105] For example, computer program 62 may be divided into one or more modules / units, which are stored in memory 61 and executed by processor 60 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of computer program 62 in electronic device 6.
[0106] Electronic device 6 may include, but is not limited to, processor 60 and memory 61. Those skilled in the art will understand that... Figure 6 This is merely an example of electronic device 6 and does not constitute a limitation on electronic device 6. It may include more or fewer components than shown, or combine certain components, or different components. For example, electronic device 6 may also include input / output devices, network access devices, buses, etc.
[0107] The processor 60 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0108] The memory 61 can be an internal storage unit of the electronic device 6, such as a hard disk or RAM. The memory 61 can also be an external storage device of the electronic device 6, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory 61 can include both internal and external storage units of the electronic device 6. The memory 61 is used to store the computer program 62 and other programs and data required by the electronic device 6. The memory 61 can also be used to temporarily store data that has been output or will be output.
[0109] For the sake of simplicity and clarity, only the above-described functional modules / units are used as examples. In practical applications, the functions described above can be assigned to different functional modules / units as needed. These modules / units can be implemented in hardware, software, or a combination of both.
[0110] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the power control methods described in the above-described method embodiments.
[0111] This invention also provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the power control methods in the above-described method embodiments.
[0112] Computer programs include computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. Computer-readable media can include: any entity or device capable of carrying computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0113] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. Unless otherwise specified or in conflict with logic, the terminology and / or descriptions between different embodiments are consistent and can be referenced interchangeably. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.
[0114] 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, and should all be included within the protection scope of the present invention.
Claims
1. An energy storage gateway, characterized in that, include: The main control chip is expanded to form an uplink communication interface for communicating with the scheduling system, and multiple downlink communication interfaces for communicating with multiple energy storage converters respectively. The main control chip is used to receive scheduling instructions issued by the scheduling system through the uplink communication interface, and to receive status data fed back by each of the energy storage converters through the downlink communication interface. The main control chip is also used to allocate power to each of the energy storage converters according to the scheduling instructions and the status data, and generate power adjustment instructions corresponding to each of the energy storage converters. The main control chip is also used to send each of the power adjustment commands to the corresponding energy storage converter through the downlink communication interface using the real-time Ethernet protocol.
2. The energy storage gateway according to claim 1, characterized in that, The main control chip is also used to send a clock synchronization command carrying a reference clock to each of the energy storage converters, so that each of the energy storage converters adjusts its local clock according to its own transmission delay and the reference clock, so that the local clock of each of the energy storage converters is aligned with the reference clock, so that each of the energy storage converters executes the corresponding power regulation command at the same clock time. The reference clock is the system clock of the first energy storage converter in the series-connected energy storage converters.
3. The energy storage gateway according to claim 2, characterized in that, The main control chip is also used to send synchronization frames to each of the energy storage converters and receive the arrival time of the synchronization frames recorded by each of the energy storage converters based on their respective local clocks; determine the transmission time of the link between adjacent energy storage converters according to the arrival time of each, and accumulate the transmission time of each adjacent link segment by segment to obtain the transmission delay of each energy storage converter relative to the reference clock, and send the transmission delay to the corresponding energy storage converter.
4. The energy storage gateway according to claim 1, characterized in that, The downlink communication interface includes a fast peripheral interconnect interface, which is connected to a first switching chip, and the first switching chip includes multiple downlink ports. Multiple energy storage converters are connected in series. The first downlink port is used to connect to the input port of the first energy storage converter in the series, and the second downlink port is used to connect to the output port of the last energy storage converter in the series, so as to form a ring communication link.
5. The energy storage gateway according to claim 1, characterized in that, The uplink communication interface includes a native media access control interface, which is expanded into multiple network ports by a second switching chip. The energy storage gateway communicates with the scheduling system via these network ports.
6. The energy storage gateway according to claim 1, characterized in that, The main control chip includes multiple processing cores, including a first processing core for processing communication with the scheduling system, and a second processing core for issuing power regulation commands to each of the energy storage converters through the downlink communication interface; the processing cores transmit data to each other using lock-free atomic operations. The energy storage gateway further includes a ring buffer for instruction distribution and a ring buffer for status upload based on lock-free read and write operations using atomic variables. The ring buffer for instruction distribution is used to transmit the scheduling instructions between the first processing core and the second processing core, and the ring buffer for status upload is used to transmit the status data of each of the energy storage converters between the second processing core and the first processing core.
7. The energy storage gateway according to claim 1, characterized in that, The real-time Ethernet protocol is the EtherCAT protocol.
8. A power control method, characterized in that, The method is applied to an energy storage gateway, which includes a main control chip. The main control chip is expanded to form an uplink communication interface for communicating with a scheduling system, and multiple downlink communication interfaces for communicating with multiple energy storage converters respectively. The system receives scheduling instructions from the scheduling system through the uplink communication interface and status data fed back by each energy storage converter through the downlink communication interface. Based on the scheduling instructions and the status data, power is allocated to each of the energy storage converters, and power adjustment instructions corresponding to each of the energy storage converters are generated. Through the downlink communication interface, the power adjustment commands are sent one by one to the corresponding energy storage converter using the real-time Ethernet protocol.
9. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the power control method as described in claim 8.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the power control method as described in claim 8.
