WO2023109610A1 - Bluetooth connection establishment method, device and system - Google Patents

Bluetooth connection establishment method, device and system Download PDF

Info

Publication number
WO2023109610A1
WO2023109610A1 PCT/CN2022/137200 CN2022137200W WO2023109610A1 WO 2023109610 A1 WO2023109610 A1 WO 2023109610A1 CN 2022137200 W CN2022137200 W CN 2022137200W WO 2023109610 A1 WO2023109610 A1 WO 2023109610A1
Authority
WO
WIPO (PCT)
Prior art keywords
bluetooth
information
pairing
pairing information
devices
Prior art date
Application number
PCT/CN2022/137200
Other languages
French (fr)
Chinese (zh)
Inventor
周学而
魏凡翔
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2023109610A1 publication Critical patent/WO2023109610A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup

Definitions

  • the embodiments of the present application relate to the field of communication technologies, and in particular, to a method, device, and system for establishing a Bluetooth connection.
  • Bluetooth technology is a radio technology that enables devices to communicate over short distances. Bluetooth technology enables wireless information exchange between terminal devices including smartphones, wireless headsets, and laptops. The use of Bluetooth technology can effectively simplify the communication between devices and make data transmission more rapid and efficient.
  • the user can trigger discovery of surrounding Bluetooth devices (such as enabling the Bluetooth function) on the Bluetooth master device (eg, device A).
  • the Bluetooth master device scans to discover other Bluetooth devices (such as Bluetooth slave devices) around it. After the scan is complete, the Bluetooth master device displays the scanned Bluetooth slave devices.
  • the user selects a Bluetooth slave device (such as device B) for authentication and pairing, and establishes a Bluetooth connection between the master device (that is, device A) and the slave device (that is, device B) after successful pairing to transmit services data.
  • the user needs to manually input the pairing code or manually confirm it.
  • the above method is cumbersome for the user to operate.
  • the present application provides a method, device and system for establishing a Bluetooth connection, which can simplify user operations in the process of establishing a Bluetooth connection.
  • a method for establishing a Bluetooth connection comprising: the second device receives the Bluetooth information of the first device shared by the first device and the pairing information of the first device; the second device receives the Bluetooth information of the first device and the pairing information of the first device The pairing information of the first device is used for Bluetooth pairing with the third device.
  • the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
  • the aforementioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may mean that the first device directly shares with the second device.
  • the above-mentioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may also mean that the first device shares with the second device through a third party (such as the fourth device).
  • the present application does not limit the specific manner in which the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device.
  • the method for establishing a Bluetooth connection can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
  • the second device receiving the Bluetooth information of the first device shared by the first device and the pairing information of the first device includes: after the second device establishes a communication connection with the first device, through the above-mentioned The communication connection is to receive the Bluetooth information from the first device and the pairing information of the first device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the second device receiving the Bluetooth information of the first device shared by the first device and the pairing information of the first device includes: the second device receiving the Bluetooth information of the first device sent by the fourth device The pairing information with the first device, wherein the bluetooth information of the first device and the pairing information of the first device are acquired by the fourth device from the first device.
  • This application does not limit the specific method of sharing pairing information between devices.
  • the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
  • the foregoing fourth device is a cloud-side device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
  • the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth.
  • the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
  • the second device performs Bluetooth pairing with the third device according to the Bluetooth information of the first device and the pairing information of the first device, including: the second device according to the Bluetooth information of the first device, and The Bluetooth type of the third device in the pairing information of the first device performs Bluetooth pairing with the third device based on the corresponding Bluetooth protocol.
  • the second device can be paired with the third device according to the specific Bluetooth type of the third device shared by the first device.
  • the above method further includes: in response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device based on the Bluetooth pairing between the second device and the third device. Establish a Bluetooth connection.
  • the device can directly update the list of paired devices based on the pairing information obtained from other devices, and further, establish a Bluetooth connection between devices based on the pairing information. This method can simplify The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the method further includes: the second device deletes the Bluetooth information of the first device, and the Bluetooth pairing between the first device and the third device information.
  • the second device can delete the Bluetooth received from other devices after ending the use of the Bluetooth connection. information and pairing information (including removing the third device from the paired device list of the second device).
  • the above method further includes: the second device shares the Bluetooth information of the second device and the Bluetooth pairing information between the second device and the third device with the fifth device, so that the fifth device Bluetooth information, and Bluetooth pairing information between the second device and the third device, and perform Bluetooth pairing with the third device. Furthermore, based on the pairing information sharing solution provided in this application, the second device can further share the pairing information obtained by the second device from the first device to other devices, such as the fifth device, so that the fifth device can directly base on the first device
  • the pairing information updates the pairing information list, simplifies the user's operation during the establishment of the Bluetooth connection, and shortens the time required for Bluetooth pairing.
  • a method for establishing a Bluetooth connection comprising: the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, so that the second device and the pairing information of the first device, and perform Bluetooth pairing with the third device; wherein, the first device and the third device have completed the Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
  • the aforementioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may mean that the first device directly shares with the second device.
  • the above-mentioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may also mean that the first device shares with the second device through a third party (such as the fourth device).
  • the present application does not limit the specific manner in which the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device.
  • the method for establishing a Bluetooth connection can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
  • the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: the first device shares one or more pairing information triggered by the user. Operation, sharing the Bluetooth information of the first device and the pairing information of the first device with the second device.
  • the first device may share the Bluetooth information and corresponding pairing information of the first device with the second device according to the user's actual instruction, such as the user selects the specific pairing information to be shared, so as to avoid excessive transmission data caused by sharing all pairing information. Large, redundant data, or issues that are not conducive to user privacy and data security related to device pairing.
  • the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: after the first device establishes a communication connection with the second device, , sending the Bluetooth information of the first device and the pairing information of the first device to the second device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: the first device sends the first device to the second device through the fourth device Bluetooth information and pairing information of the first device.
  • This application does not limit the specific method of sharing pairing information between devices.
  • the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
  • the foregoing fourth device is a cloud-side device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
  • the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth.
  • the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
  • a second device in a third aspect, includes: a transceiver unit configured to receive Bluetooth information of the first device shared by the first device and pairing information of the first device; a device sharing unit configured to The Bluetooth information of a device and the pairing information of the first device are used for Bluetooth pairing with the third device.
  • the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
  • the method for establishing a Bluetooth connection can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
  • the above-mentioned transceiver unit is specifically configured to: receive Bluetooth information from the first device and pairing information of the first device through the above-mentioned communication connection after the second device establishes a communication connection with the first device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the above-mentioned transceiver unit is specifically configured to: receive the Bluetooth information of the first device and the pairing information of the first device sent by the fourth device, wherein the Bluetooth information of the first device and the pairing information of the first device The information is obtained by the fourth device from the first device.
  • This application does not limit the specific method of sharing pairing information between devices.
  • the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
  • the foregoing fourth device is a cloud-side device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
  • the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth.
  • the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
  • the above-mentioned device sharing unit is specifically configured to, based on the Bluetooth information of the first device and the Bluetooth type of the third device in the pairing information of the first device, based on the corresponding Bluetooth protocol, communicate with the third device.
  • the device performs Bluetooth pairing.
  • the second device can be paired with the third device according to the specific Bluetooth type of the third device shared by the first device
  • the above-mentioned second device further includes: a Bluetooth unit, configured to: respond to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device, based on the Bluetooth pairing between the second device and the third device to establish a Bluetooth connection with the third device.
  • a Bluetooth unit configured to: respond to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device, based on the Bluetooth pairing between the second device and the third device to establish a Bluetooth connection with the third device.
  • the device can directly update the list of paired devices based on the pairing information obtained from other devices, and further, establish a Bluetooth connection between devices based on the pairing information. This method can simplify The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the device sharing unit is further configured to: delete the Bluetooth information of the first device, and the Bluetooth pairing between the first device and the third device information.
  • the second device can delete the Bluetooth received from other devices after ending the use of the Bluetooth connection. information and pairing information (including removing the third device from the paired device list of the second device).
  • the transceiver unit is further configured to: share the Bluetooth information of the second device and the Bluetooth pairing information between the second device and the third device with the fifth device, so that the fifth device information, and the Bluetooth pairing information between the second device and the third device, and perform Bluetooth pairing with the third device.
  • the second device can further share the pairing information obtained by the second device from the first device to other devices, such as the fifth device, so that the fifth device can directly base on the first device
  • the pairing information updates the pairing information list, simplifies the user's operation during the establishment of the Bluetooth connection, and shortens the time required for Bluetooth pairing.
  • a first device in a fourth aspect, includes: a transceiver unit, configured to share the Bluetooth information of the first device and the pairing information of the first device with the second device, so that the second device The Bluetooth information of the first device and the pairing information of the first device are used for Bluetooth pairing with the third device; wherein, the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing between the first device and the third device information.
  • the method for establishing a Bluetooth connection can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
  • the above-mentioned transceiving unit is specifically configured to: share the Bluetooth information of the first device and the pairing information of the first device with the second device according to an operation triggered by a user to share one or more pairing information.
  • the first device may share the Bluetooth information and corresponding pairing information of the first device with the second device according to the user's actual instruction, such as the user selects the specific pairing information to be shared, so as to avoid excessive transmission data caused by sharing all pairing information. Large, redundant data, or issues that are not conducive to user privacy and data security related to device pairing.
  • the above-mentioned transceiver unit is specifically configured to: after the first device establishes a communication connection with the second device, send the Bluetooth information of the first device and the pairing of the first device to the second device through the communication connection information.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
  • the above-mentioned transceiving unit is specifically configured to: send the Bluetooth information of the first device and the pairing information of the first device to the second device through the fourth device.
  • This application does not limit the specific method of sharing pairing information between devices.
  • the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
  • the foregoing fourth device is a cloud-side device.
  • This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
  • the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth.
  • the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
  • a second device in a fifth aspect, includes: a memory for storing a computer program; a transceiver for receiving or sending a radio signal; a processor for executing the computer program, so that the second The device executes the method in any possible implementation manner of the first aspect.
  • a first device includes: a memory for storing a computer program; a transceiver for receiving or sending a radio signal; a processor for executing the computer program, so that the first The device executes the method in any possible implementation manner of the second aspect.
  • a seventh aspect provides a communication system, the communication system includes the second device in any possible implementation manner of the third aspect or the fifth aspect, and any possible implementation manner of the fourth aspect or the sixth aspect in the first device.
  • a computer-readable storage medium is provided, and computer program code is stored on the computer-readable storage medium.
  • the processor implements any one of the first aspect or the second aspect. method in one possible implementation.
  • a chip system the chip system includes a processor, a memory, and computer program code is stored in the memory; when the computer program code is executed by the processor, the processor implements the first aspect or the first aspect.
  • the system-on-a-chip may consist of chips, or may include chips and other discrete devices.
  • a computer program product including computer instructions is provided.
  • the computer instructions When the computer instructions are run on the computer, the computer is made to implement the method in any possible implementation manner of the first aspect or the second aspect.
  • FIG. 1 is a schematic diagram of a conventional bluetooth connection establishment process
  • FIG. 2 is a schematic diagram of a pairing information sharing scenario provided by an embodiment of the present application.
  • FIG. 3 is a schematic diagram of another pairing information sharing scenario provided by the embodiment of the present application.
  • FIG. 4 is a schematic diagram of a hardware structure of a terminal device provided in an embodiment of the present application.
  • FIG. 5A is a flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application
  • FIG. 5B is the first example of pairing information provided by the embodiment of the present application.
  • Figure 5C is Figure 2 of the pairing information example provided by the embodiment of the present application.
  • Figure 5D is the third example of pairing information provided by the embodiment of the present application.
  • FIG. 6 is a logical schematic diagram of storage rules for Bluetooth information and pairing information provided by an embodiment of the present application.
  • FIG. 7 is a block diagram of a bluetooth functional structure of a terminal device provided by an embodiment of the present application.
  • FIG. 8 is an interactive schematic diagram of a method for establishing a Bluetooth connection provided by an embodiment of the present application.
  • FIG. 9 is an interactive flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application.
  • FIG. 10 is a flow chart of another method for establishing a Bluetooth connection provided by an embodiment of the present application.
  • FIG. 11 is a logical schematic diagram of another storage rule for Bluetooth information and pairing information provided by the embodiment of the present application.
  • FIG. 12 is a flow chart of another method for establishing a Bluetooth connection provided in an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a system framework for establishing a Bluetooth connection provided by an embodiment of the present application.
  • first and second are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, “plurality” means two or more.
  • the establishment of a Bluetooth connection needs to be based on device discovery and connection authentication.
  • the device discovery is used for the master device to discover the slave devices that can be connected around.
  • Connection authentication is used to ensure the security of Bluetooth communication.
  • the master device is a device that initiates a Bluetooth connection
  • the slave device is a Bluetooth device that can be discovered by the master device. It can be understood that a master device is relative to a slave device, and a terminal device can be used as a master device to discover a slave device and initiate establishment of a Bluetooth connection, or as a slave device.
  • the master device can detect surrounding bluetooth devices (such as slave devices), and when the slave device is detected, record the information (such as media access control (media access control, MAC) address of the slave device ), and the ID of the detected slave device is displayed.
  • the master device and the slave device perform authentication pairing.
  • the master device and the slave device can be decrypted through negotiation to establish a point-to-point connection.
  • This process is called Bluetooth pairing.
  • the pairing between the master device and the slave device (such as slave device A) can be performed through the following three steps:
  • Step 1 The master device and the slave device exchange authentication requirements and interaction capabilities.
  • the interaction capability is an input/output capability (input/output, I/O) capability.
  • I/O capability determines the subsequent authentication method.
  • the I/O capability is NoInputNoOutput, DisplayOnly, NoInputNoOutput1, DisplayYesNo, KeyboardOnly or KeyboardDisplay.
  • Step 2 The master device and the slave device exchange public keys (public key).
  • the public key (public key) is used for the terminal device to calculate the key.
  • Step 3 The master device and the slave device perform authentication.
  • the master device and the slave device may use the above-mentioned key for authentication based on a security management protocol (secure manager protocol, SMP).
  • SMP secure manager protocol
  • the SMP protocol is used to connect based on the logical link control and adaptation protocol (L2CAP) to realize pairing between the master device and the slave device, password transmission and other operations.
  • L2CAP logical link control and adaptation protocol
  • the master device and the slave device may select a specific authentication method to perform authentication according to the authentication requirements of the peer end and its own authentication capability.
  • both the master device and the slave device support man-in-the-middle (MITM) authentication
  • the master device and the slave device can negotiate to generate serial codes (such as 6 numbers) and display them separately, so that users can compare Then confirm.
  • serial codes displayed by the two devices are consistent, the authentication passes; if the serial codes displayed by the two devices are inconsistent, the authentication fails.
  • one device such as a master device or a slave device
  • randomly generates a serial code such as 6 numbers
  • the other device displays a verification interface so that the user can assist authentication by entering the pairing code.
  • the device can synchronously transmit the pairing code input by the user to the peer device, and the peer device performs verification to achieve the purpose of authentication.
  • the master device and the slave device will perform subsequent pairing; if the authentication of the master device and the slave device fails, the pairing of the master device and the slave device will fail.
  • the user triggers device A to discover the slave device ⁇ the user manually selects the discovered device B ⁇ the user performs connection authentication between device A and device B ⁇ the user triggers device C to discover the slave device ⁇ the user manually selects the discovered device A ⁇ The user authenticates the connection between device A and device C.
  • the above-mentioned conventional method for establishing a Bluetooth connection is more complicated and cumbersome for the user to operate, and the user experience is poor.
  • the embodiment of the present application provides a method for establishing a Bluetooth connection.
  • This method can share pairing information between terminal devices, for example, the first device shares pairing information with the second device.
  • the second device directly establishes a Bluetooth connection with other devices (such as a third device) that have been paired with the first device without pairing.
  • the pairing information includes Bluetooth pairing information between the first device and other devices (such as the third device).
  • the third device Based on the Bluetooth connection establishment method provided by the embodiment of the present application, for the third device, the third device only needs to be paired once (that is, paired with the first device), and other terminal devices (such as the second device) can be paired with the third device without pairing.
  • the third device establishes a Bluetooth connection.
  • the first device may share the pairing information with the second device in a form of near-end sharing.
  • the first device may share the pairing information with a terminal device (such as the second device) that has established a communication connection with the first device.
  • the smart phone and the Bluetooth headset (( a) The device identified as A1) has been paired, and the tablet and the Bluetooth headset are not paired.
  • the smartphone shares the Bluetooth pairing information of the smartphone and the Bluetooth headset to the tablet computer in the form of near-end sharing, as shown in (b) in Figure 2, the paired device list of the tablet computer displays The headset (the device identified as A1 as shown in (b) in Figure 2) has been paired.
  • the first device may share the pairing information with the second device through the fourth device.
  • the fourth device may be a cloud-side device (such as a cloud server), or other terminal devices, which is not limited in this application.
  • the first device as a smart phone
  • the second device as a tablet
  • the third device as a Bluetooth headset
  • the fourth device as a cloud server.
  • the first device and the second device log into the same cloud server account as an example, as shown in the figure
  • the tablet computer and the Bluetooth headset are not paired
  • the smartphone and the Bluetooth headset (the device marked as A1 as shown in Figure 3) have been paired
  • the smartphone synchronizes the Bluetooth pairing information of the smartphone and the Bluetooth headset to the cloud server.
  • the paired device list of the tablet computer shows that the tablet computer and the Bluetooth headset (the device identified as A1 as shown in Figure 3) have been paired .
  • the first device supports sharing the pairing information of one or more devices that have been paired with it to the second device according to the actual needs of the user.
  • the first device supports sharing the pairing information of all devices that have been paired with it to the second device.
  • a smart phone that is, the first device
  • a Bluetooth headset as shown in (a) in Figure 2 and a device identified as A1 in Figure 3
  • a Bluetooth mouse as shown in Figure 2 (a) in (a) and the device identified as A2 shown in Figure 3
  • the smart phone shares the pairing information with the tablet computer (that is, the second device)
  • the smart phone shares the Bluetooth pairing information with the Bluetooth headset
  • the Bluetooth pairing information with the Bluetooth mouse is shared with the tablet computer.
  • the tablet computer (that is, the second device) displays the tablet computer and the Bluetooth headset in the paired device list of the tablet computer according to the pairing information shared by the smartphone (as shown in (b) in Figure 2 and the device identified as A1 in Figure 3 ) and the Bluetooth mouse (as shown in (b) in Figure 2 and the device identified as A2 in Figure 3) have been paired.
  • the terminal device supports Bluetooth communication or has a Bluetooth communication function.
  • a Bluetooth function or module may be integrated in the terminal device.
  • the terminal device can be a smart phone or a tablet computer as shown in Figure 2 or Figure 3, and can also include but not limited to a personal computer (PC), netbook, smart watch, Bluetooth peripherals (such as Bluetooth headsets, Bluetooth mice, etc.) , smart bracelet, phone watch, smart camera, handheld computer, bluetooth speaker, personal digital assistant (personal digital assistant, PDA), portable multimedia player (portable multimedia player, PMP), augmented reality (augmented reality, AR)/virtual Reality (virtual reality, VR) equipment, TV or somatosensory game consoles in human-computer interaction scenes, etc.
  • PC personal computer
  • PDA personal digital assistant
  • PMP portable multimedia player
  • augmented reality augmented reality, AR
  • VR virtual reality
  • This application does not limit the specific functions and structures of the terminal equipment.
  • FIG. 4 takes a smart phone as an example and shows a schematic diagram of a hardware structure of a terminal device provided in an embodiment of the present application.
  • the terminal device may include a processor 410, a memory (comprising an external memory interface 420 and an internal memory 421), a universal serial bus (universal serial bus, USB) interface 430, a charging management module 440, and a power management module 441 , battery 442, antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, audio module 470, speaker 470A, receiver 470B, microphone 470C, earphone jack 470D, sensor module 480, button 490, motor 491, indicator 492 , a camera 493, a display screen 494, and a subscriber identification module (subscriber identification module, SIM) card interface 495, etc.
  • the sensor module 480 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
  • the structure shown in the embodiment of the present invention does not constitute a specific limitation on the terminal device.
  • the terminal device may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components.
  • the illustrated components can be realized in hardware, software or a combination of software and hardware.
  • Processor 410 may include one or more processing units.
  • the processor 410 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a flight controller, Video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor application processor
  • AP application processor
  • modem processor graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • flight controller Video codec
  • digital signal processor digital signal processor
  • DSP digital signal processor
  • baseband processor baseband processor
  • neural network processor neural-network processing unit
  • a memory may also be provided in the processor 410 for storing instructions and data.
  • the memory in processor 410 is a cache memory.
  • the memory may hold instructions or data that the processor 410 has just used or recycled. If the processor 410 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 410 is reduced, thus improving the efficiency of the system.
  • processor 410 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input and output
  • subscriber identity module subscriber identity module
  • SIM subscriber identity module
  • USB universal serial bus
  • the charging management module 440 is configured to receive charging input from the charger.
  • the power management module 441 is used for connecting the battery 442 , the charging management module 440 and the processor 410 .
  • the power management module 441 receives the input of the battery 442 and/or the charging management module 440, and supplies power for the processor 410, the internal memory 421, the display screen 494, the camera 493, and the wireless communication module 460, etc.
  • the wireless communication function of the terminal device can be realized by the antenna 1, the antenna 2, the mobile communication module 450, the wireless communication module 460, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an end device can be used to cover single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas.
  • Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna may be used in conjunction with a tuning switch.
  • the mobile communication module 450 can provide wireless communication solutions including 2G/3G/4G/5G/6G applied on terminal equipment.
  • the mobile communication module 450 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like.
  • the mobile communication module 450 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.
  • the mobile communication module 450 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 .
  • at least part of the functional modules of the mobile communication module 450 may be set in the processor 410 .
  • at least part of the functional modules of the mobile communication module 450 and at least part of the modules of the processor 410 may be set in the same device.
  • a modem processor may include a modulator and a demodulator.
  • the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is passed to the application processor after being processed by the baseband processor.
  • the application processor outputs a sound signal through an audio device (not limited to a speaker 470A, a receiver 470B, etc.), or displays an image or video through a display screen 494 .
  • the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent of the processor 410, and be set in the same device as the mobile communication module 450 or other functional modules.
  • the wireless communication module 460 can provide wireless local area networks (wireless local area networks, WLAN) (such as WiFi network), Bluetooth (Bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 460 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 460 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410 .
  • the wireless communication module 460 can also receive the signal to be transmitted from the processor 410 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the terminal device is coupled to the mobile communication module 450, and the antenna 2 is coupled to the wireless communication module 460, so that the terminal device can communicate with the network and other devices through wireless communication technology.
  • the wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), new wireless (new radio, NR ), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc.
  • GSM global system for mobile communications
  • general packet radio service general packet radio service
  • CDMA code division multiple access
  • CDMA broadband Code division multiple access
  • WCDMA wideband code division multiple access
  • time division code division multiple access time-division code division multiple access
  • LTE long term evolution
  • new wireless new
  • the GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (satellite based augmentation systems, SBAS), etc.
  • GPS global positioning system
  • GLONASS global navigation satellite system
  • Beidou navigation satellite system beidou navigation satellite system
  • BDS Beidou navigation satellite system
  • QZSS quasi-zenith satellite system
  • SBAS satellite based augmentation systems
  • the terminal device realizes the display function through the GPU, the display screen 494, and the application processor.
  • the GPU is a microprocessor for image processing, and is connected to the display screen 494 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 410 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 494 is used to display images, videos and the like.
  • Display 494 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), MiniLED, MicroLED, Micro-OLED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc.
  • the terminal device may include 1 or N display screens 494, where N is a positive integer greater than 1.
  • the terminal device can render interfaces (such as device discovery interface, paired device interface, pairing information sharing interface, etc.) through the GPU, and perform interface display through the display screen 494 .
  • interfaces such as device discovery interface, paired device interface, pairing information sharing interface, etc.
  • the terminal device can realize the shooting function through ISP, camera 493 , video codec, GPU, display screen 494 and application processor.
  • the external memory interface 420 may be used to connect an external memory card, such as a micro (storage card, SD) card, so as to expand the storage capacity of the terminal device.
  • the external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function. Such as saving music, video and other files in the external memory card.
  • the internal memory 421 may be used to store computer-executable program code, which includes instructions.
  • the internal memory 421 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, an application program required by at least one function, and the like.
  • the storage data area can store data and the like created during the use of the terminal device.
  • the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.
  • the processor 410 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 421 and/or instructions stored in the memory provided in the processor.
  • the terminal device may implement an audio function through an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an application processor, and the like. Such as music playback, recording, etc.
  • an audio module 470 a speaker 470A, a receiver 470B, a microphone 470C, an application processor, and the like.
  • the audio module 470 the speaker 470A, the receiver 470B and the microphone 470C, reference may be made to the introduction in conventional technologies.
  • the keys 490 include a power key, a volume key and the like.
  • the key 490 may be a mechanical key. It can also be a touch button.
  • the terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
  • the hardware modules included in the terminal device shown in FIG. 4 are only described as examples, and do not limit the specific structure of the terminal device.
  • the terminal device may also include components such as a keyboard and a mouse.
  • the terminal device may support but not limited to the basic rate (Base rate, BR) Bluetooth protocol, enhanced data rate (enhanced data rate, EDR) Bluetooth protocol or low power consumption Bluetooth (bluetooth low energy, One or more of the BLE) protocols.
  • BR Bluetooth is also called traditional Bluetooth
  • EDR Bluetooth is also called high-speed Bluetooth
  • classic bluetooth is such as BT V1.0 to BT V3.0, wherein BT V1.0 to BT V2.0 are traditional bluetooth, and BT V3.0 is high-speed bluetooth.
  • BLE protocol such as generic attribute profile (generic attribute profile, GATT) protocol, etc.
  • Bluetooth Low Energy Compared with classic Bluetooth, Bluetooth Low Energy (BLE) has faster search and connection speeds and lower energy consumption. Therefore, Bluetooth Low Energy (BLE) is widely used in battery-powered fields such as smart wearable devices (such as smart bracelets, smart watches, etc.), smart home fields (such as smart door locks), vehicle systems, and Bluetooth mouse keyboards.
  • Battery-powered fields such as smart wearable devices (such as smart bracelets, smart watches, etc.), smart home fields (such as smart door locks), vehicle systems, and Bluetooth mouse keyboards.
  • Classic Bluetooth is widely used in Bluetooth phone answering, Bluetooth headsets, Bluetooth speakers and other fields.
  • the terminal device may support either classic Bluetooth or BLE Bluetooth, or may support both classic Bluetooth and BLE Bluetooth.
  • a terminal device that supports only one Bluetooth protocol is also called a single-mode Bluetooth device, and a terminal device that supports both classic Bluetooth and BLE Bluetooth is also called a dual-mode Bluetooth device.
  • Dual-mode Bluetooth devices can switch between BLE Bluetooth mode and classic Bluetooth mode to support both communication with classic Bluetooth devices and low-power Bluetooth devices.
  • a dual-mode Bluetooth device such as a smart phone.
  • FIG. 2 and FIG. 3 The scene shown in FIG. 2 and FIG. 3 will be taken as an example below, and a method for establishing a Bluetooth connection provided by the embodiment of the present application will be specifically introduced through Embodiment 1 and Embodiment 2 in combination with the accompanying drawings.
  • Embodiment 1 of this application assuming that Bluetooth pairing has been performed between the first device and the third device, the first device shares the pairing information of the first device with the second device in the form of near-end sharing, so that the second device Directly establish a Bluetooth connection with other devices (such as a third device) that have been paired with the first device without pairing.
  • a method for establishing a Bluetooth connection may include the following S501-S505:
  • S501 The first device establishes a communication connection with the second device.
  • the communication connection is a near-end communication connection, such as Bluetooth connection, WiFi direct connection, point-to-point (peer-to-peer, P2P) connection, NFC connection, etc., or the first device and the second device access the same wireless local area network,
  • the present application does not limit the specific manner of the communication connection.
  • the master device can detect surrounding slave devices based on the device discovery technology, so as to establish a communication connection with the discovered slave devices. For example, after discovering the second device, the first device may establish a communication connection with the second device in response to a user triggering an operation of establishing a communication connection between the first device and the second device. For another example, after discovering the first device, the second device may establish a communication connection with the first device in response to a user triggering an operation of establishing a communication connection between the first device and the second device.
  • the terminal device may establish a communication connection with the device represented by the input device information based on the device information manually input by the user.
  • the first device receives the identifier of the second device input by the user on the device discovery interface of the first device, and establishes a communication connection with the second device.
  • the identifier of the second device may be a media access control (media access control, MAC) address, an identity number (identity, ID), an international mobile equipment identity (international mobile equipment identity, IMEI) etc. of the second device,
  • MAC media access control
  • ID identity, ID
  • IMEI international mobile equipment identity
  • the terminal device can also establish a communication connection with other devices, such as an NFC connection, by means of touching or approaching.
  • the terminal device may also establish a communication connection with other devices by scanning a device code.
  • the terminal device may also establish a communication connection with other devices by scanning a device code.
  • the first device and the second device may establish a communication connection based on a highly reliable connection establishment mechanism.
  • the first device and the second device may be based on Huawei Establish a communication connection with end-to-end data encryption, by Provides information transmission security protection during device trust and subsequent information sharing (such as Bluetooth information and pairing information).
  • the first device acquires the Bluetooth information of the first device and the pairing information of the first device.
  • the pairing information of the first device includes pairing information of the first device and the third device.
  • the Bluetooth information of the first device may include but not limited to an identifier of the first device, a type of the first device, a Bluetooth type of the first device, and the like.
  • the identifier of the first device is, for example, the MAC address, ID, and IMEI of the first device.
  • the type of the first device includes a Bluetooth peripheral, a terminal device supporting a Bluetooth function, and the like.
  • the Bluetooth type of the first device is used to represent the Bluetooth protocol that the first device can support.
  • the Bluetooth type of the first device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
  • the pairing information of the first device may include the identifier, type, Bluetooth type, pairing key, and the like of the terminal device that has been paired with the first device. For example, assuming that Bluetooth pairing has been performed between the first device and the third device, then the pairing information of the first device includes pairing information of the first device and the third device. Exemplarily, the pairing information of the first device includes the identifier, type, Bluetooth type, pairing keys of the first device and the third device, and the like of the third device that has been paired with the first device. Exemplarily, FIG. 5B shows pairing information of a Bluetooth peripheral device whose Bluetooth type is BLE Bluetooth. FIG. 5C shows pairing information of a Bluetooth peripheral whose Bluetooth type is Classic Bluetooth. FIG. 5D shows related pairing information of a Bluetooth adapter for a smart phone.
  • the first device may acquire pairing information of all terminal devices that have been paired with the first device. For example, if there are multiple terminal devices that have been paired with the first device, then the pairing information of the first device may include identifiers, types, Bluetooth types, pairing keys, etc. of the multiple terminal devices that have been paired with the first device.
  • the first device may acquire pairing information between the first device and one or more other terminal devices according to a user's selection operation. For example, assuming that the user chooses to share the pairing information of the third device that has been paired with the first device, the first device may acquire the pairing information between the first device and the third device according to the user's selection operation.
  • S503 The first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the second device.
  • the second device receives the Bluetooth information of the first device and the pairing information of the first device.
  • the second device may also receive Bluetooth information and pairing information of other devices.
  • the second device may save the received Bluetooth information and pairing information in the device.
  • the second device may store and manage Bluetooth information and pairing information according to a predefined rule.
  • the second device may separately manage the pairing information of each source device according to the source devices (including the first device) of the Bluetooth information and pairing information.
  • the second device has received respective Bluetooth information and pairing information from the first device, ..., the Nth device (N is a positive integer, N>1), wherein the first device and the third device, ..., the i-th device, etc. are successfully paired, and the N-th device is successfully paired with the j-th device, ..., the k-th device, etc., and the second device can logically store and manage the received Bluetooth according to the predefined rules shown in Figure 6. information and pairing information.
  • the second device can determine the source device of the pairing information of the corresponding device according to the Bluetooth information of the first device, the Bluetooth information of the second device, ..., the Bluetooth information of the Nth device, so as to store and manage the pairing information from the device according to different source devices. Pairing information for the source device.
  • the second device adds the information of the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device.
  • the paired device list of the second device includes information of one or more terminal devices successfully paired with the second device, such as device identifiers.
  • the identification of the device such as the device name, device model, ID, MAC address, IMEI, etc., is not limited in this application.
  • the second device adds the information of the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device, for the second device, it has been connected with The third device is successfully paired.
  • the UI interface of the second device may display that the second device and the third device have been paired. For example, as shown in (a) in FIG.
  • the device identified as A1) has completed pairing. So far, the second device can establish a Bluetooth connection with the third device according to the user's operation of establishing a Bluetooth connection between the second device and the third device, as shown in S505 below.
  • S505 In response to the operation of the user triggering the establishment of the Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device.
  • the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as: the user triggers the operation of establishing a Bluetooth connection with the third device on the paired device user interface (user interface, UI) of the second device .
  • the user triggers the operation of establishing a Bluetooth connection with the third device on the paired device user interface (user interface, UI) of the second device .
  • the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as the user clicking the operation of the third device logo on the UI interface of the paired device, selecting (such as clicking, long pressing, mouse pointing, right mouse button, etc.)
  • the operation of selecting the connection option on the corresponding selection interface is not limited in this application, and it depends on the input methods supported by the second device.
  • the second device may determine the Bluetooth type of the terminal device (such as the third device) paired with the first device according to the pairing information. , so as to establish a Bluetooth connection between the second device and the third device based on the corresponding Bluetooth protocol according to the specific Bluetooth type.
  • the Bluetooth type of the terminal device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
  • the second device when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may The pairing information of the third device generates a new Resolving List entry and updates it to the Resolving List of the second device, so that the second device can establish a relationship between the second device and the third device based on the updated Resolving List Bluetooth connection.
  • the second device when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may For the pairing information of the third device, modify the Bluetooth MAC address used by the second device in the module responsible for the Bluetooth service (such as the Bluetooth controller (Controller)) to the Bluetooth MAC address of the first device, so as to successfully establish the relationship between the second device and the first device.
  • the module responsible for the Bluetooth service such as the Bluetooth controller (Controller)
  • the second device can be used in the module responsible for the Bluetooth service
  • the Bluetooth MAC address of the second device is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
  • the second device in order to ensure the convenience of use, after the second device adds the information of the third device to the list of paired devices of the second device, the second device can keep the information of the third device in the list of paired devices , so that there is no need to perform device discovery, device authentication, and device pairing again when there is a need for Bluetooth connection in the future, or to obtain pairing information from other devices and analyze pairing information again, and can directly establish a Bluetooth connection based on the pairing information. For example, an agreed link key (link key) is established with a personal identification number (personal identification number, PIN) for subsequent establishment of a Bluetooth connection.
  • PIN personal identification number
  • the second device in order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and security of device pairing-related data, can delete the Bluetooth information and pairing information received from other devices (including removing the third device from the paired device list of the second device). Or after the trust relationship between the first device and the second device is released, the second device can delete the Bluetooth information and pairing information received from other devices (including deleting the third device from the paired device list of the second device) . Exemplarily, the trust relationship between the first device and the second device is released, such as disconnecting the communication connection between the first device and the second device.
  • the method for establishing a Bluetooth connection may be implemented based on multiple functional units related to establishing a Bluetooth connection in a terminal device.
  • the terminal device may include a Bluetooth unit 710 and a device sharing unit 720 .
  • the Bluetooth unit 710 is responsible for slave device discovery, device authentication, Bluetooth pairing, Bluetooth connection establishment, paired device list management, data transmission, and the like.
  • the architecture of the Bluetooth unit 710 may include a Bluetooth service layer, a Bluetooth protocol stack (that is, implementation code for implementing the Bluetooth protocol) and a Bluetooth controller (Controller) (such as a Bluetooth chip) from top to bottom.
  • the device sharing unit 720 is responsible for reading the pairing information of the terminal device (for example, obtained from the Bluetooth unit 710), establishing a near-end connection, sharing pairing information, synchronizing pairing information, analyzing pairing information, and importing pairing information to the Bluetooth unit 710.
  • the device sharing unit 720 may include a Bluetooth migration device management module and a pairing information storage module.
  • the Bluetooth migration device management module is responsible for reading pairing information, establishing a near-end connection, sharing pairing information, synchronizing pairing information, parsing pairing information, importing pairing information to the Bluetooth unit 710, and the like.
  • the pairing information storage module is used for managing non-local pairing information, etc., for example, saving pairing information shared by other terminal devices.
  • the structure of the Bluetooth unit 710 and the device sharing unit 720 shown in FIG. 7 is only used as a structural example.
  • the embodiment of the present application does not limit the specific structure of the Bluetooth unit 710 and the device sharing unit 720, depending on the specific operating system. .
  • the first device can pair with the third device through the Bluetooth unit 510-1 (such as the Bluetooth service layer).
  • the pairing information between the first device and the third device is stored in the Bluetooth unit 510-1 (such as the Bluetooth service layer) of the first device. Therefore, the device sharing unit 520-1 (such as the migration device management module) of the first device obtains pairing information from the Bluetooth unit 510-1 (such as the Bluetooth service layer).
  • the pairing information includes pairing information of the first device and the third device.
  • the device sharing unit 520-1 (such as the migration device management module) of the first device sends the Bluetooth information and pairing information of the first device to the second device.
  • the second device may hand over the received Bluetooth information and pairing information to the device sharing unit 520-2 (such as the migration device management module) of the second device for processing.
  • the migration device management module of the second device may store the received Bluetooth information and pairing information of the first device in the pairing information storage module. So that the Bluetooth unit 510-2 (such as the Bluetooth service layer) adds the third device to the paired device list of the second device according to the Bluetooth information and pairing information of the first device.
  • a method for establishing a Bluetooth connection may include the following S901-S906, and S907-1 or S907-2:
  • S901 The first device establishes a communication connection with the second device through the migration device management module.
  • the first device or the second device may discover the opposite end based on the device discovery technology, so as to establish a communication connection through the migration device management module.
  • the first device or the second device may establish a communication connection based on the device information of the peer device manually input by the user.
  • the first device and/or the second device may also establish a communication connection by touching, approaching, scanning a device code, and the like.
  • the embodiment of the present application does not limit the specific manner of establishing the communication connection.
  • the first device and the second device may be based on, for example, Huawei Establish a connection establishment mechanism with high reliability, and establish a communication connection with terminal data encryption.
  • the migration device management module of the first device obtains the Bluetooth information of the first device and the pairing information of the first device from the Bluetooth service layer.
  • the pairing information of the first device includes pairing information of the first device and the third device.
  • the user's operation of selecting to share pairing information on the first device is, for example, an operation of the user selecting one or more paired devices on the pairing information sharing UI interface.
  • the first device may acquire and share pairing information of all terminal devices that have been paired with the first device.
  • the first device may support the user to select a specific paired device, so as to obtain and share the pairing information of one or more terminal devices selected by the user and paired with the first device.
  • the first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the second device through the migration device management module.
  • the migration device management module of the second device sends the received Bluetooth information of the first device and pairing information of the first device to the pairing information storage module and the Bluetooth service layer.
  • the migration device management module of the second device may also send the received Bluetooth information and pairing information of other devices to the pairing information storage module and the Bluetooth service layer.
  • the migration device management module of the second device sends the received Bluetooth information and pairing information to the pairing information storage module for storing the received Bluetooth information and pairing information, so that the above information can be used at any time later.
  • the migrating device management module of the second device sends the received Bluetooth information and pairing information to the Bluetooth service layer for subsequent establishment of a Bluetooth connection between the second device and the third device.
  • the pairing information storage module of the second device stores the received Bluetooth information and pairing information according to sources.
  • the Bluetooth service layer of the second device updates the paired device list of the second device according to the Bluetooth information of the first device and the pairing information between the first device and the third device.
  • the second device executes the following S907-1; if the Bluetooth type of the third device is classic Bluetooth, the second device executes the following S907-2:
  • the Bluetooth service layer of the second device updates the second The Resolving List of the device, and establish a Bluetooth connection with the third device.
  • the Bluetooth service layer of the second device modifies the Bluetooth MAC address of the second device to the Bluetooth MAC address of the first device, and communicates with the third device Establish a Bluetooth connection.
  • the Bluetooth service layer of the second device can use the The Bluetooth MAC address in the service module is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
  • the method for establishing a Bluetooth connection provided by the embodiment of the present application, through the near-end sharing of pairing information between devices, can realize the exemption from conventional device discovery, authentication requirements and interaction capabilities exchange between devices, and public key exchange between devices on the terminal device Steps such as authentication and authentication, directly update the paired device list according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing.
  • the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
  • the first device shares pairing information with the second device through the fourth device, so that the second device can directly connect with the second device without pairing.
  • a device is paired with another device (such as a third device) to establish a Bluetooth connection.
  • the fourth device may be a cloud-side device (such as a cloud server), or other terminal devices, which is not limited in this application.
  • a method for establishing a Bluetooth connection may include the following S1001-S1004:
  • the first device sends the Bluetooth information of the first device and the pairing information of the first device to a cloud server (that is, the fourth device).
  • the pairing information of the first device includes pairing information of the first device and the third device.
  • the Bluetooth information of the first device may include but not limited to an identifier of the first device, a type of the first device, a Bluetooth type of the first device, and the like.
  • the identifier of the first device is, for example, the MAC address, ID, and IMEI of the first device.
  • the type of the first device includes a Bluetooth peripheral, a terminal device supporting a Bluetooth function, and the like.
  • the Bluetooth type of the first device is used to represent the Bluetooth protocol that the first device can support.
  • the Bluetooth type of the first device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
  • the pairing information of the first device includes the identifier, type, Bluetooth type, pairing key, and the like of the terminal device paired with the first device. For example, assuming that Bluetooth pairing has been performed between the first device and the third device, then the pairing information of the first device includes pairing information of the first device and the third device.
  • the pairing information of the first device may include the identifier, type, Bluetooth type, pairing keys of the first device and the third device, and the like of the third device that has been paired with the first device.
  • the first device may send the Bluetooth information of the first device and pairing information of all terminal devices that have been paired with the first device to the cloud server (that is, the fourth device). For example, if there are multiple terminal devices that have been paired with the first device, then the pairing information includes identifiers, types, Bluetooth types, pairing keys, etc. of the multiple terminal devices that have been paired with the first device.
  • the first device may send pairing information between the first device and one or more other terminal devices to the cloud server (that is, the fourth device) according to the user's selection operation. For example, assuming that the user selects a third device that has been paired with the first device, the first device may send pairing information between the first device and the third device to the cloud server (ie, the fourth device) according to the user's selection operation.
  • the second device acquires Bluetooth information and pairing information from a cloud server (that is, the fourth device).
  • the second device may acquire Bluetooth information and pairing information from the cloud server (that is, the fourth device) when receiving an operation of turning on the Bluetooth function by the user or an operation of triggering device discovery by the user.
  • the cloud server that is, the fourth device
  • the second device can also obtain the Bluetooth information and pairing information from the cloud server (that is, the fourth device) when it is turned on or periodically.
  • the cloud server (that is, the fourth device) can also actively synchronize the Bluetooth information and pairing information to the second device when the Bluetooth information and/or pairing information is updated, for example, when receiving the Bluetooth information and pairing information from the first device.
  • the present application does not limit the specific triggering manner and triggering timing for the second device to acquire Bluetooth information and pairing information from the cloud server (ie, the fourth device).
  • the cloud server may support only synchronizing Bluetooth information and pairing information to terminal devices that log in with the same account as the first device. That is, in this embodiment of the application, the second device is logged in with the same account as the first device.
  • the above-mentioned account may be an account related to bluetooth connection, may also be a related account such as a mobile phone housekeeper, or may be a related account such as a cloud service, which is not limited in this application.
  • the cloud server (that is, the fourth device) can also save and manage the received Bluetooth information and pairing information.
  • the cloud server (that is, the fourth device) can store and manage the Bluetooth information and pairing information according to the predefined rules.
  • the predefined rules are rules managed by accounts.
  • the cloud server that is, the fourth device
  • the cloud server can separately manage the pairing information corresponding to each account according to the accounts registered by the source devices (including the first device) of the Bluetooth information and pairing information.
  • the second device has received respective Bluetooth information and pairing information (N is a positive integer, N>1) from the first device, ..., the Nth device, wherein the first device is logged in account A, The Nth device has logged in account B, the first device has successfully paired with the third device, ..., the i-th device, etc., the N-th device has successfully paired with the j-th device, ..., the k-th device, etc., and the second device can
  • the received Bluetooth information and pairing information are logically stored and managed according to the predefined rules shown in FIG. 11 .
  • the predefined rules may also be rules managed according to the source of the Bluetooth information and pairing information, for details, refer to the logical schematic diagram of storage rules shown in FIG. 6 .
  • the second device adds the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device.
  • the paired device list of the second device includes information of one or more terminal devices successfully paired with the second device, such as device identifiers.
  • the identification of the device such as the device name, device model, ID, MAC address, IMEI, etc., is not limited in this application.
  • the second device can also save and manage the received Bluetooth information and pairing information.
  • the second device can store and manage Bluetooth information and pairing information by category according to predefined rules.
  • the predefined rules include rules managed according to accounts (as shown in FIG. 11 ), rules managed according to sources of Bluetooth information and pairing information (as shown in FIG. 6 ), and the like.
  • S1004 In response to the operation of the user triggering the establishment of the Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device.
  • the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as: the user triggers the operation of establishing a Bluetooth connection between the second device and the third device on the paired UI interface of the second device.
  • the operation of clicking the third device logo on the device UI interface, selecting (such as clicking, long-pressing, pointing the mouse, right mouse button, etc.) the third device logo and selecting the connection option on the corresponding selection interface, etc., are not limited in this application. Depends on the input methods supported by the second device.
  • the second device may determine the Bluetooth type of the terminal device (such as the third device) paired with the first device according to the pairing information. , so as to establish a Bluetooth connection between the second device and the third device based on the corresponding Bluetooth protocol according to the specific Bluetooth type.
  • the Bluetooth type of the terminal device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
  • the second device when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may The pairing information of the third device generates a new Resolving List entry, and updates it into the Resolving List of the second device, so that the second device establishes a Bluetooth connection between the second device and the third device based on the updated Resolving List.
  • the second device when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may For the pairing information of the third device, modify the Bluetooth MAC address used by the second device in the module responsible for the Bluetooth service (such as the Bluetooth controller (Controller)) to the Bluetooth MAC address of the first device, so as to successfully establish the relationship between the second device and the first device.
  • the module responsible for the Bluetooth service such as the Bluetooth controller (Controller)
  • the second device can be used in the module responsible for the Bluetooth service
  • the Bluetooth MAC address of the second device is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
  • the second device in order to ensure the convenience of use, after the second device adds the third device to the paired device list of the second device, the second device can keep the third device in the paired device list for subsequent When there is a need for a Bluetooth connection, the Bluetooth connection can be established directly based on the pairing information.
  • the second device in order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and security of device pairing-related data, can delete the Bluetooth information and pairing information received from other devices (including removing the third device from the paired device list of the second device). Or after the trust relationship between the first device and the second device is released, the second device can delete the Bluetooth information and pairing information received from other devices (including deleting the third device from the paired device list of the second device) . Exemplarily, the trust relationship between the first device and the second device is released, for example, the second device logs out of the logged-in account.
  • the method for establishing a Bluetooth connection may be implemented based on the functional units related to establishing a Bluetooth connection with the structure shown in FIG. 7 .
  • the first device can pair with the third device through the Bluetooth unit 510-1 (such as the Bluetooth service layer).
  • the pairing information between the first device and the third device is stored in the Bluetooth unit 510-1 (such as the Bluetooth service layer) of the first device. Therefore, the device sharing unit 520-1 (such as the migration device management module) of the first device obtains pairing information from the Bluetooth unit 510-1 (such as the Bluetooth service layer).
  • the first device may send the Bluetooth information and pairing information of the first device to the cloud server (that is, the fourth device) through the device sharing unit 520-1 (such as the migration device management module).
  • the second device can obtain Bluetooth information and pairing information from the cloud server (that is, the fourth device) through the device sharing unit 520-1 (such as the migration device management module), and pass the received Bluetooth information and pairing information to the second device.
  • the Bluetooth service layer of the second device performs processing, such as updating the paired device list of the second device according to the Bluetooth information and pairing information, and enabling the second device in response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device. Establish a Bluetooth connection with a third device.
  • the first device performs pairing information sharing according to the user's choice
  • the cloud server that is, the fourth device
  • the second device share the pairing information according to the Bluetooth information and the source of the pairing information.
  • a method for establishing a Bluetooth connection provided by the embodiment of the present application may include the following S1201-S1204, and the above-mentioned S904-S906, S907-1 or S907-2:
  • the migration device management module of the first device obtains the Bluetooth information of the first device and the pairing information of the first device from the Bluetooth service layer.
  • the pairing information of the first device includes pairing information of the first device and the third device.
  • the first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the cloud server (that is, the fourth device) through the migration device management module.
  • the cloud server may also receive Bluetooth information and pairing information of other devices.
  • the cloud server (that is, the fourth device) stores the received Bluetooth information and pairing information according to the account.
  • the second device obtains the Bluetooth information of the first device and the pairing information of the first device from the cloud server (that is, the fourth device) through the migration device management module.
  • the migration device management module of the second device sends the received Bluetooth information of the first device and pairing information of the first device to the pairing information storage module and the Bluetooth service layer.
  • the pairing information storage module of the second device stores the received Bluetooth information and pairing information according to the account.
  • the Bluetooth service layer of the second device updates the paired device list of the second device according to the Bluetooth information of the first device and the pairing information between the first device and the third device.
  • the second device executes the following S907-1; if the Bluetooth type of the third device is classic Bluetooth, the second device executes the following S907-2:
  • the Bluetooth service layer of the second device updates the second The Resolving List of the device, and establish a Bluetooth connection with the third device.
  • the Bluetooth service layer of the second device modifies the Bluetooth MAC address of the second device to the Bluetooth MAC address of the first device, and communicates with the third device Establish a Bluetooth connection.
  • the Bluetooth service layer of the second device can use the The Bluetooth MAC address in the service module is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
  • the pairing information is shared between devices through the far-field cloud service synchronization capability.
  • the first device can upload the Bluetooth information and pairing information corresponding to the
  • the terminal device of the account (such as the second device) can obtain these information synchronously, so as to avoid the conventional device discovery, authentication requirements and interaction capability exchange between devices, public key exchange and authentication between devices on the second device and other steps, directly update the paired device list according to the obtained pairing information, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing.
  • the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching , making the Bluetooth connection switching process smoother and improving the user experience.
  • the embodiment of the present application does not limit the specific structure of the functional units related to the establishment of the Bluetooth connection in the terminal device.
  • the functional units related to establishing a Bluetooth connection in the terminal device may further include other functional modules, or the functional modules in the functional units related to establishing a Bluetooth connection in the terminal device may also be combined in other ways.
  • the method for establishing a Bluetooth connection provided in the embodiment of the present application may also be implemented based on the functional units related to establishing a Bluetooth connection with the structure shown in FIG. 13 .
  • the terminal device may include a device management unit, a device sharing unit and a Bluetooth unit.
  • the device management unit is used for Bluetooth information and pairing information sharing management, Bluetooth information and pairing information synchronization management, login account (such as Bluetooth connection related account, mobile phone housekeeper account, etc.) management, etc.
  • the Bluetooth unit is responsible for device discovery, device authentication, pairing information synchronization, Bluetooth pairing, Bluetooth connection establishment, paired device list management, data transmission, etc.
  • the bluetooth unit may include a bluetooth service layer, a bluetooth protocol stack (that is, implementation codes for implementing bluetooth protocols) and a bluetooth controller (controller) (such as a bluetooth chip) from top to bottom.
  • the device sharing unit is responsible for establishing a near-end connection, acquiring pairing information, parsing pairing information, importing pairing information to the Bluetooth unit, storing pairing information, and the like.
  • the device sharing unit includes a connection control management module, a local pairing information storage module and a non-local pairing information storage module.
  • the connection control management module is used for establishing a near-end connection, acquiring pairing information, parsing pairing information, importing pairing information to the Bluetooth unit, and the like.
  • the local machine pairing information storage module is responsible for storing the device-related information successfully paired by the local machine based on conventional device discovery, device authentication, and device pairing.
  • the non-local pairing information storage module is used to store the bluetooth information and pairing information obtained from the fourth device (such as a cloud server).
  • the first device can be paired with the third device through the Bluetooth unit 1320-1 (such as the Bluetooth service layer).
  • the Bluetooth unit 1320-1 (such as the Bluetooth service layer) can save the pairing information of the first device and the third device in the local pairing information storage module of the device sharing unit 1330-1 . Therefore, the connection control management module of the first device can obtain the pairing information from the local pairing information storage module, and synchronize the Bluetooth information and pairing information of the first device to the cloud server (that is, the fourth device) through the device management unit 1310-1 .
  • the device management unit 1310-2 of the second device acquires Bluetooth information and pairing information from the cloud server (that is, the fourth device), and hands over the received Bluetooth information and pairing information to the connection control of the device sharing unit 1330-2
  • the management module performs processing, such as storing the Bluetooth information and pairing information in the non-local pairing information storage module, parsing the pairing information, and importing the pairing information into the Bluetooth unit 1320-2.
  • the Bluetooth unit 1320-2 (such as the Bluetooth service layer) can update the paired device list of the second device according to the pairing information, and enable the second device to communicate with the third device in response to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device.
  • the third device establishes a Bluetooth connection.
  • the second device may also Share the bluetooth information and pairing information with other devices according to the user's needs (for example, in the form of near-end sharing, or through far-field cloud service synchronization capability sharing), so that other terminal devices can be exempted from conventional device discovery and device-to-device authentication Steps such as demand and interaction capability exchange, public key exchange and authentication between devices directly update the list of paired devices based on the pairing information shared by the second device. and so on.
  • the method provided in the embodiments of the present application may only support one-time sharing and not support forwarding sharing when sharing pairing information.
  • the first device can share the pairing information of the third device successfully paired after device discovery and authentication with the second device, but the second device cannot share the pairing information with other devices again.
  • the method provided in the embodiment of the present application may only support a preset number of forwardings when sharing pairing information.
  • serial numbers of the above-mentioned processes do not mean the order of execution, and the order of execution of the processes should be determined by their functions and internal logic, and should not be implemented in this application.
  • the implementation of the examples constitutes no limitation.
  • the terminal device includes corresponding hardware structures and/or software modules for performing various functions.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
  • the functional modules of the terminal device can be divided.
  • each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
  • each module in the terminal device may be implemented in the form of software and/or hardware, which is not specifically limited.
  • electronic equipment is presented in the form of functional modules.
  • the "module” here may refer to an application-specific integrated circuit ASIC, a circuit, a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that can provide the above-mentioned functions.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available mediums.
  • the available medium can be a magnetic medium, (such as a floppy disk, a hard disk, etc. , tape), optical media (such as digital video disk (digital video disk, DVD)), or semiconductor media (such as solid state disk (SSD)), etc.
  • the steps of the methods or algorithms described in conjunction with the embodiments of the present application may be implemented in hardware, or may be implemented in a manner in which a processor executes software instructions.
  • the software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium.
  • An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium.
  • the storage medium may also be a component of the processor.
  • the processor and storage medium can be located in the ASIC.
  • the ASIC may be located in the electronic device.
  • the processor and the storage medium may also exist in the terminal device as discrete components.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the technical field of communications. Disclosed are a Bluetooth connection establishment method, device and system, which can simplify an operation of a user during a Bluetooth connection establishment process. In the present application, by means of sharing pairing information between devices, conventional steps such as device discovery, the exchange of authentication requirements and interaction capabilities between the devices, and public key exchange and authentication between the devices can be avoided on a terminal device, and a list of paired devices is directly updated according to pairing information acquired from other terminal devices, thereby simplifying an operation of a user during a Bluetooth connection establishment process and shortening the time required for Bluetooth pairing. In addition, in some scenarios where a user uses a plurality of terminal devices to perform a cross-device service on the basis of Bluetooth technology, the Bluetooth connection establishment method provided in the embodiments of the present application can greatly simplify an operation of a user during Bluetooth connection switching and shorten the time required for Bluetooth switching, such that the Bluetooth connection switching process is smoother, thereby improving the usage experience of the user.

