Multi-step automatic activation and communication method of battery management system

Through the multi-step automatic activation and communication method, the problem of complex configuration and errors of the battery management system is solved, the high reliability and manageability of the system are achieved, and it is suitable for complex application scenarios.

CN119340519APending Publication Date: 2025-01-21GUANGZHOU LANGO ELECTRONICS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411483457.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-01-21

AI Technical Summary

Technical Problem

The existing battery management system is complex in configuration, prone to coding conflicts and communication failures, resulting in system configuration errors, increasing operational complexity and error probability.

Method used

Adopt multi -step automatic activation and communication methods, including BMS initialization internal status, detect hosting activation signals, establish communication channels through RS485 and CAN bus, automatically allocate battery packs unique encoding, and determine the effective battery packages through threshold comparison and historical data trend analysis algorithm. sex.

Benefits of technology

It improves system reliability and management, reduce the probability of configuration errors, ensure the stability and security of the battery system, and adapt to complex application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119340519A_ABST
    Figure CN119340519A_ABST
Patent Text Reader

Abstract

The invention relates to the field of battery management systems, in particular to a multi-step automatic activation and communication method for a battery management system, which comprises the following steps: after a multi-battery pack system is powered on, a BMS (Battery Management System) initializes an internal state and waits for an activation signal of a host; after the activation signal is detected, the host sends a polling request through an RS485 communication channel, and the BMS receives and processes the polling request; the BMS detects the number of the connected battery packs through the CAN bus, and after communication channels between the battery packs and the RS485 are activated, CAN communication channels between the battery packs are activated; and automatically allocating the unique code of the battery pack, and after detecting that the allocated code does not conflict with other battery pack codes, successfully activating and notifying the host. The method can improve the reliability of the system, enhance the manageability of the system, improve the performance of the system and adapt to complex application scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of battery management systems, and in particular to a multi-step automatic activation and communication method for a battery management system. Background Art

[0002] In modern electronic devices and electric vehicles, batteries play a vital role as energy storage units. Battery management systems (BMS) have emerged to monitor the status of batteries, including parameters such as voltage, current, and temperature, and to manage battery charge and discharge, balance control, and other operations to improve battery performance and life, while ensuring system safety. In a multi-battery pack system, the configuration process is complex, prone to coding conflicts and communication failures. The configuration process of traditional battery management systems is complex, prone to coding conflicts, and leads to system configuration errors. In the prior art, it is usually necessary to manually configure the communication code of each battery pack, which increases the complexity of system configuration and the probability of error. For example, after power-on, the BMS may not be able to automatically initialize the internal state and wait for the host activation signal, which requires manual intervention to start the system, increasing the complexity of operation and the possibility of error. When the host sends an activation signal through a specific communication channel, if the BMS cannot accurately detect and confirm the activation request, it will not be able to smoothly enter the subsequent battery pack detection and other steps. Summary of the invention

[0003] To solve the above problems, the present invention provides a multi-step automatic activation and communication method for a battery management system, which can improve system reliability, enhance system manageability, improve system performance and adapt to complex application scenarios.

[0004] To achieve the above object, the technical solution adopted by the present invention is:

[0005] A multi-step automatic activation and communication method for a battery management system comprises the following steps:

[0006] After the multi-battery pack system is powered on, the BMS initializes its internal state and waits for the activation signal from the host;

[0007] After detecting the activation signal, the host sends a polling request through the RS485 communication channel, and the BMS receives and processes the polling request;

[0008] The BMS detects the number of connected battery packs through the CAN bus, activates the communication channel between the battery packs and RS485, and then activates the CAN communication channel between the battery packs;

[0009] Automatically assign a unique code to the battery pack. After detecting that the assigned code does not conflict with other battery pack codes, the activation is successful and the host is notified. The unique code is automatically assigned, and the formula is:

[0010] Unique_Code = (N×2)%M;

[0011] Among them: Unique_Code is the unique code finally assigned, N is the initial number of the battery pack, and M is the total number of battery packs.

[0012] Furthermore, the BMS initializes the internal state and waits for the activation signal from the host, including: the BMS continuously monitors the signal on the hardware interface through an interrupt mechanism, and when a 5V activation signal is detected, the BMS initializes the resources for battery pack detection. At the same time, the BMS prepares to record various status information during the battery pack detection process.

