WO2022247802A1 - 连接建立方法、装置、电子设备及存储介质 - Google Patents

连接建立方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2022247802A1
WO2022247802A1 PCT/CN2022/094533 CN2022094533W WO2022247802A1 WO 2022247802 A1 WO2022247802 A1 WO 2022247802A1 CN 2022094533 W CN2022094533 W CN 2022094533W WO 2022247802 A1 WO2022247802 A1 WO 2022247802A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
connection
ble
application program
establishing
Prior art date
Application number
PCT/CN2022/094533
Other languages
English (en)
French (fr)
Inventor
包建全
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022247802A1 publication Critical patent/WO2022247802A1/zh

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/11Allocation or use of connection identifiers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Definitions

  • the embodiments of the present application relate to the field of wireless connection technologies, and in particular, to a connection establishment method, device, electronic equipment, and storage medium.
  • Bluetooth devices With the widespread application of Bluetooth technology, many manufacturers will produce Bluetooth devices and develop applications for managing Bluetooth devices. Any device installed with the application can communicate with the Bluetooth device through the application.
  • Embodiments of the present application provide a connection establishment method, device, electronic equipment, and storage medium, which can establish a GATT over BR/EDR transmission channel without multiple user operations, simplify user operations, and improve connection establishment efficiency.
  • the technical solution is as follows:
  • a method for establishing a connection which is applied to a first electronic device, and the method includes:
  • connection interface of the application program displaying the device identification of at least one electronic device scanned by the application program
  • a method for establishing a connection is provided, which is applied to a second electronic device, and the method includes:
  • the BLE broadcast includes device information of the second electronic device, and the device information is used to display a target device identifier of the second electronic device on the first electronic device;
  • a GATT over BR/EDR transmission channel for communicating with the application program is established.
  • a method for establishing a connection which is applied to a first electronic device, and the method includes:
  • a Bluetooth establishment request is sent to the second electronic device, and a BLE connection between the first electronic device and the second electronic device is established, and the application program is connected to the second electronic device.
  • the application program matched by the second electronic device, the first electronic device does not support the second electronic device to directly call the interface for establishing a classic Bluetooth connection in the first electronic device;
  • a method for establishing a connection is provided, which is applied to a second electronic device, and the method includes:
  • an apparatus for establishing a connection which is applied to a first electronic device, and the apparatus includes:
  • a display module configured to display the device identification of at least one electronic device scanned by the application program in the connection interface of the application program;
  • a connection establishment module configured to establish a Bluetooth connection between the first electronic device and the second electronic device in response to selecting a target device identifier in the device identifiers of the at least one electronic device, the target device identifier indicating said second electronic device;
  • a channel establishment module configured to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the Bluetooth connection.
  • an apparatus for establishing a connection which is applied to a second electronic device, and the apparatus includes:
  • a sending module configured to send a BLE broadcast, the BLE broadcast includes device information of the second electronic device, and the device information is used to display a target device identifier of the second electronic device on the first electronic device;
  • a connection establishment module configured to establish a Bluetooth connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device, and the Bluetooth connection request is responded to by the first electronic device Triggering the selection operation of the target device identifier;
  • the channel establishment module is used to establish a GATT over BR/EDR transmission channel for communicating with the application program based on the bluetooth connection.
  • an apparatus for establishing a connection which is applied to a first electronic device, and the apparatus includes:
  • a connection establishment module configured to send a Bluetooth establishment request to the second electronic device in response to establishing a connection operation between the application program and the second electronic device, and establish a BLE connection between the first electronic device and the second electronic device,
  • the application program is an application program matched with the second electronic device, and the first electronic device does not support the second electronic device to directly call an interface for establishing a classic Bluetooth connection in the first electronic device;
  • connection establishment module is further configured to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection;
  • a channel establishing module configured to establish a transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • an apparatus for establishing a connection which is applied to a second electronic device, and the apparatus includes:
  • a connection establishment module configured to establish a BLE connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device, and the Bluetooth connection request is responded to by the first electronic device
  • An operation of establishing a connection between an application program and the second electronic device is triggered, the application program is an application program that matches the second electronic device, and the first electronic device does not support the second electronic device to directly call the first electronic device.
  • connection establishment module is further configured to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection;
  • a channel establishing module configured to establish a transmission channel for communicating with the application program based on the classic Bluetooth connection.
  • an electronic device includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to Implement the method for establishing a connection as described in the first aspect or the second aspect.
  • a computer-readable storage medium stores at least one instruction, and the at least one instruction is used to be executed by a processor to realize the connection described in the above aspect Build method.
  • a computer program product is provided.
  • the computer program product is executed by a processor of the first electronic device or the second electronic device, it is used to implement the connection establishment method described in the above aspect.
  • a chip is provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip runs on the first electronic device or the second electronic device, it is used to realize the above-mentioned The connection establishment method described in the aspect.
  • FIG. 1 shows a structural block diagram of an electronic device provided by an exemplary embodiment of the present application
  • Fig. 2 shows a schematic diagram of the connection between the mobile phone and the earphone provided by an exemplary embodiment of the present application
  • FIG. 3 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application
  • FIG. 4 shows a flow chart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • FIG. 5 shows a flow chart of a method for establishing a connection provided by an exemplary embodiment of the present application
  • FIG. 6 shows a flow chart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • FIG. 7 shows a flow chart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • FIG. 8 shows a flow chart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • FIG. 9 shows a flow chart of a method for establishing a connection provided in an exemplary embodiment of the present application.
  • FIG. 10 shows a flowchart of a method for establishing a connection provided in an exemplary embodiment of the present application
  • Fig. 11 shows a flowchart of a method for displaying a device identification of at least one electronic device provided by an exemplary embodiment of the present application
  • Fig. 12 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application
  • Fig. 13 shows a structural block diagram of a device for establishing a connection provided by an exemplary embodiment of the present application
  • Fig. 14 shows a structural block diagram of a device for establishing a connection provided by an exemplary embodiment of the present application
  • Fig. 15 shows a structural block diagram of a device for establishing a connection provided by an exemplary embodiment of the present application
  • Fig. 16 shows a structural block diagram of an apparatus for establishing a connection provided by an exemplary embodiment of the present application.
  • the "plurality” mentioned herein means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
  • the character “/” generally indicates that the contextual objects are an "or” relationship.
  • the electronic device 100 is an electronic device capable of accessing a wireless local area network as a wireless station, such as a smart phone, a tablet computer, and a wearable device.
  • the electronic device 100 in this application includes at least one or more of the following components: a processor 110 , a memory 120 and at least two wireless links 130 .
  • processor 110 includes one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions of the electronic device 100 by running or executing program codes stored in the memory 120 and calling data stored in the memory 120. and process data.
  • the processor 110 adopts at least one of Digital Signal Processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). A form of hardware to achieve.
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 110 can integrate one or more of a central processing unit (Central Processing Unit, CPU), an image processor (Graphics Processing Unit, GPU), a neural network processor (Neural-network Processing Unit, NPU) and a modem, etc.
  • a central processing unit Central Processing Unit, CPU
  • an image processor Graphics Processing Unit, GPU
  • a neural network processor Neural-network Processing Unit, NPU
  • the CPU mainly handles the operating system, user interface and application programs, etc.
  • the GPU is used to render and draw the content that needs to be displayed on the display screen
  • the NPU is used to realize artificial intelligence (Artificial Intelligence, AI) functions
  • the modem is used to process wireless communication. It can be understood that the foregoing modem may not be integrated into the processor 110, but may be implemented by a single chip.
  • the processor 110 is used to control the working conditions of at least two wireless links 130.
  • the processor 110 is a processor integrated with a wireless fidelity (Wireless Fidelity, Wi-Fi) chip.
  • Wi-Fi chip is a chip with dual Wi-Fi processing capabilities.
  • the Wi-Fi chip is a Dual Band Dual Concurrent (DBDC) chip, or a Dual Band Simultaneous (DBS) chip.
  • DBDC Dual Band Dual Concurrent
  • DBS Dual Band Simultaneous
  • the memory 120 includes random access memory (Random Access Memory, RAM), and in some embodiments, the memory 120 includes a read-only memory (Read-Only Memory, ROM). In some embodiments, the memory 120 includes a non-transitory computer-readable storage medium.
  • the memory 120 can be used to store program codes.
  • the memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), Instructions and the like for realizing the following various method embodiments; the storage data area can store data created according to the use of the electronic device 100 (such as audio data, phonebook) and the like.
  • the memory 120 stores different schemes for receiving beacon frames of the wireless link 130 . And, the identifiers of the access nodes connected to the different wireless links 130, the identifiers of the wireless links 130, and the like.
  • the at least two wireless links 130 are used to connect different access nodes (Access Point, AP). Receive downlink data sent by the AP.
  • the different access nodes are access nodes in the same router or access nodes in different routers.
  • the electronic device 100 further includes a display screen.
  • a display is a display component for displaying a user interface.
  • the display screen is a display screen with a touch function, and through the touch function, the user can use any suitable object such as a finger or a touch pen to perform a touch operation on the display screen.
  • the display screen is generally disposed on the front panel of the electronic device 100 .
  • the display screen is designed as a full screen, a curved screen, a special-shaped screen, a double-sided screen or a folding screen.
  • the display screen is also designed as a combination of a full screen and a curved screen, a combination of a special-shaped screen and a curved screen, etc., which are not limited in this embodiment.
  • the structure of the electronic device 100 shown in the above drawings does not constitute a limitation on the electronic device 100, and the electronic device 100 includes more or less components than those shown in the figure, or Combining certain parts, or different arrangements of parts.
  • the electronic device 100 also includes components such as a microphone, a speaker, an input unit, a sensor, an audio circuit, a module, a power supply, and a bluetooth module, which will not be repeated here.
  • the electronic device includes a first electronic device and a second electronic device, the first electronic device is a mobile phone, and the second electronic device is an earphone.
  • the mobile phone displays the device identification of at least one earphone scanned by the application program in the connection interface of the application program, and in response to the operation of selecting the target earphone in the device identification of at least one earphone, establishes a connection between the mobile phone and the earphone. Based on the Bluetooth connection, a GATT over BR/EDR transmission channel for communication between the application and the headset is established.
  • the electronic device includes a first electronic device and a second electronic device, the first electronic device is a mobile phone, and the second electronic device is an earphone.
  • the mobile phone sends a Bluetooth establishment request to the second electronic device in response to the operation of establishing a connection between the application program and the second electronic device, and establishes a BLE connection between the first electronic device and the second electronic device. Connecting, establishing a classic Bluetooth connection between the first electronic device and the second electronic device, and establishing a transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • a BLE connection 21 can be established between the mobile phone and the headset, and a classic Bluetooth connection 22 can also be established between the mobile phone and the headset based on the BLE connection 21, and then a connection between the application program and the headset can be established based on the established classic Bluetooth connection 22.
  • the transmission channel 23 can be established.
  • connection establishment method provided by the embodiment of the present application is applied in the scenario where the first electronic device and the second electronic device establish a connection for the first time.
  • the connection establishment method provided by the embodiment of the present application the first electronic device and the second electronic device, the user By triggering the target device identification of the second electronic device displayed by the first electronic device, the Bluetooth connection between the first electronic device and the second electronic device is established, and then the application program of the first electronic device and the second electronic device are established.
  • GATT over BR/EDR transmission channel simplifies user operations and improves connection establishment efficiency.
  • the method for establishing a connection provided in the embodiment of the present application is applied in the scenario where the first electronic device and the second electronic device establish a connection for the first time, and the first electronic device and the second electronic device execute the connection establishment method provided in the embodiment of the present application.
  • the user establishes the BLE connection between the first electronic device and the second electronic device by triggering the connection operation between the application program and the second electronic device, and then establishes the BLE connection between the first electronic device and the second electronic device based on the BLE connection.
  • the classic bluetooth connection and further establishes the transmission channel between the application program of the first electronic device and the second electronic device based on the classic bluetooth connection, which simplifies user operations and improves connection establishment efficiency.
  • Fig. 3 shows a flowchart of a method for establishing a connection provided in an exemplary embodiment of the present application.
  • the method is applied to a first electronic device, and the method includes:
  • Step 201 In the connection interface of the application program, the first electronic device displays the device identification of at least one electronic device scanned by the application program.
  • the first electronic device is installed with an application program, and the application program is used to scan to obtain the device identification of at least one electronic device, and then display the obtained device ID of at least one electronic device on the connection interface of the application program. logo.
  • the application program is a program for managing at least one electronic device.
  • the first electronic device controls other connected electronic devices through the application program. For example, the first electronic device upgrades the firmware of other electronic devices through this application, or modifies the settings of other electronic devices through this application, or performs other operations on other electronic devices through this application. Examples are not limited.
  • the step of obtaining the device identification of at least one electronic device by scanning the application program includes: at least one electronic device broadcasts a wireless signal, the first electronic device controls the application program to scan, and receives the wireless signal broadcast by the at least one electronic device, the wireless signal includes The device identification of the electronic device. Therefore, the application program obtains the device identification of at least one electronic device through the scanned wireless signal, and displays the scanned device identification of the at least one electronic device in the connection interface of the application program.
  • the first electronic device performs a BLE scan through an application program, so as to obtain the device identification of at least one electronic device.
  • the first electronic device performs a classic bluetooth scan through the application program, so as to obtain the device identification of at least one electronic device.
  • the device identification of the electronic device includes a name of the electronic device, an account of the electronic device, a user name of the electronic device, an icon of the electronic device or other identifications.
  • the at least one electronic device scanned by the first electronic device includes earphones, stereos, refrigerators or other types of devices, which are not limited in this application.
  • Step 202 The first electronic device establishes a Bluetooth connection between the first electronic device and the second electronic device in response to an operation of selecting a target device identifier in the device identifiers of at least one electronic device.
  • At least one device identifier of an electronic device is displayed on the connection interface, each device identifier indicates an electronic device, and the target device identifier indicates a second electronic device. If the user needs to establish a connection between the first electronic device and the second Bluetooth connection between electronic devices, the user triggers the selection operation of the target device identifier of the second electronic device in the connection interface, and the first electronic device responds to the selection operation of the target device identifier in the connection interface to establish the first electronic device.
  • the selected operation is a click operation, a long press operation, a double-click operation or other types of operations.
  • This Bluetooth connection is a classic Bluetooth connection, which is different from a BLE connection.
  • the target device identifier determined by the first electronic device can be regarded as the second electronic device, and when the first electronic device responds to the operation of selecting the target device identifier among the device identifiers of at least one electronic device, it can also It is understood that the first electronic device determines to receive an operation of establishing a connection between the application program and the second electronic device in response to the operation of selecting the second device identifier in the device identifiers of at least one electronic device.
  • connection operation between the application program and the second electronic device is not limited in this embodiment of the present application.
  • the embodiment of the present application is described by taking establishing a Bluetooth connection as an example.
  • the first electronic device determines to receive an operation of establishing a connection between the application program and the second electronic device
  • the first electronic device responds to the operation of establishing a connection between the application program and the second electronic device, and sends a message to the second electronic device.
  • the electronic device sends a Bluetooth establishment request, establishes a BLE connection between the first electronic device and the second electronic device, establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection, and establishes a classic Bluetooth connection based on the classic Bluetooth connection.
  • Step 203 The first electronic device establishes a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the Bluetooth connection.
  • the application program installed on the first electronic device will also establish a connection with the second electronic device. If the first electronic device completes the establishment of the Bluetooth connection with the second electronic device, the first electronic device will Based on the Bluetooth connection, establish a GATT (Generic Attribute Profile, general attribute configuration file) over BR (Basic Rate, basic rate)/EDR (Enhanced Data Rate, enhanced data rate) between the application program and the second electronic device The transmission channel for communication between the first electronic device and the second electronic device through the GATT over BR/EDR transmission channel.
  • GATT Generic Attribute Profile, general attribute configuration file
  • the embodiment of the present application is only described by taking the establishment of the first electronic device based on the Bluetooth connection to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first electronic device if the first electronic device fails to establish the GATT over BR/EDR transmission channel between the application program and the second electronic device, the first electronic device will re-execute step 203 to successfully establish the application program GATT over BR/EDR transmission channel with the second electronic device.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first electronic device also Other transmission channels for communication between the application program and the second electronic device may be established, which is not limited in this embodiment of the present application.
  • An embodiment of the present application provides a method for establishing a connection. If a selection operation of the target device identifier is detected in the connection interface of the application program, a Bluetooth connection between the application program and the second electronic device is established based on the selection operation. Furthermore, on the basis of the established Bluetooth connection, a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device is established, and the GATT over BR/EDR transmission channel can be established without multiple operations by the user. Simplifies user operations and improves connection establishment efficiency.
  • the GATT over BR/EDR transmission channel communicates based on the Bluetooth connection, which ensures the communication rate of the Bluetooth connection and improves the data transmission efficiency.
  • Fig. 4 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application. Referring to Fig. 4, the method is applied to a second electronic device, and the method includes:
  • Step 301 the second electronic device sends a BLE broadcast.
  • the BLE broadcast includes device information of the second electronic device, and the device information is used to display the target device identifier of the second electronic device on the first electronic device.
  • the device information includes a target device identifier and MAC (Media Access Control Address, Media Access Control) information of the second electronic device.
  • the MAC information is used to establish a Bluetooth connection between the first electronic device and the second electronic device.
  • the second electronic device sends a BLE broadcast, and when any electronic device is within the broadcast range of the second electronic device, any electronic device can receive the BLE broadcast sent by the second electronic device by scanning.
  • the first electronic device After scanning the BLE broadcast sent by the second electronic device, the first electronic device obtains the device information of the second electronic device according to the BLE broadcast, and then displays the target device identifier of the second electronic device based on the device information.
  • the target device identifier of the second electronic device is represented by the device name of the target device, and the first electronic device displays the device name of the target device.
  • the target device identifier of the second electronic device is represented by an account number of the target device, the first electronic device displays the account number of the target device.
  • the target device identifier displayed by the first electronic device is an icon of the second electronic device, and the first electronic device generates the icon according to the device information of the second electronic device, and then displays the generated icon.
  • the first electronic device scans through the application program to obtain the BLE broadcast sent by the second electronic device, and then obtains the target device identifier included in the BLE broadcast, and displays the obtained target device identifier.
  • Step 302 The second electronic device establishes a Bluetooth connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device.
  • the Bluetooth connection request is triggered by the first electronic device in response to an operation of selecting the target device identifier.
  • the first electronic device displays the scanned target device identifier of the second electronic device, and if the user needs to establish a Bluetooth connection between the first electronic device and the second electronic device, the second electronic device is selected.
  • the first electronic device sends a Bluetooth connection request to the second electronic device in response to the selection operation, and the second electronic device establishes a Bluetooth connection with the first electronic device according to the Bluetooth connection request.
  • Step 303 The second electronic device establishes a GATT over BR/EDR transmission channel for communication with the application program based on the Bluetooth connection.
  • the application program installed on the first electronic device will also establish a connection with the second electronic device. If the second electronic device completes the establishment of the Bluetooth connection with the first electronic device, then the Based on this, a transmission channel for communication between the application program and the second electronic device through GATT over BR/EDR is established to realize communication between the first electronic device and the second electronic device through the GATT over BR/EDR transmission channel .
  • the embodiment of the present application is described by taking establishing a Bluetooth connection as an example.
  • the first electronic device determines to receive an operation of establishing a connection between the application program and the second electronic device
  • the first electronic device responds to the operation of establishing a connection between the application program and the second electronic device, and sends a message to the second electronic device.
  • the electronic device sends a Bluetooth establishment request, establishes a BLE connection between the first electronic device and the second electronic device, establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection, and establishes a classic Bluetooth connection based on the classic Bluetooth connection.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • the first electronic device detects a selection operation on the displayed target device identification, based on the selection operation, it sends a Bluetooth establishment request to the second electronic device, and establishes a connection between the first electronic device and the second electronic device.
  • the Bluetooth connection between electronic devices and then on the basis of the established Bluetooth connection, establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device, which can be established without multiple operations by the user GATT over BR/EDR transmission channel simplifies user operations and improves connection establishment efficiency.
  • Fig. 5 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application. Referring to Fig. 5, the method is applied to a first electronic device, and the method includes:
  • Step 511 The first electronic device sends a Bluetooth establishment request to the second electronic device in response to the operation of establishing a connection between the application program and the second electronic device, and establishes a BLE connection between the first electronic device and the second electronic device.
  • the application program is For the application program matched with the second electronic device, the first electronic device does not support the second electronic device to directly call the interface for establishing a classic Bluetooth connection in the first electronic device.
  • the first electronic device does not support the second electronic device to directly call the interface for establishing a classic Bluetooth connection in the first electronic device, that is, if a classic Bluetooth connection needs to be established between the first electronic device and the second electronic device,
  • the application program that matches the second electronic device cannot directly call the interface used to establish a classic Bluetooth connection in the first electronic device, that is, it cannot directly establish a classic Bluetooth connection between the first electronic device and the second electronic device through the application program. connect.
  • the user needs to complete the classic Bluetooth connection between the two through the Bluetooth setting interface in the system first, which will complicate the user's operation.
  • the application program in the embodiment of this application is used to manage the second electronic device, and can also control the second electronic device that has established a connection, that is to say, the application program is matched with the second electronic device, so the application program The program can manage the second electronic device.
  • the second electronic device needs to complete the authentication of the first electronic device to complete the classic Bluetooth connection. If the second electronic device has not completed the authentication, the first electronic device does not support the second electronic device to directly call the user in the first electronic device. Interface for establishing classic Bluetooth connections.
  • the application program is an application program corresponding to an electronic device for establishing a connection with at least one electronic device, that is to say, the first electronic device can establish a connection with at least one electronic device through the application program.
  • the application program is a program installed on the first electronic device at the factory, or the application program is a third-party application program installed on the first electronic device, that is to say, the application program is installed by the first electronic device through a program platform program.
  • the application program is an application program installed by the first electronic device in other ways, which is not limited in this embodiment of the present application.
  • the first electronic device when the first electronic device detects the operation for establishing a connection between the application program and the second electronic device, the first electronic device sends a Bluetooth establishment request to the second electronic device, because the first electronic device does not support The second electronic device directly calls the interface used to establish a classic Bluetooth connection in the first electronic device, that is to say, the classic Bluetooth connection cannot be directly established between the first electronic device and the second electronic device, so the first electronic device establishes the BLE connection between electronic devices, and then execute steps 512-513 based on the established BLE connection.
  • Step 512 The first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection.
  • the classic Bluetooth may refer to Bluetooth below Bluetooth 4.0
  • the BLE Bluetooth may refer to Bluetooth above Bluetooth 4.0, which may also be understood with reference to the usual understanding in the field.
  • the amount of data transmitted by the classic Bluetooth may be greater than the amount of data transmitted by the BLE Bluetooth, and the power consumption of the classic Bluetooth is greater than that of the BLE Bluetooth.
  • Step 513 The first electronic device establishes a transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • the BLE connection after the BLE connection is established between the first electronic device and the second electronic device, it can continue to establish a classic Bluetooth connection based on the BLE connection, so that even if the first electronic device does not support the second electronic device to directly call
  • the interface used to establish a classic Bluetooth connection in the first electronic device can also automatically establish a solution for a classic Bluetooth connection between the first electronic device and the second electronic device, and then establish an application program and the second electronic device based on the established classic Bluetooth connection. Transmission channel between electronic devices.
  • the transmission channel is a transmission channel for communication between GATT (Generic Attribute Profile, general attribute configuration file) over BR (Basic Rate, basic rate)/EDR (Enhanced Data Rate, enhanced data rate).
  • GATT Generic Attribute Profile, general attribute configuration file
  • BR Base Rate, basic rate
  • EDR Enhanced Data Rate, enhanced data rate
  • the embodiment of the present application takes the first electronic device as an example for description.
  • the first electronic device is a mobile phone.
  • the operating system of the first electronic device is an IOS system.
  • the first electronic device detects the operation of establishing a connection between the application program and the second electronic device, it first establishes a BLE connection, then establishes a classic Bluetooth connection based on the BLE connection, and then establishes a connection between the application program and the second electronic device.
  • the transmission channel for communication between the second electronic devices can establish the transmission channel without multiple operations by the user, which simplifies user operations and improves the efficiency of establishing a connection.
  • Fig. 6 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application. Referring to Fig. 6, the method is applied to a second electronic device, and the method includes:
  • Step 611 The second electronic device establishes a BLE connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device.
  • the application program is an application program matched with the second electronic device, and the first electronic device does not support the second electronic device to directly call the interface for establishing a classic Bluetooth connection in the first electronic device.
  • the first electronic device does not support the second electronic device to directly call the interface for establishing a classic Bluetooth connection in the first electronic device, that is, if a classic Bluetooth connection needs to be established between the first electronic device and the second electronic device,
  • the application program that matches the second electronic device cannot directly call the interface used to establish a classic Bluetooth connection in the first electronic device, that is, it cannot directly establish a classic Bluetooth connection between the first electronic device and the second electronic device through the application program. connect.
  • the application program is an application program corresponding to an electronic device for establishing a connection with at least one electronic device, that is to say, the first electronic device can establish a connection with at least one electronic device through the application program.
  • the first electronic device when the first electronic device detects an operation for establishing a connection between the application program and the second electronic device, the first electronic device sends a Bluetooth establishment request to the second electronic device, and the second electronic device receives the request Bluetooth connection request, and because a classic Bluetooth connection cannot be directly established, the first electronic device establishes a BLE connection with the second electronic device, and then executes steps 612-613 based on the established BLE connection.
  • Step 612 The second electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection.
  • Step 613 The second electronic device establishes a transmission channel for communication with the application program based on the classic Bluetooth connection.
  • the transmission channel is a transmission channel for communication between GATT (Generic Attribute Profile, general attribute configuration file) over BR (Basic Rate, basic rate)/EDR (Enhanced Data Rate, enhanced data rate).
  • GATT Generic Attribute Profile, general attribute configuration file
  • BR Base Rate, basic rate
  • EDR Enhanced Data Rate, enhanced data rate
  • the embodiment of the present application takes the second electronic device as an example for description.
  • the second electronic device is an earphone.
  • the second electronic device is not compatible with the IOS system.
  • the second electronic device is not compatible with the IOS system means that the second electronic device has not authenticated the IOS system, that is to say, the second electronic device cannot call the interface of the IOS system.
  • the second electronic device receives the Bluetooth connection request sent by the first electronic device, it first establishes a BLE connection, then establishes a classic Bluetooth connection based on the BLE connection, and then establishes a connection between the application program and the second electronic device.
  • the transmission channel for communication between electronic devices can establish a transmission channel without multiple operations by the user, which simplifies user operations and improves the efficiency of establishing connections.
  • FIG. 3 and FIG. 4 are described by taking the first electronic device and the second electronic device as examples respectively, and the embodiments shown in FIG. 2 and FIG.
  • the Bluetooth connection between an electronic device and a second electronic device is taken as an example for description.
  • a BLE (Bluetooth Low Energy, Bluetooth Low Energy) connection between the application program and the second electronic device can also be established first, and then a classic Bluetooth connection can be established. Therefore, FIG. 7 shows a flowchart of a method for establishing a connection provided in an exemplary embodiment of the present application. Referring to FIG. 7, the method includes steps 401-406:
  • Step 401 The first electronic device sends a Bluetooth connection request to the second electronic device to establish a BLE connection between the first electronic device and the second electronic device in response to the selection operation of the target device identifier in the connection interface.
  • Step 402 The second electronic device establishes a BLE connection between the first electronic device and the second electronic device according to the received Bluetooth connection request sent by the first electronic device in response to the operation of selecting the target device identifier.
  • the classic Bluetooth connection between the first electronic device and the second electronic device is established based on the BLE connection between the first electronic device and the second electronic device, and the first electronic device detects that in the connection interface
  • a BLE connection between the first electronic device and the second electronic device indicated by the target device identifier is established.
  • the first electronic device when the first electronic device detects the selection operation of the target device identifier in the connection interface, in response to the selection operation of the target device identifier, it sends a Bluetooth establishment request to the second electronic device, then the second electronic device Both the first electronic device and the second electronic device will establish a BLE connection between the first electronic device and the second electronic device based on the Bluetooth establishment request.
  • connection interface of the application program is an interface for establishing a connection with the second electronic device.
  • the first electronic device displays the device identifier of at least one electronic device through the connection interface, and determines to establish a connection with the second electronic device in response to a selection operation of the target device identifier of the second electronic device.
  • the embodiment of the present application establishes a BLE connection between the first electronic device and the second electronic device to ensure normal communication with the second electronic device during the process of establishing the GATT over BR/EDR transmission channel between the application program and the second electronic device , establish a connection on the basis of ensuring the communication effect, and improve the stability of establishing the connection.
  • Step 403 The first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection.
  • Step 404 The second electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection.
  • the first electronic device when the first electronic device has established a BLE connection with the second electronic device, the first electronic device establishes a classic connection between the first electronic device and the second electronic device based on the BLE connection. Bluetooth connection.
  • the second electronic device will also establish a BLE connection with the first electronic device.
  • the specific process includes: the second electronic device sends a BLE broadcast, and the first electronic device scans the BLE broadcast, and on the connection interface
  • the target device ID of the second electronic device is displayed in , and in response to the selection operation of the target device ID in the connection interface, a Bluetooth connection request is sent to the second electronic device, and the second electronic device establishes the first electronic device according to the received Bluetooth connection request.
  • the BLE connection between the device and the second electronic device and then based on the BLE connection, establish a classic Bluetooth connection between the first electronic device and the second electronic device.
  • the process of establishing a classic Bluetooth connection between the first electronic device and the second electronic device is shown in FIG. 8 .
  • the method includes:
  • Step 5011 the first electronic device sends an access request to the second electronic device.
  • the access request is used to access the BLE encryption service of the second electronic device.
  • a BLE connection is established between the first electronic device and the second electronic device, then for the first electronic device, the first electronic device sends an access request to the second electronic device based on the BLE connection .
  • Step 5012 The second electronic device receives the access request sent by the first electronic device based on the BLE connection.
  • the first electronic device sends an access request to the second electronic device to access the BLE encryption service of the second electronic device, and since the BLE encryption service of the second electronic device needs to be performed under an encrypted BLE connection, Therefore, the second electronic device sends an error message to the first electronic device to instruct the first electronic device to perform the process of encrypting the BLE connection.
  • the access request is configured to enable the BLE encryption service of the second electronic device by setting the notify type characteristic corresponding to the BLE encryption service of the second electronic device to enable.
  • the access request can also access the BLE encryption service of the second electronic device by setting other types of characteristics corresponding to the BLE encryption service of the second electronic device.
  • Step 5013 When the BLE connection is an unencrypted BLE connection, the second electronic device sends an error message to the first electronic device.
  • the error message is used to indicate access to the BLE encryption service under the encrypted BLE connection.
  • the second electronic device after the first electronic device sends an access request to the second electronic device, since the BLE connection between the first electronic device and the second electronic device is a non-encrypted BLE connection, the second electronic device sends an access request to the first electronic device.
  • the device sends an error message to inform the first electronic device that the BLE connection needs to be encrypted.
  • Step 5014 the first electronic device establishes an encrypted BLE connection with the second electronic device in response to the error message.
  • the first electronic device receives an error message, and based on the error message, it is determined that the BLE encryption service of the second electronic device cannot be accessed when the BLR connection is an unencrypted connection, so the second electronic device returns an error
  • the message indicates that the first electronic device needs to perform BLE encryption, so as to establish an encrypted BLE connection with the second electronic device.
  • the first electronic device displays the connection confirmation interface in response to the error message, and performs pairing with the second electronic device in response to the confirmation operation on the connection confirmation interface to obtain an encryption key for the BLE connection.
  • the second electronic device sends an error message to the first electronic device, the first electronic device determines that an encrypted BLE connection with the second electronic device needs to be established, the first electronic device displays a connection confirmation interface in response to the error message, and the user passes the connection
  • the confirmation interface confirms whether the second electronic device that needs to be paired with the first electronic device is correct. If the confirmation is correct, the user performs a confirmation operation in the connection confirmation interface to control the first electronic device to pair with the second electronic device.
  • connection confirmation interface includes the target device identifier of the second electronic device.
  • the first electronic device displays a connection confirmation interface in response to the error message, the connection confirmation interface includes a confirmation option and a negative option, and if the user determines that the second electronic device paired with the first electronic device is correct, the pair confirmation is triggered.
  • the first electronic device performs pairing with the second electronic device in response to the selection operation of the confirmation option.
  • a selection operation of the deny option is triggered, and the first electronic device cancels pairing with the second electronic device in response to the selection operation of the deny option.
  • the first electronic device performs pairing with the second electronic device in response to the error message, acquires an encryption key for the BLE connection, encrypts the BLE connection according to the encryption key, and establishes the encrypted BLE connection.
  • Step 5015 The first electronic device executes a CTKD (Cross-Transport Key Derivation, cross-transport key derivation) algorithm based on the encryption key of the encrypted BLE connection to generate a connection key for establishing a classic Bluetooth connection.
  • CTKD Cross-Transport Key Derivation, cross-transport key derivation
  • the first electronic device is paired with the second electronic device, so that the first electronic device and the second electronic device respectively obtain the encryption key of the BLE connection, and then pair the BLE connection according to the obtained encryption key.
  • the connection is encrypted.
  • Step 5016 The second electronic device executes the CTKD algorithm based on the encryption key of the encrypted BLE connection to generate a connection key for establishing a classic Bluetooth connection.
  • Step 5017 The first electronic device establishes a classic Bluetooth connection with the second electronic device according to the connection key.
  • Step 5018 The second electronic device establishes a classic Bluetooth connection with the second electronic device according to the connection key.
  • the first electronic device and the second electronic device respectively execute the CTKD algorithm to generate the encryption key used for the BLE connection according to the encryption key of the BLE connection.
  • a connection key for a classic Bluetooth connection is established, and then a classic Bluetooth connection between the first electronic device and the second electronic device is established according to the connection key.
  • steps 5011-5018 the steps performed by the first electronic device may independently form an embodiment, and the steps performed by the second electronic device may independently form an embodiment.
  • steps 5011-5018 can also form an embodiment alone, and do not need to be executed on the basis of FIG. 7 .
  • steps 5011-5018 can also be performed on the basis of the embodiment shown in Figure 5 or Figure 6, that is, how to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the established BLE connection connect.
  • the operating system of the first electronic device in the embodiment of the present application is an IOS (a name of an operating system) system.
  • the second electronic device needs to complete the corresponding authentication of the IOS system before establishing a Bluetooth connection with the first electronic device, and then establishing a connection between the application program and the second electronic device.
  • the limitations of the classic Bluetooth connection can only be established through the certification, which improves the efficiency of establishing a connection.
  • the IOS system cannot obtain the MAC information of the second electronic device through the interface, it is impossible to determine whether the current connection with the second electronic device is a classic Bluetooth connection, and the IOS system in the embodiment of the application supports the CTKD algorithm.
  • the connection key used to establish the classic Bluetooth connection is obtained, and then the classic Bluetooth connection with the second electronic device is established to ensure that the first electronic device can determine the classic Bluetooth connection established with the second electronic device.
  • the connection breaks the limitation that the IOS system cannot identify whether the current connection with the second electronic device is a classic Bluetooth connection, and improves the accuracy of establishing a connection with the second electronic device.
  • Step 405 The first electronic device establishes a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • Step 406 The second electronic device establishes a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • a classic Bluetooth connection can be established between the first electronic device and the second electronic device, and the classic Bluetooth connection between the first electronic device and the second electronic device can transmit data, then based on the classic Bluetooth
  • the connection can establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device.
  • the second electronic device in the process of establishing a classic Bluetooth connection, sends an ATT protocol connection request to the first electronic device, and the first electronic device receives the ATT protocol connection request sent by the second electronic device, and based on the ATT protocol connection request , establishing a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device.
  • the first electronic device sends an ATT protocol connection response of an ATT protocol connection request to the second electronic device, and the second electronic device is notified through the ATT protocol connection response to complete the established GATT over BR/EDR transmission channel.
  • the first electronic device determines that the GATT over BR/EDR transmission channel has not been established, it sends an ATT protocol connection request to the second electronic device, and establishes a connection request based on the ATT protocol for the application program to communicate with the second electronic device. GATT over BR/EDR transmission channel for communication between devices.
  • the situation that the first electronic device determines that the GATT over BR/EDR transmission channel has not been established includes:
  • the first electronic device receives the ATT protocol connection request sent by the second electronic device, but does not successfully establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the ATT protocol connection request.
  • the second electronic device sends an ATT protocol connection request to the first electronic device, and for the first electronic device, although the first electronic device receives the ATT protocol connection request sent by the second electronic device, the first electronic device The device cannot establish a GATT over BR/EDR transmission channel for communication with the second electronic device, that is, the first electronic device determines that the GATT over BR/EDR transmission channel has not been established.
  • the first electronic device does not receive the ATT protocol connection request sent by the second electronic device.
  • the second electronic device sends an ATT protocol connection request to the first electronic device, but for the first electronic device, the first electronic device may not be able to receive the ATT protocol connection request sent by the second electronic device, that is, It means that the first electronic device cannot establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device according to the ATT protocol connection request, so the first electronic device does not receive the ATT protocol sent by the second electronic device In the case of a connection request, it is determined that the GATT over BR/EDR transmission channel has not been established.
  • the first electronic device does not establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device by establishing a classic Bluetooth connection on the Bluetooth setting interface.
  • a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device will be established between the first electronic device and the second electronic device based on a classic Bluetooth connection, and a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device will be established.
  • the first electronic device Before the GATT over BR/EDR transmission channel for communication between electronic devices, the first electronic device needs to establish a classic Bluetooth connection with the second electronic device, and because the first electronic device determines that the classic Bluetooth connection has not been established through the Bluetooth setting interface, so It can also be determined that the GATT over BR/EDR transport channel is not established.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • the embodiment of the present application provides a method for establishing a connection. If a selection operation of the target device identifier is detected in the connection interface of the application program, based on the selection operation, a BLE connection between the application program and the second electronic device is established. Then establish a Bluetooth connection between the first electronic device and the second electronic device indicated by the target device identifier, and then automatically establish a GATT over BR/EDR between the application program and the second electronic device on the basis of the established Bluetooth connection Connection, GATT over BR/EDR connection can be established without multiple operations by the user, which simplifies user operations and improves the efficiency of connection establishment.
  • FIG. 9 shows a flowchart of a method for establishing a connection provided in an exemplary embodiment of the present application.
  • steps 601-602 are performed after step 406, and the method includes:
  • Step 601 the first electronic device disconnects the BLE connection between the first electronic device and the second electronic device.
  • Step 602 the second electronic device disconnects the BLE connection between the first electronic device and the second electronic device.
  • the BLE connection between the first electronic device and the second electronic device is used to trigger the establishment of a classic Bluetooth connection between the first electronic device and the second electronic device, and establish a connection between the first electronic device and the second electronic device.
  • the GATT over BR/EDR transmission channel is established. Since the application program in the first electronic device cannot recognize the BLE connection and the GATT over BR/EDR transmission channel at the same time, the GATT over BR/EDR transmission channel is established. After the channel, disconnect the BLE connection between the first electronic device and the second electronic device.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • steps 601-602 are performed after step 406 as an example for illustration.
  • steps 601-602 in the embodiment of the present application may also be executed after step 513, or after step 613, or after step 203, or after step 204. Examples are not limited.
  • the BLE connection between the first electronic device and the second electronic device is disconnected, excluding The interference of the BLE connection to the application program improves the communication efficiency between the application program and the second electronic device, reduces resource consumption of the BLE connection, and improves resource utilization.
  • FIG. 10 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application. Referring to FIG. 10 , after step 402, step 701 is also included, and step 403 is replaced by step 702. Methods include:
  • Step 701 The first electronic device acquires target parameters.
  • the target parameter is used to indicate whether the GATT over BR/EDR transmission channel has been established. If a BLE connection is established between the first electronic device and the second electronic device, the first electronic device first obtains the target parameter used to indicate whether the GATT over BR/EDR transmission channel has been established through the application program, and determines the application based on the obtained target parameter. Whether a GATT over BR/EDR transmission channel has been established between the program and the second electronic device.
  • the target parameter includes 1 bit. If the target parameter is 1, it indicates that a GATT over BR/EDR transmission channel has been established between the application program and the second electronic device. If the target parameter is 0, it indicates that no GATT over BR/EDR transmission channel has been established between the application program and the second electronic device. Or, if the target parameter is 0, it indicates that the GATT over BR/EDR transmission channel has been established between the application program and the second electronic device, and if the target parameter is 1, it indicates that the GATT over is not established between the application program and the second electronic device BR/EDR transmission channel.
  • the target parameter may also be expressed in other ways, and the embodiment of the present application does not limit the way of expressing the target parameter.
  • Step 702 When the target parameter indicates that the GATT over BR/EDR transmission channel has not been established, based on the BLE connection, the first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device.
  • the first electronic device After the first electronic device obtains the target parameter, it is determined according to the target parameter that the GATT over BR/EDR transmission channel has not been established, which means that the first electronic device needs to perform the steps of establishing a classic Bluetooth connection, and then establish a classic Bluetooth connection.
  • step 702 the process of establishing a classic Bluetooth connection in step 702 is similar to the process of establishing a Bluetooth connection in steps 403-404 above, and will not be repeated here.
  • the first electronic device first judges whether a GATT over BR/EDR transmission channel has been established between the application program and the second electronic device according to the obtained target parameters, and determines that the GATT over BR/EDR transmission channel has not been established In this case, perform the steps of establishing a classic Bluetooth connection to prevent the situation where the application program and the second electronic device have established a GATT over BR/EDR transmission channel, and continue to establish a GATT over BR/EDR transmission channel to save resources , to improve the efficiency of connection establishment.
  • the embodiment of the present application is only described by taking the case where the target parameter indicates that no GATT over BR/EDR transmission channel has been established as an example. In another embodiment, when the target parameter indicates that the GATT over BR/EDR transmission channel has been established, the above step 702 is not executed.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • step 701 is included after step 402, and step 403 is replaced by step 702 as an example for illustration.
  • step 701 may also be included after step 512 , and step 513 is replaced by step 702 .
  • FIG. 11 shows a flowchart of a method for displaying the device identification of at least one electronic device provided by an exemplary embodiment of the present application.
  • step 201 is replaced by step 801- 803, the method comprising:
  • Step 801 The first electronic device scans through an application program to obtain a device identification of at least one electronic device.
  • the first electronic device is installed with an application program, and the application program is used to scan to obtain the device identification of at least one electronic device.
  • step 801 scans to obtain the device identification of at least one electronic device, which is similar to the above-mentioned step 201 and will not be repeated here.
  • Step 802 The first electronic device screens the scanned device identifiers to obtain device identifiers whose electronic devices belong to the same device type as the target device type of the application.
  • the first electronic device needs to Filter the scanned device identifiers to obtain device identifiers whose electronic devices belong to the same device type as the target device type of the application program.
  • the electronic devices indicated by the obtained device identifiers are all managed by the application program of the first electronic device.
  • the first electronic device may establish a Bluetooth connection with any electronic device indicated by the screened device identifier.
  • the target device type of the application program is a type of electronic device that supports establishing a Bluetooth connection with the application program.
  • Step 803 The first electronic device displays the filtered device identification in the connection interface.
  • the first electronic device displays the screened device identifiers on the connection interface, and the user controls the first electronic device to perform step 202 by selecting a target device identifier among the displayed device identifiers.
  • the method provided in the embodiment of the present application screens at least one device identification obtained through scanning according to the target device type of the application program, so as to obtain the device identification whose electronic device belongs to the same device type as the target device type of the application program, and excludes the The device identification of different target device types of the application prevents interference from other electronic devices and improves the efficiency of establishing a connection.
  • FIG. 12 shows a flowchart of a method for establishing a connection provided by an exemplary embodiment of the present application.
  • step 202 is replaced with steps 901-903, and the method includes :
  • Step 901 The first electronic device responds to the operation of selecting the target device ID in the device ID of at least one electronic device, and controls the application program when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel Display prompt information.
  • the first electronic device if the first electronic device detects the selection operation of the target device identifier, if the second electronic device does not support the CTKD algorithm, but supports the GATT over BR/EDR transmission channel, the first electronic device will pass the control application
  • the program displays prompt information to guide the user to control the first electronic device to establish a classic Bluetooth connection with the second electronic device.
  • Step 902 The first electronic device displays the Bluetooth setting interface of the first electronic device system in response to the confirmation operation on the prompt information.
  • the first electronic device After the first electronic device displays the prompt information, if the user triggers a confirmation operation on the prompt information, the first electronic device displays the Bluetooth setting interface of the first electronic device system in response to the confirmation operation on the prompt information.
  • the Bluetooth setting interface includes a device identifier of at least one electronic device, and the device identifier of at least one electronic device includes a target device identifier of a second electronic device.
  • Step 903 The first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth device interface.
  • the first electronic device displays the Bluetooth setting interface, and establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth setting interface.
  • the Bluetooth setting interface displayed by the first electronic device includes the target device identifier of the second electronic device, and the user controls the first electronic device to respond to the target device identifier by triggering the selection operation of the target device identifier. Select the operation to establish a classic Bluetooth connection with the second electronic device.
  • the first electronic device sends a Bluetooth connection request to the second electronic device based on the Bluetooth device interface, and the second electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth connection request.
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • this embodiment of the present application is illustrated by performing steps 901-903 in response to the operation of selecting the target device ID in the device ID of at least one electronic device as an example.
  • the target device determined by the first electronic device The identification can also be considered as the second electronic device.
  • the first electronic device responds to the selection operation of the target device identification in the device identification of at least one electronic device, it can also be understood as the first electronic device responding to at least one electronic device.
  • the selection operation of the second device identifier in the device identifier determines that an operation of establishing a connection between the application program and the second electronic device is received.
  • the first electronic device responds to the operation of establishing a connection between the application program and the second electronic device, and when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel, the control application program displays a prompt message, and responds to The confirmation operation of the prompt information displays the bluetooth setting interface of the first electronic device system, and establishes a classic bluetooth connection between the first electronic device and the second electronic device based on the bluetooth device interface.
  • connection operation between the application program and the second electronic device is further performed to establish a classic Bluetooth connection, which is not limited in this embodiment of the present application.
  • step 202 is replaced with steps 901-903 as an example.
  • step 511 may also be replaced with steps 901-903, which is not limited in this embodiment of the present application.
  • the first electronic device when it is determined that the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel, the first electronic device establishes the Bluetooth setting interface based on the switching display of the first electronic device system
  • the classic Bluetooth connection between the second electronic device and the establishment of a GATT over BR/EDR transmission channel between the application program and the second electronic device expand the way to establish a classic Bluetooth connection and improve the efficiency of connection establishment.
  • the first electronic device will not perform step 202, but the first electronic device responds A BLE connection between the first electronic device and the second electronic device is established based on the operation of selecting the target device identifier in the device identifiers of at least one electronic device.
  • the establishment of the BLE connection between the first electronic device and the second electronic device by the first electronic device is similar to the above steps 401-402, and will not be repeated here.
  • the first electronic device sends a Bluetooth connection request to the second electronic device in response to the operation of selecting the target device identifier in the device identifiers of at least one electronic device, and the second electronic device establishes a connection with the first electronic device based on the Bluetooth connection request.
  • the first electronic device can establish a classic Bluetooth connection with the second electronic device by displaying the Bluetooth setting interface. connect.
  • the first electronic device controls the application program to display a prompt message when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel.
  • the first electronic device displays the Bluetooth setting interface of the first electronic device system in response to the confirmation operation of the prompt information, and the first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth device interface.
  • the process for the first electronic device to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth setting interface is similar to the above steps 901-903, and will not be repeated here.
  • the above-mentioned embodiments are described by taking the establishment of a BLE connection between the first electronic device and the second electronic device and the establishment of a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth setting interface as examples. .
  • the first electronic device it is also possible for the first electronic device to establish a BLE connection between the first electronic device and the second electronic device in response to the operation of selecting the target device identifier in the device identifiers of at least one electronic device.
  • the control application program displays the prompt information
  • the first electronic device responds to the confirmation operation of the prompt information, and displays the bluetooth setting of the first electronic device system Interface
  • the first electronic device establishes a classic Bluetooth connection between the first electronic device and the second electronic device based on the Bluetooth device interface, and then establishes a GATT over BR/EDR transmission channel between the application program and the second electronic device based on the classic Bluetooth connection .
  • the embodiment of the present application is described by taking the first electronic device to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device as an example.
  • the first The electronic device may also establish another transmission channel for communication between the application program and the second electronic device, which is not limited in this embodiment of the present application.
  • connection establishment device is applied to the first electronic equipment, and the connection establishment device includes:
  • the display module 1001 is configured to display the device identification of at least one electronic device scanned by the application program in the connection interface of the application program;
  • a connection establishment module 1002 configured to establish a Bluetooth connection between the first electronic device and the second electronic device in response to selecting a target device ID in the device ID of at least one electronic device, where the target device ID indicates the second electronic device;
  • the channel establishment module 1003 is configured to establish a general attribute GATT over BR/EDR transmission channel based on the basic rate and the enhanced rate for communication between the application program and the second electronic device based on the Bluetooth connection.
  • a selection operation of the target device identifier is detected in the connection interface of the application program, based on the selection operation, a Bluetooth connection between the application program and the second electronic device is established, and then the established Based on the Bluetooth connection, the GATT over BR/EDR transmission channel for communication between the application program and the second electronic device is established, and the GATT over BR/EDR transmission channel can be established without multiple operations by the user, which simplifies the user operation , to improve the efficiency of establishing a connection.
  • connection establishment module 1002 is configured to:
  • the channel establishment module 1003 is configured to establish a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • connection establishment module 1002 includes:
  • the sending unit 10021 is configured to send an access request to the second electronic device based on the BLE connection, and the access request is used to access the BLE encrypted service of the second electronic device;
  • the receiving unit 10022 is configured to receive an error message returned by the second electronic device when the BLE connection is a non-encrypted BLE connection, the error message is sent by the second electronic device in response to the access request, and the error message is used to indicate that the encrypted BLE connection Access the BLE encryption service under;
  • Establishing unit 10023 configured to establish an encrypted BLE connection with the second electronic device in response to the error message
  • the generation unit 10024 is used to execute the CTKD algorithm based on the encryption key of the encrypted BLE connection to generate a connection key for establishing a classic Bluetooth connection;
  • the establishing unit 10023 is configured to establish a classic bluetooth connection with the second electronic device according to the connection key.
  • the establishment unit 10023 is configured to:
  • the establishment unit 10023 is configured to:
  • connection confirmation interface including the target device identification of the second electronic device
  • the second electronic device In response to the confirmation operation in the connection confirmation interface, the second electronic device is paired to obtain the encryption key for the BLE connection.
  • the channel establishment module 1003 is configured to:
  • a GATT over BR/EDR transmission channel for communication between the application program and the second electronic device is established.
  • the channel establishment module 1003 is configured to send an ATT protocol connection request to the second electronic device when it is determined that the GATT over BR/EDR transmission channel is not established, and establish a connection request for the application program and the second electronic device based on the ATT protocol connection request. GATT over BR/EDR transmission channel for communication between the second electronic devices.
  • the device further includes:
  • a disconnection module 1004 configured to disconnect the BLE connection between the application program and the second electronic device.
  • the device further includes:
  • the parameter acquisition module 1005 is used to acquire the target parameter, and the target parameter is used to indicate whether the GATT over BR/EDR transmission channel has been established;
  • a connection establishment module 1002 configured to perform the step of establishing a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection when the target parameter indicates that the GATT over BR/EDR transmission channel has not been established.
  • a display module 1001 includes:
  • a scanning unit 10011 configured to obtain the device identification of at least one electronic device through application scanning
  • the screening unit 10012 is configured to screen the scanned device identifiers to obtain device identifiers whose electronic devices belong to the same device type as the target device type of the application program;
  • the display unit 10013 is configured to display the filtered device identification in the connection interface.
  • connection establishment module 1002 is configured to:
  • the control application program In response to the selection operation of the target device ID in the device ID of at least one electronic device, when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel, the control application program displays a prompt message;
  • a classic Bluetooth connection between the first electronic device and the second electronic device is established based on the Bluetooth device interface.
  • connection establishment module 1002 is configured to:
  • the second electronic device in response to the selection operation of the target device identification in the device identification of at least one electronic device, establish the connection between the first electronic device and the second electronic device.
  • the control application program In response to the selection operation of the target device ID in the device ID of at least one electronic device, when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel, the control application program displays a prompt message;
  • a classic Bluetooth connection between the first electronic device and the second electronic device is established based on the Bluetooth device interface.
  • the operating system of the first electronic device is an IOS system.
  • the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to the needs.
  • the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
  • the device and the method embodiment provided by the above embodiment belong to the same idea, and the specific implementation process thereof is detailed in the method embodiment, and will not be repeated here.
  • connection establishment device is applied to the second electronic device, and the connection establishment device includes:
  • the sending module 1201 is configured to send a BLE broadcast, the BLE broadcast includes device information of the second electronic device, and the device information is used to display the target device identifier of the second electronic device on the first electronic device;
  • the connection establishment module 1202 is configured to establish a Bluetooth connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device, and the Bluetooth connection request is performed by the first electronic device in response to the selection operation of the target device identifier trigger;
  • the channel establishment module 1203 is configured to establish a GATT over BR/EDR transmission channel for communication with the application program based on the Bluetooth connection.
  • connection establishment module 1202 is configured to:
  • the channel establishment module 1203 is configured to establish a GATT over BR/EDR transmission channel for communication with the application program based on the classic Bluetooth connection.
  • connection establishment module 1202 includes:
  • the receiving unit 12021 is configured to receive the access request sent by the first electronic device based on the BLE connection, and start the BLE encryption service of the second electronic device;
  • the sending unit 12022 is used to send an error message to the first electronic device in response to the access request when the BLE connection is a non-encrypted BLE connection, and the error message is used to indicate access to the BLE encryption service under the encrypted BLE connection;
  • Establishing unit 12023 configured to establish an encrypted BLE connection with the second electronic device
  • the obtaining unit 12024 is used to obtain the connection key according to the CTKD algorithm and the encryption key based on the encrypted BLE connection;
  • the establishing unit 12023 is configured to establish a classic bluetooth connection with the second electronic device according to the connection key.
  • the establishing unit 12023 is configured to:
  • the channel establishment module 1203 is configured to:
  • an ATT protocol connection request is sent to the first electronic device; the first electronic device is used to establish a GATT over BR/EDR transmission channel between the application program and the second electronic device based on the ATT protocol connection request.
  • the channel establishment module 1203 is configured to:
  • the GATT over BR/EDR transmission channel When the GATT over BR/EDR transmission channel is not established, the ATT protocol connection request sent by the first electronic device is received, and the GATT over BR/EDR transmission channel with the application is established in response to the ATT protocol connection request.
  • the device also includes:
  • a disconnection module 1204 configured to disconnect the BLE connection between the second electronic device and the first electronic device.
  • connection establishment module 1202 is configured to receive the Bluetooth connection request sent by the first electronic device and establish the first electronic device when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel.
  • connection establishment module 1202 is configured to receive the Bluetooth connection request sent by the first electronic device when the second electronic device does not support the CTKD algorithm and does not support the GATT over BR/EDR transmission channel, and establish the first a BLE connection between the electronic device and the second electronic device;
  • a connection establishment module 1202 configured to receive a Bluetooth connection request sent by the first electronic device when the second electronic device does not support the CTKD algorithm and supports the GATT over BR/EDR transmission channel, and establish the first electronic device and the second electronic device Classic Bluetooth connection between.
  • the operating system of the first electronic device is an IOS system.
  • connection establishment device is applied to the first electronic equipment, and the connection establishment device includes:
  • a connection establishment module 1002 configured to send a Bluetooth establishment request to the second electronic device in response to the operation of establishing a connection between the application program and the second electronic device, and establish a BLE connection between the first electronic device and the second electronic device , the application program is an application program matched with the second electronic device, and the first electronic device does not support the second electronic device to directly call an interface for establishing a classic Bluetooth connection in the first electronic device;
  • the connection establishment module 1002 is further configured to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection;
  • the channel establishment module 1003 is configured to establish a transmission channel for communication between the application program and the second electronic device based on the classic Bluetooth connection.
  • a selection operation of the target device identifier is detected in the connection interface of the application program, based on the selection operation, a Bluetooth connection between the application program and the second electronic device is established, and then the established Based on the Bluetooth connection, the GATT over BR/EDR transmission channel for communication between the application program and the second electronic device is established, and the GATT over BR/EDR transmission channel can be established without multiple operations by the user, which simplifies the user operation , to improve the efficiency of establishing a connection.
  • connection establishment module 1002 includes:
  • the sending unit 10021 is configured to send an access request to the second electronic device based on the BLE connection, and the access request is used to access the BLE encryption service of the second electronic device;
  • the receiving unit 10022 is configured to receive an error message returned by the second electronic device when the BLE connection is a non-encrypted BLE connection, the error message is sent by the second electronic device in response to the access request, and the error message is used to indicate that the encrypted BLE connection Access the BLE encryption service under;
  • Establishing unit 10023 configured to establish an encrypted BLE connection with the second electronic device in response to the error message
  • the generation unit 10024 is used to execute the CTKD algorithm based on the encryption key of the encrypted BLE connection to generate a connection key for establishing a classic Bluetooth connection;
  • the establishing unit 10023 is configured to establish a classic bluetooth connection with the second electronic device according to the connection key.
  • the establishment unit 10023 is configured to:
  • the establishment unit 10023 is configured to:
  • connection confirmation interface including the target device identification of the second electronic device
  • the second electronic device In response to the confirmation operation in the connection confirmation interface, the second electronic device is paired to obtain the encryption key for the BLE connection.
  • the channel establishment module 1003 is configured to:
  • a transmission channel for communication between the application program and the second electronic device is established.
  • the channel establishment module 1003 is configured to send an ATT protocol connection request to the second electronic device when it is determined that the transmission channel has not been established, and establish a link between the application program and the second electronic device based on the ATT protocol connection request. transmission channel for inter-communication.
  • the device further includes:
  • a disconnection module 1004 configured to disconnect the BLE connection between the application program and the second electronic device.
  • the device further includes:
  • a parameter acquisition module 1005 configured to acquire a target parameter, where the target parameter is used to indicate whether a transmission channel has been established;
  • the connection establishment module 1002 is configured to execute the step of establishing a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection when the target parameter indicates that no transmission channel has been established.
  • the device further includes:
  • a display module 1001 configured to display the device identification of at least one electronic device scanned by the application program in the connection interface of the application program;
  • a connection establishing module 1002 configured to determine that an operation of establishing a connection between the application program and the second electronic device is received in response to an operation of selecting the second device identifier in the device identifiers of the at least one electronic device.
  • a display module 1001 includes:
  • a scanning unit 10011 configured to obtain the device identification of at least one electronic device through application scanning
  • the screening unit 10012 is configured to screen the scanned device identifiers to obtain device identifiers whose electronic devices belong to the same device type as the target device type of the application program;
  • the display unit 10013 is configured to display the filtered device identification in the connection interface.
  • connection establishment module 1002 is configured to:
  • a classic Bluetooth connection between the first electronic device and the second electronic device is established based on the Bluetooth device interface.
  • connection establishment module 1002 is configured to:
  • the control application program in response to the operation of establishing a connection between the application program and the second electronic device, send a Bluetooth establishment request to the second electronic device, and establish the connection between the first electronic device and the second electronic device.
  • a classic Bluetooth connection between the first electronic device and the second electronic device is established based on the Bluetooth device interface.
  • the operating system of the first electronic device is an IOS system.
  • connection establishment device is applied to the second electronic device, and the connection establishment device includes:
  • a connection establishment module 1202 configured to establish a BLE connection with the first electronic device according to the received Bluetooth connection request sent by the first electronic device, and the Bluetooth connection request is established by the first electronic device in response to Triggered by a connection operation between an application program and the second electronic device, the application program is an application program that matches the second electronic device, and the first electronic device does not support the second electronic device to directly call the first electronic device.
  • a connection establishment module 1202 configured to establish a classic Bluetooth connection between the first electronic device and the second electronic device based on the BLE connection;
  • the channel establishment module 1203 is configured to establish a transmission channel for communication with the application program based on the classic Bluetooth connection.
  • connection establishment module 1202 is configured to:
  • the channel establishment module 1203 is configured to establish a transmission channel for communication with the application program based on the classic Bluetooth connection.
  • connection establishment module 1202 includes:
  • the receiving unit 12021 is configured to receive the access request sent by the first electronic device based on the BLE connection, and start the BLE encryption service of the second electronic device;
  • the sending unit 12022 is used to send an error message to the first electronic device in response to the access request when the BLE connection is a non-encrypted BLE connection, and the error message is used to indicate access to the BLE encrypted service under the encrypted BLE connection;
  • Establishing unit 12023 configured to establish an encrypted BLE connection with the second electronic device
  • the obtaining unit 12024 is used to obtain the connection key according to the CTKD algorithm and the encryption key based on the encrypted BLE connection;
  • the establishing unit 12023 is configured to establish a classic bluetooth connection with the second electronic device according to the connection key.
  • the establishing unit 12023 is configured to:
  • the channel establishment module 1203 is configured to:
  • an ATT protocol connection request is sent to the first electronic device; the first electronic device is used to establish a transmission channel between the application program and the second electronic device based on the ATT protocol connection request.
  • the sending module 1201 is configured to send a BLE broadcast, the BLE broadcast includes device information of the second electronic device, and the device information is used to display the target of the second electronic device on the first electronic device Equipment Identity.
  • the channel establishment module 1203 is configured to:
  • the ATT protocol connection request sent by the first electronic device is received, and the transmission channel with the application program is established in response to the ATT protocol connection request.
  • the device also includes:
  • a disconnection module 1204 configured to disconnect the BLE connection between the second electronic device and the first electronic device.
  • connection establishment module 1202 is configured to receive a Bluetooth connection request sent by the first electronic device and establish a connection between the first electronic device and the second electronic device when the second electronic device does not support the CTKD algorithm and supports the transmission channel.
  • Classic Bluetooth connection between devices is configured to receive a Bluetooth connection request sent by the first electronic device and establish a connection between the first electronic device and the second electronic device when the second electronic device does not support the CTKD algorithm and supports the transmission channel.
  • connection establishment module 1202 is configured to receive the Bluetooth connection request sent by the first electronic device when the second electronic device does not support the CTKD algorithm and the transmission channel, and establish the connection between the first electronic device and the second electronic device. BLE connection between electronic devices;
  • connection establishment module 1202 is configured to receive a Bluetooth connection request sent by the first electronic device and establish a connection between the first electronic device and the second electronic device when the second electronic device does not support the CTKD algorithm and supports the transmission channel. classic bluetooth connection.
  • the operating system of the first electronic device is an IOS system.
  • the present application also provides a computer-readable medium on which program instructions are stored, and when the program instructions are executed by a processor, the connection establishment methods provided in the foregoing method embodiments are implemented.
  • the present application also provides a computer program product containing instructions, which, when run on a computer, causes the computer to execute the connection establishment method of each of the above embodiments.
  • the present application also provides a chip, the chip includes a programmable logic circuit and/or program instructions, and when the chip runs on the first electronic device or the second electronic device, it is used to implement the connection establishment method of each of the above-mentioned embodiments .

