Bluetooth communication method, system and hardware device

CN122602128APending Publication Date: 2026-08-18HANGZHOU ROBAM APPLIANCES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610974705.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-01
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

在2.4GHz频段,蓝牙与Wi-Fi等设备频段重叠,当多个设备同时工作时,信号干扰严重,导致数据传输丢包、延迟等问题频发

Benefits of technology

本发明提供了一种蓝牙通讯方法、系统和硬件设备,方法包括:响应于蓝牙连接请求,向目标蓝牙设备发送身份验证请求;接收目标蓝牙设备返回的设备标识和基于预设的加密密钥加密的随机数;解密并基于解密结果和设备标识生成第一校验值后,将第一校验值发回目标蓝牙设备进行验证;验证通过后建立连接;基于预设的密钥协商算法,与目标设备交换临时密钥以生成会话密钥;持续监测通信信号强度;当通信信号强度低于第一阈值时,指令目标蓝牙设备调整发射功率,若调整后仍低于第一阈值,则双方协商降低数据传输速率;实时监测无线信号环境;当检测到干扰信号时,分析干扰信号的频率范围,并与目标蓝牙设备协商切换至未受干扰的信道;其中,在切换过程中维持已建立的会话密钥加密状态;通过多维身份验证和动态密钥保障通信安全,通过信号自适应调整和主动干扰避让提升通信的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122602128A_ABST
    Figure CN122602128A_ABST
Patent Text Reader

Abstract

The application provides a Bluetooth communication method, system and hardware device, and designs the technical field of smart home. The method comprises the following steps: in response to a connection request, an identity authentication request is sent; a random number and a device identifier encrypted based on an encryption key returned by a target device are received, the random number is decrypted, and a first check value is generated based on the decryption result and the device identifier and sent back for verification; a connection is established after verification; a session key is generated by exchanging a temporary key based on a key agreement algorithm; a signal strength is continuously monitored, and the transmission power is adjusted if the signal strength is lower than a first threshold value; if the signal strength is still lower than the first threshold value, a data transmission rate is reduced; a wireless environment is monitored in real time, and when an interference signal is detected, the frequency range of the interference signal is analyzed, and switching to an undisturbed channel is negotiated, and the session key encryption state is maintained during the switching. The application guarantees the communication security through multi-dimensional identity authentication and dynamic key, and improves the stability of the communication through signal self-adaptive adjustment and active interference avoidance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to a Bluetooth communication method, system, and hardware device. Background Technology

[0002] With the widespread adoption of smart devices, Bluetooth technology, as a short-range wireless communication technology, is increasingly used in Android devices. Connecting to various Bluetooth devices via Android apps enables data transmission, device control, and other functions, bringing convenience to users. However, in practical applications, Bluetooth connectivity faces numerous challenges.

[0003] In terms of security, existing Bluetooth connections are vulnerable to external attacks. Malicious devices may forge Bluetooth signals to trick apps into connecting and steal sensitive data from the device. The Bluetooth protocol contains numerous high- and medium-risk vulnerabilities, allowing attackers to silently build privilege escalation attack chains without the user's knowledge or interaction, enabling command injection and information theft. Some smart devices have weak authentication mechanisms during connection, relying solely on device names or MAC addresses, which are insufficient to effectively identify unauthorized devices. During data transmission, inadequate encryption measures can easily lead to data theft or tampering. For example, the BlueFrag vulnerability allows nearby hackers to mine a user's Bluetooth MAC address based on Wi-Fi MAC addresses, enabling them to transmit malicious programs to the phone via Bluetooth without user interaction.

[0004] In terms of stability, Bluetooth connections are frequently interrupted by interference. In the 2.4GHz band, Bluetooth overlaps with the frequency bands of devices such as Wi-Fi. When multiple devices operate simultaneously, signal interference is severe, leading to frequent data transmission issues such as packet loss and latency. Current technologies offer limited means for apps to monitor and adjust Bluetooth signal strength, making real-time adjustments ineffective. Furthermore, the lack of intelligent channel switching and negotiation mechanisms in the face of interference means that connections are easily interrupted, severely impacting user experience. Summary of the Invention

[0005] The purpose of this invention is to provide a Bluetooth communication method, system, and hardware device that ensures communication security through multidimensional authentication and dynamic keys, and improves communication stability through adaptive signal adjustment and active interference avoidance.

[0006] In a first aspect, the present invention provides a Bluetooth communication method, comprising: In response to a Bluetooth connection request, an authentication request is sent to the target Bluetooth device; the device identifier and a random number encrypted based on a preset encryption key are received from the target Bluetooth device; after decryption and generating a first verification value based on the decryption result and the device identifier, the first verification value is sent back to the target Bluetooth device for verification; and a connection is established after successful verification. Based on a preset key negotiation algorithm, a temporary key is exchanged with the target device to generate a session key; The system continuously monitors the strength of the communication signal. When the strength of the communication signal is lower than the first threshold, the system instructs the target Bluetooth device to adjust its transmission power. If the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate. Real-time monitoring of the wireless signal environment; when interference signals are detected, the frequency range of the interference signals is analyzed, and the target Bluetooth device is negotiated to switch to an interference-free channel; during the switching process, the established session key is kept encrypted.

[0007] In some preferred embodiments of the present invention, decryption and generation of a first verification value based on the decryption result and the device identifier include: The encrypted random number is decrypted using a preset encryption algorithm to obtain the decryption result; The decryption result and device identifier are processed based on a preset verification algorithm to generate the first verification value.

[0008] In some preferred embodiments of the present invention, after sending the first verification value back to the target Bluetooth device for verification, the method further includes: If the target Bluetooth device verifies that the first verification value is different from the second verification value generated by the verification algorithm based on a random number and the device identifier, the connection will be disconnected and a failure log will be recorded. The failure log includes time information, device identifier, and reason for failure.