[0013] Furthermore, the BMS receives and processes the polling request, including: the BMS counts the number of polling times and maintains a counter corresponding to the number of times, records the received polling signal, and periodically checks the number of polling times through a timer. When the polling reaches 6 times, the BMS executes the battery pack detection process.

[0014] Furthermore, the BMS detects the number of connected battery packs via the CAN bus, including:

[0015] The BMS continuously monitors the CAN bus in an infinite loop, waiting for the battery pack to send status information. When a CAN data packet is received, the BMS parses the data packet according to the pre-defined communication protocol to determine the status signal of the battery pack;

[0016] The BMS determines whether the received signal status is valid through the battery pack judgment model. For each valid battery pack, the BMS increases the value of the valid battery pack counter and stores the received valid battery pack information.

[0017] Further, the status signal includes an identifier, voltage, current and temperature of the battery pack;

[0018] The battery pack judgment model comprises the following steps:

[0019] According to the specific characteristics of the BMS, determine the reasonable threshold range of the battery pack status parameters. When receiving the battery pack status signal, extract the key parameters therein and compare these parameters with the corresponding thresholds respectively. If the parameters are within the threshold range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid;

[0020] During the operation of the BMS, the status data of the battery pack is continuously collected, and historical data within a certain period of time is stored. Algorithm training is performed based on historical data to determine the normal status change trend. When a new battery pack status signal is received, the current status parameters are extracted and compared with the trend of historical data. If the current parameters are within a reasonable trend range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid;

[0021] The status parameters of the battery pack are judged by a threshold comparison algorithm and a historical data trend analysis algorithm respectively. If both algorithms consider the battery pack to be valid, the battery pack is ultimately determined to be valid; otherwise, the battery pack is considered invalid.

[0022] Furthermore, the activation of the communication channel between the battery pack and RS485 includes the following steps:

[0023] Determine the communication parameters according to the design requirements of the BMS and the characteristics of the battery pack. The BMS sets the pin function of the RS485 communication interface and enables the RS485 transceiver through the microcontroller;

[0024] The BMS scans the connected battery packs, determines the presence of the battery packs by detecting the device address on the RS485 bus, and assigns a unique address to each connected battery pack;

[0025] The BMS generates a test data packet containing specific flags, commands or data, and the BMS sends the test data packet to each connected battery pack through the RS485 interface according to the sending function of the RS485 communication protocol;

[0026] The host monitors the RS485 communication channel and waits to receive the test data packet from the BMS. The host parses and verifies each field of the data packet according to the protocol rules, and checks the integrity, correctness and validity of the data packet. When the host successfully receives and verifies the test data packet, it confirms that the RS485 communication channel has been successfully established.

[0027] Furthermore, the activating the CAN communication channel between the battery packs comprises the following steps:

[0028] The BMS determines all connected battery packs through the assigned unique addresses. The BMS sends a specific command to the battery pack through the RS485 communication channel to activate the CAN communication interface of each battery pack. When the CAN communication interface is activated, the BMS sets the baud rate parameters and frame format parameters through the configuration register of the CAN controller according to the system requirements and battery pack characteristics.

[0029] BMS sends a test message to each battery pack through the CAN bus. After receiving the test message, the battery pack replies with a response message to the BMS. The BMS waits for the response message by monitoring the CAN bus. The BMS checks the received response message and verifies whether the communication channel is normal through the verification model.

[0030] The BMS traverses the communication status of all battery packs, confirms that the CAN communication interface of each battery pack has been successfully activated and the communication channel is normal. When the communication status of all battery packs is normal, the BMS confirms that the CAN communication network is ready through a weighted evaluation algorithm and sends a confirmation message to the host.

[0031] Further, the checking of the received response message includes checking the content, format and sequence number of the response message;

[0032] The verification model comprises the following steps:

[0033] Through the accumulation and check algorithm, the value of each byte in the sent test message is accumulated to obtain the checksum value. When the BMS sends the test message to the battery pack, it also sends the calculated checksum. After the battery pack receives the test message, it calculates the checksum of the response message in the same checksum calculation method, and includes the checksum of the response message in the response message and sends it back to the BMS;