Landscapes

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

Abstract

本申请公开了一种连接建立方法、装置、电子设备及存储介质,属于无线连接技术领域。方法包括:在应用程序的连接界面中,显示应用程序扫描得到的至少一个电子设备的设备标识;响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的蓝牙连接,目标设备标识指示第二电子设备;基于蓝牙连接,建立用于应用程序与第二电子设备之间通信的在基础速率和增强速率基础上的通用属性GATT over BR/EDR传输通道,无需用户多次操作,即能建立GATT over BR/EDR连接,简化了用户操作,提高建立连接的效率。

Description

连接建立方法、装置、电子设备及存储介质
本申请要求于2021年5月27日提交的申请号为202110587719.X、发明名称为“连接建立方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及无线连接技术领域,特别涉及一种连接建立方法、装置、电子设备及存储介质。
背景技术
随着蓝牙技术的广泛应用,很多厂商会生产蓝牙设备,并且还会开发用于管理蓝牙设备的应用程序,任一安装有该应用程序的设备可以通过该应用程序与该蓝牙设备进行通信。
发明内容
本申请实施例提供了一种连接建立方法、装置、电子设备及存储介质,无需用户多次操作,即能建立GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的效率。技术方案如下:
根据本申请实施例的一方面,提供了一种连接建立方法,应用于第一电子设备,所述方法包括:
在应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,所述目标设备标识指示所述第二电子设备;
基于所述蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
根据本申请实施例的一方面,提供了一种连接建立方法,应用于第二电子设备,所述方法包括:
发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识;
根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,所述蓝牙连接请求由所述第一电子设备响应于对所述目标设备标识的选中操作触发;
基于所述蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道。
根据本申请实施例的一方面,提供了一种连接建立方法,应用于第一电子设备,所述方法包括:
响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与第二电子设备之间的BLE连接,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
根据本申请实施例的一方面,提供了一种连接建立方法,应用于第二电子设备,所述方法包括:
根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与第一电子设备之间的BLE连接,所述蓝牙连接请求由所述第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道。
根据本申请实施例的另一方面,提供了一种连接建立装置,应用于第一电子设备,所述装置包括:
显示模块,用于在应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
连接建立模块,用于响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,所述目标设备标识指示所述第二电子设备;
通道建立模块,用于基于所述蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
根据本申请实施例的另一方面,提供了一种连接建立装置,应用于第二电子设备,所述装置包括:
发送模块,用于发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识;
连接建立模块,用于根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,所述蓝牙连接请求由所述第一电子设备响应于对所述目标设备标识的选中操作触发;
通道建立模块,用于基于所述蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传 输通道。
根据本申请实施例的另一方面,提供了一种连接建立装置,应用于第一电子设备,所述装置包括:
连接建立模块,用于响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与第二电子设备之间的BLE连接,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
所述连接建立模块,还用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
通道建立模块,用于基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
根据本申请实施例的另一方面,提供了一种连接建立装置,应用于第二电子设备,所述装置包括:
连接建立模块,用于根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的BLE连接,所述蓝牙连接请求由所述第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
所述连接建立模块,还用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
通道建立模块,用于基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道。
根据本申请实施例的另一方面,提供了一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如上第一方面或第二方面所述的连接建立方法。
根据本申请实施例的另一方面,提供了一种计算机可读存储介质,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如上述方面所述的连接建立方法。
根据本申请的一个方面,提供了一种计算机程序产品,当所述计算机程序产品被第一电子设备或第二电子设备的处理器执行时,其用于实现上述方面所述的连接建立方法。
根据本申请的一个方面,提供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片在第一电子设备或第二电子设备上运行时,用于实现如上述方面所述的连接建立方法。
附图说明
图1示出了本申请一个示例性实施例提供的电子设备的结构方框图;
图2示出了本申请一个示例性实施例提供的手机与耳机之间连接的示意图;
图3示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图4示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图5示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图6示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图7示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图8示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图9示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图10示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图11示出了本申请一个示例性实施例提供的显示至少一个电子设备的设备标识的方法的流程图;
图12示出了本申请一个示例性实施例提供的一种连接建立方法的流程图;
图13示出了本申请一个示例性实施例提供的连接建立装置的结构框图;
图14示出了本申请一个示例性实施例提供的连接建立装置的结构框图;
图15示出了本申请一个示例性实施例提供的连接建立装置的结构框图;
图16示出了本申请一个示例性实施例提供的连接建立装置的结构框图。
具体实施方式
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请实施例、实施方式及其特征在不冲突的情况下,可以相互组合。
请参考图1,其示出了本申请一个示例性实施例提供的电子设备的结构方框图。在一些实施例中,电子设备100是智能手机、平板电脑、可穿戴设备等能够作为无线站点接入无线局域网的电子设备。本申请中的电子设备100至少包括一个或多个以下部件:处理器110、存储器120和至少两个无线链路130。
在一些实施例中,处理器110包括一个或者多个处理核心。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的程序代码,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。在一些实施例中,处理器110采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110能集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligence,AI)功能;调制解调器用于处理无线通信。能够理解的是,上述调制解调器也能不集成到处理器110中,单独通过一块芯片进行实现。
在一些实施例中,该处理器110用于控制至少两个无线链路130的工作状况,相应的,该处理器110为集成了无线保真(Wireless Fidelity,Wi-Fi)芯片的处理器。其中,该Wi-Fi芯片为具有双Wi-Fi处理能力的芯片。例如,该Wi-Fi芯片为双频双发(Dual Band Dual Concurrent,DBDC)芯片,或者,双频同步(Dual Band Simultaneous,DBS)芯片等。
在一些实施例中,存储器120包括随机存储器(Random Access Memory,RAM),在一些实施例中,存储器120包括只读存储器(Read-Only Memory,ROM)。在一些实施例中,该存储器120包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器120可用于存储程序代码。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据电子设备100的使用所创建的数据(比如音频数据、电话本)等。
在一些实施例中,存储器120中存储有不同的无线链路130的接收信标帧的接收方案。以及,不同的无线链路130连接的接入节点的标识、无线链路130的标识等。
该至少两个无线链路130用于连接不同的接入节点(Access Point,AP)。接收AP下发的下行数据。其中,该不同的接入节点为同一路由器中的接入节点或者不同路由器中的接入节点。
在一些实施例中,电子设备100中还包括显示屏。显示屏是用于显示用户界面的显示组件。在一些实施例中,该显示屏为具有触控功能的显示屏,通过触控功能,用户可以使用手指、触摸笔等任何适合的物体在显示屏上进行触控操作。在一些实施例中,显示屏通常设置在电子设备100的前面板。在一些实施例中,显示屏被设计成为全面屏、曲面屏、异型屏、双面屏或折叠屏。在一些实施例中,显示屏还被设计成为全面屏与曲面屏的结合,异型屏与曲面屏的结合等,本实施例对此不加以限定。
除此之外,本领域技术人员能够理解,上述附图所示出的电子设备100的结构并不构成对电子设备100的限定,电子设备100包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,电子设备100中还包括麦克风、扬声器、输入单元、传感器、音频电路、模块、电源、蓝牙模块等部件,在此不再赘述。
在一些实施例中,电子设备包括第一电子设备和第二电子设备,该第一电子设备为手机,第二电子设备为耳机。在本申请实施例中,手机在应用程序的连接界面中,显示应用程序扫描得到的至少一个耳机的设备标识,响应于对至少一个耳机的设备标识中目标耳机的选中操作,建立手机与耳机之间的蓝牙连接,基于蓝牙连接,建立用于应用程序与耳机之间通信的GATT over BR/EDR传输通道。
在另一些实施例中,电子设备包括第一电子设备和第二电子设备,该第一电子设备为手机,第二电子设备为耳机。在本申请实施例中,手机响应于建立应用程序与第二电子设备的连接操作,向第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接,基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接,基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的传输通道。
以图2为例,对本申请所涉及的手机和耳机之间的蓝牙连接和传输通道进行说明。参见图2,该手机和耳机之间可以建立BLE连接21,并且手机和耳机之间还可以基于BLE连接21建立经典蓝牙连接22,再基于已建立的经典蓝牙连接22建立应用程序与耳机之间的传输通道23。
本申请实施例提供的连接建立方法,应用在第一电子设备和第二电子设备首次建立连接的场景中,第一电子设备和第二电子设备通过执行本申请实施例提供的连接建立方法,用户通过触发第一电子设备显示的第二电子设备的目标设备标识,建立第一电子设备与第二电子设备之间的蓝牙连接,进而建立第一电子设备的应用程序与第二电子设备之间的GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的 效率。
又或者,本申请实施例提供的连接建立方法,应用在第一电子设备和第二电子设备首次建立连接的场景中,第一电子设备和第二电子设备通过执行本申请实施例提供的连接建立方法,用户通过触发建立应用程序与第二电子设备的连接操作,建立第一电子设备与第二电子设备之间的BLE连接,再基于BLE连接建立第一电子设备与第二电子设备之间的经典蓝牙连接,进而基于经典蓝牙连接建立第一电子设备的应用程序与第二电子设备之间的传输通道,简化了用户操作,提高建立连接的效率。
图3示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图3,该方法应用于第一电子设备中,该方法包括:
步骤201:在应用程序的连接界面中,第一电子设备显示应用程序扫描得到的至少一个电子设备的设备标识。
在本申请实施例中,第一电子设备安装有应用程序,通过该应用程序进行扫描,以得到至少一个电子设备的设备标识,进而在应用程序的连接界面中显示得到的至少一个电子设备的设备标识。在一些实施例中,该应用程序为用于管理至少一个电子设备的程序。第一电子设备通过该应用程序对已建立连接的其他电子设备进行控制。例如,第一电子设备通过该应用程序对其他电子设备的固件进行升级,或者,通过该应用程序对其他电子设备的设置进行修改,或者通过该应用程序对其他电子设备执行其他操作,本申请实施例不做限定。其中,应用程序扫描得到至少一个电子设备的设备标识的步骤包括:至少一个电子设备广播无线信号,第一电子设备控制应用程序进行扫描,接收至少一个电子设备广播的无线信号,该无线信号中包括电子设备的设备标识,因此应用程序通过扫描到的无线信号得到至少一个电子设备的设备标识,在该应用程序的连接界面中显示扫描到的至少一个电子设备的设备标识。
在一些实施例中,第一电子设备通过应用程序进行BLE扫描,以获取至少一个电子设备的设备标识。或者,第一电子设备通过应用程序进行经典蓝牙扫描,以获取至少一个电子设备的设备标识。
例如,该电子设备的设备标识包括电子设备的名称、电子设备的账号、电子设备的用户名、电子设备的图标或者其他标识。
其中,第一电子设备扫描到的至少一个电子设备包括耳机、音响、冰箱或者其他类型的设备,本申请不作限定。
步骤202:第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的蓝牙连接。
在本申请实施例中,连接界面中显示有至少一个电子设备的设备标识,每个设备标识指示一个电子设备,且目标设备标识指示第二电子设备,若用户需要建立第一电子设备与第二电子设备之间的蓝牙连接,则用户在连接界面中触发对第二电子设备的目标设备标识的选中操作,第一电子设备响应于对连接界面中目标设备标识的选中操作,建立该第一电子设备与第二电子设备之间的蓝牙连接。
其中,选中操作为点击操作、长按操作、双击操作或者其他类型的操作。该蓝牙连接为经典蓝牙连接,与BLE连接不同。
在一些实施例中,第一电子设备确定的目标设备标识也就是可以认为是第二电子设备,第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作时,也可以理解为是第一电子设备响应于对至少一个电子设备的设备标识中第二设备标识的选中操作,确定接收到建立应用程序与第二电子设备的连接操作。
需要说明的是,本申请实施例是以在连接界面中通过对第二电子设备的选中操作,确定接收到连接操作为例进行说明,在其他实施例中,还可以通过其他方式确定接收到建立应用程序与第二电子设备的连接操作,本申请实施例不作限定。
其中,本申请实施例是以建立蓝牙连接为例进行说明。而在一些实施例中,在第一电子设备确定接收到建立应用程序与第二电子设备的连接操作时,则第一电子设备响应于建立应用程序与第二电子设备的连接操作,向第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接,基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接,基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的传输通道。
步骤203:第一电子设备基于蓝牙连接,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在本申请实施例中,第一电子设备安装的应用程序还会与第二电子设备之间建立连接,若第一电子设备完成建立与第二电子设备之间的蓝牙连接,第一电子设备在蓝牙连接的基础上,建立用于应用程序与第二电子设备之间的GATT(Generic Attribute Profile,通用属性配置文件)over BR(Basic Rate,基本速率)/EDR(Enhanced Data Rate,增强数据速率)之间通信的传输通道,实现第一电子设备与第二电子设备之间通过GATT over BR/EDR传输通道进行通信。
需要说明的是,本申请实施例仅是以第一电子设备基于蓝牙连接建立,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明。而在另一实施例中,若第一电子设备未成功建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道,则第一电子设备会重新执行步骤203,以成功建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道。
另外,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
本申请实施例提供了一种连接建立方法,若在应用程序的连接界面中检测到对目标设备标识的选中操作,则基于该选中操作,建立应用程序与第二电子设备之间的蓝牙连接,进而在已建立的蓝牙连接的基础上,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,无需用户多次操作,即能建立GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的效率。
并且,通过建立应用程序与第二电子设备之间的GATT over BR/EDR连接,该GATT over BR/EDR传输通道基于蓝牙连接进行通信,保证了蓝牙连接的通信速率,提高了数据传输效率。
图4示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图4,该方法应用于第二电子设备中,该方法包括:
步骤301:第二电子设备发送BLE广播。
其中,BLE广播包括第二电子设备的设备信息,该设备信息用于在第一电子设备上显示第二电子设备的目标设备标识。
在一些实施例中,设备信息中包括第二电子设备的目标设备标识和MAC(Media Access Control Address,媒体访问控制)信息。该MAC信息用于建立第一电子设备与第二电子设备之间的蓝牙连接。
在本申请实施例中,第二电子设备发送BLE广播,任一电子设备在第二电子设备的广播范围内时,该任一电子设备可以通过扫描的方式接收第二电子设备发送的BLE广播。
第一电子设备扫描第二电子设备发送的BLE广播后,根据该BLE广播获取第二电子设备的设备信息,进而基于该设备信息显示第二电子设备的目标设备标识。
例如,该第二电子设备的目标设备标识采用目标设备的设备名称表示,则第一电子设备显示目标设备的设备名称。又例如,该第二电子设备的目标设备标识采用目标设备的账号表示,则第一电子设备显示目标设备的账号。
在一些实施例中,第一电子设备显示的目标设备标识为第二电子设备的图标,则第一电子设备根据第二电子设备的设备信息生成图标,进而显示生成的图标。
第一电子设备通过应用程序进行扫描,以扫描得到第二电子设备发送的BLE广播,进而得到该BLE广播中包括的目标设备标识,显示得到的目标设备标识。
步骤302:第二电子设备根据接收到的第一电子设备发送的蓝牙连接请求,建立与第一电子设备之间的蓝牙连接。
其中,蓝牙连接请求由第一电子设备响应于对目标设备标识的选中操作触发。
在本申请实施例中,第一电子设备显示扫描到的第二电子设备的目标设备标识,若用户需要建立第一电子设备与第二电子设备之间的蓝牙连接,则执行选中第二电子设备的目标设备标识的操作,第一电子设备响应于该选择操作向第二电子设备发送蓝牙连接请求,第二电子设备根据该蓝牙连接请求建立与第一电子设备之间的蓝牙连接。
步骤303:第二电子设备基于蓝牙连接,建立用于与应用程序之间通信的GATT over BR/EDR传输通道。
在本申请实施例中,第一电子设备安装的应用程序还会与第二电子设备之间建立连接,若第二电子设备完成建立与第一电子设备之间的蓝牙连接,则在蓝牙连接的基础上,建立用于应用程序与第二电子设备之间的GATT over BR/EDR之间通信的传输通道,实现第一电子设备与第二电子设备之间通过GATT over BR/EDR传输通道进行通信。
其中,本申请实施例是以建立蓝牙连接为例进行说明。而在一些实施例中,在第一电子设备确定接收到建立应用程序与第二电子设备的连接操作时,则第一电子设备响应于建立应用程序与第二电子设备的连接操作,向第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接,基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接,基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的传输通道。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
本申请实施例提供的方法,若第一电子设备检测到对已显示的目标设备标识的选中操作,则基于该选中操作,向第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的蓝牙连接,进而在已建立的蓝牙连接的基础上,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,无需用户多次操作,即能建立GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的效率。
图5示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图5,该方法应用于第一电子设备中,该方法包括:
步骤511:第一电子设备响应于建立应用程序与第二电子设备的连接操作,向第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接,应用程序为与第二电子设备匹配的应用程序,第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口。
其中,第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口,也就是说若第一电子设备与第二电子设备之间需要建立经典蓝牙连接时,与该第二电子设备匹配的应用程序无法直接调用第一电子设备中用于建立经典蓝牙连接的接口,也就是无法直接通过该应用程序建立第一电子设备与第二电子设备之间的经典蓝牙连接。用户需要先通过系统中的蓝牙设置界面来完成二者的经典蓝牙连接,这样会使得用户的操作复杂化。
需要说明的是,本申请实施例中的应用程序用于管理第二电子设备,并且还可以对已建立连接的第二电子设备进行控制,也就是说应用程序与第二电子设备匹配,因此应用程序可以管理第二电子设备。另外,第二电子设备需要完成对第一电子设备的认证才能完成经典蓝牙连接,而若第二电子设备未完成认证,则第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口。
在一些实施例中,该应用程序为用于建立与至少一个电子设备的连接的电子设备对应的应用程序,也就是说该第一电子设备可以通过该应用程序与至少一个电子设备建立连接。
可选地,该应用程序为第一电子设备出厂安装的程序,或者,该应用程序为第一电子设备安装的第三方应用程序,也就是说该应用程序是第一电子设备通过程序平台安装的程序。又或者,该应用程序为第一电子设备通过其他方式安装的应用程序,本申请实施例不作限定。
在本申请实施例中,第一电子设备检测到用于建立应用程序与第二电子设备的连接操作时,则第一电子设备向第二电子设备发送蓝牙建立请求,由于第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口,也就是说第一电子设备与第二电子设备之间无法直接建立经典蓝牙连接,因此第一电子设备建立与第二电子设备之间的BLE连接,再基于已建立的BLE连接执行步骤512-513。
步骤512:第一电子设备基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接。
在一些实施例中,该经典蓝牙可以是指蓝牙4.0以下的蓝牙,BLE蓝牙可以是指蓝牙4.0以上的蓝牙,也可以参照本领域惯常的理解。
另外,该经典蓝牙传输的数据量可能大于BLE蓝牙传输的数据量,并且经典蓝牙的功耗大于BLE蓝牙的功耗。
步骤513:第一电子设备基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的传输通道。
本申请实施例中,第一电子设备与第二电子设备之间建立BLE连接后,则还可以继续基于该BLE连接建立经典蓝牙连接,实现了即使第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口,也可以自动建立第一电子设备与第二电子设备之间的经典蓝牙连接的方案,进而基于已建立的经典蓝牙连接建立应用程序与第二电子设备之间的传输通道。
在一些实施例中,该传输通道为GATT(Generic Attribute Profile,通用属性配置文件)over BR(Basic Rate,基本速率)/EDR(Enhanced Data Rate,增强数据速率)之间通信的传输通道。
需要说明的是,本申请实施例是以第一电子设备为例进行说明。而在另一实施例中,该第一电子设备为手机。可选地,该第一电子设备的操作系统为IOS系统。
本申请实施例提供的方案中,若第一电子设备检测到建立应用程序与第二电子设备的连接操作,则先建立BLE连接,再基于BLE连接建立经典蓝牙连接,再建立用于应用程序与第二电子设备之间通信的传输通道,无需用户多次操作,即能建立传输通道,简化了用户操作,提高建立连接的效率。
图6示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图6,该方法应用于第二电子设备中,该方法包括:
步骤611:第二电子设备根据接收到的第一电子设备发送的蓝牙连接请求,建立与第一电子设备之间的BLE连接,蓝牙连接请求由第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,应用程序为与第二电子设备匹配的应用程序,第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口。
其中,第一电子设备不支持第二电子设备直接调用第一电子设备中用于建立经典蓝牙连接的接口,也 就是说若第一电子设备与第二电子设备之间需要建立经典蓝牙连接时,与该第二电子设备匹配的应用程序无法直接调用第一电子设备中用于建立经典蓝牙连接的接口,也就是无法直接通过该应用程序建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,该应用程序为用于建立与至少一个电子设备的连接的电子设备对应的应用程序,也就是说该第一电子设备可以通过该应用程序与至少一个电子设备建立连接。
在本申请实施例中,第一电子设备检测到用于建立应用程序与第二电子设备的连接操作时,则第一电子设备向第二电子设备发送蓝牙建立请求,第二电子设备接收到该蓝牙连接请求,并且由于无法直接建立经典蓝牙连接,因此第一电子设备建立与第二电子设备之间的BLE连接,再基于已建立的BLE连接执行步骤612-613。
步骤612:第二电子设备基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接。
步骤613:第二电子设备基于经典蓝牙连接,建立用于与应用程序之间通信的传输通道。
在一些实施例中,该传输通道为GATT(Generic Attribute Profile,通用属性配置文件)over BR(Basic Rate,基本速率)/EDR(Enhanced Data Rate,增强数据速率)之间通信的传输通道。
需要说明的是,本申请实施例是以第二电子设备为例进行说明。而在另一实施例中,该第二电子设备为耳机。可选地,该第二电子设备不适配IOS系统。其中,第二电子设备不适配IOS系统是指第二电子设备未认证IOS系统,也就是说第二电子设备无法调用IOS系统的接口。
本申请实施例提供的方案中,若第二电子设备接收到第一电子设备发送的蓝牙连接请求,则先建立BLE连接,再基于BLE连接建立经典蓝牙连接,再建立用于应用程序与第二电子设备之间通信的传输通道,无需用户多次操作,即能建立传输通道,简化了用户操作,提高建立连接的效率。
图3和图4所示实施例分别以第一电子设备和第二电子设备为例进行说明,并且图2和图3所示实施例均以基于响应于对目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的蓝牙连接为例进行说明。而在图3和图4所示实施例的基础上,还可以先建立应用程序与第二电子设备之间的BLE(Bluetooth Low Energy,蓝牙低能耗)连接,再建立经典蓝牙连接。因此,图7示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图7,该方法包括步骤401-406:
步骤401:第一电子设备响应于对连接界面中目标设备标识的选中操作,向第二电子设备发送蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接。
步骤402:第二电子设备根据接收到的第一电子设备响应于对目标设备标识的选中操作发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接。
在本申请实施例中,第一电子设备与第二电子设备之间的经典蓝牙连接基于第一电子设备与第二电子设备之间的BLE连接建立,在第一电子设备检测到对连接界面中目标设备标识的选中操作的情况下,响应于对该目标设备标识的选中操作,建立第一电子设备与目标设备标识指示的第二电子设备之间的BLE连接。
在本申请实施例中,第一电子设备检测到对连接界面中目标设备标识的选中操作的情况下,响应于对该目标设备标识的选中操作,向第二电子设备发送蓝牙建立请求,则第一电子设备和第二电子设备均会基于该蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接。
其中,应用程序的连接界面为用于建立与第二电子设备之间的连接的界面。第一电子设备通过该连接界面显示至少一个电子设备的设备标识,响应于对第二电子设备的目标设备标识的选中操作,确定与第二电子设备建立连接。
本申请实施例通过建立第一电子设备与第二电子设备之间的BLE连接,保证在建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道过程中与第二电子设备正常通信,在保证通信效果的基础上建立连接,提高建立连接的稳定性。
步骤403:第一电子设备基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接。
步骤404:第二电子设备基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接。
在本申请实施例中,在第一电子设备已建立与第二电子设备之间的BLE连接的情况下,第一电子设备基于BLE连接,建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在本申请实施例中,第二电子设备也会建立与第一电子设备之间的BLE连接,具体过程包括:第二电子设备发送BLE广播,第一电子设备扫描到该BLE广播,在连接界面中显示第二电子设备的目标设备标识,响应于对连接界面中目标设备标识的选中操作,向第二电子设备发送蓝牙连接请求,第二电子设备根据接收到的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接,再基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备与第二电子设备建立经典蓝牙连接的过程如图8所示,参见图8,该方法包括:
步骤5011:第一电子设备向第二电子设备发送访问请求。
其中,访问请求用于访问第二电子设备的BLE加密服务。
在一些实施例中,第一电子设备与第二电子设备设备之间建立了BLE连接,则对于该第一电子设备来说,该第一电子设备基于BLE连接,向第二电子设备发送访问请求。
步骤5012:第二电子设备基于BLE连接,接收第一电子设备发送的访问请求。
在本申请实施例中,第一电子设备向第二电子设备发送的访问请求,以访问第二电子设备的BLE加密服务,而由于第二电子设备的BLE加密服务需要在加密BLE连接下进行,因此第二电子设备向第一电子设备发送错误消息,以指示第一电子设备执行对BLE连接进行加密的过程。
在一些实施例中,访问请求通过设置第二电子设备的BLE加密服务对应的notify类型的characteristic(特征)为可用enable,以访问第二电子设备的BLE加密服务。
在另一些实施例中,访问请求还可以通过设置第二电子设备的BLE加密服务对应的其他类型的characteristic,以访问第二电子设备的BLE加密服务。
步骤5013:在BLE连接为非加密BLE连接的情况下,第二电子设备向第一电子设备发送错误消息。
其中,错误消息用于指示在加密BLE连接下访问BLE加密服务。
在本申请实施例中,第一电子设备向第二电子设备发送访问请求后,由于第一电子设备和第二电子设备之间的BLE连接为非加密BLE连接,第二电子设备向第一电子设备发送错误消息,以告知第一电子设备需要对BLE连接进行加密。
步骤5014:第一电子设备响应于错误消息,建立与第二电子设备之间的加密BLE连接。
在本申请实施例中,第一电子设备接收到错误消息,基于该错误消息确定在BLR连接为非加密连接的情况下,无法访问第二电子设备的BLE加密服务,因此第二电子设备返回错误消息来指示第一电子设备需要进行BLE加密,以便于建立与第二电子设备之间的加密BLE连接。
在一些实施例中,第一电子设备响应于错误消息,显示连接确认界面,响应于在连接确认界面中的确认操作,与第二电子设备进行配对,获取BLE连接的加密秘钥。
第二电子设备向第一电子设备发送错误消息,第一电子设备确定需要建立与第二电子设备之间的加密BLE连接,第一电子设备响应于该错误消息显示连接确认界面,用户通过该连接确认界面确认需要与第一电子设备配对的第二电子设备是否正确,若确认正确,用户通过在连接确认界面中执行确认操作,以控制第一电子设备与第二电子设备进行配对。
其中,连接确认界面包括第二电子设备的目标设备标识。
可选地,第一电子设备响应于该错误消息显示连接确认界面,该连接确认界面中包括确认选项和否定选项,若用户确定与第一电子设备配对的第二电子设备正确,则触发对确认选项的选择操作,第一电子设备响应于对确认选项的选择操作,与第二电子设备进行配对。另外,若用户确定与第一电子设备配对的第二电子设备不正确,则触发对否认选项的选择操作,第一电子设备响应于对否认选项的选择操作,取消与第二电子设备配对。
在一些实施例中,第一电子设备响应于错误消息,与第二电子设备进行配对,获取BLE连接的加密秘钥,根据加密秘钥对BLE连接进行加密,建立加密后的BLE连接。
步骤5015:第一电子设备基于加密BLE连接的加密秘钥,执行CTKD(Cross-Transport Key Derivation,交叉传输密钥派生)算法,生成建立经典蓝牙连接的连接秘钥。
在本申请实施例中,第一电子设备与第二电子设备之间进行配对,以使第一电子设备与第二电子设备分别获取BLE连接的加密秘钥,进而根据获取的加密秘钥对BLE连接进行加密。
步骤5016:第二电子设备基于加密BLE连接的加密秘钥,执行CTKD算法,生成建立经典蓝牙连接的连接秘钥。
步骤5017:第一电子设备根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
步骤5018:第二电子设备根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
在本申请实施例中,第一电子设备和第二电子设备之间建立加密BLE连接后,则第一电子设备和第二电子设备分别执行CTKD算法,以根据BLE连接的加密秘钥生成用于建立经典蓝牙连接的连接秘钥,进而根据该连接秘钥建立第一电子设备与第二电子设备之间的经典蓝牙连接。
需要说明的是,步骤5011-5018中第一电子设备所执行的步骤可以单独形成一个实施例,第二电子设备所执行的步骤可以单独形成一个实施例。另外,步骤5011-5018也可以单独形成一个实施例,无需在图7的基础上执行。进一步的,步骤5011-5018还可以在图5或图6所示的实施例的基础上执行,也就是如何基于已建立的BLE连接来建立第一电子设备与第二电子设备之间的经典蓝牙连接。
需要说明的是,本申请实施例中的第一电子设备的操作系统为IOS(一种操作系统名称)系统。
相关技术中,若第一电子设备的操作系统为IOS系统,则第二电子设备需要完成IOS系统对应的认证后,才能与第一电子设备建立蓝牙连接,进而建立用于应用程序与第二电子设备之间通信的GATT over  BR/EDR传输通道,而本申请实施例中的IOS系统在支持CTKD算法情况下,基于BLE连接的加密秘钥获取用于建立经典蓝牙连接的连接秘钥,进而建立与第二电子设备之间的经典蓝牙连接,后续可以完成建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道的过程,打破了第二电子设备需要经过IOS系统对应的认证才能建立经典蓝牙连接的局限性,提高了建立连接的效率。
另外,由于IOS系统无法通过接口获取第二电子设备的MAC信息,导致出现无法确定当前与第二电子设备的连接是否为经典蓝牙连接,而本申请实施例中的IOS系统在支持CTKD算法情况下,基于BLE连接的加密秘钥获取用于建立经典蓝牙连接的连接秘钥,进而建立与第二电子设备之间的经典蓝牙连接,保证第一电子设备能够确定与第二电子设备建立的经典蓝牙连接,打破了采用IOS系统无法识别当前与第二电子设备的连接是否为经典蓝牙连接的局限性,提高了建立与第二电子设备之间的连接的准确性。
步骤405:第一电子设备基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
步骤406:第二电子设备基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在本申请实施例中,第一电子设备与第二电子设备之间可以建立经典蓝牙连接,并且,第一电子设备与第二电子设备之间的经典蓝牙连接可以传输数据,则基于该经典蓝牙连接,可以建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在一些实施例中,在建立经典蓝牙连接过程中,第二电子设备向第一电子设备发送ATT协议连接请求,第一电子设备接收第二电子设备发送的ATT协议连接请求,基于ATT协议连接请求,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在一种可能实现方式中,第一电子设备向第二电子设备发送ATT协议连接请求的ATT协议连接响应,通过该ATT协议连接响应通知第二电子设备完成建立的GATT over BR/EDR传输通道。
在一些实施例中,若第一电子设备确定未建立GATT over BR/EDR传输通道的情况下,向第二电子设备发送ATT协议连接请求,基于ATT协议连接请求建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
其中,第一电子设备确定未建立GATT over BR/EDR传输通道的情况包括:
第一电子设备接收第二电子设备发送的ATT协议连接请求,未基于该ATT协议连接请求建立成功用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。例如,第二电子设备向第一电子设备发送了ATT协议连接请求,而对于第一电子设备来说,第一电子设备虽然接收到了第二电子设备发送的ATT协议连接请求,但是该第一电子设备无法建立用于与第二电子设备之间通信的GATT over BR/EDR传输通道,也就是说,第一电子设备确定了未建立GATT over BR/EDR传输通道。
或者,第一电子设备未接收第二电子设备发送的ATT协议连接请求。例如,第二电子设备向第一电子设备发送了ATT协议连接请求,而对于第一电子设备来说,该第一电子设备可能并无法接收到第二电子设备发送的ATT协议连接请求,也就是说第一电子设备无法根据ATT协议连接请求建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,因此第一电子设备在未接收到第二电子设备发送的ATT协议连接请求的情况下,确定未建立GATT over BR/EDR传输通道。
或者,第一电子设备未通过在蓝牙设置界面建立经典蓝牙连接,进而建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。例如,第一电子设备与第二电子设备之间会基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,而建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道之前,第一电子设备需要与第二电子设备之间建立经典蓝牙连接,而由于第一电子设备确定未通过蓝牙设置界面建立经典蓝牙连接,因此也可以确定未建立GATT over BR/EDR传输通道。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
本申请实施例提供了一种连接建立方法,若在应用程序的连接界面中检测到对目标设备标识的选中操作,则基于该选中操作,建立应用程序与第二电子设备之间的BLE连接,进而建立第一电子设备与目标设备标识指示的第二电子设备之间的蓝牙连接,进而在已建立的蓝牙连接的基础上,自动建立应用程序与第二电子设备之间的GATT over BR/EDR连接,无需用户多次操作,即能建立GATT over BR/EDR连接,简化了用户操作,提高建立连接的效率。
在图7所示实施例的基础上,图9示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图9,在步骤406之后执行步骤601-602,该方法包括:
步骤601:第一电子设备断开第一电子设备与第二电子设备之间的BLE连接。
步骤602:第二电子设备断开第一电子设备与第二电子设备之间的BLE连接。
在本申请实施例中,第一电子设备与第二电子设备之间的BLE连接用于触发建立第一电子设备与第二电子设备之间的经典蓝牙连接,建立第一电子设备与第二电子设备之间的经典蓝牙连接后,再建立GATT over BR/EDR传输通道,由于第一电子设备中的应用程序无法同时识别BLE连接以及GATT over BR/EDR传输通道,因此建立GATT over BR/EDR传输通道后,第一电子设备和第二电子设备之间断开BLE连接。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
另外,本申请实施例是以步骤601-602在步骤406之后执行为例进行说明。而在另一实施例中,本申请实施例中的步骤601-602还可以在步骤513之后执行,或者在步骤613之后执行,或者在步骤203之后执行,或者在步骤204之后执行,本申请实施例不作限定。
本申请实施例提供的方法,在完成建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道后,将第一电子设备与第二电子设备之间的BLE连接断开,排除了BLE连接对应用程序的干扰,提高应用程序与第二电子设备的通信效率,并且减少BLE连接的资源消耗量,提高资源利用率。
在图7所示实施例的基础上,在建立第一电子设备与第二电子设备之间的BLE连接之后,第一电子设备需要先判断是否已建立GATT over BR/EDR传输通道,进而确定是否执行建立经典蓝牙连接的步骤,图10示出了本申请一个示例性实施例提供的连接建立方法的流程图,参见图10,在步骤402之后还包括步骤701,步骤403替换为步骤702,该方法包括:
步骤701:第一电子设备获取目标参数。
在本申请实施例中,目标参数用于指示是否已建立GATT over BR/EDR传输通道。若第一电子设备与第二电子设备之间建立了BLE连接,第一电子设备先通过应用程序获取用于指示是否已建立GATT over BR/EDR传输通道的目标参数,基于获取的目标参数确定应用程序与第二电子设备之间是否已建立GATT over BR/EDR传输通道。
在一些实施例中,该目标参数包括1比特,若该目标参数为1,指示应用程序与第二电子设备之间已建立GATT over BR/EDR传输通道。若目标参数为0,指示应用程序与第二电子设备之间未建立GATT over BR/EDR传输通道。或者,若该目标参数为0,指示应用程序与第二电子设备之间已建立GATT over BR/EDR传输通道,若该目标参数为1,指示应用程序与第二电子设备之间未建立GATT over BR/EDR传输通道。
该目标参数还可以采用其他方式表示,本申请实施例对目标参数的表示方式不作限定。
步骤702:在目标参数指示未建立GATT over BR/EDR传输通道的情况下,基于BLE连接,第一电子设备建立第一电子设备和第二电子设备之间的经典蓝牙连接。
第一电子设备获取到目标参数后,根据该目标参数确定未建立GATT over BR/EDR传输通道,则说明第一电子设备需要执行建立经典蓝牙连接的步骤,进而建立经典蓝牙连接。
其中,步骤702中建立经典蓝牙连接的过程与上述步骤403-404建立蓝牙连接的过程类似,在此不再赘述。
本申请实施例提供的方法,第一电子设备先根据获取的目标参数判断应用程序与第二电子设备之间是否已建立GATT over BR/EDR传输通道,在确定未建立GATT over BR/EDR传输通道的情况下,再执行建立经典蓝牙连接的步骤,防止出现应用程序与第二电子设备已建立GATT over BR/EDR传输通道的情况下,继续执行建立GATT over BR/EDR传输通道的情况,节省资源,提高建立连接的效率。
需要说明的是,本申请实施例仅是以目标参数指示未建立GATT over BR/EDR传输通道的情况为例进行说明。而在另一实施例中,在目标参数指示已建立GATT over BR/EDR传输通道的情况下,则不执行上述步骤702。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
另外,本申请实施例是以在步骤402之后还包括步骤701,步骤403替换为步骤702为例进行说明。而在另一实施例中,在步骤512之后也可以包括步骤701,步骤513替换为步骤702。
在图3所示实施例的基础上,图11示出了本申请一个示例性实施例提供的显示至少一个电子设备的设备标识的方法的流程图,参见图11,步骤201替换为步骤801-803,该方法包括:
步骤801:第一电子设备通过应用程序扫描得到至少一个电子设备的设备标识。
在本申请实施例中,第一电子设备安装有应用程序,通过该应用程序进行扫描,以扫描得到至少一个电子设备的设备标识。
其中,步骤801扫描得到至少一个电子设备的设备标识的步骤与上述步骤201类似,在此不再赘述。
步骤802:第一电子设备对扫描得到的设备标识进行筛选,得到所属电子设备的设备类型与应用程序的目标设备类型相同的设备标识。
在本申请实施例中,由于应用程序具有管理电子设备的功能,并且应用程序管理的电子设备的设备类型固定,因此为了防止不属于应用程序管理范围的其他电子设备的干扰,第一电子设备需要对扫描得到的设备标识进行筛选,以得到所属电子设备的设备类型与应用程序的目标设备类型相同的设备标识,得到的这些设备标识指示的电子设备均由第一电子设备的应用程序管理,后续第一电子设备可以与筛选得到的任一个设备标识指示的电子设备建立蓝牙连接。
其中,应用程序的目标设备类型为支持与应用程序建立蓝牙连接的电子设备的类型。
步骤803:第一电子设备在连接界面中显示筛选得到的设备标识。
第一电子设备在连接界面中显示筛选得到的设备标识,用户通过选中已显示的设备标识中的目标设备标识,控制第一电子设备执行步骤202。
本申请实施例提供的方法,根据应用程序的目标设备类型对扫描得到的至少一个设备标识进行筛选,以筛选得到所属电子设备的设备类型与应用程序的目标设备类型相同的设备标识,排除了与应用程序的目标设备类型不同的设备标识,防止其他电子设备产生干扰,提高建立连接的效率。
在图3所示的实施例的基础上,图12示出了本申请一个示例性实施例提供的连接建立的方法的流程图,参见图12,步骤202替换为步骤901-903,该方法包括:
步骤901:第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息。
在本申请实施例中,第一电子设备若检测到对目标设备标识的选中操作,若第二电子设备不支持CTKD算法,但是支持GATT over BR/EDR传输通道,则第一电子设备通过控制应用程序显示提示信息引导用户控制第一电子设备建立与第二电子设备之间的经典蓝牙连接。
步骤902:第一电子设备响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面。
第一电子设备显示提示信息后,若用户触发对该提示信息的确认操作,则第一电子设备响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面。
其中,该蓝牙设置界面中包括至少一个电子设备的设备标识,且至少一个电子设备的设备标识中包括第二电子设备的目标设备标识。
步骤903:第一电子设备基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在本申请实施例中,第一电子设备显示该蓝牙设置界面,基于该蓝牙设置界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备显示的蓝牙设置界面中包括第二电子设备的目标设备标识,用户通过触发对目标设备标识的选中操作,控制第一电子设备响应于对该目标设备标识的选中操作,建立与第二电子设备之间的经典蓝牙连接。
需要说明的是,第一电子设备基于该蓝牙设备界面向第二电子设备发送蓝牙连接请求,第二电子设备基于该蓝牙连接请求建立第一电子设备与第二电子设备之间的经典蓝牙连接。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
另外,本申请实施例是以响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,执行步骤901-903为例进行说明,在一些实施例中,第一电子设备确定的目标设备标识也就是可以认为是第二电子设备,第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作时,也可以理解为是第一电子设备响应于对至少一个电子设备的设备标识中第二设备标识的选中操作,确定接收到建立应用程序与第二电子设备的连接操作。进而第一电子设备响应于建立应用程序与第二电子设备的连接操作,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息,响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面,基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
需要说明的是,本申请实施例是以在连接界面中通过对第二电子设备的选中操作,确定接收到连接操作为例进行说明,在其他实施例中,还可以通过其他方式确定接收到建立应用程序与第二电子设备的连接操作,进而执行建立经典蓝牙连接,本申请实施例不作限定。
其次,本申请实施例是以步骤202替换为步骤901-903为例进行说明。而在另一实施例中,还可以将步骤511替换为步骤901-903,本申请实施例不作限定。
本申请实施例提供的方法,在确定第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通 道的情况下,第一电子设备基于切换显示的第一电子设备系统的蓝牙设置界面,建立与第二电子设备之间的经典蓝牙连接,进而建立用于应用程序与第二电子设备之间的GATT over BR/EDR传输通道,扩展了建立经典蓝牙连接的方式,提高建立连接的效率。
在图3所示的实施例的基础上,若第二电子设备不支持CTKD算法且不支持GATT over BR/EDR传输通道,则第一电子设备不会执行步骤202,而是第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的BLE连接。
其中,第一电子设备建立第一电子设备与第二电子设备之间的BLE连接与上述步骤401-402类似,在此不再赘述。
需要说明的是,第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,向第二电子设备发送蓝牙连接请求,第二电子设备基于该蓝牙连接请求建立与第一电子设备之间的BLE连接。
而在另一些实施例中,若第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道,第一电子设备可以通过显示蓝牙设置界面的方式建立与第二电子设备之间的经典蓝牙连接。
第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息,第一电子设备响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面,第一电子设备基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
其中,第一电子设备基于蓝牙设置界面建立第一电子设备与第二电子设备之间的经典蓝牙连接的过程与上述步骤901-903类似,在此不再赘述。
需要说明的是,上述实施例分别以建立第一电子设备和第二电子设备之间的BLE连接和基于蓝牙设置界面建立第一电子设备与第二电子设备之间的经典蓝牙连接为例进行说明。而在另一实施例中,还可以为第一电子设备响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的BLE连接,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息,第一电子设备响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面,第一电子设备基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接,进而基于经典蓝牙连接建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道。
需要说明的是,本申请实施例是以第一电子设备建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道为例进行说明,在另一实施例中,第一电子设备还可以建立用于应用程序与第二电子设备之间通信的其他传输通道,本申请实施例不作限定。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图13,其示出了本申请一个示例性实施例提供的连接建立装置的结构框图。该连接建立装置应用于第一电子设备,该连接建立装置包括:
显示模块1001,用于在应用程序的连接界面中,显示应用程序扫描得到的至少一个电子设备的设备标识;
连接建立模块1002,用于响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的蓝牙连接,目标设备标识指示第二电子设备;
通道建立模块1003,用于基于蓝牙连接,建立用于应用程序与第二电子设备之间通信的在基础速率和增强速率基础上的通用属性GATT over BR/EDR传输通道。
本申请实施例提供的装置,若在应用程序的连接界面中检测到对目标设备标识的选中操作,则基于该选中操作,建立应用程序与第二电子设备之间的蓝牙连接,进而在已建立的蓝牙连接的基础上,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,无需用户多次操作,即能建立GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的效率。
在一些实施例中,连接建立模块1002,用于:
响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的蓝牙低能耗BLE连接;
基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接;
通道建立模块1003,用于基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在一些实施例中,参见图14,连接建立模块1002,包括:
发送单元10021,用于基于BLE连接,向第二电子设备发送访问请求,访问请求用于访问第二电子设 备的BLE加密服务;
接收单元10022,用于在BLE连接为非加密BLE连接的情况下,接收第二电子设备返回的错误消息,错误消息由第二电子设备响应于访问请求发送,错误消息用于指示在加密BLE连接下访问BLE加密服务;
建立单元10023,用于响应于错误消息,建立与第二电子设备之间的加密BLE连接;
生成单元10024,用于基于加密BLE连接的加密秘钥,执行CTKD算法,生成建立经典蓝牙连接的连接秘钥;
建立单元10023,用于根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
在一些实施例中,建立单元10023,用于:
响应于错误消息,与第二电子设备进行配对,获取BLE连接的加密秘钥;
根据加密秘钥对BLE连接进行加密,建立加密后的BLE连接。
在一些实施例中,建立单元10023,用于:
响应于错误消息,显示连接确认界面,连接确认界面包括第二电子设备的目标设备标识;
响应于在连接确认界面中的确认操作,与第二电子设备进行配对,获取BLE连接的加密秘钥。
在一些实施例中,通道建立模块1003,用于:
接收第二电子设备在建立经典蓝牙连接过程中,发送的ATT协议连接请求;
基于ATT协议连接请求,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在一些实施例中,通道建立模块1003,用于在确定未建立GATT over BR/EDR传输通道的情况下,向第二电子设备发送ATT协议连接请求,基于ATT协议连接请求建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道。
在一些实施例中,参见图14,装置还包括:
断开模块1004,用于断开应用程序与第二电子设备之间的BLE连接。
在一些实施例中,参见图14,装置还包括:
参数获取模块1005,用于获取目标参数,目标参数用于指示是否已建立GATT over BR/EDR传输通道;
连接建立模块1002,用于在目标参数指示未建立GATT over BR/EDR传输通道的情况下,执行基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接的步骤。
在一些实施例中,参见图14,显示模块1001,包括:
扫描单元10011,用于通过应用程序扫描得到至少一个电子设备的设备标识;
筛选单元10012,用于对扫描得到的设备标识进行筛选,得到所属电子设备的设备类型与应用程序的目标设备类型相同的设备标识;
显示单元10013,用于在连接界面中显示筛选得到的设备标识。
在一些实施例中,连接建立模块1002,用于:
响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息;
响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面;
基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,连接建立模块1002,用于:
在第二电子设备不支持CTKD算法且不支持GATT over BR/EDR传输通道的情况下,响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,建立第一电子设备与第二电子设备之间的BLE连接;
和/或,
响应于对至少一个电子设备的设备标识中目标设备标识的选中操作,在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制应用程序显示提示信息;
响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面;
基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备的操作系统为IOS系统。
需要说明的是,上述实施例提供的装置,在实现其功能时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图15,其示出了本申请一个示例性实施例提供的连接建立装置的结构框图。该连接建立装置应用于第二电子设备,该连接建立装置包括:
发送模块1201,用于发送BLE广播,BLE广播包括第二电子设备的设备信息,设备信息用于在第一电子设备上显示第二电子设备的目标设备标识;
连接建立模块1202,用于根据接收到的第一电子设备发送的蓝牙连接请求,建立与第一电子设备之间的蓝牙连接,蓝牙连接请求由第一电子设备响应于对目标设备标识的选中操作触发;
通道建立模块1203,用于基于蓝牙连接,建立用于与应用程序之间通信的GATT over BR/EDR传输通道。
在一些实施例中,连接建立模块1202,用于:
根据接收到的第一电子设备响应于对目标设备标识的选中操作发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接;
基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接;
通道建立模块1203,用于基于经典蓝牙连接,建立用于与应用程序之间通信的GATT over BR/EDR传输通道。
在一些实施例中,连接建立模块1202,包括:
接收单元12021,用于基于BLE连接,接收第一电子设备发送的访问请求,启动第二电子设备的BLE加密服务;
发送单元12022,用于在BLE连接为非加密BLE连接的情况下,响应于访问请求向第一电子设备发送错误消息,错误消息用于指示在加密BLE连接下访问BLE加密服务;
建立单元12023,用于建立与第二电子设备之间的加密BLE连接;
获取单元12024,用于基于加密后的BLE连接,根据CTKD算法和加密秘钥获取连接秘钥;
建立单元12023,用于根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
在一些实施例中,建立单元12023,用于:
与第一电子设备进行配对,获取BLE连接的加密秘钥;
根据加密秘钥对BLE连接进行加密,建立加密后的BLE连接。
在一些实施例中,通道建立模块1203,用于:
在建立经典蓝牙连接过程中,向第一电子设备发送ATT协议连接请求;第一电子设备用于基于ATT协议连接请求,建立应用程序与第二电子设备之间的GATT over BR/EDR传输通道。
在一些实施例中,通道建立模块1203,用于:
在未建立GATT over BR/EDR传输通道的情况下,接收第一电子设备发送的ATT协议连接请求,响应于ATT协议连接请求,建立与应用程序之间的GATT over BR/EDR传输通道。
在一些实施例中,装置还包括:
断开模块1204,用于断开第二电子设备与第一电子设备之间的BLE连接。
在一些实施例中,连接建立模块1202,用于在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,连接建立模块1202,用于在第二电子设备不支持CTKD算法且不支持GATT over BR/EDR传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接;
和/或,
连接建立模块1202,用于在第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备的操作系统为IOS系统。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图14,其示出了本申请一个示例性实施例提供的连接建立装置的结构框图。该连接建立装置应用于第一电子设备,该连接建立装置包括:
连接建立模块1002,用于响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与第二电子设备之间的BLE连接,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
连接建立模块1002,还用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
通道建立模块1003,用于基于经典蓝牙连接,建立用于应用程序与第二电子设备之间通信的传输通道。
本申请实施例提供的装置,若在应用程序的连接界面中检测到对目标设备标识的选中操作,则基于该选中操作,建立应用程序与第二电子设备之间的蓝牙连接,进而在已建立的蓝牙连接的基础上,建立用于应用程序与第二电子设备之间通信的GATT over BR/EDR传输通道,无需用户多次操作,即能建立GATT over BR/EDR传输通道,简化了用户操作,提高建立连接的效率。
在一些实施例中,参见图14,连接建立模块1002,包括:
发送单元10021,用于基于BLE连接,向第二电子设备发送访问请求,访问请求用于访问第二电子设备的BLE加密服务;
接收单元10022,用于在BLE连接为非加密BLE连接的情况下,接收第二电子设备返回的错误消息,错误消息由第二电子设备响应于访问请求发送,错误消息用于指示在加密BLE连接下访问BLE加密服务;
建立单元10023,用于响应于错误消息,建立与第二电子设备之间的加密BLE连接;
生成单元10024,用于基于加密BLE连接的加密秘钥,执行CTKD算法,生成建立经典蓝牙连接的连接秘钥;
建立单元10023,用于根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
在一些实施例中,建立单元10023,用于:
响应于错误消息,与第二电子设备进行配对,获取BLE连接的加密秘钥;
根据加密秘钥对BLE连接进行加密,建立加密后的BLE连接。
在一些实施例中,建立单元10023,用于:
响应于错误消息,显示连接确认界面,连接确认界面包括第二电子设备的目标设备标识;
响应于在连接确认界面中的确认操作,与第二电子设备进行配对,获取BLE连接的加密秘钥。
在一些实施例中,通道建立模块1003,用于:
接收第二电子设备在建立经典蓝牙连接过程中,发送的ATT协议连接请求;
基于ATT协议连接请求,建立用于应用程序与第二电子设备之间通信的传输通道。
在一些实施例中,通道建立模块1003,用于在确定未建立传输通道的情况下,向第二电子设备发送ATT协议连接请求,基于ATT协议连接请求建立用于应用程序与第二电子设备之间通信的传输通道。
在一些实施例中,参见图14,装置还包括:
断开模块1004,用于断开应用程序与第二电子设备之间的BLE连接。
在一些实施例中,参见图14,装置还包括:
参数获取模块1005,用于获取目标参数,目标参数用于指示是否已建立传输通道;
连接建立模块1002,用于在目标参数指示未建立传输通道的情况下,执行基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接的步骤。
在一些实施例中,参见图14,该装置还包括:
显示模块1001,用于在所述应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
连接建立模块1002,用于响应于对所述至少一个电子设备的设备标识中所述第二设备标识的选中操作,确定接收到建立所述应用程序与所述第二电子设备的连接操作。
在一些实施例中,参见图14,显示模块1001,包括:
扫描单元10011,用于通过应用程序扫描得到至少一个电子设备的设备标识;
筛选单元10012,用于对扫描得到的设备标识进行筛选,得到所属电子设备的设备类型与应用程序的目标设备类型相同的设备标识;
显示单元10013,用于在连接界面中显示筛选得到的设备标识。
在一些实施例中,连接建立模块1002,用于:
响应于建立应用程序与第二电子设备的连接操作,在第二电子设备不支持CTKD算法且支持传输通道的情况下,控制应用程序显示提示信息;
响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面;
基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,连接建立模块1002,用于:
在第二电子设备不支持CTKD算法且不支持传输通道的情况下,响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立第一电子设备与第二电子设备之间的BLE连接;和/或,响应于建立应用程序与第二电子设备的连接操作,在第二电子设备不支持CTKD算法且支持传输通道的情况下,控制应用程序显示提示信息;
响应于对提示信息的确认操作,显示第一电子设备系统的蓝牙设置界面;
基于蓝牙设备界面建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备的操作系统为IOS系统。
需要说明的是,上述实施例提供的装置,在实现其功能时,以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。
请参考图16,其示出了本申请一个示例性实施例提供的连接建立装置的结构框图。该连接建立装置应用于第二电子设备,该连接建立装置包括:
连接建立模块1202,用于根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与第一电子设备之间的BLE连接,所述蓝牙连接请求由所述第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
连接建立模块1202,用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
通道建立模块1203,用于基于经典蓝牙连接,建立用于与应用程序之间通信的传输通道。
在一些实施例中,连接建立模块1202,用于:
根据接收到的第一电子设备响应于对目标设备标识的选中操作发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接;
基于BLE连接,建立第一电子设备和第二电子设备之间的经典蓝牙连接;
通道建立模块1203,用于基于经典蓝牙连接,建立用于与应用程序之间通信的传输通道。
在一些实施例中,参见图16,连接建立模块1202,包括:
接收单元12021,用于基于BLE连接,接收第一电子设备发送的访问请求,启动第二电子设备的BLE加密服务;
发送单元12022,用于在BLE连接为非加密BLE连接的情况下,响应于访问请求向第一电子设备发送错误消息,错误消息用于指示在加密BLE连接下访问BLE加密服务;
建立单元12023,用于建立与第二电子设备之间的加密BLE连接;
获取单元12024,用于基于加密后的BLE连接,根据CTKD算法和加密秘钥获取连接秘钥;
建立单元12023,用于根据连接秘钥,建立与第二电子设备之间的经典蓝牙连接。
在一些实施例中,建立单元12023,用于:
与第一电子设备进行配对,获取BLE连接的加密秘钥;
根据加密秘钥对BLE连接进行加密,建立加密后的BLE连接。
在一些实施例中,通道建立模块1203,用于:
在建立经典蓝牙连接过程中,向第一电子设备发送ATT协议连接请求;第一电子设备用于基于ATT协议连接请求,建立应用程序与第二电子设备之间的传输通道。
在一些实施例中,发送模块1201,用于发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识。
在一些实施例中,通道建立模块1203,用于:
在未建立GATT over BR/EDR传输通道的情况下,接收第一电子设备发送的ATT协议连接请求,响应于ATT协议连接请求,建立与应用程序之间的传输通道。
在一些实施例中,装置还包括:
断开模块1204,用于断开第二电子设备与第一电子设备之间的BLE连接。
在一些实施例中,连接建立模块1202,用于在第二电子设备不支持CTKD算法且支持传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,连接建立模块1202,用于在第二电子设备不支持CTKD算法且不支持传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的BLE连接;
和/或,连接建立模块1202,用于在第二电子设备不支持CTKD算法且支持传输通道的情况下,接收第一电子设备发送的蓝牙连接请求,建立第一电子设备与第二电子设备之间的经典蓝牙连接。
在一些实施例中,第一电子设备的操作系统为IOS系统。
本申请还提供一种计算机可读介质,其上存储有程序指令,程序指令被处理器执行时实现上述各个方法实施例提供的连接建立方法。
本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各个实施例的连接建立方法。
本申请还提供了一种芯片,芯片包括可编程逻辑电路和/或程序指令,当所述芯片在第一电子设备或第二电子设备上运行时,用于实现上述各个实施例的连接建立方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本领域普通技术人员可以理解实现上述实施例的连接建立方法中全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。以上所述为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。

