Anti-misconnection method based on Bluetooth retrieval pairing and Bluetooth BMS communication

By employing dual verification of Bluetooth devices and the request-response model of the BMS protocol, the problems of false and spurious connections in Bluetooth connections are resolved, enabling accurate connection and stable communication in complex environments and ensuring the security and data integrity of the BMS system.

CN121486785APending Publication Date: 2026-02-06湖北达巨科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511512643.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-22
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing Bluetooth connectivity solutions are prone to false connections and misconnections in complex electromagnetic environments, resulting in unstable communication and poor data security. This is especially true in battery management systems (BMS), where they struggle to meet the requirements for communication security and accuracy.

Method used

By parsing the broadcast data of the slave device for dual verification (pairing code and device name), the service UUID and attribute characteristics are verified. Combined with the request-response model and dynamic timeout determination mechanism of the BMS protocol, the accuracy and stability of the connection are ensured.

Benefits of technology

Accurately identifying target devices in complex electromagnetic environments avoids false connections, ensures the activity of communication links and the integrity of data transmission, and improves the security and continuity of Bluetooth BMS systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121486785A_ABST
    Figure CN121486785A_ABST
Patent Text Reader

Abstract

The invention discloses an anti-misconnection method based on Bluetooth retrieval pairing and Bluetooth BMS communication, and the method comprises the following steps: S1, a device pre-screening step: in a Bluetooth scanning stage, analyzing broadcast data of slave devices, carrying out pairing code verification and device name verification in sequence, and only when the same slave device passes the two verification items at the same time, carrying out the pairing code verification and the device name verification; determining the connection equipment as target connection equipment; s2, a service verification step: 1) after establishing a physical Bluetooth connection with a target connection device, verifying whether the target connection device provides a predetermined service UUID and whether the target connection device has predetermined notify attribute features and write attribute features under the service; according to the method, in the equipment discovery and connection stage, through strict matching of broadcast data dual verification and service characteristics, accurate discrimination and connection to unique target equipment in a complex electromagnetic environment can be realized, and wrong connection and illegal access are effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of Bluetooth wireless connection technology, and in particular to a method for preventing accidental connection based on Bluetooth search and pairing and Bluetooth BMS communication. Background Technology

[0002] With the widespread application of Bluetooth Low Energy (BLE) in smart devices, the problem of Bluetooth misconnection in multi-device coexistence environments has become increasingly prominent. Especially in scenarios with high requirements for communication security and accuracy, such as battery management systems (BMS), the traditional single screening mechanism based on device name or service UUID is no longer sufficient. BLE devices announce their existence to the surrounding environment by broadcasting advertising packets, which can carry information such as device name, service list and manufacturer-defined data. The central device discovers the device by scanning the broadcast content and initiates a connection according to the GAP (Generic Access Profile) process.

[0003] Existing Bluetooth pairing solutions typically rely solely on device name matching or service UUID identification for device screening, lacking a multi-layered authentication mechanism. In complex electromagnetic environments, issues such as name spoofing, service forgery, or inability to communicate after connection can easily occur, leading to the host mistakenly connecting to non-target devices, affecting system stability and data security. Furthermore, a successful BLE connection only indicates that the link layer path is working properly and does not guarantee application layer protocol compatibility or the legitimacy of the device's identity.

[0004] To improve the reliability of Bluetooth connections, it is essential to construct a multi-level filtering mechanism that combines the broadcast layer, GATT service layer, and application layer. This mechanism enhances the accuracy and robustness of Bluetooth connections and prevents false or misconnections. It is also crucial to ensure the security and continuity of wireless pairing and communication of the Bluetooth BMS system in multi-device and high-interference environments. Therefore, this paper proposes a method to prevent false connections based on Bluetooth search pairing and Bluetooth BMS communication to address these issues. Summary of the Invention

[0005] (a) Purpose of the invention

[0006] To address the technical problems existing in the background art, this invention proposes a method for preventing false connections based on Bluetooth search pairing and Bluetooth BMS communication. This method solves the problem of inaccurate connection to the peer device and invalid data communication caused by false connections in complex Bluetooth network environments. It has the advantages of ensuring the security and continuity of Bluetooth BMS pairing and communication in multi-device and strong interference environments.

[0007] (II) Technical Solution

[0008] This invention provides a method for preventing accidental connection based on Bluetooth search and pairing and Bluetooth BMS communication, comprising the following steps:

[0009] S1. Device pre-screening steps: During the Bluetooth scanning phase, the broadcast data of the slave device is parsed, and the pairing code verification and device name verification are performed in sequence. Only when the same slave device passes both verifications at the same time is it identified as the target connection device.

[0010] S2, Service Verification Steps:

[0011] 1) After establishing a physical Bluetooth connection with the target device, verify whether it provides the pre-defined service UUID and whether the service has the pre-defined notify and write attributes.

