WO2024082906A1 - 信息获取方法、装置、蓝牙设备、终端设备及存储介质 - Google Patents

信息获取方法、装置、蓝牙设备、终端设备及存储介质 Download PDF

Info

Publication number
WO2024082906A1
WO2024082906A1 PCT/CN2023/119904 CN2023119904W WO2024082906A1 WO 2024082906 A1 WO2024082906 A1 WO 2024082906A1 CN 2023119904 W CN2023119904 W CN 2023119904W WO 2024082906 A1 WO2024082906 A1 WO 2024082906A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
bluetooth
terminal device
gatt
connection
Prior art date
Application number
PCT/CN2023/119904
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 WO2024082906A1 publication Critical patent/WO2024082906A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • 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 present disclosure relates to the technical field of Bluetooth connection, and in particular to an information acquisition method, device, Bluetooth device, terminal device and storage medium.
  • Bluetooth technology it is very common to realize data transmission between terminal devices through Bluetooth technology in daily life.
  • LE-Audio The next generation of Bluetooth audio, the next generation of Bluetooth audio transmission technology
  • BLE Bluetooth Low Energy
  • GATT Generic Attribute Profile
  • the embodiments of the present disclosure provide an information acquisition method, an apparatus, a Bluetooth device, a terminal device, and a storage medium.
  • an embodiment of the present disclosure provides an information acquisition method, which is applied to a Bluetooth device, and the method includes:
  • the first information includes general attribute GATT information of the Bluetooth device
  • the first information is sent to the terminal device, so that the terminal device acquires the GATT information according to the first information.
  • an embodiment of the present disclosure provides an information acquisition method, which is applied to a terminal device and includes:
  • the terminal device Before the terminal device completes a Bluetooth low energy BLE connection with the Bluetooth device, receiving first information sent by the Bluetooth device, where the first information includes general attribute GATT information of the Bluetooth device;
  • the GATT information is acquired according to the first information.
  • an information acquisition device which is applied to a Bluetooth device, and includes:
  • a first acquisition module configured to acquire first information, wherein the first information includes general attribute GATT information of the Bluetooth device;
  • the information sending module is used to send the first information to the terminal device before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device obtains the GATT information according to the first information.
  • an embodiment of the present disclosure provides an information acquisition device, which is applied to a terminal device and includes:
  • An information receiving module used for receiving first information sent by the Bluetooth device before the terminal device completes a Bluetooth low energy BLE connection with the Bluetooth device, wherein the first information includes general attribute GATT information of the Bluetooth device;
  • the second acquisition module is used to acquire the GATT information according to the first information.
  • the present disclosure provides a Bluetooth device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the information acquisition method as described in one aspect.
  • the present disclosure provides a terminal device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the information acquisition method as described in one aspect.
  • the present disclosure provides a computer-readable storage medium, wherein the storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the information acquisition method as described in one aspect.
  • an embodiment of the present disclosure provides a computer program product.
  • the computer is enabled to execute the information acquisition method as described in one aspect above.
  • an embodiment of the present disclosure provides an application publishing platform, which is used to publish a computer program product, wherein when the computer program product is run on a computer, the computer executes the information acquisition method as described in one aspect above.
  • FIG1 is a schematic diagram of a process of Bluetooth connection between a terminal device and a Bluetooth headset according to an exemplary embodiment of the present disclosure
  • FIG2 is a schematic diagram of a structure of broadcast information involved in an exemplary embodiment of the present disclosure
  • FIG3 is a schematic diagram of a structure of a GATT message involved in an exemplary embodiment of the present disclosure
  • FIG4 is a schematic diagram of the structure of a terminal device involved in an exemplary embodiment of the present disclosure.
  • FIG5 is a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure.
  • FIG6 is a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure.
  • FIG7 is a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure.
  • FIG8 is a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure.
  • FIG9 is a method flow chart of an information acquisition method involved in an exemplary embodiment of the present disclosure.
  • FIG10 is a structural block diagram of an information acquisition device provided by an exemplary embodiment of the present disclosure.
  • FIG11 is a structural block diagram of an information acquisition device provided by an exemplary embodiment of the present disclosure.
  • FIG. 12 is a schematic diagram of the structure of a Bluetooth device provided by an exemplary embodiment of the present disclosure.
  • Bluetooth is a radio technology that supports short-range communication between devices. It can realize wireless information exchange between multiple electronic devices that support Bluetooth transmission, making data transmission between electronic devices faster and more efficient. It should be noted that the “multiple” mentioned in this disclosure includes two or more, and the same applies to “multiple”.
  • Bluetooth technology it is very common to realize data transmission through Bluetooth technology in various terminal devices. For example, after people establish a Bluetooth connection with a Bluetooth headset through a terminal device, they can play audio data through the Bluetooth headset to realize data interaction.
  • LE-Audio The next generation of Bluetooth audio, the next generation of Bluetooth audio transmission technology
  • the Bluetooth device may be a wireless Bluetooth headset, such as a True Wireless Stereo (TWS) Bluetooth headset, etc.
  • the terminal device may include but is not limited to wearable devices (such as bracelets, smart watches, smart glasses, etc.), mobile phones, tablet computers, laptops, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, desktop computers, laptops, smart home devices, and other terminals with Bluetooth connection functions.
  • the Bluetooth device can also be a terminal device, and the terminal device can also be a Bluetooth device.
  • Figure 1 shows a schematic diagram of a process of Bluetooth connection between a terminal device and a Bluetooth headset according to an exemplary embodiment of the present disclosure.
  • the process of Bluetooth connection may include the following steps.
  • Step 101 A master earphone in a Bluetooth earphone sends a first BLE broadcast message.
  • the Bluetooth headset can actively broadcast the first BLE broadcast information to the space, so that other terminal devices can receive it and establish a Bluetooth connection with itself.
  • the Bluetooth headset is generally placed in an earphone box, and the user can open the earphone box to make the Bluetooth headset start broadcasting the first BLE broadcast information to the surrounding space.
  • the left and right earphones can perform BLE broadcasts at the same time, and the BLE broadcast is used to trigger the establishment of an LE Audio Bluetooth connection, or, when any one of the left and right earphones is working, BLE broadcasts can also be performed to trigger the establishment of an LE Audio Bluetooth connection.
  • the main headset can first actively broadcast the first BLE broadcast information to the space.
  • Step 102 The terminal device receives the first BLE broadcast information and establishes a BLE connection with the main headset.
  • the terminal device can also turn on its own Bluetooth function and perform LE scanning to scan the first BLE broadcast information in the space. After acquiring the first BLE broadcast information, a BLE connection can be established with a master headset in the Bluetooth headset.
  • Step 103 The terminal device obtains the combined identification resolution value SIRK of the primary headset.
  • a coordinated set identification service (CSIS) protocol is provided in the Bluetooth LE Audio technology, which allows devices belonging to the same combination to achieve the purpose of coordination and synchronization when interacting with external devices.
  • the CSIS protocol mainly describes how an external device (equivalent to the terminal device in this embodiment) identifies multiple independent Bluetooth devices in a combination (equivalent to the Bluetooth master headset and slave headset in this embodiment) as the same combination.
  • each device For multiple devices belonging to the same combination, if they are to be used with external devices at the same time, each device needs to establish an independent LE Audio Bluetooth connection with the external device, and at the same time, it can be judged based on the obtained combination identification resolution value (Set Identity Resolving Key, SIRK) of each device, and the devices with the same SIRK value are grouped into a group. Therefore, after the terminal device establishes a BLE connection with the master headset in the Bluetooth headset, it can obtain the SIRK of the master headset.
  • SIRK Set Identity Resolving Key
  • Step 104 The slave earphone in the Bluetooth earphone sends a second BLE broadcast message.
  • the slave earphone in the Bluetooth earphone may also send the second BLE broadcast information.
  • Step 105 The terminal device calculates a first hash value according to the SIRK of the master headset and the prand field in the second BLE broadcast information.
  • the terminal device can receive the second BLE broadcast information sent from the headset and obtain the prand field in the second BLE broadcast information.
  • Figure 2 shows a schematic diagram of the structure of a broadcast information involved in an exemplary embodiment of the present disclosure. As shown in Figure 2, it includes a hash field 201 and a prand field 202.
  • the terminal device can obtain the prand field in the second BLE broadcast by parsing, and calculate the first hash value in combination with the SIRK of the main headset.
  • Step 106 The terminal device detects whether the first hash value is equal to the hash value in the second BLE broadcast information.
  • the terminal device determines whether the slave earphone and the master earphone belong to the same coordination set by detecting whether the first hash value is equal to the hash value in the second BLE broadcast information.
  • the two headsets will send their own LE Audio broadcasts when the headset cover is opened.
  • the mobile phone first establishes a BLE connection with the main headset and obtains the SIRK of the main headset.
  • the main headset can work normally with the terminal device.
  • the terminal device receives the BLE broadcast information from the slave headset, it will parse whether this slave headset and the currently connected master headset belong to the same coordination set.
  • the first hash value is calculated and checked whether it is the same as the hash value in the second BLE broadcast information broadcast by the slave headset. If the same, it will automatically establish an LE Audio connection with the slave headset and work normally. If different, it means that the master headset and the slave headset do not belong to the same coordination set and are not a combination, and the process of this Bluetooth connection is terminated.
  • Step 107 If they are equal, the terminal device establishes a BLE connection with the slave headset.
  • the terminal device When the terminal device detects that the first hash value is equal to the hash value in the second BLE broadcast information, the terminal device establishes a BLE connection with the slave earphone, and completes the process of establishing a BLE connection with both the master earphone and the slave earphone in the Bluetooth earphone.
  • the terminal device after establishing the BLE connection, the terminal device also needs to obtain the GATT information of the Bluetooth headset (for example, through the GATT service discovery process) to learn the functions supported by the Bluetooth headset (such as touch pause, etc.), complete the overall LE Audio configuration, and then use these functions normally.
  • the GATT information of the Bluetooth headset for example, through the GATT service discovery process
  • the functions supported by the Bluetooth headset such as touch pause, etc.
  • the GATT information structure may include one or more units of a service unit 301, a characteristic unit 302, an estimation unit 303, a description unit 304, and a physical characteristic unit 305.
  • the GATT information structure including the above units is disclosed.
  • the service unit 301 can be represented by the service field
  • the characteristic unit 302 can be represented by the characteristic field
  • the estimation unit 303 can be represented by the value field
  • the description unit 304 can be represented by the descriptor field
  • the physical characteristic unit 305 can be represented by the Properties field.
  • each of the above units has a separate handle identifier, and the terminal device needs to query it separately through the attribute profile (ATT). Therefore, the GATT information may include one or more management handle identifiers corresponding to the information units; in some embodiments, the GATT information may also include other contents of the above GATT information structure.
  • the terminal device When there are many GATT information of the Bluetooth device, the terminal device also needs to divide a lot of time to do ATT query, and there is a problem of low efficiency of the terminal device in obtaining GATT information.
  • a BLE connection is established between the Bluetooth headset and the terminal device based on the LE-Audio technology.
  • the terminal device and the Bluetooth headset interact so that the terminal device can query the Generic Attribute Profile (GATT) information of the Bluetooth headset (for example, through the GATT seavice discovery process) and complete the subsequent configuration of the LE-Audio technology (for example, the relevant LE Audio profile configuration).
  • GATT Generic Attribute Profile
  • audio and other transmissions based on the LE Audio Bluetooth connection can be further established when there is a demand for audio and other transmission services.
  • a data stream transmission channel of a Connected Isochronous Steam (CIS) is established to further perform audio and other transmissions.
  • some or all of the steps in establishing a BLE connection or a LE Auido Bluetooth connection can refer to the relevant provisions of the LE Audio Bluetooth standard. Since GATT information is usually large, the terminal device needs to consume a lot of resources by querying one by one. time, resulting in low efficiency of terminal devices in acquiring GATT information, thus resulting in low efficiency of Bluetooth connection of terminal devices.
  • the terminal device includes a processor 410, a transceiver 420 and a display unit 470.
  • the display unit 470 may include a display screen.
  • the terminal device may further include a memory 430.
  • the processor 410, the transceiver 420 and the memory 430 may communicate with each other through an internal connection path to transfer ranging data.
  • the memory 430 is used to store a computer program, and the processor 410 is used to call and run the computer program from the memory 430.
  • the processor 410 and the memory 430 may be combined into a processing device, or more commonly, they are independent components, and the processor 410 is used to execute the program code stored in the memory 430 to implement the above functions.
  • the memory 430 may also be integrated into the processor 410, or may be independent of the processor 410.
  • the terminal device shown in FIG4 may include one or more processing units, for example, the processor 410 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural-network processing unit (neural-network processing unit, NPU), etc.
  • different processing units may be independent devices or integrated in one or more processors.
  • the processor 410 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 410 is a cache memory.
  • the memory may store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
  • the processor 410 may include one or more interfaces.
  • the interface may include an inter-integrated circuit (I4C) interface, an inter-integrated circuit sound (I4S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.
  • I4C inter-integrated circuit
  • I4S inter-integrated circuit sound
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the UART interface is a universal serial data bus for asynchronous communication.
  • the bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication.
  • the UART interface is generally used to connect the processor 410 and the transceiver 420.
  • the processor 410 communicates with the Bluetooth module in the transceiver 420 through the UART interface to implement the Bluetooth function.
  • the MIPI interface can be used to connect the processor 410 to peripheral devices such as the display unit 470.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
  • the processor 410 and the display unit 470 communicate through the DSI interface to realize the display function of the terminal device.
  • the GPIO interface can be configured by software.
  • the GPIO interface can be configured as a control signal or as a data signal.
  • the GPIO interface can be used to connect the processor 410 with the display unit 470, the transceiver 420, etc.
  • the GPIO interface can also be configured as an I4C interface, an I4S interface, a UART interface, a MIPI interface, etc.
  • the transceiver 420 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device.
  • WLAN wireless local area networks
  • BT Bluetooth
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the transceiver 420 can be one or more devices integrating at least one communication processing module, for example, it can include a Bluetooth module.
  • the memory 430 may be used to store computer executable program codes, which include instructions.
  • the memory 430 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the data storage area may store data created during the use of the terminal device (such as positioning data), etc.
  • the memory 430 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
  • the processor 410 executes various functional applications and data processing of the terminal device by running instructions stored in the memory 430 and/or instructions stored in a memory provided in the processor.
  • the terminal device may further include one or more of a power supply 450 , an input unit 460 , an audio circuit 480 , and a sensor 404 .
  • the power supply 450 is used to provide power to various devices or circuits in the terminal device.
  • the power supply 450 can be logically connected to the processor 410 through a power management device, so that the power management device can manage charging, discharging, power consumption and other functions.
  • the input unit 460 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the terminal device.
  • the input unit 460 may include a touch panel and other input devices.
  • a touch panel also known as a touch screen
  • the user's touch operations on or near it can be collected, such as the user's operation on or near the touch panel using any suitable object or accessory such as a finger, stylus, etc., and the corresponding connection device can be driven according to a pre-set program.
  • the touch panel may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 410, and can receive and execute the command sent by the processor 410.
  • the touch panel can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic wave.
  • the input unit 460 can also include other input devices. Specifically, other input devices may include but are not limited to one or more of function keys, trackballs, joysticks, etc.
  • the display unit 470 may be used to display information input by the user or information provided to the user and various menus of the terminal device.
  • the display unit 470 may include a display panel.
  • the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.
  • the touch panel may cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 410 to determine the type of touch event, and then the processor 410 provides a corresponding visual output on the display panel according to the type of touch event.
  • the terminal device may also include at least one sensor 404, such as a gyroscope sensor, a motion sensor, and other sensors.
  • the gyroscope sensor can be used to determine the motion posture of the terminal device.
  • the angular velocity of the terminal device around three axes i.e., x, y, and z axes
  • Gyroscope sensors can also be used for navigation and somatosensory game scenes.
  • the acceleration sensor can detect the magnitude of acceleration in all directions (i.e., x, y, and z axes), and can detect the magnitude and direction of gravity when stationary.
  • the audio circuit 480 may include a speaker and a microphone, providing an audio interface between the user and the terminal device.
  • the audio circuit 480 may transmit the received audio data to the speaker after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 480 and converted into audio data, and then the audio data is output to the processor 410 for processing, and then sent to another terminal device through the RF circuit, or the audio data is output to the memory 430 for further processing.
  • the structure illustrated in the embodiments of the present disclosure does not constitute a specific limitation on the terminal device.
  • the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the terminal device involved in the embodiments of the present disclosure may be installed with an operating system, and applications may be installed and run on the operating system.
  • the terminal device may be an Android system, an iOS system, a Linux system, etc., and the embodiments of the present disclosure are not limited to this.
  • the present disclosure provides an information acquisition method, which actively sends first information containing GATT information to the terminal device in advance before the Bluetooth low energy BLE connection is completed between the Bluetooth device and the terminal device, and the terminal device does not need to perform subsequent ATT query and other processes.
  • Figure 5 shows a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure, and the information acquisition method can be used in a Bluetooth device.
  • the information acquisition method may include the following steps:
  • Step 501 Acquire first information, where the first information includes general attribute GATT information of a Bluetooth device.
  • the Bluetooth device needs to send GATT information to the terminal device before completing the Bluetooth low energy BLE connection with the terminal device, so that the Bluetooth device can obtain its own GATT information in advance.
  • the first information may only include GATT information (equivalent to the first information being GATT information), or may include other information in addition to GATT information.
  • other information may be information that the terminal device needs to obtain after the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device.
  • the terminal device also needs to obtain the A information of the Bluetooth device, then the first information may include GATT information and A information.
  • Step 502 before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, first information is sent to the terminal device, so that the terminal device obtains GATT information according to the first information.
  • the present disclosure actively sends the first information to the terminal device through the Bluetooth device before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device.
  • the Bluetooth device can carry the first information in the information that needs to interact with the terminal device (such as broadcast information) and send it to the terminal device.
  • the Bluetooth device is a Bluetooth headset
  • both the master headset and the slave headset in the Bluetooth headset can be regarded as a separate Bluetooth device.
  • the completion of the Bluetooth BLE connection described in this step is equivalent to before step 102 in Figure 1 above, or before step 107.
  • the Bluetooth device obtains the first information, which includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device obtains the GATT information according to the first information.
  • the first information of the information is actively sent to the terminal device, so that the terminal device obtains the GATT information of the Bluetooth device according to the first information in advance.
  • FIG6 shows a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure, and the information acquisition method can be used in a terminal device.
  • the information acquisition method can include the following steps:
  • Step 601 before the terminal device completes the Bluetooth low energy BLE connection with the Bluetooth device, first information sent by the Bluetooth device is received, where the first information includes general attribute GATT information of the Bluetooth device.
  • the first information may be carried by the Bluetooth device in the information that needs to interact with the terminal device (such as broadcast information), and the terminal device obtains the information by parsing after receiving the information.
  • the first information may include only GATT information (equivalent to the first information being GATT information), or may include other information in addition to GATT information.
  • other information may be information that the terminal device needs to obtain after the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device. For example, if the terminal device also needs to obtain the A information of the Bluetooth device, then the first information may include GATT information and A information.
  • Step 602 Acquire GATT information according to the first information.
  • the terminal device may acquire GATT information in the first information according to the obtained first information.
  • the Bluetooth device acquires the first information, and the first information includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device acquires the GATT information according to the first information.
  • the present disclosure actively sends the first information including the GATT information to the terminal device in advance before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device acquires the GATT information of the Bluetooth device according to the first information in advance.
  • FIG. 5 and FIG. 6 are introduced based on the interaction of establishing a Bluetooth connection between a terminal device and a Bluetooth device.
  • Figure 7 shows a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure, and the information acquisition method can be used in a Bluetooth device and a terminal device.
  • the information acquisition method may include the following steps:
  • Step 701 The Bluetooth device obtains first information, where the first information includes general attribute GATT information of the Bluetooth device.
  • the Bluetooth device may obtain GATT information that needs to be sent to the terminal device, and use the GATT information as the first information.
  • the Bluetooth device may also obtain GATT information and other information that needs to be sent to the terminal device, and package the GATT information and other information that needs to be sent to the terminal device to obtain the first information including the GATT information.
  • the GATT information includes one or more management handle identifiers corresponding to the information units.
  • the management handle identifiers corresponding to the information units in the GATT information obtained by the Bluetooth device require the terminal device to perform an ATT query. Therefore, the GATT information obtained in this step may include the management handle identifiers corresponding to the information units, and then be sent to the terminal device.
  • Step 702 before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, add the first information to the BLE broadcast information used for the BLE connection, and send the BLE broadcast information.
  • the Bluetooth device before the Bluetooth device sends BLE broadcast information to the outside, the Bluetooth device adds the above-mentioned first information to the BLE broadcast and sends it out, so that the terminal device can receive the BLE broadcast information and obtain the GATT information of the Bluetooth device therefrom.
  • the BLE broadcast information for the BLE connection may also include information related to the LE Audio Bluetooth technology, so that the BLE broadcast information may also be used to trigger the establishment of the LE Audio Bluetooth connection.
  • the BLE broadcast information may also be used to trigger the terminal device to pop up a window for the user to choose to establish a Bluetooth connection.
  • the Bluetooth device can add the first information in the free field of the BLE broadcast information.
  • the BLE broadcast information of the Bluetooth device contains 32 bytes, and the information originally required to be carried in the BLE broadcast information occupies 10 bytes. Then, the Bluetooth device can append the first information to the subsequent free 22 bytes, thereby sending the first information through the BLE broadcast information so that the terminal device can obtain it.
  • Step 703 The terminal device receives the BLE broadcast information sent by the Bluetooth device.
  • the terminal device performs Bluetooth scanning and receives BLE broadcast information sent by the Bluetooth device in the space.
  • Step 704 The terminal device obtains first information according to the BLE broadcast information, and obtains GATT information according to the first information.
  • the terminal device parses the BLE broadcast information to obtain the first information carried therein, and obtains the GATT information of the Bluetooth device according to the first information.
  • Step 705 The terminal device establishes a BLE connection with the Bluetooth device.
  • the terminal device can establish a Bluetooth BLE connection with the Bluetooth device, similar to Figure 1 above, which will not be repeated here.
  • steps 701 to 705 can be regarded as the process of steps 101 to 102 in the embodiment of Figure 1 above.
  • the Bluetooth device By carrying the GATT information in the first BLE broadcast information, before the Bluetooth device and the terminal device complete the Bluetooth low energy BLE connection, the Bluetooth device actively sends the first information containing GATT information to the terminal device in advance, and the terminal device does not need to obtain it through the ATT query method later.
  • a query request for obtaining the GATT information is not sent to the Bluetooth device.
  • the LE Audio Bluetooth connection can be completed without obtaining the GATT information through the ATT query, thereby transmitting and communicating audio and other data based on the LE Audio Bluetooth technology, thereby improving the speed of the LE Audio Bluetooth connection.
  • the Bluetooth device acquires the first information, and the first information includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device acquires the GATT information according to the first information.
  • the present disclosure actively sends the first information including the GATT information to the terminal device in advance before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device acquires the GATT information of the Bluetooth device according to the first information in advance.
  • the terminal device can also establish a classic Bluetooth connection (i.e., BT connection) with the Bluetooth device before establishing a BLE connection with the Bluetooth device.
  • a classic Bluetooth connection i.e., BT connection
  • the first information obtained by the Bluetooth device in Figures 5 to 7 above can also be transmitted during the process of establishing a BT connection between the Bluetooth device and the terminal device. That is, the terminal device and the Bluetooth device can be connected to the classic Bluetooth connection and the BLE connection at the same time, and a set of cross-transport key derivation (CTKD) schemes are defined in the existing specifications.
  • CTKD cross-transport key derivation
  • the key (LTK) generated by the BLE connection pairing between the Bluetooth device and the terminal device and the key (linkkey) generated by the BT connection pairing between the Bluetooth device and the terminal device can be converted to each other, so that the user can complete the connection of BT and BLE at the same time with one click, which is very important in the application of LE Audio.
  • the terminal device and the Bluetooth device will first establish a BT connection, and then automatically trigger the BLE connection between the terminal device and the Bluetooth device through CTKD. This requires the Bluetooth device to support BT's secure connection (secure connection), and the terminal device also needs to support BT's secure connection (secure connection).
  • Figure 8 shows a method flow chart of an information acquisition method provided by an exemplary embodiment of the present disclosure, and the information acquisition method is used in a Bluetooth device and a terminal device.
  • the information acquisition method may include the following steps:
  • Step 801 A Bluetooth device obtains first information, where the first information includes general attribute GATT information of the Bluetooth device.
  • the manner in which the Bluetooth device obtains the first information may refer to the description in the embodiment of FIG. 7 above, which will not be described in detail here.
  • Step 802 Add the first information to the BT broadcast information used to establish the Bluetooth BT connection.
  • the Bluetooth device in the process of establishing a classic Bluetooth connection between a terminal device and a Bluetooth device, when the Bluetooth device enters a pairing mode (for example, turning on Bluetooth), the Bluetooth device will transmit an extended inquiry response (Extended Inquiry Response, EIR) data packet to the surrounding area, that is, the BT broadcast information may include an EIR data packet, and the EIR data packet may carry basic device information of the Bluetooth device (for example, device type, device address information, device name, functions supported by the device, etc.), and the EIR data packet may open a user-modifiable and customizable field, and add the first information to the field.
  • EIR Extended Inquiry Response
  • the Bluetooth device can add a field in the EIR data packet to place the first information obtained above.
  • the first information only contains GATT information, it is equivalent to placing the complete GATT information in the field added in the EIR data packet.
  • Step 803 The Bluetooth device sends BT broadcast information for establishing a Bluetooth BT connection.
  • Step 804 The terminal device receives BT broadcast information, and obtains the first information according to the BT broadcast information.
  • the terminal device may receive BT broadcast information sent by the Bluetooth device, obtain the first information carried therein by parsing the obtained BT broadcast information, and obtain the GATT information of the Bluetooth device based on the first information.
  • the above BT broadcast information includes an EIR data packet.
  • the terminal device After the terminal device receives the EIR data packet sent by the Bluetooth device, it parses and stores the EIR data packet, obtains the first information added in the EIR data packet, and obtains the GATT information contained in the first information.
  • Step 805 The terminal device establishes a BT connection with the Bluetooth device.
  • the terminal device can establish a classic Bluetooth connection with the Bluetooth device.
  • the establishment of a classic Bluetooth connection can be triggered first, then a BLE connection can be established, and then an LE Audio Bluetooth connection can be established.
  • GATT information can be obtained as early as possible to establish the final LE Audio Bluetooth connection.
  • the Bluetooth device and the terminal device can transmit the first information in the process of establishing classic Bluetooth, so that the terminal device does not need to perform ATT query again after the subsequent BLE connection is established.
  • the Bluetooth device obtains the first information, which includes the general attribute GATT information of the Bluetooth device; Before the terminal device completes the Bluetooth low energy BLE connection, the first information is sent to the terminal device so that the terminal device obtains the GATT information according to the first information.
  • the present disclosure actively sends the first information containing GATT information to the terminal device in advance before the Bluetooth device and the terminal device complete the Bluetooth low energy BLE connection, so that the terminal device obtains the GATT information of the Bluetooth device according to the first information in advance.
  • the above-mentioned first information can also be added to the process of SDP query between the terminal device and the Bluetooth device, that is, after the terminal device establishes a classic Bluetooth connection with the Bluetooth device in the above-mentioned Figure 8, the BLE connection between the terminal device and the Bluetooth device is automatically triggered through CTKD. This requires the terminal device to discover whether the Bluetooth device supports BT's secure connection (secure connection). If supported, the terminal device can send a Service Discovery Protocol (SDP) query to the Bluetooth device, so that the Bluetooth device returns the SDP query result.
  • SDP Service Discovery Protocol
  • FIG9 shows a method flow chart of an information acquisition method involved in an exemplary embodiment of the present disclosure.
  • the information acquisition method can be used in a Bluetooth device and a terminal device. As shown in FIG9, the information acquisition method may include the following steps:
  • Step 901 The Bluetooth device sends BT broadcast information.
  • Step 902 The terminal device establishes a BT connection with the Bluetooth device.
  • Step 903 The terminal device discovers that the headset supports BT secure connection.
  • the method for establishing a BT connection between the terminal device and the Bluetooth device can refer to the method shown in Figure 8 above, which will not be repeated here. It should be noted that in this embodiment, during the process of establishing a BT connection, it is not necessary to add the first information to the BT broadcast information. When the Bluetooth device subsequently sends the SDP query result to the terminal device, the first information is added to the SDP query result, which also achieves the effect that the terminal device obtains the GATT information of the Bluetooth device before the terminal device establishes a BLE connection with the Bluetooth device.
  • Step 904 The terminal device sends an SDP query instruction to the Bluetooth device.
  • the terminal device After establishing a BT connection with the Bluetooth device, the terminal device obtains an SDP query result of the Bluetooth device by sending an SDP query instruction.
  • Step 905 The Bluetooth device obtains first information, where the first information includes general attribute GATT information of the Bluetooth device.
  • the manner in which the Bluetooth device obtains the first information may refer to the description in the embodiment of FIG. 8 above, which will not be described in detail here. It should be noted that the execution process of step 905 may be performed after the Bluetooth device is turned on, which is not limited in this embodiment. That is, the Bluetooth device may obtain the first information during the establishment of the classic Bluetooth BT connection, or after the classic Bluetooth BT connection is established.
  • Step 906 The Bluetooth device adds the first information to the SDP query result in response to the SDP query instruction.
  • the Bluetooth device feeds back the SDP query result to the terminal device, and the SDP query result also provides user-modifiable and customizable fields.
  • the Bluetooth device After receiving the SDP query instruction, the Bluetooth device generates the SDP query result and adds the first information to the remaining free fields in the SDP query result, thereby sending it to the terminal device.
  • Step 907 The Bluetooth device returns the SDP query result to the terminal device.
  • the SDP query result includes the added first information, namely, the GATT information of the Bluetooth device.
  • Step 908 The terminal device receives the SDP query result, obtains first information from the SDP query result, and obtains GATT information according to the first information.
  • the terminal device receives the SDP query result sent by the Bluetooth device, parses the first information therefrom, and acquires the GATT information of the Bluetooth device according to the first information.
  • Step 909 The terminal device parses the LIK according to the linkkey and performs the BLE connection process.
  • Step 910 The Bluetooth device sends BLE broadcast information.
  • Step 911 The terminal device receives the BLE broadcast information sent by the Bluetooth device, queries whether the Bluetooth device is included in the whitelist maintained by the terminal device, and whether the terminal device can process the BLE broadcast information.
  • the whitelist includes the names of various Bluetooth devices maintained by the terminal device. After the terminal device obtains the device name of the Bluetooth device through BLE broadcast information, it determines whether the whitelist maintained by itself includes the Bluetooth device, and determines whether it can process the BLE broadcast information. When the Bluetooth device is included in the whitelist maintained by the terminal device and the terminal device can process the BLE broadcast information, execute step 912, otherwise end.
  • Step 912 The terminal device establishes a BLE connection with the Bluetooth device based on the CSIS protocol.
  • the process of establishing a BLE connection between the terminal device and the Bluetooth device in the above steps 909 to 912 can refer to the process of establishing a BLE connection in the above embodiments, which will not be repeated here.
  • the terminal device can send confirmation information to the Bluetooth device, and correspondingly, the Bluetooth device can also obtain the confirmation information sent by the terminal device.
  • the Bluetooth device also includes obtaining the confirmation information sent by the terminal device, and the confirmation information is used to indicate that the terminal device has obtained the GATT information; according to the confirmation information, it is determined that the Bluetooth device In the process of establishing a BLE connection with the terminal device, the GATT information in the first information is stopped from being sent to the terminal device.
  • the Bluetooth device After the Bluetooth device sends out the first information obtained above, it receives the confirmation information returned by the terminal device, so as to know that the terminal device has obtained the GATT information before establishing the BLE connection with itself this time.
  • the terminal device adds the first information to the BT broadcast information and receives the confirmation information before the above step 902. Then, in the subsequent SDP query process and the process of sending the BLE broadcast information, the Bluetooth device does not need to add its own GATT information to the SDP query instruction or BLE broadcast information, thereby reducing the amount of data transmission and improving the connection efficiency.
  • the terminal device adds the first information to the SDP query result and receives the confirmation information before the above step 909. Then, in the subsequent process of sending the BLE broadcast information, the Bluetooth device does not need to add its own GATT information to the BLE broadcast information, thereby reducing the amount of data transmission and improving the connection efficiency.
  • the terminal device may directly send the confirmation information to the Bluetooth device, for example, the terminal device directly sends the confirmation information to the Bluetooth device.
  • the terminal device may also carry the confirmation information in the information to be sent to the Bluetooth device, for example, the confirmation information is carried in the second information sent by the terminal device to the Bluetooth device, and the second information is the query information sent by the terminal device to the Bluetooth device.
  • the Bluetooth device receives the query information sent by the terminal device, and the query information includes confirmation information; according to the query information, the confirmation information is obtained.
  • the Bluetooth device adds the first information during the BT broadcast process.
  • the terminal device obtains the GATT information, in the above SDP query process, when sending the SDP query instruction in step 904, the confirmation information can be added to the SDP query instruction.
  • the Bluetooth device obtains the confirmation information carried therein by parsing.
  • the way in which the above-mentioned terminal device feeds back confirmation information can be flexibly changed.
  • the terminal device After obtaining the GATT information, the terminal device no longer needs to interact with the Bluetooth device for information.
  • the terminal device can directly send the confirmation information to the Bluetooth device. If the terminal device needs to interact with the Bluetooth device for information (for example, it needs to perform an SDP query process), the terminal device can carry the confirmation information in the information to be sent and send it to the Bluetooth device, and the feedback method of the confirmation information can also be applied to the various embodiments of Figures 5 to 8 above.
  • the Bluetooth device after the Bluetooth device obtains the first information, it can choose any one or more of the methods to carry the first information in the BT broadcast information, in the BLE broadcast information, and in the SDP query instruction, and can also be flexibly changed according to the needs of the developer. It only needs to enable the Bluetooth device to send its own GATT information to the terminal device before the BLE connection is established. This embodiment is not limited to this.
  • the terminal device after obtaining the GATT information, the terminal device no longer sends a query request for obtaining the GATT information to the Bluetooth device.
  • the LE Audio Bluetooth connection can be completed without obtaining the GATT information through the ATT query, thereby transmitting and communicating audio and other data based on the LE Audio Bluetooth technology, thereby improving the speed of the LE Audio Bluetooth connection.
  • the Bluetooth device takes a Bluetooth headset (TWS headset) as an example.
  • the Bluetooth device can be other product forms (for example, a smart bracelet, a smart watch, a TWS speaker, etc.), or can include multiple Bluetooth devices and a combination of multiple Bluetooth devices.
  • the specific Bluetooth device is not limited here.
  • the Bluetooth device and the terminal device after the Bluetooth device and the terminal device complete the Bluetooth low energy BLE connection, the Bluetooth device and the terminal device also complete the LE Audio Bluetooth connection with the terminal device based on the LE Audio protocol. Since the Bluetooth device sends its own GATT information and its corresponding handle identifier to the terminal device in the BLE broadcast content, and/or in the classic EIR packet, and/or in the SDP query result, the terminal device can subsequently omit the process (service discovery process) of querying GATT information one by one after establishing the BLE connection in FIG. 1, thereby saving connection time and improving the efficiency of establishing the LE Audio Bluetooth connection between the Bluetooth device and the terminal device.
  • process service discovery process
  • the mobile phone and the headset bypass the standard GATT service discovery process, and synchronize the GATT structure of the headset and its corresponding handle identifier to the mobile phone through the BLE broadcast content or the classic EIR packet or SDP.
  • the mobile phone can subsequently omit the service discovery process, thereby saving connection time, thereby improving the user experience.
  • the Bluetooth device obtains the first information, and the first information includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device obtains the GATT information according to the first information.
  • the present disclosure actively sends the first information containing GATT information to the terminal device in advance before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device obtains the GATT information of the Bluetooth device according to the first information in advance.
  • the Bluetooth device has actively sent the GATT information to the terminal device, and the terminal device does not need to query the GATT information separately.
  • the process of querying GATT information is skipped, which reduces the time taken by the terminal device to obtain GATT information, improves the efficiency of the terminal device to obtain GATT information, and improves the efficiency of the Bluetooth device to establish a Bluetooth connection with the terminal device.
  • this solution also improves the efficiency of establishing BLE connections by promptly canceling the subsequent redundant transmission of GATT information through feedback confirmation information between the terminal device and the Bluetooth device.
  • FIG. 10 shows a structural block diagram of an information acquisition device provided by an exemplary embodiment of the present disclosure.
  • the information acquisition device 1000 can be used in a Bluetooth device to execute all or part of the steps performed by the Bluetooth device in the method provided in the embodiments shown in FIG. 5, FIG. 7, FIG. 8 or FIG. 9.
  • the information acquisition device 1000 includes:
  • a first acquisition module 1001 is used to acquire first information, where the first information includes general attribute GATT information of the Bluetooth device;
  • the information sending module 1002 is used to send the first information to the terminal device before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device obtains the GATT information according to the first information.
  • the Bluetooth device acquires the first information, and the first information includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device acquires the GATT information according to the first information.
  • the present disclosure actively sends the first information including the GATT information to the terminal device in advance before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device acquires the GATT information of the Bluetooth device according to the first information in advance.
  • the information sending module 1002 includes: a first sending unit;
  • the first sending unit is used to add the first information to the BLE broadcast information used for the BLE connection, and send the BLE broadcast information to the terminal device.
  • the device further comprises:
  • a first establishing module used to establish a Bluetooth BT connection with the terminal device before establishing the BLE connection
  • the information sending module 1002 includes: a second sending unit;
  • the second sending unit is used to add the first information to the BT broadcast information used to establish the Bluetooth BT connection, and send the BT broadcast information to the terminal device.
  • the device further comprises:
  • a first receiving module is used to receive a service discovery protocol SDP query instruction sent by the terminal device
  • the information sending module 1002 includes: a third sending unit;
  • the third sending unit is used to add the first information to the SDP query result in response to the SDP query instruction, and send the SDP query result to the terminal device.
  • the GATT information includes management handle identifiers corresponding to one or more information units.
  • the device further comprises:
  • a first acquisition module configured to acquire confirmation information sent by the terminal device after sending the first information to the terminal device, wherein the confirmation information is used to indicate that the terminal device has acquired the GATT information;
  • the first determining module is used to determine, according to the confirmation information, to stop sending the GATT information in the first information to the terminal device during the process of establishing a BLE connection between the Bluetooth device and the terminal device.
  • the first acquisition module includes: a first receiving unit and a first acquisition unit;
  • the first receiving unit is used to receive the query information sent by the terminal device, wherein the query information includes the confirmation information;
  • the first acquiring unit is used to acquire the confirmation information according to the query information.
  • the device further comprises:
  • the second establishment module is used to complete the LE Audio Bluetooth connection with the terminal device based on the LE Audio protocol after the Bluetooth device and the terminal device complete the Bluetooth low energy consumption BLE connection.
  • FIG. 11 shows a structural block diagram of an information acquisition device provided by an exemplary embodiment of the present disclosure.
  • the information acquisition device 1100 can be used in a Bluetooth device to execute all or part of the steps performed by the terminal device in the method provided in the embodiments shown in FIG. 6, FIG. 7, FIG. 8 or FIG. 9.
  • the information acquisition device 1100 includes:
  • the information receiving module 1101 is used to receive first information sent by the Bluetooth device before the terminal device completes the Bluetooth low energy BLE connection with the Bluetooth device, wherein the first information includes the general attribute GATT information of the Bluetooth device;
  • the second acquisition module 1102 is used to acquire the GATT information according to the first information.
  • the Bluetooth device acquires the first information, and the first information includes the general attribute GATT information of the Bluetooth device; before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, the first information is sent to the terminal device, so that the terminal device acquires the GATT information according to the first information.
  • the present disclosure actively sends the first information including the GATT information to the terminal device in advance before the Bluetooth device completes the Bluetooth low energy BLE connection with the terminal device, so that the terminal device acquires the GATT information of the Bluetooth device according to the first information in advance.
  • the information receiving module 1101 is used to receive BLE broadcast information sent by the Bluetooth device for the BLE connection, wherein the BLE broadcast information includes the first information; and obtain the first information according to the BLE broadcast information.
  • the device further comprises:
  • a third establishing module used to establish a Bluetooth BT connection with the Bluetooth device before establishing the BLE connection;
  • the information receiving module 1101 is further configured to receive BT broadcast information sent by the Bluetooth device for establishing the Bluetooth BT connection, wherein the BT broadcast information includes the first information; and obtain the first information according to the BT broadcast information.
  • the device further comprises:
  • An instruction sending module used for sending a service discovery protocol SDP query instruction to the Bluetooth device
  • the information receiving module 1101 is further configured to receive an SDP query result sent by the Bluetooth device, wherein the SDP query result includes the first information; and obtain the first information according to the SDP query result.
  • the GATT information includes management handle identifiers corresponding to one or more information units.
  • the device further comprises:
  • the second sending module is used to send confirmation information to the Bluetooth device after the GATT information is obtained according to the first information, and the confirmation information is used to indicate that the terminal device has obtained the GATT information.
  • the confirmation information is carried in second information sent by the terminal device to the Bluetooth device, and the second information is query information sent by the terminal device to the Bluetooth device.
  • the second sending module is further used to not send a query request for obtaining GATT information to the Bluetooth device after confirming that the GATT information is obtained.
  • the device further comprises:
  • the fourth establishing module is used to complete the LE Audio Bluetooth connection with the Bluetooth device based on the LE Audio protocol after the terminal device completes the Bluetooth low energy consumption BLE connection with the Bluetooth device.
  • FIG12 is a schematic diagram of the structure of a Bluetooth device provided by an exemplary embodiment of the present disclosure.
  • the Bluetooth device 1200 includes: a processor 1201 and a memory 1202, a communication interface 1203 and a bus 1204.
  • the memory 1202 is used to store instructions
  • the processor 1201 is used to execute the instructions stored in the memory 1202.
  • the processor 1201, the memory 1202 and the communication interface 1203 are connected to each other through the bus 1204.
  • the processor 1201 is used to: obtain a first parameter of the device 1200, which is used to indicate the current communication quality of the Bluetooth device 1200; when it is determined according to the first parameter that the communication quality of the Bluetooth device 1200 is lower than a preset communication quality threshold, control the Bluetooth device 1200 to reconnect to the network.
  • the Bluetooth device 1200 may be used to execute each step and/or process executed by the Bluetooth device in each of the above method embodiments.
  • the memory 1202 may include a read-only memory and a random access memory, and provide instructions and data to the processor 1201.
  • a portion of the memory 1202 may also include a non-volatile random access memory.
  • the memory 1202 may also store information about the device type.
  • the processor 1201 may be used to execute the instructions stored in the memory, and when the processor executes the instructions, the processor 1201 may execute the various steps and/or processes executed by the Bluetooth device in the above method embodiment.
  • the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • CPU central processing unit
  • DSP digital signal processors
  • ASIC application-specific integrated circuits
  • FPGA field programmable gate arrays
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • An embodiment of the present disclosure also provides a Bluetooth device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement all or part of the steps performed by the terminal device or the Bluetooth device in the information acquisition method described in the above embodiments.
  • An embodiment of the present disclosure also provides a terminal device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement all or part of the steps performed by the terminal device or the Bluetooth device in the information acquisition method described in the above embodiments.
  • An embodiment of the present disclosure also provides a computer-readable medium, in which at least one instruction, at least one program, a code set or an instruction set is stored.
  • the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement all or part of the steps performed by a terminal device or a Bluetooth device in the information acquisition method described in the above embodiments.
  • the embodiments of the present disclosure also provide a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the information acquisition method described in the above embodiments, and all or part of the steps executed by the terminal device or Bluetooth device.
  • the embodiments of the present disclosure also provide an application publishing platform, which is used to publish a computer program product.
  • the computer program product runs on a computer, the computer is enabled to execute all or part of the steps of the information acquisition method described in the above embodiments, which are executed by a terminal device or a Bluetooth device.
  • the device provided in the above embodiment performs the control of the terminal device, only the division of the above functional modules is used as an example.
  • the above functions can be assigned to different functional modules as needed, that is, 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 method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

Landscapes

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

Abstract

本公开公开了一种信息获取方法、装置、蓝牙设备、终端设备及存储介质,属于蓝牙连接技术领域。应用于蓝牙设备,该方法包括:获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。

Description

信息获取方法、装置、蓝牙设备、终端设备及存储介质
本公开要求于2022年10月21日提交、申请号为202211295568.1、发明名称为“信息获取方法、 装置、蓝牙设备、终端设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本公开 中。
技术领域
本公开涉及蓝牙连接技术领域,特别涉及一种信息获取方法、装置、蓝牙设备、终端设备及存储介质。
背景技术
随着蓝牙技术的发展,在日常生活中通过蓝牙技术实现终端设备与终端设备之间的数据传输非常普遍。
其中,LE-Audio(The next generation of Bluetooth audio,下一代蓝牙音频传输技术)作为蓝牙领域中一项新的音频传输技术,可以给人们带来更低功耗、更低成本、更高质量、以及更低延迟的无线音频服务。在建立LE-Audio蓝牙连接的过程中,会建立蓝牙低能耗(Bluetooth Low Energy,BLE)连接,获取蓝牙耳机的通用属性(Generic Attribute Profile,GATT)信息等步骤,该过程需要的时间较长,存在终端设备蓝牙连接的效率低的问题。
发明内容
本公开实施例提供了一种信息获取方法、装置、蓝牙设备、终端设备及存储介质。
一个方面,本公开实施例提供了一种信息获取方法,应用于蓝牙设备,所述方法包括:
获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向所述终端设备发送所述第一信息,以使得所述终端设备根据所述第一信息获取到所述GATT信息。
一个方面,本公开实施例提供了提供了一种信息获取方法,所述方法应用于终端设备,所述方法包括:
在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收所述蓝牙设备发送的第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
根据所述第一信息,获取所述GATT信息。
一个方面,本公开实施例提供了提供了一种信息获取装置,所述装置应用于蓝牙设备,所述装置包括:
第一获取模块,用于获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
信息发送模块,用于在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向所述终端设备发送所述第一信息,以使得所述终端设备根据所述第一信息获取到所述GATT信息。
一个方面,本公开实施例提供了提供了一种信息获取装置,所述装置应用于终端设备,所述装置包括:
信息接收模块,用于在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收所述蓝牙设备发送的第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
第二获取模块,用于根据所述第一信息,获取所述GATT信息。
一个方面,本公开提供了一种蓝牙设备,所述蓝牙设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如一个方面所述的信息获取方法。
一个方面,本公开提供了一种终端设备,所述终端设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如一个方面所述的信息获取方法。
一个方面,本公开提供了一种计算机可读存储介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如一个方面所述的信息获取方法。
一个方面,本公开实施例提供了一种计算机程序产品,当所述计算机程序产品在计算机上运行时, 使得所述计算机执行如上述一个方面所述的信息获取方法。
一个方面,本公开实施例提供了一种应用发布平台,所述应用发布平台用于发布计算机程序产品,其中,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如上述一个方面所述的信息获取方法。
附图说明
为了更清楚地说明本公开实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是本公开一示例性实施例涉及的一种终端设备与蓝牙耳机进行蓝牙连接的流程示意图;
图2是本公开一示例性实施例涉及的一种广播信息的结构示意图;
图3是本公开一示例性实施例涉及的一种GATT信息的结构示意图;
图4是本公开一示例性实施例涉及的一种终端设备的结构示意图;
图5是本公开一示例性实施例提供的一种信息获取方法的方法流程图;
图6是本公开一示例性实施例提供的一种信息获取方法的方法流程图;
图7是本公开一示例性实施例提供的一种信息获取方法的方法流程图;
图8是本公开一示例性实施例提供的一种信息获取方法的方法流程图;
图9是本公开一示例性实施例涉及的一种信息获取方法的方法流程图;
图10是本公开一示例性实施例提供的信息获取装置的结构框图;
图11是本公开一示例性实施例提供的信息获取装置的结构框图;
图12是本公开一示例性实施例提供的一种蓝牙设备的结构示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
蓝牙是一种支持设备短距离通信的无线电技术,能够实现在多个支持蓝牙传输的电子设备之间的无线信息交换,使得电子设备之间的数据传输更加迅速和高效。需要说明的是,本公开中提到的“多个”包括两个或两个以上,“多种”同理。
随着蓝牙技术的发展,在各种各样的终端设备中通过蓝牙技术实现数据传输的现象非常普遍,比如,人们通过终端设备与蓝牙耳机建立蓝牙连接之后,就可以通过蓝牙耳机播放音频数据,实现数据的交互。其中,LE-Audio(The next generation of Bluetooth audio,下一代蓝牙音频传输技术)作为蓝牙领域中一项新的音频传输技术,给人们带来更低功耗、更低成本、更高质量、以及更低延迟的无线音频服务。
可选的,本公开中,蓝牙设备可为无线蓝牙耳机,例如真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等。终端设备可包括但不限于可穿戴设备(如手环、智能手表、智能眼镜等)、手机、平板电脑,笔记本电脑,MP3播放器(Moving Picture Experts Group Audio Layer III,动态影像专家压缩标准音频层面3),MP4(Moving Picture Experts Group Audio Layer IV,动态影像专家压缩标准音频层面4)播放器,台式电脑,膝上型便携计算机,智能家居设备等具有蓝牙连接功能的终端。其中,蓝牙设备也可以是终端设备,终端设备也可以是蓝牙设备。
请参考图1,其示出了本公开一示例性实施例涉及的一种终端设备与蓝牙耳机进行蓝牙连接的流程示意图。如图1所示,该蓝牙连接的流程可以包括如下几个步骤。
步骤101,蓝牙耳机中的主耳机发送第一BLE广播信息。
其中,蓝牙耳机作为蓝牙设备,可以主动向空间广播第一BLE广播信息,从而让其他终端设备接收到,与自身建立蓝牙连接。在实际应用中,蓝牙耳机一般放置在耳机盒中,用户可以通过打开耳机盒使得蓝牙耳机开始向周围空间广播第一BLE广播信息。其中,在一些实施例中,左右耳机可以同时进行BLE广播,该BLE广播用于触发建立LE Audio蓝牙连接,或者,当左右耳机两个耳机中的任意一个耳机工作时,也可以进行BLE广播,从而触发建立LE Audio蓝牙连接。本实施例中,以TWS耳机为例,主耳机可以先主动向空间中广播第一BLE广播信息。
步骤102,终端设备接收第一BLE广播信息,并与主耳机建立BLE连接。
可选的,终端设备也可以开启自身的蓝牙功能,并进行LE扫描,扫描空间中的第一BLE广播信息, 获取到第一BLE广播信息后可以与蓝牙耳机中的主耳机建立BLE连接。
步骤103,终端设备获取主耳机的组合标识解析值SIRK。
可选的,在蓝牙LEAudio技术中提供有协同集识别服务(Coordinated SetIdentification service,CSIS)协议,可以让属于同一个组合中的设备在与外部设备交互时,达成协调同步的目的。该CSIS协议中主要说明了外部设备(相当于本实施例中的终端设备)如何将一个组合中的多个独立的蓝牙设备(相当于本实施例中的蓝牙主耳机和从耳机)识别为同一个组合。针对属于同一个组合中的多个设备,要想同时与外部设备一起使用的话,每一个设备都需要跟外部设备建立独立的LE Audio蓝牙连接,同时可以根据获取到的每个设备的组合标识解析值(Set Identity Resolving Key,SIRK)进行判断,将具有相同SIRK值的设备组成一个组合。因此,终端设备在与蓝牙耳机中的主耳机建立BLE连接之后,可以获取到主耳机的SIRK。
步骤104,蓝牙耳机中的从耳机发送第二BLE广播信息。
可选的,蓝牙耳机中的从耳机也可以发送第二BLE广播信息。
步骤105,终端设备根据主耳机的SIRK和第二BLE广播信息中的prand字段计算第一哈希值。
相应的,终端设备可以接收到从耳机发送的第二BLE广播信息,并获取到第二BLE广播信息中的prand字段。请参考图2,其示出了本公开一示例性实施例涉及的一种广播信息的结构示意图。如图2所示,其中包含了hash字段201、prand字段202。终端设备可以通过解析获取到第二BLE广播中的prand字段,并结合主耳机的SIRK计算出第一哈希值。
步骤106,终端设备检测第一哈希值与第二BLE广播信息中的哈希值是否相等。
可选的,终端设备得到第一哈希值之后,通过检测第一哈希值是否与第二BLE广播信息中的哈希值相等,判断该从耳机与主耳机是否属于相同协调集。
也就是说,本实施例中,针对首次连接支持蓝牙LE Audio的蓝牙耳机,在耳机开盖时两只耳机会发送各自的LE Audio广播,当用户选择连接其中一只耳机(主耳机)时,手机先与该主耳机建立BLE连接且获取该主耳机的SIRK,此时主耳机就可以正常与终端设备工作了。终端设备再收到从耳机的BLE广播信息时会解析此从耳机与当前连接的主耳机是否属于相同协调集,根据主耳机的SIRK与从耳机广播的第二BLE广播信息中的prand字段,计算出第一hash值并检测是否与从耳机广播的第二BLE广播信息里的hash值是否相同,如果相同则自动与从耳机建立LE Audio连接后正常工作。若不同,则说明主耳机与从耳机不属于一个相同协调集,不是一个组合,结束此次蓝牙连接的流程。
步骤107,若相等,终端设备与从耳机建立BLE连接。
终端设备检测到第一哈希值与第二BLE广播信息中的哈希值相等时,终端设备与从耳机建立BLE连接,完成与蓝牙耳机中主耳机以及从耳机均建立BLE连接过程。
可选的,终端设备在建立BLE连接之后,还需要获取蓝牙耳机的GATT信息(例如通过GATT service discovery流程),从而得知蓝牙耳机所支持的功能(比如触摸暂停等),完成整体的LE Audio的配置,进而正常使用这些功能。
请参考图3,其示出了本公开一示例性实施例涉及的一种GATT信息的结构示意图。示例的,在GATT信息结构中可以包括服务单元301,特征单元302,估量单元303,描述单元304,物理特征单元305中的一种或多种单元,如图3所示披露了包括上述单元的GATT信息结构。其中,服务单元301可以用service字段表示,特征单元302可以用characteristic字段表示,估量单元303可以用value字段表示,描述单元304可以用descriptor字段表示,物理特征单元305可以用Properties字段表示。可选的,对于上述每个单元都具有单独的handle标识,并且需要终端设备单独通过属性配置文件(Attribute Profile,ATT)查询,因此,GATT信息中可以包括一个或多个信息单元对应的管理handle标识;在一些实施例中,GATT信息还可以包括上述GATT信息结构的其他内容。当蓝牙设备的GATT信息较多时,终端设备也需要划分大量时间做ATT查询,存在终端设备获取GATT信息的效率低的问题。
对于上述图1所示的过程中,在蓝牙耳机与终端设备之间,基于LE-Audio技术建立BLE连接。在BLE连接建立完成后,终端设备与蓝牙耳机通过交互的方式,使得终端设备可以查询到蓝牙耳机的通用属性(Generic Attribute Profile,GATT)信息(例如通过GATT seavice discovery流程),并完成LE-Audio技术在后续的配置(例如相关LE Audio profile配置),可以理解为基于LE Audio协议,建立LE Audio蓝牙连接,从而可以正常使用蓝牙耳机提供的功能,可以理解为可以基于LE Audio蓝牙连接进行音频等传输,在一些实施例中,基于LE Audio蓝牙连接进行音频等传输,可以是在有音频等传输业务需求的情况下进一步建立连接等时流(Connected Isochronous Steam,简称CIS)的数据流传输通道,进而进行音频等数据传输。在一些实施例中,建立BLE连接或LE Auido蓝牙连接中的部分或全部步骤可以参考LE Audio蓝牙标准相关的规定。由于GATT信息通常较多,终端设备通过一一查询的方式需要消耗大量 的时间,导致终端设备获取GATT信息的效率低,因此存在终端设备蓝牙连接的效率低的问题。
请参考图4,其示出了本公开一示例性实施例涉及的一种终端设备的结构示意图。如图4所示,终端设备包括处理器410、收发器420和显示单元470。其中,显示单元470可以包括显示屏。
可选地,终端设备还可以包括存储器430。处理器410、收发器420和存储器430之间可以通过内部连接通路互相通信,传递测距数据,该存储器430用于存储计算机程序,该处理器410用于从该存储器430中调用并运行该计算机程序。
上述处理器410可以和存储器430合成一个处理装置,更常见的是彼此独立的部件,处理器410用于执行存储器430中存储的程序代码来实现上述功能。具体实现时,该存储器430也可以集成在处理器410中,或者,独立于处理器410。
可以理解的是,图4所示的终端设备可以包括一个或多个处理单元,例如:处理器410可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
处理器410中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器410中的存储器为高速缓冲存储器。该存储器可以保存处理器410刚用过或循环使用的指令或数据。如果处理器410需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器410的等待时间,因而提高了系统的效率。
在一些实施例中,处理器410可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I4C)接口,集成电路内置音频(inter-integrated circuit sound,I4S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器410与收发器420。例如:处理器410通过UART接口与收发器420中的蓝牙模块通信,实现蓝牙功能。
MIPI接口可以被用于连接处理器410与显示单元470等外围器件。MIPI接口包括摄像头串行接口(camera serial interface,CSI),显示屏串行接口(display serial interface,DSI)等。在一些实施例中,处理器410和显示单元470通过DSI接口通信,实现终端设备的显示功能。
GPIO接口可以通过软件配置。GPIO接口可以被配置为控制信号,也可被配置为数据信号。在一些实施例中,GPIO接口可以用于连接处理器410与显示单元470,收发器420等。GPIO接口还可以被配置为I4C接口,I4S接口,UART接口,MIPI接口等。
收发器420可以提供应用在终端设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。收发器420可以是集成至少一个通信处理模块的一个或多个器件,例如,可以包括蓝牙模块。
存储器430可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。存储器430可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储终端设备使用过程中所创建的数据(比如定位数据)等。此外,存储器430可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器410通过运行存储在存储器430的指令,和/或存储在设置于处理器中的存储器的指令,执行终端设备的各种功能应用以及数据处理。
除此之外,为了使得终端设备的功能更加完善,终端设备还可以包括电源450、输入单元460、音频电路480和传感器404等中的一个或多个。
电源450,用于给终端设备中的各种器件或电路提供电源。优选的,电源450可以通过电源管理装置与处理器410逻辑相连,从而通过电源管理装置实现管理充电、放电、以及功耗管理等功能。
输入单元460可用于接收输入的数字或字符信息,以及产生与终端设备的用户设置以及功能控制有关的键信号输入。具体地,输入单元460可包括触控面板以及其他输入设备。触控面板,也称为触摸屏, 可收集用户在其上或附近的触摸操作,比如用户使用手指、触笔等任何适合的物体或附件在触控面板上或在触控面板附近的操作,并根据预先设定的程式驱动相应的连接装置。可选的,触控面板可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器410,并能接收处理器410发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板。除了触控面板,输入单元460还可以包括其他输入设备。具体地,其他输入设备可以包括但不限于功能键、轨迹球、操作杆等中的一种或多种。
显示单元470可用于显示由用户输入的信息或提供给用户的信息以及终端设备的各种菜单。显示单元470可包括显示面板,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。进一步的,触控面板可覆盖显示面板,当触控面板检测到在其上或附近的触摸操作后,传送给处理器410以确定触摸事件的类型,随后处理器410根据触摸事件的类型在显示面板上提供相应的视觉输出。
终端设备还可包括至少一种传感器404,比如陀螺仪传感器、运动传感器以及其他传感器。具体地,陀螺仪传感器可以用于确定终端设备的运动姿态。在一些实施例中,可以通过陀螺仪传感器确定终端设备围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器还可以用于导航,体感游戏场景。作为运动传感器的一种,加速度传感器可检测各个方向上(即,x,y和z轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端设备还可配置的压力计、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路480可包括扬声器和传声器,提供用户与终端设备之间的音频接口。音频电路480可将接收到的音频数据转换后的电信号,传输到扬声器,由扬声器转换为声音信号输出;另一方面,传声器将收集的声音信号转换为电信号,由音频电路480接收后转换为音频数据,再将音频数据输出处理器410处理后,经RF电路以发送给比如另一终端设备,或者将音频数据输出至存储器430以便进一步处理。
可以理解的是,本公开实施例示意的结构并不构成对终端设备的具体限定。在本公开另一些实施例中,终端设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
另外,本公开实施例所涉及的终端设备,可安装有操作系统,在该操作系统上可以安装运行应用程序,比如,终端设备可以是安卓(Android)系统,iOS系统,Linux系统等,本公开实施例对此不作限定。
为了解决上述相关技术中存在的问题,提高终端设备获取GATT信息的效率,本公开提供了一种信息获取方法,在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,不需要终端设备后续进行ATT查询等过程。
请参考图5,其示出了本公开一示例性实施例提供的一种信息获取方法的方法流程图,该信息获取方法可以用于蓝牙设备中。如图5所示,该信息获取方法可以包括如下步骤:
步骤501,获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息。
可选的,在本公开中,蓝牙设备需要在与终端设备完成蓝牙低功耗BLE连接之前,将GATT信息发送给终端设备,蓝牙设备可以提前获取到自身的GATT信息。可选的,第一信息可以只包括GATT信息(相当于第一信息就是GATT信息),也可以包括除GATT信息之外的其他信息。其中,其他信息可以是蓝牙设备与终端设备完成蓝牙低功耗BLE连接之后终端设备需要获取的信息。比如,终端设备还需要获取蓝牙设备的A信息,那么,第一信息可以包含GATT信息以及A信息。
步骤502,在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。
可选的,本公开在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,通过蓝牙设备主动将第一信息发送给终端设备。可选的,蓝牙设备可以将第一信息携带在需要与终端设备交互的信息(比如广播信息)中发送给终端设备。需要说明的是,当蓝牙设备是蓝牙耳机时,蓝牙耳机中无论是主耳机还是从耳机都可以看做是单独的一个蓝牙设备。比如,在上述图1中,本步骤中所描述的完成蓝牙BLE连接之前,相当于在上述图1中的步骤102之前,或者,步骤107之前。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT 信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
相应的,请参考图6,其示出了本公开一示例性实施例提供的一种信息获取方法的方法流程图,该信息获取方法可以用于终端设备中。如图6所示,该信息获取方法可以包括如下步骤:
步骤601,在终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收蓝牙设备发送的第一信息,第一信息包括蓝牙设备的通用属性GATT信息。
可选的,第一信息可以是蓝牙设备携带在需要与终端设备交互的信息(比如广播信息)中,终端设备通过接收到该信息之后,从该信息中通过解析得到的。可选的,第一信息可以只包括GATT信息(相当于第一信息就是GATT信息),也可以包括除GATT信息之外的其他信息。其中,其他信息可以是蓝牙设备与终端设备完成蓝牙低功耗BLE连接之后终端设备需要获取的信息。比如,终端设备还需要获取蓝牙设备的A信息,那么,第一信息可以包含GATT信息以及A信息。
步骤602,根据第一信息,获取GATT信息。
可选的,终端设备可以根据得到的第一信息,获取到第一信息中的GATT信息。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
下面,以终端设备与蓝牙设备之间建立蓝牙连接的交互,对上述图5和图6所示的方案进行介绍。
请参考图7,其示出了本公开一示例性实施例提供的一种信息获取方法的方法流程图,该信息获取方法可以用于蓝牙设备以及终端设备中。如图7所示,该信息获取方法可以包括如下步骤:
步骤701,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息。
可选的,蓝牙设备可以获取到需要发送给终端设备的GATT信息,将GATT信息作为第一信息。或者,蓝牙设备也可以获取到GATT信息以及其他需要发送给终端设备的信息,将GATT信息以及其他需要发送给终端设备的信息进行打包得到包含GATT信息的第一信息。
可选的,GATT信息中包括一个或多个信息单元对应的管理handle标识。例如,对于上述图3的GATT信息结构来说,蓝牙设备获取到的GATT信息中各个信息单元对应的管理handle标识都需要终端设备进行ATT查询,因此,在本步骤中获取的GATT信息中可以包含各个信息单元对应的管理handle标识,从而发送给终端设备。
步骤702,在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,将第一信息添加在用于BLE连接的BLE广播信息中,并发送BLE广播信息。
可选的,在蓝牙设备向外部发送BLE广播信息前,蓝牙设备将上述第一信息添加在BLE广播中,从而发送出去,使得终端设备可以接收到BLE广播信息,并从中获取到蓝牙设备的GATT信息。
在一些实施例中,用于BLE连接的BLE广播信息还可以包括与LE Audio蓝牙技术有关的信息,从而该BLE广播信息还可用于触发建立LE Audio蓝牙连接。例如,该BLE广播信息还可用于触发终端设备进行弹窗,以供用户选择建立蓝牙连接。
在一种可能实现的方式中,蓝牙设备可以在BLE广播信息的空闲字段中添加上述第一信息。比如,蓝牙设备的BLE广播信息中包含32个字节,而BLE广播信息中原本需要携带的信息占据10个字节,那么,蓝牙设备可以将第一信息追加在后续空闲的22个字节内,从而通过BLE广播信息将第一信息发送出去,使得终端设备获取到。
步骤703,终端设备接收蓝牙设备发送的BLE广播信息。
可选的,终端设备进行蓝牙扫描,接收到空间中由该蓝牙设备发送的BLE广播信息。
步骤704,终端设备根据BLE广播信息获取第一信息,并根据第一信息,获取GATT信息。
可选的,终端设备通过解析BLE广播信息,获取到其中携带的第一信息,并根据第一信息获取蓝牙设备的GATT信息。
步骤705,终端设备与蓝牙设备建立BLE连接。
可选的,终端设备接收到BLE广播信息之后,可以与蓝牙设备建立蓝牙BLE连接,类似于上述图1,此处不再赘述。
需要说明的是,步骤701至步骤705可以看做是上述图1实施例中步骤101至步骤102的过程中,通过将GATT信息携带在第一BLE广播信息中,使得在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,蓝牙设备提前将包含GATT信息的第一信息主动发送给终端设备,不需要终端设备在后续通过ATT查询方式获取。
可以理解的,在一些实施例中,在获取GATT信息后,不向蓝牙设备发送用于获取GATT信息的查询请求。也就是说不用经过ATT查询获取GATT信息就可以完成LE Audio蓝牙连接,从而基于LE Audio蓝牙技术进行音频等数据的传输通信,提升了LE Audio蓝牙连接的速度。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
在一种可能实现的方式中,终端设备在与蓝牙设备建立BLE连接之前,还可以与蓝牙设备建立经典蓝牙连接(即BT连接)。上述图5至图7中蓝牙设备获取到的第一信息,也可以在蓝牙设备与终端设备建立BT连接的过程中传输。即,终端设备与蓝牙设备可以同时连上经典蓝牙连接和BLE连接,在已有的规范中定义了一套交叉传输密钥派生(Cross-transport key derivation,CTKD)的方案。
其中,蓝牙设备与终端设备之间的BLE连接配对完成产生的密钥(LTK)以及蓝牙设备与终端设备之间的BT连接配对完成产生的密钥(linkkey)可以进行相互转化,这样用户可以在点击一次连接便完成BT连接和BLE连接两种方式的同时连接,在LE Audio的应用非常重要。通常的,终端设备与蓝牙设备会先建立BT连接,后通过CTKD自动触发终端设备与蓝牙设备之间的BLE连接,这就需要蓝牙设备支持BT的安全连接(secure connection),同时终端设备也需要支持BT的安全连接(secure connection)。
请参考图8,其示出了本公开一示例性实施例提供的一种信息获取方法的方法流程图,该信息获取方法用于蓝牙设备以及终端设备中。如图8所示,该信息获取方法可以包括如下步骤:
步骤801,蓝牙设备获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息。
可选的,蓝牙设备获取第一信息的方式可以参照上述图7实施例中的描述,此处不再赘述。
步骤802,将所述第一信息添加在用于建立所述蓝牙BT连接的BT广播信息中。
其中,在终端设备与蓝牙设备建立经典蓝牙连接的过程中,当蓝牙设备进入可配对模式(比如打开蓝牙)时,蓝牙设备会向周围发射一种扩展查询响应(Extended Inquiry Response,EIR)数据包,即,BT广播信息可以包括EIR数据包,该EIR数据包中可以携带蓝牙设备的基本设备信息(比如,设备类型、设备地址信息、设备名称、设备所支持的功能等),且EIR数据包中可以开放用户可修改且自定义的字段,将第一信息添加在该字段内。
比如,蓝牙设备可以在EIR数据包中增加一个字段,放置上述获取到的第一信息。当上述第一信息只包含GATT信息时,相当于在EIR数据包中增加的字段放置完整的GATT信息。本公开在蓝牙设备与终端设备完成BLE连接之前,在蓝牙设备与终端设备建立BT连接的过程中,当蓝牙设备发送BT广播信息时,将获取到的第一信息携带在BT广播中,提前发送给终端设备。
步骤803,蓝牙设备发送用于建立蓝牙BT连接的BT广播信息。
步骤804,终端设备接收BT广播信息,根据所述BT广播信息,获取所述第一信息。
可选的,终端设备可以接收到蓝牙设备发送的BT广播信息,通过解析获取到的BT广播信息,得到其中携带的第一信息,根据第一信息,获取到蓝牙设备的GATT信息。比如,上述BT广播信息包含EIR数据包,终端设备接收到蓝牙设备发送的EIR数据饱之后,对EIR数据包进行解析并存储,获取到EIR数据包中添加的第一信息,获取到第一信息中包含的GATT信息。
步骤805,终端设备与蓝牙设备建立BT连接。
可选的,终端设备接收到BT广播信息之后,可以与蓝牙设备建立经典蓝牙连接。
在一些实施例中,可以先触发建立经典蓝牙连接(BT连接)再建立BLE连接进而建立LE Audio蓝牙连接。从而可以尽早的获取到GATT信息,建立最终的LE Audio蓝牙连接。
需要说明的是,上述是建立经典蓝牙的过程中应用本方案提供的信息获取方法时,蓝牙设备和终端设备可以在建立经典蓝牙的过程中将第一信息传输,使得终端设备在后续BLE连接建立之后,不需要再次单独进行ATT查询。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与 终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
在一种可能实现的方式中,上述第一信息也可以添加到终端设备与蓝牙设备进行SDP查询的过程中,即,终端设备在上述图8中与蓝牙设备建立经典蓝牙连接之后,后通过CTKD自动触发终端设备与蓝牙设备之间的BLE连接,这就需要终端设备发现蓝牙设备是否支持BT的安全连接(secure connection),若支持,终端设备可以向蓝牙设备发送服务发现协议(Service Discovery Protocol,SDP)查询,使得蓝牙设备返回SDP查询结果。
请参考图9,其示出了本公开一示例性实施例涉及的一种信息获取方法的方法流程图。该信息获取方法可以用于蓝牙设备以及终端设备中。如图9所示,该信息获取方法可以包括如下步骤:
步骤901,蓝牙设备发送BT广播信息。
步骤902,终端设备与蓝牙设备建立BT连接。
步骤903,终端设备发现耳机支持BT的安全连接。
可选的,终端设备与蓝牙设备建立BT连接的方式可以参照上述图8所示的方式,此处不再赘述。需要说明的是,在本实施例中,建立BT连接的过程中,可以不需要将第一信息添加至BT广播信息中,在蓝牙设备后续向终端设备发送SDP查询结果时将第一信息添加至SDP查询结果中,也实现终端设备与蓝牙设备建立BLE连接之前终端设备获取到蓝牙设备的GATT信息的效果。
步骤904,终端设备向蓝牙设备发送SDP查询指令。
可选的,终端设备与蓝牙设备在建立BT连接之后,通过发送SDP查询指令的方式,获取蓝牙设备的SDP查询结果。
步骤905,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息。
可选的,蓝牙设备获取第一信息的方式可以参照上述图8实施例中的描述,此处不再赘述。需要说明的是,本步骤905的执行过程可以在蓝牙设备开启之后执行,本实施例并不限定。即,蓝牙设备可以在上述经典蓝牙BT连接的建立过程中获取,也可以是在经典蓝牙BT连接的建立之后获取。
步骤906,蓝牙设备响应于SDP查询指令,将第一信息添加在SDP查询结果。
可选的,在经典蓝牙的SDP查询流程中,蓝牙设备向终端设备反馈SDP查询结果中,SDP查询结果也提供了用户可修改且自定义的字段,蓝牙设备在接收到SDP查询指令之后,生成SDP查询结果的过程中,将第一信息添加到SDP查询结果中剩余的空闲字段中,从而发送给终端设备。
步骤907,蓝牙设备向终端设备返回SDP查询结果。
其中,SDP查询结果中包含增加的第一信息,即包含蓝牙设备的GATT信息。
步骤908,终端设备接收SDP查询结果,从SDP查询结果中获取第一信息,根据第一信息获取GATT信息。
终端设备通过接收蓝牙设备发送的SDP查询结果,从中解析出第一信息,根据第一信息获取到蓝牙设备的GATT信息。
步骤909,终端设备根据linkkey解析出LIK并进行BLE连接流程。
步骤910,蓝牙设备发送BLE广播信息。
步骤911,终端设备接收蓝牙设备发送的BLE广播信息,查询终端设备维护的白名单中是否包含该蓝牙设备,以及终端设备是否可以处理该BLE广播信息。
其中,白名单中包含终端设备维护的各个蓝牙设备名称,终端设备通过BLE广播信息,获取到蓝牙设备的设备名称后,确定自身维护的白名单中是否包含该蓝牙设备,以及确定是否可以处理BLE广播信息,在终端设备维护的白名单中包含该蓝牙设备,以及终端设备可以处理该BLE广播信息时,执行步骤912,否则结束。
步骤912,终端设备基于CSIS协议与蓝牙设备建立BLE连接。
可选的,上述步骤909至步骤912中终端设备与蓝牙设备建立BLE连接的过程可以参照上述各个实施例中BLE连接的建立过程,此处不再赘述。
在一种可能实现的方式中,终端设备在获取到GATT信息之后,可以向蓝牙设备发送确认信息,相应的,蓝牙设备也可以获取到终端设备发送的确认信息。比如,在本公开中,蓝牙设备还包括获取终端设备发送的确认信息,确认信息用于指示终端设备获取到GATT信息;根据确认信息,确定在蓝牙设备 与终端设备建立BLE连接的过程中停止将第一信息中的GATT信息发送给终端设备。
也就是说,蓝牙设备将上述获取到的第一信息发送出去之后,接收终端设备返回的确认信息,从而得知终端设备在此次与自身建立BLE连接之前,已经获取到GATT信息,在后续建立BLE连接的过程中,不需要再将GATT信息发送给终端设备,可以终止将第一信息携带在其他信息中。比如,终端设备将第一信息添加到BT广播信息中,并在上述步骤902之前接收到确认信息,那么,蓝牙设备在后续的SDP查询流程以及BLE广播信息发送的过程中,可以不需要再将自身的GATT信息添加到SDP查询指令或者BLE广播信息中,减少数据传输量,提高连接效率。或者,终端设备将第一信息添加到SDP查询结果中,并在上述步骤909之前接收到确认信息,那么,蓝牙设备在后续的BLE广播信息发送的过程中,可以不需要再将自身的GATT信息添加到BLE广播信息中,减少数据传输量,提高连接效率。
可选的,终端设备在发送确认信息时,可以直接将确认信息发送给蓝牙设备,比如,终端设备直接向蓝牙设备发送确认信息。或者,终端设备也可以通过携带的方式将确认信息携带在需要向蓝牙设备发送的信息中发送,比如,确认信息携带于终端设备向蓝牙设备发送的第二信息中,第二信息是终端设备向蓝牙设备发送的查询信息。
例如,蓝牙设备接收终端设备发送的查询信息,查询信息中包括确认信息;根据查询信息,获取确认信息。比如,蓝牙设备是在BT广播过程中添加了第一信息,终端设备获取到GATT信息之后,可以在上述SDP查询流程中,在步骤904发送SDP查询指令时,将确认信息添加到SDP查询指令中,相应的,蓝牙设备接收到SDP查询指令后,通过解析得到其中携带的确认信息。
需要说明的是,上述终端设备反馈确认信息的方式可以灵活变动,在获取到GATT信息之后,终端设备在后续不需要再与蓝牙设备进行信息的交互,终端设备可以直接将确认信息发送给蓝牙设备,终端设备在后续需要再与蓝牙设备进行信息的交互(比如需要进行SDP查询流程),终端设备可以将确认信息携带在需要发送的信息中发送给蓝牙设备,且该确认信息的反馈方式也可以应用于上述图5至图8的各个实施例中。
另外,上述图5至图9中的各个实施例中,蓝牙设备在获取到第一信息后,在BT广播信息中、在BLE广播信息中以及在SDP查询指令中携带第一信息可以选择任意一种或者多种,也可以根据开发者的需求灵活变化,只需要在建立BLE连接完成之前,实现蓝牙设备将自身的GATT信息发送给终端设备即可,本实施例对此并不限定。
可以理解的,在一些实施例中,在获取GATT信息后,终端设备不再向蓝牙设备发送用于获取GATT信息的查询请求。也就是说不用经过ATT查询获取GATT信息就可以完成LE Audio蓝牙连接,从而基于LE Audio蓝牙技术进行音频等数据的传输通信,提升了LE Audio蓝牙连接的速度。
在上述各个实施例中,蓝牙设备是以蓝牙耳机为例(TWS耳机)的,实际应用中,蓝牙设备可以是其他产品形态(比如,智能手环、智能手表、TWS音箱等),也可以包含多个蓝牙设备以及多个蓝牙设备之间的组合,此处对具体的蓝牙设备也并不限定。
需要说明的是,上述图5至图9所示的蓝牙连接建立的实施例中,在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之后,蓝牙设备与终端设备还基于LE Audio协议,与终端设备完成LE Audio蓝牙连接。由于蓝牙设备在BLE广播内容中,和/或,在经典EIR包中,和/或,在SDP查询结果中携带的方式将自身的GATT信息以及其对应的handle标识发送给了终端设备,后续终端设备可以省去图1中在建立BLE连接之后去一一查询GATT信息的流程(service discovery流程),从而节省了连接时间,提高了蓝牙设备与终端设备建立LE Audio蓝牙连接的效率。以手机和耳机为例,手机和耳机绕过标准的GATT service discovery流程,通过BLE广播内容或经典EIR包或SDP的方式将耳机的GATT结构以及其对应的handle标识同步给手机,后续手机可以省去service discovery流程,从而节省了连接时间,以此提升用户体验。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,蓝牙设备已经主动将GATT信息发送给了终端设备,不需要终端设备单独查询GATT信息,相对于上述图1的方案中跳过了查询GATT信息的过程,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了蓝牙设备与终端设备建立蓝牙连接的效率。
另外,本方案中还通过终端设备与蓝牙设备之间反馈确认信息,及时取消后续对GATT信息的多余传递,也提高了BLE连接建立的效率。
下述为本公开装置实施例,可以用于执行本公开方法实施例。对于本公开装置实施例中未披露的细节,请参照本公开方法实施例。
请参考图10,其示出了本公开一示例性实施例提供的信息获取装置的结构框图。该信息获取装置1000可以用于蓝牙设备中,以执行图5、图7、图8或图9所示实施例提供的方法中由蓝牙设备执行的全部或者部分步骤。该信息获取装置1000包括:
第一获取模块1001,用于获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
信息发送模块1002,用于在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向所述终端设备发送所述第一信息,以使得所述终端设备根据所述第一信息获取到所述GATT信息。。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
可选的,所述信息发送模块1002,包括:第一发送单元;
所述第一发送单元,用于将所述第一信息添加在用于所述BLE连接的BLE广播信息中,并向所述终端设备发送所述BLE广播信息。
可选的,所述装置还包括:
第一建立模块,用于在建立所述BLE连接之前,建立与所述终端设备的蓝牙BT连接;
所述信息发送模块1002,包括:第二发送单元;
所述第二发送单元,用于将所述第一信息添加在用于建立所述蓝牙BT连接的BT广播信息中,并向所述终端设备发送所述BT广播信息。
可选的,所述装置还包括:
第一接收模块,用于接收所述终端设备发送的服务发现协议SDP查询指令;
所述信息发送模块1002,包括:第三发送单元;
所述第三发送单元,用于响应于所述SDP查询指令,将所述第一信息添加在SDP查询结果中,向所述终端设备发送所述SDP查询结果。
可选的,所述GATT信息中包括一个或多个信息单元对应的管理handle标识。
可选的,所述装置还包括:
第一获取模块,用于在所述向所述终端设备发送所述第一信息之后,获取所述终端设备发送的确认信息,所述确认信息用于指示所述终端设备获取到所述GATT信息;
第一确定模块,用于根据所述确认信息,确定在所述蓝牙设备与所述终端设备建立BLE连接的过程中停止将所述第一信息中的GATT信息发送给所述终端设备。
可选的,所述第一获取模块,包括:第一接收单元和第一获取单元;
所述第一接收单元,用于接收所述终端设备发送的查询信息,所述查询信息中包括所述确认信息;
所述第一获取单元,用于根据所述查询信息,获取所述确认信息。
可选的,所述装置还包括:
第二建立模块,用于在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之后,基于LE Audio协议,与所述终端设备完成LE Audio蓝牙连接。
请参考图11,其示出了本公开一示例性实施例提供的信息获取装置的结构框图。该信息获取装置1100可以用于蓝牙设备中,以执行图6、图7、图8或图9所示实施例提供的方法中由终端设备执行的全部或者部分步骤。该信息获取装置1100包括:
信息接收模块1101,用于在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收所述蓝牙设备发送的第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
第二获取模块1102,用于根据所述第一信息,获取所述GATT信息。
综上所述,蓝牙设备获取第一信息,第一信息包括蓝牙设备的通用属性GATT信息;在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向终端设备发送第一信息,以使得终端设备根据第一信息获取到GATT信息。本公开通过在蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,提前将包含GATT信息的第一信息主动发送给终端设备,使得终端设备提前根据第一信息获取到蓝牙设备的GATT信息,当BLE连接完成后,不需要单独查询GATT信息,减少了终端设备获取GATT信息所用的时间,提高了终端设备获取GATT信息的效率,提高了终端设备与蓝牙设备之间建立蓝牙连接的效率。
可选的,所述信息接收模块1101,用于接收所述蓝牙设备发送的用于所述BLE连接的BLE广播信息,所述BLE广播信息中包括所述第一信息;根据所述BLE广播信息,获取所述第一信息。
可选的,所述装置还包括:
第三建立模块,用于在建立所述BLE连接之前,建立与所述蓝牙设备的蓝牙BT连接;
所述信息接收模块1101,还用于接收所述蓝牙设备发送的用于建立所述蓝牙BT连接的BT广播信息,所述BT广播信息中包括所述第一信息;根据所述BT广播信息,获取所述第一信息。
可选的,所述装置还包括:
指令发送模块,用于向所述蓝牙设备发送的服务发现协议SDP查询指令;
所述信息接收模块1101,还用于接收所述蓝牙设备发送的SDP查询结果,所述SDP查询结果中包括所述第一信息;根据所述SDP查询结果,获取所述第一信息。
可选的,所述GATT信息中包括一个或多个信息单元对应的管理handle标识。
可选的,所述装置还包括:
第二发送模块,用于在所述根据所述第一信息,获取所述GATT信息之后,向所述蓝牙设备发送确认信息,所述确认信息用于指示所述终端设备获取到所述GATT信息。
可选的,所述确认信息携带于所述终端设备向所述蓝牙设备发送的第二信息中,所述第二信息是所述终端设备向所述蓝牙设备发送的查询信息。
可选的,第二发送模块,还用于在确认获取所述GATT信息后,不向所述蓝牙设备发送用于获取GATT信息的查询请求。
可选的,所述装置还包括:
第四建立模块,用于在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之后,基于LE Audio协议,与所述蓝牙设备完成LE Audio蓝牙连接。
图12是本公开一示例性实施例提供的一种蓝牙设备的结构示意图。该蓝牙设备1200包括:处理器1201和存储器1202,通信接口1203以及总线1204。其中,存储器1202用于存储指令,该处理器1201用于执行该存储器1202存储的指令。处理器1201、存储器1202和通信接口1203通过总线1204实现彼此之间的通信连接。
其中,处理器1201用于:获取装置1200的第一参数,该第一参数用于指示蓝牙设备1200当前的通信质量;在根据第一参数确定蓝牙设备1200的通信质量低于预设通信质量阈值时,控制蓝牙设备1200重新进行网络连接。
蓝牙设备1200可以用于执行上述各个方法实施例中由蓝牙设备执行的各个步骤和/或流程。
可选地,该存储器1202可以包括只读存储器和随机存取存储器,并向处理器1201提供指令和数据。存储器1202的一部分还可以包括非易失性随机存取存储器。例如,存储器1202还可以存储设备类型的信息。该处理器1201可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器1201可以执行上述方法实施例中由蓝牙设备执行的各个步骤和/或流程。
应理解,在本公开实施例中,该处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
本公开实施例还提供了一种蓝牙设备,所述蓝牙设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上各个实施例所述的信息获取方法中,由终端设备或者蓝牙设备执行的全部或部分步骤。
本公开实施例还提供了一种终端设备,所述终端设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如上各个实施例所述的信息获取方法中,由终端设备或者蓝牙设备执行的全部或部分步骤。
本公开实施例还提供了一种计算机可读介质,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如上各个实施例所述的信息获取方法中,由终端设备或者蓝牙设备执行的全部或部分步骤。
本公开实施例还提供了一种计算机程序产品,该计算机程序产品存储有至少一条指令,所述至少一条指令由所述处理器加载并执行以实现如上各个实施例所述的信息获取方法,由终端设备或者蓝牙设备执行的全部或部分步骤。
本公开实施例还提供了一种应用发布平台,所述应用发布平台用于发布计算机程序产品,其中,当所述计算机程序产品在计算机上运行时,使得所述计算机执行以实现如上各个实施例所述的信息获取方法,由终端设备或者蓝牙设备执行的全部或部分步骤。
需要说明的是:上述实施例提供的装置在执行终端设备的控制时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将设备的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。另外,上述实施例提供的装置与方法实施例属于同一构思,其具体实现过程详见方法实施例,这里不再赘述。
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。在冲突的情况下,上述实施例、实施方式及相关技术特征可以相互组合。
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本公开的可选实施例,并不用以限制本公开,凡在本公开的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (21)

  1. 一种信息获取方法,其特征在于,所述方法应用于蓝牙设备,所述方法包括:
    获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
    在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向所述终端设备发送所述第一信息,以使得所述终端设备根据所述第一信息获取到所述GATT信息。
  2. 根据权利要求1所述的方法,其特征在于,所述向所述终端设备发送所述第一信息,包括:
    将所述第一信息添加在用于所述BLE连接的BLE广播信息中,并发送所述BLE广播信息。
  3. 根据权利要求1所述的方法,其特征在于,在建立所述BLE连接之前,所述方法还包括:
    建立与所述终端设备的蓝牙BT连接;
    所述向所述终端设备发送所述第一信息,包括:
    将所述第一信息添加在用于建立所述蓝牙BT连接的BT广播信息中,并发送所述BT广播信息。
  4. 根据权利要求1所述的方法,其特征在于,在建立所述BLE连接之前,所述方法还包括:
    建立与所述终端设备的蓝牙BT连接;
    接收所述终端设备发送的服务发现协议SDP查询指令;
    所述向所述终端设备发送所述第一信息,包括:
    响应于所述SDP查询指令,将所述第一信息添加在SDP查询结果中,向所述终端设备发送所述SDP查询结果。
  5. 根据权利要求1-4中任一项所述的方法,其特征在于,所述GATT信息中包括一个或多个信息单元对应的管理handle标识。
  6. 根据权利要求1至4任一所述的方法,其特征在于,在所述向所述终端设备发送所述第一信息之后,还包括:
    获取所述终端设备发送的确认信息,所述确认信息用于指示所述终端设备获取到所述GATT信息;
    根据所述确认信息,确定在所述蓝牙设备与所述终端设备建立BLE连接的过程中停止将所述第一信息中的GATT信息发送给所述终端设备。
  7. 根据权利要求6所述的方法,其特征在于,所述获取所述终端设备发送的确认信息,包括:
    接收所述终端设备发送的查询信息,所述查询信息中包括所述确认信息;
    根据所述查询信息,获取所述确认信息。
  8. 根据权利要求1至4任一所述的方法,其特征在于,在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之后,所述方法还包括:
    基于LE Audio协议,与所述终端设备完成LE Audio蓝牙连接。
  9. 一种信息获取方法,其特征在于,所述方法应用于终端设备,所述方法包括:
    在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收所述蓝牙设备发送的第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
    根据所述第一信息,获取所述GATT信息。
  10. 根据权利要求9所述的方法,其特征在于,所述接收所述蓝牙设备发送的第一信息包括:
    接收所述蓝牙设备发送的用于所述BLE连接的BLE广播信息,所述BLE广播信息中包括所述第一信息;
    根据所述BLE广播信息,获取所述第一信息。
  11. 根据权利要求9所述的方法,其特征在于,在建立所述BLE连接之前,所述方法还包括:
    建立与所述蓝牙设备的蓝牙BT连接;
    所述接收所述蓝牙设备发送的第一信息,包括:
    接收所述蓝牙设备发送的用于建立所述蓝牙BT连接的BT广播信息,所述BT广播信息中包括所述第一信息;
    根据所述BT广播信息,获取所述第一信息。
  12. 根据权利要求9所述的方法,其特征在于,在建立所述BLE连接之前,所述方法还包括:
    建立与所述蓝牙设备的蓝牙BT连接;
    向所述蓝牙设备发送服务发现协议SDP查询指令;
    所述接收所述蓝牙设备发送的第一信息,包括:
    接收所述蓝牙设备发送的SDP查询结果,所述SDP查询结果中包括所述第一信息;
    根据所述SDP查询结果,获取所述第一信息。
  13. 根据权利要求9至12任一所述的方法,其特征在于,所述GATT信息中包括一个或多个信息 单元对应的管理handle标识。
  14. 根据权利要求9至12任一所述的方法,其特征在于,在所述根据所述第一信息,获取所述GATT信息之后,还包括:
    向所述蓝牙设备发送确认信息,所述确认信息用于指示所述终端设备获取到所述GATT信息。
  15. 根据权利要求1所述的方法,其特征在于,所述方法还包括,在获取所述GATT信息后,不向所述蓝牙设备发送用于获取GATT信息的查询请求。
  16. 根据权利要求9至12任一所述的方法,其特征在于,在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之后,所述方法还包括:
    基于LE Audio协议,与所述蓝牙设备完成LE Audio蓝牙连接。
  17. 一种信息获取装置,其特征在于,所述装置应用于蓝牙设备,所述装置包括:
    第一获取模块,用于获取第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
    信息发送模块,用于在所述蓝牙设备与终端设备完成蓝牙低功耗BLE连接之前,向所述终端设备发送所述第一信息,以使得所述终端设备根据所述第一信息获取到所述GATT信息。
  18. 一种信息获取装置,其特征在于,所述装置应用于终端设备,所述装置包括:
    信息接收模块,用于在所述终端设备与蓝牙设备完成蓝牙低功耗BLE连接之前,接收所述蓝牙设备发送的第一信息,所述第一信息包括所述蓝牙设备的通用属性GATT信息;
    第二获取模块,用于根据所述第一信息,获取所述GATT信息。
  19. 一种蓝牙设备,其特征在于,所述蓝牙设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求1至8任一所述的信息获取方法。
  20. 一种终端设备,其特征在于,所述终端设备包含处理器和存储器,所述存储器中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由所述处理器加载并执行以实现如权利要求9至16任一所述的信息获取方法。
  21. 一种计算机可读存储介质,其特征在于,所述存储介质中存储有至少一条指令、至少一段程序、代码集或指令集,所述至少一条指令、所述至少一段程序、所述代码集或指令集由处理器加载并执行以实现如权利要求1至16任一所述的信息获取方法。
PCT/CN2023/119904 2022-10-21 2023-09-20 信息获取方法、装置、蓝牙设备、终端设备及存储介质 WO2024082906A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211295568.1 2022-10-21
CN202211295568.1A CN115696637A (zh) 2022-10-21 2022-10-21 信息获取方法、装置、蓝牙设备、终端设备及存储介质

Publications (1)

Publication Number Publication Date
WO2024082906A1 true WO2024082906A1 (zh) 2024-04-25

Family

ID=85066740

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/119904 WO2024082906A1 (zh) 2022-10-21 2023-09-20 信息获取方法、装置、蓝牙设备、终端设备及存储介质

Country Status (2)

Country Link
CN (1) CN115696637A (zh)
WO (1) WO2024082906A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115696637A (zh) * 2022-10-21 2023-02-03 Oppo广东移动通信有限公司 信息获取方法、装置、蓝牙设备、终端设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866998A (zh) * 2020-07-24 2020-10-30 深圳创维数字技术有限公司 蓝牙配网方法、设备及存储介质
CN112399358A (zh) * 2020-11-05 2021-02-23 北京小米移动软件有限公司 电话通知方法、装置、系统、设备及介质
CN114980057A (zh) * 2022-06-21 2022-08-30 润芯微科技(江苏)有限公司 一种系统设备快速连接低功耗蓝牙设备的方法
CN115696637A (zh) * 2022-10-21 2023-02-03 Oppo广东移动通信有限公司 信息获取方法、装置、蓝牙设备、终端设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111866998A (zh) * 2020-07-24 2020-10-30 深圳创维数字技术有限公司 蓝牙配网方法、设备及存储介质
WO2022016669A1 (zh) * 2020-07-24 2022-01-27 深圳创维数字技术有限公司 蓝牙配网方法、设备及存储介质
CN112399358A (zh) * 2020-11-05 2021-02-23 北京小米移动软件有限公司 电话通知方法、装置、系统、设备及介质
CN114980057A (zh) * 2022-06-21 2022-08-30 润芯微科技(江苏)有限公司 一种系统设备快速连接低功耗蓝牙设备的方法
CN115696637A (zh) * 2022-10-21 2023-02-03 Oppo广东移动通信有限公司 信息获取方法、装置、蓝牙设备、终端设备及存储介质

Also Published As

Publication number Publication date
CN115696637A (zh) 2023-02-03

Similar Documents

Publication Publication Date Title
CN110622123B (zh) 一种显示方法及装置
CN111083684B (zh) 控制电子设备的方法及电子设备
EP3893109B1 (en) Method and device for connecting bluetooth devices
WO2018000134A1 (zh) 一种蓝牙连接的方法及终端
KR101901720B1 (ko) 더미 장치와의 연동 방법 및 그 전자 장치
CN103391473B (zh) 一种提供及获取音视频的方法和装置
WO2021114952A1 (zh) 数据处理方法、终端设备、蓝牙设备及存储介质
CN106385621A (zh) 智能设备控制方法和装置
CN111818669A (zh) 移动终端及其数据传输方法
KR102441850B1 (ko) 서비스 처리 방법 및 이동 통신 단말
JP5849857B2 (ja) 近距離無線通信装置
WO2017096909A1 (zh) 建立数据连接的方法及装置
WO2024082906A1 (zh) 信息获取方法、装置、蓝牙设备、终端设备及存储介质
WO2018040813A1 (zh) 音视频通信方法、终端、服务器及存储介质
WO2017215661A1 (zh) 一种场景音效的控制方法、及电子设备
CN111083755A (zh) 一种设备切换方法及相关设备
WO2020063240A1 (zh) 信道接入方法、配置方法、终端及网络侧设备
WO2015062234A1 (zh) 移动终端资源处理方法、装置和设备
WO2019242633A1 (zh) 测量间隔的处理方法、终端及网络节点
WO2018119630A1 (zh) 一种交互方法和终端
WO2019165983A1 (zh) 一种蓝牙传输控制方法、控制系统及存储介质
WO2024066694A1 (zh) 音频设备的连接方法、装置、存储介质及设备
WO2015062400A1 (zh) 视频通道分配管理方法和相关设备及通信系统
WO2020038157A1 (zh) 基于nan智能管理方法及相关产品
US20100167652A1 (en) Communication device and communication method thereof