Claims (54)

  1. 一种连接建立方法,所述方法应用于第一电子设备,所述方法包括:
    在应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
    响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,所述目标设备标识指示所述第二电子设备;
    基于所述蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的在基础速率和增强速率基础上的通用属性GATT over BR/EDR传输通道。
  2. 根据权利要求1所述的方法,所述基于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,包括:
    响应于对所述至少一个电子设备的设备标识中所述目标设备标识的选中操作,建立所述第一电子设备与所述第二电子设备之间的蓝牙低能耗BLE连接;
    基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    所述基于所述蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道,包括:
    基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
  3. 根据权利要求2所述的方法,所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接,包括:
    基于所述BLE连接,向所述第二电子设备发送访问请求,所述访问请求用于访问所述第二电子设备的BLE加密服务;
    在所述BLE连接为非加密BLE连接的情况下,接收所述第二电子设备返回的错误消息,所述错误消息由所述第二电子设备响应于所述访问请求发送,所述错误消息用于指示在加密BLE连接下访问所述BLE加密服务;
    响应于所述错误消息,建立与所述第二电子设备之间的加密BLE连接;
    基于所述加密BLE连接的加密秘钥,执行交叉传输密钥派生CTKD算法,生成建立所述经典蓝牙连接的连接秘钥;
    根据所述连接秘钥,建立与所述第二电子设备之间的所述经典蓝牙连接。
  4. 根据权利要求3所述的方法,所述响应于所述错误消息,建立与所述第二电子设备之间的加密BLE连接,包括:
    响应于所述错误消息,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥;
    根据所述加密秘钥对所述BLE连接进行加密,建立加密后的BLE连接。
  5. 根据权利要求4所述的方法,所述响应于所述错误消息,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥,包括:
    响应于所述错误消息,显示连接确认界面,所述连接确认界面包括所述第二电子设备的所述目标设备标识;
    响应于在所述连接确认界面中的确认操作,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥。
  6. 根据权利要求2所述的方法,所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道,包括:
    接收所述第二电子设备在建立所述经典蓝牙连接过程中,发送的ATT协议连接请求;
    基于所述ATT协议连接请求,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
  7. 根据权利要求2所述的方法,所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道,包括:
    在确定未建立所述GATT over BR/EDR传输通道的情况下,向所述第二电子设备发送ATT协议连接请求,基于所述ATT协议连接请求建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
  8. 根据权利要求2所述的方法,在所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道之后,所述方法还包括:
    断开所述第一电子设备与所述第二电子设备之间的所述BLE连接。
  9. 根据权利要求2所述的方法,所述响应于对所述至少一个电子设备的设备标识中所述目标设备标识 的选中操作,建立所述第一电子设备与所述第二电子设备之间的BLE连接之后,所述方法还包括获取目标参数,所述目标参数用于指示是否已建立所述GATT over BR/EDR传输通道;
    所述方法还包括:在所述目标参数指示未建立所述GATT over BR/EDR传输通道的情况下,执行所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接的步骤。
  10. 根据权利要求1所述的方法,所述在应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识,包括:
    通过所述应用程序扫描得到至少一个电子设备的设备标识;
    对扫描得到的设备标识进行筛选,得到所属电子设备的设备类型与所述应用程序的目标设备类型相同的设备标识;
    在所述连接界面中显示筛选得到的设备标识。
  11. 根据权利要求1所述的方法,所述响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,包括:
    响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,在所述第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制所述应用程序显示提示信息;
    响应于对所述提示信息的确认操作,显示所述第一电子设备系统的蓝牙设置界面;
    基于所述蓝牙设备界面建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  12. 根据权利要求1所述的方法,所述方法还包括:在所述第二电子设备不支持CTKD算法且不支持GATT over BR/EDR传输通道的情况下,响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与所述第二电子设备之间的BLE连接;
    和/或,所述方法还包括:
    响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,在所述第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制所述应用程序显示提示信息;
    响应于对所述提示信息的确认操作,显示所述第一电子设备系统的蓝牙设置界面;
    基于所述蓝牙设备界面建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  13. 根据权利要求1至12任一所述的方法,所述第一电子设备的操作系统为IOS系统。
  14. 一种连接建立方法,所述方法应用于第二电子设备,所述方法包括:
    发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识;
    根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,所述蓝牙连接请求由所述第一电子设备响应于对所述目标设备标识的选中操作触发;
    基于所述蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道。
  15. 根据权利要求14所述的方法,所述根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,包括:
    根据接收到的所述第一电子设备响应于对所述目标设备标识的选中操作发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接;
    基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    所述基于所述蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道,包括:
    基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道。
  16. 根据权利要求15所述的方法,所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接,包括:
    基于所述BLE连接,接收所述第一电子设备发送的访问请求,所述访问请求用于访问所述第二电子设备的BLE加密服务;
    在所述BLE连接为非加密BLE连接的情况下,响应于所述访问请求向所述第一电子设备发送错误消息,所述错误消息用于指示在加密BLE连接下访问所述BLE加密服务;
    建立与所述第二电子设备之间的加密BLE连接;
    基于所述加密后的BLE连接,根据所述CTKD算法和所述加密秘钥获取所述连接秘钥;
    根据所述连接秘钥,建立与所述第二电子设备之间的所述经典蓝牙连接。
  17. 根据权利要求16所述的方法,所述建立与所述第二电子设备之间的加密BLE连接,包括:
    与所述第一电子设备进行配对,获取所述BLE连接的加密秘钥;
    根据所述加密秘钥对所述BLE连接进行加密,建立加密后的BLE连接。
  18. 根据权利要求15所述的方法,所述基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道,包括:
    在建立所述经典蓝牙连接过程中,向所述第一电子设备发送ATT协议连接请求;所述第一电子设备用于基于所述ATT协议连接请求,建立所述应用程序与所述第二电子设备之间的GATT over BR/EDR传输通道。
  19. 根据权利要求14所述的方法,所述方法还包括:
    在未建立所述GATT over BR/EDR传输通道的情况下,接收所述第一电子设备发送的ATT协议连接请求,响应于所述ATT协议连接请求,建立与所述应用程序之间的GATT over BR/EDR传输通道。
  20. 根据权利要求15所述的方法,在基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道之后,所述方法还包括:
    断开所述第二电子设备与所述第一电子设备之间的所述BLE连接。
  21. 根据权利要求14所述的方法,所述接收所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,包括:
    在所述第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  22. 根据权利要求14所述的方法,所述方法还包括:
    在所述第二电子设备不支持CTKD算法且不支持GATT over BR/EDR传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接;
    和/或,所述方法还包括:
    在所述第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  23. 根据权利要求14至22任一所述的方法,所述第一电子设备的操作系统为IOS系统。
  24. 一种连接建立方法,所述方法应用于第一电子设备,所述方法包括:
    响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
    基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
  25. 根据权利要求24所述的方法,所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接,包括:
    基于所述BLE连接,向所述第二电子设备发送访问请求,所述访问请求用于访问所述第二电子设备的BLE加密服务;
    在所述BLE连接为非加密BLE连接的情况下,接收所述第二电子设备返回的错误消息,所述错误消息由所述第二电子设备响应于所述访问请求发送,所述错误消息用于指示在加密BLE连接下访问所述BLE加密服务;
    响应于所述错误消息,建立与所述第二电子设备之间的加密BLE连接;
    基于所述加密BLE连接的加密秘钥,执行交叉传输密钥派生CTKD算法,生成建立所述经典蓝牙连接的连接秘钥;
    根据所述连接秘钥,建立与所述第二电子设备之间的所述经典蓝牙连接。
  26. 根据权利要求25所述的方法,所述响应于所述错误消息,建立与所述第二电子设备之间的加密BLE连接,包括:
    响应于所述错误消息,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥;
    根据所述加密秘钥对所述BLE连接进行加密,建立加密后的BLE连接。
  27. 根据权利要求26所述的方法,所述响应于所述错误消息,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥,包括:
    响应于所述错误消息,显示连接确认界面,所述连接确认界面包括所述第二电子设备的目标设备标识;
    响应于在所述连接确认界面中的确认操作,与所述第二电子设备进行配对,获取所述BLE连接的加密秘钥。
  28. 根据权利要求24所述的方法,所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道,包括:
    接收所述第二电子设备在建立所述经典蓝牙连接过程中,发送的ATT协议连接请求;
    基于所述ATT协议连接请求,建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
  29. 根据权利要求24所述的方法,所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电 子设备之间通信的传输通道,包括:
    在确定未建立所述传输通道的情况下,向所述第二电子设备发送ATT协议连接请求,基于所述ATT协议连接请求建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
  30. 根据权利要求24所述的方法,在所述基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道之后,所述方法还包括:
    断开所述第一电子设备与所述第二电子设备之间的所述BLE连接。
  31. 根据权利要求24所述的方法,所述响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接之后,所述方法还包括获取目标参数,所述目标参数用于指示是否已建立所述传输通道;
    所述方法还包括:在所述目标参数指示未建立所述传输通道的情况下,执行所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接的步骤。
  32. 根据权利要求24至31任一所述的方法,所述方法还包括:
    在所述应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
    所述响应于建立应用程序与第二电子设备的连接操作,包括:
    响应于对所述至少一个电子设备的设备标识中所述第二设备标识的选中操作,确定接收到建立所述应用程序与所述第二电子设备的连接操作。
  33. 根据权利要求32所述的方法,所述在所述应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识,包括:
    通过所述应用程序扫描得到至少一个电子设备的设备标识;
    对扫描得到的设备标识进行筛选,得到所属电子设备的设备类型与所述应用程序的目标设备类型相同的设备标识;
    在所述连接界面中显示筛选得到的设备标识。
  34. 根据权利要求24所述的方法,所述方法还包括:
    响应于建立应用程序与第二电子设备的连接操作,在所述第二电子设备不支持CTKD算法且支持GATT over BR/EDR传输通道的情况下,控制所述应用程序显示提示信息;
    响应于对所述提示信息的确认操作,显示所述第一电子设备系统的蓝牙设置界面;
    基于所述蓝牙设备界面建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  35. 根据权利要求24所述的方法,所述方法还包括:在所述第二电子设备不支持CTKD算法且不支持传输通道的情况下,响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接;
    和/或,所述方法还包括:
    响应于建立应用程序与第二电子设备的连接操作,在所述第二电子设备不支持CTKD算法且支持传输通道的情况下,控制所述应用程序显示提示信息;
    响应于对所述提示信息的确认操作,显示所述第一电子设备系统的蓝牙设置界面;
    基于所述蓝牙设备界面建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  36. 根据权利要求24至25任一所述的方法,所述第一电子设备的操作系统为IOS系统。
  37. 一种连接建立方法,所述方法应用于第二电子设备,所述方法包括:
    根据接收到的第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的BLE连接,所述蓝牙连接请求由所述第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
    基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道。
  38. 根据权利要求37所述的方法,所述基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接,包括:
    基于所述BLE连接,接收所述第一电子设备发送的访问请求,所述访问请求用于访问所述第二电子设备的BLE加密服务;
    在所述BLE连接为非加密BLE连接的情况下,响应于所述访问请求向所述第一电子设备发送错误消息,所述错误消息用于指示在加密BLE连接下访问所述BLE加密服务;
    建立与所述第二电子设备之间的加密BLE连接;
    基于所述加密后的BLE连接,根据所述CTKD算法和所述加密秘钥获取所述连接秘钥;
    根据所述连接秘钥,建立与所述第二电子设备之间的所述经典蓝牙连接。
  39. 根据权利要求38所述的方法,所述建立与所述第二电子设备之间的加密BLE连接,包括:
    与所述第一电子设备进行配对,获取所述BLE连接的加密秘钥;
    根据所述加密秘钥对所述BLE连接进行加密,建立加密后的BLE连接。
  40. 根据权利要求37所述的方法,所述基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道,包括:
    在建立所述经典蓝牙连接过程中,向所述第一电子设备发送ATT协议连接请求;所述第一电子设备用于基于所述ATT协议连接请求,建立所述应用程序与所述第二电子设备之间的传输通道。
  41. 根据权利要求37至40任一所述的方法,所述方法还包括:
    发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识。
  42. 根据权利要求37所述的方法,所述方法还包括:
    在未建立所述传输通道的情况下,接收所述第一电子设备发送的ATT协议连接请求,响应于所述ATT协议连接请求,建立与所述应用程序之间的传输通道。
  43. 根据权利要求37所述的方法,在基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道之后,所述方法还包括:
    断开所述第二电子设备与所述第一电子设备之间的所述BLE连接。
  44. 根据权利要求37所述的方法,所述接收所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,包括:
    在所述第二电子设备不支持CTKD算法且支持传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  45. 根据权利要求37所述的方法,所述方法还包括:
    在所述第二电子设备不支持CTKD算法且不支持传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接;
    和/或,所述方法还包括:
    在所述第二电子设备不支持CTKD算法且支持传输通道的情况下,接收所述第一电子设备发送的蓝牙连接请求,建立所述第一电子设备与所述第二电子设备之间的经典蓝牙连接。
  46. 根据权利要求37至45任一所述的方法,所述第一电子设备的操作系统为IOS系统。
  47. 一种连接建立装置,所述装置应用于第一电子设备,所述装置包括:
    显示模块,用于在应用程序的连接界面中,显示所述应用程序扫描得到的至少一个电子设备的设备标识;
    连接建立模块,用于响应于对所述至少一个电子设备的设备标识中目标设备标识的选中操作,建立所述第一电子设备与第二电子设备之间的蓝牙连接,所述目标设备标识指示所述第二电子设备;
    通道建立模块,用于基于所述蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的GATT over BR/EDR传输通道。
  48. 一种连接建立装置,所述装置应用于第二电子设备,所述装置包括:
    发送模块,用于发送BLE广播,所述BLE广播包括所述第二电子设备的设备信息,所述设备信息用于在第一电子设备上显示第二电子设备的目标设备标识;
    连接建立模块,用于根据接收到的所述第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间的蓝牙连接,所述蓝牙连接请求由所述第一电子设备响应于对所述目标设备标识的选中操作触发;
    通道建立模块,用于基于所述蓝牙连接,建立用于与所述应用程序之间通信的GATT over BR/EDR传输通道。
  49. 一种连接建立装置,所述装置应用于第一电子设备,所述装置包括:
    连接建立模块,用于响应于建立应用程序与第二电子设备的连接操作,向所述第二电子设备发送蓝牙建立请求,建立所述第一电子设备与所述第二电子设备之间的BLE连接,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
    所述连接建立模块,还用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    通道建立模块,用于基于所述经典蓝牙连接,建立用于所述应用程序与所述第二电子设备之间通信的传输通道。
  50. 一种连接建立装置,所述装置应用于第二电子设备,所述装置包括:
    连接建立模块,用于根据接收到的第一电子设备发送的蓝牙连接请求,建立与所述第一电子设备之间 的BLE连接,所述蓝牙连接请求由所述第一电子设备响应于建立应用程序与第二电子设备的连接操作触发,所述应用程序为与所述第二电子设备匹配的应用程序,所述第一电子设备不支持所述第二电子设备直接调用所述第一电子设备中用于建立经典蓝牙连接的接口;
    所述连接建立模块,还用于基于所述BLE连接,建立所述第一电子设备和所述第二电子设备之间的经典蓝牙连接;
    通道建立模块,用于基于所述经典蓝牙连接,建立用于与所述应用程序之间通信的传输通道。
  51. 一种电子设备,所述电子设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至13任一所述的连接建立方法,或者以实现如权利要求14至23任一所述的连接建立方法,或者以实现如权利要求24至36任一所述的连接建立方法,或者以实现如权利要求37至46任一所述的连接建立方法。
  52. 一种计算机可读存储介质,所述存储介质存储有至少一条指令,所述至少一条指令用于被处理器执行以实现如权利要求1至13任一所述的连接建立方法,或者以实现如权利要求14至23任一所述的连接建立方法,或者以实现如权利要求24至36任一所述的连接建立方法,或者以实现如权利要求37至46任一所述的连接建立方法。
  53. 一种计算机程序产品,当所述计算机程序产品被第一电子设备或第二电子设备的处理器执行时,用于实现如权利要求1至13任一所述的连接建立方法,或者用于实现如权利要求14至23任一所述的连接建立方法,或者用于实现如权利要求24至36任一所述的连接建立方法,或者用于实现如权利要求37至46任一所述的连接建立方法。
  54. 一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片在第一电子设备或第二电子设备上运行时,用于实现如权利要求1至13任一所述的连接建立方法,或者用于实现如权利要求14至23任一所述的连接建立方法,或者用于实现如权利要求24至36任一所述的连接建立方法,或者用于实现如权利要求37至46任一所述的连接建立方法。