[0009] In some preferred embodiments of the present invention, exchanging a temporary key with the target device to generate a session key based on a preset key negotiation algorithm includes: A first temporary key is generated based on a preset encryption library, and then encrypted based on the public key of the target Bluetooth device before being sent to the target Bluetooth device. Receive the second temporary key encrypted by the target Bluetooth device using your own public key, and decrypt it using your local private key; A session key is generated based on the first temporary key and the second temporary key using a key negotiation algorithm.

[0010] In some preferred embodiments of the present invention, when the communication signal strength is lower than a first threshold, the target Bluetooth device is instructed to adjust its transmission power. If the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate, including: When the communication signal strength is lower than the first threshold, the target Bluetooth device is instructed to increase the transmission power by a preset ratio or a preset step value. If the adjusted communication signal strength is still lower than the first threshold, the current data transmission rate will be adjusted from the first rate to a second rate that is lower than the first rate.

[0011] In some preferred embodiments of the present invention, the method further includes: If the signal strength detected after reducing the data transmission rate is still below the first threshold, a prompt message is generated to inform the user of the connection status.

[0012] In some preferred embodiments of the present invention, when an interference signal is detected, the frequency range of the interference signal is analyzed, including: Scan the preset frequency band to obtain the signal strength of at least one other wireless signal; Wireless signals whose signal strength exceeds a preset second threshold and whose channel overlaps with the current Bluetooth channel are identified as interference signals. Frequency analysis is performed on the interference signal to determine its frequency range.

[0013] In some preferred embodiments of the present invention, negotiating a switch to an interference-free channel with the target Bluetooth device includes: Among the multiple available channels, the channel located outside the frequency range of the interference signal is selected as the target channel. The system synchronously switches to the target channel with the target Bluetooth device using a predefined negotiation protocol; during the channel switching, a data caching mechanism maintains the continuity of data transmission.

[0014] Secondly, the present invention provides a Bluetooth communication system, comprising: The authentication module is used to respond to a Bluetooth connection request by sending an authentication request to the target Bluetooth device; receiving the device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; decrypting the data and generating a first verification value based on the decryption result and the device identifier, and then sending the first verification value back to the target Bluetooth device for verification; and establishing a connection after successful verification. The key negotiation module is used to exchange temporary keys with the target device to generate session keys based on a preset key negotiation algorithm; The signal monitoring and adjustment module is used to continuously monitor the communication signal strength. When the communication signal strength is lower than the first threshold, the target Bluetooth device is instructed to adjust the transmission power. If the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate. The interference detection and avoidance module is used to monitor the wireless signal environment in real time. When interference signals are detected, the frequency range of the interference signals is analyzed, and the target Bluetooth device is negotiated to switch to an interference-free channel. During the switching process, the established session key is kept encrypted.

[0015] Thirdly, the present invention provides a hardware device including a processor and a memory, the memory storing computer-executable instructions that can be executed by the processor, the processor executing the computer-executable instructions to implement the method provided in the first aspect above.

[0016] This invention brings the following beneficial effects: This invention provides a Bluetooth communication method, system, and hardware device. The method includes: in response to a Bluetooth connection request, sending an authentication request to a target Bluetooth device; receiving a device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; decrypting the data and generating a first verification value based on the decryption result and the device identifier, and sending the first verification value back to the target Bluetooth device for verification; establishing a connection after successful verification; exchanging a temporary key with the target device to generate a session key based on a preset key negotiation algorithm; continuously monitoring the communication signal strength; when the communication signal strength is lower than a first threshold, instructing the target Bluetooth device to adjust its transmission power; if the power is still lower than the first threshold after adjustment, both parties negotiate to reduce the data transmission rate; monitoring the wireless signal environment in real time; when interference signals are detected, analyzing the frequency range of the interference signals and negotiating with the target Bluetooth device to switch to an interference-free channel; wherein, the established session key encryption state is maintained during the switching process; communication security is ensured through multi-dimensional authentication and dynamic keys, and communication stability is improved through signal adaptive adjustment and active interference avoidance. Attached Figure Description

[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 A flowchart of a Bluetooth communication method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of an overall Bluetooth communication method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of a Bluetooth communication system provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of a hardware device provided in an embodiment of the present invention.

[0019] Icons: 310 - Authentication module; 311 - Encryption and decryption unit; 312 - Verification value generation unit; 313 - Verification unit; 320 - Key negotiation module; 330 - Signal monitoring and adjustment module; 331 - Signal strength monitoring unit; 332 - Adjustment command sending unit; 333 - Transmit power and rate adjustment unit; 340 - Interference detection and avoidance module; 341 - Interference signal detection unit; 342 - Frequency analysis unit; 343 - Channel switching negotiation unit; 400 - Memory; 401 - Processor; 402 - Bus; 403 - Communication interface. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0022] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0023] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. In addition, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0024] Furthermore, terms such as "horizontal," "vertical," and "sag" do not imply that components must be absolutely horizontal or suspended, but rather that they can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal relative to "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.

[0025] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0026] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0027] This invention provides a Bluetooth communication method, see [link to relevant documentation]. Figure 1 The flowchart shown in this embodiment of the invention provides a Bluetooth communication method, which includes: Step S102: In response to the Bluetooth connection request, send an authentication request to the target Bluetooth device; receive the device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; decrypt and generate a first verification value based on the decryption result and the device identifier, and send the first verification value back to the target Bluetooth device for verification; establish a connection after successful verification.

[0028] Specifically, on the main screen of the Android app, the user clicks the "Search Bluetooth Devices" button, and the app starts its Bluetooth search function. After finding a list of nearby Bluetooth devices, the user selects the target Bluetooth device to connect to. At this point, the Android app responds to the Bluetooth connection request by sending an authentication request to the target Bluetooth device.