[0034] Through the message sequence number algorithm, the BMS assigns a unique sequence number to each test message sent. The BMS sends the test message and the corresponding sequence number to the battery pack. The battery pack includes the received sequence number in the response message. After receiving the response message, the BMS checks whether the sequence number in the response message is consistent with the expected sequence number. If they are consistent, the sequence number verification is successful.

[0035] When both the checksum verification and the serial number verification pass, it is confirmed that the communication channel is normal. When any one of the verifications fails, it indicates that there is a problem with the communication channel of the marked battery pack.

[0036] Furthermore, the automatic allocation of a unique battery pack code, after detecting that the allocated code has no conflict with other battery pack codes, the activation is successful and the host is notified; comprises the following steps:

[0037] The starting code is determined by the initial code variable in the BMS software. The BMS automatically assigns a unique code to each connected battery pack in turn. Each battery pack broadcasts its own code information through the CAN bus. At the same time, each battery pack monitors the CAN bus and receives the code information broadcast by other battery packs. The battery pack stores the received code information in an internal data structure.

[0038] Through the coding conflict detection algorithm, the BMS traverses all battery packs to check whether there is a coding conflict. i , BMS checks whether the coding of other battery packs is consistent with B i The codes of the two digits are the same. If the same codes are found, it is considered that there is a conflict.

[0039] When a coding conflict is detected, the BMS reallocates a new coding to the conflicting battery pack. The new coding is different from the already allocated coding. The BMS continues to perform coding conflict detection through multiple iterations until the coding of all battery packs is unique.

[0040] The beneficial effects of the present invention are:

[0041] 1. The threshold comparison algorithm and the historical data trend analysis algorithm are used to determine the effectiveness of the battery pack, which can accurately identify the battery pack in normal working condition and avoid system instability or safety problems caused by the use of faulty battery packs. For example, when the parameters such as voltage, current and temperature of the battery pack exceed the reasonable threshold range or are inconsistent with the historical data trend, it can be promptly judged as invalid, thereby ensuring that the entire battery system is composed of reliable battery packs. The complementary algorithm of the checksum algorithm and the message sequence number algorithm is used to verify the communication channel, which can effectively detect errors in data transmission and ensure the order and integrity of messages. For example, the checksum algorithm can prevent data corruption, and the message sequence number algorithm can detect message loss or duplication. The combination of the two greatly improves the reliability of communication and ensures accurate information transmission between the BMS and the battery pack.

[0042] 2. Assign a unique code to each battery pack and execute a coding conflict detection algorithm so that each battery pack has a clear identification in the system. This not only facilitates the BMS to manage and monitor each battery pack individually, but also accurately identifies the source of the battery pack sending and receiving information during the communication process, improving the management efficiency and communication accuracy of the system. The multi-step automatic activation process makes the system startup more orderly. From the BMS initializing the internal state and waiting for the host activation signal, to the step-by-step battery pack detection, establishing communication channels and other steps, each link has a clear purpose and operation process, which makes it convenient for system administrators to understand the operating status of the system and discover and solve problems in a timely manner.

[0043] 3. Reasonable configuration of communication parameters can improve communication speed and data transmission accuracy, reduce communication delays and error rates, and thus improve the performance of the entire system. The battery pack detection process is performed only when the number of polling times reaches a specific value, avoiding unnecessary frequent detection, saving system resources, and improving the pertinence and efficiency of detection. This method is applicable to multi-battery pack systems and can effectively manage and coordinate the work of multiple battery packs. Whether in complex application scenarios such as electric vehicles or energy storage systems, it can ensure the coordinated work of each battery pack and improve the performance and stability of the entire system. The comprehensive use of multiple algorithms and technologies enables the battery management system to adapt to different working environments and battery characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 It is a flow chart of a multi-step automatic activation and communication method of a battery management system.

[0045] Figure 2 It is a schematic diagram of a multi-step automatic activation and communication method of a battery management system. DETAILED DESCRIPTION

[0046] See also Figure 1 and Figure 2 As shown, the present invention relates to a multi-step automatic activation and communication method for a battery management system, comprising the following steps:

[0047] After the multi-battery pack system is powered on, the BMS initializes its internal state and waits for the activation signal from the host;

[0048] After detecting the activation signal, the host sends a polling request through the RS485 communication channel, and the BMS receives and processes the polling request;