Description

一种蓝牙连接建立方法、设备及系统Method, device and system for establishing a bluetooth connection
本申请要求于2021年12月14日提交国家知识产权局、申请号为202111531867.6、申请名称为“一种蓝牙连接建立方法、设备及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the State Intellectual Property Office on December 14, 2021, with application number 202111531867.6, and application title "A Method, Device, and System for Establishing a Bluetooth Connection", the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请实施例涉及通信技术领域,尤其涉及一种蓝牙连接建立方法、设备及系统。The embodiments of the present application relate to the field of communication technologies, and in particular, to a method, device, and system for establishing a Bluetooth connection.
背景技术Background technique
蓝牙技术是一种支持设备短距离通信的无线电技术。蓝牙技术可以在包括智能手机、无线耳机、笔记本电脑等终端设备之间进行无线信息交换。利用蓝牙技术,能够有效地简化设备之间的通信,使数据传输变得更加迅速高效。Bluetooth technology is a radio technology that enables devices to communicate over short distances. Bluetooth technology enables wireless information exchange between terminal devices including smartphones, wireless headsets, and laptops. The use of Bluetooth technology can effectively simplify the communication between devices and make data transmission more rapid and efficient.
例如,假设用户希望建立设备A与设备B之间的蓝牙连接,用户可以在蓝牙主设备(如设备A)上触发发现周围蓝牙设备(如开启蓝牙功能)。蓝牙主设备通过扫描以发现周围的其他蓝牙设备(如蓝牙从设备)。在扫描完成后,蓝牙主设备显示扫描到的蓝牙从设备。然后,用户通过选中某一蓝牙从设备(如设备B)以进行认证和配对,在成功配对后建立主设备(即设备A)与该从设备(即设备B)之间的蓝牙连接以传输业务数据。其中,在认证时需要用户手动输入配对码或者手动确认。上述方法对于用户来说操作繁琐。For example, assuming that the user wishes to establish a Bluetooth connection between device A and device B, the user can trigger discovery of surrounding Bluetooth devices (such as enabling the Bluetooth function) on the Bluetooth master device (eg, device A). The Bluetooth master device scans to discover other Bluetooth devices (such as Bluetooth slave devices) around it. After the scan is complete, the Bluetooth master device displays the scanned Bluetooth slave devices. Then, the user selects a Bluetooth slave device (such as device B) for authentication and pairing, and establishes a Bluetooth connection between the master device (that is, device A) and the slave device (that is, device B) after successful pairing to transmit services data. Wherein, during the authentication, the user needs to manually input the pairing code or manually confirm it. The above method is cumbersome for the user to operate.
发明内容Contents of the invention
本申请提供一种蓝牙连接建立方法、设备及系统,可以简化蓝牙连接建立过程中用户的操作。The present application provides a method, device and system for establishing a Bluetooth connection, which can simplify user operations in the process of establishing a Bluetooth connection.
为达到上述目的,本申请实施例采用如下技术方案:In order to achieve the above purpose, the embodiment of the present application adopts the following technical solutions:
第一方面,提供一种蓝牙连接建立方法,该方法包括:第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息;第二设备根据第一设备的蓝牙信息和第一设备的配对信息,与第三设备进行蓝牙配对。其中,第一设备与第三设备已完成蓝牙配对,第一设备的配对信息包括第一设备与第三设备的蓝牙配对信息。According to the first aspect, a method for establishing a Bluetooth connection is provided, the method comprising: the second device receives the Bluetooth information of the first device shared by the first device and the pairing information of the first device; the second device receives the Bluetooth information of the first device and the pairing information of the first device The pairing information of the first device is used for Bluetooth pairing with the third device. Wherein, the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
示例性的,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息可以是指第一设备直接向第二设备共享。Exemplarily, the aforementioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may mean that the first device directly shares with the second device.
示例性的,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息还可以是指第一设备通过第三方(如第四设备)向第二设备共享。Exemplarily, the above-mentioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may also mean that the first device shares with the second device through a third party (such as the fourth device).
本申请不限定第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息的具体方式。The present application does not limit the specific manner in which the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device.
上述第一方面提供的方案,设备之间通过共享配对信息,可以实现在终端设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据从其他终端设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备、基于蓝牙技术进行跨设备业务的场景中,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得 蓝牙连接切换过程更加顺畅,提高用户的使用体验。In the solution provided by the first aspect above, by sharing pairing information between devices, it is possible to avoid the steps of conventional device discovery, inter-device authentication requirements and interaction capability exchange, inter-device public key exchange and authentication on the terminal device. , update the paired device list directly according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, in some scenarios where users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
在一种可能的实现方式中,上述第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息,包括:第二设备在与第一设备建立通信连接之后,通过上述通信连接,接收来自第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以基于建立的通信连接共享配对信息,以便设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the second device receiving the Bluetooth information of the first device shared by the first device and the pairing information of the first device includes: after the second device establishes a communication connection with the first device, through the above-mentioned The communication connection is to receive the Bluetooth information from the first device and the pairing information of the first device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息,包括:第二设备接收第四设备发送的第一设备的蓝牙信息和第一设备的配对信息,其中,第一设备的蓝牙信息和第一设备的配对信息是第四设备从第一设备获取的。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过第三方转发配对信息,以便设备可以直接基于第三方转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the second device receiving the Bluetooth information of the first device shared by the first device and the pairing information of the first device includes: the second device receiving the Bluetooth information of the first device sent by the fourth device The pairing information with the first device, wherein the bluetooth information of the first device and the pairing information of the first device are acquired by the fourth device from the first device. This application does not limit the specific method of sharing pairing information between devices. For example, the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第四设备是云侧设备。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过云侧设备转发配对信息,以便设备可以直接基于云侧设备转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the foregoing fourth device is a cloud-side device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第一设备与第三设备的蓝牙配对信息包括第三设备的蓝牙类型;其中,蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。为了便于第二设备根据第三设备的具体蓝牙类型与第三设备配对,第一设备可以在向第二设备共享的蓝牙配对信息中携带第三设备的蓝牙类型。In a possible implementation manner, the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth. In order to facilitate the pairing of the second device with the third device according to the specific Bluetooth type of the third device, the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
在一种可能的实现方式中,上述第二设备根据第一设备的蓝牙信息和第一设备的配对信息,与第三设备进行蓝牙配对,包括:第二设备根据第一设备的蓝牙信息,以及第一设备的配对信息中第三设备的蓝牙类型,基于相对应的蓝牙协议,与第三设备进行蓝牙配对。为了保证蓝牙配对适配于相应蓝牙类型的蓝牙协议,第二设备可以根据第一设备共享的第三设备的具体蓝牙类型与第三设备配对。In a possible implementation manner, the second device performs Bluetooth pairing with the third device according to the Bluetooth information of the first device and the pairing information of the first device, including: the second device according to the Bluetooth information of the first device, and The Bluetooth type of the third device in the pairing information of the first device performs Bluetooth pairing with the third device based on the corresponding Bluetooth protocol. In order to ensure that the Bluetooth pairing is adapted to the Bluetooth protocol of the corresponding Bluetooth type, the second device can be paired with the third device according to the specific Bluetooth type of the third device shared by the first device.
在一种可能的实现方式中,上述方法还包括:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备基于第二设备和第三设备的蓝牙配对,与第三设备建立蓝牙连接。基于本申请提供的设备之间共享配对信息的方案,设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,并且进一步的,基于配对信息建立设备之间的蓝牙连接,该方法可以简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above method further includes: in response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device based on the Bluetooth pairing between the second device and the third device. Establish a Bluetooth connection. Based on the solution for sharing pairing information between devices provided in this application, the device can directly update the list of paired devices based on the pairing information obtained from other devices, and further, establish a Bluetooth connection between devices based on the pairing information. This method can simplify The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,在上述第二设备与第三设备建立蓝牙连接之后,上述方法还包括:第二设备删除第一设备的蓝牙信息,以及第一设备与第三设备的蓝牙配对信息。为了不对第二设备的后续使用造成影响(如占用存储空间等),以及保证用户隐私和设备配对相关数据的安全性,在结束蓝牙连接使用之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设备列表中删除第三设备)。In a possible implementation, after the Bluetooth connection is established between the second device and the third device, the method further includes: the second device deletes the Bluetooth information of the first device, and the Bluetooth pairing between the first device and the third device information. In order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and device pairing-related data security, the second device can delete the Bluetooth received from other devices after ending the use of the Bluetooth connection. information and pairing information (including removing the third device from the paired device list of the second device).
在一种可能的实现方式中,上述方法还包括:第二设备向第五设备共享第二设备的蓝牙信息和第二设备与第三设备的蓝牙配对信息,使得第五设备根据第二设备的蓝牙信息,以及第二设备与第三设备的蓝牙配对信息,与第三设备进行蓝牙配对。进一步的,基于本申请提供的配对信息共享方案,第二设备还可以进一步向其他设备,如第五设备共享第二设备从第一设备获取的配对信息,以便第五设备可以直接基于第一设备的配对信息更新配对信息列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above method further includes: the second device shares the Bluetooth information of the second device and the Bluetooth pairing information between the second device and the third device with the fifth device, so that the fifth device Bluetooth information, and Bluetooth pairing information between the second device and the third device, and perform Bluetooth pairing with the third device. Furthermore, based on the pairing information sharing solution provided in this application, the second device can further share the pairing information obtained by the second device from the first device to other devices, such as the fifth device, so that the fifth device can directly base on the first device The pairing information updates the pairing information list, simplifies the user's operation during the establishment of the Bluetooth connection, and shortens the time required for Bluetooth pairing.
第二方面,提供一种蓝牙连接建立方法,该方法包括:第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,以使第二设备根据第一设备的蓝牙信息和第一设备的配对信息,与第三设备进行蓝牙配对;其中,第一设备与第三设备已完成蓝牙配对,第一设备的配对信息包括第一设备与第三设备的蓝牙配对信息。In a second aspect, a method for establishing a Bluetooth connection is provided, the method comprising: the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, so that the second device and the pairing information of the first device, and perform Bluetooth pairing with the third device; wherein, the first device and the third device have completed the Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
示例性的,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息可以是指第一设备直接向第二设备共享。Exemplarily, the aforementioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may mean that the first device directly shares with the second device.
示例性的,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息还可以是指第一设备通过第三方(如第四设备)向第二设备共享。Exemplarily, the above-mentioned first device sharing the first device's Bluetooth information and the first device's pairing information with the second device may also mean that the first device shares with the second device through a third party (such as the fourth device).
本申请不限定第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息的具体方式。The present application does not limit the specific manner in which the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device.
上述第二方面提供的方案,设备之间通过共享配对信息,可以实现在终端设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据从其他终端设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备、基于蓝牙技术进行跨设备业务的场景中,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得蓝牙连接切换过程更加顺畅,提高用户的使用体验。In the solution provided by the second aspect above, by sharing pairing information between devices, it is possible to avoid the steps of conventional device discovery, inter-device authentication requirements and interaction capability exchange, inter-device public key exchange and authentication on the terminal device. , update the paired device list directly according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, in some scenarios where users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
在一种可能的实现方式中,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:第一设备根据用户触发的、共享一个或多个配对信息的操作,向第二设备共享第一设备的蓝牙信息和第一设备的配对信息。本申请中,第一设备可以根据用户的实际指示,例如用户选择需要共享的具体配对信息,向第二设备共享第一设备的蓝牙信息和相应配对信息,避免共享所有配对信息造成的传输数据过大、存在冗余数据或者不利于用户隐私和设备配对相关数据安全性的问题。In a possible implementation manner, the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: the first device shares one or more pairing information triggered by the user. Operation, sharing the Bluetooth information of the first device and the pairing information of the first device with the second device. In this application, the first device may share the Bluetooth information and corresponding pairing information of the first device with the second device according to the user's actual instruction, such as the user selects the specific pairing information to be shared, so as to avoid excessive transmission data caused by sharing all pairing information. Large, redundant data, or issues that are not conducive to user privacy and data security related to device pairing.
在一种可能的实现方式中,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:第一设备在与第二设备建立通信连接之后,通过通信连接,向第二设备发送第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以基于建立的通信连接共享配对信息,以便设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: after the first device establishes a communication connection with the second device, , sending the Bluetooth information of the first device and the pairing information of the first device to the second device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:第一设备通过第四设备向第二设备发送第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例 性的,设备之间可以通过第三方转发配对信息,以便设备可以直接基于第三方转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned first device sharing the Bluetooth information of the first device and the pairing information of the first device with the second device includes: the first device sends the first device to the second device through the fourth device Bluetooth information and pairing information of the first device. This application does not limit the specific method of sharing pairing information between devices. For example, the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第四设备是云侧设备。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过云侧设备转发配对信息,以便设备可以直接基于云侧设备转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the foregoing fourth device is a cloud-side device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第一设备与第三设备的蓝牙配对信息包括第三设备的蓝牙类型;其中,蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。为了便于第二设备根据第三设备的具体蓝牙类型与第三设备配对,第一设备可以在向第二设备共享的蓝牙配对信息中携带第三设备的蓝牙类型。In a possible implementation manner, the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth. In order to facilitate the pairing of the second device with the third device according to the specific Bluetooth type of the third device, the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
第三方面,提供一种第二设备,该第二设备包括:收发单元,用于接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息;设备分享单元,用于根据第一设备的蓝牙信息和第一设备的配对信息,与第三设备进行蓝牙配对。其中,第一设备与第三设备已完成蓝牙配对,第一设备的配对信息包括第一设备与第三设备的蓝牙配对信息。In a third aspect, a second device is provided, and the second device includes: a transceiver unit configured to receive Bluetooth information of the first device shared by the first device and pairing information of the first device; a device sharing unit configured to The Bluetooth information of a device and the pairing information of the first device are used for Bluetooth pairing with the third device. Wherein, the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing information of the first device and the third device.
上述第三方面提供的方案,设备之间通过共享配对信息,可以实现在终端设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据从其他终端设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备、基于蓝牙技术进行跨设备业务的场景中,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得蓝牙连接切换过程更加顺畅,提高用户的使用体验。In the solution provided by the third aspect above, by sharing pairing information between devices, it is possible to avoid the steps of conventional device discovery, inter-device authentication requirements and interaction capability exchange, inter-device public key exchange and authentication on terminal devices. , update the paired device list directly according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, in some scenarios where users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
在一种可能的实现方式中,上述收发单元具体用于:在第二设备与第一设备建立通信连接之后,通过上述通信连接,接收来自第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以基于建立的通信连接共享配对信息,以便设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned transceiver unit is specifically configured to: receive Bluetooth information from the first device and pairing information of the first device through the above-mentioned communication connection after the second device establishes a communication connection with the first device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述收发单元具体用于:接收第四设备发送的第一设备的蓝牙信息和第一设备的配对信息,其中,第一设备的蓝牙信息和第一设备的配对信息是第四设备从第一设备获取的。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过第三方转发配对信息,以便设备可以直接基于第三方转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned transceiver unit is specifically configured to: receive the Bluetooth information of the first device and the pairing information of the first device sent by the fourth device, wherein the Bluetooth information of the first device and the pairing information of the first device The information is obtained by the fourth device from the first device. This application does not limit the specific method of sharing pairing information between devices. For example, the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第四设备是云侧设备。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过云侧设备转发配对信息,以便设备可以直接基于云侧设备转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the foregoing fourth device is a cloud-side device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第一设备与第三设备的蓝牙配对信息包括第三设备的蓝牙类型;其中,蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。为了便于第二设备根据第三设备的具体蓝牙类型与第三设备配对,第一设备可以在向第二设备共享的蓝牙配对信息中携带第三设备的蓝牙类型。In a possible implementation manner, the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth. In order to facilitate the pairing of the second device with the third device according to the specific Bluetooth type of the third device, the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
在一种可能的实现方式中,上述设备分享单元具体用于,根据第一设备的蓝牙信息,以及第一设备的配对信息中第三设备的蓝牙类型,基于相对应的蓝牙协议,与第三设备进行蓝牙配对。为了保证蓝牙配对适配于相应蓝牙类型的蓝牙协议,第二设备可以根据第一设备共享的第三设备的具体蓝牙类型与第三设备配对In a possible implementation manner, the above-mentioned device sharing unit is specifically configured to, based on the Bluetooth information of the first device and the Bluetooth type of the third device in the pairing information of the first device, based on the corresponding Bluetooth protocol, communicate with the third device. The device performs Bluetooth pairing. In order to ensure that the Bluetooth pairing is adapted to the Bluetooth protocol of the corresponding Bluetooth type, the second device can be paired with the third device according to the specific Bluetooth type of the third device shared by the first device
在一种可能的实现方式中,上述第二设备还包括:蓝牙单元,用于:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,基于第二设备和第三设备的蓝牙配对,与第三设备建立蓝牙连接。基于本申请提供的设备之间共享配对信息的方案,设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,并且进一步的,基于配对信息建立设备之间的蓝牙连接,该方法可以简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned second device further includes: a Bluetooth unit, configured to: respond to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device, based on the Bluetooth pairing between the second device and the third device to establish a Bluetooth connection with the third device. Based on the solution for sharing pairing information between devices provided in this application, the device can directly update the list of paired devices based on the pairing information obtained from other devices, and further, establish a Bluetooth connection between devices based on the pairing information. This method can simplify The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,在上述第二设备与第三设备建立蓝牙连接之后,上述设备分享单元还用于:删除第一设备的蓝牙信息,以及第一设备与第三设备的蓝牙配对信息。为了不对第二设备的后续使用造成影响(如占用存储空间等),以及保证用户隐私和设备配对相关数据的安全性,在结束蓝牙连接使用之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设备列表中删除第三设备)。In a possible implementation manner, after the Bluetooth connection is established between the second device and the third device, the device sharing unit is further configured to: delete the Bluetooth information of the first device, and the Bluetooth pairing between the first device and the third device information. In order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and device pairing-related data security, the second device can delete the Bluetooth received from other devices after ending the use of the Bluetooth connection. information and pairing information (including removing the third device from the paired device list of the second device).
在一种可能的实现方式中,上述收发单元还用于:向第五设备共享第二设备的蓝牙信息和第二设备与第三设备的蓝牙配对信息,使得第五设备根据第二设备的蓝牙信息,以及第二设备与第三设备的蓝牙配对信息,与第三设备进行蓝牙配对。进一步的,基于本申请提供的配对信息共享方案,第二设备还可以进一步向其他设备,如第五设备共享第二设备从第一设备获取的配对信息,以便第五设备可以直接基于第一设备的配对信息更新配对信息列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation, the transceiver unit is further configured to: share the Bluetooth information of the second device and the Bluetooth pairing information between the second device and the third device with the fifth device, so that the fifth device information, and the Bluetooth pairing information between the second device and the third device, and perform Bluetooth pairing with the third device. Furthermore, based on the pairing information sharing solution provided in this application, the second device can further share the pairing information obtained by the second device from the first device to other devices, such as the fifth device, so that the fifth device can directly base on the first device The pairing information updates the pairing information list, simplifies the user's operation during the establishment of the Bluetooth connection, and shortens the time required for Bluetooth pairing.
第四方面,提供一种第一设备,该第一设备包括:收发单元,用于向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,以使第二设备根据第一设备的蓝牙信息和第一设备的配对信息,与第三设备进行蓝牙配对;其中,第一设备与第三设备已完成蓝牙配对,第一设备的配对信息包括第一设备与第三设备的蓝牙配对信息。In a fourth aspect, a first device is provided, the first device includes: a transceiver unit, configured to share the Bluetooth information of the first device and the pairing information of the first device with the second device, so that the second device The Bluetooth information of the first device and the pairing information of the first device are used for Bluetooth pairing with the third device; wherein, the first device and the third device have completed Bluetooth pairing, and the pairing information of the first device includes the Bluetooth pairing between the first device and the third device information.
上述第四方面提供的方案,设备之间通过共享配对信息,可以实现在终端设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据从其他终端设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备、基于蓝牙技术进行跨设备业务的场景中,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得蓝牙连接切换过程更加顺畅,提高用户的使用体验。In the solution provided by the fourth aspect above, by sharing pairing information between devices, it is possible to avoid the steps of conventional device discovery, authentication requirements and interaction capability exchange between devices, public key exchange and authentication between devices on the terminal device. , update the paired device list directly according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, in some scenarios where users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
在一种可能的实现方式中,上述收发单元具体用于:根据用户触发的、共享一个 或多个配对信息的操作,向第二设备共享第一设备的蓝牙信息和第一设备的配对信息。本申请中,第一设备可以根据用户的实际指示,例如用户选择需要共享的具体配对信息,向第二设备共享第一设备的蓝牙信息和相应配对信息,避免共享所有配对信息造成的传输数据过大、存在冗余数据或者不利于用户隐私和设备配对相关数据安全性的问题。In a possible implementation manner, the above-mentioned transceiving unit is specifically configured to: share the Bluetooth information of the first device and the pairing information of the first device with the second device according to an operation triggered by a user to share one or more pairing information. In this application, the first device may share the Bluetooth information and corresponding pairing information of the first device with the second device according to the user's actual instruction, such as the user selects the specific pairing information to be shared, so as to avoid excessive transmission data caused by sharing all pairing information. Large, redundant data, or issues that are not conducive to user privacy and data security related to device pairing.
在一种可能的实现方式中,上述收发单元具体用于:在第一设备与第二设备建立通信连接之后,通过通信连接,向第二设备发送第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以基于建立的通信连接共享配对信息,以便设备可以直接基于从其他设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned transceiver unit is specifically configured to: after the first device establishes a communication connection with the second device, send the Bluetooth information of the first device and the pairing of the first device to the second device through the communication connection information. This application does not limit the specific method of sharing pairing information between devices. For example, devices can share pairing information based on established communication connections, so that devices can directly update the list of paired devices based on pairing information obtained from other devices, simplifying The user's operation during the establishment of the Bluetooth connection shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述收发单元具体用于:通过第四设备向第二设备发送第一设备的蓝牙信息和第一设备的配对信息。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过第三方转发配对信息,以便设备可以直接基于第三方转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the above-mentioned transceiving unit is specifically configured to: send the Bluetooth information of the first device and the pairing information of the first device to the second device through the fourth device. This application does not limit the specific method of sharing pairing information between devices. For example, the pairing information can be forwarded between devices through a third party, so that the device can directly update the list of paired devices based on the pairing information forwarded by the third party, simplifying the establishment of Bluetooth connections The user's operation during the process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第四设备是云侧设备。本申请不限定设备之间共享配对信息的具体方式,示例性的,设备之间可以通过云侧设备转发配对信息,以便设备可以直接基于云侧设备转发的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。In a possible implementation manner, the foregoing fourth device is a cloud-side device. This application does not limit the specific method of sharing pairing information between devices. For example, devices can forward pairing information through cloud-side devices, so that devices can directly update the list of paired devices based on the pairing information forwarded by cloud-side devices, simplifying Bluetooth The user's operation during the connection establishment process shortens the time required for Bluetooth pairing.
在一种可能的实现方式中,上述第一设备与第三设备的蓝牙配对信息包括第三设备的蓝牙类型;其中,蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。为了便于第二设备根据第三设备的具体蓝牙类型与第三设备配对,第一设备可以在向第二设备共享的蓝牙配对信息中携带第三设备的蓝牙类型。In a possible implementation manner, the Bluetooth pairing information of the first device and the third device includes the Bluetooth type of the third device; wherein, the Bluetooth type includes: classic Bluetooth, BLE Bluetooth or dual-mode Bluetooth. In order to facilitate the pairing of the second device with the third device according to the specific Bluetooth type of the third device, the first device may carry the Bluetooth type of the third device in the Bluetooth pairing information shared with the second device.
第五方面,提供一种第二设备,该第二设备包括:存储器,用于存储计算机程序;收发器,用于接收或发送无线电信号;处理器,用于执行所述计算机程序,使得第二设备执行如第一方面任一种可能的实现方式中的方法。In a fifth aspect, a second device is provided, and the second device includes: a memory for storing a computer program; a transceiver for receiving or sending a radio signal; a processor for executing the computer program, so that the second The device executes the method in any possible implementation manner of the first aspect.
第六方面,提供一种第一设备,该第一设备包括:存储器,用于存储计算机程序;收发器,用于接收或发送无线电信号;处理器,用于执行所述计算机程序,使得第一设备执行如第二方面任一种可能的实现方式中的方法。According to a sixth aspect, a first device is provided, and the first device includes: a memory for storing a computer program; a transceiver for receiving or sending a radio signal; a processor for executing the computer program, so that the first The device executes the method in any possible implementation manner of the second aspect.
第七方面,提供一种通信系统,该通信系统包括如第三方面或第五方面任一种可能的实现方式中第二设备,以及如第四方面或第六方面任一种可能的实现方式中第一设备。A seventh aspect provides a communication system, the communication system includes the second device in any possible implementation manner of the third aspect or the fifth aspect, and any possible implementation manner of the fourth aspect or the sixth aspect in the first device.
第八方面,提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序代码,该计算机程序代码被处理器执行时,使得处理器实现如第一方面或第二方面任一种可能的实现方式中的方法。In an eighth aspect, a computer-readable storage medium is provided, and computer program code is stored on the computer-readable storage medium. When the computer program code is executed by a processor, the processor implements any one of the first aspect or the second aspect. method in one possible implementation.
第九方面,提供一种芯片系统,该芯片系统包括处理器、存储器,存储器中存储有计算机程序代码;所述计算机程序代码被所述处理器执行时,使得处理器实现如第一方面或第二方面任一种可能的实现方式中的方法。该芯片系统可以由芯片构成,也 可以包含芯片和其它分立器件。According to the ninth aspect, there is provided a chip system, the chip system includes a processor, a memory, and computer program code is stored in the memory; when the computer program code is executed by the processor, the processor implements the first aspect or the first aspect. A method in any possible implementation of the second aspect. The system-on-a-chip may consist of chips, or may include chips and other discrete devices.
第十方面,提供一种计算机程序产品,该计算机程序产品包括计算机指令。当该计算机指令在计算机上运行时,使得计算机实现如第一方面或第二方面任一种可能的实现方式中的方法。In a tenth aspect, a computer program product including computer instructions is provided. When the computer instructions are run on the computer, the computer is made to implement the method in any possible implementation manner of the first aspect or the second aspect.
附图说明Description of drawings
图1为一种常规的蓝牙连接建立过程示意图;FIG. 1 is a schematic diagram of a conventional bluetooth connection establishment process;
图2为本申请实施例提供的一种配对信息共享场景示意图;FIG. 2 is a schematic diagram of a pairing information sharing scenario provided by an embodiment of the present application;
图3为本申请实施例提供的另一种配对信息共享场景示意图;FIG. 3 is a schematic diagram of another pairing information sharing scenario provided by the embodiment of the present application;
图4为本申请实施例提供的一种终端设备的硬件结构示意图;FIG. 4 is a schematic diagram of a hardware structure of a terminal device provided in an embodiment of the present application;
图5A为本申请实施例提供的一种蓝牙连接建立方法流程图;FIG. 5A is a flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application;
图5B为本申请实施例提供的配对信息示例图一;FIG. 5B is the first example of pairing information provided by the embodiment of the present application;
图5C为本申请实施例提供的配对信息示例图二;Figure 5C is Figure 2 of the pairing information example provided by the embodiment of the present application;
图5D为本申请实施例提供的配对信息示例图三;Figure 5D is the third example of pairing information provided by the embodiment of the present application;
图6为本申请实施例提供的一种蓝牙信息和配对信息存储规则逻辑示意图;FIG. 6 is a logical schematic diagram of storage rules for Bluetooth information and pairing information provided by an embodiment of the present application;
图7为本申请实施例提供的一种终端设备的蓝牙功能结构框图;FIG. 7 is a block diagram of a bluetooth functional structure of a terminal device provided by an embodiment of the present application;
图8为本申请实施例提供的一种蓝牙连接建立方法交互示意图;FIG. 8 is an interactive schematic diagram of a method for establishing a Bluetooth connection provided by an embodiment of the present application;
图9为本申请实施例提供的一种蓝牙连接建立方法交互流程图;FIG. 9 is an interactive flowchart of a method for establishing a Bluetooth connection provided by an embodiment of the present application;
图10为本申请实施例提供的另一种蓝牙连接建立方法流程图;FIG. 10 is a flow chart of another method for establishing a Bluetooth connection provided by an embodiment of the present application;
图11为本申请实施例提供的另一种蓝牙信息和配对信息存储规则逻辑示意图;FIG. 11 is a logical schematic diagram of another storage rule for Bluetooth information and pairing information provided by the embodiment of the present application;
图12为本申请实施例提供的另一种蓝牙连接建立方法流程图;FIG. 12 is a flow chart of another method for establishing a Bluetooth connection provided in an embodiment of the present application;
图13为本申请实施例提供的一种蓝牙连接建立系统框架示意图。FIG. 13 is a schematic diagram of a system framework for establishing a Bluetooth connection provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Among them, in the description of the embodiments of this application, unless otherwise specified, "/" means or means, for example, A/B can mean A or B; "and/or" in this article is only a description of associated objects The association relationship of indicates that there may be three kinds of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of indicated technical features. Thus, a feature defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
我们知道,蓝牙连接的建立需要基于设备发现和连接认证实现。其中,设备发现用于主设备发现周围可连接的从设备。连接认证用于保证蓝牙通信的安全性。We know that the establishment of a Bluetooth connection needs to be based on device discovery and connection authentication. Among them, the device discovery is used for the master device to discover the slave devices that can be connected around. Connection authentication is used to ensure the security of Bluetooth communication.
其中,主设备即发起蓝牙连接的设备,从设备即能够被主设备发现的蓝牙设备。可以理解,主设备与从设备是相对而言的,一个终端设备可以作为主设备发现从设备,以及发起建立蓝牙连接,也可以作为从设备。Wherein, the master device is a device that initiates a Bluetooth connection, and the slave device is a Bluetooth device that can be discovered by the master device. It can be understood that a master device is relative to a slave device, and a terminal device can be used as a master device to discover a slave device and initiate establishment of a Bluetooth connection, or as a slave device.
示例性的,如图1所示,主设备可以检测周围的蓝牙设备(如从设备),在检测到从设备时,记录从设备的信息(如媒体接入控制(media access control,MAC)地址),并显示检测到的从设备的标识。在用户选择与某一从设备(如从设备A)建立 蓝牙连接时,主设备和从设备进行鉴权配对。Exemplarily, as shown in Figure 1, the master device can detect surrounding bluetooth devices (such as slave devices), and when the slave device is detected, record the information (such as media access control (media access control, MAC) address of the slave device ), and the ID of the detected slave device is displayed. When the user chooses to establish a Bluetooth connection with a certain slave device (such as slave device A), the master device and the slave device perform authentication pairing.
其中,主设备和从设备之间可以基于蓝牙技术,通过协商进行解密,以建立点对点连接,这一过程称为蓝牙配对。作为一种示例,如图1所示,主设备和从设备(如从设备A)之间可以通过以下三个步骤进行配对:Among them, based on Bluetooth technology, the master device and the slave device can be decrypted through negotiation to establish a point-to-point connection. This process is called Bluetooth pairing. As an example, as shown in Figure 1, the pairing between the master device and the slave device (such as slave device A) can be performed through the following three steps:
步骤1:主设备和从设备交换鉴权需求(authentication requirements)和交互能力。Step 1: The master device and the slave device exchange authentication requirements and interaction capabilities.
其中,交互能力如输入输出能力(input/output,I/O)能力。I/O能力决定了后续的鉴权方式。示例性的,I/O能力如NoInputNoOutput,DisplayOnly,NoInputNoOutput1,DisplayYesNo,KeyboardOnly或KeyboardDisplay。Wherein, the interaction capability is an input/output capability (input/output, I/O) capability. The I/O capability determines the subsequent authentication method. Exemplarily, the I/O capability is NoInputNoOutput, DisplayOnly, NoInputNoOutput1, DisplayYesNo, KeyboardOnly or KeyboardDisplay.
步骤2:主设备和从设备交换公钥(public key)。Step 2: The master device and the slave device exchange public keys (public key).
其中,公钥(public key)用于终端设备计算密钥。Among them, the public key (public key) is used for the terminal device to calculate the key.
步骤3:主设备和从设备进行鉴权。Step 3: The master device and the slave device perform authentication.
示例性的,主设备和从设备可以基于安全管理协议(secure manager protocol,SMP),使用上述密钥进行鉴权。其中,SMP协议用于基于逻辑链路控制和适配协议(logical link control and adaptation protocol,L2CAP)连接,实现主设备和从设备之间的配对、密码传输等操作。Exemplarily, the master device and the slave device may use the above-mentioned key for authentication based on a security management protocol (secure manager protocol, SMP). Among them, the SMP protocol is used to connect based on the logical link control and adaptation protocol (L2CAP) to realize pairing between the master device and the slave device, password transmission and other operations.
示例性的,主设备和从设备可以根据对端的鉴权需求和自身的鉴权能力选择具体鉴权方式进行鉴权。Exemplarily, the master device and the slave device may select a specific authentication method to perform authentication according to the authentication requirements of the peer end and its own authentication capability.
例如,若主设备和从设备都支持中间人(man-in-the-middle,MITM)鉴权,可以由主设备和从设备自行协商生成序列码(如6个数字)并各自显示,以便用户比较后进行确认,例如若两个设备显示的序列码一致,则鉴权通过;若两个设备显示的序列码不一致,则鉴权失败。或者,一个设备(如主设备或从设备)随机生成序列码(如6个数字),另一个设备显示验证界面,以便用户以输入配对码的方式辅助鉴权,例如若用户输入的配对码与上述序列码一致,则鉴权通过;用户输入的配对码与上述序列码不一致,则鉴权失败。示例性的,在用户输入配对码时,该设备可以将用户输入的配对码同步传输至对端设备,对端设备进行验证,以达到鉴权的目的。For example, if both the master device and the slave device support man-in-the-middle (MITM) authentication, the master device and the slave device can negotiate to generate serial codes (such as 6 numbers) and display them separately, so that users can compare Then confirm. For example, if the serial codes displayed by the two devices are consistent, the authentication passes; if the serial codes displayed by the two devices are inconsistent, the authentication fails. Alternatively, one device (such as a master device or a slave device) randomly generates a serial code (such as 6 numbers), and the other device displays a verification interface so that the user can assist authentication by entering the pairing code. For example, if the pairing code entered by the user is the same as If the above serial codes are consistent, the authentication will pass; if the pairing code input by the user is inconsistent with the above serial codes, the authentication will fail. Exemplarily, when the user inputs the pairing code, the device can synchronously transmit the pairing code input by the user to the peer device, and the peer device performs verification to achieve the purpose of authentication.
若主设备和从设备鉴权成功,则主设备和从设备进行后续配对;若主设备和从设备鉴权失败,则主设备和从设备配对失败。If the authentication of the master device and the slave device is successful, the master device and the slave device will perform subsequent pairing; if the authentication of the master device and the slave device fails, the pairing of the master device and the slave device will fail.
由此可见,常规的蓝牙连接建立方法对于用户来说操作比较复杂和繁琐。It can be seen that the conventional method for establishing a Bluetooth connection is relatively complicated and cumbersome for the user.
并且,随着终端技术的多样化发展,用户使用终端设备的范围从一个终端设备扩展到了多个终端设备。例如,用户可以使用多个终端设备,基于蓝牙技术进行跨设备业务。由此衍生出了蓝牙连接切换等场景下的问题,例如在由设备A发起与设备B建立蓝牙连接,切换为设备C发起与设备A建立蓝牙连接的场景中,对于用户来说,基于常规方法通常需要经过以下几个过程:用户触发设备A发现从设备→用户手动选中发现的设备B→用户进行设备A和设备B的连接认证→用户触发设备C发现从设备→用户手动选中发现的设备A→用户进行设备A和设备C的连接认证。上述常规的蓝牙连接建立方法对于用户来说操作愈加复杂和繁琐,用户体验较差。Moreover, with the diversified development of terminal technologies, the scope of a user's use of a terminal device has expanded from one terminal device to multiple terminal devices. For example, users can use multiple terminal devices to conduct cross-device services based on Bluetooth technology. This leads to problems in scenarios such as Bluetooth connection switching. For example, in the scenario where device A initiates the establishment of a Bluetooth connection with device B, and switches to device C initiating the establishment of a Bluetooth connection with device A, for users, based on conventional methods Usually, the following processes are required: the user triggers device A to discover the slave device → the user manually selects the discovered device B → the user performs connection authentication between device A and device B → the user triggers device C to discover the slave device → the user manually selects the discovered device A → The user authenticates the connection between device A and device C. The above-mentioned conventional method for establishing a Bluetooth connection is more complicated and cumbersome for the user to operate, and the user experience is poor.
为了简化蓝牙连接建立过程中用户的操作,本申请实施例提供一种蓝牙连接建立方法,该方法可以通过终端设备之间配对信息的共享,例如第一设备向第二设备共享配对信息,实现在第二设备上免配对直接和与第一设备已配对的其他设备(如第三设 备)建立蓝牙连接。其中,配对信息包括第一设备与其他设备(如第三设备)的蓝牙配对信息。In order to simplify the user's operation in the process of establishing a Bluetooth connection, the embodiment of the present application provides a method for establishing a Bluetooth connection. This method can share pairing information between terminal devices, for example, the first device shares pairing information with the second device. The second device directly establishes a Bluetooth connection with other devices (such as a third device) that have been paired with the first device without pairing. Wherein, the pairing information includes Bluetooth pairing information between the first device and other devices (such as the third device).
基于本申请实施例提供的蓝牙连接建立方法,对于第三设备来说,第三设备仅需配对一次(即与第一设备配对),其他终端设备(如第二设备)便可以免配对与该第三设备建立蓝牙连接。Based on the Bluetooth connection establishment method provided by the embodiment of the present application, for the third device, the third device only needs to be paired once (that is, paired with the first device), and other terminal devices (such as the second device) can be paired with the third device without pairing. The third device establishes a Bluetooth connection.
作为一种实现方式,第一设备可以以近端分享的形式,将配对信息共享给第二设备。例如,第一设备可以将配对信息共享给与第一设备建立了通信连接的终端设备(如第二设备)。As an implementation manner, the first device may share the pairing information with the second device in a form of near-end sharing. For example, the first device may share the pairing information with a terminal device (such as the second device) that has established a communication connection with the first device.
示例性的,以第一设备是智能手机,第二设备是平板电脑,第三设备是蓝牙耳机为例,如图2中(a)所示,智能手机与蓝牙耳机(如图2中的(a)所示标识为A1的设备)已完成配对,平板电脑与蓝牙耳机未配对。在智能手机将智能手机与蓝牙耳机的蓝牙配对信息以近端分享的形式共享给平板电脑之后,如图2中的(b)所示,平板电脑的已配对的设备列表中显示平板电脑与蓝牙耳机(如图2中的(b)所示标识为A1的设备)已配对。Exemplarily, taking the first device as a smart phone, the second device as a tablet computer, and the third device as a Bluetooth headset as an example, as shown in (a) in FIG. 2 , the smart phone and the Bluetooth headset (( a) The device identified as A1) has been paired, and the tablet and the Bluetooth headset are not paired. After the smartphone shares the Bluetooth pairing information of the smartphone and the Bluetooth headset to the tablet computer in the form of near-end sharing, as shown in (b) in Figure 2, the paired device list of the tablet computer displays The headset (the device identified as A1 as shown in (b) in Figure 2) has been paired.
作为另一种实现方式,第一设备可以通过第四设备将配对信息共享给第二设备。其中,第四设备可以是云侧设备(如云端服务器),也可以是其他终端设备,本申请不限定。As another implementation manner, the first device may share the pairing information with the second device through the fourth device. Wherein, the fourth device may be a cloud-side device (such as a cloud server), or other terminal devices, which is not limited in this application.
示例性的,以第一设备是智能手机,第二设备是平板电脑,第三设备是蓝牙耳机,第四设备是云端服务器,第一设备和第二设备登录同一云端服务器账号为例,如图3所示,平板电脑与蓝牙耳机未配对,智能手机与蓝牙耳机(如图3所示标识为A1的设备)已完成配对,智能手机将智能手机与蓝牙耳机的蓝牙配对信息同步至云端服务器。平板电脑在从云端服务器同步以获取智能手机与蓝牙耳机的蓝牙配对信息之后,在平板电脑的已配对的设备列表中显示平板电脑与蓝牙耳机(如图3所示标识为A1的设备)已配对。As an example, take the first device as a smart phone, the second device as a tablet, the third device as a Bluetooth headset, and the fourth device as a cloud server. The first device and the second device log into the same cloud server account as an example, as shown in the figure As shown in 3, the tablet computer and the Bluetooth headset are not paired, the smartphone and the Bluetooth headset (the device marked as A1 as shown in Figure 3) have been paired, and the smartphone synchronizes the Bluetooth pairing information of the smartphone and the Bluetooth headset to the cloud server. After the tablet computer is synchronized from the cloud server to obtain the Bluetooth pairing information of the smartphone and the Bluetooth headset, the paired device list of the tablet computer shows that the tablet computer and the Bluetooth headset (the device identified as A1 as shown in Figure 3) have been paired .
在本申请一些实施例中,第一设备支持根据用户实际需求,将与其已配对的一个或多个设备的配对信息分享给第二设备。In some embodiments of the present application, the first device supports sharing the pairing information of one or more devices that have been paired with it to the second device according to the actual needs of the user.
在本申请另一些实施例中,第一设备支持将与其已配对的所有设备的配对信息分享给第二设备。In some other embodiments of the present application, the first device supports sharing the pairing information of all devices that have been paired with it to the second device.
以图2和图3所示示例为例,智能手机(即第一设备)与蓝牙耳机(如图2中的(a)和图3所示标识为A1的设备)和蓝牙鼠标(如图2中的(a)和图3所示标识为A2的设备)均已完成配对,在智能手机向平板电脑(即第二设备)共享配对信息时,智能手机将其与蓝牙耳机的蓝牙配对信息,以及与蓝牙鼠标的蓝牙配对信息均共享给平板电脑。平板电脑(即第二设备)根据智能手机共享的配对信息,在平板电脑已配对的设备列表中显示平板电脑与蓝牙耳机(如图2中的(b)和图3所示标识为A1的设备)和蓝牙鼠标(如图2中的(b)和图3所示标识为A2的设备)均已配对。Taking the example shown in Figure 2 and Figure 3 as an example, a smart phone (that is, the first device) and a Bluetooth headset (as shown in (a) in Figure 2 and a device identified as A1 in Figure 3) and a Bluetooth mouse (as shown in Figure 2 (a) in (a) and the device identified as A2 shown in Figure 3) have been paired. When the smart phone shares the pairing information with the tablet computer (that is, the second device), the smart phone shares the Bluetooth pairing information with the Bluetooth headset, And the Bluetooth pairing information with the Bluetooth mouse is shared with the tablet computer. The tablet computer (that is, the second device) displays the tablet computer and the Bluetooth headset in the paired device list of the tablet computer according to the pairing information shared by the smartphone (as shown in (b) in Figure 2 and the device identified as A1 in Figure 3 ) and the Bluetooth mouse (as shown in (b) in Figure 2 and the device identified as A2 in Figure 3) have been paired.
在本申请实施例中,终端设备支持蓝牙通信或者具备蓝牙通信功能。例如,终端设备中可以集成有蓝牙功能或者模块。终端设备可以如图2或图3所示智能手机或平板电脑,还可以包括但不限定于个人计算机(personal computer,PC)、上网本、智能手表、蓝牙外设(如蓝牙耳机、蓝牙鼠标等)、智能手环、电话手表、智能相机、 掌上电脑、蓝牙音箱、个人数字助理(personal digital assistant,PDA)、便携式多媒体播放器(portable multimedia player,PMP)、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、电视机或人机交互场景中的体感游戏机等。本申请对终端设备的具体功能和结构不做限定。In the embodiment of the present application, the terminal device supports Bluetooth communication or has a Bluetooth communication function. For example, a Bluetooth function or module may be integrated in the terminal device. The terminal device can be a smart phone or a tablet computer as shown in Figure 2 or Figure 3, and can also include but not limited to a personal computer (PC), netbook, smart watch, Bluetooth peripherals (such as Bluetooth headsets, Bluetooth mice, etc.) , smart bracelet, phone watch, smart camera, handheld computer, bluetooth speaker, personal digital assistant (personal digital assistant, PDA), portable multimedia player (portable multimedia player, PMP), augmented reality (augmented reality, AR)/virtual Reality (virtual reality, VR) equipment, TV or somatosensory game consoles in human-computer interaction scenes, etc. This application does not limit the specific functions and structures of the terminal equipment.
请参考图4,图4以智能手机为例,示出了本申请实施例提供的一种终端设备的硬件结构示意图。Please refer to FIG. 4 . FIG. 4 takes a smart phone as an example and shows a schematic diagram of a hardware structure of a terminal device provided in an embodiment of the present application.
如图4所示,终端设备可以包括处理器410,存储器(包括外部存储器接口420和内部存储器421),通用串行总线(universal serial bus,USB)接口430,充电管理模块440,电源管理模块441,电池442,天线1,天线2,移动通信模块450,无线通信模块460,音频模块470,扬声器470A,受话器470B,麦克风470C,耳机接口470D,传感器模块480,按键490,马达491,指示器492,摄像头493,显示屏494,以及用户标识模块(subscriber identification module,SIM)卡接口495等。其中传感器模块480可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。As shown in Figure 4, the terminal device may include a processor 410, a memory (comprising an external memory interface 420 and an internal memory 421), a universal serial bus (universal serial bus, USB) interface 430, a charging management module 440, and a power management module 441 , battery 442, antenna 1, antenna 2, mobile communication module 450, wireless communication module 460, audio module 470, speaker 470A, receiver 470B, microphone 470C, earphone jack 470D, sensor module 480, button 490, motor 491, indicator 492 , a camera 493, a display screen 494, and a subscriber identification module (subscriber identification module, SIM) card interface 495, etc. The sensor module 480 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
可以理解的是,本发明实施例示意的结构并不构成对终端设备的具体限定。在本申请另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure shown in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器410可以包括一个或多个处理单元。例如:处理器410可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),飞行控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。 Processor 410 may include one or more processing units. For example: the processor 410 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a flight controller, Video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
处理器410中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器410中的存储器为高速缓冲存储器。该存储器可以保存处理器410刚用过或循环使用的指令或数据。如果处理器410需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器410的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 410 for storing instructions and data. In some embodiments, the memory in processor 410 is a cache memory. The memory may hold instructions or data that the processor 410 has just used or recycled. If the processor 410 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 410 is reduced, thus improving the efficiency of the system.
在一些实施例中,处理器410可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 410 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc.
充电管理模块440用于从充电器接收充电输入。电源管理模块441用于连接电池442,充电管理模块440与处理器410。电源管理模块441接收电池442和/或充电管理模块440的输入,为处理器410,内部存储器421,显示屏494,摄像头493,和无线 通信模块460等供电。The charging management module 440 is configured to receive charging input from the charger. The power management module 441 is used for connecting the battery 442 , the charging management module 440 and the processor 410 . The power management module 441 receives the input of the battery 442 and/or the charging management module 440, and supplies power for the processor 410, the internal memory 421, the display screen 494, the camera 493, and the wireless communication module 460, etc.
终端设备的无线通信功能可以通过天线1,天线2,移动通信模块450,无线通信模块460,调制解调处理器以及基带处理器等实现。The wireless communication function of the terminal device can be realized by the antenna 1, the antenna 2, the mobile communication module 450, the wireless communication module 460, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。终端设备中的每个天线可用于覆盖单个或多个通信频段。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an end device can be used to cover single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块450可以提供应用在终端设备上的包括2G/3G/4G/5G/6G等无线通信的解决方案。移动通信模块450可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块450可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块450还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块450的至少部分功能模块可以被设置于处理器410中。在一些实施例中,移动通信模块450的至少部分功能模块可以与处理器410的至少部分模块被设置在同一个器件中。The mobile communication module 450 can provide wireless communication solutions including 2G/3G/4G/5G/6G applied on terminal equipment. The mobile communication module 450 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 450 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 450 can also amplify the signal modulated by the modem processor, convert it into electromagnetic wave and radiate it through the antenna 1 . In some embodiments, at least part of the functional modules of the mobile communication module 450 may be set in the processor 410 . In some embodiments, at least part of the functional modules of the mobile communication module 450 and at least part of the modules of the processor 410 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频装置(不限于扬声器470A、受话器470B等)输出声音信号,或通过显示屏494显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器410,与移动通信模块450或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 470A, a receiver 470B, etc.), or displays an image or video through a display screen 494 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent of the processor 410, and be set in the same device as the mobile communication module 450 or other functional modules.
无线通信模块460可以提供应用在终端设备上的包括无线局域网(wireless local area networks,WLAN)(如WiFi网络),蓝牙(Bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块460可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块460经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器410。无线通信模块460还可以从处理器410接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 460 can provide wireless local area networks (wireless local area networks, WLAN) (such as WiFi network), Bluetooth (Bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 460 may be one or more devices integrating at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410 . The wireless communication module 460 can also receive the signal to be transmitted from the processor 410 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,终端设备的天线1和移动通信模块450耦合,天线2和无线通信模块460耦合,使得终端设备可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),新无线(new radio,NR),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS), 北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)等。In some embodiments, the antenna 1 of the terminal device is coupled to the mobile communication module 450, and the antenna 2 is coupled to the wireless communication module 460, so that the terminal device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), broadband Code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), new wireless (new radio, NR ), BT, GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a Beidou navigation satellite system (beidou navigation satellite system, BDS), a quasi-zenith satellite system (quasi -zenith satellite system, QZSS) and/or satellite based augmentation systems (satellite based augmentation systems, SBAS), etc.
终端设备通过GPU,显示屏494,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏494和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器410可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The terminal device realizes the display function through the GPU, the display screen 494, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 494 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 410 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏494用于显示图像,视频等。显示屏494包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),MiniLED,MicroLED,Micro-OLED,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,终端设备可以包括1个或N个显示屏494,N为大于1的正整数。The display screen 494 is used to display images, videos and the like. Display 494 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), MiniLED, MicroLED, Micro-OLED, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the terminal device may include 1 or N display screens 494, where N is a positive integer greater than 1.
在本申请实施例中,终端设备可以通过GPU进行界面(如设备发现界面、已配对设备界面、配对信息共享界面等)渲染,通过显示屏494进行界面显示等。In this embodiment of the present application, the terminal device can render interfaces (such as device discovery interface, paired device interface, pairing information sharing interface, etc.) through the GPU, and perform interface display through the display screen 494 .
终端设备可以通过ISP,摄像头493,视频编解码器,GPU,显示屏494以及应用处理器等实现拍摄功能。The terminal device can realize the shooting function through ISP, camera 493 , video codec, GPU, display screen 494 and application processor.
外部存储器接口420可以用于连接外部存储卡,例如微型(micro)存储(storage card,SD)卡,实现扩展终端设备的存储能力。外部存储卡通过外部存储器接口420与处理器410通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 420 may be used to connect an external memory card, such as a micro (storage card, SD) card, so as to expand the storage capacity of the terminal device. The external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function. Such as saving music, video and other files in the external memory card.
内部存储器421可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器421可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序等。存储数据区可存储终端设备使用过程中所创建的数据等。此外,内部存储器421可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器410通过运行存储在内部存储器421的指令,和/或存储在设置于处理器中的存储器的指令,执行终端设备的各种功能应用以及数据处理。The internal memory 421 may be used to store computer-executable program code, which includes instructions. The internal memory 421 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, an application program required by at least one function, and the like. The storage data area can store data and the like created during the use of the terminal device. In addition, the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like. The processor 410 executes various functional applications and data processing of the terminal device by executing instructions stored in the internal memory 421 and/or instructions stored in the memory provided in the processor.
终端设备可以通过音频模块470,扬声器470A,受话器470B,麦克风470C以及应用处理器等实现音频功能。例如音乐播放,录音等。关于音频模块470,扬声器470A,受话器470B和麦克风470C的具体工作原理和作用,可以参考常规技术中的介绍。The terminal device may implement an audio function through an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an application processor, and the like. Such as music playback, recording, etc. For the specific working principles and functions of the audio module 470 , the speaker 470A, the receiver 470B and the microphone 470C, reference may be made to the introduction in conventional technologies.
按键490包括开机键,音量键等。按键490可以是机械按键。也可以是触摸式按键。终端设备可以接收按键输入,产生与终端设备的用户设置以及功能控制有关的键信号输入。The keys 490 include a power key, a volume key and the like. The key 490 may be a mechanical key. It can also be a touch button. The terminal device can receive key input and generate key signal input related to user settings and function control of the terminal device.
需要说明的是,图4所示终端设备包括的硬件模块只是示例性地描述,并不对终端设备的具体结构做出限定。例如,若终端设备是PC,那么终端设备还可以包括键盘、鼠标等部件。It should be noted that the hardware modules included in the terminal device shown in FIG. 4 are only described as examples, and do not limit the specific structure of the terminal device. For example, if the terminal device is a PC, the terminal device may also include components such as a keyboard and a mouse.
其中,在本申请实施例中,即终端设备可以支持但不限于基础率(Base rate,BR) 蓝牙协议、增强数据率(enhanced data rate,EDR)蓝牙协议或低功耗蓝牙(bluetooth low energy,BLE)协议中的一种或多种。其中,BR蓝牙也称传统蓝牙,EDR蓝牙也称高速蓝牙,传统蓝牙和高速蓝牙也称经典蓝牙(classic bluetooth)。示例性的,经典蓝牙如BT V1.0版本~BT V3.0版本,其中BT V1.0版本~BT V2.0版本是传统蓝牙,BT V3.0版本是高速蓝牙。BLE协议如通用属性配置文件(generic attribute profile,GATT)协议等。Wherein, in the embodiment of the present application, the terminal device may support but not limited to the basic rate (Base rate, BR) Bluetooth protocol, enhanced data rate (enhanced data rate, EDR) Bluetooth protocol or low power consumption Bluetooth (bluetooth low energy, One or more of the BLE) protocols. Among them, BR Bluetooth is also called traditional Bluetooth, EDR Bluetooth is also called high-speed Bluetooth, and traditional Bluetooth and high-speed Bluetooth are also called classic bluetooth. Exemplarily, classic bluetooth is such as BT V1.0 to BT V3.0, wherein BT V1.0 to BT V2.0 are traditional bluetooth, and BT V3.0 is high-speed bluetooth. BLE protocol such as generic attribute profile (generic attribute profile, GATT) protocol, etc.
相比于经典蓝牙,低功耗蓝牙(BLE)的搜索、连接速度更快,能耗更低。因此,低功耗蓝牙(BLE)在智能穿戴设备(如智能手环、智能手表等)、智能家居领域(如智能门锁)、车载系统、蓝牙鼠标键盘等电池供电领域应用较广。经典蓝牙在蓝牙电话接听、蓝牙耳机、蓝牙音箱等领域应用较广。Compared with classic Bluetooth, Bluetooth Low Energy (BLE) has faster search and connection speeds and lower energy consumption. Therefore, Bluetooth Low Energy (BLE) is widely used in battery-powered fields such as smart wearable devices (such as smart bracelets, smart watches, etc.), smart home fields (such as smart door locks), vehicle systems, and Bluetooth mouse keyboards. Classic Bluetooth is widely used in Bluetooth phone answering, Bluetooth headsets, Bluetooth speakers and other fields.
需要说明的是,在本申请实施例中,终端设备可以支持经典蓝牙或BLE蓝牙中的任意一种,也可以同时支持经典蓝牙和BLE蓝牙。其中,仅支持一种蓝牙协议的终端设备也被称为单模蓝牙设备,同时支持经典蓝牙和BLE蓝牙的终端设备也被称为双模蓝牙设备。双模蓝牙设备可以通过在BLE蓝牙模式和经典蓝牙模式之间进行切换,以实现既支持和经典蓝牙设备通信,也支持和低功耗蓝牙设备通信。示例性的,双模蓝牙设备如智能手机。It should be noted that, in the embodiment of the present application, the terminal device may support either classic Bluetooth or BLE Bluetooth, or may support both classic Bluetooth and BLE Bluetooth. Among them, a terminal device that supports only one Bluetooth protocol is also called a single-mode Bluetooth device, and a terminal device that supports both classic Bluetooth and BLE Bluetooth is also called a dual-mode Bluetooth device. Dual-mode Bluetooth devices can switch between BLE Bluetooth mode and classic Bluetooth mode to support both communication with classic Bluetooth devices and low-power Bluetooth devices. Exemplarily, a dual-mode Bluetooth device such as a smart phone.
以下将以图2和图3所示场景为例,结合附图,通过实施例1和实施例2,对本申请实施例提供的一种蓝牙连接建立方法进行具体介绍。The scene shown in FIG. 2 and FIG. 3 will be taken as an example below, and a method for establishing a Bluetooth connection provided by the embodiment of the present application will be specifically introduced through Embodiment 1 and Embodiment 2 in combination with the accompanying drawings.
实施例1:Example 1:
在本申请实施例1中,假设第一设备与第三设备之间已进行蓝牙配对,第一设备以近端分享的方式,向第二设备共享第一设备的配对信息,以便在第二设备上免配对直接和与第一设备已配对的其他设备(如第三设备)建立蓝牙连接。In Embodiment 1 of this application, assuming that Bluetooth pairing has been performed between the first device and the third device, the first device shares the pairing information of the first device with the second device in the form of near-end sharing, so that the second device Directly establish a Bluetooth connection with other devices (such as a third device) that have been paired with the first device without pairing.
如图5A所示,本申请实施例提供的一种蓝牙连接建立方法可以包括以下S501-S505:As shown in FIG. 5A, a method for establishing a Bluetooth connection provided by the embodiment of the present application may include the following S501-S505:
S501:第一设备与第二设备建立通信连接。S501: The first device establishes a communication connection with the second device.
示例性的,通信连接如近端通信连接,如蓝牙连接、WiFi直连、点对点(peer-to-peer,P2P)连接、NFC连接等,或者第一设备与第二设备接入同一无线局域网,本申请不限定通信连接的具体方式。Exemplarily, the communication connection is a near-end communication connection, such as Bluetooth connection, WiFi direct connection, point-to-point (peer-to-peer, P2P) connection, NFC connection, etc., or the first device and the second device access the same wireless local area network, The present application does not limit the specific manner of the communication connection.
作为一种可能的实现方式,主设备可以基于设备发现技术检测周围的从设备,从而建立与发现的从设备之间的通信连接。例如,第一设备可以在发现第二设备之后,响应于用户触发建立第一设备与第二设备之间通信连接的操作,与第二设备建立通信连接。又如,第二设备可以在发现第一设备之后,响应于用户触发建立第一设备与第二设备之间通信连接的操作,与第一设备建立通信连接。As a possible implementation manner, the master device can detect surrounding slave devices based on the device discovery technology, so as to establish a communication connection with the discovered slave devices. For example, after discovering the second device, the first device may establish a communication connection with the second device in response to a user triggering an operation of establishing a communication connection between the first device and the second device. For another example, after discovering the first device, the second device may establish a communication connection with the first device in response to a user triggering an operation of establishing a communication connection between the first device and the second device.
作为另一种可能的实现方式,终端设备可以基于用户手动输入的设备信息建立与已输入的设备信息所表征的设备之间的通信连接。例如,第一设备接收用户在第一设备的设备发现界面上输入的第二设备的标识,建立与第二设备之间的通信连接。示例性的,第二设备的标识可以是第二设备的媒体访问控制(media access control,MAC)地址、身份号(identity,ID)、国际移动设备身份码(international mobile equipment identity,IMEI)等,本申请实施例不限定。As another possible implementation manner, the terminal device may establish a communication connection with the device represented by the input device information based on the device information manually input by the user. For example, the first device receives the identifier of the second device input by the user on the device discovery interface of the first device, and establishes a communication connection with the second device. Exemplarily, the identifier of the second device may be a media access control (media access control, MAC) address, an identity number (identity, ID), an international mobile equipment identity (international mobile equipment identity, IMEI) etc. of the second device, The embodiment of this application is not limited.
作为另一种可能的实现方式,终端设备还可以通过碰一碰、靠近等方式,建立与其他设备之间的通信连接,如NFC连接。As another possible implementation manner, the terminal device can also establish a communication connection with other devices, such as an NFC connection, by means of touching or approaching.
作为另一种可能的实现方式,终端设备还可以通过扫描设备码的方式建立与其他设备之间的通信连接。关于终端设备之间建立通信连接的具体方式和过程,可以参考常规技术,本申请实施例不做赘述。As another possible implementation manner, the terminal device may also establish a communication connection with other devices by scanning a device code. For the specific manner and process of establishing a communication connection between terminal devices, reference may be made to conventional technologies, and details are not described in this embodiment of the present application.
在一些实施例中,为了保证通信信息的安全性,第一设备与第二设备可以基于可信度较高的连接建立机制建立通信连接。例如,第一设备与第二设备可以基于华为
Figure PCTCN2022137200-appb-000001
Figure PCTCN2022137200-appb-000002
建立端到端数据加密的通信连接,由
Figure PCTCN2022137200-appb-000003
提供设备信任及后续信息(如蓝牙信息和配对信息)共享过程中的信息传输安全保障。
In some embodiments, in order to ensure the security of communication information, the first device and the second device may establish a communication connection based on a highly reliable connection establishment mechanism. For example, the first device and the second device may be based on Huawei
Figure PCTCN2022137200-appb-000001
Figure PCTCN2022137200-appb-000002
Establish a communication connection with end-to-end data encryption, by
Figure PCTCN2022137200-appb-000003
Provides information transmission security protection during device trust and subsequent information sharing (such as Bluetooth information and pairing information).
S502:第一设备获取第一设备的蓝牙信息和第一设备的配对信息。第一设备的配对信息包括第一设备与第三设备的配对信息。S502: The first device acquires the Bluetooth information of the first device and the pairing information of the first device. The pairing information of the first device includes pairing information of the first device and the third device.
其中,第一设备的蓝牙信息可以包括但不限于第一设备的标识、第一设备的类型、第一设备的蓝牙类型等。第一设备的标识如第一设备的MAC地址、ID、IMEI等。第一设备的类型如蓝牙外设、支持蓝牙功能的终端设备等。第一设备的蓝牙类型用于表征第一设备能够支持的蓝牙协议。第一设备的蓝牙类型如经典蓝牙、BLE蓝牙、双模蓝牙等。Wherein, the Bluetooth information of the first device may include but not limited to an identifier of the first device, a type of the first device, a Bluetooth type of the first device, and the like. The identifier of the first device is, for example, the MAC address, ID, and IMEI of the first device. The type of the first device includes a Bluetooth peripheral, a terminal device supporting a Bluetooth function, and the like. The Bluetooth type of the first device is used to represent the Bluetooth protocol that the first device can support. The Bluetooth type of the first device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
第一设备的配对信息可以包括与第一设备已配对的终端设备的标识、类型、蓝牙类型、配对密钥等。例如,假设第一设备与第三设备之间已进行蓝牙配对,那么第一设备的配对信息包括第一设备与第三设备的配对信息。示例性的,第一设备的配对信息包括与第一设备已配对的第三设备的标识、类型、蓝牙类型、第一设备和第三设备的配对密钥等。示例性的,图5B示出了一种蓝牙类型为BLE蓝牙的蓝牙外设的配对信息。图5C示出了一种蓝牙类型为经典蓝牙的蓝牙外设的配对信息。图5D示出了一种智能手机蓝牙适配器的相关配对信息。The pairing information of the first device may include the identifier, type, Bluetooth type, pairing key, and the like of the terminal device that has been paired with the first device. For example, assuming that Bluetooth pairing has been performed between the first device and the third device, then the pairing information of the first device includes pairing information of the first device and the third device. Exemplarily, the pairing information of the first device includes the identifier, type, Bluetooth type, pairing keys of the first device and the third device, and the like of the third device that has been paired with the first device. Exemplarily, FIG. 5B shows pairing information of a Bluetooth peripheral device whose Bluetooth type is BLE Bluetooth. FIG. 5C shows pairing information of a Bluetooth peripheral whose Bluetooth type is Classic Bluetooth. FIG. 5D shows related pairing information of a Bluetooth adapter for a smart phone.
在一些实施例中,第一设备可以获取与第一设备已配对所有终端设备的配对信息。例如,与第一设备已配对的终端设备包括多个,那么第一设备的配对信息可以包括与第一设备已配对的该多个终端设备的标识、类型、蓝牙类型、配对密钥等。In some embodiments, the first device may acquire pairing information of all terminal devices that have been paired with the first device. For example, if there are multiple terminal devices that have been paired with the first device, then the pairing information of the first device may include identifiers, types, Bluetooth types, pairing keys, etc. of the multiple terminal devices that have been paired with the first device.
在另一些实施例中,第一设备可以根据用户的选择操作,获取第一设备与其它一个或多个终端设备的配对信息。例如,假设用户选择分享与第一设备已配对的第三设备的配对信息,那么第一设备可以根据用户的选择操作,获取第一设备与第三设备的配对信息。In some other embodiments, the first device may acquire pairing information between the first device and one or more other terminal devices according to a user's selection operation. For example, assuming that the user chooses to share the pairing information of the third device that has been paired with the first device, the first device may acquire the pairing information between the first device and the third device according to the user's selection operation.
S503:第一设备向第二设备发送获取的第一设备的蓝牙信息和第一设备的配对信息。相应的,第二设备接收第一设备的蓝牙信息和第一设备的配对信息。S503: The first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the second device. Correspondingly, the second device receives the Bluetooth information of the first device and the pairing information of the first device.
可选的,第二设备还可以接收其他设备的蓝牙信息和配对信息。Optionally, the second device may also receive Bluetooth information and pairing information of other devices.
在一些实施例中,第二设备可以将接收到的蓝牙信息和配对信息保存在本机中。In some embodiments, the second device may save the received Bluetooth information and pairing information in the device.
作为一种可能的实现方式,第二设备可以按照预定义规则,分类存储并管理蓝牙信息和配对信息。示例性的,第二设备可以根据蓝牙信息和配对信息的来源设备(包括第一设备),分别管理每一个来源设备的配对信息。As a possible implementation manner, the second device may store and manage Bluetooth information and pairing information according to a predefined rule. Exemplarily, the second device may separately manage the pairing information of each source device according to the source devices (including the first device) of the Bluetooth information and pairing information.
示例性的,假设第二设备分别从第一设备、……、第N设备接收到了各自的蓝牙信息和配对信息(N为正整数,N>1),其中,第一设备与第三设备、……、第i设 备等均成功配对,第N设备与第j设备、……、第k设备等均成功配对,第二设备可以按照图6所示预定义规则逻辑存储和管理接收到的蓝牙信息和配对信息。例如,第二设备可以根据第一设备的蓝牙信息、第二设备的蓝牙信息、……、第N设备的蓝牙信息确定对应设备的配对信息的来源设备,从而按照不同来源设备存储和管理来自该来源设备的配对信息。Exemplarily, it is assumed that the second device has received respective Bluetooth information and pairing information from the first device, ..., the Nth device (N is a positive integer, N>1), wherein the first device and the third device, ..., the i-th device, etc. are successfully paired, and the N-th device is successfully paired with the j-th device, ..., the k-th device, etc., and the second device can logically store and manage the received Bluetooth according to the predefined rules shown in Figure 6. information and pairing information. For example, the second device can determine the source device of the pairing information of the corresponding device according to the Bluetooth information of the first device, the Bluetooth information of the second device, ..., the Bluetooth information of the Nth device, so as to store and manage the pairing information from the device according to different source devices. Pairing information for the source device.
S504:第二设备根据第一设备的蓝牙信息和第一设备的配对信息,将第三设备的信息加入第二设备的已配对设备列表。S504: The second device adds the information of the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device.
其中,第二设备的已配对设备列表中包括与第二设备成功配对的一个或多个终端设备的信息,如设备标识。其中,设备的标识如设备名称、设备型号、ID、MAC地址、IMEI等,本申请不限定。Wherein, the paired device list of the second device includes information of one or more terminal devices successfully paired with the second device, such as device identifiers. Wherein, the identification of the device, such as the device name, device model, ID, MAC address, IMEI, etc., is not limited in this application.
可以理解,在第二设备根据第一设备的蓝牙信息和第一设备的配对信息,将第三设备的信息加入第二设备的已配对设备列表中之后,对于第二设备而言,其已与第三设备成功配对。此时,第二设备的UI界面中可以显示第二设备与第三设备已配对,例如,如图2中(a)所示,智能手机与蓝牙耳机(如图2中的(a)所示标识为A1的设备)已完成配对。至此,第二设备便可以根据用户建立第二设备与第三设备之间蓝牙连接的操作,使能建立与第三设备之间的蓝牙连接,如以下S505所示。It can be understood that after the second device adds the information of the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device, for the second device, it has been connected with The third device is successfully paired. At this time, the UI interface of the second device may display that the second device and the third device have been paired. For example, as shown in (a) in FIG. The device identified as A1) has completed pairing. So far, the second device can establish a Bluetooth connection with the third device according to the user's operation of establishing a Bluetooth connection between the second device and the third device, as shown in S505 below.
S505:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备与第三设备建立蓝牙连接。S505: In response to the operation of the user triggering the establishment of the Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device.
示例性的,用户触发第二设备与第三设备建立蓝牙连接的操作如:用户在第二设备的已配对设备用户界面(user interface,UI)上,触发的与第三设备建立蓝牙连接的操作。Exemplarily, the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as: the user triggers the operation of establishing a Bluetooth connection with the third device on the paired device user interface (user interface, UI) of the second device .
例如,用户触发第二设备与第三设备建立蓝牙连接的操作如用户在已配对设备UI界面上,点击第三设备标识的操作、选择(如点击、长按、鼠标指向、鼠标右键等)第三设备标识后在相应选择界面上选择连接选项的操作等,本申请不限定,具体视第二设备可支持的输入方式而定。For example, the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as the user clicking the operation of the third device logo on the UI interface of the paired device, selecting (such as clicking, long pressing, mouse pointing, right mouse button, etc.) After the third device is identified, the operation of selecting the connection option on the corresponding selection interface is not limited in this application, and it depends on the input methods supported by the second device.
在一些实施例中,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据配对信息确定与第一设备配对的终端设备(如第三设备)的蓝牙类型,以根据具体蓝牙类型,基于相应蓝牙协议,建立第二设备与第三设备之间的蓝牙连接。其中,终端设备的蓝牙类型如经典蓝牙、BLE蓝牙、双模蓝牙等。In some embodiments, when the user triggers the second device to establish a Bluetooth connection with the third device, the second device may determine the Bluetooth type of the terminal device (such as the third device) paired with the first device according to the pairing information. , so as to establish a Bluetooth connection between the second device and the third device based on the corresponding Bluetooth protocol according to the specific Bluetooth type. Among them, the Bluetooth type of the terminal device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
示例性的,若第三设备的蓝牙类型是BLE蓝牙,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,生成新的解决列表(Resolving List)条目,并更新到第二设备的Resolving List中,以便第二设备基于更新后的Resolving List建立第二设备与第三设备之间的蓝牙连接。Exemplarily, if the Bluetooth type of the third device is BLE Bluetooth, when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may The pairing information of the third device generates a new Resolving List entry and updates it to the Resolving List of the second device, so that the second device can establish a relationship between the second device and the third device based on the updated Resolving List Bluetooth connection.
示例性的,若第三设备的蓝牙类型是经典蓝牙,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,将第二设备用于负责蓝牙业务的模块(如蓝牙控制器(Controller))中的蓝牙MAC地址修改为第一设备的蓝牙MAC地址,以成功建立第二设备与第三设备之间的蓝牙连接。进一步的,在第二设备与第三设备建立蓝牙连 接之后(如蓝牙连接建立成功时,或者蓝牙连接建立成功后预设之间段之后),第二设备可以将用于负责蓝牙业务的模块中的蓝牙MAC地址改回第二设备的蓝牙MAC地址,以避免对第二设备的后续使用造成影响。Exemplarily, if the Bluetooth type of the third device is classic Bluetooth, when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may For the pairing information of the third device, modify the Bluetooth MAC address used by the second device in the module responsible for the Bluetooth service (such as the Bluetooth controller (Controller)) to the Bluetooth MAC address of the first device, so as to successfully establish the relationship between the second device and the first device. Bluetooth connection between three devices. Further, after the second device establishes a Bluetooth connection with the third device (such as when the Bluetooth connection is successfully established, or after the preset interval after the Bluetooth connection is successfully established), the second device can be used in the module responsible for the Bluetooth service The Bluetooth MAC address of the second device is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
在一些实施例中,为了保证使用的方便性,在第二设备将第三设备的信息加入第二设备的已配对设备列表之后,第二设备可以将第三设备的信息保留在已配对设备列表中,以便后续有蓝牙连接需求时无需再次进行设备发现、设备认证和设备配对,或者再次从其他设备获取配对信息以及解析配对信息等,可以直接基于该配对信息建立蓝牙连接。例如,以个人识别号码(personal identification number,PIN)建立约定的链路密钥(link key),以用于后续蓝牙连接的建立。In some embodiments, in order to ensure the convenience of use, after the second device adds the information of the third device to the list of paired devices of the second device, the second device can keep the information of the third device in the list of paired devices , so that there is no need to perform device discovery, device authentication, and device pairing again when there is a need for Bluetooth connection in the future, or to obtain pairing information from other devices and analyze pairing information again, and can directly establish a Bluetooth connection based on the pairing information. For example, an agreed link key (link key) is established with a personal identification number (personal identification number, PIN) for subsequent establishment of a Bluetooth connection.
在另一些实施例中,为了不对第二设备的后续使用造成影响(如占用存储空间等),以及保证用户隐私和设备配对相关数据的安全性,在结束蓝牙连接使用之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设备列表中删除第三设备)。或者在第一设备与第二设备之间的信任关系解除之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设备列表中删除第三设备)。示例性的,第一设备与第二设备之间的信任关系解除如第一设备与第二设备断开通信连接。In some other embodiments, in order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and security of device pairing-related data, the second device can delete the Bluetooth information and pairing information received from other devices (including removing the third device from the paired device list of the second device). Or after the trust relationship between the first device and the second device is released, the second device can delete the Bluetooth information and pairing information received from other devices (including deleting the third device from the paired device list of the second device) . Exemplarily, the trust relationship between the first device and the second device is released, such as disconnecting the communication connection between the first device and the second device.
作为一种示例,本申请实施例提供的蓝牙连接建立方法可以基于终端设备中的多个蓝牙连接建立相关功能单元实现。示例性的,如图7所示,终端设备可以包括蓝牙单元710和设备分享单元720。As an example, the method for establishing a Bluetooth connection provided in the embodiment of the present application may be implemented based on multiple functional units related to establishing a Bluetooth connection in a terminal device. Exemplarily, as shown in FIG. 7 , the terminal device may include a Bluetooth unit 710 and a device sharing unit 720 .
其中,蓝牙单元710用于负责从设备发现、设备认证、蓝牙配对、蓝牙连接建立、已配对设备列表管理、数据传输等。如图7所示,蓝牙单元710的架构自上而下可以包括蓝牙服务层、蓝牙协议栈(即实现蓝牙协议的实现代码)和蓝牙控制器(Controller)(如蓝牙芯片)。Among them, the Bluetooth unit 710 is responsible for slave device discovery, device authentication, Bluetooth pairing, Bluetooth connection establishment, paired device list management, data transmission, and the like. As shown in FIG. 7 , the architecture of the Bluetooth unit 710 may include a Bluetooth service layer, a Bluetooth protocol stack (that is, implementation code for implementing the Bluetooth protocol) and a Bluetooth controller (Controller) (such as a Bluetooth chip) from top to bottom.
设备分享单元720用于负责读取终端设备的配对信息(例如从蓝牙单元710获取)、建立近端连接、配对信息分享、配对信息同步、配对信息解析、向蓝牙单元710导入配对信息等。如图7所示,设备分享单元720可以包括蓝牙迁移设备管理模块和配对信息存储模块。其中,蓝牙迁移设备管理模块用于负责配对信息读取、近端连接建立、配对信息分享、配对信息同步、配对信息解析、配对信息向蓝牙单元710的导入等。配对信息存储模块用于负责管理非本机配对信息等,例如保存其他终端设备分享的配对信息。The device sharing unit 720 is responsible for reading the pairing information of the terminal device (for example, obtained from the Bluetooth unit 710), establishing a near-end connection, sharing pairing information, synchronizing pairing information, analyzing pairing information, and importing pairing information to the Bluetooth unit 710. As shown in FIG. 7 , the device sharing unit 720 may include a Bluetooth migration device management module and a pairing information storage module. Among them, the Bluetooth migration device management module is responsible for reading pairing information, establishing a near-end connection, sharing pairing information, synchronizing pairing information, parsing pairing information, importing pairing information to the Bluetooth unit 710, and the like. The pairing information storage module is used for managing non-local pairing information, etc., for example, saving pairing information shared by other terminal devices.
需要说明的是,图7所示蓝牙单元710和设备分享单元720的架构仅作为一种结构示例,本申请实施例不限定蓝牙单元710和设备分享单元720的具体架构,视具体操作系统而定。It should be noted that the structure of the Bluetooth unit 710 and the device sharing unit 720 shown in FIG. 7 is only used as a structural example. The embodiment of the present application does not limit the specific structure of the Bluetooth unit 710 and the device sharing unit 720, depending on the specific operating system. .
以第一设备和第二设备的蓝牙功能结构如图7所示结构为例,如图8所示,第一设备可以通过蓝牙单元510-1(如蓝牙服务层)与第三设备进行配对。在第一设备与第三设备成功配对之后,第一设备的蓝牙单元510-1(如蓝牙服务层)中保存有第一设备与第三设备的配对信息。因此,第一设备的设备分享单元520-1(如迁移设备管理模块)从蓝牙单元510-1(如蓝牙服务层)获取配对信息。其中,配对信息中包括第一设备与第三设备的配对信息。Taking the Bluetooth functional structure of the first device and the second device as shown in FIG. 7 as an example, as shown in FIG. 8 , the first device can pair with the third device through the Bluetooth unit 510-1 (such as the Bluetooth service layer). After the first device is successfully paired with the third device, the pairing information between the first device and the third device is stored in the Bluetooth unit 510-1 (such as the Bluetooth service layer) of the first device. Therefore, the device sharing unit 520-1 (such as the migration device management module) of the first device obtains pairing information from the Bluetooth unit 510-1 (such as the Bluetooth service layer). Wherein, the pairing information includes pairing information of the first device and the third device.
进一步的,如图8所示,第一设备的设备分享单元520-1(如迁移设备管理模块)向第二设备发送第一设备的蓝牙信息和配对信息。对应的,第二设备可以将接收到的蓝牙信息和配对信息交由第二设备的设备分享单元520-2(如迁移设备管理模块)处理。例如,第二设备的迁移设备管理模块可以将接收到的第一设备的蓝牙信息和配对信息存储在配对信息存储模块中。以便蓝牙单元510-2(如蓝牙服务层)根据第一设备的蓝牙信息和配对信息,将第三设备加入第二设备的已配对设备列表中。Further, as shown in FIG. 8, the device sharing unit 520-1 (such as the migration device management module) of the first device sends the Bluetooth information and pairing information of the first device to the second device. Correspondingly, the second device may hand over the received Bluetooth information and pairing information to the device sharing unit 520-2 (such as the migration device management module) of the second device for processing. For example, the migration device management module of the second device may store the received Bluetooth information and pairing information of the first device in the pairing information storage module. So that the Bluetooth unit 510-2 (such as the Bluetooth service layer) adds the third device to the paired device list of the second device according to the Bluetooth information and pairing information of the first device.
以第一设备和第二设备的蓝牙功能结构如图7所示结构,第一设备根据用户的选择进行配对信息分享,第二设备根据蓝牙信息和配对信息的来源管理配对信息为例,如图9所示,本申请实施例提供的一种蓝牙连接建立方法可以包括以下S901-S906,以及S907-1或者S907-2:Taking the Bluetooth function structure of the first device and the second device as shown in Figure 7, the first device performs pairing information sharing according to the user's choice, and the second device manages the pairing information according to the source of the Bluetooth information and pairing information, as shown in the figure As shown in 9, a method for establishing a Bluetooth connection provided in the embodiment of the present application may include the following S901-S906, and S907-1 or S907-2:
S901:第一设备与第二设备通过迁移设备管理模块建立通信连接。S901: The first device establishes a communication connection with the second device through the migration device management module.
示例性的,第一设备或者第二设备可以基于设备发现技术发现对端,从而通过迁移设备管理模块建立通信连接。或者,第一设备或者第二设备可以基于用户手动输入的对端设备的设备信息建立通信连接。或者,第一设备和/或第二设备还可以通过碰一碰、靠近、扫描设备码等方式建立通信连接。本申请实施例不限定通信连接建立的具体方式。Exemplarily, the first device or the second device may discover the opposite end based on the device discovery technology, so as to establish a communication connection through the migration device management module. Alternatively, the first device or the second device may establish a communication connection based on the device information of the peer device manually input by the user. Alternatively, the first device and/or the second device may also establish a communication connection by touching, approaching, scanning a device code, and the like. The embodiment of the present application does not limit the specific manner of establishing the communication connection.
为了保证通信信息的安全性,在一些实施例中,第一设备与第二设备可以基于例如华为
Figure PCTCN2022137200-appb-000004
等可信度较高的连接建立机制,建立端数据加密的通信连接。
In order to ensure the security of communication information, in some embodiments, the first device and the second device may be based on, for example, Huawei
Figure PCTCN2022137200-appb-000004
Establish a connection establishment mechanism with high reliability, and establish a communication connection with terminal data encryption.
S902:响应于用户在第一设备上选择共享配对信息的操作,第一设备的迁移设备管理模块从蓝牙服务层获取第一设备的蓝牙信息和第一设备的配对信息。第一设备的配对信息包括第一设备与第三设备的配对信息。S902: In response to the user's operation of selecting to share pairing information on the first device, the migration device management module of the first device obtains the Bluetooth information of the first device and the pairing information of the first device from the Bluetooth service layer. The pairing information of the first device includes pairing information of the first device and the third device.
其中,用户在第一设备上选择共享配对信息的操作如:用户在配对信息共享UI界面上,选择一个或多个已配对设备的操作。Wherein, the user's operation of selecting to share pairing information on the first device is, for example, an operation of the user selecting one or more paired devices on the pairing information sharing UI interface.
在一些实施例中,第一设备可以获取并共享与第一设备已配对的所有终端设备的配对信息。In some embodiments, the first device may acquire and share pairing information of all terminal devices that have been paired with the first device.
在另一些实施例中,第一设备可以支持用户选择具体的已配对设备,以获取并共享用户选中的、且与第一设备已配对的一个或多个终端设备的配对信息。In some other embodiments, the first device may support the user to select a specific paired device, so as to obtain and share the pairing information of one or more terminal devices selected by the user and paired with the first device.
S903:第一设备通过迁移设备管理模块向第二设备发送获取的第一设备的蓝牙信息和第一设备的配对信息。S903: The first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the second device through the migration device management module.
S904:第二设备的迁移设备管理模块将接收到的第一设备的蓝牙信息和第一设备的配对信息发送给配对信息存储模块和蓝牙服务层。S904: The migration device management module of the second device sends the received Bluetooth information of the first device and pairing information of the first device to the pairing information storage module and the Bluetooth service layer.
可选的,第二设备的迁移设备管理模块也可以将接收到的其它设备的蓝牙信息和配对信息发送给配对信息存储模块和蓝牙服务层。Optionally, the migration device management module of the second device may also send the received Bluetooth information and pairing information of other devices to the pairing information storage module and the Bluetooth service layer.
其中,第二设备的迁移设备管理模块将接收到的蓝牙信息和配对信息发送给配对信息存储模块用于保存接收到的蓝牙信息和配对信息,以便后续可以随时使用上述信息。第二设备的迁移设备管理模块将接收到的蓝牙信息和配对信息发送给蓝牙服务层,用于后续第二设备与第三设备建立蓝牙连接。Wherein, the migration device management module of the second device sends the received Bluetooth information and pairing information to the pairing information storage module for storing the received Bluetooth information and pairing information, so that the above information can be used at any time later. The migrating device management module of the second device sends the received Bluetooth information and pairing information to the Bluetooth service layer for subsequent establishment of a Bluetooth connection between the second device and the third device.
S905:第二设备的配对信息存储模块按照来源存储接收到的蓝牙信息和配对信息。S905: The pairing information storage module of the second device stores the received Bluetooth information and pairing information according to sources.
S906:第二设备的蓝牙服务层根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,更新第二设备的已配对设备列表。S906: The Bluetooth service layer of the second device updates the paired device list of the second device according to the Bluetooth information of the first device and the pairing information between the first device and the third device.
若第三设备的蓝牙类型是BLE蓝牙,第二设备执行以下S907-1;若三设备的蓝牙类型是经典蓝牙,第二设备执行以下S907-2:If the Bluetooth type of the third device is BLE Bluetooth, the second device executes the following S907-1; if the Bluetooth type of the third device is classic Bluetooth, the second device executes the following S907-2:
S907-1:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备的蓝牙服务层根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,更新第二设备的Resolving List,与第三设备建立蓝牙连接。S907-1: In response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device, the Bluetooth service layer of the second device updates the second The Resolving List of the device, and establish a Bluetooth connection with the third device.
S907-2:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备的蓝牙服务层将第二设备的蓝牙MAC地址修改为第一设备的蓝牙MAC地址,与第三设备建立蓝牙连接。S907-2: In response to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the Bluetooth service layer of the second device modifies the Bluetooth MAC address of the second device to the Bluetooth MAC address of the first device, and communicates with the third device Establish a Bluetooth connection.
进一步的,在第二设备与第三设备建立蓝牙连接之后(如蓝牙连接建立成功时,或者蓝牙连接建立成功后预设之间段之后),第二设备的蓝牙服务层可以将用于负责蓝牙业务的模块中的蓝牙MAC地址改回第二设备的蓝牙MAC地址,以避免对第二设备的后续使用造成影响。Further, after the second device establishes a Bluetooth connection with the third device (such as when the Bluetooth connection is successfully established, or after a preset interval after the Bluetooth connection is successfully established), the Bluetooth service layer of the second device can use the The Bluetooth MAC address in the service module is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
本申请实施例提供的蓝牙连接建立方法,设备之间通过近端共享配对信息,可以实现在终端设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据从其他终端设备获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备、基于蓝牙技术进行跨设备业务的场景中,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得蓝牙连接切换过程更加顺畅,提高用户的使用体验。The method for establishing a Bluetooth connection provided by the embodiment of the present application, through the near-end sharing of pairing information between devices, can realize the exemption from conventional device discovery, authentication requirements and interaction capabilities exchange between devices, and public key exchange between devices on the terminal device Steps such as authentication and authentication, directly update the paired device list according to the pairing information obtained from other terminal devices, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, in some scenarios where users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching. time, making the Bluetooth connection switching process smoother and improving the user experience.
实施例2:Example 2:
在本申请实施例2中,假设第一设备与第三设备之间已进行蓝牙配对,第一设备通过第四设备向第二设备共享配对信息,以便在第二设备上免配对直接和与第一设备已配对的其他设备(如第三设备)建立蓝牙连接。其中,第四设备可以是云侧设备(如云端服务器),也可以是其他终端设备,本申请不限定。In Embodiment 2 of the present application, assuming that Bluetooth pairing has been performed between the first device and the third device, the first device shares pairing information with the second device through the fourth device, so that the second device can directly connect with the second device without pairing. A device is paired with another device (such as a third device) to establish a Bluetooth connection. Wherein, the fourth device may be a cloud-side device (such as a cloud server), or other terminal devices, which is not limited in this application.
以第四设备是云端服务器为例,如图10所示,本申请实施例提供的一种蓝牙连接建立方法可以包括以下S1001-S1004:Taking the fourth device being a cloud server as an example, as shown in FIG. 10 , a method for establishing a Bluetooth connection provided by the embodiment of the present application may include the following S1001-S1004:
S1001:第一设备向云端服务器(即第四设备)发送第一设备的蓝牙信息和第一设备的配对信息。第一设备的配对信息包括第一设备与第三设备的配对信息。S1001: The first device sends the Bluetooth information of the first device and the pairing information of the first device to a cloud server (that is, the fourth device). The pairing information of the first device includes pairing information of the first device and the third device.
其中,第一设备的蓝牙信息可以包括但不限于第一设备的标识、第一设备的类型、第一设备的蓝牙类型等。第一设备的标识如第一设备的MAC地址、ID、IMEI等。第一设备的类型如蓝牙外设、支持蓝牙功能的终端设备等。第一设备的蓝牙类型用于表征第一设备能够支持的蓝牙协议。第一设备的蓝牙类型如经典蓝牙、BLE蓝牙、双模蓝牙等。Wherein, the Bluetooth information of the first device may include but not limited to an identifier of the first device, a type of the first device, a Bluetooth type of the first device, and the like. The identifier of the first device is, for example, the MAC address, ID, and IMEI of the first device. The type of the first device includes a Bluetooth peripheral, a terminal device supporting a Bluetooth function, and the like. The Bluetooth type of the first device is used to represent the Bluetooth protocol that the first device can support. The Bluetooth type of the first device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
第一设备的配对信息包括与第一设备已配对的终端设备的标识、类型、蓝牙类型、配对密钥等。例如,假设第一设备与第三设备之间已进行蓝牙配对,那么第一设备的配对信息包括第一设备与第三设备的配对信息。示例性的,第一设备的配对信息可以包括与第一设备已配对的第三设备的标识、类型、蓝牙类型、第一设备和第三设备的 配对密钥等。The pairing information of the first device includes the identifier, type, Bluetooth type, pairing key, and the like of the terminal device paired with the first device. For example, assuming that Bluetooth pairing has been performed between the first device and the third device, then the pairing information of the first device includes pairing information of the first device and the third device. Exemplarily, the pairing information of the first device may include the identifier, type, Bluetooth type, pairing keys of the first device and the third device, and the like of the third device that has been paired with the first device.
在一些实施例中,第一设备可以向云端服务器(即第四设备)发送第一设备的蓝牙信息,以及与第一设备已配对所有终端设备的配对信息。例如,与第一设备已配对的终端设备包括多个,那么配对信息包括与第一设备已配对的该多个终端设备的标识、类型、蓝牙类型、配对密钥等。In some embodiments, the first device may send the Bluetooth information of the first device and pairing information of all terminal devices that have been paired with the first device to the cloud server (that is, the fourth device). For example, if there are multiple terminal devices that have been paired with the first device, then the pairing information includes identifiers, types, Bluetooth types, pairing keys, etc. of the multiple terminal devices that have been paired with the first device.
在另一些实施例中,第一设备可以根据用户的选择操作,向云端服务器(即第四设备)发送第一设备与其它一个或多个终端设备的配对信息。例如,假设用户选择了与第一设备已配对的第三设备,那么第一设备可以根据用户的选择操作,向云端服务器(即第四设备)发送第一设备与第三设备的配对信息。In some other embodiments, the first device may send pairing information between the first device and one or more other terminal devices to the cloud server (that is, the fourth device) according to the user's selection operation. For example, assuming that the user selects a third device that has been paired with the first device, the first device may send pairing information between the first device and the third device to the cloud server (ie, the fourth device) according to the user's selection operation.
S1002:第二设备从云端服务器(即第四设备)获取蓝牙信息和配对信息。S1002: The second device acquires Bluetooth information and pairing information from a cloud server (that is, the fourth device).
示例性的,第二设备可以在接收到用户打开蓝牙功能的操作或者用户触发设备发现的操作等操作时,从云端服务器(即第四设备)获取蓝牙信息和配对信息。Exemplarily, the second device may acquire Bluetooth information and pairing information from the cloud server (that is, the fourth device) when receiving an operation of turning on the Bluetooth function by the user or an operation of triggering device discovery by the user.
或者,第二设备还可以在开机时或者周期性从云端服务器(即第四设备)获取蓝牙信息和配对信息。Or, the second device can also obtain the Bluetooth information and pairing information from the cloud server (that is, the fourth device) when it is turned on or periodically.
或者,云端服务器(即第四设备)还可以在蓝牙信息和/或配对信息有更新时,例如在接收到来自第一设备的蓝牙信息和配对信息时,主动将蓝牙信息和配对信息同步至第二设备。本申请不限定第二设备从云端服务器(即第四设备)获取蓝牙信息和配对信息的具体触发方式和触发时机。Alternatively, the cloud server (that is, the fourth device) can also actively synchronize the Bluetooth information and pairing information to the second device when the Bluetooth information and/or pairing information is updated, for example, when receiving the Bluetooth information and pairing information from the first device. Two equipment. The present application does not limit the specific triggering manner and triggering timing for the second device to acquire Bluetooth information and pairing information from the cloud server (ie, the fourth device).
在一些实施例中,为了保证用户隐私和设备配对相关数据的安全性,云端服务器可以支持仅将蓝牙信息和配对信息同步至与第一设备登录了相同账号的终端设备。即,在本申请实施例中,第二设备与第一设备中登录了相同账号。其中,上述账号可以是蓝牙连接相关账号,也可以是手机管家等相关账号,也可以是云服务等相关账号,本申请不限定。In some embodiments, in order to ensure user privacy and security of device pairing-related data, the cloud server may support only synchronizing Bluetooth information and pairing information to terminal devices that log in with the same account as the first device. That is, in this embodiment of the application, the second device is logged in with the same account as the first device. Wherein, the above-mentioned account may be an account related to bluetooth connection, may also be a related account such as a mobile phone housekeeper, or may be a related account such as a cloud service, which is not limited in this application.
在一些实施例中,云端服务器(即第四设备)还可以保存并管理接收到的蓝牙信息和配对信息。In some embodiments, the cloud server (that is, the fourth device) can also save and manage the received Bluetooth information and pairing information.
作为一种可能的实现方式,云端服务器(即第四设备)可以按照预定义规则,分类保存并管理蓝牙信息和配对信息。As a possible implementation, the cloud server (that is, the fourth device) can store and manage the Bluetooth information and pairing information according to the predefined rules.
在一些实施例中,预定义规则如按照账号管理的规则。例如,云端服务器(即第四设备)可以根据蓝牙信息和配对信息的来源设备(包括第一设备)所登录的账号,分别管理每一个账号对应的配对信息。In some embodiments, the predefined rules are rules managed by accounts. For example, the cloud server (that is, the fourth device) can separately manage the pairing information corresponding to each account according to the accounts registered by the source devices (including the first device) of the Bluetooth information and pairing information.
示例性的,假设第二设备分别从第一设备、……、第N设备接收到了各自的蓝牙信息和配对信息(N为正整数,N>1),其中,第一设备登录了账号A,第N设备登录了账号B,第一设备与第三设备、……、第i设备等均成功配对,第N设备与第j设备、……、第k设备等均成功配对,第二设备可以按照图11所示预定义规则逻辑存储和管理接收到的蓝牙信息和配对信息。Exemplarily, it is assumed that the second device has received respective Bluetooth information and pairing information (N is a positive integer, N>1) from the first device, ..., the Nth device, wherein the first device is logged in account A, The Nth device has logged in account B, the first device has successfully paired with the third device, ..., the i-th device, etc., the N-th device has successfully paired with the j-th device, ..., the k-th device, etc., and the second device can The received Bluetooth information and pairing information are logically stored and managed according to the predefined rules shown in FIG. 11 .
在另一些实施例中,预定义规则还可以如按照蓝牙信息和配对信息的来源管理的规则,具体可参考图6所示存储规则逻辑示意图。In some other embodiments, the predefined rules may also be rules managed according to the source of the Bluetooth information and pairing information, for details, refer to the logical schematic diagram of storage rules shown in FIG. 6 .
S1003:第二设备根据第一设备的蓝牙信息和第一设备的配对信息,将第三设备加入第二设备的已配对设备列表。S1003: The second device adds the third device to the paired device list of the second device according to the Bluetooth information of the first device and the pairing information of the first device.
其中,第二设备的已配对设备列表中包括与第二设备成功配对的一个或多个终端设备的信息,如设备标识。其中,设备的标识如设备名称、设备型号、ID、MAC地址、IMEI等,本申请不限定。Wherein, the paired device list of the second device includes information of one or more terminal devices successfully paired with the second device, such as device identifiers. Wherein, the identification of the device, such as the device name, device model, ID, MAC address, IMEI, etc., is not limited in this application.
在一些实施例中,第二设备还可以保存并管理接收到的蓝牙信息和配对信息。例如,第二设备可以按照预定义规则,分类保存并管理蓝牙信息和配对信息。示例性的,预定义规则如按照账号管理的规则(如图11所示)、按照蓝牙信息和配对信息的来源管理的规则(如图6所示)等。In some embodiments, the second device can also save and manage the received Bluetooth information and pairing information. For example, the second device can store and manage Bluetooth information and pairing information by category according to predefined rules. Exemplarily, the predefined rules include rules managed according to accounts (as shown in FIG. 11 ), rules managed according to sources of Bluetooth information and pairing information (as shown in FIG. 6 ), and the like.
S1004:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备与第三设备建立蓝牙连接。S1004: In response to the operation of the user triggering the establishment of the Bluetooth connection between the second device and the third device, the second device establishes a Bluetooth connection with the third device.
示例性的,用户触发第二设备与第三设备建立蓝牙连接的操作如:用户在第二设备已配对UI界面上,触发第二设备与第三设备建立蓝牙连接的操作,如用户在已配对设备UI界面上点击第三设备标识的操作、选择(如点击、长按、鼠标指向、鼠标右键等)第三设备标识后在相应选择界面上选择连接选项的操作等,本申请不限定,具体视第二设备可支持的输入方式而定。Exemplarily, the user triggers the operation of establishing a Bluetooth connection between the second device and the third device, such as: the user triggers the operation of establishing a Bluetooth connection between the second device and the third device on the paired UI interface of the second device. The operation of clicking the third device logo on the device UI interface, selecting (such as clicking, long-pressing, pointing the mouse, right mouse button, etc.) the third device logo and selecting the connection option on the corresponding selection interface, etc., are not limited in this application. Depends on the input methods supported by the second device.
在一些实施例中,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据配对信息确定与第一设备配对的终端设备(如第三设备)的蓝牙类型,以根据具体蓝牙类型,基于相应蓝牙协议,建立第二设备与第三设备之间的蓝牙连接。其中,终端设备的蓝牙类型如经典蓝牙、BLE蓝牙、双模蓝牙等。In some embodiments, when the user triggers the second device to establish a Bluetooth connection with the third device, the second device may determine the Bluetooth type of the terminal device (such as the third device) paired with the first device according to the pairing information. , so as to establish a Bluetooth connection between the second device and the third device based on the corresponding Bluetooth protocol according to the specific Bluetooth type. Among them, the Bluetooth type of the terminal device includes classic Bluetooth, BLE Bluetooth, dual-mode Bluetooth, and the like.
示例性的,若第三设备的蓝牙类型是BLE蓝牙,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,生成新的Resolving List条目,并更新到第二设备的ResolvingList中,以便第二设备基于更新后的Resolving List建立第二设备与第三设备之间的蓝牙连接。Exemplarily, if the Bluetooth type of the third device is BLE Bluetooth, when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may The pairing information of the third device generates a new Resolving List entry, and updates it into the Resolving List of the second device, so that the second device establishes a Bluetooth connection between the second device and the third device based on the updated Resolving List.
示例性的,若第三设备的蓝牙类型是经典蓝牙,在接收到用户触发第二设备与第三设备建立蓝牙连接的操作时,第二设备可以根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,将第二设备用于负责蓝牙业务的模块(如蓝牙控制器(Controller))中的蓝牙MAC地址修改为第一设备的蓝牙MAC地址,以成功建立第二设备与第三设备之间的蓝牙连接。进一步的,在第二设备与第三设备建立蓝牙连接之后(如蓝牙连接建立成功时,或者蓝牙连接建立成功后预设之间段之后),第二设备可以将用于负责蓝牙业务的模块中的蓝牙MAC地址改回第二设备的蓝牙MAC地址,以避免对第二设备的后续使用造成影响。Exemplarily, if the Bluetooth type of the third device is classic Bluetooth, when receiving an operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the second device may For the pairing information of the third device, modify the Bluetooth MAC address used by the second device in the module responsible for the Bluetooth service (such as the Bluetooth controller (Controller)) to the Bluetooth MAC address of the first device, so as to successfully establish the relationship between the second device and the first device. Bluetooth connection between three devices. Further, after the second device establishes a Bluetooth connection with the third device (such as when the Bluetooth connection is successfully established, or after the preset interval after the Bluetooth connection is successfully established), the second device can be used in the module responsible for the Bluetooth service The Bluetooth MAC address of the second device is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
在一些实施例中,为了保证使用的方便性,在第二设备将第三设备加入第二设备的已配对设备列表之后,第二设备可以将第三设备保留在已配对设备列表中,以便后续有蓝牙连接需求时可以直接基于该配对信息建立蓝牙连接。In some embodiments, in order to ensure the convenience of use, after the second device adds the third device to the paired device list of the second device, the second device can keep the third device in the paired device list for subsequent When there is a need for a Bluetooth connection, the Bluetooth connection can be established directly based on the pairing information.
在另一些实施例中,为了不对第二设备的后续使用造成影响(如占用存储空间等),以及保证用户隐私和设备配对相关数据的安全性,在结束蓝牙连接使用之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设备列表中删除第三设备)。或者在第一设备与第二设备之间的信任关系解除之后,第二设备可以删除从其他设备接收到的蓝牙信息和配对信息(包括从第二设备的已配对设 备列表中删除第三设备)。示例性的,第一设备与第二设备之间的信任关系解除如第二设备退出所登录的账号等。In some other embodiments, in order not to affect the subsequent use of the second device (such as occupying storage space, etc.), and to ensure user privacy and security of device pairing-related data, the second device can delete the Bluetooth information and pairing information received from other devices (including removing the third device from the paired device list of the second device). Or after the trust relationship between the first device and the second device is released, the second device can delete the Bluetooth information and pairing information received from other devices (including deleting the third device from the paired device list of the second device) . Exemplarily, the trust relationship between the first device and the second device is released, for example, the second device logs out of the logged-in account.
在一些实施例中,本申请实施例提供的蓝牙连接建立方法可以基于图7所示结构的蓝牙连接建立相关功能单元实现。其中,第一设备可以通过蓝牙单元510-1(如蓝牙服务层)与第三设备进行配对。在第一设备与第三设备成功配对之后,第一设备的蓝牙单元510-1(如蓝牙服务层)中保存有第一设备与第三设备的配对信息。因此,第一设备的设备分享单元520-1(如迁移设备管理模块)从蓝牙单元510-1(如蓝牙服务层)获取配对信息。进一步的,第一设备可以通过设备分享单元520-1(如迁移设备管理模块)向云端服务器(即第四设备)发送第一设备的蓝牙信息和配对信息。对应的,第二设备可以通过设备分享单元520-1(如迁移设备管理模块)从云端服务器(即第四设备)获取蓝牙信息和配对信息,并将接收到的蓝牙信息和配对信息交由第二设备的蓝牙服务层进行处理,例如根据蓝牙信息和配对信息,更新第二设备的已配对设备列表,以及响应于用户触发第二设备与第三设备建立蓝牙连接的操作,使能第二设备与第三设备建立蓝牙连接。In some embodiments, the method for establishing a Bluetooth connection provided in the embodiment of the present application may be implemented based on the functional units related to establishing a Bluetooth connection with the structure shown in FIG. 7 . Wherein, the first device can pair with the third device through the Bluetooth unit 510-1 (such as the Bluetooth service layer). After the first device is successfully paired with the third device, the pairing information between the first device and the third device is stored in the Bluetooth unit 510-1 (such as the Bluetooth service layer) of the first device. Therefore, the device sharing unit 520-1 (such as the migration device management module) of the first device obtains pairing information from the Bluetooth unit 510-1 (such as the Bluetooth service layer). Further, the first device may send the Bluetooth information and pairing information of the first device to the cloud server (that is, the fourth device) through the device sharing unit 520-1 (such as the migration device management module). Correspondingly, the second device can obtain Bluetooth information and pairing information from the cloud server (that is, the fourth device) through the device sharing unit 520-1 (such as the migration device management module), and pass the received Bluetooth information and pairing information to the second device. The Bluetooth service layer of the second device performs processing, such as updating the paired device list of the second device according to the Bluetooth information and pairing information, and enabling the second device in response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device. Establish a Bluetooth connection with a third device.
以第一设备和第二设备的蓝牙功能结构如图7所示结构,第一设备根据用户的选择进行配对信息分享,云端服务器(即第四设备)和第二设备根据蓝牙信息和配对信息来源设备所登录的账号管理配对信息为例,如图12所示,本申请实施例提供的一种蓝牙连接建立方法可以包括以下S1201-S1204,以及上述S904-S906,S907-1或者S907-2:With the Bluetooth function structure of the first device and the second device as shown in Figure 7, the first device performs pairing information sharing according to the user's choice, and the cloud server (that is, the fourth device) and the second device share the pairing information according to the Bluetooth information and the source of the pairing information. Take the account management pairing information logged in by the device as an example, as shown in Figure 12, a method for establishing a Bluetooth connection provided by the embodiment of the present application may include the following S1201-S1204, and the above-mentioned S904-S906, S907-1 or S907-2:
S1201:响应于用户在第一设备上选择共享配对信息的操作,第一设备的迁移设备管理模块从蓝牙服务层获取第一设备的蓝牙信息和第一设备的配对信息。第一设备的配对信息包括第一设备与第三设备的配对信息。S1201: In response to the user's operation of selecting to share pairing information on the first device, the migration device management module of the first device obtains the Bluetooth information of the first device and the pairing information of the first device from the Bluetooth service layer. The pairing information of the first device includes pairing information of the first device and the third device.
S1202:第一设备通过迁移设备管理模块向云端服务器(即第四设备)发送获取的第一设备的蓝牙信息和第一设备的配对信息。S1202: The first device sends the acquired Bluetooth information of the first device and pairing information of the first device to the cloud server (that is, the fourth device) through the migration device management module.
可选的,云端服务器(即第四设备)也可以接收其他设备的蓝牙信息和配对信息。Optionally, the cloud server (that is, the fourth device) may also receive Bluetooth information and pairing information of other devices.
S1203:云端服务器(即第四设备)按照账号存储接收到的蓝牙信息和配对信息。S1203: The cloud server (that is, the fourth device) stores the received Bluetooth information and pairing information according to the account.
S1204:第二设备通过迁移设备管理模块从云端服务器(即第四设备)获取上述第一设备的蓝牙信息和第一设备的配对信息。S1204: The second device obtains the Bluetooth information of the first device and the pairing information of the first device from the cloud server (that is, the fourth device) through the migration device management module.
S904:第二设备的迁移设备管理模块将接收到的第一设备的蓝牙信息和第一设备的配对信息发送给配对信息存储模块和蓝牙服务层。S904: The migration device management module of the second device sends the received Bluetooth information of the first device and pairing information of the first device to the pairing information storage module and the Bluetooth service layer.
S905:第二设备的配对信息存储模块按照账号存储接收到的蓝牙信息和配对信息。S905: The pairing information storage module of the second device stores the received Bluetooth information and pairing information according to the account.
S906:第二设备的蓝牙服务层根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,更新第二设备的已配对设备列表。S906: The Bluetooth service layer of the second device updates the paired device list of the second device according to the Bluetooth information of the first device and the pairing information between the first device and the third device.
若第三设备的蓝牙类型是BLE蓝牙,第二设备执行以下S907-1;若第三设备的蓝牙类型是经典蓝牙,第二设备执行以下S907-2:If the Bluetooth type of the third device is BLE Bluetooth, the second device executes the following S907-1; if the Bluetooth type of the third device is classic Bluetooth, the second device executes the following S907-2:
S907-1:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备的蓝牙服务层根据第一设备的蓝牙信息和第一设备与第三设备的配对信息,更新第二设备的Resolving List,与第三设备建立蓝牙连接。S907-1: In response to the user triggering the operation of establishing a Bluetooth connection between the second device and the third device, the Bluetooth service layer of the second device updates the second The Resolving List of the device, and establish a Bluetooth connection with the third device.
S907-2:响应于用户触发第二设备与第三设备建立蓝牙连接的操作,第二设备的 蓝牙服务层将第二设备的蓝牙MAC地址修改为第一设备的蓝牙MAC地址,与第三设备建立蓝牙连接。S907-2: In response to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device, the Bluetooth service layer of the second device modifies the Bluetooth MAC address of the second device to the Bluetooth MAC address of the first device, and communicates with the third device Establish a Bluetooth connection.
进一步的,在第二设备与第三设备建立蓝牙连接之后(如蓝牙连接建立成功时,或者蓝牙连接建立成功后预设之间段之后),第二设备的蓝牙服务层可以将用于负责蓝牙业务的模块中的蓝牙MAC地址改回第二设备的蓝牙MAC地址,以避免对第二设备的后续使用造成影响。Further, after the second device establishes a Bluetooth connection with the third device (such as when the Bluetooth connection is successfully established, or after a preset interval after the Bluetooth connection is successfully established), the Bluetooth service layer of the second device can use the The Bluetooth MAC address in the service module is changed back to the Bluetooth MAC address of the second device, so as to avoid affecting the subsequent use of the second device.
本申请实施例提供的蓝牙连接建立方法,设备之间通过远场云服务同步能力共享配对信息,例如第一设备可以将已配对设备对应的蓝牙信息和配对信息同步上传到云端服务器,登录了同账号的终端设备(如第二设备)可以同步获取到这些信息,以实现在第二设备上免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据获取的配对信息更新已配对设备列表,简化蓝牙连接建立过程中用户的操作,缩短蓝牙配对所需的时间。并且,在一些用户使用多个终端设备,基于蓝牙技术进行跨设备业务时,基于本申请实施例提供的蓝牙连接建立方法可以极大简化蓝牙连接切换时的用户操作,缩短蓝牙切换所需的时间,使得蓝牙连接切换过程更加顺畅,提高用户的使用体验。In the Bluetooth connection establishment method provided by the embodiment of the present application, the pairing information is shared between devices through the far-field cloud service synchronization capability. For example, the first device can upload the Bluetooth information and pairing information corresponding to the The terminal device of the account (such as the second device) can obtain these information synchronously, so as to avoid the conventional device discovery, authentication requirements and interaction capability exchange between devices, public key exchange and authentication between devices on the second device and other steps, directly update the paired device list according to the obtained pairing information, simplify the user's operation during the establishment of the Bluetooth connection, and shorten the time required for Bluetooth pairing. Moreover, when some users use multiple terminal devices and conduct cross-device services based on Bluetooth technology, the method for establishing a Bluetooth connection based on the embodiment of the present application can greatly simplify user operations when switching Bluetooth connections and shorten the time required for Bluetooth switching , making the Bluetooth connection switching process smoother and improving the user experience.
关于S1201-S1204的具体过程,可以参考上述实施例1中的相关介绍或上述实施例中对图10的介绍和说明,这里不做赘述。For the specific process of S1201-S1204, you can refer to the relevant introduction in the above-mentioned embodiment 1 or the introduction and description of FIG. 10 in the above-mentioned embodiment, and details are not repeated here.
需要说明的是,本申请实施例对终端设备中蓝牙连接建立相关功能单元的具体结构不作限定。例如,终端设备中蓝牙连接建立相关功能单元还可以包括其他功能模块,或者,终端设备中蓝牙连接建立相关功能单元中的功能模块还可以以其他方式组合。示例性的,在另一些实施例中,本申请实施例提供的蓝牙连接建立方法还可以基于图13所示结构的蓝牙连接建立相关功能单元实现。It should be noted that the embodiment of the present application does not limit the specific structure of the functional units related to the establishment of the Bluetooth connection in the terminal device. For example, the functional units related to establishing a Bluetooth connection in the terminal device may further include other functional modules, or the functional modules in the functional units related to establishing a Bluetooth connection in the terminal device may also be combined in other ways. Exemplarily, in some other embodiments, the method for establishing a Bluetooth connection provided in the embodiment of the present application may also be implemented based on the functional units related to establishing a Bluetooth connection with the structure shown in FIG. 13 .
如图13所示,终端设备可以包括设备管理单元,设备分享单元和蓝牙单元。As shown in FIG. 13, the terminal device may include a device management unit, a device sharing unit and a Bluetooth unit.
其中,设备管理单元用于进行蓝牙信息和配对信息分享管理、蓝牙信息和配对信息同步管理、登录账号(如蓝牙连接相关账号、手机管家账号等)管理等。Among them, the device management unit is used for Bluetooth information and pairing information sharing management, Bluetooth information and pairing information synchronization management, login account (such as Bluetooth connection related account, mobile phone housekeeper account, etc.) management, etc.
蓝牙单元用于负责从设备发现、设备认证、配对信息同步、蓝牙配对、蓝牙连接建立、已配对设备列表管理、数据传输等。蓝牙单元自上而下可以包括蓝牙服务层、蓝牙协议栈(即实现蓝牙协议的实现代码)和蓝牙控制器(Controller)(如蓝牙芯片)。The Bluetooth unit is responsible for device discovery, device authentication, pairing information synchronization, Bluetooth pairing, Bluetooth connection establishment, paired device list management, data transmission, etc. The bluetooth unit may include a bluetooth service layer, a bluetooth protocol stack (that is, implementation codes for implementing bluetooth protocols) and a bluetooth controller (controller) (such as a bluetooth chip) from top to bottom.
设备分享单元用于负责建立近端连接、配对信息获取、配对信息解析、向蓝牙单元导入配对信息、配对信息存储等。设备分享单元包括连接控制管理模块、本机配对信息存储模块和非本机配对信息存储模块。其中,连接控制管理模块用于负责建立近端连接、配对信息获取、配对信息解析和向蓝牙单元导入配对信息等。本机配对信息存储模块用于负责存储本机基于常规设备发现、设备认证、设备配对所成功配对的设备相关信息。非本机配对信息存储模块用于存储从第四设备(如云端服务器)获取的蓝牙信息和配对信息。The device sharing unit is responsible for establishing a near-end connection, acquiring pairing information, parsing pairing information, importing pairing information to the Bluetooth unit, storing pairing information, and the like. The device sharing unit includes a connection control management module, a local pairing information storage module and a non-local pairing information storage module. Wherein, the connection control management module is used for establishing a near-end connection, acquiring pairing information, parsing pairing information, importing pairing information to the Bluetooth unit, and the like. The local machine pairing information storage module is responsible for storing the device-related information successfully paired by the local machine based on conventional device discovery, device authentication, and device pairing. The non-local pairing information storage module is used to store the bluetooth information and pairing information obtained from the fourth device (such as a cloud server).
以第一设备和第二设备的蓝牙功能结构如图13所示结构为例,第一设备可以通过蓝牙单元1320-1(如蓝牙服务层)与第三设备进行配对。在第一设备与第三设备成功配对之后,蓝牙单元1320-1(如蓝牙服务层)可以将第一设备与第三设备的配对信息保存在设备分享单元1330-1的本机配对信息存储模块。因此,第一设备的连接控制管 理模块可以从本机配对信息存储模块获取配对信息,并通过设备管理单元1310-1将第一设备的蓝牙信息和配对信息同步至云端服务器(即第四设备)。对应的,第二设备的设备管理单元1310-2从云端服务器(即第四设备)获取蓝牙信息和配对信息,并将接收到的蓝牙信息和配对信息交由设备分享单元1330-2的连接控制管理模块进行处理,例如将蓝牙信息和配对信息存储至非本机配对信息存储模块、解析配对信息、将配对信息导入蓝牙单元1320-2。蓝牙单元1320-2(如蓝牙服务层)可以根据配对信息,更新第二设备的已配对设备列表,以及响应于用户触发第二设备与第三设备建立蓝牙连接的操作,使能第二设备与第三设备建立蓝牙连接。Taking the Bluetooth functional structures of the first device and the second device as shown in FIG. 13 as an example, the first device can be paired with the third device through the Bluetooth unit 1320-1 (such as the Bluetooth service layer). After the first device and the third device are successfully paired, the Bluetooth unit 1320-1 (such as the Bluetooth service layer) can save the pairing information of the first device and the third device in the local pairing information storage module of the device sharing unit 1330-1 . Therefore, the connection control management module of the first device can obtain the pairing information from the local pairing information storage module, and synchronize the Bluetooth information and pairing information of the first device to the cloud server (that is, the fourth device) through the device management unit 1310-1 . Correspondingly, the device management unit 1310-2 of the second device acquires Bluetooth information and pairing information from the cloud server (that is, the fourth device), and hands over the received Bluetooth information and pairing information to the connection control of the device sharing unit 1330-2 The management module performs processing, such as storing the Bluetooth information and pairing information in the non-local pairing information storage module, parsing the pairing information, and importing the pairing information into the Bluetooth unit 1320-2. The Bluetooth unit 1320-2 (such as the Bluetooth service layer) can update the paired device list of the second device according to the pairing information, and enable the second device to communicate with the third device in response to the operation triggered by the user to establish a Bluetooth connection between the second device and the third device. The third device establishes a Bluetooth connection.
进一步的,在本申请一些实施例中,在第二设备根据从第一设备获取的蓝牙信息和配对信息,将第三设备加入第二设备的已配对设备列表中之后,第二设备还可以根据用户的需求向其他设备共享(如以近端分享的形式共享、或者通过远场云服务同步能力共享)蓝牙信息和配对信息,以便其他终端设备可以免于进行常规的设备发现、设备间鉴权需求和交互能力交换、设备间公钥交换和鉴权等步骤,直接根据第二设备共享的配对信息更新已配对设备列表。以此类推。Further, in some embodiments of the present application, after the second device adds the third device to the paired device list of the second device according to the Bluetooth information and pairing information obtained from the first device, the second device may also Share the bluetooth information and pairing information with other devices according to the user's needs (for example, in the form of near-end sharing, or through far-field cloud service synchronization capability sharing), so that other terminal devices can be exempted from conventional device discovery and device-to-device authentication Steps such as demand and interaction capability exchange, public key exchange and authentication between devices directly update the list of paired devices based on the pairing information shared by the second device. and so on.
在本申请另一些实施例,为了保证隐私用户隐私和设备配对相关数据的安全性,本申请实施例提供的方法在进行配对信息共享时,还可以仅支持一次共享,不支持转发共享。例如,在本申请实施例中,第一设备可以将其经过设备发现、认证后成功配对的第三设备的配对信息共享第二设备,但是第二设备不能再次将该配对信息共享给其他设备。或者,本申请实施例提供的方法在进行配对信息共享时,可以仅支持预设次数的转发。In other embodiments of the present application, in order to ensure the privacy of users and the security of device pairing-related data, the method provided in the embodiments of the present application may only support one-time sharing and not support forwarding sharing when sharing pairing information. For example, in this embodiment of the application, the first device can share the pairing information of the third device successfully paired after device discovery and authentication with the second device, but the second device cannot share the pairing information with other devices again. Alternatively, the method provided in the embodiment of the present application may only support a preset number of forwardings when sharing pairing information.
应理解,本申请实施例的各个方案可以进行合理的组合使用,并且实施例中出现的各个术语的解释或说明可以在各个实施例中互相参考或解释,对此不作限定。It should be understood that various schemes of the embodiments of the present application can be used in a reasonable combination, and the explanations or descriptions of various terms appearing in the embodiments can be referred to or interpreted in each embodiment, which is not limited.
还应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that in various embodiments of the present application, the serial numbers of the above-mentioned processes do not mean the order of execution, and the order of execution of the processes should be determined by their functions and internal logic, and should not be implemented in this application. The implementation of the examples constitutes no limitation.
可以理解的是,终端设备(包括第一设备和第二设备)为了实现上述任一个实施例的功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the functions of any one of the foregoing embodiments, the terminal device (including the first device and the second device) includes corresponding hardware structures and/or software modules for performing various functions. Those skilled in the art should easily realize that the present application can be implemented in the form of hardware or a combination of hardware and computer software in combination with the units and algorithm steps of each example described in the embodiments disclosed herein. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本申请实施例可以对终端设备(包括第一设备和第二设备)进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the embodiment of the present application, the functional modules of the terminal device (including the first device and the second device) can be divided. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. It should be noted that the division of modules in the embodiment of the present application is schematic, and is only a logical function division, and there may be other division methods in actual implementation.
应理解,终端设备中的各个模块可以通过软件和/或硬件形式实现,对此不作具体限定。换言之,电子设备是以功能模块的形式来呈现。这里的“模块”可以指特定应用 集成电路ASIC、电路、执行一个或多个软件或固件程序的处理器和存储器、集成逻辑电路,和/或其它可以提供上述功能的器件。It should be understood that each module in the terminal device may be implemented in the form of software and/or hardware, which is not specifically limited. In other words, electronic equipment is presented in the form of functional modules. The "module" here may refer to an application-specific integrated circuit ASIC, a circuit, a processor and memory executing one or more software or firmware programs, an integrated logic circuit, and/or other devices that can provide the above-mentioned functions.
在一种可选的方式中,当使用软件实现数据传输时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地实现本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其它可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线((digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如软盘、硬盘、磁带)、光介质(例如数字化视频光盘(digital video disk,DVD))、或者半导体介质(例如固态硬盘solid state disk(SSD))等。In an optional manner, when software is used to implement data transmission, it may be implemented in whole or in part in the form of computer program products. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions described in the embodiments of the present application are realized in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available mediums. The available medium can be a magnetic medium, (such as a floppy disk, a hard disk, etc. , tape), optical media (such as digital video disk (digital video disk, DVD)), or semiconductor media (such as solid state disk (SSD)), etc.
结合本申请实施例所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于电子设备中。当然,处理器和存储介质也可以作为分立组件存在于终端设备中。The steps of the methods or algorithms described in conjunction with the embodiments of the present application may be implemented in hardware, or may be implemented in a manner in which a processor executes software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art medium. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC. Alternatively, the ASIC may be located in the electronic device. Of course, the processor and the storage medium may also exist in the terminal device as discrete components.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.

Claims (21)

  1. 一种蓝牙连接建立方法,其特征在于,所述方法包括:A bluetooth connection establishment method, is characterized in that, described method comprises:
    第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息,所述第一设备的配对信息包括所述第一设备与第三设备的蓝牙配对信息,所述第一设备与所述第三设备已完成蓝牙配对;The second device receives the Bluetooth information of the first device shared by the first device and the pairing information of the first device, the pairing information of the first device includes the Bluetooth pairing information of the first device and a third device, and the first device The device and the third device have completed Bluetooth pairing;
    所述第二设备根据所述第一设备的蓝牙信息和所述第一设备的配对信息,与所述第三设备进行蓝牙配对。The second device performs Bluetooth pairing with the third device according to the Bluetooth information of the first device and the pairing information of the first device.
  2. 根据权利要求1所述的方法,其特征在于,所述第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息,包括:The method according to claim 1, wherein the second device receives the Bluetooth information of the first device shared by the first device and the pairing information of the first device, comprising:
    所述第二设备在与所述第一设备建立通信连接之后,通过所述通信连接,接收来自所述第一设备的所述第一设备的蓝牙信息和所述第一设备的配对信息。After establishing a communication connection with the first device, the second device receives the Bluetooth information of the first device and the pairing information of the first device from the first device through the communication connection.
  3. 根据权利要求1所述的方法,其特征在于,所述第二设备接收第一设备共享的第一设备的蓝牙信息和第一设备的配对信息,包括:The method according to claim 1, wherein the second device receives the Bluetooth information of the first device shared by the first device and the pairing information of the first device, comprising:
    所述第二设备接收第四设备发送的所述第一设备的蓝牙信息和所述第一设备的配对信息,其中,所述第一设备的蓝牙信息和所述第一设备的配对信息是所述第四设备从所述第一设备获取的。The second device receives the Bluetooth information of the first device and the pairing information of the first device sent by the fourth device, wherein the Bluetooth information of the first device and the pairing information of the first device are the obtained by the fourth device from the first device.
  4. 根据权利要求3所述的方法,其特征在于,所述第四设备是云侧设备。The method according to claim 3, wherein the fourth device is a cloud-side device.
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述第一设备与所述第三设备的蓝牙配对信息包括所述第三设备的蓝牙类型;The method according to any one of claims 1-4, wherein the Bluetooth pairing information between the first device and the third device includes the Bluetooth type of the third device;
    其中,所述蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。Wherein, the bluetooth type includes: classic bluetooth, low power consumption BLE bluetooth or dual-mode bluetooth.
  6. 根据权利要求5所述的方法,其特征在于,所述第二设备根据所述第一设备的蓝牙信息和所述第一设备的配对信息,与所述第三设备进行蓝牙配对,包括:The method according to claim 5, wherein the second device performs Bluetooth pairing with the third device according to the Bluetooth information of the first device and the pairing information of the first device, comprising:
    所述第二设备根据所述第一设备的蓝牙信息,以及所述第一设备的配对信息中所述第三设备的蓝牙类型,基于相对应的蓝牙协议,与所述第三设备进行蓝牙配对。The second device performs Bluetooth pairing with the third device based on the corresponding Bluetooth protocol according to the Bluetooth information of the first device and the Bluetooth type of the third device in the pairing information of the first device .
  7. 根据权利要求1-6中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-6, wherein the method further comprises:
    响应于用户触发所述第二设备与所述第三设备建立蓝牙连接的操作,所述第二设备基于所述第二设备和所述第三设备的蓝牙配对,与所述第三设备建立蓝牙连接。In response to the user triggering the second device to establish a Bluetooth connection with the third device, the second device establishes a Bluetooth connection with the third device based on the Bluetooth pairing between the second device and the third device connect.
  8. 根据权利要求7所述的方法,其特征在于,在所述第二设备与所述第三设备建立蓝牙连接之后,所述方法还包括:The method according to claim 7, wherein after the second device establishes a Bluetooth connection with the third device, the method further comprises:
    所述第二设备删除所述第一设备的蓝牙信息,以及所述第一设备与第三设备的蓝牙配对信息。The second device deletes the Bluetooth information of the first device and the Bluetooth pairing information between the first device and a third device.
  9. 根据权利要求1-7中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-7, further comprising:
    所述第二设备向第五设备共享第二设备的蓝牙信息和所述第二设备与所述第三设备的蓝牙配对信息,使得所述第五设备根据所述第二设备的蓝牙信息,以及所述第二设备与所述第三设备的蓝牙配对信息,与所述第三设备进行蓝牙配对。The second device shares the Bluetooth information of the second device and the Bluetooth pairing information between the second device and the third device with the fifth device, so that the fifth device uses the Bluetooth information of the second device, and The Bluetooth pairing information between the second device and the third device is used to perform Bluetooth pairing with the third device.
  10. 一种蓝牙连接建立方法,其特征在于,所述方法包括:A bluetooth connection establishment method, is characterized in that, described method comprises:
    第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,以使所述第二设备根据所述第一设备的蓝牙信息和所述第一设备的配对信息,与第三设备进行蓝牙配对;The first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, so that the second device can communicate with the second device according to the Bluetooth information of the first device and the pairing information of the first device. Three devices for Bluetooth pairing;
    其中,所述第一设备的配对信息包括所述第一设备与所述第三设备的蓝牙配对信息,所述第一设备与所述第三设备已完成蓝牙配对。Wherein, the pairing information of the first device includes Bluetooth pairing information between the first device and the third device, and the Bluetooth pairing between the first device and the third device has been completed.
  11. 根据权利要求10所述的方法,其特征在于,所述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:The method according to claim 10, wherein the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, comprising:
    所述第一设备根据用户触发的、共享一个或多个配对信息的操作,向所述第二设备共享所述第一设备的蓝牙信息和所述第一设备的配对信息。The first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device according to an operation triggered by a user to share one or more pieces of pairing information.
  12. 根据权利要求10或11所述的方法,其特征在于,所述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:The method according to claim 10 or 11, wherein the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, comprising:
    所述第一设备在与所述第二设备建立通信连接之后,通过所述通信连接,向所述第二设备发送所述第一设备的蓝牙信息和所述第一设备的配对信息。After establishing a communication connection with the second device, the first device sends the Bluetooth information of the first device and the pairing information of the first device to the second device through the communication connection.
  13. 根据权利要求10或11所述的方法,其特征在于,所述第一设备向第二设备共享第一设备的蓝牙信息和第一设备的配对信息,包括:The method according to claim 10 or 11, wherein the first device shares the Bluetooth information of the first device and the pairing information of the first device with the second device, comprising:
    所述第一设备通过第四设备向所述第二设备发送所述第一设备的蓝牙信息和第一设备的配对信息。The first device sends the Bluetooth information of the first device and the pairing information of the first device to the second device through the fourth device.
  14. 根据权利要求13所述的方法,其特征在于,所述第四设备是云侧设备。The method according to claim 13, wherein the fourth device is a cloud-side device.
  15. 根据权利要求10-14中任一项所述的方法,其特征在于,所述第一设备与所述第三设备的蓝牙配对信息包括所述第三设备的蓝牙类型;The method according to any one of claims 10-14, wherein the Bluetooth pairing information between the first device and the third device includes the Bluetooth type of the third device;
    其中,所述蓝牙类型包括:经典蓝牙、低功耗BLE蓝牙或双模蓝牙。Wherein, the bluetooth type includes: classic bluetooth, low power consumption BLE bluetooth or dual-mode bluetooth.
  16. 一种第二设备,其特征在于,所述第二设备包括:A second device, characterized in that the second device comprises:
    存储器,用于存储计算机程序;memory for storing computer programs;
    收发器,用于接收或发送无线电信号;Transceivers for receiving or transmitting radio signals;
    处理器,用于执行所述计算机程序,使得所述第二设备实现如权利要求1-9中任一项所述的方法。A processor, configured to execute the computer program, so that the second device implements the method according to any one of claims 1-9.
  17. 一种第一设备,其特征在于,所述第一设备包括:A first device, characterized in that the first device includes:
    存储器,用于存储计算机程序;memory for storing computer programs;
    收发器,用于接收或发送无线电信号;Transceivers for receiving or transmitting radio signals;
    处理器,用于执行所述计算机程序,使得所述第一设备实现如权利要求10-15中任一项所述的方法。A processor, configured to execute the computer program, so that the first device implements the method according to any one of claims 10-15.
  18. 一种通信系统,其特征在于,所述通信系统包括:A communication system, characterized in that the communication system includes:
    如权利要求16所述的第二设备;以及,A second device as claimed in claim 16; and,
    如权利要求17所述的第一设备。A first device as claimed in claim 17.
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序代码,所述计算机程序代码被处理电路执行时实现如权利要求1-9或10-15中任一项所述的方法。A computer-readable storage medium, characterized in that computer program code is stored on the computer-readable storage medium, and when the computer program code is executed by a processing circuit, any one of claims 1-9 or 10-15 is implemented. method described in the item.
  20. 一种芯片系统,其特征在于,所述芯片系统包括处理电路、存储介质,所述存储介质中存储有计算机程序代码;所述计算机程序代码被所述处理电路执行时实现如权利要求1-9或10-15中任一项所述的方法。A chip system, characterized in that the chip system includes a processing circuit and a storage medium, and computer program codes are stored in the storage medium; when the computer program codes are executed by the processing circuit, claims 1-9 are implemented. Or the method described in any one of 10-15.
  21. 一种计算机程序产品,其特征在于,所述计算机程序产品用于在计算机上运行,以实现如权利要求1-9或10-15中任一项所述的方法。A computer program product, characterized in that the computer program product is used to run on a computer to implement the method according to any one of claims 1-9 or 10-15.
PCT/CN2022/137200 2021-12-14 2022-12-07 Bluetooth connection establishment method, device and system WO2023109610A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111531867.6 2021-12-14
CN202111531867.6A CN116264678A (en) 2021-12-14 2021-12-14 Bluetooth connection establishment method, device and system

Publications (1)

Publication Number Publication Date
WO2023109610A1 true WO2023109610A1 (en) 2023-06-22

Family

ID=86722534

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/137200 WO2023109610A1 (en) 2021-12-14 2022-12-07 Bluetooth connection establishment method, device and system

Country Status (2)

Country Link
CN (1) CN116264678A (en)
WO (1) WO2023109610A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110611905A (en) * 2019-08-09 2019-12-24 华为技术有限公司 Information sharing method, terminal device, storage medium, and computer program product
CN113613313A (en) * 2021-08-19 2021-11-05 杭州涂鸦信息技术有限公司 Communication method, device and medium for Bluetooth equipment pairing
CN113676879A (en) * 2020-05-14 2021-11-19 华为技术有限公司 Method, electronic device and system for sharing information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110611905A (en) * 2019-08-09 2019-12-24 华为技术有限公司 Information sharing method, terminal device, storage medium, and computer program product
CN113676879A (en) * 2020-05-14 2021-11-19 华为技术有限公司 Method, electronic device and system for sharing information
CN113613313A (en) * 2021-08-19 2021-11-05 杭州涂鸦信息技术有限公司 Communication method, device and medium for Bluetooth equipment pairing

Also Published As

Publication number Publication date
CN116264678A (en) 2023-06-16

Similar Documents

Publication Publication Date Title
US11297666B2 (en) Electronic device and method for forming Wi-Fi direct group thereof
US10004095B2 (en) Method and apparatus for communicating using multiple frequency bands
WO2020233538A1 (en) Method for accessing wireless local area network and terminal
US11856498B2 (en) Bluetooth device connection method and device
US9125002B2 (en) Apparatus and method for connecting with bluetooth device in portable terminal
TWI568214B (en) Connection switching method applicable to remote controllable system and mobile device, remote controllable system using the same, and mobile device using the same
WO2016082801A1 (en) Method and device for establishing wireless connection
WO2020062344A1 (en) Data transmission method and electronic device
WO2019000411A1 (en) Method and device for establishing wireless communication connection
CN108605373B (en) Method and electronic device for providing network sharing service
WO2022068513A1 (en) Wireless communication method and terminal device
WO2022135341A1 (en) Communication method and system, and electronic device
US11089443B2 (en) Electronic device and method for connecting short range communication
WO2022228083A1 (en) Method for establishing connection between multiple devices, and device
CN114885442A (en) Input device connection method, device and system
KR102343301B1 (en) Method for wireless connection and electronic device thereof
WO2021227942A1 (en) Information sharing method, electronic devices and system
WO2023109610A1 (en) Bluetooth connection establishment method, device and system
WO2022247638A1 (en) Method for controlling connection of stylus, and electronic device
WO2022228028A1 (en) File sharing method and electronic device
WO2022068646A1 (en) Data transmission method and electronic device
WO2023051229A1 (en) Method and apparatus for identifying device, and electronic device and medium
CN112615891B (en) Pairing method and device
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium
WO2023098356A1 (en) Fingerprint identification method and system, and electronic device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22906358

Country of ref document: EP

Kind code of ref document: A1