[0029] After receiving the authentication request, the target Bluetooth device generates a random number and encrypts it using a preset encryption key. It then sends the encrypted result along with its device identifier back to the Android app. Taking a smart speaker as an example, the smart speaker's internal microcontroller generates a 16-bit random number, such as "1234567890123456". The smart speaker uses a preset encryption key stored in its internal EEPROM to encrypt the random number using the AES encryption algorithm, obtaining an encrypted result such as "abcdefghijklmnop". The smart speaker then sends the encrypted result along with its device identifier "SmartSpeaker_001" back to the Android app.

[0030] The Android app stores a preset encryption key corresponding to the target Bluetooth device locally. Upon receiving the encryption result and device identifier, the app decrypts the encrypted random number, obtaining the decryption result. After decryption, the app generates a first verification value based on the decryption result and device identifier using a preset verification algorithm. For example, the app uses the same AES encryption algorithm as the smart speaker to decrypt the encryption result, obtaining the random number "1234567890123456". Next, the app uses the SHA-256 algorithm, taking the random number and the device identifier "SmartSpeaker_001" as input, to generate a 256-bit first verification value, such as "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef". The app then sends this first verification value back to the target Bluetooth device for verification.

[0031] After receiving the first verification value, the target Bluetooth device uses the same preset verification algorithm to generate a second verification value based on its previously generated random number and its own device identifier. It then compares the received first verification value with the generated second verification value. If they match, authentication is successful, a connection is established normally, and the process proceeds to the next step. If they do not match, authentication fails, the target Bluetooth device disconnects from the Android app, attempts to reconnect, and records the failure in its local log.

[0032] Through the above identity verification steps, this embodiment of the invention constructs a triple independent verification mechanism of "dynamic random number generation + encrypted transmission + dual-end algorithm verification", which effectively resists attacks from counterfeit devices.

[0033] Step S104: Based on a preset key negotiation algorithm, exchange temporary keys with the target device to generate a session key.

[0034] Specifically, after successful authentication, the Android app and the target Bluetooth device engage in dynamic key negotiation. Both parties exchange temporary keys to generate a session key based on a preset key negotiation algorithm. The Android app calls the system's preset encryption library to generate a 256-bit first temporary key, such as "qwertyuiopasdfghjklzxcvbnm123456". Simultaneously, the target Bluetooth device also generates a 256-bit second temporary key using its internal encryption chip, such as "mnbvcxzlkjhgfdsapoiuytrewq654321". The Android app encrypts the first temporary key using the target Bluetooth device's public key and sends the encrypted result to the target Bluetooth device. The target Bluetooth device decrypts the received encryption result using its private key to obtain the first temporary key. Similarly, the target Bluetooth device encrypts the second temporary key using the Android app's public key and sends it; the Android app decrypts it using its private key to obtain the second temporary key. After obtaining each other's temporary keys, both parties use the preset key negotiation algorithm, taking the first and second temporary keys as input, to generate a session key for subsequent data transmission. As one implementation method, the key negotiation algorithm employs the Diffie-Hellman algorithm, generating a 512-bit session key, for example, "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef". This session key is longer than the temporary key, further enhancing encryption strength. Subsequently, both parties use this session key to encrypt and decrypt data during transmission, ensuring the confidentiality of the communication content.

[0035] As another implementation of the key negotiation algorithm, the Elliptic Curve Diffie-Hellman (ECDH) algorithm can also be used. Both parties generate temporary elliptic curve key pairs and exchange public keys. They then calculate the shared secret using their respective private keys and the other party's public key, and finally derive the session key via a key derivation function. ECDH can use shorter key lengths at the same security level, improving computational efficiency, and is particularly suitable for resource-constrained Bluetooth devices. Regardless of the specific algorithm used, this embodiment implements a dynamic key system of "one key per connection," eliminating the risk of data being eavesdropped on or tampered with during transmission.

[0036] Step S106: Continuously monitor the communication signal strength; when the communication signal strength is lower than the first threshold, instruct the target Bluetooth device to adjust the transmission power. If the power is still lower than the first threshold after adjustment, both parties negotiate to reduce the data transmission rate.

[0037] Specifically, after the Android app establishes a connection with the target Bluetooth device, the app continuously monitors the signal strength between them. The app periodically obtains the Bluetooth Signal Strength Index (RSSI) using the system's Bluetooth API. For example, it might obtain the signal strength value every second, assuming the current value is -60dBm. The Android app has a pre-set first threshold to determine signal stability. For example, this threshold might be set to -70dBm. When the obtained signal strength falls below the first threshold, the app initiates a proactive adjustment strategy. First, the app sends a signal strength adjustment command to the target Bluetooth device, instructing it to adjust its transmission power. For example, it might instruct the target Bluetooth device to increase its transmission power by a preset percentage (e.g., 10%) or a preset step (e.g., 2dBm). The target Bluetooth device executes the power adjustment upon receiving the command. If, after adjusting the transmission power, the signal strength value monitored by the app meets the standard (e.g., reaching -65dBm, higher than -70dBm), the current connection is maintained, and no further action is taken.

[0038] If, after adjusting the transmit power, the detected signal strength still does not reach the first threshold (e.g., the adjusted signal strength is -75dBm), the target Bluetooth device notifies the Android app, and both parties negotiate to reduce the data transmission rate. During the negotiation process, the current data transmission rate is adjusted from the first rate to a second rate lower than the first rate. For example, the data transmission rate is reduced from the current 2Mbps to 1Mbps. After reducing the rate, the signal's anti-interference capability and transmission reliability are improved, thereby indirectly improving the effective connection status. If the detected signal strength is still lower than the first threshold after reducing the data transmission rate, for example, the signal strength is still only -74dBm after reducing the rate, a prompt message is generated to inform the user of the weak connection signal, suggesting shortening the distance or removing obstacles. Furthermore, other preset adjustment strategies can be tried, such as changing the data packet length or adjusting the retransmission mechanism parameters, to maintain connection stability as much as possible.