[0049] The BMS detects the number of connected battery packs through the CAN bus, activates the communication channel between the battery packs and RS485, and then activates the CAN communication channel between the battery packs;

[0050] Automatically assign a unique code to the battery pack. After detecting that the assigned code does not conflict with other battery pack codes, the activation is successful and the host is notified. The unique code is automatically assigned, and the formula is:

[0051] Unique_Code = (N×2)%M;

[0052] Among them: Unique_Code is the unique code finally assigned, N is the initial number of the battery pack, and M is the total number of battery packs.

[0053] Furthermore, the BMS initializes the internal state and waits for the activation signal from the host, including: the BMS continuously monitors the signal on the hardware interface through an interrupt mechanism, and when a 5V activation signal is detected, the BMS initializes the resources for battery pack detection. At the same time, the BMS prepares to record various status information during the battery pack detection process.

[0054] Specifically, when the multi-battery pack system is powered on, the BMS first monitors the stability of the power input through the power management module. A high-precision voltage sensor is used to monitor the power input voltage in real time and compare it with the preset voltage range. If the voltage is out of range, the BMS cuts off the power input by controlling relays or other switching devices to protect the system and ensure that the input voltage is within the specified range to prevent excessive or low voltage from damaging the system. The BMS performs self-inspections on its own hardware, including various sensors such as voltage sensors, current sensors, temperature sensors, controllers, and communication modules.

[0055] For the BMS internal state initialization, various parameters inside the BMS are reset to default values, including: battery capacity, charging current, discharging current, protection threshold and other parameters. Various status flags of the BMS are initialized, including: charging status flag, discharging status flag and fault status flag, etc. The clock module of the BMS is initialized to provide accurate time information through the real-time clock chip to ensure the accuracy of the time, which is very important for recording information such as battery usage time and charging time.

[0056] The BMS configures the interface for communicating with the host, including selecting the communication protocol (including CAN bus and RS485) and setting the communication parameters (including: baud rate, data bit or stop bit). The BMS continuously monitors the communication interface and waits for the activation signal from the host. The activation signal is a specific data packet or a specific pin level change. If the activation signal from the host is not received within a certain period of time, the BMS takes corresponding timeout processing measures, such as issuing an alarm, entering low power mode, or reinitializing the communication interface. After detecting the signal, the system confirms the activation request and prepares to detect the battery pack.

[0057] The BMS configures the hardware interface connected to the host to ensure that the 5V activation signal can be received correctly. The BMS continuously monitors the signals on the hardware interface. The BMS initializes various resources for battery pack detection, including sensors, analog-to-digital converters (ADCs), communication modules, etc. Ensure that these resources are available for accurate battery pack detection. The BMS loads and prepares to execute algorithms for battery pack detection. These algorithms include battery voltage detection algorithms, battery internal resistance detection algorithms, and battery capacity estimation algorithms.

[0058] Furthermore, the BMS receives and processes the polling request, including: the BMS counts the number of polling times and maintains a counter corresponding to the number of times, records the received polling signal, and periodically checks the number of polling times through a timer. When the polling reaches 6 times, the BMS executes the battery pack detection process.

[0059] Specifically, the BMS first configures the RS485 interface for communication with the host, including: setting parameters such as baud rate, data bit, stop bit and check bit to ensure that the communication parameters are consistent with the host. In order to respond to the host's polling request in a timely manner, the BMS sets a receive interrupt. When data is received through the RS485 interface, the interrupt service program is triggered to process the data. After receiving the polling request, the BMS records it. Use a variable or data structure to store relevant information of the polling signal, such as reception time, request content, etc. Whenever a polling request is received, add one to the counter value. The BMS periodically checks whether the number of polling times has reached 6 times, and uses a timer to make a judgment. When the number of polling times reaches 6 times, the BMS executes the battery pack detection process.

[0060] Furthermore, the BMS detects the number of connected battery packs via the CAN bus, including:

[0061] The BMS continuously monitors the CAN bus in an infinite loop, waiting for the battery pack to send status information. When a CAN data packet is received, the BMS parses the data packet according to the pre-defined communication protocol to determine the status signal of the battery pack;

[0062] The BMS determines whether the received signal status is valid through the battery pack judgment model. For each valid battery pack, the BMS increases the value of the valid battery pack counter and stores the received valid battery pack information.

