Address allocation methods, devices, energy storage systems, media and products for energy storage systems
By constructing a ring network topology in the energy storage system, the system allocates addresses along different directions using the central control and determines the number of addresses acquired using MAC addresses. This solves the address allocation problem when the main control link of the energy storage system is disconnected, achieving full-coverage address allocation and ensuring normal system operation.
Patent Information
- Application Number
- CN202611287948.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-17
AI Technical Summary
When the main control link of an existing energy storage system is disconnected, it is unable to successfully assign an address to the downstream main control at the location of the disconnection, which affects the normal communication and operation of the system. Furthermore, the existing solutions require additional wiring harness costs.
A ring network topology is formed by the master control and main control links. Addresses are allocated in different directions through the first and second ports to ensure that the address allocation of all main control can still be completed when the main control link is disconnected at any point. The number of addresses already acquired is determined by the MAC address and then reassigned in reverse to avoid increasing the cost of the wiring harness.
Without increasing wiring harness costs, full-coverage address allocation was achieved for the energy storage system when the main control link is disconnected, ensuring normal system communication and operation.
Smart Images

Figure CN123123314A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of battery energy storage technology, and in particular to an address allocation method, device, energy storage system, medium and product for an energy storage system. Background Technology
[0002] An energy storage system is a specific object or spatial area designated for energy storage and management. Existing energy storage systems may include a central controller and multiple master controllers. The central controller, also known as the Battery Array Unit (BAU), is responsible for monitoring and managing the battery status. Multiple master controllers communicate in a daisy-chain topology; these master controllers are also known as Battery Control Units (BCUs). To accurately distinguish and independently manage each master controller, reliable and efficient address allocation for each master controller is a prerequisite for the stable operation of the entire system.
[0003] Currently, when assigning addresses to the main controllers of an energy storage system, the address assignment command is usually transmitted to each main controller through the central controller. This method is highly dependent on the physical connectivity of the cascaded links between the main controllers. Once the link is broken, the downstream main controller at the broken point will be unable to successfully assign an address, thereby affecting the normal communication and operation of the entire energy storage system. Summary of the Invention
[0004] This invention provides an address allocation method, device, energy storage system, medium, and product for an energy storage system, to solve the problem that when the links connecting the main controllers of an energy storage system are disconnected, it is impossible to successfully allocate addresses to the downstream main controllers at the disconnection location. Without increasing the cost of wiring harnesses, it can still complete the address allocation of all main controllers when the links of the main controllers are disconnected at any location, thus helping the normal communication and operation of the energy storage system.
[0005] According to one aspect of the present invention, an address allocation method for an energy storage system is provided. The energy storage system deploys a central control unit and a main control link. The central control unit is connected to a first main control unit of the main control link via a first port and to a second main control unit of the main control link via a second port, forming a ring network topology. The method is applied to the central control unit. The address allocation method for the energy storage system includes: Through the first port, along the first link direction from the first master controller to the second master controller, addresses are sequentially assigned to each master controller, and the first number of master controllers whose addresses have been successfully assigned is recorded; Obtain the Media Access Control (MAC) address of each of the master controllers, and determine a second number of MAC addresses that have been obtained; If it is determined that the first quantity is less than the second quantity, an address is sequentially allocated to the master controller that has not been allocated an address through the second port along the second link direction from the second master controller to the first master controller.
[0006] According to another aspect of the present invention, an address allocation device for an energy storage system is provided. The energy storage system deploys a central control unit and a main control link. The central control unit is connected to a first main control unit of the main control link via a first port and to a second main control unit of the main control link via a second port, forming a ring network topology. The device is deployed at the central control unit. The address allocation device for the energy storage system includes: The first address allocation module is used to allocate addresses to each of the master controllers sequentially through the first port along the first link direction from the first master controller to the second master controller, and record the first number of master controllers that have been successfully allocated addresses; The MAC address determination module is used to obtain the MAC address of each of the main controllers and determine a second number of MAC addresses that have been obtained; The second address allocation module is used to allocate addresses to the master controllers that have not been allocated addresses sequentially through the second port along the second link direction from the second master controller to the first master controller when it is determined that the first quantity is less than the second quantity.
[0007] According to another aspect of the present invention, an energy storage system is provided, the energy storage system comprising: The system consists of a central control unit and a main control link. The central control unit is connected to the first main control unit of the main control link via a first port and to the second main control unit of the main control link via a second port, forming a ring network topology. At least one processor; and a memory communicatively connected to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the address allocation method of the energy storage system according to any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the address allocation method of the energy storage system according to any embodiment of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the address allocation method of the energy storage system according to any embodiment of the present invention.
[0010] The technical solution of this invention can be used in an energy storage system. The energy storage system deploys a central control unit and main control links. The central control unit communicates with a first main control unit on the main control link via a first port and with a second main control unit on the main control link via a second port, forming a ring network topology. The method is executed by the central control unit. The address allocation method of the energy storage system includes: sequentially allocating addresses to each main control unit along a first link direction from the first main control unit to the second main control unit via the first port, and recording a first number of main control units that have successfully allocated addresses; obtaining the MAC addresses of each main control unit and determining a second number of obtained MAC addresses; if the first number is less than the second number, sequentially allocating addresses to the unallocated main control units along a second link direction from the second main control unit to the first main control unit via the second port. This solves the problem that when the link connecting the main control units of the energy storage system is disconnected, it is impossible to successfully allocate addresses to downstream main control units at the disconnection point. Without increasing wiring costs, address allocation for all main control units can still be achieved even when the main control link is disconnected at any point, thus assisting in the normal communication and operation of the energy storage system.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart of an address allocation method for an energy storage system according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the structure of an energy storage system according to Embodiment 1 of the present invention; Figure 3 This is a schematic diagram of the communication interface connection of an energy storage system according to Embodiment 1 of the present invention; Figure 4 This is a flowchart of an address allocation method for an energy storage system according to Embodiment 2 of the present invention; Figure 5 This is a flowchart of another address allocation method for an energy storage system provided in Embodiment 2 of the present invention; Figure 6This is a schematic diagram of the structure of an address allocation device for an energy storage system according to Embodiment 3 of the present invention; Figure 7 This is a schematic diagram of the structure of an energy storage system that implements the address allocation method of the energy storage system according to an embodiment of the present invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0016] Example 1 Figure 1 This is a flowchart of an address allocation method for an energy storage system according to Embodiment 1 of the present invention. This embodiment is applicable to the situation of allocating addresses to each master controller when the master control link is disconnected. The method can be executed by the address allocation device of the energy storage system. The address allocation device of the energy storage system can be implemented in hardware and / or software and can be configured in the energy storage system.
[0017] Before detailing the address allocation method for the energy storage system, the energy storage system involved in this embodiment is described. Figure 2 This is a schematic diagram of the structure of an energy storage system according to Embodiment 1 of the present invention; as shown Figure 2 As shown, the system includes a central control and a main control link. The main control link contains multiple cascaded main controllers, BCU1, BCU2, ..., BCUn, which are connected in series via communication cables. Here, n can be any positive integer greater than 2, such as 10, 20, or 30, etc., and is not limited to it in this embodiment.
[0018] The master control is controlled through the first port (e.g., Figure 2 ETH1 in the main control link communicates with the first master controller (BCU1) through the second port (e.g., Figure 2 The ETH2 module is connected to the second master control communication module (BCUn) of the master control link, forming a ring network topology. Each BCU has two communication ports (JR1 and JR2), which are used to receive upstream signals and forward them to downstream signals, respectively, supporting the step-by-step transmission of pulse waves and message backhaul. The entire system adopts a single-master-multiple-slave, cascaded topology, which is suitable for the distributed management of battery clusters in large-scale energy storage power stations.
[0019] In this embodiment, the master control includes a first port and a second port. Both the first port and the second port can communicate with each master control in the master control link. Each master control in the master control link includes an input port and an output port. The communication port and the output port both include predefined transmit pins and predefined CAN bus pins. The input port includes predefined receive pins and predefined CAN bus pins.
[0020] Figure 3 This is a schematic diagram of the communication interface connection of an energy storage system according to Embodiment 1 of the present invention; as shown. Figure 3 As shown, the BAU (Master Controller Unit) and each BCU (Binary Control Unit) are connected via a physical ring network topology constructed using ETH1 and ETH2 dual channels. The ETH1 port of the BAU is connected to the JR1 interface of the first-level BCU via a blue dashed line. Each level of BCU is connected in a cascaded manner, meaning the JR2 interface of the preceding BCU is connected to the JR1 interface of the following BCU. The JR2 interface of the final-level BCU is connected back to the ETH2 port of the BAU via a yellow dashed line, forming a closed physical ring link. Figure 3 In this context, n is any positive integer greater than or equal to 2, and m is any positive integer greater than n.
[0021] To better understand the ports involved in this embodiment, the pins of each port are described in this embodiment. Table 1 is a pin definition table of the first port of a master control according to Embodiment 1 of the present invention; Table 2 is a pin definition table of the second port of a master control according to Embodiment 1 of the present invention; Table 3 is a pin definition table of the input port of a master control according to Embodiment 1 of the present invention; and Table 4 is a pin definition table of the output port of a master control according to Embodiment 1 of the present invention.
[0022] Table 1 Table 2 Table 3 Table 4 Table 1 shows the pin definitions for the first port of the master control. Pins 1, 2, 3, and 6 of this port are Ethernet transmit pins (ETH_TX+, ETH_TX-) and Ethernet receive pins (ETH_RX+, ETH_RX-), respectively, used for exchanging addressing and acknowledgment messages with the first master control. Pins 4 and 5 are predefined addressing pulse transmit pins (TX1+, TX1-), used to output trigger pulse waves that enable addressing to the first master control. Pins 7 and 8 are reserved pins.
[0023] Table 2 shows the pin definitions for the second port of the master control. Pins 1, 2, 3, and 6 of this port form Ethernet transmit pins (ETH_TX+, ETH_TX-) and Ethernet receive pins (ETH_RX+, ETH_RX-), used for data interaction with the second master control during the reverse addressing phase; pins 7 and 8 are predefined reverse addressing pulse transmit pins (TX2+, TX2-), used to output the reverse addressing enable trigger pulse wave to the second master control; pins 4 and 5 are reserved pins.
[0024] Table 3 shows the pin definitions for the main control input port. Pins 1, 2, 3, and 6 are Ethernet transmit pins (ETH_TX+, ETH_TX-) and Ethernet receive pins (ETH_RX+, ETH_RX-), used to send response messages to the upstream node and receive downlink commands. Pins 4 and 5 are predefined addressing pulse receive pins (RX1+, RX1-), used to receive enable addressing trigger pulse waves from the upstream node. Pins 7 and 8 are cascade transmit pins (TX2+, TX2-), used to transmit the received trigger pulse waves and data signals to the output port of this stage.
[0025] Table 4 shows the pin definitions for the master control output port. Compared to the master control input port, pins 4 and 5 are changed from predefined receive functions (RX1+, RX1-) to predefined addressing pulse transmission pins (TX1+, TX1-), and pins 7 and 8 are changed from cascaded transmit pins (TX2+, TX2-) to cascaded receive pins (RX2+, RX2-). The remaining pins (ETH_TX±, ETH_RX±) remain one-to-one and electrically compatible. In this way, after receiving the upstream trigger pulse through the input port, the master control can forward it losslessly to the downstream master control through the output port. Simultaneously, it relies on Ethernet pins to complete the return transmission of addressing acknowledgment messages, supporting chain-level addressing in a ring topology.
[0026] In this embodiment, each port uses a standard 8-pin Ethernet port. While retaining pins 1, 2, 3, and 6 for conventional Ethernet communication, redundant pins not involved in Ethernet communication are functionally reused: pins 4 and 5 are defined as address trigger channels (TX1± / RX1±), which can be used to transmit addressing enable pulse waves; pins 7 and 8 are defined as cascade pass-through channels (TX2± / RX2±), which can be used to transmit trigger signals cascaded through the main control link. Without adding new interfaces or external buses, data communication, pulse triggering, and cascade pass-through functions can be integrated within the same physical interface simply by reusing redundant pins of the Ethernet port.
[0027] For details, please refer to Figure 1 The address allocation methods for energy storage systems include: Step 110: Through the first port, along the first link direction from the first master controller to the second master controller, assign addresses to each master controller in sequence, and record the first number of master controllers that have been successfully assigned addresses.
[0028] The first link direction refers to the unidirectional signal path starting from the first port of the master control, passing through the first master control level to the downstream master control level until the second master control. This direction can also be called the forward address allocation direction, which is not a limitation of this embodiment. The first quantity refers to the number of master controls that the master control actually receives addressing confirmation messages in the forward address allocation process. This value can be used to reflect the connectivity status of the forward link. For example, if there are 5 master controls deployed in the energy storage system, and the master control only receives addressing confirmation messages from the first 3 master controls in the forward address allocation process, then the first quantity is 3, indicating that there is a disconnection or communication failure between the 3rd and 4th master controls in the master control link, and subsequent master controls cannot be assigned addresses; if the master control receives addressing confirmation messages from all 5 master controls, then the first quantity is 5, indicating that the master control link is connected without any abnormalities throughout.
[0029] Optionally, in this embodiment, after the address allocation process is initiated, the central control can first send an enable pulse wave and an addressing message carrying the initial ID address to the first master control through the first port. Upon detecting the enable pulse wave, the first master control activates the addressing function, parses the addressing message, configures its local address as the initial ID address, and further sends a first addressing confirmation message back to the central control. After receiving the first addressing confirmation message, the central control generates a new ID address by incrementing the ID address by a preset step size, and sends an addressing message carrying the new ID address to the first link through the first port. The first master control outputs an enable pulse wave to the downstream master control and forwards the addressing message carrying the new ID address to the downstream master control. After receiving the enable pulse wave and the addressing message, the downstream master control configures its local address as the new ID address and sends a second addressing confirmation message back to the central control. In response to the second addressing acknowledgment message, the master control system continues to generate a new ID address and sends an addressing message carrying the new ID address to the first link. This process is repeated until a master control fails to send an addressing acknowledgment message within a specified time or the master control at the end of the link completes the allocation. Throughout the forward address allocation process, the master control system continuously counts the number of addressing acknowledgment messages received and records this count as the first number of master control systems that have successfully allocated addresses. If a master control fails to send an acknowledgment message due to a line disconnection during the forward address allocation process, the master control system stops sending subsequent addressing messages. The first count recorded at this time is the actual number of master control systems connected in the first link direction.
[0030] It should be noted that in this embodiment, the master controller can also send other types of enable signals to the first master controller through the first port to trigger its start addressing process, such as a continuous high-level signal or a continuous low-level signal. In this embodiment, the specific form of the enable signal is not limited.
[0031] Step 120: Obtain the MAC address of each master controller and determine the second number of MAC addresses that have been obtained.
[0032] The MAC address is a unique physical address assigned to each master controller in network communication. It is fixed at the factory by the network card hardware, has global uniqueness, and does not change with the address allocation process or link status. The second quantity refers to the total number of master controller MAC addresses actually obtained by the master controller after completing the forward address allocation process. This value reflects the total number of master controllers that the master controller can currently confirm, and it is not affected by the disconnection of the master controller link.
[0033] Optionally, in this embodiment, after determining the first quantity, the central control can further send query messages carrying MAC address reporting instructions to the master control link simultaneously or in a time-division manner through the first port along the first link direction and through the second port along the second link direction; after receiving the query message, each master control extracts the MAC address pre-stored on its own machine and sends a reporting confirmation message carrying its own MAC address back to the central control through its respective input port; the central control receives the two reporting confirmation messages through the first port and the second port respectively, extracts and summarizes all MAC addresses, performs deduplication processing on the summarized MAC addresses, and determines the total number of deduplicated MAC addresses as the second quantity.
[0034] Step 130: If the first quantity is less than the second quantity, then through the second port, along the second link from the second master controller to the first master controller, sequentially allocate addresses to the master controllers that have not been allocated addresses.
[0035] Among them, the master controller without an assigned address is the master controller that failed to receive the addressing message due to the link break during the forward address allocation process and has not yet obtained the ID address. The number of master controllers without assigned addresses can be one or more. In this embodiment, there is no limitation on the number of master controllers. It can be understood that the master controllers without assigned addresses are all located downstream of the break point of the master controller link.
[0036] Optionally, in this embodiment, after obtaining the first quantity and the second quantity, the size relationship between the first quantity and the second quantity can be further determined. If it is determined that the first quantity is less than the second quantity, it can be determined that there is a line break in the main control link, and the forward address allocation has failed to cover all main controls. At this time, the reverse address allocation process can be initiated. Specifically, the main control can send an enable pulse wave and a second addressing message carrying the starting ID address to the second main control through the second port. The starting ID address corresponds to the second quantity. After receiving the enable pulse wave, the second main control is activated to activate the addressing function, configures its local address as the starting ID address, and sends a third addressing confirmation message back to the main control. After receiving the third addressing confirmation message, the main control generates a new ID address by decreasing the ID address by a preset step size, and sends a second addressing message carrying the new ID address through the second port. The second main control forwards the second addressing message carrying the new ID address to the upstream main control. After receiving the enable pulse wave and the second addressing message, the upstream main control configures its local address as the new ID address and sends an addressing confirmation message back to the main control. The master controller continues to decrement the ID address by a preset step size and send it to the next upstream master controller. This process is repeated until the master controller that has successfully allocated an address during the forward address allocation process is reached.
[0037] In one example of this embodiment, the energy storage system includes three master controllers: BCU1, BCU2, and BCU3. The link between BCU2 and BCU3 is broken. The master controller first performs forward address allocation along the first link direction via the first port. BCU1 is allocated address 1, BCU2 is allocated address 2 via forwarding from BCU1, and BCU3 is not allocated an address because it cannot receive addressing messages due to the broken link. The master controller records the first quantity as 2. After the forward allocation is completed, the master controller sends query messages in both directions via the first and second ports to obtain the MAC addresses of each master controller. BCU1 and BCU2 report their MAC addresses via the first port, and BCU3 reports its MAC address via the second port. After summarizing and deduplicating, the master controller obtains a total of 3 MAC addresses, i.e., the second quantity is 3. The master controller further compares the first quantity 2 with the second quantity 3, determines that 2 is less than 3, and judges that there is a disconnection in the link. Then it starts the reverse address allocation process. The master controller sends an addressing message with the starting ID address 3 to BCU3 through the second port. BCU3 allocates address 3. Then the master controller decrements the ID address to 2. Since the master controller has recorded that address 2 was successfully configured to BCU2 in the forward allocation, the master controller judges that the current reverse ID address (2) has entered the address range of the forward allocation success, and then actively terminates the reverse allocation process. Finally, the master controller confirms that the sum of the first quantity 2 and the third quantity 1 of the reverse allocation success is equal to the second quantity 3. The forward-allocated addresses 1 and 2 and the reverse-allocated address 3 are concatenated to obtain the continuous address sequence 1, 2, 3. All three master controllers have completed the address allocation.
[0038] The technical solution of this embodiment can be used in an energy storage system. The energy storage system deploys a central control unit and main control links. The central control unit communicates with the first main control unit of the main control link through a first port and with the second main control unit of the main control link through a second port, forming a ring network topology. The method is executed by the central control unit. The address allocation method of the energy storage system includes: sequentially allocating addresses to each main control unit along the first link direction from the first main control unit to the second main control unit through the first port, and recording the first number of main control units that have successfully allocated addresses; obtaining the MAC addresses of each main control unit and determining the second number of MAC addresses obtained; if the first number is less than the second number, sequentially allocating addresses to the unallocated main control units along the second link direction from the second main control unit to the first main control unit through the second port. This solves the problem that when the link connecting the main control units of the energy storage system is disconnected, it is impossible to successfully allocate addresses to the downstream main control units at the disconnection location. Without increasing wiring harness costs, address allocation for all main control units can still be achieved even when the main control link is disconnected at any location, thus assisting in the normal communication and operation of the energy storage system.
[0039] Example 2 Figure 4This is a flowchart of an address allocation method for an energy storage system according to Embodiment 2 of the present invention. This embodiment is a further refinement of the above technical solution, and the technical solution in this embodiment can be combined with various optional solutions in one or more of the above embodiments. Figure 4 As shown, the method includes: Step 410: Through the first port, along the first link direction from the first master controller to the second master controller, assign addresses to each master controller in sequence, and record the first number of master controllers that have successfully assigned addresses.
[0040] Optionally, in this embodiment, the sequential allocation of addresses to each master controller along the first link direction from the first master controller to the second master controller via the first port may include: sending a pulse wave and an addressing message carrying an ID address to the first master controller via the first port, and generating an addressing message carrying a new ID address after receiving a first addressing confirmation message from the first master controller in response to the addressing message; wherein the pulse wave is used to enable addressing; sending the addressing message carrying the new ID address to the first link so that the first master controller outputs a pulse wave to the downstream master controller when it determines that the new ID address meets the first preset transmission conditions; receiving a second addressing confirmation message from the downstream master controller after configuring its local address as the new ID address based on the pulse wave and the addressing message carrying the new ID address; and in response to the second addressing confirmation message, continuing to generate the next new ID address and sending an addressing message carrying the next new ID address to the first link until each master controller completes address allocation.
[0041] The preset transmission conditions can be address validity verification rules preset within the first master controller. For example, these could include whether the new ID address is within a valid range, whether it has a correct incrementing relationship with the local address, and whether the received addressing instruction format is complete. Only if these conditions are met is the ID address considered usable to trigger the downstream master controller. The downstream master controller can be a downstream master controller cascaded with the first master controller, for example... Figure 2 BCU2 in the middle.
[0042] In one optional implementation of this embodiment, during the address allocation process for each master controller in the energy storage system, the central controller can send a pulse wave and an addressing message carrying an ID address to the first master controller via a first port. Upon receiving the pulse wave and the addressing message, the first master controller can configure its local address as the ID address carried in the addressing message and send a first addressing confirmation message back to the central controller. Upon receiving the first addressing confirmation message, the central controller confirms that the first master controller has successfully allocated an address, generates an addressing message carrying a new ID address, and sends the addressing message to the first link via the first port. Upon receiving the addressing message carrying the new ID address, the first master controller first determines whether the new ID address meets a first preset transmission condition. If the first preset transmission condition is met, the first master controller outputs a pulse wave to the downstream master controller, while the addressing message carrying the new ID address is sent from the central controller to the master control link. Upon receiving the valid pulse wave output by the first master controller, the downstream master controller intercepts and parses the currently broadcast addressing message, and then configures its local address as the new ID address.
[0043] Furthermore, upon receiving the pulse wave and the addressing message, the downstream master controller can configure its local address to the new ID address carried in the addressing message and send a second addressing confirmation message back to the central control. Upon receiving the second addressing confirmation message, the central control confirms that the downstream master controller has successfully allocated an address, continues to generate the next new ID address, and sends an addressing message carrying the next new ID address to the first link. This process repeats, with each master controller in the first link direction sequentially obtaining an address allocation. Each master controller that obtains an address sends an addressing confirmation message back to the central control. Upon receiving each addressing confirmation message, the central control increments the ID address by a preset step size and generates a new addressing message to continue sending downwards, until all master controllers in the first link direction have completed address allocation. Throughout the forward address allocation process, the central control unit counts the number of addressing confirmation messages received in real time. When a master control unit fails to send an addressing confirmation message within the specified time or when the master control unit at the end of the link completes the address allocation and no new confirmation messages are returned, the forward address allocation process ends. The central control unit records the number of addressing confirmation messages counted as the first number, which is the number of master control units that are actually connected and have successfully allocated addresses in the first link direction.
[0044] Optionally, in this embodiment, each master controller on the master control link includes an input port and an output port; the first port, the second port, the input port, and the output port all include predefined transmit pins and receive pins; correspondingly, sending a pulse wave and an addressing message carrying an ID address to the first master controller through the first port may include: sending a pulse wave to the receive pin of the input port of the first master controller through the transmit pin of the first port; sending an addressing message carrying an ID address to the receive pin of the input port of the first master controller through the transmit pin of the first port; and receiving a first addressing acknowledgment message fed back by the first master controller through the transmit pin of the input port through the receive pin of the first port.
[0045] Optionally, in this embodiment, the master controller sends a pulse wave and an addressing message to the first master controller through the first port, and receives an acknowledgment message from the first master controller. Specifically, the first port of the master controller includes multiple pins, the pin definitions of which are shown in Table 1. Pins 1 and 2 are Ethernet transmit pins, pins 3 and 6 are Ethernet receive pins, and pins 4 and 5 are predefined addressing pulse transmit pins. The master controller sends a pulse wave to the corresponding receive pin of the input port of the first master controller through pins 4 and 5 of the first port. This pulse wave is used to activate the addressing function of the first master controller. The master controller sends an addressing message carrying an ID address to the corresponding receive pin of the input port of the first master controller through pins 1 and 2 of the first port. After receiving the pulse wave and the addressing message, the first master controller configures its local address to the ID address carried in the addressing message, and sends a first addressing acknowledgment message back to the master controller through the transmit pin of its input port. The master controller receives the first addressing acknowledgment message through pins 3 and 6 of the first port.
[0046] Step 420: Obtain the MAC address of each master controller and determine the second number of MAC addresses that have been obtained.
[0047] Optionally, in this embodiment, obtaining the MAC address of each master controller and determining the second number of obtained MAC addresses may include: sequentially sending a query message carrying a MAC address reporting instruction to each master controller along the master controller link through the transmit pin of the first port and / or the second port; receiving a report confirmation message carrying its own MAC address fed back by each master controller through the transmit pin of the input port; performing deduplication processing on the MAC addresses in each received report confirmation message, and determining the total number of deduplicated MAC addresses as the second number.
[0048] Among them, the MAC address reporting instruction query message can be a dedicated query frame broadcast or unicast sequentially by the master controller to the master control link through the Ethernet sending pin. Its payload contains a preset reporting instruction code, which is used to trigger each master controller to encapsulate its own unique MAC address into an acknowledgment message and send it back. It is different from the regular data communication message and has an independent protocol identifier and parsing rules.
[0049] The reporting confirmation message is a response frame sent back to the central controller by each master controller through the transmit pin of its input port after receiving the MAC address reporting instruction. The payload of this message carries the unique MAC address that is factory-fixed or software-configured on the local machine, which serves as the physical layer identifier for node identification and does not depend on any assigned address ID.
[0050] The MAC address deduplication process involves the central control system performing hash comparisons or sorting checks on the MAC addresses in all received acknowledgment messages to eliminate duplicate addresses caused by link loopbacks, message retransmissions, or repeated reception from multiple ports. This ensures that the final count accurately reflects the actual number of independent physical nodes on the link.
[0051] In one implementation of this embodiment, the central controller can send a query message carrying a MAC address reporting instruction to each master controller sequentially along the master control link through the transmit pin of the first port. After receiving the query message, each master controller extracts the MAC address pre-stored on its own machine and sends a report confirmation message carrying its own MAC address back to the central controller through the transmit pin of its input port. The central controller receives each report confirmation message through the receive pin of the first port.
[0052] In another implementation of this embodiment, the master controller can send a query message carrying a MAC address reporting instruction to each master controller sequentially along the master control link through the transmit pin of the second port. After receiving the query message, each master controller extracts the MAC address pre-stored on its own machine and sends a report confirmation message carrying its own MAC address back to the master controller through the transmit pin of its input port. The master controller receives each report confirmation message through the receive pin of the second port.
[0053] In another implementation of this embodiment, the central control unit can simultaneously send query messages carrying MAC address reporting instructions to each master control unit in both directions along the main control link via the transmit pins of the first and second ports. Upon receiving a query message from any port, each master control unit extracts its pre-stored MAC address and sends a reporting confirmation message carrying its own MAC address back to the central control unit via the corresponding input port. After receiving the two reporting confirmation messages via the receive pins of the first and / or second ports, the central control unit extracts the MAC address from all received reporting confirmation messages and maintains an address list. Each received MAC address is compared with an existing address in the list; if the address does not exist in the list, it is added; otherwise, it is discarded. After traversing the list, the total number of duplicate MAC addresses is determined as the second quantity.
[0054] Optionally, in this embodiment, after determining the second number of acquired MAC addresses, the address allocation method of the energy storage system may further include: determining the size relationship between the first number and the second number; and, if the first number is equal to the second number, completing the address allocation for each master controller.
[0055] In one implementation of this embodiment, after obtaining the first quantity and the second quantity, if the master control determines that the first quantity is equal to the second quantity, it indicates that the number of master controllers that have successfully allocated addresses during the forward address allocation process is consistent with the total number of master controllers actually accessing the entire network. That is, the forward address allocation has covered all master controllers, and there are no breaks or missing links in the master controller links. At this time, there is no need to start the reverse address allocation process, and the master control directly determines that the address allocation of each master controller is complete.
[0056] Step 430: If the first quantity is less than the second quantity, then through the second port, along the second link from the second master controller to the first master controller, sequentially allocate addresses to the master controllers that have not been allocated addresses.
[0057] Optionally, in this embodiment, when the first quantity is determined to be less than the second quantity, the unallocated addresses are sequentially allocated to the master controllers along the second link direction from the second master controller to the first master controller via the second port. This may include: sending a pulse wave to the receiving pin of the output port of the second master controller via the transmitting pin of the second port; sending a second addressing message carrying a starting ID address to the receiving pin of the output port of the second master controller via the transmitting pin of the second port; wherein the starting ID address corresponds to the second quantity; receiving a third addressing confirmation message based on the second addressing message from the transmitting pin of the output port of the second master controller via the receiving pin of the second port; responding to the third addressing confirmation message, decreasing the starting ID address by a preset step size to generate a new ID address, and sending a second addressing message carrying the new ID address along the second link direction to the receiving pin of the output port of the downstream master controller adjacent to the second master controller via the transmitting pin of the second port, until reaching the master controller that has successfully allocated an address during the address allocation process along the first link direction.
[0058] The starting ID address is the logical address value assigned to the first addressing master (i.e., the second master) in the reverse address allocation process. Its value is equal to the second number obtained by deduplicating MAC addresses. For example, when the second number is 4, the starting ID address is 4, indicating that the reverse address allocation starts from number 4 and decreases sequentially to avoid overlapping with addresses 1, 2, 3, etc., that have already been used in the forward addressing.
[0059] The preset step size is a fixed difference in ID addresses between two adjacent master controllers during the reverse address allocation process. It can be set to 1, 2, or other values, and is not limited in this embodiment. For example, when the starting ID address is 4 and the step size is 1, the next upstream master controller will obtain an ID address of 3, the next one will be 2, and so on, ensuring that the addresses are continuous and predictable.
[0060] The third addressing acknowledgment message is a response frame sent back by the upstream master controller of the second master controller through the transmit pin of its output port after receiving the second addressing message carrying the new ID address. This frame informs the master controller that it has successfully received and configured the current ID address. The master controller only performs ID address decrementing and continues sending addressing messages to the next master controller after receiving this acknowledgment message.
[0061] Optionally, in this embodiment, if the first quantity is determined to be less than the second quantity, i.e., the forward address allocation process has not achieved address allocation for all master controllers, the reverse address allocation process is initiated through the second port (specific pins are shown in Table 2). The master controller can send pulse waves to the corresponding receive pins of the output port of the second master controller through pins 7 and 8 of the second port. Simultaneously, the master controller sends a second addressing message carrying the starting ID address to the Ethernet interface of the second master controller through the Ethernet interface of the second port (pins 1, 2, 3, and 6). After receiving the pulse wave and the second addressing message, the second master controller configures its local address to the starting ID address and sends a third addressing confirmation message back to the master controller through its Ethernet interface. The master controller receives the third addressing confirmation message through the Ethernet interface of the second port (pins 1, 2, 3, and 6). After confirming that the second master controller has successfully allocated an address, the main controller decrements the starting ID address by a preset step size to generate a new ID address and continues to send a second addressing message carrying the new ID address through the Ethernet interface of the second port. Simultaneously, after determining that the new ID address meets preset transmission conditions, the second master controller sends a pulse wave through the corresponding pulse transmission pin of its output port to the corresponding receive pin of the input port of its adjacent upstream master controller. This pulse trigger signal is transmitted upstream level by level until it reaches the master controller that has successfully allocated an address in the forward address allocation process. Upon receiving the pulse wave from downstream and the addressing message sent through the Ethernet interface of the second port, the master controller that has been allocated an address compares the ID address in the message with its already configured address. If they are the same, the address is not reconfigured, and no more pulse waves are transmitted upstream; the reverse address allocation process terminates at this point.
[0062] Step 440: Obtain the third number of master controllers that have successfully allocated addresses along the second link direction, and determine that the address allocation of each master controller is complete when the third number and the second number satisfy the preset relationship.
[0063] The preset relationship can be that the sum of the first quantity and the third quantity equals the second quantity.
[0064] Optionally, in this embodiment, after the reverse address allocation process is completed, the central control obtains a third number of master controllers that have successfully allocated addresses along the second link direction (i.e., the reverse address allocation direction). Specifically, during the process of the central control sequentially allocating addresses to each master controller along the second link direction through the second port, each time an address is successfully allocated to a master controller and an addressing confirmation message is received from that master controller, a count is incremented. When the reverse address allocation process terminates, the accumulated count is determined as the third number, which is the number of master controllers that are actually connected and have successfully allocated addresses along the second link direction. After obtaining the third number, the central control compares the first number, the second number, and the third number. When it is determined that the third number and the second number satisfy a preset relationship, the address allocation of each master controller is determined to be complete. In one implementation, the preset relationship is that the sum of the first quantity and the third quantity equals the second quantity. That is, when the sum of the number of master controllers that have been successfully allocated with forward address and the number of master controllers that have been successfully allocated with reverse address equals the total number of master controllers actually accessed in the entire network, it indicates that forward allocation and reverse allocation have covered all master controllers, and there is no overlap or omission between the master controllers that have been successfully allocated with forward address and the master controllers that have been successfully allocated with reverse address. At this time, the master controller determines that the address allocation of each master controller is complete.
[0065] Optionally, in this embodiment, obtaining the third number of master controllers that have successfully allocated addresses along the second link direction, and determining that the address allocation of each master controller is completed when the third number and the second number satisfy a preset relationship, may include: determining the number of times addressing confirmation messages are received during the process of sequentially allocating addresses to each master controller through the second port along the second link direction, and determining the number as the third number of master controllers that have successfully allocated addresses; determining that the sum of the first number and the third number is equal to the second number, and then obtaining each first ID address that has been allocated during the process of sequentially allocating addresses to each master controller through the first port along the first link direction, and each second ID address that has been allocated during the process of sequentially allocating addresses to each master controller through the second port along the second link direction; determining whether each first ID address and each second ID address, after being concatenated according to the allocation order of the first link direction and the second link direction, constitute a continuous address sequence containing the second number of addresses; if a continuous address sequence is constituted, then determining that the address allocation of each master controller is completed.
[0066] In an optional implementation of this embodiment, after the reverse address allocation process is completed, the central control unit counts the number of addressing acknowledgment messages received through the second port and records this number as the third quantity. The central control unit adds the first quantity recorded during the forward address allocation process to the third quantity recorded during the reverse address allocation process and compares it with the second quantity. If the sum of the first quantity and the third quantity equals the second quantity, it indicates that the forward and reverse address allocations have covered all master controllers and there is no duplicate allocation. At this time, the central control unit obtains each first ID address allocated during the forward address allocation process and each second ID address allocated during the reverse address allocation process. The central control unit arranges each first ID address according to the allocation order in the first link direction (i.e., the forward address allocation direction) and each second ID address according to the allocation order in the second link direction (i.e., the reverse address allocation direction). The central control unit then concatenates the arranged first ID addresses and second ID addresses to determine whether the concatenated address sequence contains the second quantity of addresses and that the addresses are consecutive. If the concatenated address sequence contains the second quantity of addresses and that the addresses are consecutive, the central control unit determines that the address allocation for each master controller is complete.
[0067] In one example of this embodiment, the energy storage system includes six master controllers, namely BCU1, BCU2, BCU3, BCU4, BCU5, and BCU6. The link between BCU3 and BCU4 is broken. The forward address allocation along the first link direction is as follows: BCU1 is allocated address 1, BCU2 is allocated address 2, and BCU3 is allocated address 3. BCU4 to BCU6 cannot receive addressing messages because they are located after the breakpoint, and therefore cannot be allocated addresses. The first number recorded by the master controller is 3. The master controller obtains the MAC addresses of each master controller through dual ports and obtains a second number of 6 after deduplication. It is determined that the first number is less than the second number, and reverse address allocation is initiated. The reverse address allocation along the second link direction is as follows: BCU6 is allocated address 6, BCU5 is allocated address 5, and BCU4 is allocated address 4. Since the master controller has already recorded that address 3 was successfully configured to BCU3 in the forward allocation, the master controller determines that the current reverse ID address (3) has entered the address range of the successful forward allocation, and then actively terminates the reverse allocation process. The reverse allocation is terminated, and the third number recorded by the master controller is 3. The central control determines that the sum of the first quantity 3 and the third quantity 3 equals the second quantity 6. It obtains the first ID addresses that have been allocated in the forward address allocation as 1, 2, 3, and arranges them in the order of allocation as 1, 2, 3. It obtains the second ID addresses that have been allocated in the reverse address allocation as 6, 5, 4, and arranges them in the order of allocation as 6, 5, 4. After concatenation, it obtains the address sequence 1, 2, 3, 4, 5, 6. This sequence contains 6 consecutive addresses. Based on this, the central control determines that the address allocation of each master controller is complete.
[0068] Optionally, in this embodiment, the address allocation method of the energy storage system may further include: determining that there is a line abnormality in the main control link when the sum of the third quantity and the first quantity is less than the second quantity; locating the abnormal main control and abnormal segment in the main control link based on the first ID addresses allocated in the process of sequentially allocating addresses to each main control through the first port along the first link direction, and the second ID addresses allocated in the process of sequentially allocating addresses to each main control through the second port along the second link direction.
[0069] In an optional implementation of this embodiment, after the reverse address allocation process is completed, the central control unit counts the number of addressing acknowledgment messages received through the second port and records this number as the third quantity. The central control unit adds the first quantity and the third quantity and compares it with the second quantity. If the central control unit determines that the sum of the first quantity and the third quantity is less than the second quantity, it indicates that the total number of master controllers covered by forward address allocation and reverse address allocation is still less than the total number of master controllers actually accessing the entire network. That is, there are master controllers in the master control link that are neither covered by forward allocation nor by reverse allocation. At this time, the central control unit determines that there is a line anomaly in the master control link. The central control unit can locate the abnormal master controller and abnormal segment in the master control link based on the first ID addresses allocated during the forward address allocation process and the second ID addresses allocated during the reverse address allocation process. Specifically, the master controller corresponding to the last ID address that can be successfully allocated by forward address allocation is the last master controller that can communicate normally in the first link direction; the master controller corresponding to the last ID address that can be successfully allocated by reverse address allocation is the last master controller that can communicate normally in the second link direction. The master controller between these two master controllers is one that failed to obtain an address through neither forward address allocation nor reverse address allocation. The segment containing these master controllers is the abnormal segment, and the master controller between these two master controllers is the abnormal master controller. In this way, the central control can locate the abnormal master controller and abnormal segment in the master control link, which facilitates the rapid troubleshooting and handling by operation and maintenance personnel.
[0070] For example, suppose the energy storage system includes five master controllers: BCU1, BCU2, BCU3, BCU4, and BCU5. The link between BCU2 and BCU3 is broken, and the link between BCU3 and BCU4 is also broken. Forward address allocation along the first link direction assigns address 1 to BCU1, address 2 to BCU2, and BCU3 fails to receive the addressing message due to being located after the breakpoint, thus failing to receive an address. The master controller records a first count of 2. The master controller obtains the MAC addresses of each master controller through dual ports, removes duplicates, and obtains a second count of 5, then initiates reverse address allocation. Reverse address allocation along the second link direction assigns address 5 to BCU5 and address 4 to BCU4. When the second addressing message carrying address 3 arrives at BCU3, BCU3 cannot receive the second addressing message due to the broken link between BCU3 and BCU4, and the reverse allocation terminates, with the master controller recording a third count of 2. The central control determines that the sum of the first quantity 2 and the third quantity 2 is 4, which is less than the second quantity 5, indicating a line anomaly in the master control link. At this time, the first ID addresses already allocated in the forward address allocation are 1 and 2, meaning BCU1 and BCU2 are forward-reachable master controls; the second ID addresses already allocated in the reverse address allocation are 5 and 4, meaning BCU5 and BCU4 are reverse-reachable master controls. The last master control reachable in the forward direction is BCU2, and the last master control reachable in the reverse direction is BCU4. BCU3, between BCU2 and BCU4, is neither covered by forward nor reverse allocation. Based on this, the central control locates the abnormal master control as BCU3, and the abnormal segments are the links between BCU2 and BCU3 and between BCU3 and BCU4.
[0071] In one optional implementation of this embodiment, after the address allocation process is initiated, the central controller sends an enable signal and an addressing message with address 1 to the first master controller via the first port. Upon detecting the enable signal, the first master controller configures its local address to 1 and returns an addressing success message to the central controller. After the central controller confirms the response, it stops outputting the enable signal and then sends an addressing message with address 2 via the bus. Upon receiving the addressing message with address 2, the first master controller first determines whether address 2 meets the first preset transmission condition. If the first preset transmission condition is met, the first master controller sends the addressing message to the master control link and transmits it along the master control link to the downstream master controller. Upon detecting the enable signal, the downstream master controller configures its local address to 2 and returns an addressing success message. This process continues incrementally until the end master controller in the first link direction completes the address allocation, with the ID address increasing sequentially from 1 to n. When the communication link between BCU2 and BCU3 is broken, BCU1 assigns address 1, and BCU2 forwards the assignment of address 2 through BCU1. BCU3 cannot receive the pulse wave, and the number of successfully assigned addresses in the forward direction is 2. The number of MAC addresses collected via Ethernet is 3. The master control determines that the number of successfully assigned addresses in the forward direction is less than the total number of MAC addresses, confirming a break in the link, and then initiates the reverse address allocation process. The master control initiates the reverse address allocation through the second port. After detecting the pulse, BCU3 starts addressing from address 3, which corresponds to the total number of MAC addresses. The reverse address allocation assigns addresses to each master control in descending order of address. BCU3 assigns address 3, BCU2's already assigned address 2 is not reconfigured, and BCU1's already assigned address 1 is not reconfigured. Finally, the address allocation for all master control is completed.
[0072] To better understand the address allocation method of the energy storage system involved in this embodiment, Figure 5 This is a flowchart of another address allocation method for an energy storage system provided according to Embodiment 2 of the present invention; see reference. Figure 5After the energy storage system is powered on, the central controller first collects the MAC addresses of all master controllers in the main control link via Ethernet, and uses the number of collected MAC addresses as a baseline. Next, the central controller initiates forward address allocation along the first link direction via the first port, assigning addresses to each master controller in ascending order of ID addresses. After forward address allocation is completed, the central controller compares the number of master controllers successfully allocated with the baseline number of MAC addresses. If they are equal, it is determined that all master controllers have completed address allocation, and the address allocation process ends. If the number of master controllers successfully allocated is less than the baseline number of MAC addresses, it is determined that there is a disconnection in the main control link. The central controller then initiates reverse address allocation along the second link direction via the second port, assigning addresses to the master controllers not covered by forward allocation in descending order of ID addresses. After reverse address allocation is completed, the central controller again collects the ID addresses of all master controllers and compares the number of collected ID addresses with the baseline number of MAC addresses. If they are equal, it reports that the address line is normal and confirms that the address allocation is complete; if they are not equal, it reports that the address line is abnormal, and the address allocation fails.
[0073] The solution in this embodiment of the invention constructs a physical ring network structure for address allocation lines by connecting the first port of the central control unit to the first master control unit and connecting the last master control unit (the second master control unit) back to the second port of the central control unit, thus realizing a bidirectional redundant address allocation mechanism. During normal operation, forward address allocation is initiated from the first port, with the ID incrementing from 1. When a disconnection is detected, reverse address allocation is initiated from the second port, with the ID decrementing from the total number of MAC addresses. This fully utilizes the dual-end connectivity of the ring topology, ensuring that address allocation for all master control units can still be completed even when a single point of disconnection occurs. Forward and reverse address allocations are not executed simultaneously. The central control unit completes forward allocation first, and only initiates reverse allocation after detecting a discrepancy in the number of allocations. This avoids address conflicts and logical confusion that might result from simultaneous bidirectional allocation, improving the reliability and stability of the address allocation process. Disconnection detection is achieved by comparing the number of successfully forward-allocated master controllers with the total number of MAC addresses. If the former is less than the latter, it is determined that there is a disconnection in the link. After a disconnection is detected, reverse allocation is automatically triggered to complete the addressing of the remaining master controllers. The address configuration of all master controllers can be completed automatically without manual intervention, which can effectively deal with the address allocation failure problem caused by physical connection abnormalities in energy storage systems.
[0074] Example 3 Figure 6 This is a schematic diagram of an address allocation device for an energy storage system according to Embodiment 3 of the present invention. The energy storage system deploys a central control unit and a main control link. The central control unit is connected to a first main control unit of the main control link via a first port and to a second main control unit of the main control link via a second port, forming a ring network topology. The device is deployed at the central control unit, as shown below. Figure 6 As shown, the device includes: The first address allocation module 610 is used to allocate addresses to each of the master controllers sequentially through the first port along the first link direction from the first master controller to the second master controller, and record the first number of master controllers that have been successfully allocated addresses; MAC address determination module 620 is used to obtain the MAC address of each of the main controllers and determine a second number of MAC addresses that have been obtained; The second address allocation module 630 is used to allocate addresses to the master controllers that have not been allocated addresses sequentially through the second port along the second link direction from the second master controller to the first master controller when it is determined that the first quantity is less than the second quantity.
[0075] In an optional implementation of this embodiment, the second address allocation module 630 is specifically used to obtain a third number of master controllers whose addresses have been successfully allocated along the second link direction, and to determine that the address allocation of each master controller is completed when the third number and the second number satisfy a preset relationship.
[0076] In an optional implementation of this embodiment, the first address allocation module 610 is specifically used to send a pulse wave and an addressing message carrying an ID address to the first master controller through the first port, and after receiving a first addressing confirmation message from the first master controller in response to the addressing message, generate the addressing message carrying the new ID address; wherein, the pulse wave is used to enable addressing; Send the addressing message carrying the new ID address to the first link, so that the first master controller outputs the pulse wave to the downstream master controller when it determines that the new ID address meets the first preset transmission conditions; The downstream master controller receives the addressing message based on the pulse wave and carrying the new ID address, configures the local address to the new ID address, and then sends back a second addressing confirmation message. In response to the second addressing confirmation message, a new ID address is generated, and the addressing message carrying the new ID address is sent to the first link until each master controller completes address allocation.
[0077] In an optional implementation of this embodiment, each master controller on the master control link includes an input port and an output port; the first port, the second port, the input port, and the output port all include predefined transmit pins and receive pins; The first address allocation module 610 is also specifically used to send the pulse wave to the receiving pin of the input port of the first master controller through the transmitting pin of the first port; The addressed message carrying the ID address is sent to the receive pin of the input port of the first master controller through the transmit pin of the first port; The first addressing acknowledgment message is received by the first master controller via the transmit pin of the input port through the receive pin of the first port.
[0078] In an optional implementation of this embodiment, the MAC address determination module 620 is specifically used to send a query message carrying a MAC address reporting instruction to each of the master controllers along the master control link via the transmit pins of the first port and / or the second port. Receive the report confirmation message carrying its own MAC address fed back by each of the main controllers through the transmit pin of the input port; The MAC addresses in each of the received reporting confirmation messages are deduplicated, and the total number of deduplicated MAC addresses is determined as the second quantity.
[0079] In an optional implementation of this embodiment, the address allocation device of the energy storage system further includes: an address allocation completion module, used to determine the size relationship between the first quantity and the second quantity; If the first quantity is determined to be equal to the second quantity, the master control address allocation is completed.
[0080] In an optional implementation of this embodiment, the second address allocation module 630 is further configured to send a pulse wave to the receive pin of the output port of the second master controller via the transmit pin of the second port; A second addressing message carrying a start ID address is sent to the receive pin of the output port of the second master controller via the transmit pin of the second port; wherein the start ID address corresponds to the second quantity; The receiving pin of the second port receives the third addressing acknowledgment message fed back by the sending pin of the output port of the second master based on the second addressing message; In response to the third addressing confirmation message, the starting ID address is decremented by a preset step size to generate a new ID address, and a second addressing message carrying the new ID address is sent along the second link direction to the receiving pin of the output port of the downstream master controller adjacent to the second master controller via the transmit pin of the second port, until it reaches the master controller that has successfully allocated an address during the address allocation process in the first link direction.
[0081] In an optional implementation of this embodiment, the second address allocation module 630 is further specifically used to determine the number of times an addressing confirmation message is received during the process of sequentially allocating addresses to each of the master controllers through the second port along the second link direction, and to determine the number of times as the third number of master controllers that have successfully performed address allocation; If the sum of the first quantity and the third quantity is equal to the second quantity, then obtain the first ID addresses that have been allocated in the process of sequentially allocating addresses to each master controller through the first port along the first link direction, and the second ID addresses that have been allocated in the process of sequentially allocating addresses to each master controller through the second port along the second link direction. Determine whether concatenating each of the first ID addresses and each of the second ID addresses in the order of allocation in the first link direction and the second link direction constitutes a continuous address sequence containing the second number of addresses; If the consecutive address sequence is formed, then the address allocation for each master controller is complete.
[0082] In an optional implementation of this embodiment, the address allocation device of the energy storage system further includes: an abnormal section determination module, used to determine that there is a line abnormality in the main control link when the sum of the third quantity and the first quantity is less than the second quantity; Based on the first ID addresses already allocated during the process of sequentially allocating addresses to each of the master controllers along the first link direction through the first port, and the second ID addresses already allocated during the process of sequentially allocating addresses to each of the master controllers along the second link direction through the second port, the abnormal master controllers and abnormal segments in the master control link are located.
[0083] The address allocation device for the energy storage system provided in this embodiment of the invention can execute the address allocation method for the energy storage system provided in any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the method.
[0084] Example 4 Figure 7 This is a schematic diagram of the structure of an energy storage system implementing the address allocation method of the energy storage system according to an embodiment of the present invention. The energy storage system includes: a central control unit and a main control link. The central control unit is connected to a first main control unit of the main control link via a first port and to a second main control unit of the main control link via a second port, forming a ring network topology. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0085] like Figure 7As shown, the energy storage system 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from the storage unit 18. The RAM 13 can also store various programs and data required for the operation of the energy storage system 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0086] Multiple components in the energy storage system 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, optical disk, etc.; and a communication unit 19, such as a network card, modem, wireless transceiver, etc. The communication unit 19 allows the energy storage system 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0087] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods described above, such as the address allocation method for energy storage systems.
[0088] In some embodiments, the address allocation method for the energy storage system may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed onto the energy storage system 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the address allocation method for the energy storage system described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the address allocation method for the energy storage system by any other suitable means (e.g., by means of firmware).
[0089] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0091] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM), optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0092] To provide interaction with the user, the systems and techniques described herein can be implemented on an energy storage system having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the energy storage system. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0093] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0094] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Servers (VPS) in terms of management difficulty and weak business scalability.
[0095] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0096] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
[0097] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the address allocation method for an energy storage system as provided in any embodiment of this application.
[0098] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LANs or WANs—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0099] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the solution has been or necessarily used.
[0100] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. An address allocation method for an energy storage system, characterized in that, The energy storage system is equipped with a central control unit and a main control link. The central control unit is connected to the first main control unit of the main control link through a first port and to the second main control unit of the main control link through a second port, forming a ring network topology. The method is applied to the central control unit, and the address allocation method for the energy storage system includes: Through the first port, along the first link direction from the first master controller to the second master controller, addresses are sequentially assigned to each master controller, and the first number of master controllers whose addresses have been successfully assigned is recorded; Obtain the Media Access Control (MAC) address of each of the master controllers, and determine the second number of MAC addresses that have been obtained; If it is determined that the first quantity is less than the second quantity, an address is sequentially allocated to the master controller that has not been allocated an address through the second port along the second link direction from the second master controller to the first master controller.
2. The address allocation method for an energy storage system according to claim 1, characterized in that, The process of the master controller sequentially allocating addresses for unallocated addresses also includes: Obtain the third number of master controllers that have successfully allocated addresses along the second link direction, and determine that the address allocation of each master controller is complete when the third number and the second number satisfy a preset relationship.
3. The address allocation method for an energy storage system according to claim 1, characterized in that, The step of sequentially allocating addresses to each of the master controllers via the first port along the first link direction from the first master controller to the second master controller includes: Through the first port, a pulse wave and an addressing message carrying an ID address are sent to the first master controller. After receiving a first addressing confirmation message from the first master controller in response to the addressing message, the addressing message carrying the new ID address is generated. The pulse wave is used to enable addressing. Send the addressing message carrying the new ID address to the first link, so that the first master controller outputs the pulse wave to the downstream master controller when it determines that the new ID address meets the first preset transmission conditions; The downstream master controller receives the addressing message based on the pulse wave and carrying the new ID address, configures the local address to the new ID address, and then sends back a second addressing confirmation message. In response to the second addressing confirmation message, a new ID address is generated, and the addressing message carrying the new ID address is sent to the first link until each master controller completes address allocation.
4. The address allocation method for an energy storage system according to claim 3, characterized in that, Each master controller on the master control link includes an input port and an output port; the first port, the second port, the input port, and the output port all include predefined transmit pins and receive pins; The step of sending a pulse wave and an addressed message carrying an ID address to the first master controller through the first port includes: The pulse wave is transmitted to the receive pin of the input port of the first master controller via the transmit pin of the first port; The addressed message carrying the ID address is sent to the receive pin of the input port of the first master controller through the transmit pin of the first port; The first addressing acknowledgment message is received by the first master controller via the transmit pin of the input port through the receive pin of the first port.
5. The address allocation method for an energy storage system according to claim 4, characterized in that, The step of obtaining the MAC addresses of each of the master controllers and determining the second number of MAC addresses obtained includes: Through the transmit pins of the first port and / or the second port, query messages carrying MAC address reporting instructions are sequentially sent to each of the master controllers along the master control link; Receive the report confirmation message carrying its own MAC address fed back by each of the main controllers through the transmit pin of the input port; The MAC addresses in each of the received reporting confirmation messages are deduplicated, and the total number of deduplicated MAC addresses is determined as the second quantity.
6. The address allocation method for an energy storage system according to claim 1, characterized in that, After determining the second number of MAC addresses acquired, the method further includes: Determine the size relationship between the first quantity and the second quantity; If the first quantity is determined to be equal to the second quantity, the master control address allocation is completed.
7. The address allocation method for an energy storage system according to claim 1, characterized in that, When it is determined that the first quantity is less than the second quantity, the step of sequentially allocating addresses to the master controllers that have not been allocated addresses via the second port, along the second link direction from the second master controller to the first master controller, includes: A pulse wave is sent to the receive pin of the output port of the second master controller through the transmit pin of the second port; A second addressing message carrying a start ID address is sent to the receive pin of the output port of the second master controller via the transmit pin of the second port; wherein the start ID address corresponds to the second quantity; The receiving pin of the second port receives the third addressing acknowledgment message fed back by the sending pin of the output port of the second master based on the second addressing message; In response to the third addressing confirmation message, the starting ID address is decremented by a preset step size to generate a new ID address, and a second addressing message carrying the new ID address is sent along the second link direction to the receiving pin of the output port of the downstream master controller adjacent to the second master controller via the transmit pin of the second port, until it reaches the master controller that has successfully allocated an address during the address allocation process in the first link direction.
8. The address allocation method for an energy storage system according to claim 2, characterized in that, The step of obtaining a third number of master controllers that have successfully allocated addresses along the second link direction, and determining that the address allocation of each master controller is complete when the third number and the second number satisfy a preset relationship, includes: The number of times an addressing acknowledgment message is received during the process of sequentially allocating addresses to each of the master controllers through the second port along the second link direction is determined, and the number of times is determined as the third number of master controllers that have successfully performed address allocation; If the sum of the first quantity and the third quantity is equal to the second quantity, then obtain the first ID addresses that have been allocated in the process of sequentially allocating addresses to each master controller through the first port along the first link direction, and the second ID addresses that have been allocated in the process of sequentially allocating addresses to each master controller through the second port along the second link direction. Determine whether each of the first ID addresses and each of the second ID addresses, after being concatenated according to the allocation order of the first link direction and the second link direction, constitutes a continuous address sequence containing the second number of addresses; If the consecutive address sequence is formed, then the address allocation for each master controller is complete.
9. The address allocation method for an energy storage system according to claim 8, characterized in that, The method further includes: If the sum of the third quantity and the first quantity is less than the second quantity, it is determined that there is a line anomaly in the main control link; Based on the first ID addresses already allocated during the process of sequentially allocating addresses to each of the master controllers along the first link direction through the first port, and the second ID addresses already allocated during the process of sequentially allocating addresses to each of the master controllers along the second link direction through the second port, the abnormal master controllers and abnormal segments in the master control link are located.
10. An address allocation device for an energy storage system, characterized in that, The energy storage system is equipped with a central control unit and a main control link. The central control unit is connected to the first main control unit of the main control link through a first port and to the second main control unit of the main control link through a second port, forming a ring network topology. The device is deployed in the central control unit, and the address allocation device of the energy storage system includes: The first address allocation module is used to allocate addresses to each of the master controllers sequentially through the first port along the first link direction from the first master controller to the second master controller, and record the first number of master controllers that have been successfully allocated addresses; The MAC address determination module is used to obtain the MAC address of each of the main controllers and determine a second number of MAC addresses that have been obtained; The second address allocation module is used to allocate addresses to the master controllers that have not been allocated addresses sequentially through the second port along the second link direction from the second master controller to the first master controller when it is determined that the first quantity is less than the second quantity.
11. An energy storage system, characterized in that, The energy storage system includes: The system consists of a central control unit and a main control link. The central control unit is connected to the first main control unit of the main control link via a first port and to the second main control unit of the main control link via a second port, forming a ring network topology. At least one processor; and a memory communicatively connected to said at least one processor; The memory stores a computer program that can be executed by the at least one processor, which is then executed by the at least one processor to enable the at least one processor to perform the address allocation method of the energy storage system according to any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the address allocation method of the energy storage system according to any one of claims 1-9.
13. A computer program product comprising a computer program that, when executed by a processor, implements the address allocation method for an energy storage system according to any one of claims 1-9.