[0039] To adapt to different device types, the first threshold can be set differently based on the type of the target Bluetooth device. For example, for wearable devices, which are used closer to the body and are more sensitive to power consumption, the first threshold can be set to -80dBm; for fixed devices such as Bluetooth speakers, it can be set to -65dBm; and for in-vehicle devices, it can be set to -75dBm. This dynamic adaptation mechanism further enhances the versatility and real-time performance of the method. This embodiment constructs a step-by-step optimization closed loop of "monitoring - power adjustment - rate adjustment - prompting / other strategies," completely transforming connection stability from passively relying on environmental signals to actively adapting to the environment, thus solving the pain point of frequent disconnections caused by signal fluctuations.

[0040] Step S108: Monitor the wireless signal environment in real time; when interference signals are detected, analyze the frequency range of the interference signals and negotiate with the target Bluetooth device to switch to an interference-free channel; wherein, the established session key encryption state is maintained during the switching process.

[0041] Specifically, in addition to active signal strength management, this embodiment also performs real-time monitoring of the wireless signal environment in parallel. The Android app scans the surrounding wireless signal environment in real time to detect the presence of strong interference signals. When an interference signal is detected, the Android app further analyzes the frequency range of the interference signal. As one implementation method, the interference signal detection process is as follows: scan a preset frequency band (such as the 2.4GHz ISM band) to obtain the signal strength of at least one other wireless signal; identify wireless signals whose signal strength exceeds a preset second threshold and whose channel overlaps with the current Bluetooth channel as interference signals. For example, in an office environment, if the app detects a strong Wi-Fi signal in the 2.4GHz band with a signal strength of -40dBm, exceeding the second threshold of -45dBm, and the channel used by this Wi-Fi signal (2412MHz-2437MHz) partially overlaps with the current Bluetooth connection channel, then the Wi-Fi signal is identified as an interference signal. Then, the app performs frequency analysis on the interference signal to determine its interference frequency range as 2412MHz-2437MHz. As another approach to identifying interference signals, it is also possible to determine the presence of interference signals by calculating the signal-to-noise ratio (SNR) or packet error rate (PER) of the received signal, rather than relying on a second threshold. When the SNR is below a preset threshold or the packet error rate consistently exceeds a certain threshold, interference signals are considered to be present, thus triggering an avoidance process. This multi-dimensional judgment method can more accurately identify different types of interference sources.

[0042] After determining the interference frequency range, the Android app and the target Bluetooth device negotiate to switch to an interference-free channel. The Bluetooth 2.4GHz band has 79 channels, each with a bandwidth of 1MHz. Through a predefined negotiation protocol, the Android app and the target Bluetooth device select a channel outside the frequency range of the interference signal from among several preset available channels as the target channel. For example, selecting the channel corresponding to the 2462MHz frequency is completely outside the 2412-2437MHz interference frequency range. Subsequently, both parties synchronously switch to the target channel. During channel switching, a data caching mechanism is used to ensure uninterrupted data transmission: the sending end temporarily caches the data packets to be sent, and retransmits the cached data packets after the channel switch is complete; the receiving end also manages the cache accordingly. Simultaneously, the entire switching process maintains the encrypted state of the established session key, eliminating the need to renegotiate the key, thus avoiding security vulnerabilities or communication interruptions caused by channel switching. Through the above interference detection and avoidance steps, this embodiment realizes a closed-loop anti-interference process of "interference signal detection → frequency analysis → channel negotiation and switching → continuous monitoring", which is executed in parallel with signal strength monitoring, so that Bluetooth connection can maintain extremely high stability in complex scenarios with dense deployment of multiple devices.

[0043] Furthermore, in some preferred embodiments of the present invention, decryption and generation of a first verification value based on the decryption result and the device identifier includes: decrypting the encrypted random number using a preset encryption algorithm to obtain a decryption result; and processing the decryption result and the device identifier based on a preset verification algorithm to generate a first verification value.

[0044] For details, see Figure 2The illustrated embodiment of the present invention provides a schematic flowchart of an overall Bluetooth communication method. The preset encryption algorithm and preset verification algorithm can have various implementations. In one implementation, the preset encryption algorithm uses the AES symmetric encryption algorithm, and decryption uses the same key as encryption. The preset verification algorithm uses the SHA-256 secure hash algorithm, concatenating the decrypted random number with the device identifier or combining it according to preset rules as input to generate a 256-bit first verification value. In another implementation, the preset verification algorithm can also use the HMAC-SHA256 algorithm, using the decryption result as the message and the device identifier as the key to perform a hash operation message authentication code calculation, further enhancing the security of the verification value. In yet another implementation, the preset verification algorithm can also use the SM3 cryptographic hash algorithm, meeting the compliance requirements of specific scenarios. The specific algorithm selected can be determined based on actual security needs and device capabilities. This embodiment processes the decryption result and device identifier using preset encryption and verification algorithms to generate a first verification value, ensuring the security, reliability, and unforgeability of the verification value generation process, thereby supporting high-strength protection in the identity verification process.

[0045] Furthermore, in some preferred embodiments of the present invention, after sending the first verification value back to the target Bluetooth device for verification, the method further includes: if the target Bluetooth device verifies that the first verification value is different from the second verification value generated by the verification algorithm based on the random number and the device identifier, then disconnecting the connection attempt and recording a failure log; wherein, the failure log includes time information, device identifier and failure reason.

