A real-time encoding system and method for household energy storage batteries

By using a real-time coding system for residential energy storage batteries, sequential coding and CAN communication are employed to solve the problem of difficult ID lookup when multiple batteries are connected in parallel, achieving efficient battery coding and system stability without manual operation.

CN122291731APending Publication Date: 2026-06-26HANGZHOU LIVOLTEK POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610220341.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-24
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

When multiple batteries are connected in parallel, the existing coding method cannot quickly and accurately find the specific battery ID, which makes it difficult to analyze problems and increases user costs or causes ID conflicts.

Method used

A real-time coding system and method for residential energy storage batteries utilizes a sequential coding approach. Batteries communicate via CAN and a hardware addressing port, sequentially sending coding request frames and coding frames, automatically setting IDs and broadcasting their own IDs, and handling new or lost batteries in real time to ensure coding efficiency and system stability.

Benefits of technology

It achieves efficient battery coding without manual operation, supports the quick addition or removal of batteries, ensures stable and reliable system operation, and makes it convenient for users to find the corresponding ID.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122291731A_ABST
    Figure CN122291731A_ABST
Patent Text Reader

Abstract

This invention provides a real-time coding system and method for residential energy storage batteries, belonging to the field of battery coding technology. The real-time coding system for residential energy storage batteries includes N first batteries connected sequentially. In this invention, the N first batteries are connected sequentially. The first battery sends a coding request frame and then a coding frame. All first batteries send coding frames to broadcast their own IDs. When N is a positive integer greater than 1, the next first battery in a pair of adjacent batteries, upon receiving a coding frame from the previous battery, sets its own ID to the ID of the previous battery + 1 and sends its corresponding coding frame. If a first battery does not receive a coding frame within a first preset time after sending its own coding frame, it sends a coding end frame. The first battery sets its status to coding complete upon sending or receiving a coding end frame. This process requires no manual operation and has high coding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of battery coding, in particular to a real-time coding system and method for household energy storage batteries. BACKGROUND

[0002] With the wide application of household energy storage battery systems, when multiple batteries are connected in parallel, it is particularly important to quickly code and confirm the specific battery ID for analyzing problems and accurately finding the corresponding battery. At present, the coding of multiple batteries connected in parallel can be divided into three types: automatic coding, sequential coding and dial coding. Automatic coding does not require hardware circuit, only CAN bus is needed, and the coding can be completed quickly through MCU SN code or BMSSN code, but the coded ID is random and cannot accurately find the problem battery for analysis. Sequential coding requires the combination of hardware circuit and CAN communication for addressing, and the battery ID is arranged in sequence, which is convenient for finding the battery, but when a new battery is added or removed during system operation, all batteries need to be restarted, which increases the use cost of customers. Dial coding assigns different addresses through dial switches, and the corresponding battery ID can be accurately known through switch dialing, but manual operation is required and the number of batteries connected in parallel is large, which is easy to dial wrong and cause ID conflict and coding failure.

[0003] Therefore, how to meet the advantages of the market mainstream coding method in the multiple battery parallel connection scene, quickly code, and facilitate users to accurately find the corresponding ID battery, has become a technical problem to be solved at present. SUMMARY

[0004] In order to solve the above problems, the present application provides a real-time coding system and method for household energy storage batteries.

[0005] In a first aspect, this application provides a real-time encoding system for a residential energy storage battery, comprising N first batteries connected sequentially, where N is a positive integer. One of the N first batteries is located at one end as the first first battery. When none of the N first batteries are being encoded, the first first battery sends an encoding request frame and an encoding frame. All first batteries send encoding frames to broadcast their own IDs. The first battery sets its state to an encoding idle state when sending or receiving an encoding request frame. The first battery sends an encoding end frame if it does not receive an encoding frame after sending an encoding frame for a first preset time. When N is a positive integer greater than 1, the next first battery in a pair of adjacent first batteries sets its own ID to the ID + 1 of the previous first battery and sends its corresponding encoding frame when receiving an encoding frame from the previous first battery. The first battery locks itself to receive the encoding end frame within a first preset time after sending its encoding frame, and sets its state to an encoding complete state when sending or receiving the encoding end frame.