[0063] Specifically, according to the predefined communication protocol, the data fields in the CAN data packet are parsed, and specific information is extracted using bit masking, bit shifting and other techniques. For example, when the format of the status signal is an 8-byte CAN data packet, the first two bytes represent the battery pack identifier, the next two bytes represent the voltage, the next two bytes represent the current, and the last two bytes represent the temperature, then the corresponding bit operations and data type conversions are used to extract this information.

[0064] The battery pack information is stored including the battery pack identifier, status parameters, etc. The battery pack information is stored through a data structure, such as a structure array. Each structure contains fields such as the battery pack identifier, voltage, current, and temperature. When a valid status signal is received, the corresponding information is stored in the structure array.

[0065] Further, the status signal includes an identifier, voltage, current and temperature of the battery pack;

[0066] The battery pack judgment model comprises the following steps:

[0067] According to the specific characteristics of the BMS, determine the reasonable threshold range of the battery pack status parameters. When receiving the battery pack status signal, extract the key parameters therein and compare these parameters with the corresponding thresholds respectively. If the parameters are within the threshold range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid;

[0068] During the operation of the BMS, the status data of the battery pack is continuously collected, and historical data within a certain period of time is stored. Algorithm training is performed based on historical data to determine the normal status change trend. When a new battery pack status signal is received, the current status parameters are extracted and compared with the trend of historical data. If the current parameters are within a reasonable trend range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid;

[0069] The status parameters of the battery pack are judged by a threshold comparison algorithm and a historical data trend analysis algorithm respectively. If both algorithms consider the battery pack to be valid, the battery pack is ultimately determined to be valid; otherwise, the battery pack is considered invalid.

[0070] Specifically, in determining the threshold range, for example, for voltage, the normal operating voltage range is determined according to the type and specification of the battery; for temperature, the threshold is determined according to the safe operating temperature range of the battery. Assuming that the battery is a lithium-ion battery, its normal operating voltage range is usually 3.0V-4.2V, and its safe operating temperature range is 0℃-45℃. The key parameters include voltage, current, and temperature.

[0071] The state change trend, for example, calculates the average value, standard deviation and other statistics of parameters such as voltage, current, temperature, etc. in the historical data. Assume that n historical data are collected, and the voltage values ​​are V1, V2, ..., V n , then the average voltage is The standard deviation of the voltage is In the historical data trend analysis algorithm, take voltage as an example, assuming that the currently received voltage is V current ,if Where k is a coefficient determined according to actual conditions. If the current voltage is within a reasonable trend range, the voltage parameters are valid; otherwise, the voltage parameters are invalid.

[0072] Furthermore, the activation of the communication channel between the battery pack and RS485 includes the following steps:

[0073] Determine the communication parameters according to the design requirements of the BMS and the characteristics of the battery pack. The BMS sets the pin function of the RS485 communication interface and enables the RS485 transceiver through the microcontroller;

[0074] The BMS scans the connected battery packs, determines the presence of the battery packs by detecting the device address on the RS485 bus, and assigns a unique address to each connected battery pack;

[0075] The BMS generates a test data packet containing specific flags, commands or data, and the BMS sends the test data packet to each connected battery pack through the RS485 interface according to the sending function of the RS485 communication protocol;

[0076] The host monitors the RS485 communication channel and waits to receive the test data packet from the BMS. The host parses and verifies each field of the data packet according to the protocol rules, and checks the integrity, correctness and validity of the data packet. When the host successfully receives and verifies the test data packet, it confirms that the RS485 communication channel has been successfully established.

[0077] Specifically, the communication parameters are determined, such as the baud rate can be selected as 9600bps, 115200bps, etc.; the data bit is usually 8 bits; the check bit is no check, odd check or even check.

[0078] Assign a unique address to each connected battery pack so that it can be identified and distinguished in subsequent communications. Use an automatic address allocation algorithm, such as starting from the starting address and assigning addresses to each battery pack in turn. In the process of allocating addresses, ensure the uniqueness of the addresses to avoid conflicts.