[0046] For details, please refer to [link / reference]. Figure 2When generating the second verification value, the target Bluetooth device uses the same preset verification algorithm as the Android app, calculating it with its own generated random number and its own device identifier as input. The target Bluetooth device compares the calculated second verification value bit by bit with the received first verification value. If the two verification values ​​are exactly the same, it means that the Android app does indeed possess a legitimate preset encryption key, and the device identity is genuine and trustworthy; if the two verification values ​​differ in any way, it indicates that the other party may not possess the correct key, posing a risk of device forgery. The target Bluetooth device immediately disconnects the connection attempt and records the failure information in its local log. The failure log includes time information (e.g., "2025-05-09 10:30:15"), device identifier (e.g., "SmartSpeaker_001"), and reason for failure (e.g., "verification value mismatch"). As another implementation of recording the failure log, the log content can further include the first verification value received in this connection attempt, the self-generated second verification value, the verification algorithm identifier used, etc., to facilitate subsequent security auditing and attack tracing. This embodiment disconnects the connection and records a failure log containing the time, device identifier, and reason for failure when authentication fails. This provides detailed audit information while blocking unauthorized connections, making it easier for the system to detect and respond to potential attacks in a timely manner, and significantly improving the traceability of security incidents.

[0047] Furthermore, in some preferred embodiments of the present invention, exchanging temporary keys with the target device to generate a session key based on a preset key negotiation algorithm includes: generating a first temporary key based on a preset encryption library, encrypting the first temporary key based on the public key of the target Bluetooth device, and sending it to the target Bluetooth device; receiving a second temporary key encrypted by the target Bluetooth device using its own public key, and decrypting it using its local private key; and generating a session key based on the first temporary key and the second temporary key through a key negotiation algorithm.

[0048] For details, please refer to [link / reference]. Figure 2The first temporary key is generated by the Android app using a system-preset encryption library (such as the Android Keystore system or a third-party security library), while the second temporary key is generated by the target Bluetooth device using its internal encryption chip. Both generated temporary keys are either truly random numbers or cryptographically secure pseudo-random numbers. When exchanging temporary keys, as one implementation of encryption, the RSA algorithm from asymmetric encryption is used: the Android app encrypts the first temporary key using the RSA public key pre-distributed by the target Bluetooth device, and the target Bluetooth device decrypts it using its own RSA private key; the target Bluetooth device encrypts the second temporary key using the Android app's RSA public key, and the Android app decrypts it using its own RSA private key. Alternatively, Elliptic Curve Integration (ECIES) encryption can be used for encrypted transmission of the temporary keys, which is more efficient when the Bluetooth device's computing power is limited. After both parties obtain each other's temporary keys, they generate the final session key based on a preset key negotiation algorithm. As one implementation, the key negotiation algorithm employs the Diffie-Hellman (DH) algorithm. Using a first and second temporary key as input parameters, a shared secret is generated through modular exponentiation. A fixed-length session key, such as 512 bits, is then generated using a key derivation function (KDF). Alternatively, the key negotiation algorithm can use the Elliptic Curve Diffie-Hellman (ECDH) algorithm. Both parties generate temporary elliptic curve key pairs and exchange public keys. The shared secret is calculated using their respective private keys and the other party's public key, and the session key is derived via KDF. ECDH offers the advantages of shorter keys and faster computation at the same security strength, making it particularly suitable for resource-constrained Bluetooth peripherals. Regardless of whether DH or ECDH is used, the generated session key is longer than the temporary key, effectively improving encryption strength. Furthermore, a different session key is generated for each connection, truly achieving one-time key encryption. This embodiment securely exchanges temporary keys using asymmetric encryption and generates a session key based on the temporary keys through a key negotiation algorithm. This ensures the confidentiality of the temporary key transmission process, and the generation of a different session key for each connection avoids the risk of leakage caused by long-term use of a fixed key, guaranteeing the confidentiality and integrity of communication data from the source.

[0049] Furthermore, in some preferred embodiments of the present invention, when the communication signal strength is lower than a first threshold, the target Bluetooth device is instructed to adjust its transmission power. If the adjusted power is still lower than the first threshold, the two parties negotiate to reduce the data transmission rate, including: when the communication signal strength is lower than the first threshold, instructing the target Bluetooth device to increase the transmission power by a preset ratio or a preset step value; if the adjusted communication signal strength is still lower than the first threshold, adjusting the current data transmission rate from a first rate to a second rate lower than the first rate.

[0050] For details, please refer to [link / reference]. Figure 2 There are several ways to adjust the transmission power. One approach is to instruct the target Bluetooth device to increase its transmission power by a preset percentage; for example, if the current transmission power is 0dBm, increasing it by 10% will result in approximately 0.4dBm (increasing it linearly). Another approach is to instruct the target Bluetooth device to increase its transmission power by a preset step value, for example, increasing it by 2dBm each time, from 0dBm to 2dBm. In the Bluetooth specification, transmission power is typically adjusted in dBm increments, and the preset step value can be set to 1dBm, 2dBm, or 4dBm, depending on the device's hardware capabilities. If the signal strength remains below a first threshold after the power increase, the rate negotiation phase begins. There are several ways to reduce the data transmission rate: One approach is to reduce the physical layer data transmission rate from 2 Mbps to 1 Mbps. This reduction improves receiver sensitivity and signal-to-noise ratio. Another approach is to use Bluetooth Low Energy (LE) coding physical layer to reduce the rate from 1 Mbps to 500 kbps or 125 kbps, achieving a longer effective communication distance and stronger anti-interference capability through forward error correction coding gain. The specific value for adjusting from the first rate to the second rate can be dynamically selected based on the actual link quality, ensuring connection stability is prioritized while meeting basic data transmission requirements. This embodiment uses a preset ratio or step value to increase the transmit power and degrades the rate when power adjustment is ineffective, forming a hardware and software collaborative step-by-step optimization strategy. This strategy can flexibly adapt to different signal attenuation environments, maximizing connection stability and reliability.

[0051] Furthermore, in some preferred embodiments of the present invention, the method further includes: if the signal strength detected after reducing the data transmission rate is still lower than a first threshold, generating a prompt message to inform the user of the connection status.