[0006] Preferably, it further includes a second battery for inserting into the N first batteries when the N first batteries are encoding or encoding is complete, the second battery being connected to one or two adjacent first batteries; after the second battery sends an encoding request frame, all the first and second batteries set their states to idle state, and the first first battery sends an encoding frame; when the second battery receives an encoding frame sent by a first battery in front of it, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame, the second battery sending the encoding frame is used to broadcast its own ID, when a first battery is behind the second battery, the first battery receives the encoding frame sent by the second battery, sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame; the second battery is used to send an encoding end frame if it does not receive an encoding frame after sending an encoding frame for more than a first preset time; the second battery is used to lock itself to receive the encoding end frame after receiving an encoding frame within a first preset time after sending an encoding frame, the second battery is used to set its state to encoding complete state when sending or receiving an encoding end frame.

[0007] Preferably, the first battery includes a first encoding port and a second encoding port; when N is a positive integer greater than 1, the second encoding port of the preceding first battery is connected to the first encoding port of the following first battery; the second battery includes a third encoding port and a fourth encoding port, when a first battery is provided on the front side of the second battery, the third encoding port of the second battery is connected to the second encoding port of the first battery, and when another first battery is provided on the rear side of the second battery, the fourth encoding port of the second battery is connected to the first encoding port of the first battery.

[0008] Preferably, when N is a positive integer greater than 1, two adjacent first batteries communicate via CAN, and the second battery communicates via CAN with a first battery located in front of it and / or another first battery located behind it.

[0009] Preferably, the first battery and the second battery transmit corresponding encoded frames every second preset time interval within a first preset time interval starting from the moment when they first transmit the encoded frame, and the second preset time interval is less than the first preset time interval.

[0010] Preferably, the first battery is used to send an end-of-encoding frame if it does not receive an encoded frame for more than 3 seconds after sending an encoded frame, and the remaining first and second batteries are used to send an end-of-encoding frame if they do not receive an encoded frame for more than 2 seconds after sending an encoded frame.

[0011] Preferably, the second preset time is 100ms.

[0012] Preferably, it also includes an energy storage PCS, which communicates with the first first battery via CAN.

[0013] Secondly, embodiments of this application provide a real-time encoding method for residential energy storage batteries, comprising the following steps:

[0014] S1: When none of the N first batteries have been encoded, the first first battery sends an encoding request frame and sets its state to the encoding idle state. When the remaining first batteries receive the encoding request frame, their states are set to the encoding idle state. The N first batteries are connected in sequence, where N is a positive integer. The first battery located at one end of the N first batteries is the first first battery.

[0015] S2: All first batteries send out encoded frames to broadcast their own IDs. If the first battery does not receive an encoded frame after sending out an encoded frame for more than a first preset time, it sends an encoding end frame and sets its status to encoding complete, and stops executing downwards. If the first battery receives an encoded frame sent by a first battery behind it within a first preset time after sending out an encoded frame, it locks itself to receive the encoding end frame and continues executing downwards.

[0016] S3: When the next first battery in two adjacent first batteries receives the encoded frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoded frame. Any first battery after the first first battery receives the encoded frame within a first preset time after sending the encoded frame and locks itself to receive the encoding end frame. When the Nth first battery does not receive the encoded frame within the first preset time after sending the encoded frame, it sends the encoding end frame.

[0017] S4: All first batteries set their state to encoding complete state when they send or receive an encoding end frame.