[0079] The test data packet is used to verify the availability of the communication channel. The host waits to receive the test data packet by interrupting or polling according to the same RS485 communication interface and parameter settings. The host confirms that the RS485 communication channel has been successfully established by sending a confirmation signal or setting a flag bit to indicate that the communication channel has been successfully established; the BMS confirms the status of the communication channel by reading the host's confirmation signal or flag bit.

[0080] Furthermore, the activating the CAN communication channel between the battery packs comprises the following steps:

[0081] The BMS determines all connected battery packs through the assigned unique addresses. The BMS sends a specific command to the battery pack through the RS485 communication channel to activate the CAN communication interface of each battery pack. When the CAN communication interface is activated, the BMS sets the baud rate parameters and frame format parameters through the configuration register of the CAN controller according to the system requirements and battery pack characteristics.

[0082] BMS sends a test message to each battery pack through the CAN bus. After receiving the test message, the battery pack replies with a response message to the BMS. The BMS waits for the response message by monitoring the CAN bus. The BMS checks the received response message and verifies whether the communication channel is normal through the verification model.

[0083] The BMS traverses the communication status of all battery packs, confirms that the CAN communication interface of each battery pack has been successfully activated and the communication channel is normal. When the communication status of all battery packs is normal, the BMS confirms that the CAN communication network is ready through a weighted evaluation algorithm and sends a confirmation message to the host.

[0084] Specifically, a test message is sent to each battery pack to generate a CAN data packet containing specific test data. This test message can be a simple inquiry command or a specific data frame used to verify the normality of the communication channel, such as a data packet containing a "communication test" flag and a serial number. This data packet is sent to the CAN address of each battery pack.

[0085] The weighted evaluation algorithm is to assign different weights to different communication test results, such as a higher weight for a successful response and a lower weight for a response timeout or error. The BMS performs a weighted evaluation on the test results of each battery pack to obtain a comprehensive score. When the comprehensive scores of all battery packs exceed the preset threshold, the CAN communication network is confirmed to be ready. Sending a confirmation message to the host is to set a system status flag or send a confirmation message to the host to indicate that the CAN communication network can be used normally.

[0086] Further, the checking of the received response message includes checking the content, format and sequence number of the response message;

[0087] The verification model comprises the following steps:

[0088] Through the accumulation and check algorithm, the value of each byte in the sent test message is accumulated to obtain the checksum value. When the BMS sends the test message to the battery pack, it also sends the calculated checksum. After the battery pack receives the test message, it calculates the checksum of the response message in the same checksum calculation method, and includes the checksum of the response message in the response message and sends it back to the BMS;

[0089] Through the message sequence number algorithm, the BMS assigns a unique sequence number to each test message sent. The BMS sends the test message and the corresponding sequence number to the battery pack. The battery pack includes the received sequence number in the response message. After receiving the response message, the BMS checks whether the sequence number in the response message is consistent with the expected sequence number. If they are consistent, the sequence number verification is successful.

[0090] When both the checksum verification and the serial number verification pass, it is confirmed that the communication channel is normal. When any one of the verifications fails, it indicates that there is a problem with the communication channel of the marked battery pack.

[0091] The checksum value is obtained, assuming that the test message is a data packet containing multiple bytes of data, using D1, D2, ..., D n Represents the byte data in the data packet, then the cumulative checksum For the multi-step automatic activation and communication method of the battery management system, the byte range involved in the checksum calculation is determined according to the specific content and format of the data packet. For example, only the bytes containing key information can be checked and calculated. Add the checksum byte at the end of the test message. After the BMS receives the response message, it extracts the checksum in the response message and compares it with the checksum calculated by itself. If the two are consistent, the checksum verification passes.

[0092] The unique serial number assigned starts from an initial value and is incremented each time a message is sent. When any of the verifications fails, it is marked that there is a problem with the communication channel of the battery pack, and appropriate measures should be taken, such as resending the test message or troubleshooting. If the communication channel verification fails, the BMS decides whether to retry based on the specific situation. For example, an upper limit on the number of retries is set. If the communication channel still cannot be verified before the upper limit is reached, a fault is reported.

[0093] Furthermore, the automatic allocation of a unique battery pack code, after detecting that the allocated code has no conflict with other battery pack codes, the activation is successful and the host is notified; comprises the following steps:

[0094] The starting code is determined by the initial code variable in the BMS software. The BMS automatically assigns a unique code to each connected battery pack in turn. Each battery pack broadcasts its own code information through the CAN bus. At the same time, each battery pack monitors the CAN bus and receives the code information broadcast by other battery packs. The battery pack stores the received code information in an internal data structure.

[0095] Through the coding conflict detection algorithm, the BMS traverses all battery packs to check whether there is a coding conflict. i , BMS checks whether the coding of other battery packs is consistent with B i The codes of the two digits are the same. If the same codes are found, it is considered that there is a conflict.

[0096] When a coding conflict is detected, the BMS reallocates a new coding to the conflicting battery pack. The new coding is different from the already allocated coding. The BMS continues to perform coding conflict detection through multiple iterations until the coding of all battery packs is unique.

[0097] Specifically, the starting code provides a clear starting point for subsequent sequential allocation. This choice makes the coding easy to understand and manage, and also facilitates the identification and distinction of different battery packs in the system. The broadcast is through the CAN communication module in the battery pack, encapsulating the encoded information as a data field in the CAN data packet and sending it to the CAN bus. The CAN communication module of the battery pack is set to receive mode. When a CAN data packet is received, the encoded information in the data packet is parsed and stored in a data structure such as an array or a linked list.

[0098] The above implementation modes are merely descriptions of the preferred implementation modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary engineering and technical personnel in the field shall fall within the protection scope determined by the claims of the present invention.

Claims

1. A multi-step automatic activation and communication method for a battery management system, characterized in that: The following steps are involved: After the multi-battery pack system is powered on, the BMS initializes its internal state and waits for the activation signal from the host; After detecting the activation signal, the host sends a polling request through the RS485 communication channel, and the BMS receives and processes the polling request; The BMS detects the number of connected battery packs through the CAN bus, activates the communication channel between the battery packs and RS485, and then activates the CAN communication channel between the battery packs; Automatically assign a unique code to the battery pack. After detecting that the assigned code does not conflict with other battery pack codes, the activation is successful and the host is notified. The unique code is automatically assigned, and the formula is: Unique_Code = (N×2)%M; Among them: Unique_Code is the unique code finally assigned, N is the initial number of the battery pack, and M is the total number of battery packs.

2. The multi-step automatic activation and communication method of a battery management system according to claim 1, characterized in that: The BMS initializes the internal state and waits for the activation signal of the host, including: the BMS continuously monitors the signal on the hardware interface through the interrupt mechanism. When the 5V activation signal is detected, the BMS initializes the resources for battery pack detection. At the same time, the BMS prepares to record various status information during the battery pack detection process.

3. The multi-step automatic activation and communication method of a battery management system according to claim 1, characterized in that: The BMS receives and processes the polling request, including: the BMS counts the number of polling times and maintains a counter corresponding to the number of polling times, records the received polling signal, and periodically checks the number of polling times through a timer. When the polling reaches 6 times, the BMS executes the battery pack detection process.

4. The multi-step automatic activation and communication method of a battery management system according to claim 1, characterized in that: The BMS detects the number of connected battery packs via the CAN bus, including: The BMS continuously monitors the CAN bus in an infinite loop, waiting for the battery pack to send status information. When a CAN data packet is received, the BMS parses the data packet according to the pre-defined communication protocol to determine the status signal of the battery pack; The BMS determines whether the received signal status is valid through the battery pack judgment model. For each valid battery pack, the BMS increases the value of the valid battery pack counter and stores the received valid battery pack information.

5. The multi-step automatic activation and communication method of a battery management system according to claim 4, characterized in that: The status signal includes an identifier, voltage, current and temperature of the battery pack; The battery pack judgment model comprises the following steps: According to the specific characteristics of the BMS, determine the reasonable threshold range of the battery pack status parameters. When receiving the battery pack status signal, extract the key parameters therein and compare these parameters with the corresponding thresholds respectively. If the parameters are within the threshold range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid; During the operation of the BMS, the status data of the battery pack is continuously collected, and historical data within a certain period of time is stored. Algorithm training is performed based on historical data to determine the normal status change trend. When a new battery pack status signal is received, the current status parameters are extracted and compared with the trend of historical data. If the current parameters are within a reasonable trend range, the parameters are considered valid, otherwise the parameters are considered invalid; if all key parameters are valid, the battery pack is considered valid, otherwise the battery pack is considered invalid; The status parameters of the battery pack are judged by a threshold comparison algorithm and a historical data trend analysis algorithm respectively. If both algorithms consider the battery pack to be valid, the battery pack is ultimately determined to be valid; otherwise, the battery pack is considered invalid.