[0052] For details, please refer to [link / reference]. Figure 2When both power adjustment and speed adjustment measures fail to restore the signal strength above the first threshold, it indicates that the current environment may have severe signal obstruction, exceed the effective communication distance, or experience strong interference. In such cases, the device's self-adaptive adjustments alone are insufficient to maintain ideal connection quality. At this point, the system generates a prompt message to inform the user, allowing them to take proactive measures. One implementation method is a visual prompt, such as a banner notification or pop-up reminder displayed on the app interface stating "The current Bluetooth signal is weak; it is recommended to move the device closer." Another implementation method is a vibration feedback or sound prompt, suitable for scenarios where the user cannot easily view the screen. In addition to generating prompt messages, other preset adjustment strategies can be tried, such as changing the data packet length (shortening the data packet to reduce the probability of interference during a single transmission) or adjusting retransmission mechanism parameters (increasing the number of retransmissions or shortening the retransmission timeout), to maintain connection stability to the greatest extent possible. Simultaneously, relevant abnormal events can be logged for subsequent connection quality analysis. This embodiment generates a prompt message when the hardware and software collaborative adjustment still fails to meet the requirements, enabling users to promptly perceive connection abnormalities and proactively intervene. This compensates for the limitations of automatic adjustment strategies in extreme environments and further enhances user experience and connection assurance capabilities.

[0053] Furthermore, in some preferred embodiments of the present invention, when an interference signal is detected, analyzing the frequency range of the interference signal includes: scanning a preset frequency band to obtain the signal strength of at least one other wireless signal; identifying wireless signals whose signal strength exceeds a preset second threshold and whose channels overlap with the current Bluetooth channel as interference signals; and performing frequency analysis on the interference signal to determine the frequency range of the interference signal.

[0054] For details, please refer to [link / reference]. Figure 2The preset frequency band is typically the 2.4GHz ISM band (2400MHz-2483.5MHz), a band shared by wireless technologies such as Bluetooth and Wi-Fi. During scanning, the Android app obtains information about surrounding wireless signals through the system's wireless scanning interface (such as Wi-Fi scan results and Bluetooth scan results). There are several ways to set the signal strength judgment threshold, i.e., the second threshold: One approach is to set the second threshold as an empirical value, such as -45dBm; signals exceeding this value are considered strong enough to substantially interfere with Bluetooth communication. Another approach is to not set a fixed value for the second threshold, but rather determine it dynamically. For example, the current Bluetooth communication signal strength plus a preset bias (such as 15dB) can be used as a dynamic threshold; when other wireless signal strengths exceed this dynamic threshold, they are identified as potential interference sources. When determining channel overlap, Bluetooth uses adaptive frequency hopping technology, switching between 79 channels (each with a 1MHz bandwidth); Wi-Fi has multiple 20MHz or 40MHz bandwidth channels in the 2.4GHz band. If the center frequency and bandwidth of a Wi-Fi signal cover the frequency range of the channel currently used by Bluetooth, it is determined to be a channel overlap, and the Wi-Fi signal is considered interference. After identifying the interference signal, frequency analysis is used to determine its specific frequency range, providing a basis for subsequent channel selection. This embodiment identifies interference signals by combining signal strength thresholds and channel overlap conditions, and performs frequency range analysis on the interference signals. This allows for accurate and reliable location of the interference source and its occupied spectrum, providing an accurate decision-making basis for subsequent channel switching and avoiding blind switching and misjudgment.

[0055] Furthermore, in some preferred embodiments of the present invention, negotiating a switch to an interference-free channel with the target Bluetooth device includes: selecting a channel located outside the frequency range of the interference signal from a plurality of preset available channels as the target channel; and synchronously switching to the target channel with the target Bluetooth device through a predefined negotiation protocol; wherein, during the channel switching, the continuity of data transmission is maintained through a data caching mechanism.

[0056] For details, please refer to [link / reference]. Figure 2The available channel set consists of 79 channels in the Bluetooth 2.4GHz band (numbered 0 to 78, corresponding to frequencies from 2402MHz to 2480MHz, with each channel spaced 1MHz apart). When selecting a target channel, all channels falling within the frequency range of interference signals are excluded, and the remaining channels are selected according to a preset strategy. The preset strategy has several implementations: one implementation involves pre-scanning to obtain the background noise or interference level of each available channel and selecting the channel with the lowest noise; another implementation uses a pseudo-random frequency hopping sequence to select the target channel, increasing the unpredictability of anti-interference and avoiding continuous conflict with periodic interference signals. The predefined negotiation protocol can adopt the channel switching mechanism in the Bluetooth specification, for example, initiating a channel switching request via an LMP_channel_selection_req PDU, with both parties confirming and switching synchronously. During channel switching, the data caching mechanism has several implementations: one implementation involves the sending end temporarily storing the data packets to be sent in a transmission buffer, and retransmitting the cached data packets sequentially after receiving confirmation of channel switching completion; the receiving end also caches received but unacknowledged data packets, processing them in order after the switch is completed. As another implementation, the Bluetooth link layer's retransmission mechanism can be utilized to automatically request retransmission of lost data packets after a brief interruption during switching, without the upper-layer application needing to be aware of the channel switching process. This data caching mechanism ensures the continuity of data transmission during channel switching, and users will not perceive any service interruption. This embodiment, by selectively and synchronously switching between available, interference-free channels while maintaining transmission continuity during switching using a data caching mechanism, achieves seamless communication while avoiding interference, ensuring that the service experience of upper-layer applications is unaffected, and significantly enhancing anti-interference capabilities in complex electromagnetic environments.