[0018] Preferably, after step S1, the method further includes: inserting the second battery into the N first batteries when the N first batteries are being encoded or have completed encoding; connecting the second battery to one or two adjacent first batteries; stopping the execution of the steps in or after this step; the second battery sending an encoding request frame; all first and second batteries setting their states to idle; the first first battery sending an encoding frame; all first and second batteries sending encoding frames to broadcast their own IDs; when the next first battery in a pair of adjacent first batteries receives the encoding frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoding frame; the second battery, when receiving the encoding frame sent by the battery in front of it... When the first battery sends an encoded frame, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoded frame. When a first battery is behind the second battery, after receiving the encoded frame sent by the second battery, the first battery sets its own ID to the ID of the first battery +1 and sends its corresponding encoded frame. All the first and second batteries lock themselves to receive the encoded frame within a first preset time after sending the encoded frame in order to receive the encoding end frame. If all the first and second batteries do not receive the encoded frame within the first preset time after sending the encoded frame, they send the encoding end frame. All the first and second batteries set their status to the encoding completion state when sending or receiving the encoding end frame.

[0019] The beneficial effects of the present invention are as follows: 1. N first batteries are connected sequentially. The first first battery sends an encoding request frame and an encoding frame. All first batteries send encoding frames to broadcast their own IDs. When N is a positive integer greater than 1, the next first battery in two adjacent first batteries sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoding frame when it receives the encoding frame sent by the previous first battery. If the first battery does not receive an encoding frame after sending the encoding frame for more than a first preset time, it sends an encoding end frame. When the first battery sends or receives the encoding end frame, it sets its status to the encoding completion state. No manual operation is required, and the encoding efficiency is high.

[0020] 2. When N first batteries are in the process of encoding or have completed encoding, insert a second battery from among the N first batteries. The second battery sends an encoding request frame. The first first battery sends an encoding frame. When the second battery receives an encoding frame from the first battery in front of it, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame. The second battery sends the encoding frame to broadcast its own ID. When a first battery is behind the second battery, the first battery receives the encoding frame from the second battery, sets its own ID to the ID of the first battery in front of it +1, and sends its corresponding encoding frame. If the second battery does not receive an encoding frame after sending its encoding frame for more than a first preset time, it sends an encoding end frame. When the second battery sends or receives the encoding end frame, it sets its status to the encoding complete state. This achieves real-time processing and real-time control, ensuring the stable and reliable operation of the system. Attached Figure Description

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

[0022] Figure 1 A structural block diagram of a real-time coding system for household energy storage batteries provided in this application embodiment;

[0023] Figure 2 This is a flowchart illustrating a real-time coding method for household energy storage batteries provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0025] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The following description provides multiple embodiments of this application, which can be substituted or combined with each other. Therefore, this application can also be considered to include all possible combinations of the same and / or different embodiments described. Thus, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then this application should also be considered to include embodiments containing one or more other possible combinations of A, B, C, and D, even if such embodiments are not explicitly described in the following text.

[0026] The following description provides examples and does not limit the scope, applicability, or examples set forth in the claims. Changes may be made to the function and arrangement of the described elements without departing from the scope of this application. Various processes or components may be appropriately omitted, substituted, or added to the examples. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Furthermore, features described with respect to some examples may be combined into other examples.

[0027] Please see Figure 1 In this embodiment, the system includes N first batteries connected sequentially, where N is a positive integer. One of the N first batteries, located at one end, is designated as the first first battery. When none of the N first batteries have been encoded, the first first battery sends an encoding request frame and then an encoding frame. All first batteries send encoding frames to broadcast their own IDs. Each first battery sets its state to an encoding idle state when sending or receiving an encoding request frame. Each first battery sends an encoding end frame if it does not receive an encoding frame after sending an encoding frame for a first preset time. When N is a positive integer greater than 1, the next first battery in a pair of adjacent first batteries sets its own ID to the ID + 1 of the previous first battery and sends its corresponding encoding frame when receiving an encoding frame from the previous first battery. Each first battery locks itself to receive an encoding end frame within a first preset time after sending an encoding frame, and sets its state to an encoding complete state when sending or receiving an encoding end frame.

[0028] In this embodiment, each battery has two addressing ports, IN and OU. The first battery (OU) is connected to the second battery (IN), the second battery (OU) is connected to the third battery (IN), and so on. The last battery (OU) is not connected. The first and last batteries can be identified through hardware connections. Encoding begins from the master and proceeds to the last battery. The last battery sends an encoding end frame, which other batteries receive and mark themselves as having completed encoding. If, during encoding of any battery, a communication line connection fails or is lost, a slave timeout is set. After the timeout, an encoding end frame is sent to the bus, ending the encoding process for all batteries. If a battery has already completed encoding...

