Communication method for realizing BMS (Battery Management System) protocol by Bluetooth

By using the BMS protocol frame structure and periodic handshake mechanism, the problems of data packet loss and unstable connection in BLE in the battery management system are solved, data integrity verification and system self-healing recovery are realized, and the reliability and security of Bluetooth communication are improved.

CN121334636AActive Publication Date: 2026-01-13湖北达巨科技有限公司

Patent Information

Application Number
CN202511487388.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-01-13
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

BLE suffers from data packet loss, latency, connection interruption, and "false connection" phenomena in battery management systems. Furthermore, it lacks application-layer integrity verification and connection self-recovery mechanisms, which affect the accuracy of battery data acquisition and system reliability.

Method used

The BMS protocol frame structure is used for data transmission. Notify and Write features are used for command issuance and data return. Stability and security of Bluetooth communication are achieved through periodic handshake, timeout retries and CRC checks.

Benefits of technology

It improves the reliability and robustness of Bluetooth communication, ensures data integrity, prevents unauthorized device access, enables system self-healing recovery, and avoids data packet loss and connection interruption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121334636A_ABST
    Figure CN121334636A_ABST
Patent Text Reader

Abstract

The invention discloses a communication method for realizing a BMS protocol through Bluetooth, and the method comprises the following steps: S1, a connection establishment stage: 1) after a local device establishes a Bluetooth connection with a slave device, the local device constructs a request instruction for reading a version number according to a predefined BMS communication protocol; and 2) periodically issuing the request instruction to the slave equipment in a first preset period through the Bluetooth feature with the notification attribute. According to the method, the communication reliability is improved, the problems of instability and data packet loss of a Bluetooth channel are effectively solved through instruction issuing based on timing polling and a multi-level overtime disconnection mechanism, and it is ensured that instructions and data are reachable in a complex wireless environment; and on the basis of a BMS protocol framework, end-to-end CRC16 verification from'equipment address' to'data content 'is introduced in a data analysis link, damaged or tampered data frames in a transmission process can be accurately identified and discarded, and system processing errors or missing data are fundamentally avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of Bluetooth wireless communication technology, in particular to a communication method for implementing BMS protocol by Bluetooth. BACKGROUND

[0002] With the wide application of Bluetooth Low Energy (BLE) technology, it has become an important means of wireless communication between master and slave devices in the battery management system (BMS). BLE has the advantages of low power consumption, strong compatibility, and convenient connection, and is suitable for battery monitoring scenarios that do not require high real-time performance but need long-term stable operation.

[0003] However, BLE uses GATT protocol for data transmission, and the single MTU (maximum transmission unit) is limited. In addition, in the environment of signal interference, too far distance or multiple devices coexistence, data packet loss, delay or connection interruption problems are easy to occur;

[0004] In addition, BLE only judges whether the communication is normal through the link layer connection state, and cannot sense the application layer non-response or data error situation, which is easy to cause the "false connection" phenomenon and affect the system reliability.

[0005] At the same time, the existing BMS communication scheme generally lacks integrity check and connection recovery mechanism based on the application layer, and it is difficult to guarantee the accurate acquisition of key battery data (such as total voltage, current, single cell voltage, etc.), therefore, it is urgent to provide a wireless communication technology which combines the BMS protocol frame structure (including frame header, address, function code, CRC16 check, frame tail, etc.), uses the Notify and Write features of BLE to realize reliable instruction issuing and data returning, and through periodic handshaking, timeout retry, CRC check and automatic reconnection mechanism, improves the stability, integrity and anti-interference ability of Bluetooth communication. SUMMARY

[0006] (I) Invention purpose

[0007] In order to solve the technical problems in the background art, the present application provides a communication method for implementing BMS protocol by Bluetooth, which solves the problems of unstable and unsafe data transmission in the Bluetooth communication process, and has the advantages of providing data transmission integrity check and data instruction splitting and parsing.

[0008] (II) Technical scheme

[0009] The present application provides a communication method for implementing BMS protocol by Bluetooth, which is used for connection establishment and data transmission between local device and slave device, including the following steps:

[0010] S1, connection establishment stage:

[0011] 1) After the local device and the slave device establish a Bluetooth connection, the local device constructs a request command to read the version number according to the predefined BMS communication protocol;

[0012] 2) Using Bluetooth features with notification attributes, the request command is periodically sent to the slave device at a first preset period;

[0013] 3) Receive response data from the slave device using Bluetooth features with write attributes, and parse and verify it according to the BMS communication protocol;

[0014] 4) If the verification is successful and the response data is confirmed to be a correct response to the command to read the version number, then the Bluetooth connection is determined to be successfully established;

[0015] 5) If no valid response is received after sending the first preset number of request commands, the connection is deemed to have timed out and the current Bluetooth connection is disconnected.

[0016] S2, Data Communication Phase:

[0017] 1) After the connection is established, the local device constructs a request command to obtain battery parameters according to the BMS communication protocol, and periodically sends the command to the slave device at a second preset period.

[0018] 2) Receive the battery data returned by the slave device, and parse and verify it according to the BMS communication protocol. After the verification is successful, extract and process the battery parameters.

[0019] S3, Connection Status Monitoring and Recovery Phase:

[0020] 1) During the data communication phase, if the slave device does not return battery data within the third preset time period, the local device will re-execute the version number reading process of the connection establishment phase to evaluate the connection status.

[0021] 2) If no valid response is received from the slave device within the fourth preset time period during the re-execution of the version number reading process, the current Bluetooth connection will be disconnected and an attempt will be made to re-establish the connection.

[0022] Preferably, during the connection establishment phase, the specific process of parsing and verification is as follows:

[0023] 1) Verify the correctness of the frame header, device address, and function code of the response data;

[0024] 2) Determine the length of the data content based on the data byte number segment in the protocol, and extract the data content accordingly;

[0025] 3) Based on all the data from the device address field to the data content field, calculate the CRC16 check value and compare it with the CRC16 field in the response data;

[0026] 4) Provided that the verification values ​​are consistent, determine whether the response data is a response to the command to read the version number based on the function code.

[0027] Preferably, the first preset period is 500 milliseconds and the first preset number of times is 5.

[0028] Preferably, the second preset period is 1 second.

[0029] Preferably, the third preset duration is 10 seconds and the fourth preset duration is 5 seconds.

[0030] Preferably, the data frame structure of the BMS protocol includes, in sequence: frame header, device address, function code, register start address, number of data bytes, data content, CRC16 checksum, and frame tail.

[0031] Preferably, the battery parameter data includes the number of batteries, total voltage, total current, and the voltage of one or more individual cells.

[0032] Compared with the prior art, the above-mentioned technical solution of the present invention has the following beneficial technical effects:

[0033] 1. This Bluetooth implementation uses the BMS protocol communication method to improve communication reliability: By using timed polling-based command issuance and a multi-level timeout disconnection mechanism, it effectively addresses the instability of the Bluetooth channel and data packet loss, ensuring that commands and data are reachable in complex wireless environments; it also guarantees data integrity: Based on the BMS protocol framework, an end-to-end CRC16 checksum from "device address" to "data content" is introduced in the data parsing stage, which can accurately identify and discard data frames that are damaged or tampered with during transmission, fundamentally avoiding system processing errors or missing data.

[0034] 2. This Bluetooth implementation uses the BMS protocol communication method to enhance interaction security: By forcibly performing a "version number-function code" handshake verification during the communication link establishment phase and verifying the device address in all subsequent interactions, a preliminary identity authentication and command filtering barrier is constructed, effectively preventing the access and spoofing of unauthorized devices; It also achieves system self-healing: When a communication interruption or prolonged lack of response is detected, the system can automatically trigger a full-process recovery mechanism from connection verification to reconnection, recovering from brief communication failures without manual intervention, greatly improving the system's robustness and continuous service capabilities. Attached Figure Description

[0035] Fig. 1 This is a flowchart illustrating the process of establishing a Bluetooth connection between the master and slave devices in this invention.

[0036] Fig. 2 This is a flowchart of the master and slave data transmission and response process of the present invention. Detailed Implementation

[0037] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0038] like Figs. 1-2 As shown, the Bluetooth implementation of the BMS protocol communication method proposed in this invention includes the following steps:

[0039] S1, Connection Establishment Phase:

[0040] 1) When the slave device responds to the command and replies with data, the local Bluetooth unit efficiently receives the data using its write attribute. After receiving the data, the local Bluetooth unit performs a deep parsing of the data strictly according to the BMS protocol (the format includes frame header, device address, function code, register start address, number of data bytes, data content, CRC16, and frame tail). This parsing process first verifies whether the frame header, device address, and function code are accurate. Then, it dynamically determines the length of the data content based on the number of data bytes and accurately extracts the data content. Next, it calculates the CRC16 checksum of the command from the device address field to the end of the data content field and strictly compares it with the received CRC16 value. If the two match, it fully proves the integrity and correctness of the data transmission. Subsequently, it intelligently determines whether the data is the expected reply to the read version number command based on the function code. If so, it officially confirms that the Bluetooth connection has been successfully established, laying a solid foundation for subsequent data communication.

[0041] 2) After the local Bluetooth device successfully establishes a Bluetooth connection with the slave device, the local Bluetooth device first carefully constructs a command data packet to read the version number according to the BMS protocol (the format of which includes frame header, device address, function code, register start address, number of data bytes (set to 00), CRC16 check code and frame tail). Then, the local Bluetooth device continuously and stably sends the command to read the version number to the slave device at a fixed frequency of every 500 milliseconds through the Bluetooth feature with notification attribute, ensuring reliable transmission of the command.

[0042] 3) However, if the local device does not receive any response from the slave device within the entire time period (i.e., a total of 2.5 seconds) during which it sends 5 read version number commands at 500-millisecond intervals, the system will decisively determine that the connection has timed out. At this time, the local device will automatically disconnect the Bluetooth connection, causing the Bluetooth data communication with the slave device to be temporarily interrupted, thereby avoiding resource waste and potential errors.

[0043] S2, Data Communication Phase:

[0044] 1) Once the Bluetooth connection is firmly established, the local Bluetooth device will periodically (every 1 second) proactively request battery-related data from the slave device in a highly autonomous manner to achieve real-time monitoring. The local Bluetooth device will then package the instructions for obtaining battery parameters according to the BMS protocol (frame header, device address, function code, register start address, data byte count 00, CRC16, frame tail) and efficiently send them to the slave device via the notify feature. After receiving the instructions, the slave device will also perform detailed parsing according to the BMS protocol: confirming the correctness of the frame header, device address, and function code; calculating the CRC16 value from the device address to the data content and comparing it with the received CRC16 value to ensure data integrity; after the verification is passed, it will quickly execute the corresponding processing according to the function code, accurately fill the collected battery data into the data content field of the BMS protocol, and then calculate the total length of the data, update the data byte number segment in a timely manner, and completely fill the frame header, frame tail, and other fields. Finally, the packaged data will be reliably sent back to the local Bluetooth device.

[0045] 2) After receiving the returned data via Bluetooth, the device performs precise parsing based on the BMS protocol: verifying the frame header, device address, and function code; flexibly extracting the data content based on the number of data bytes; calculating the CRC16 value and performing a rigorous comparison. After confirming that there are no errors, the data content is parsed by the system according to the predefined battery data structure (including key fields such as battery quantity, total voltage, total current, and individual cell voltage), thereby efficiently obtaining various battery parameter data and providing reliable data support for upper-layer applications.

[0046] S3, Connection Status Monitoring and Recovery Phase:

[0047] After a connection is established, if the local Bluetooth device does not receive battery data from the slave device within 10 seconds, it is determined that the Bluetooth communication may have experienced packet loss or external interference. In this case, the local Bluetooth device will immediately restart the connection establishment process, repackage and send a command to read the version number through the BMS protocol to quickly verify the current connection status. If the local Bluetooth device still does not receive a response from the slave device within the following 5 seconds, it is determined that the connection is abnormal, actively disconnects the Bluetooth connection, and actively attempts to re-establish a new Bluetooth connection with the slave device to ensure the continuity and stability of communication.