[0057] The Bluetooth communication method provided in this embodiment achieves strong dual-end authentication based on dynamic random numbers and device identifiers by sending an authentication request and receiving a random number and device identifier encrypted with a preset encryption key, and then decrypting and generating a verification value for verification. This completely intercepts connection requests initiated by malicious devices through simple forgery of device names or MAC addresses, solving the problem of device spoofing caused by authentication vulnerabilities in existing technologies. By exchanging temporary keys based on a preset key negotiation algorithm to generate session keys, a dynamic encryption mechanism of one key per connection is implemented, avoiding the risk of leakage due to long-term use of fixed keys, ensuring the confidentiality and integrity of data transmission, and solving the problem of data transmission being easily eavesdropped on or tampered with. By continuously monitoring the communication signal strength and comparing it with a first threshold, the target device is first instructed to adjust its power; if adjustment is ineffective, the rate is negotiated to reduce the speed. This constructs a step-by-step optimization closed loop of "monitoring-power adjustment-rate adjustment," upgrading connection stability from passively relying on environmental signals to actively adapting to the environment, solving the problem of frequent connection interruptions caused by signal fluctuations. By monitoring the wireless signal environment in real time, analyzing the frequency range of interference signals and negotiating channel switching after detection, a leap from passively enduring interference to actively detecting and avoiding interference has been achieved. This solves the problem of severe interference from Wi-Fi and other signals in multi-device coexistence scenarios for Bluetooth connections. At the same time, the session key is kept encrypted during the switching process to ensure the security of the anti-interference process.

[0058] This invention provides a Bluetooth communication method, comprising: in response to a Bluetooth connection request, sending an authentication request to a target Bluetooth device; receiving a device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; decrypting the data and generating a first verification value based on the decryption result and the device identifier, and sending the first verification value back to the target Bluetooth device for verification; establishing a connection after successful verification; exchanging a temporary key with the target device to generate a session key based on a preset key negotiation algorithm; continuously monitoring the communication signal strength; when the communication signal strength is lower than a first threshold, instructing the target Bluetooth device to adjust its transmission power; if the power is still lower than the first threshold after adjustment, both parties negotiate to reduce the data transmission rate; monitoring the wireless signal environment in real time; when interference signals are detected, analyzing the frequency range of the interference signals and negotiating with the target Bluetooth device to switch to an interference-free channel; wherein, the established session key encryption state is maintained during the switching process; communication security is ensured through multi-dimensional authentication and dynamic keys, and communication stability is improved through signal adaptive adjustment and active interference avoidance.

[0059] Based on the above embodiments, this invention provides a Bluetooth communication system, see [link to relevant documentation]. Figure 3The schematic diagram shown in this embodiment of the invention provides a Bluetooth communication system, which includes: an authentication module 310, comprising an encryption and decryption unit 311, a verification value generation unit 312, and an authentication unit 313; a key negotiation module 320; a signal monitoring and adjustment module 330, comprising a signal strength monitoring unit 331, an adjustment command sending unit 332, and a transmission power and rate adjustment unit 333; and an interference detection and avoidance module 340, comprising an interference signal detection unit 341, a frequency analysis unit 342, and a channel switching negotiation unit 343.

[0060] The authentication module 310 is used to respond to a Bluetooth connection request by sending an authentication request to the target Bluetooth device; receiving the device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; decrypting and generating a first verification value based on the decryption result and the device identifier, and then sending the first verification value back to the target Bluetooth device for verification; and establishing a connection after successful verification.

[0061] The key negotiation module 320 is used to exchange temporary keys with the target device to generate a session key based on a preset key negotiation algorithm.

[0062] The signal monitoring and adjustment module 330 is used to continuously monitor the communication signal strength. When the communication signal strength is lower than the first threshold, it instructs the target Bluetooth device to adjust the transmission power. If the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate.

[0063] The interference detection and avoidance module 340 is used to monitor the wireless signal environment in real time. When interference signals are detected, the frequency range of the interference signals is analyzed, and the target Bluetooth device is negotiated to switch to an interference-free channel. During the switching process, the established session key is kept encrypted.

[0064] Furthermore, in some preferred embodiments of the present invention, the authentication module 310 is used to decrypt the encrypted random number using a preset encryption algorithm to obtain a decryption result; and to process the decryption result and the device identifier based on a preset verification algorithm to generate a first verification value.

[0065] Furthermore, in some preferred embodiments of the present invention, the system further includes a verification and discipline module, used to disconnect the connection and record a failure log if the first verification value of the target Bluetooth device is different from the second verification value generated by the verification algorithm based on a random number and a device identifier; wherein the failure log includes time information, device identifier and failure reason.

[0066] Furthermore, in some preferred embodiments of the present invention, the key negotiation module 320 is used to generate a first temporary key based on a preset encryption library, encrypt the first temporary key based on the public key of the target Bluetooth device, and send it to the target Bluetooth device; receive a second temporary key encrypted by the target Bluetooth device using its own public key, and decrypt it using its local private key; and generate a session key based on the first temporary key and the second temporary key through a key negotiation algorithm.

[0067] Furthermore, in some preferred embodiments of the present invention, the signal monitoring and adjustment module 330 is used to instruct the target Bluetooth device to increase the transmission power by a preset ratio or a preset step value when the communication signal strength is lower than a first threshold; if the adjusted communication signal strength is still lower than the first threshold, the current data transmission rate is adjusted from the first rate to a second rate lower than the first rate.

[0068] Furthermore, in some preferred embodiments of the present invention, the signal monitoring and adjustment module 330 is used to generate a prompt message to inform the user of the connection status if the signal strength detected after reducing the data transmission rate is still lower than a first threshold.

[0069] Furthermore, in some preferred embodiments of the present invention, the interference detection and avoidance module 340 is used to scan a preset frequency band to obtain the signal strength of at least one other wireless signal; to determine wireless signals whose signal strength exceeds a preset second threshold and whose channels overlap with the current Bluetooth channel as interference signals; and to perform frequency analysis on the interference signals to determine the frequency range of the interference signals.

[0070] Furthermore, in some preferred embodiments of the present invention, the interference detection and avoidance module 340 is used to select a channel located outside the frequency range of the interference signal from a plurality of preset available channels as the target channel; and to switch synchronously with the target Bluetooth device to the target channel through a predefined negotiation protocol; wherein, during the channel switching, the continuity of data transmission is maintained through a data caching mechanism.