6. The multi-step automatic activation and communication method of a battery management system according to claim 1, characterized in that: The activation of the communication channel between the battery pack and RS485 includes the following steps: Determine the communication parameters according to the design requirements of the BMS and the characteristics of the battery pack. The BMS sets the pin function of the RS485 communication interface and enables the RS485 transceiver through the microcontroller; The BMS scans the connected battery packs, determines the presence of the battery packs by detecting the device address on the RS485 bus, and assigns a unique address to each connected battery pack; The BMS generates a test data packet containing specific flags, commands or data, and the BMS sends the test data packet to each connected battery pack through the RS485 interface according to the sending function of the RS485 communication protocol; The host monitors the RS485 communication channel and waits to receive the test data packet from the BMS. The host parses and verifies each field of the data packet according to the protocol rules, and checks the integrity, correctness and validity of the data packet. When the host successfully receives and verifies the test data packet, it confirms that the RS485 communication channel has been successfully established.

7. The multi-step automatic activation and communication method of a battery management system according to claim 6, characterized in that: The activating CAN communication channel between the battery packs comprises the following steps: The BMS determines all connected battery packs through the assigned unique addresses. The BMS sends a specific command to the battery pack through the RS485 communication channel to activate the CAN communication interface of each battery pack. When the CAN communication interface is activated, the BMS sets the baud rate parameters and frame format parameters through the configuration register of the CAN controller according to the system requirements and battery pack characteristics. BMS sends a test message to each battery pack through the CAN bus. After receiving the test message, the battery pack replies with a response message to the BMS. The BMS waits for the response message by monitoring the CAN bus. The BMS checks the received response message and verifies whether the communication channel is normal through the verification model. The BMS traverses the communication status of all battery packs, confirms that the CAN communication interface of each battery pack has been successfully activated and the communication channel is normal. When the communication status of all battery packs is normal, the BMS confirms that the CAN communication network is ready through a weighted evaluation algorithm and sends a confirmation message to the host.

8. The multi-step automatic activation and communication method of a battery management system according to claim 7, characterized in that: The checking of the received response message includes checking the content, format and sequence number of the response message; The verification model comprises the following steps: Through the accumulation and check algorithm, the value of each byte in the sent test message is accumulated to obtain the checksum value. When the BMS sends the test message to the battery pack, it also sends the calculated checksum. After the battery pack receives the test message, it calculates the checksum of the response message in the same checksum calculation method, and includes the checksum of the response message in the response message and sends it back to the BMS; Through the message sequence number algorithm, the BMS assigns a unique sequence number to each test message sent. The BMS sends the test message and the corresponding sequence number to the battery pack. The battery pack includes the received sequence number in the response message. After receiving the response message, the BMS checks whether the sequence number in the response message is consistent with the expected sequence number. If they are consistent, the sequence number verification is successful. When both the checksum verification and the serial number verification pass, it is confirmed that the communication channel is normal. When any one of the verifications fails, it indicates that there is a problem with the communication channel of the marked battery pack.

9. The multi-step automatic activation and communication method of a battery management system according to claim 1, characterized in that: The automatic allocation of a unique battery pack code, after detecting that the allocated code does not conflict with other battery pack codes, activation is successful and the host is notified; comprises the following steps: The starting code is determined by the initial code variable in the BMS software. The BMS automatically assigns a unique code to each connected battery pack in turn. Each battery pack broadcasts its own code information through the CAN bus. At the same time, each battery pack monitors the CAN bus and receives the code information broadcast by other battery packs. The battery pack stores the received code information in an internal data structure. Through the coding conflict detection algorithm, the BMS traverses all battery packs to check whether there is a coding conflict. i , BMS checks whether the coding of other battery packs is consistent with B i The codes of the two digits are the same. If the same codes are found, it is considered that there is a conflict. When a coding conflict is detected, the BMS reallocates a new coding to the conflicting battery pack. The new coding is different from the already allocated coding. The BMS continues to perform coding conflict detection through multiple iterations until the coding of all battery packs is unique.