[0048] In this embodiment, communication reliability is improved by using a timed polling-based command issuance and a multi-level timeout disconnection mechanism to effectively address the instability of the Bluetooth channel and data packet loss, ensuring the reachability of commands and data in complex wireless environments. Data integrity is guaranteed by introducing an end-to-end CRC16 checksum from "device address" to "data content" in the data parsing stage based on the BMS protocol framework. This can accurately identify and discard data frames that are damaged or tampered with during transmission, fundamentally avoiding system processing errors or missing data.

[0049] Enhanced interaction security: By forcibly performing "version number-function code" handshake verification during the communication link establishment phase and verifying the device address in all subsequent interactions, a preliminary identity authentication and command filtering barrier is constructed, effectively preventing the access and spoofing of unauthorized devices; Achieved system self-healing: When communication interruption or prolonged unresponsiveness is detected, the system can automatically trigger a full-process recovery mechanism from connection verification to reconnection, recovering from brief communication failures without manual intervention;

[0050] Therefore, the entire solution significantly improves the reliability and robustness of Bluetooth communication through multi-layered verification and timeout mechanisms.

[0051] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0052] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A Bluetooth communication method implementing the BMS protocol, used for establishing a connection and transmitting data between a local device and a slave device, characterized in that... Includes the following steps: S1, Connection Establishment Phase: 1) After the local device and the slave device establish a Bluetooth connection, the local device constructs a request command to read the version number according to the predefined BMS communication protocol; 2) Using Bluetooth features with notification attributes, the request command is periodically sent to the slave device at a first preset period; 3) Receive response data from the slave device using Bluetooth features with write attributes, and parse and verify it according to the BMS communication protocol; 4) If the verification is successful and the response data is confirmed to be a correct response to the command to read the version number, then the Bluetooth connection is determined to be successfully established; 5) If no valid response is received after sending the first preset number of request commands, the connection is deemed to have timed out and the current Bluetooth connection is disconnected. S2, Data Communication Phase: 1) After the connection is established, the local device constructs a request command to obtain battery parameters according to the BMS communication protocol, and periodically sends the command to the slave device at a second preset period. 2) Receive the battery data returned by the slave device, and parse and verify it according to the BMS communication protocol. After successful verification, extract and process the battery parameters. S3, Connection Status Monitoring and Recovery Phase: 1) During the data communication phase, if the slave device does not return battery data within the third preset time period, the local device will re-execute the version number reading process of the connection establishment phase to evaluate the connection status. 2) If no valid response is received from the slave device within the fourth preset time period during the re-execution of the version number reading process, the current Bluetooth connection will be disconnected and an attempt will be made to re-establish the connection.

2. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, During the connection establishment phase, the specific process of parsing and verification is as follows: 1) Verify the correctness of the frame header, device address, and function code of the response data; 2) Determine the length of the data content based on the data byte number segment in the protocol, and extract the data content accordingly; 3) Based on all the data from the device address field to the data content field, calculate the CRC16 check value and compare it with the CRC16 field in the response data; 4) Provided that the verification values ​​are consistent, determine whether the response data is a response to the command to read the version number based on the function code.

3. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, The first preset period is 500 milliseconds, and the first preset number of times is 5.

4. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, The second preset period is 1 second.

5. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, The third preset duration is 10 seconds, and the fourth preset duration is 5 seconds.

6. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, The data frame structure of the BMS protocol includes, in sequence: frame header, device address, function code, register start address, number of data bytes, data content, CRC16 checksum, and frame trailer.

7. The Bluetooth-based BMS protocol communication method according to claim 1, characterized in that, The battery parameter data includes the number of batteries, total voltage, total current, and the voltage of one or more individual cells.

Citation Information

Patent Citations

  • BMS battery management system with bluetooth modules and control method for battery management system and electric vehicle

    CN105280967A

  • Upgrading method and device of battery protection board, detector, system and storage medium

    CN115098137A

  • Bluetooth communication method and system

    CN115150753A

  • Method for reading BMS (Battery Management System) information in battery management system and related equipment

    CN119647432A

  • Bluetooth connection method and device

    WO2019114303A1

Cited By

  • React Native-based cross-platform Bluetooth communication unified implementation method and system

    CN121568079A

  • A react native-based cross-platform bluetooth communication unified implementation method and system

    CN121568079B