[0029] In one possible implementation, a second battery is further included to be inserted among the N first batteries when the N first batteries are encoding or encoding is complete. The second battery is connected to one or two adjacent first batteries. After the second battery sends an encoding request frame, all the first and second batteries set their states to idle. The first first battery sends an encoding frame. When the second battery receives an encoding frame from a first battery in front of it, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame. The second battery sends the encoding frame to broadcast its own ID. When a first battery is behind the second battery, the first battery receives the encoding frame from the second battery and sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame. The second battery is used to send an encoding end frame if it does not receive an encoding frame after sending an encoding frame for more than a first preset time. The second battery is used to lock itself to receive the encoding end frame after receiving an encoding frame within a first preset time after sending an encoding frame. The second battery sets its state to encoding complete when it sends or receives an encoding end frame.

[0030] In this embodiment, when a new battery re-enters, it sends an encoding request frame. Upon receiving this frame, other batteries will set themselves to an encoding idle state and re-encode. This scheme supports sequential battery addressing (IDs increment from the first battery) for easy retrieval of the corresponding ID battery. It also allows for quick and real-time re-addressing when batteries are added or removed during operation. After encoding is complete, the host summarizes the system information and reports it to the PCS.

[0031] In one possible implementation, the first battery includes a first encoding port and a second encoding port; when N is a positive integer greater than 1, the second encoding port of the preceding first battery is connected to the first encoding port of the following first battery; the second battery includes a third encoding port and a fourth encoding port, when a first battery is provided on the front side of the second battery, the third encoding port of the second battery is connected to the second encoding port of the first battery, and when another first battery is provided on the rear side of the second battery, the fourth encoding port of the second battery is connected to the first encoding port of the first battery.

[0032] In one possible implementation, when N is a positive integer greater than 1, two adjacent first batteries communicate via CAN, and the second battery communicates via CAN with a first battery located in front of it and / or another first battery located behind it.

[0033] In one possible implementation, the first battery and the second battery transmit corresponding encoded frames every second preset time interval within a first preset time interval starting from the moment when the first battery first transmits the encoded frame, wherein the second preset time interval is less than the first preset time interval.

[0034] In one possible implementation, the first battery is used to send an end-of-encoding frame if it does not receive an encoded frame for more than 3 seconds after sending an encoded frame, and the remaining first and second batteries are used to send an end-of-encoding frame if they do not receive an encoded frame for more than 2 seconds after sending an encoded frame.

[0035] In one possible implementation, the second preset time is 100ms.

[0036] In one possible implementation, the system further includes an energy storage PCS that communicates with the first battery via CAN.

[0037] Specifically, this application includes multiple independent batteries and energy storage PCS, and the batteries and energy storage PCS communicate with each other via CAN.

[0038] In this embodiment, the encoding request frame (0x8FB AA 00 00 00 00 00 00 00) is used when a new battery is added to the system. Upon receiving this frame, other batteries will set themselves to an idle encoding state, becoming addressable. The encoding frame (0x8FB AA 55 Self-ID 00 00 00 00 00) is used to broadcast its own ID. The next battery, after a change in its encoding port IN level, receives this broadcast ID information and sets its own ID to the received broadcast ID + 1. The encoding end frame (0x8FB AA AA Self-ID 00 00 00 00 00) is used to determine a timeout after 2 seconds following the slave's broadcast encoding frame. If no response is received from the next battery after the timeout, the encoding end frame is uploaded. Upon receiving this frame, other batteries will set themselves to encoding complete and will no longer perform encoding, continuing normal logic.