[0012] 2) If any verification fails, the connection will be immediately disconnected;

[0013] S3. Connecting to monitoring steps:

[0014] 1) After the service verification is successful, the validity of the connection is determined by periodically issuing data request commands and monitoring the responses;

[0015] 2) If no valid response is received within the preset number of attempts, the connection is deemed to have timed out, and the connection process will be automatically disconnected and restarted.

[0016] Preferably, the specific steps of the pre-screening by the device are as follows:

[0017] 1) Extract the field with data type 0xFF from the broadcast data and obtain the slave pairing code from the predetermined offset position;

[0018] 2) Compare the slave pairing code with the pairing code stored on the local machine. If they match, temporarily store the MAC address of the device.

[0019] 3) Extract the field with the data type "complete device name (0x09)" from the same broadcast data to obtain the slave device name;

[0020] 4) Determine whether the slave device name matches the name filter field stored on the local machine, and verify whether its MAC address is consistent with the temporarily stored MAC address;

[0021] 5) If the name matches and the MAC address is the same, then the device is finally identified as the target connection device.

[0022] Preferably, in the service verification step, the predetermined service UUID is 0xFFE0, the predetermined notify attribute feature UUID is 0xFFE1, and the predetermined write attribute feature UUID is 0xFFE2.

[0023] Preferably, the specific steps for connection monitoring are as follows:

[0024] 1) Send request commands based on the BMS protocol to the slave devices at 1-second intervals;

[0025] 2) Set a timeout counter, which increments by one each time a response is not received after an instruction is issued;

[0026] 3) If the counter value reaches 10, the connection is determined to have timed out and a disconnection operation is performed;

[0027] 4) If a valid response is received during the counting process, the counter will be reset to zero, and the current connection will be maintained.

[0028] Preferably, in the connection monitoring step, the BMS protocol is used for communication. The instruction frame structure of the BMS protocol includes a frame header, device address, function code, register start address, number of data bytes, data content, CRC16 checksum, and frame tail.

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

[0030] 1. This method for preventing false connections based on Bluetooth retrieval and pairing and Bluetooth BMS communication, through dual verification of broadcast data and strict matching of service characteristics during the device discovery and connection phase, can accurately identify and connect to a unique target device in complex electromagnetic environments, effectively avoiding false connections and unauthorized access.

[0031] 2. This method for preventing accidental connection based on Bluetooth search and pairing and Bluetooth BMS communication constructs an ordered request-response communication model based on the BMS protocol, and combines periodic heartbeat commands and dynamic timeout determination mechanisms to maintain the activity and stability of the communication link, ensuring that commands are reachable and responses are predictable.

[0032] 3. This method for preventing accidental connection based on Bluetooth search and pairing and Bluetooth BMS communication, at the data interaction level, relies on the BMS protocol frame structure to perform end-to-end CRC verification from device address to data content, fundamentally ensuring the integrity and reliability of data transmission and preventing the uploading and processing of erroneous or tampered data. Attached Figure Description

[0033] Figure 1 This is a flowchart illustrating the Bluetooth pairing and data communication process of the present invention. Detailed Implementation

[0034] 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.

[0035] like Figure 1 As shown, the method for preventing accidental connection based on Bluetooth retrieval pairing and Bluetooth BMS communication proposed in this invention includes the following steps:

[0036] S1. Equipment Discovery and Pre-screening:

[0037] 1) During the Bluetooth scanning phase, the device performs two-level pre-screening by parsing the broadcast data of the slave device;

[0038] 2) Pairing code verification: The local machine parses the broadcast data, locates the field with data type 0xFF (manufacturer-specific data), extracts the pairing code of the slave device from it, and compares the pairing code with the preset pairing code stored in the local Flash. If they match, the MAC address of the slave device is temporarily stored.

[0039] 3) Device Name Verification: The local machine continues to parse the same broadcast data, locates the field with data type 0x09 (complete device name), and extracts the actual name of the slave device. The name is then matched with the preset name filtering field stored in the local flash memory. If the name matches successfully and its MAC address is consistent with the temporary MAC address verified by the pairing code, the device is finally confirmed as the target connection device, and its MAC address is recorded.

[0040] 4) This dual verification mechanism ensures that during the device discovery phase, only authorized devices that pass both "identity identifier" (pairing code) and "identity statement" (device name) verification can proceed to the subsequent connection process;

[0041] S2, Service and Feature Validation:

[0042] 1) After attempting to establish a physical connection with the target slave device, the local machine will perform service level verification;

[0043] 2) The local machine iterates through the service list of the slave devices to search for a service whose UUID (0xFFE0) exactly matches the default service UUID.

[0044] 3) If the specified service is not found, the connection will be immediately disconnected;