PCT/CN2022/094533 2021-05-27 2022-05-23 连接建立方法、装置、电子设备及存储介质 WO2022247802A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110587719.XA CN113316131B (zh) 2021-05-27 2021-05-27 连接建立方法、装置、电子设备及存储介质
CN202110587719.X 2021-05-27

Publications (1)

Publication Number Publication Date
WO2022247802A1 true WO2022247802A1 (zh) 2022-12-01

Family

ID=77375652

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/094533 WO2022247802A1 (zh) 2021-05-27 2022-05-23 连接建立方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN113316131B (zh)
WO (1) WO2022247802A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113316131B (zh) * 2021-05-27 2023-07-07 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备及存储介质
CN113923639B (zh) * 2021-09-30 2024-05-28 联想(北京)有限公司 控制方法及装置
CN113825208B (zh) * 2021-09-30 2023-05-02 联想(北京)有限公司 一种信息处理方法和装置
CN113923641B (zh) * 2021-12-07 2022-05-06 荣耀终端有限公司 一种连接方法及装置
CN114422566B (zh) * 2021-12-29 2024-10-01 Oppo广东移动通信有限公司 多设备连接方法、装置、系统、设备及存储介质
CN114390724A (zh) * 2022-01-11 2022-04-22 维沃移动通信有限公司 连接方法、装置和电子设备
CN114422574B (zh) * 2022-02-10 2024-05-03 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备和计算机可读存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170215113A1 (en) * 2014-07-31 2017-07-27 Lg Electronics Inc. Method and apparatus for controlling electronic device in wireless communication system supporting bluetooth communication
CN107277754A (zh) * 2017-07-12 2017-10-20 深圳市冠旭电子股份有限公司 一种蓝牙连接的方法及蓝牙外围设备
US20180152979A1 (en) * 2015-05-14 2018-05-31 Lg Electronics Inc. Method and device for connecting alternative communication means using bluetooth low energy technology
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
CN110519737A (zh) * 2019-08-30 2019-11-29 南京爱沃客信息科技有限公司 一种蓝牙自动连接的方法、装置和系统
CN110933614A (zh) * 2019-10-12 2020-03-27 阿里巴巴集团控股有限公司 通信处理方法、装置及电子设备
CN111866998A (zh) * 2020-07-24 2020-10-30 深圳创维数字技术有限公司 蓝牙配网方法、设备及存储介质
WO2020254549A1 (en) * 2019-06-19 2020-12-24 Tap Sound System Method and system for routing audio data in a bluetooth network
CN113316131A (zh) * 2021-05-27 2021-08-27 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备及存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9955291B2 (en) * 2016-01-13 2018-04-24 Lg Electronics Inc. Method and device for controlling group device using bluetooth in wireless communication system
US9961484B2 (en) * 2016-01-22 2018-05-01 Lg Electronics Inc. Method and apparatus for controlling a device using bluetooth technology
CN106878926B (zh) * 2017-02-08 2020-11-06 泰凌微电子(上海)有限公司 一种基于低功耗蓝牙的数据传输方法、从主设备及系统
CN106726541A (zh) * 2017-02-28 2017-05-31 深圳市灸大夫医疗科技有限公司 一种电热灸头控制方法以及电热灸头系统
CN107172579A (zh) * 2017-06-15 2017-09-15 精伦电子股份有限公司 一种通过蓝牙信息控制蓝牙受控终端的方法及系统

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170215113A1 (en) * 2014-07-31 2017-07-27 Lg Electronics Inc. Method and apparatus for controlling electronic device in wireless communication system supporting bluetooth communication
US20180152979A1 (en) * 2015-05-14 2018-05-31 Lg Electronics Inc. Method and device for connecting alternative communication means using bluetooth low energy technology
CN107277754A (zh) * 2017-07-12 2017-10-20 深圳市冠旭电子股份有限公司 一种蓝牙连接的方法及蓝牙外围设备
CN108551670A (zh) * 2018-03-30 2018-09-18 深圳市冠旭电子股份有限公司 一种蓝牙连接方法、装置及智能终端
WO2020254549A1 (en) * 2019-06-19 2020-12-24 Tap Sound System Method and system for routing audio data in a bluetooth network
CN110519737A (zh) * 2019-08-30 2019-11-29 南京爱沃客信息科技有限公司 一种蓝牙自动连接的方法、装置和系统
CN110933614A (zh) * 2019-10-12 2020-03-27 阿里巴巴集团控股有限公司 通信处理方法、装置及电子设备
CN111866998A (zh) * 2020-07-24 2020-10-30 深圳创维数字技术有限公司 蓝牙配网方法、设备及存储介质
CN113316131A (zh) * 2021-05-27 2021-08-27 Oppo广东移动通信有限公司 连接建立方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN113316131B (zh) 2023-07-07
CN113316131A (zh) 2021-08-27