[0039] In this embodiment, the first and second batteries can be the same, the first encoding port can be the same as the third encoding port, and the second encoding port can be the same as the fourth encoding port. The battery has an external first encoding port IN and a second encoding port OU. The first encoding port IN is the first interface UP_IN, and the second encoding port OU is the second interface DN_OP+. Both DN_OP and UP_IN+ are connected to microcontroller pins. When the battery is powered on, DN_OP is low by default. The battery addressing line is connected as follows: the first battery's DN_OP+ is connected to the second battery's UP_IN, the second battery's DN_OP+ is connected to the third battery's UP_IN, and so on, with the last battery's DN_OP+ not connected.

[0040] Specifically, 1) the battery is first powered on;

[0041] When the first battery is powered on for the first time, it sends an encoding request frame. After all batteries receive the frame, they set themselves to the encoding idle state (addressable). After waiting for 2 seconds, according to the hardware connection, the batteries with UP_IN+ at low level are the master batteries, and the batteries with UP_IN+ at high level are the slave batteries.

[0042] 2) Addressing process: After the hardware confirms the master and slave devices, the batteries are in the encoding state at this time;

[0043] The master controller keeps its DN_OP high and sends an encoded frame 0x8FB AA 55 01 00 00 00 0000 every 100ms, while setting a timeout counter. If it receives an encoded frame from another slave within 3 seconds, it locks itself, stops sending encoded frames, and only receives slave end frames. If it does not receive a 0x8FB message after 3 seconds, it assumes that there is only one master and one battery in the system, sets its encoding status to complete, and stops encoding. The first slave connected to the master, when its UP_IN+ is low, waits 200ms (to prevent receiving erroneous frames previously; a low UP_IN+ indicates that the upstream battery on the addressing port is active, so a 200ms delay before receiving the bus encoded frame ensures that this encoded frame was sent by its upstream battery), and sets the broadcast ID of the encoded frame received on the CAN bus to its own ID (i.e., 2). After setting its own ID, the battery controls its own DN_OP to be high and sends an encoded frame 0x8FB AA 55 Self-ID 00 00 00 00 00 every 100ms, setting a timeout counter. If it receives an encoded frame from another slave within 2 seconds, it locks itself, stops sending encoded frames, and only receives bus encoding end frames. If it does not receive a bus encoding frame or end frame after 2 seconds, it considers itself the last battery and sends an encoding end frame. Other batteries, upon receiving this, set themselves to the encoding complete state and stop encoding. When the Nth battery receives its own UP_IN+ as low, it waits 200ms and then sets the broadcast ID + 1 of the encoded frame received on the CAN bus to its own ID. After setting its own ID, it controls its own DN_OP to be high and sends an encoded frame 0x8FB AA 55 Self ID 00 00 00 00 00 every 100ms. It sets a timeout counter. If it receives an encoded frame from another slave within 2 seconds, it locks itself, stops sending encoded frames, and only receives bus end frames. If it does not receive a bus encoded frame or end frame after a 2-second timeout, it considers itself to be the last battery and sends an end frame. After other batteries receive the end frame, they set themselves to the encoding complete state and stop encoding.

[0044] 3) Encoding complete;

[0045] Once all batteries in the system are coded, the master sends a 0x100 query message. Upon receiving this message, the slave sends a 0x200+self-ID message, uploading its own voltage, current, temperature, and other information. The master sets a communication timeout counter using the 0x200+slave-ID message sent by the slave; a timeout of 5 seconds indicates that the slave has been lost. Similarly, the slave sets a communication timeout counter using the 0x100 message sent by the master; a timeout of 5 seconds indicates that the master has been lost.

[0046] 4) A new battery arrives during system operation;

[0047] When the system is encoding or has completed encoding, if a new battery is inserted, the battery will send an encoding request frame upon power-up. If other batteries receive the encoding request frame 0x8FB AA 00 00 00 00 00 00 00, with the first two bytes being 0XAA 0x00, they will set their own encoding status to idle. The first battery will then send an encoding frame and re-execute the encoding operations described in steps 2) and 3).

[0048] 5) During system operation, the host communication cable is disconnected or the host is disconnected;

[0049] After the system encoding is completed and master and slave devices are assigned, if the master goes offline, the slave device will stop transmitting via the master message 0x100 for more than 5 seconds, indicating that the master is offline. It will then send an encoding request frame, and all batteries will be re-encoded, performing encoding operations 1) and 2).