[0045] 4) If the service exists, then further search the service’s feature value list for the two features that must be present: the feature with the notify attribute (UUID: 0xFFE1) and the feature with the write attribute (UUID: 0xFFE2).

[0046] 5) If any of the specified features are missing, the connection will be immediately disconnected and the device retrieval process will be restarted.

[0047] 6) This step ensures that only slave devices that are fully compatible with the established BMS communication specifications can successfully establish a logical connection and enter the data exchange phase;

[0048] S3. Connection maintenance and status monitoring:

[0049] 1) After successfully passing all the aforementioned verifications and establishing a connection, the system enters the connection activity monitoring phase:

[0050] 2) The local machine periodically (e.g., every 1 second) sends data request commands to the slave device according to the BMS communication protocol;

[0051] 3) The system sets a timeout counter. If the local machine does not receive a valid response from the slave device within the expected time after issuing a command, the counter will increment.

[0052] 4) If the cumulative value of the counter reaches the threshold (e.g., 10 times, corresponding to about 10 seconds), it is determined that the communication timeout or connection failure has occurred, and the current connection is actively disconnected and the entire device discovery and connection process is restarted.

[0053] 5) If a valid response is successfully received during the counting period, the counter is immediately reset to zero, the connection is considered active and maintained.

[0054] In this embodiment, by employing dual verification of broadcast data and strict matching of service characteristics during the device discovery and connection phases, the system can accurately identify and connect to a unique target device in complex electromagnetic environments, effectively preventing false connections and unauthorized access. Furthermore, by constructing an ordered request-response communication model based on the BMS protocol, and combining periodic heartbeat commands and a dynamic timeout determination mechanism, the system maintains the activity and stability of the communication link, ensuring that commands are reachable and responses are predictable. Finally, by relying on the BMS protocol frame structure at the data interaction level and performing end-to-end CRC verification from device address to data content, the system fundamentally guarantees the integrity and reliability of data transmission, preventing the uploading and processing of erroneous or tampered data.

[0055] 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.

[0056] 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 method for preventing accidental connection based on Bluetooth search and pairing and Bluetooth BMS communication, characterized in that, Includes the following steps: S1. Device pre-screening steps: During the Bluetooth scanning phase, the broadcast data of the slave device is parsed, and the pairing code verification and device name verification are performed in sequence. Only when the same slave device passes both verifications at the same time is it identified as the target connection device. S2, Service Verification Steps: 1) After establishing a physical Bluetooth connection with the target device, verify whether it provides the pre-defined service UUID and whether the service has the pre-defined notify and write attributes. 2) If any verification fails, the connection will be immediately disconnected; S3. Connecting to monitoring steps: 1) After the service verification is successful, the validity of the connection is determined by periodically issuing data request commands and monitoring the responses; 2) If no valid response is received within the preset number of attempts, the connection is deemed to have timed out, and the connection process will be automatically disconnected and restarted.

2. The method for preventing accidental connection based on Bluetooth retrieval and pairing and Bluetooth BMS communication according to claim 1, characterized in that, The specific steps for the equipment pre-screening are as follows: 1) Extract the field with data type 0xFF from the broadcast data and obtain the slave pairing code from the predetermined offset position; 2) Compare the slave pairing code with the pairing code stored on the local machine. If they match, temporarily store the MAC address of the device. 3) Extract the field with the data type "complete device name (0x09)" from the same broadcast data to obtain the slave device name; 4) Determine whether the slave device name matches the name filter field stored on the local machine, and verify whether its MAC address is consistent with the temporarily stored MAC address; 5) If the name matches and the MAC address is the same, then the device is finally identified as the target connection device.

3. The method for preventing accidental connection based on Bluetooth retrieval and pairing and Bluetooth BMS communication according to claim 1, characterized in that, In the service verification step, the predetermined service UUID is 0xFFE0, the predetermined notify attribute feature UUID is 0xFFE1, and the predetermined write attribute feature UUID is 0xFFE2.

4. The method for preventing accidental connection based on Bluetooth retrieval and pairing and Bluetooth BMS communication according to claim 1, characterized in that, The specific steps for connection monitoring are as follows: 1) Send request commands based on the BMS protocol to the slave devices at 1-second intervals; 2) Set a timeout counter, which increments by one each time a response is not received after an instruction is issued; 3) If the counter value reaches 10, the connection is determined to have timed out and a disconnection operation is performed; 4) If a valid response is received during the counting process, the counter will be reset to zero, and the current connection will be maintained.

5. The method for preventing accidental connection based on Bluetooth retrieval and pairing and Bluetooth BMS communication according to claim 4, characterized in that, In the connection monitoring step, the BMS protocol is used for communication. The instruction frame structure of the BMS protocol includes a frame header, device address, function code, register start address, number of data bytes, data content, CRC16 checksum, and frame tail.