Similar Documents

Publication Publication Date Title
WO2022247802A1 (zh) 连接建立方法、装置、电子设备及存储介质
EP3794853B1 (en) Secure systems and methods for establishing wireless audio sharing connection
US12069551B2 (en) Service connection establishment method, Bluetooth master device, chip, and Bluetooth system
US10798548B2 (en) Method for controlling device by using Bluetooth technology, and apparatus
EP3641366B1 (en) Wireless local area network configuration method and apparatus
KR20230118849A (ko) 멀티 링크 피어 투 피어 통신을 위한 통신 장치 및 통신 방법
KR20220061199A (ko) 전송 구성 상태 활성화 방법, 장치 및 저장 매체
US10674353B2 (en) Association establishment method in wireless local area network, terminal, and access point
WO2018010148A1 (zh) 一种通过虚拟客户识别模块进行通信的方法及设备
JP7179087B2 (ja) Rrc接続再確立のベアラ設定方法、端末及びネットワーク機器
WO2016045636A1 (zh) 业务处理方法及装置
US20160299739A1 (en) Method for controlling data streaming using bluetooth communication
JP7233527B2 (ja) リソースプールの設定方法、使用方法、および設定装置、端末
US10652729B1 (en) Subscriber identity privacy
CN108566686B (zh) 一种d2d连接建立的方法、装置和系统
US12004096B2 (en) Signal transmission method and communications device
EP3182787B1 (en) Communication method and device
US20220014331A1 (en) Method for determining reference value and terminal
US20170099289A1 (en) Temporary Mac Address-Based Access Method, Apparatus, and System
WO2022166755A1 (zh) 一种信息处理方法及设备、存储介质
WO2023151423A1 (zh) 设备连接方法、装置、设备及存储介质
US20160142214A1 (en) Device to Device Communication Security
CN113519176B (zh) 一种通信方法、通信装置及终端
CN114844736A (zh) 一种设备及通话控制方法
CN115515254A (zh) 点对点连接建立方法、装置、存储介质及电子设备

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: 22810527

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22810527

Country of ref document: EP

Kind code of ref document: A1