[0050] 6) During system operation, the slave communication line is disconnected or the slave device goes offline;

[0051] Once the system coding is complete and master and slave devices are assigned, the master determines that the corresponding slave device 0x200+slave ID has stopped sending. After a 5-second timeout, it confirms that the slave device is lost, and the master summarizes the information response by subtracting the information of the lost slave device.

[0052] In this embodiment, multiple batteries are addressed sequentially using addressing port level actions and broadcast encoded frames. Each battery has a communication timeout. If the next-level battery does not respond, the master determines that there is only one battery in the system and ends the encoding. The slave determines that it is the last battery and sends an encoding end frame. All batteries then stop encoding. If a battery is lost or added during system operation, real-time re-encoding or the master summarizes the information and removes the corresponding lost battery data will be handled, ensuring real-time processing and control, and guaranteeing stable and reliable system operation.

[0053] The following will be combined with the appendix Figure 2 This application provides a detailed description of a real-time encoding method for household energy storage batteries, as illustrated in the embodiments of this application. It should be noted that... Figure 2 The diagram shows a flowchart of a real-time coding method for household energy storage batteries.

[0054] like Figure 2 As shown, the method includes the following steps:

[0055] S1: When none of the N first batteries have been encoded, the first first battery sends an encoding request frame and sets its state to the encoding idle state. When the remaining first batteries receive the encoding request frame, their states are set to the encoding idle state. The N first batteries are connected in sequence, where N is a positive integer. The first battery located at one end of the N first batteries is the first first battery.

[0056] S2: All first batteries send out encoded frames to broadcast their own IDs. If the first battery does not receive an encoded frame after sending out an encoded frame for more than a first preset time, it sends an encoding end frame and sets its status to encoding complete, and stops executing downwards. If the first battery receives an encoded frame sent by a first battery behind it within a first preset time after sending out an encoded frame, it locks itself to receive the encoding end frame and continues executing downwards.

[0057] S3: When the next first battery in two adjacent first batteries receives the encoded frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoded frame. Any first battery after the first first battery receives the encoded frame within a first preset time after sending the encoded frame and locks itself to receive the encoding end frame. When the Nth first battery does not receive the encoded frame within the first preset time after sending the encoded frame, it sends the encoding end frame.

[0058] S4: All first batteries set their state to encoding complete state when they send or receive an encoding end frame.

[0059] In one possible implementation, after step S1, the method further includes: inserting the second battery into the N first batteries when the N first batteries are being encoded or have completed encoding; connecting the second battery to one or two adjacent first batteries; stopping the execution of the steps in or after this step; the second battery sending an encoding request frame; all the first and second batteries setting their states to idle; the first first battery sending an encoding frame; all the first and second batteries sending encoding frames to broadcast their own IDs; when the next first battery in a pair of adjacent first batteries receives the encoding frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoding frame; the second battery, when receiving the encoding frame sent by the battery in front of it... When a first battery sends an encoded frame, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoded frame. When a first battery is behind the second battery, it receives the encoded frame sent by the second battery, sets its own ID to the ID of the first battery +1, and sends its corresponding encoded frame. All first and second batteries lock themselves to receive the encoded frame within a first preset time after sending the encoded frame in order to receive the encoding end frame. If all first and second batteries do not receive the encoded frame within the first preset time after sending the encoded frame, they send the encoding end frame. All first and second batteries set their status to the encoding completion state when sending or receiving the encoding end frame.