[0071] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the Bluetooth communication system described above can be referred to the corresponding process in the aforementioned embodiments of the Bluetooth communication method, and will not be repeated here.

[0072] This invention also provides a hardware device for running a Bluetooth communication method; see [link to related documentation]. Figure 4 The schematic diagram shown in this embodiment of the invention provides a hardware device, which includes a memory 400 and a processor 401. The memory 400 is used to store one or more computer instructions, which are executed by the processor 401 to implement the Bluetooth communication method described above.

[0073] Furthermore, Figure 4 The hardware device shown also includes a bus 402 and a communication interface 403. The processor 401, the communication interface 403, and the memory 400 are connected via the bus 402.

[0074] The memory 400 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 403 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 402 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0075] Processor 401 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 401 or by instructions in software form. Processor 401 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 400, and processor 401 reads information from memory 400 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0076] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are called and executed by a processor, they cause the processor to implement the Bluetooth communication method described above. For specific implementation details, please refer to the method embodiments, which will not be repeated here.

[0077] The computer program products of the Bluetooth communication method, system and hardware device provided in the embodiments of the present invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.

[0078] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0079] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

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

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A Bluetooth communication method, characterized in that, include: In response to a Bluetooth connection request, an authentication request is sent to the target Bluetooth device; Receive the device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; After decryption and generating a first verification value based on the decryption result and the device identifier, the first verification value is sent back to the target Bluetooth device for verification; A connection will be established after successful verification. Based on a preset key negotiation algorithm, a temporary key is exchanged with the target device to generate a session key; The communication signal strength is continuously monitored; when the communication signal strength is lower than a first threshold, the target Bluetooth device is instructed to adjust its transmission power. If the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate. The system monitors the wireless signal environment in real time; when interference signals are detected, it analyzes the frequency range of the interference signals and negotiates with the target Bluetooth device to switch to an interference-free channel; during the switching process, the established session key is kept encrypted.

2. The method according to claim 1, characterized in that, Decryption and generation of a first verification value based on the decryption result and the device identifier include: The encrypted random number is decrypted using a preset encryption algorithm to obtain the decryption result; The decryption result and the device identifier are processed based on a preset verification algorithm to generate the first verification value.

3. The method according to claim 2, characterized in that, After sending the first verification value back to the target Bluetooth device for verification, the method further includes: If the target Bluetooth device verifies that the first verification value is different from the second verification value generated by the verification algorithm based on the random number and the device identifier, it attempts to disconnect and records a failure log; wherein the failure log includes time information, the device identifier and the reason for failure.

4. The method according to claim 1, characterized in that, Based on a preset key negotiation algorithm, exchanging temporary keys with the target device to generate session keys includes: A first temporary key is generated based on a preset encryption library, and the first temporary key is encrypted based on the public key of the target Bluetooth device before being sent to the target Bluetooth device; Receive the second temporary key encrypted by the target Bluetooth device using its own public key, and decrypt it using its local private key; The session key is generated based on the first temporary key and the second temporary key using the key negotiation algorithm.

5. The method according to claim 1, characterized in that, When the communication signal strength is lower than a first threshold, the target Bluetooth device is instructed to adjust its transmission power. If the power is still lower than the first threshold after adjustment, both parties negotiate to reduce the data transmission rate, including: When the strength of the communication signal is lower than the first threshold, the target Bluetooth device is instructed to increase the transmission power by a preset ratio or a preset step value. If the adjusted communication signal strength is still lower than the first threshold, the current data transmission rate is adjusted from the first rate to a second rate that is lower than the first rate.

6. The method according to claim 5, characterized in that, The method further includes: If the signal strength detected after reducing the data transmission rate is still lower than the first threshold, a prompt message is generated to inform the user of the connection status.

7. The method according to claim 1, characterized in that, When an interference signal is detected, the frequency range of the interference signal is analyzed, including: Scan the preset frequency band to obtain the signal strength of at least one other wireless signal; Wireless signals whose signal strength exceeds a preset second threshold and whose channel overlaps with the current Bluetooth channel are identified as interference signals; Frequency analysis is performed on the interference signal to determine its frequency range.

8. The method according to claim 7, characterized in that, Negotiating a switch to an interference-free channel with the target Bluetooth device includes: Among a number of preset available channels, a channel located outside the frequency range of the interference signal is selected as the target channel; The target Bluetooth device is synchronously switched to the target channel via a predefined negotiation protocol; during the channel switching, a data caching mechanism is used to maintain the continuity of data transmission.

9. A Bluetooth communication system, characterized in that, include: The authentication module is used to send an authentication request to the target Bluetooth device in response to a Bluetooth connection request; Receive the device identifier and a random number encrypted based on a preset encryption key returned by the target Bluetooth device; After decryption and generating a first verification value based on the decryption result and the device identifier, the first verification value is sent back to the target Bluetooth device for verification; A connection will be established after successful verification. The key negotiation module is used to exchange temporary keys with the target device to generate session keys based on a preset key negotiation algorithm; The signal monitoring and adjustment module is used to continuously monitor the communication signal strength; when the communication signal strength is lower than a first threshold, it instructs the target Bluetooth device to adjust the transmission power; if the power is still lower than the first threshold after adjustment, the two parties negotiate to reduce the data transmission rate. An interference detection and avoidance module is used to monitor the wireless signal environment in real time. When an interference signal is detected, the frequency range of the interference signal is analyzed, and the target Bluetooth device is negotiated to switch to an interference-free channel. During the switching process, the established session key is kept encrypted.

10. A hardware device, characterized in that, The method includes a processor and a memory, the memory storing computer-executable instructions executable by the processor, the processor executing the computer-executable instructions to implement the method according to any one of claims 1 to 8.