Bluetooth pairing method and device
Through the connection and status switching between Bluetooth devices and terminal devices, the automatic pairing of Bluetooth devices is performed based on networking information, solving the problems of cumbersome and mismatch of existing Bluetooth networking methods, and simplifying the triggering process and improving scalability.
Patent Information
- Application Number
- CN202510261200.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-07-04
AI Technical Summary
The existing Bluetooth networking method is complicated, prone to mismatching, and poor scalability, making it difficult to simplify the device pairing triggering process and update linkage plan.
The current Bluetooth device establishes a connection with the terminal device, sends network information, sorts according to the broadcast signal strength, switches the state to pair until the preset number of devices completes the pairing, and uses the network information to switch status and update the linkage plan.
It simplifies the triggering process of Bluetooth networking, reduces the probability of mismatch, and allows updates to linkage solutions in networking information, improving the scalability of Bluetooth networking.
Smart Images

Figure CN120264285A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of Bluetooth networking, and specifically relates to a Bluetooth pairing method and device. Background Art
[0002] BLE (Bluetooth Low Energy) technology has been widely used in local area networks such as the Internet of Things (IoT) and smart communities due to its low power consumption. This technology allows low-power communication between devices and is very suitable for devices that require long battery life, such as wearable devices, sensors, and smart home devices. In a BLE network, there are two main connection methods: mesh networking and tree cascade networking. Both networking methods are designed to achieve large-scale connection and communication between multiple BLE devices.
[0003] At present, the Bluetooth networking methods on the market are relatively cumbersome, usually requiring a button to trigger the networking; and when multiple devices are triggered at the same time, it is easy to have mispairing. For example, limiting the signal strength may cause the device pairing to fail or adjacent devices may also be paired; and the existing Bluetooth networking methods require the basic linkage scheme between devices to be configured within the program, resulting in poor scalability. Therefore, there is an urgent need for a Bluetooth pairing solution with a simple pairing trigger process and good scalability. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a Bluetooth pairing method and device, which can simplify the pairing trigger process of devices in Bluetooth networking and reduce the probability of incorrect pairing; and can preset the latest basic linkage solution during the pairing process according to the existing device combination to solve the problem of poor scalability in the existing technology.
[0005] On the one hand, an embodiment of the present application provides a Bluetooth pairing method, the method comprising:
[0006] The current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in a Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting a preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices; the networking information includes a linkage scheme between Bluetooth devices;
[0007] The current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after removing the Bluetooth device to be paired from the Bluetooth device sequence;
[0008] The current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device;
[0009] The current Bluetooth device is converted into a host based on the networking information, and when the broadcast signal of the Bluetooth device to be paired is scanned, a pairing request is sent to the Bluetooth device to be paired;
[0010] When the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, the pairing with the Bluetooth device to be paired is completed;
[0011] The current Bluetooth device repeats the operation of switching from the scanning state to the broadcasting state until the pairing with the Bluetooth device to be paired is completed, until the preset number of Bluetooth devices complete the pairing according to the networking information.
[0012] On the other hand, an embodiment of the present application also provides a Bluetooth pairing method, and the method includes:
[0013] In response to the connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device, so that the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; the networking information includes the linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of them;
[0014] In response to a new connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send the networking information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the networking information; and so that when the current Bluetooth device scans the broadcast signal of the to-be-paired Bluetooth device, send a pairing request to the to-be-paired Bluetooth device; and so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed, complete the pairing with the to-be-paired Bluetooth device; and so that repeat the operations from "In response to a new connection request sent by the current Bluetooth device" to "so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed, complete the pairing with the to-be-paired Bluetooth device" until the preset number of Bluetooth devices complete the pairing according to the networking information; wherein, the current Bluetooth device is the Bluetooth device ranked first in the new current Bluetooth devices, and the new Bluetooth device sequence is the Bluetooth device sequence after removing the to-be-paired Bluetooth device from the Bluetooth device sequence.
[0015] On the other hand, an embodiment of the present application further provides a Bluetooth pairing device, and the device includes:
[0016] A first connection module, configured to send a connection request from the current Bluetooth device to the terminal device, so that the terminal device, in response to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices; the networking information includes a linkage scheme between Bluetooth devices;
[0017] A status switching module, when the current Bluetooth device switches from the scanning state to the broadcast state, automatically removes it from the Bluetooth device sequence and is converted into a to-be-paired Bluetooth device; wherein, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the Bluetooth device sequence after removing the to-be-paired Bluetooth device from the Bluetooth device sequence;
[0018] A second connection module, the current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device, in response to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device;
[0019] A pairing request module, configured to convert the current Bluetooth device into a host based on the networking information, and send a pairing request to the to-be-paired Bluetooth device when scanning the broadcast signal of the to-be-paired Bluetooth device;
[0020] A pairing module, configured to complete pairing with the to-be-paired Bluetooth device when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed;
[0021] A repetition module, configured to repeat the operation that the current Bluetooth device switches from the scanning state to the broadcasting state until the pairing with the to-be-paired Bluetooth device is completed, until the preset number of Bluetooth devices complete pairing according to the networking information.
[0022] On the other hand, an embodiment of the present application further provides a Bluetooth pairing terminal, where the terminal includes:
[0023] A first networking information sending module, configured to establish a connection with the current Bluetooth device in response to a connection request sent by the current Bluetooth device, and send networking information to the current Bluetooth device, so that the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a to-be-paired Bluetooth device; the networking information includes a linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by ranking the preset number of Bluetooth devices according to the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices;
[0024] A second networking information sending module, configured to establish a connection with the current Bluetooth device in response to a new connection request sent by the current Bluetooth device, and send the networking information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the networking information; and so that when the current Bluetooth device scans the broadcast signal of the to-be-paired Bluetooth device, the current Bluetooth device sends a pairing request to the to-be-paired Bluetooth device; and so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed, the current Bluetooth device completes pairing with the to-be-paired Bluetooth device; and so that the operation of repeating the response to the connection request sent by the current Bluetooth device until the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed and the current Bluetooth device completes pairing with the to-be-paired Bluetooth device is performed until the preset number of Bluetooth devices complete pairing according to the networking information; wherein, the current Bluetooth device is the Bluetooth device ranked first in the new current Bluetooth devices, and the new Bluetooth device sequence is the Bluetooth device sequence after removing the to-be-paired Bluetooth device.
[0025] On the other hand, an embodiment of the present application further provides an electronic device for Bluetooth pairing. The electronic device includes a processor and a memory. At least one instruction or at least one program segment is stored in the memory, and the at least one instruction or at least one program segment is loaded and executed by the processor to implement the Bluetooth pairing method as described above.
[0026] On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the Bluetooth pairing method as described above.
[0027] On the other hand, an embodiment of the present application further provides a computer program product, which implements the Bluetooth pairing method as described above when executed by a processor.
[0028] The Bluetooth pairing method, device, equipment and storage medium provided by the embodiments of the present application have the following technical effects:
[0029] In the present application, the current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting a preset number of Bluetooth devices based on the broadcast signal strength of the terminal devices scanned by each of the preset number of Bluetooth devices; the networking information includes the linkage scheme between Bluetooth devices; the current Bluetooth device switches from the scanning state to the broadcast state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after the Bluetooth device sequence removes the Bluetooth device to be paired; the current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is converted into a host based on the networking information, and when the broadcast signal of the Bluetooth device to be paired is scanned, a pairing request is sent to the Bluetooth device to be paired; when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, the pairing with the Bluetooth device to be paired is completed; the current Bluetooth device repeats the operation of switching from the scanning state to the broadcast state until the pairing with the Bluetooth device to be paired is completed, until a preset number of Bluetooth devices complete the pairing according to the networking information. In the present application, based on the connection between the current Bluetooth device and the terminal device, the terminal device pairs the networking information with the current Bluetooth device, and the networking information includes the linkage scheme between Bluetooth devices. Therefore, the current Bluetooth device can switch its state according to the networking information, and the above process is used as the trigger process for Bluetooth networking, so that the pairing process must be based on the networking information, which not only simplifies the trigger process and does not require triggering through a certain button to perform networking, but also reduces the probability of mispairing. And the linkage scheme between Bluetooth devices in the networking information can be updated, avoiding the problem of poor scalability caused by the need to pre-set the basic linkage scheme inside the program. Description of the Drawings
[0030] To more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.
[0031] Figure 1 is a schematic diagram of a Bluetooth networking system shown according to an exemplary embodiment.
[0032] Figure 2 is a schematic flowchart of a Bluetooth pairing method shown according to an exemplary embodiment.
[0033] Figure 3 is a schematic flowchart of a method for a terminal device to generate authentication information shown according to an exemplary embodiment.
[0034] Figure 4 is a schematic flowchart of a method for a terminal device to establish a connection with a Bluetooth device shown according to an exemplary embodiment.
[0035] Figure 5 is a schematic flowchart of a Bluetooth pairing method shown according to an exemplary embodiment.
[0036] Figure 6 is a schematic flowchart of a Bluetooth pairing method with a Bluetooth device as the execution subject shown according to an exemplary embodiment.
[0037] Figure 7 is a schematic flowchart of a Bluetooth pairing method with a terminal device as the execution subject shown according to an exemplary embodiment.
[0038] Figure 8 is a structural block diagram of a Bluetooth pairing device shown according to an exemplary embodiment.
[0039] Figure 9 is a structural block diagram of a Bluetooth pairing terminal shown according to an exemplary embodiment.
[0040] Figure 10 is a schematic structural diagram of a Bluetooth pairing server shown according to an exemplary embodiment. Detailed implementation manners
[0041] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the protection scope of the present application.
[0042] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. Thus, features defined with "first", "second" may explicitly or implicitly include one or more of such features. In the description of this embodiment, unless otherwise specified, the meaning of "a plurality" is two or more. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or server that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0043] In order to make the purpose, technical solutions and advantages of the embodiments disclosed in the present application clearer and more understandable, the following further details the embodiments of the present application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, and are not used to limit the embodiments of the present application.
[0044] Please refer to Figure 1 , Figure 1 which is a schematic diagram of a Bluetooth networking system provided by an embodiment of the present application. As Figure 1 shown, the Bluetooth networking system at least includes a terminal device 01, a first Bluetooth device 02, and a second Bluetooth device 03.
[0045] Specifically, in the embodiments of the present application, the terminal device 01 can be any device for receiving or sending data, usually connected to a computer network or other electronic systems. For example, the terminal device 01 can include physical devices such as smartphones, desktop computers, tablets, laptops, digital assistants, smart wearable devices, smart speakers, vehicle-mounted terminals, smart TVs, etc., and can also include software running on physical devices. For example, some web pages provided by service providers to users can also be applications provided by these service providers to users. Specifically, the terminal device 01 can be used to respond to a connection request from a Bluetooth device, establish a connection with the Bluetooth device, and send networking information to the current Bluetooth device; it can also be used to update the networking information, that is, to update the linkage scheme between Bluetooth devices, etc.
[0046] Specifically, in the embodiments of the present application, the first Bluetooth device 02 and the second Bluetooth device 03 can be any devices that support Bluetooth technology. These devices achieve wireless connection through Bluetooth technology, making data transmission and device control more convenient. For example, they can be various types of electronic devices such as smartphones, tablets, laptops, headphones and speakers, vehicle-mounted systems, smart watches and health trackers, home automation devices (such as smart bulbs, sockets, thermostats, etc.), game controllers, heart rate monitors and other sports tracking devices, printers and scanners. The first Bluetooth device 02 and the second Bluetooth device 03 are used to send a connection request to the terminal device 01 and receive the networking information sent by the terminal device; they are also used to perform a status switch according to the networking request sent by the terminal device; they are also used to send pairing requests or verification messages to each other so that the first Bluetooth device 02 and the second Bluetooth device 03 can be paired.
[0047] The above system can also include a third Bluetooth device 04, and the type and function of the third Bluetooth device 04 are exactly the same as those of the first Bluetooth device 02 and the second Bluetooth device 03.
[0048] The following introduces a Bluetooth pairing method of the present application. Figure 2 It is a flowchart of a Bluetooth pairing method provided by an embodiment of the present application. The present specification provides method operation steps as described in the embodiment or flowchart, but based on routine or non-creative labor, there can be more or fewer operation steps. The step order listed in the embodiment is only one way among the execution orders of numerous steps and does not represent the only execution order. When the actual system or the fourth server product executes, it can be executed in the order of the method shown in the embodiment or the drawings, or executed in parallel (for example, in an environment of parallel processors or multi-threaded processing).
[0049] Specifically, as Figure 2 shown, the method can include:
[0050] S101: The current Bluetooth device sends a connection request to the terminal device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting a preset number of Bluetooth devices based on the broadcast signal strength of each of them scanning the terminal device.
[0051] In the embodiment of the present application, before the preset number of Bluetooth devices send connection requests, it is necessary to control all the preset number of Bluetooth devices to be powered on and turn on the scanning mode to scan at a preset time interval; and control the terminal device to turn on the broadcast state. Determine the broadcast signal strength of each of the preset number of Bluetooth devices scanning the terminal device, and sort the preset number of Bluetooth devices based on the level of the broadcast signal strength to obtain the Bluetooth device sequence. Specifically, in the Bluetooth device sequence, the Bluetooth device that scans the strongest broadcast signal of the terminal device is the current Bluetooth device, that is, the Bluetooth device ranked first in the Bluetooth device sequence. Among them, the scanning state refers to a state of the device in the Link Layer (LL) for receiving broadcast data; the broadcast state refers to the state of the device sending broadcast data or broadcast signals to surrounding devices.
[0052] After determining the current Bluetooth device, the current Bluetooth device will send a connection request to the terminal device, and the connection request is a request for the current Bluetooth device to initiate communication with the terminal device. The connection request may carry the local key of the current Bluetooth device.
[0053] Optionally, the preset time interval can be 100 ms.
[0054] S103: The terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the networking information includes the linkage scheme between Bluetooth devices.
[0055] In the embodiment of the present application, the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and after establishing the connection, the terminal device sends networking information to the current Bluetooth device. The networking information includes but is not limited to the linkage scheme between Bluetooth devices. The linkage scheme between Bluetooth devices defines communication rules between Bluetooth devices, scene mode settings, timing tasks, actions triggered by sensors, user preference settings, security and privacy configurations, device status synchronization, remote control configurations, and fault handling mechanisms, etc., aiming to define how devices cooperate with each other to achieve automated control and scene linkage, ensuring the high efficiency, security, and personalized experience of the system.
[0056] The networking information can be updated in the terminal device so that each time the current Bluetooth device connects to the terminal device, the latest networking information is sent to the current Bluetooth device.
[0057] Optionally, after the network formation is completed or during the establishment of a Bluetooth connection between the current Bluetooth device and the terminal device, if the network formation information is updated, the updated network formation information can also be sent to the current Bluetooth device or all Bluetooth devices.
[0058] Optionally, the update of network formation information mainly occurs in the following situations:
[0059] 1. New node joins the network: When a new Bluetooth device joins an existing Bluetooth network, the network formation information needs to be updated. This includes configuring the network key (Net Key), node master element address, and IV value, etc., to ensure that the new node can communicate with other nodes in the network.
[0060] 2. Network parameter change: When some parameters in the network change, such as the update of the IV value (Initialization Vector), all nodes need to update these parameters to maintain network synchronization and communication. The IV value needs to be consistent with the IV value in the existing network when using the self-configuring network method.
[0061] 3. Device firmware upgrade: In a Bluetooth network, device firmware upgrade (DFU) may involve updating the firmware of nodes, which may require updating the network formation information to ensure that the upgraded device can work properly.
[0062] 4. Network topology change: If the devices in the network move or a device is removed from the network, the network formation information may need to be updated to reflect the change in the network topology.
[0063] 5. Security update: To improve the security of the network, it may be necessary to update the encryption key or security policy of the network, which also involves the update of network formation information.
[0064] 6. User manual update: The user may need to manually update the network formation information, such as performing network configuration through a mobile phone app, setting up subscription address groups, OTA upgrade, etc.
[0065] S105: The current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after the Bluetooth device to be paired is removed from the Bluetooth device sequence.
[0066] In the embodiment of the present application, after the terminal device and the current Bluetooth device establish a connection, the current Bluetooth device switches from the scanning state to the broadcasting state according to the received network formation information, so that it can be scanned by other current Bluetooth devices. After switching to the broadcasting state, since it can no longer receive the broadcast signal of the terminal device, it automatically removes itself from the Bluetooth device sequence and is converted into a Bluetooth device to be paired.
[0067] After removing the device that has established a connection with the terminal device, the Bluetooth device sequence is updated, which is the new Bluetooth device sequence. The Bluetooth device ranked first in the new Bluetooth sequence is re-determined as the current Bluetooth device.
[0068] S107: The current Bluetooth device re-sends a connection request to the terminal device.
[0069] In the implementation of this application, as long as it is determined as the current Bluetooth device, it will send a connection request to the terminal device.
[0070] S109: In response to the connection request, the terminal device establishes a connection with the current Bluetooth device and sends networking information to the current Bluetooth device. The current Bluetooth device is converted into a host based on the networking information.
[0071] In the implementation of this application, in response to the connection request sent by the new device, the terminal device establishes a connection with the current Bluetooth device and sends networking information to the current Bluetooth device. This process is the same as step S103 above and will not be elaborated here.
[0072] Because the networking information is configured with an inter-device linkage scheme, that is, the linkage configuration table of the device corresponding to the current Bluetooth device and other Bluetooth devices is defined. The linkage configuration table also includes information on whether the current Bluetooth device is configured as the host. Therefore, the current Bluetooth device will be converted into the host based on the linkage configuration table in the networking information and then continue the scanning. Among them, the linkage configuration table refers to the inter-device linkage behavior and configuration scheme to achieve the coordination and automated control between devices. Specifically, the linkage configuration table includes but is not limited to the following aspects: (1) Node role definition: Each device (node) can assume different roles, such as relay node, proxy node, low-power node, etc. The linkage configuration table will define the role and function of each node. (2) Communication path: The linkage configuration table will specify the data transmission path, including the relay and forwarding rules of messages. This ensures that even when devices are not within the direct communication range, messages can be passed to the target device through relay nodes. (3) Model and state: Details the interaction and state changes between different device models. (4) Security key management: To ensure the security of the network, the Bluetooth network uses different types of keys to encrypt communication, including network key (NetKey), application key (App Key), and device key (Dev Key). The linkage configuration table will define the distribution and management methods of these keys. (5) Automated scenarios: The linkage configuration table will also define a series of automated scenarios. For example, when a sensor detects a specific condition, how other devices respond. These scenarios can be triggered by preset rules and conditions to achieve intelligent linkage between devices. (6) Network parameters: The linkage configuration table will also include the settings of network parameters, such as the number of transmissions, sending interval, etc., to optimize the performance and reliability of the network.
[0073] S111: When the current Bluetooth device scans the broadcast signal of the Bluetooth device to be paired, it sends a pairing request to the Bluetooth device to be paired.
[0074] In the implementation of this application, when the current Bluetooth device scans the broadcast signal of the Bluetooth device to be paired, it will send a pairing request and a verification message to the Bluetooth device to be paired. The verification message is used to verify whether the pairing relationship between the current Bluetooth device and the Bluetooth device to be paired is in the linkage configuration table and to ensure the security of the pairing process.
[0075] S113: When the current Bluetooth device receives the verification message from the Bluetooth device to be paired and the verification is passed, it completes the pairing with the Bluetooth device to be paired.
[0076] In the embodiment of this application, when the current Bluetooth device receives the verification message from the Bluetooth device to be paired, if the verification message is correct, the current Bluetooth device and the Bluetooth device to be paired will exchange pairing keys to complete the pairing process. After successful pairing, the two devices will establish a stable Bluetooth connection.
[0077] S115: The current Bluetooth device repeatedly switches from the scanning state to the broadcasting state until it completes pairing with the Bluetooth device to be paired, until a preset number of Bluetooth devices complete pairing according to the networking information.
[0078] In the embodiment of the present application, it relates to a solution for a preset number of Bluetooth devices to pair to complete Bluetooth networking. When the preset number of Bluetooth devices is greater than 2, repeat the steps of S105 - S113 until the preset number of Bluetooth devices complete mutual pairing according to the linkage configuration table in the networking information, that is, the Bluetooth networking is completed.
[0079] In the embodiment of the present application, based on the connection between the current Bluetooth device and the terminal device, the terminal device sends networking information for pairing to the current Bluetooth device. The networking information includes the linkage scheme between Bluetooth devices. Therefore, the current Bluetooth device can switch its state according to the networking information. Using the above process as the trigger process for Bluetooth networking, the pairing process must be based on the networking information, which not only simplifies the trigger process and does not require triggering through a certain button to perform networking, but also reduces the probability of incorrect pairing. And the linkage scheme between Bluetooth devices in the networking information can be updated, avoiding the problem of poor scalability caused by the need to pre - set the basic linkage scheme inside the program.
[0080] In some embodiments, the above - mentioned preset number of Bluetooth devices is at least two Bluetooth devices.
[0081] In the embodiment of the present application, the processes of S101 - S115 are to enable Bluetooth devices within a certain area to pair and network so that they can perform linkage operations. Therefore, the embodiment of the present application includes at least one terminal device and two other Bluetooth devices.
[0082] In some embodiments, in the above - mentioned step S101, the current Bluetooth device sending a connection request to the terminal device includes:
[0083] When the signal strength of the broadcast signal of the terminal device received by the current Bluetooth device is greater than the preset strength threshold, the current Bluetooth device sends a connection request to the terminal device.
[0084] In the embodiment of the present application, since the current Bluetooth device is determined based on the signal strength of the broadcast signal of the terminal device it scans, but to ensure the accuracy of Bluetooth networking, generally, it will enter the Bluetooth sequence list only within a certain range of the terminal device, and only when the signal strength of the broadcast signal of the scanned terminal device is greater than the preset strength threshold, will the current Bluetooth device send a Bluetooth request to the terminal device.
[0085] Optionally, the preset strength threshold can be - 60dbm.
[0086] In the embodiments of the present application, by limiting that a connection request is sent to the terminal device only when the broadcast signal strength of the terminal device scanned by the current Bluetooth device exceeds a preset threshold, it is not only possible to avoid multiple Bluetooth devices sending connection requests to the terminal device simultaneously, but also to lay a foundation for pairing between a preset number of Bluetooth devices with each other.
[0087] In some embodiments, before the above step S101, the above method further includes:
[0088] S001: The terminal device generates authentication information in response to a networking request sent by a target object and enables the broadcast mode.
[0089] In the embodiments of the present application, the target object may be the user corresponding to the terminal. The networking request refers to using the terminal device as the master device to connect other Bluetooth devices to form a Bluetooth network that can communicate in a multi - to - multi manner. The manner in which the terminal device responds to the networking request sent by the target object may be that the terminal device receives a specific operation performed by the target object on the terminal device, or the user opens the APP as a signal for establishing the networking request, which is not specifically limited herein.
[0090] After the terminal device responds to the networking request sent by the target object, it will generate authentication information, which refers to the identity information that can uniquely identify the terminal device, and enables the broadcast mode.
[0091] In some embodiments, in the above step S001, as Figure 3 shown, the terminal device generates authentication information in response to the networking request sent by the target object, specifically including the following steps:
[0092] S0011: The terminal device obtains account information and the identification information of the database from the cloud in response to the networking request sent by the target object.
[0093] In the embodiments of the present application, the account information refers to the home information registered by the terminal device in the cloud. Here, "home" refers to a set of information used to identify and distinguish different Bluetooth networks or device groups. For example, a smart home system may allow users to set home information through a mobile APP, and then the APP will generate a home ID and guide the user to add devices such as smart bulbs, switches, and sensors to this home network. The identification information of the database refers to the key data used to uniquely identify a device or network, such as a network ID, node address, etc.
[0094] S0013: The terminal device performs a unique encryption process on the account information, the unique identifier of the database, and the local key to generate authentication information.
[0095] In the embodiments of the present application, the local key refers to the device key. The device key is unique to each node, and only the Provisioner and the device itself know this key. It is used to ensure the communication security during the device provisioning process, including configuring a new network key (Net Key) or application key (App Key), and setting other device-related parameters.
[0096] The unique encryption process of the terminal device for the account information, the unique identifier of the database, and the local key means that the terminal device generates a unique home ID based on the obtained account information, the unique identifier of the database, and the local key, as the above authentication information. The specific encryption process can adopt methods such as AES (Advanced Encryption Standard) encryption, hash algorithm, RSA encryption, identity-based encryption (IBE), encryption of the database unique identifier, digital signature, etc.
[0097] In the embodiments of the present application, by defining that before pairing and networking multiple Bluetooth devices, the terminal device generates a unique home ID and the specific method of generating the home ID, and the generated home ID is used as part of the verification message in the subsequent Bluetooth pairing process, the security of the subsequent pairing and networking process can be improved, thereby ensuring the accuracy of pairing and reducing the probability of mispairing.
[0098] In some embodiments, in the above step S103, as Figure 4 shown, the above terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device, including:
[0099] S1031: The terminal device responds to the connection request and negotiates an encryption suite with the current Bluetooth device;
[0100] In the embodiments of the present application, the encryption suite refers to a set of encryption algorithms and protocols used to ensure network communication security. It determines how data is encrypted to protect privacy and how each party authenticates each other to ensure a secure connection. When the terminal device establishes a connection with the current Bluetooth device, the two parties will first negotiate and determine the supported encryption suite. This step ensures that both parties can use the same encryption algorithm for secure communication.
[0101] S1033: The local key of the terminal device is exchanged with the local key of the current Bluetooth device.
[0102] In the embodiments of the present application, after negotiating and determining the encryption suite, the local key of the terminal device is exchanged with the local key of the current Bluetooth device.
[0103] S1035: The current Bluetooth device generates authentication information based on the local key of the terminal device, the local key of the current Bluetooth device, and the encryption suite, and sends it to the terminal device.
[0104] In the embodiment of the present application, the current Bluetooth device generates authentication information according to the local key of the terminal device, the local key of the current Bluetooth device, and the encryption suite. Specifically, it determines the encryption suite supported by both parties. The current Bluetooth device will use the key value burned together with the MAC address by the local key to generate an authentication information. This local key value is unique to the device and is usually embedded in the device during device manufacturing. The generated authentication information will be used to confirm the identity of the current Bluetooth device. During the TLS handshake process, this authentication information can be similar to a digital certificate, used to verify the identity of the current Bluetooth device and ensure the security of the connection.
[0105] Optionally, in the process of creating and storing a shared key on each side (the terminal device and other Bluetooth devices) for subsequent connections between devices. If the pairing parties store this authentication information as a long-term key (LTK), then when the two devices reconnect, they can skip the pairing process and directly use the LTK to encrypt the Bluetooth connection.
[0106] S1037: After the terminal device verifies the authentication information, it establishes a connection with the current Bluetooth device.
[0107] In the embodiment of the present application, when the terminal device verifies and passes the generated verification information, it establishes a connection with the current Bluetooth device. The connection process between the terminal device and the current Bluetooth device is encrypted using the above-generated authentication information, that is, the authentication information is a shared key.
[0108] S1039: The terminal device sends authentication information and networking information to the current Bluetooth device.
[0109] In the embodiment of the present application, after the terminal device and the current Bluetooth device establish a connection, it will send authentication information and networking information to the current Bluetooth device for data transmission with the terminal device and to enable the current Bluetooth device to obtain the latest linkage configuration table.
[0110] In the embodiments of the present application, a connection is established between the current Bluetooth device and the terminal device through processes such as negotiating encryption suites, exchanging keys, and generating authentication information. Subsequently, the terminal device sends networking information and authentication information to the current Bluetooth device. The networking information includes the latest linkage configuration table. Therefore, the current Bluetooth device can switch its state according to the networking information. Based on the above process as the trigger process for Bluetooth networking, the pairing process must be based on the networking information, which not only simplifies the trigger process and eliminates the need to trigger networking through a certain button, but also reduces the probability of incorrect pairing. Moreover, the linkage scheme between Bluetooth devices in the networking information can be updated independently at any time during pairing, avoiding the problem of poor scalability caused by pre-setting the basic linkage scheme inside the program.
[0111] In some embodiments, the above verification message includes the above authentication message. In step S113, when the current Bluetooth device receives the verification message from the Bluetooth device to be paired and passes the verification, it completes the pairing with the Bluetooth device to be paired, including:
[0112] When the current Bluetooth device receives the verification information from the Bluetooth device to be paired, when it determines that the verification information includes the authentication information and determines that the Bluetooth device to be paired meets the networking information, it completes the pairing with the Bluetooth device to be paired.
[0113] In the embodiments of the present application, because when the terminal device connects to each current Bluetooth device, it sends authentication information and networking information to it, and the networking information includes the linkage configuration table between devices. Therefore, during the pairing process between the current Bluetooth device and the Bluetooth device to be paired, the current Bluetooth device first confirms the authentication message of the Bluetooth device to be paired based on the networking information. If the authentication is passed, it determines whether the Bluetooth device to be paired needs to be linked with the current Bluetooth device according to the linkage configuration table. If so, the pairing is completed. Both of the above conditions need to be met for the current Bluetooth device and the Bluetooth device to be paired to complete the pairing.
[0114] The embodiments of the present application limit that the pairing process between the current Bluetooth device and the Bluetooth device to be paired needs to verify the authentication information and needs to meet the linkage configuration table in the networking information to complete the pairing. Based on the above process as the trigger process for Bluetooth networking, the pairing process must be based on the networking information, reducing the probability of incorrect pairing.
[0115] In some embodiments, after the above step S113, the method further includes:
[0116] The current Bluetooth device feeds back the information of the completed pairing to the terminal device.
[0117] In an embodiment of the present application, after pairing is completed, the current Bluetooth device will feedback the information of the completed pairing to the terminal device. Specifically, the information of the completed pairing includes the device information and connection status of the current Bluetooth device and the Bluetooth device to be paired. After receiving the feedback information from the current Bluetooth device, the terminal device determines that the current Bluetooth device and the Bluetooth device to be paired can perform linkage operations.
[0118] Optionally, the above method further includes that after pairing is completed, the Bluetooth device to be paired will also feedback the information of the completed pairing to the terminal device.
[0119] In the embodiment of the present application, by feedbacking the information of the completed pairing to the terminal device after each pairing is completed, the terminal device can update the subsequent network formation information sent, and can obtain the latest Bluetooth device network formation information, which helps to improve the pairing accuracy and efficiency in the subsequent Bluetooth device pairing process.
[0120] Hereinafter, as Figure 5 shown, taking an example of including one terminal device and three Bluetooth devices, the Bluetooth pairing method provided by the embodiment of the present application will be described as a whole. The method includes:
[0121] Step 1: In response to the network formation request of the target object, the terminal device obtains the account information and the identification information of the database from the cloud. The terminal device performs unique encryption processing on the account information, the unique identifier of the database, and the local key to generate authentication information, and turns on the broadcast mode.
[0122] Step 2: The three Bluetooth devices are powered on and the scanning mode is turned on. According to the broadcast signal strength of the terminal device scanned by each of the three Bluetooth devices, a Bluetooth device sequence is obtained. In the Bluetooth device sequence, the three Bluetooth devices are sorted as Bluetooth device 1, Bluetooth device 2, and Bluetooth device 3 in turn. Among them, Bluetooth device 1 is determined as the current Bluetooth device.
[0123] Step 3: The current Bluetooth device, that is, Bluetooth device 1, sends a connection request to the terminal device. The terminal device responds to the connection request sent by Bluetooth device 1 and negotiates the encryption suite and local key exchange with Bluetooth device 1. Bluetooth device 1 burns the local key and the encryption suite together with the local MAC address to generate authentication information and sends it to the terminal device. The terminal device verifies the authentication information. After the verification is passed, a connection is established with Bluetooth device 1, and the network formation information and authentication information are sent to Bluetooth device 1.
[0124] Step 4: On the premise that the current Bluetooth device, that is, Bluetooth device 1, does not receive the broadcast signal of other devices or the received broadcast signal does not conform to the network formation information, it is converted from the scanning state to the broadcast state and becomes the Bluetooth device to be paired.
[0125] Step 5: Due to the status change of Bluetooth device 1, the Bluetooth device sequence is updated. In the updated Bluetooth device sequence, Bluetooth device 2 receives the strongest broadcast signal from the terminal device, and it becomes the current Bluetooth device. Then it sends a connection request to the terminal device. The terminal device responds to the connection request sent by Bluetooth device 2 and negotiates the encryption suite and local key exchange with Bluetooth device 2. Bluetooth device 2 burns the local key and encryption suite together with the local MAC address, generates authentication information and sends it to the terminal device. The terminal device verifies the authentication information. After successful verification, it establishes a connection with Bluetooth device 2 and sends networking information and authentication information to Bluetooth device 1.
[0126] Step 6: After the current Bluetooth device, i.e., Bluetooth device 2, establishes a connection with the terminal device, according to the received networking information, it changes its status to the host and continuously scans. When it scans the broadcast signal of Bluetooth device 1, it then sends a pairing request to Bluetooth device 1. Subsequently, Bluetooth device 1 sends a verification message to Bluetooth device 2. When Bluetooth device 2 determines that the verification message sent by Bluetooth device 1 includes the authentication message and Bluetooth device 1 conforms to the linkage configuration table in the networking information, the verification is passed and the pairing with Bluetooth device 1 is completed. Bluetooth device 1 and Bluetooth device 2 respectively feedback their pairing situations to the terminal.
[0127] Step 7: When Bluetooth device 2 does not scan or the received broadcast signal does not conform to the networking information, that is, it does not receive the broadcast signals of other devices, its status changes from the scanning state to the broadcast state and it becomes a Bluetooth device waiting for pairing. Subsequently, Bluetooth device 3 repeats Step 5 to establish a connection with the terminal device.
[0128] Step 9: Bluetooth device 3 repeats the process of Step 6 to complete the pairing with Bluetooth device 1; and repeats the process of Step 6 again to complete the pairing with Bluetooth device 2. Here, the order of completing the pairing with Bluetooth device 1 and Bluetooth device 2 is not necessarily the above order. It is also recommended to complete the pairing with Bluetooth device 2 first and then with Bluetooth device 1. The specific pairing order is determined according to the strength of the broadcast signals received by Bluetooth device 3. For example, if the strength of the broadcast signal of Bluetooth device 1 received by Bluetooth device 3 is greater than the strength of the broadcast signal of Bluetooth device 2 received, then it pairs with Bluetooth device 1 first. Bluetooth device 1, Bluetooth device 2 and Bluetooth device 3 respectively feedback their pairing situations to the terminal.
[0129] The following takes the current Bluetooth device as the execution subject to introduce a specific embodiment of a Bluetooth pairing method in this specification. Figure 6 It is a schematic flowchart of a Bluetooth pairing method provided by an embodiment of the present application. Specifically, as shown in Figure 6 The method may include:
[0130] S301: The current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of them; the networking information includes the linkage scheme between Bluetooth devices.
[0131] S303: The current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after the Bluetooth device to be paired is removed from the Bluetooth device sequence.
[0132] S305: The current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device.
[0133] S307: The current Bluetooth device is converted into a host based on the networking information, and when it scans the broadcast signal of the Bluetooth device to be paired, it sends a pairing request to the Bluetooth device to be paired.
[0134] S309: When the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, it completes the pairing with the Bluetooth device to be paired.
[0135] S311: The current Bluetooth device repeats the operation of switching from the scanning state to the broadcasting state until the pairing with the Bluetooth device to be paired is completed, until the preset number of Bluetooth devices complete the pairing according to the networking information.
[0136] In some embodiments, the current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device, including:
[0137] When the broadcast signal strength of the terminal device received by the current Bluetooth device is greater than the preset strength threshold, the current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request and negotiates an encryption suite with the current Bluetooth device.
[0138] The current Bluetooth device exchanges its local key with the local key of the terminal device.
[0139] The current Bluetooth device generates authentication information based on the local key of the terminal device, the local key of the current Bluetooth device, and the encryption suite, and sends it to the terminal device, so that after the terminal device verifies the authentication information, it establishes a connection with the current Bluetooth device; and so that the terminal device sends authentication information and the networking information to the current Bluetooth device; the authentication information is generated by the terminal device in response to a networking request issued by a target object.
[0140] In some embodiments, the verification message includes the authentication information; when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and passes the verification, the pairing with the Bluetooth device to be paired is completed, including:
[0141] When the current Bluetooth device receives the verification information of the Bluetooth device to be paired, when it determines that the verification information includes the authentication information and determines that the Bluetooth device to be paired meets the networking information, it completes the pairing with the Bluetooth device to be paired.
[0142] In some embodiments, after the current Bluetooth device receives the verification message of the Bluetooth device to be paired and passes the verification, and completes the pairing with the Bluetooth device to be paired, the method further includes:
[0143] The current Bluetooth device feeds back the information of the completed pairing to the terminal device.
[0144] In some embodiments, the preset number of Bluetooth devices is at least two Bluetooth devices.
[0145] The following takes the terminal device as the execution subject to introduce the specific embodiments of a Bluetooth pairing method in this specification. Figure 7 It is a schematic flowchart of a Bluetooth pairing method provided by an embodiment of the present application. Specifically, in combination with Figure 7 shown, the method may include:
[0146] S401: In response to a connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device, so that the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; the networking information includes a linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices;
[0147] S402: In response to a new connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send the networking information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the networking information; and so that when the current Bluetooth device scans the broadcast signal of the Bluetooth device to be paired, send a pairing request to the Bluetooth device to be paired; and so that when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, complete pairing with the Bluetooth device to be paired; and so that repeat the operations from "In response to a new connection request sent by the current Bluetooth device" to "so that when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, complete pairing with the Bluetooth device to be paired" until the preset number of Bluetooth devices complete pairing according to the networking information; where the current Bluetooth device is the Bluetooth device ranked first in the new current Bluetooth devices, and the new Bluetooth device sequence is the sequence after removing the Bluetooth device to be paired from the Bluetooth device sequence.
[0148] In some embodiments, before "In response to a new connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device", the method further includes:
[0149] In response to a networking request issued by a target object, generate authentication information and turn on the broadcast mode.
[0150] In some embodiments, it is characterized in that "In response to a networking request issued by a target object, generate authentication information" includes:
[0151] In response to the networking request issued by the target object, obtain account information and identification information of the database from the cloud;
[0152] Perform unique encryption processing on the account information, the unique identifier of the database, and the local key of the terminal device to generate the authentication information.
[0153] On the other hand, an embodiment of the present application also provides a Bluetooth pairing device, as Figure 8 shown, the device includes:
[0154] A first connection module 501, configured to send a connection request from the current Bluetooth device to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices; the networking information includes a linkage scheme between Bluetooth devices.
[0155] The status switching module 503, when the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes it from the Bluetooth device sequence and converts it into a Bluetooth device to be paired; wherein, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after removing the Bluetooth device to be paired from the Bluetooth device sequence;
[0156] The second connection module 505, the current Bluetooth device re-sends a new connection request to the terminal device, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device;
[0157] The pairing request module 507 is used for the current Bluetooth device to be converted into a host based on the networking information, and when scanning the broadcast signal of the Bluetooth device to be paired, sends a pairing request to the Bluetooth device to be paired;
[0158] The pairing module 509 is used for the current Bluetooth device to complete pairing with the Bluetooth device to be paired when receiving and passing the verification message of the Bluetooth device to be paired;
[0159] The repetition module 511 is used for the current Bluetooth device to repeatedly switch from the scanning state to the broadcasting state until the operation of completing pairing with the Bluetooth device to be paired, until the preset number of Bluetooth devices complete pairing according to the networking information.
[0160] In some embodiments, the first connection module further includes:
[0161] The encryption suite negotiation unit is used for the current Bluetooth device to send a connection request to the terminal device when the received broadcast signal strength of the terminal device is greater than the preset strength threshold, so that the terminal device responds to the connection request and negotiates the encryption suite with the current Bluetooth device;
[0162] The key exchange unit is used for the current Bluetooth device to exchange the local key with the local key of the terminal device based on the local key;
[0163] The connection unit is used for the current Bluetooth device to generate authentication information based on the local key of the terminal device, the local key of the current Bluetooth device and the encryption suite, and send it to the terminal device, so that after the terminal device verifies the authentication information and passes, it establishes a connection with the current Bluetooth device; and so that the terminal device sends the authentication information and the networking information to the current Bluetooth device; the authentication information is generated by the terminal device in response to the networking request sent by the target object.
[0164] In some embodiments, the verification message includes the authentication information; the pairing module further includes:
[0165] A pairing unit, configured to, when the current Bluetooth device receives the verification information of the to-be-paired Bluetooth device, complete pairing with the to-be-paired Bluetooth device when it is determined that the verification information includes the authentication information and it is determined that the to-be-paired Bluetooth device conforms to the networking information.
[0166] In some embodiments, the device further includes:
[0167] A feedback unit, configured to feedback the information that the pairing is completed by the current Bluetooth device to the terminal device.
[0168] On the other hand, an embodiment of the present application further provides a Bluetooth pairing terminal, such as Figure 9 including, the device includes:
[0169] A first networking information sending module 701, configured to, in response to a connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device, so that the current Bluetooth device switches from a scanning state to a broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a to-be-paired Bluetooth device; the networking information includes a linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices;
[0170] A second networking information sending module 702, configured to, in response to a new connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send the networking information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the networking information; and so that when the current Bluetooth device scans the broadcast signal of the to-be-paired Bluetooth device, send a pairing request to the to-be-paired Bluetooth device; and so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed, complete pairing with the to-be-paired Bluetooth device; and so that repeat the operations from the response to the connection request sent by the current Bluetooth device to the so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and the verification is passed, complete pairing with the to-be-paired Bluetooth device, until the preset number of Bluetooth devices complete pairing according to the networking information; wherein, the current Bluetooth device is the Bluetooth device ranked first in the new Bluetooth device sequence, and the new Bluetooth device sequence is the sequence after removing the to-be-paired Bluetooth device from the Bluetooth device sequence.
[0171] In some embodiments, the device further includes:
[0172] An initialization unit, configured to generate authentication information and turn on a broadcast mode in response to a networking request sent by a target object.
[0173] In some embodiments, the first networking information sending module further includes:
[0174] An obtaining unit, configured to obtain account information and identification information of a database from a cloud in response to the networking request sent by the target object;
[0175] An authentication information generating unit, configured to perform an uniquification encryption process on the account information, the unique identifier of the database, and a local key of a terminal device to generate the authentication information.
[0176] The device in the device embodiment and the method embodiment are based on the same inventive concept.
[0177] An embodiment of the present application further provides a computer storage medium, which can be disposed in a terminal to store at least one instruction or at least one program related to a Bluetooth pairing method in a method embodiment. The at least one instruction or at least one program is loaded and executed by the processor to implement the Bluetooth pairing method provided in the above method embodiment.
[0178] An embodiment of the present application further provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes to implement the Bluetooth pairing method provided in the above method embodiment. Optionally, in an embodiment of the present application, the storage medium may be located in at least one of multiple network servers in a computer network. Optionally, in this embodiment, the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disc, and other media that can store program codes.
[0179] The memory in the embodiments of the present application can be used to store software programs and modules. The processor can execute various functional applications and data processing by running the software programs and modules stored in the memory. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0180] The embodiment of the Bluetooth pairing method provided by the embodiments of the present application can be executed in a mobile terminal, a computer terminal, a server, or a similar computing device. Taking running on a server as an example, Figure 10 is a hardware structure block diagram of a server for the Bluetooth pairing method provided by the embodiments of the present application. As Figure 10As shown, the server 2100 can vary significantly depending on configuration or performance, and may include one or more central processing units (CPUs) 2110 (the central processing unit 2110 may include, but is not limited to, processing devices such as microprocessor MCUs or programmable logic devices FPGAs), a memory 2130 for storing data, and one or more storage media 2120 for storing application programs 2123 or data 2122 (such as one or more mass storage devices). Among them, the memory 2130 and the storage media 2120 can be transient storage or persistent storage. The program stored in the storage media 2120 may include one or more modules, and each module may include a series of instruction operations on the server. Further, the central processing unit 2110 may be configured to communicate with the storage media 2120 and execute a series of instruction operations in the storage media 2120 on the server 2100. The server 2100 may also include one or more power supplies 2160, one or more wired or wireless network interfaces 2150, one or more input / output interfaces 2140, and / or one or more operating systems 2121, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, Free BSDTM, etc. The input / output interface 2140 can be used to receive or send data via a network. Specific examples of the above network may include a wireless network provided by the communication provider of the server 2100. In one instance, the input / output interface 2140 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the input / output interface 2140 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0181] Those of ordinary skill in the art can understand that Figure 10 the structure shown is only schematic and does not limit the structure of the above electronic device. For example, the server 2100 may also include more or fewer components than Figure 10 shown therein, or have a different configuration from Figure 10 that shown.
[0182] As can be seen from the embodiments of the Bluetooth pairing method, device, equipment, or storage medium provided by the present application, the current Bluetooth device of the present application sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting a preset number of Bluetooth devices based on the broadcast signal strength of the terminal devices scanned by each of them; the networking information includes the linkage scheme between Bluetooth devices; the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after the Bluetooth device to be paired is removed from the Bluetooth device sequence; the current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is converted into a host based on the networking information, and when the broadcast signal of the Bluetooth device to be paired is scanned, a pairing request is sent to the Bluetooth device to be paired; when the current Bluetooth device receives and passes the verification message of the Bluetooth device to be paired, it completes the pairing with the Bluetooth device to be paired; the current Bluetooth device repeats the operation of switching from the scanning state to the broadcasting state until it completes the pairing with the Bluetooth device to be paired, until a preset number of Bluetooth devices complete the pairing according to the networking information. The present application is based on the connection between the current Bluetooth device and the terminal device, and the terminal device pairs and networks the information to the current Bluetooth device. The networking information includes the linkage scheme between Bluetooth devices. Therefore, the current Bluetooth device can switch its state according to the networking information. As the trigger process of Bluetooth networking according to the above process, the pairing process must be based on the networking information, which not only simplifies the trigger process and does not require triggering by a certain button to perform networking, but also reduces the probability of mispairing. Moreover, the linkage scheme between Bluetooth devices in the networking information can be updated, avoiding the problem of poor scalability caused by the need to pre-set the basic linkage scheme inside the program.
[0183] It should be noted that the above order of the embodiments of the present application is only for description and does not represent the superiority or inferiority of the embodiments. And the above specific embodiments of this specification have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous. Each embodiment in this specification is described in a progressive manner, and the same or similar parts among the embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, equipment, and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0184] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The program can be stored in a computer storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, or the like.
[0185] The above are only the preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A Bluetooth pairing method, characterized in that, The method includes: The current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of them; the networking information includes the linkage scheme between Bluetooth devices; The current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after the Bluetooth device sequence removes the Bluetooth device to be paired; The current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device; The current Bluetooth device is converted into a host based on the networking information, and when the broadcast signal of the Bluetooth device to be paired is scanned, a pairing request is sent to the Bluetooth device to be paired; When the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, it completes the pairing with the Bluetooth device to be paired; The current Bluetooth device repeats the operation of switching from the scanning state to the broadcasting state until the pairing with the Bluetooth device to be paired is completed, until the preset number of Bluetooth devices complete the pairing according to the networking information.
2. The method according to claim 1, wherein The current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device, including: When the broadcast signal strength of the terminal device received by the current Bluetooth device is greater than the preset strength threshold, the current Bluetooth device sends a connection request to the terminal device, so that the terminal device responds to the connection request and negotiates an encryption suite with the current Bluetooth device; The current Bluetooth device exchanges its local key with the local key of the terminal device; The current Bluetooth device generates authentication information based on the local key of the terminal device, the local key of the current Bluetooth device, and the encryption suite, and sends it to the terminal device, so that after the terminal device verifies the authentication information and passes, it establishes a connection with the current Bluetooth device; and so that the terminal device sends authentication information and the networking information to the current Bluetooth device; the authentication information is generated by the terminal device in response to a networking request sent by a target object.
3. The method according to claim 2, characterized in that The verification message includes the authentication information; when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, it completes the pairing with the Bluetooth device to be paired, including: When the current Bluetooth device receives the verification information of the to-be-paired Bluetooth device, and determines that the verification information includes the identity verification information and the to-be-paired Bluetooth device meets the networking information, it completes the pairing with the to-be-paired Bluetooth device.
4. The method according to claim 1, characterized in that After the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and passes the verification, and completes the pairing with the to-be-paired Bluetooth device, the method further includes: The current Bluetooth device feeds back the information of the completed pairing to the terminal device.
5. The method according to claim 1, wherein The preset number of Bluetooth devices is at least two Bluetooth devices.
6. A Bluetooth pairing method, characterized in that, The method includes: In response to a connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device, so that the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes itself from the Bluetooth device sequence, and is converted into a to-be-paired Bluetooth device; the networking information includes the linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal devices scanned by each of them. In response to a new connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send the networking information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the networking information; and so that when the current Bluetooth device scans the broadcast signal of the to-be-paired Bluetooth device, it sends a pairing request to the to-be-paired Bluetooth device; and so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and passes the verification, it completes the pairing with the to-be-paired Bluetooth device; and so that repeat the operations from the response to the connection request sent by the current Bluetooth device to the so that when the current Bluetooth device receives the verification message of the to-be-paired Bluetooth device and passes the verification, it completes the pairing with the to-be-paired Bluetooth device until the preset number of Bluetooth devices complete the pairing according to the networking information; wherein, the current Bluetooth device is the Bluetooth device ranked first in the new current Bluetooth devices, and the new Bluetooth device sequence is the sequence after removing the to-be-paired Bluetooth device from the Bluetooth device sequence.
7. The method according to claim 6, characterized in that Before the response to the connection request sent by the current Bluetooth device, establish a connection with the current Bluetooth device, and send networking information to the current Bluetooth device, the method further includes: In response to a networking request sent by the target object, generate identity verification information and turn on the broadcast mode.
8. The method according to claim 7, wherein The response to the networking request sent by the target object, generating identity verification information, includes: In response to the networking request sent by the target object, obtain the account information and the identification information of the database from the cloud. Perform unique encryption processing on the account information, the unique identifier of the database, and the local key of the terminal device to generate the identity verification information.
9. A Bluetooth pairing device, characterized in that, Applied to a Bluetooth device, the device includes: The first connection module is used for the current Bluetooth device to send a connection request to the terminal device, so that the terminal device responds to the connection request, establishes a connection with the current Bluetooth device, and sends networking information to the current Bluetooth device; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices; the networking information includes the linkage scheme between Bluetooth devices. The state switching module, when the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes it from the Bluetooth device sequence and converts it into a Bluetooth device to be paired; among them, the Bluetooth device ranked first in the new current Bluetooth devices is re-determined as the current Bluetooth device, and the new Bluetooth device sequence is the sequence after removing the Bluetooth device to be paired from the Bluetooth device sequence. The second connection module, the current Bluetooth device sends a new connection request to the terminal device again, so that the terminal device responds to the new connection request, establishes a connection with the current Bluetooth device, and sends the networking information to the current Bluetooth device. The pairing request module is used for the current Bluetooth device to be converted into a host based on the networking information, and when the broadcast signal of the Bluetooth device to be paired is scanned, a pairing request is sent to the Bluetooth device to be paired. The pairing module is used for the current Bluetooth device to complete pairing with the Bluetooth device to be paired when the verification message sent by the Bluetooth device to be paired is received and verified successfully. The repetition module is used for the current Bluetooth device to repeat the operation of switching from the scanning state to the broadcasting state until the pairing with the Bluetooth device to be paired is completed, until the preset number of Bluetooth devices complete pairing according to the networking information.
10. A Bluetooth pairing terminal, characterized in that, The terminal includes: The first networking information sending module is used for responding to the connection request sent by the current Bluetooth device, establishing a connection with the current Bluetooth device, and sending networking information to the current Bluetooth device, so that the current Bluetooth device switches from the scanning state to the broadcasting state, automatically removes it from the Bluetooth device sequence, and converts it into a Bluetooth device to be paired; the networking information includes the linkage scheme between Bluetooth devices; the current Bluetooth device is the Bluetooth device ranked first in the Bluetooth device sequence, and the Bluetooth device sequence is obtained by sorting the preset number of Bluetooth devices based on the broadcast signal strength of the terminal device scanned by each of the preset number of Bluetooth devices. The second network information sending module is used to establish a connection with the current Bluetooth device in response to a new connection request sent by the current Bluetooth device, and send the network information to the current Bluetooth device, so that the current Bluetooth device is converted into a host based on the network information; and so that when the current Bluetooth device scans the broadcast signal of the Bluetooth device to be paired, a pairing request is sent to the Bluetooth device to be paired; and so that when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed, the pairing with the Bluetooth device to be paired is completed; and so that the operations from responding to the connection request sent by the current Bluetooth device to the operation of completing the pairing with the Bluetooth device to be paired when the current Bluetooth device receives the verification message of the Bluetooth device to be paired and the verification is passed are repeated until the preset number of Bluetooth devices complete the pairing according to the network information; wherein, the current Bluetooth device is the Bluetooth device ranked first among the new current Bluetooth devices, and the new Bluetooth device sequence is the sequence after removing the Bluetooth device to be paired from the Bluetooth device sequence.
Citation Information
Cited By
Communication pairing method, system and equipment of electronic equipment and control device, and medium
CN121174148A