[0060] In this embodiment, the first and second batteries are identical. Connected via hardware addressing ports, the master and slave are first identified. The master then controls the addressing port changes and sends encoded frames. Upon receiving the addressing port change, the next-level battery receives the bus encoded frame, increments the received broadcast ID by 1, sets it to its own ID, controls its own encoding port change, and sends encoded frames. After the last battery sends its encoded frame, if it doesn't receive a reply from other batteries within 2 seconds, it considers itself the last battery, sends an encoding end frame, and sets encoding completion. The remaining batteries, upon receiving the encoding end frame, also set encoding completion. Both the master and slave batteries have encoding timeout counters. If the master's encoding port activates but doesn't receive any other battery encoded frames, it considers itself the only battery after a 3-second timeout. Similarly, if a slave's encoding port activates but doesn't receive any other battery encoded frames, it considers itself the last battery after a 2-second timeout and sends an encoding end frame. The encoding ends upon receiving this frame from the other batteries. After encoding is complete, any battery disconnection or addition can be handled in real time. For disconnected batteries, a master / slave mechanism is used. If the master battery disconnects, all batteries are reassigned addresses; if a slave battery disconnects, the master's aggregated information is reduced accordingly by the disconnected battery information. If a new battery is added, it sends an encoding request frame upon power-up. Upon receiving this frame, all other batteries will set their encoding idle status and re-encode. While encoding is incomplete, real-time monitoring of addressing port level changes, as well as the CAN bus encoding and termination frames, enables rapid and sequential addressing. After encoding is complete, by setting communication timeouts for both master and slave batteries and monitoring the received encoding request frames on the CAN bus, the system can dynamically respond and quickly address batteries in case of disconnection or addition. This ensures stable and reliable system operation and facilitates after-sales service in locating problematic batteries and pinpointing the cause.

[0061] Those skilled in the art will clearly understand that the technical solutions of the embodiments of this application can be implemented by means of software and / or hardware. In this specification, "unit", "module" and "part" refer to software and / or hardware that can independently complete or cooperate with other components to complete a specific function, wherein the hardware may be, for example, a field-programmable gate array (FPGA), an integrated circuit (IC), etc.

[0062] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0063] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0064] In the embodiments provided in this application, it should be understood that the disclosed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some service interfaces; indirect couplings or communication connections between systems or units may be electrical or other forms.

[0065] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0066] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0067] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0068] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.

[0069] The foregoing description is merely an exemplary embodiment of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Those skilled in the art will readily conceive of embodiments of this disclosure upon considering the specification and practicing the disclosure herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described herein. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A real-time coding system for household energy storage batteries, characterized in that: The system comprises N first batteries connected sequentially, where N is a positive integer. The first battery located at one end of the N first batteries is designated as the first first battery. When none of the N first batteries have been encoded, the first first battery sends an encoding request frame and then an encoding frame. All first batteries send encoding frames to broadcast their own IDs. Each first battery sets its state to an encoding idle state when sending or receiving an encoding request frame. Each first battery sends an encoding end frame if it does not receive an encoding frame after sending an encoding frame for a first preset time. When N is a positive integer greater than 1, the next first battery in a pair of adjacent first batteries sets its own ID to the ID + 1 of the previous first battery and sends its corresponding encoding frame when it receives an encoding frame sent by the previous first battery. Each first battery locks itself to receive an encoding end frame within a first preset time after sending an encoding frame, and sets its state to an encoding complete state when sending or receiving an encoding end frame.

2. The real-time coding system for household energy storage batteries as described in claim 1, characterized in that: It also includes a second battery inserted among the N first batteries when the N first batteries are encoding or encoding is complete, the second battery being connected to one or two adjacent first batteries; after the second battery sends an encoding request frame, all the first and second batteries set their states to idle state, and the first first battery sends an encoding frame; when the second battery receives an encoding frame sent by a first battery in front of it, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame, the second battery sending the encoding frame is used to broadcast its own ID, when a first battery is behind the second battery, the first battery receives the encoding frame sent by the second battery, sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoding frame; the second battery is used to send an encoding end frame if it does not receive an encoding frame after sending an encoding frame for more than a first preset time; the second battery is used to lock itself to receive the encoding end frame after receiving an encoding frame within a first preset time after sending an encoding frame, the second battery is used to set its state to encoding complete state when sending or receiving an encoding end frame.

3. The real-time coding system for household energy storage batteries as described in claim 2, characterized in that: The first battery includes a first encoding port and a second encoding port; when N is a positive integer greater than 1, the second encoding port of the first battery in two adjacent first batteries is connected to the first encoding port of the second battery; the second battery includes a third encoding port and a fourth encoding port, when a first battery is provided on the front side of the second battery, the third encoding port of the second battery is connected to the second encoding port of the first battery, and when another first battery is provided on the rear side of the second battery, the fourth encoding port of the second battery is connected to the first encoding port of the first battery.

4. A real-time coding system for household energy storage batteries as described in claim 2 or 3, characterized in that: When N is a positive integer greater than 1, two adjacent first batteries communicate via CAN, and the second battery communicates via CAN with a first battery located in front of it and / or another first battery located behind it.

5. A real-time coding system for household energy storage batteries as described in claim 2 or 3, characterized in that: The first battery and the second battery emit corresponding encoded frames every second preset time interval within a first preset time interval starting from the moment when they first emit the encoded frame, and the second preset time interval is less than the first preset time interval.

6. A real-time coding system for household energy storage batteries as claimed in claim 5, characterized in that: The first battery is used to send an end-of-encoding frame if it does not receive an encoded frame for more than 3 seconds after sending an encoded frame, and the remaining first and second batteries are used to send an end-of-encoding frame if they do not receive an encoded frame for more than 2 seconds after sending an encoded frame.

7. The real-time coding system for household energy storage batteries as described in claim 6, characterized in that: The second preset time is 100ms.

8. A real-time coding system for household energy storage batteries as claimed in claim 1, 2, or 3, characterized in that: It also includes an energy storage PCS, which communicates with the first first battery via CAN.

9. A real-time coding method for household energy storage batteries, characterized in that, Includes the following steps: S1: When none of the N first batteries have been encoded, the first first battery sends an encoding request frame and sets its state to the encoding idle state. When the remaining first batteries receive the encoding request frame, their states are set to the encoding idle state. The N first batteries are connected in sequence, where N is a positive integer. The first battery located at one end of the N first batteries is the first first battery. S2: All first batteries send out encoded frames to broadcast their own IDs. If the first battery does not receive an encoded frame after sending out an encoded frame for more than a first preset time, it sends an encoding end frame and sets its status to encoding complete, and stops executing downwards. If the first battery receives an encoded frame sent by a first battery behind it within a first preset time after sending out an encoded frame, it locks itself to receive the encoding end frame and continues executing downwards. S3: When the next first battery in two adjacent first batteries receives the encoded frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoded frame. Any first battery after the first first battery receives the encoded frame within a first preset time after sending the encoded frame and locks itself to receive the encoding end frame. When the Nth first battery does not receive the encoded frame within the first preset time after sending the encoded frame, it sends the encoding end frame. S4: All first batteries set their state to encoding complete state when they send or receive an encoding end frame.

10. The real-time coding method for a household energy storage battery as described in claim 9, characterized in that, Following step S1, the process further includes: inserting the second battery into the N first batteries when the N first batteries are being encoded or have completed encoding; connecting the second battery to one or two adjacent first batteries; stopping the execution of the steps in or after this step; the second battery sending an encoding request frame; all first and second batteries setting their states to idle; the first first battery sending an encoding frame; all first and second batteries sending encoding frames to broadcast their own IDs; when the next first battery in a pair of adjacent first batteries receives the encoding frame sent by the previous first battery, it sets its own ID to the ID of the previous first battery + 1 and sends its corresponding encoding frame; the second battery, upon receiving the encoding frame from the first battery in front of it... When a battery sends an encoded frame, it sets its own ID to the ID of the first battery in front of it +1 and sends its corresponding encoded frame. When a first battery is behind the second battery, the first battery receives the encoded frame sent by the second battery, sets its own ID to the ID of the first battery +1, and sends its corresponding encoded frame. All first and second batteries lock themselves to receive the encoded frame within a first preset time after sending the encoded frame in order to receive the encoding end frame. If all first and second batteries do not receive the encoded frame within the first preset time after sending the encoded frame, they send the encoding end frame. All first and second batteries set their status to the encoding completion state when sending or receiving the encoding end frame.