Patent Description:
With development of wireless communication technologies, people are accustomed to connecting different intelligent terminal devices in a wireless manner. As a relatively mature short-range wireless communication technology currently, a Bluetooth (Bluetooth) technology is widely applied in intelligent terminal devices. For example, a terminal such as a smartphone is connected to a Bluetooth device such as a Bluetooth headset or a Bluetooth speaker through Bluetooth.

Currently, after a terminal such as a smartphone enables a Bluetooth function, the terminal may enter an inquiry (inquiry) state, and send an inquiry request (inquiry request) to a surrounding device. After entering an inquiry scan (inquiry scan) state, the Bluetooth device may scan the inquiry request. After the inquiry request sent by the terminal is detected, the Bluetooth device may return an inquiry response (inquiry response) to the terminal. The inquiry response includes a Bluetooth address of the Bluetooth device. Then, before the terminal is paired with the Bluetooth device, the terminal needs to send a remote name request to the Bluetooth device, to request to obtain a device name of the Bluetooth device. After receiving the remote name request (remote name request), the Bluetooth device may return a remote name response to the terminal, where the remote name response includes the device name of the Bluetooth device. This takes a lot of time to complete the pairing.

<CIT> discloses that in an inquiry scan procedure, the wireless device may scan for and receive inquiry packets from the other wireless devices (and transmit responsive inquiry response and/or EIR packets). An inquiry response packet may include information such as the Media Access Control (MAC) address of the device that transmitted the packet (the "BD_ADDR" of the wireless device), and/or other information. Additionally, an EIR packet may include information such as a Device Name for the device that transmitted the EIR packet.

This application provides a Bluetooth pairing method and a related apparatus. After a Bluetooth device receives an inquiry request (inquiry request) of a terminal, and returns an inquiry response (inquiry response), the Bluetooth device may return an extended inquiry response (extended inquiry response, EIR) carrying a device name of the Bluetooth device to the terminal. In this way, the terminal can quickly display the device name of the Bluetooth device, thereby reducing a time consumed by the terminal in a process from discovering the Bluetooth device to pairing with the Bluetooth device.

According to a first aspect, this application provides a Bluetooth pairing method, including: When the terminal receives a first operation of a user, the terminal sends an inquiry request (inquiry request) to a Bluetooth device, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. When receiving the inquiry request, the Bluetooth device sends an inquiry response (inquiry response) to the terminal, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth device sends an extended inquiry response (extended inquiry response) to the terminal, where the extended inquiry response includes the device name of the Bluetooth device. After receiving the extended inquiry response, the terminal displays the device name of the Bluetooth device.

According to the Bluetooth pairing method provided in this application, after the Bluetooth device receives the inquiry request (inquiry request) of the terminal and returns the inquiry response (inquiry response), the Bluetooth device may return the extended inquiry response (extended inquiry response, EIR) carrying the device name of the Bluetooth device to the terminal. In this way, the terminal can quickly display the device name of the Bluetooth device, thereby reducing a time consumed by the terminal in a process from discovering the Bluetooth device to pairing with the Bluetooth device.

In an implementation, the extended inquiry response further includes information about a feature (feature) supported by the Bluetooth device. The information about a feature supported by the Bluetooth device includes secure simple pairing, <NUM>-slot packet transmission, <NUM>-slot packet transmission, timing accuracy, synchronous connection oriented link, and the like. In this way, the Bluetooth device may further send the feature (feature) information of the Bluetooth device to the terminal in the extended inquiry response, so that the terminal and the Bluetooth device can complete pairing and connection as soon as possible.

In a possible implementation, the method further includes: The terminal receives a second operation of the user. The terminal sends a page request to the Bluetooth device in response to the second operation. After receiving the page request, the Bluetooth device sends a first secondary device response to the terminal. After receiving the first secondary device response, the terminal sends a master device response to the Bluetooth device. The Bluetooth device switches to a connected state according to the received master device response, and sends a second secondary device response to the terminal. The terminal switches to a connected state based on the received second secondary device response.

In a possible implementation, the method further includes: The terminal completes pairing with the Bluetooth device after the terminal enters the connected state.

In a possible implementation, the extended inquiry response includes a first extended inquiry response data structure (EIR data structure) and a second extended inquiry response data structure. The first extended inquiry response data structure includes the device name of the Bluetooth device, and the second extended inquiry response data structure includes the information about a feature supported by the Bluetooth device.

According to a second aspect, this application provides a Bluetooth system, including a terminal and a Bluetooth device. The terminal is configured to: send an inquiry request (inquiry request) to the Bluetooth device when receiving a first operation of a user, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. The Bluetooth device is configured to: send an inquiry response (inquiry response) to the terminal when receiving the inquiry request, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth device is further configured to send an extended inquiry response (extended inquiry response) to the terminal, where the extended inquiry response includes the device name of the Bluetooth device. The terminal is further configured to: display the device name of the Bluetooth device after receiving the extended inquiry response.

In a possible implementation, the extended inquiry response may further include information about a feature (feature) supported by the Bluetooth device. The information about a feature supported by the Bluetooth device includes secure simple pairing, <NUM>-slot packet transmission, <NUM>-slot packet transmission, timing accuracy, synchronous connection oriented link, and the like. In this way, the Bluetooth device may further send the feature (feature) information of the Bluetooth device to the terminal in the extended inquiry response, so that the terminal and the Bluetooth device can complete pairing and connection as soon as possible.

In a possible implementation, the terminal is further configured to receive a second operation of the user. The terminal is further configured to send a page request to the Bluetooth device in response to the second operation. The Bluetooth device is further configured to: send a first secondary device page response to the terminal after receiving the page request. The terminal is further configured to: send a master device page response to the Bluetooth device after receiving the first secondary device page response. The Bluetooth device is further configured to: switch to a connected state according to the received master device page response, and send a second secondary device response to the terminal. The terminal is further configured to switch to a connected state based on the received second secondary device response.

In a possible implementation, the terminal is further configured to complete pairing with the Bluetooth device after entering the connected state.

In a possible implementation, the extended inquiry response includes a first extended inquiry response data structure (EIR data structure) and a second EIR data structure. The first EIR data structure includes the device name of the Bluetooth device, and the second EIR data structure includes the information about a feature supported by the Bluetooth device.

According to a third aspect, this application provides a terminal, including a Bluetooth chip, a memory, a touchscreen, and a processor, where the memory is coupled to the processor. The touchscreen is configured to receive a first operation of a user. The processor is configured to: in response to the first operation received by the touchscreen, indicate the Bluetooth chip to send an inquiry request (inquiry request) to a Bluetooth device, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. The Bluetooth chip is configured to receive an inquiry response (inquiry response) sent by the Bluetooth device, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to receive an extended inquiry response (extended inquiry response) sent by the Bluetooth device. The extended inquiry response includes a device name of the Bluetooth device. The processor is further configured to: after the Bluetooth chip receives the extended inquiry response, indicate the touchscreen to display the device name of the Bluetooth device.

In a possible implementation, the touchscreen is further configured to receive a second operation of the user. The processor is further configured to indicate, in response to the second operation received by the touchscreen, the Bluetooth chip to send a page request to the Bluetooth device. The Bluetooth chip is further configured to receive a first secondary device page response sent by the Bluetooth device after the Bluetooth device receives the page request. The Bluetooth chip is further configured to: send a master device page response to the Bluetooth device after receiving the first secondary device page response, where the first secondary device page response is used for the Bluetooth device to switch to a connected state. The Bluetooth chip is further configured to receive a second secondary device response sent by the Bluetooth device after the Bluetooth device switches to the connected state. The Bluetooth chip is further configured to switch to a connected state based on the received second secondary device response.

In a possible implementation, the Bluetooth chip is further configured to complete pairing with the Bluetooth device after entering the connected state.

According to a fourth aspect, this application provides a Bluetooth device, including a processor, a memory, and a Bluetooth chip, where the memory is coupled to the processor. The Bluetooth chip is configured to receive an inquiry request (inquiry request) sent by a terminal, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to send an inquiry response (inquiry response) to the terminal, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to send an extended inquiry response (extended inquiry response) to the terminal, where the extended inquiry response includes a device name of the Bluetooth device.

In a possible implementation, the Bluetooth chip is further configured to receive a page request sent by the terminal. The Bluetooth chip is further configured to send a first secondary device page response to the terminal. The Bluetooth chip is further configured to receive a master device page response sent by the terminal after the terminal receives the first secondary device page response. The Bluetooth chip is further configured to switch to a connected state, and send a second secondary device page response to the terminal. The second secondary device page response is used for the terminal to switch to a connected state.

In a possible implementation, the Bluetooth chip is further configured to complete pairing with the terminal after switching to the connected state.

The extended inquiry response includes a first extended inquiry response data structure (EIR data structure) and a second EIR data structure, where the first EIR data structure includes the device name of the Bluetooth device, and the second EIR data structure includes the information about a feature supported by the Bluetooth device.

According to a fifth aspect, this application provides a chip system. The chip system is disposed on a terminal, and the chip system includes a processor and a Bluetooth chip. The processor is configured to: when a touchscreen of the terminal receives a first operation of a user, indicate the Bluetooth chip to send an inquiry request (inquiry request) to a Bluetooth device, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. The Bluetooth chip is configured to receive an inquiry response (inquiry response) sent by the Bluetooth device, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to receive an extended inquiry response (extended inquiry response) sent by the Bluetooth device, where the extended inquiry response includes a device name of the Bluetooth device. The processor is further configured to: after the Bluetooth chip receives the extended inquiry response, indicate the touchscreen of the terminal to display the device name of the Bluetooth device.

In a possible implementation, the processor is further configured to indicate, in response to a second operation received by the touchscreen, the Bluetooth chip to send a page request to the Bluetooth device. The Bluetooth chip is further configured to receive a first secondary device page response sent by the Bluetooth device after the Bluetooth device receives the page request. The Bluetooth chip is further configured to: send a master device page response to the Bluetooth device after receiving the first secondary device page response, where the first secondary device page response is used for the Bluetooth device to switch to a connected state. The Bluetooth chip is further configured to receive a second secondary device response sent by the Bluetooth device after the Bluetooth device switches to the connected state. The Bluetooth chip is further configured to switch to a connected state based on the received second secondary device response.

According to a sixth aspect, this application provides a Bluetooth chip, and the Bluetooth chip is disposed on a Bluetooth device. The Bluetooth chip is configured to receive an inquiry request (inquiry request) sent by a terminal, where the inquiry request is used to obtain a Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to send an inquiry response (inquiry response) to the terminal, where the inquiry response includes the Bluetooth address of the Bluetooth device. The Bluetooth chip is further configured to send an extended inquiry response (extended inquiry response) to the terminal, where the extended inquiry response includes a device name of the Bluetooth device.

In a possible implementation, the Bluetooth chip is further configured to receive a page request sent by the terminal. The Bluetooth chip is further configured to send a first secondary device page response to the terminal. The Bluetooth chip is further configured to receive a master device page response sent by the terminal after the terminal receives the first secondary device page response. The Bluetooth chip is further configured to: switch to a connected state, and send a second secondary device page response to the terminal. The second secondary device page response is used for the terminal to switch to a connected state.

The extended inquiry response includes a first extended inquiry response data structure (EIR data structure) and a second EIR data structure, where the first EIR data structure includes the device name of the Bluetooth device, and the second EIR data structure includes the information about a feature supported by the Bluetooth device. In the following, the invention is best understood in view of <FIG> and <FIG>. The remaining embodiments, aspects, or examples are included in order to help the reader better understand the invention.

The following clearly describes the technical solutions in embodiments of this application in detail with reference to the accompanying drawings. In descriptions of embodiments of this application, unless otherwise stated, "/" indicates "or". For example, A/B may indicate A or B. The term "and/or" in this specification only describes an association relationship for describing associated objects, and indicates that three relationships may exist. For example, A and/or B may indicate the following three cases: Only A exists, both A and B exist, and only B exists. In addition, in the descriptions of embodiments of this application, "a plurality of" means two or more.

The terms "first" and "second" mentioned below are only intended for description, and shall not be understood as an indication or implication of relative importance or implicit indication of a quantity of indicated technical features. Therefore, a feature limited by "first" or "second" may explicitly or implicitly include one or more features. In the descriptions of embodiments of this application, unless otherwise specified, "a plurality of" means two or more.

The following describes an architecture of a system provided in an embodiment of this application.

<FIG> is a schematic architectural diagram of a system <NUM> according to an embodiment of this application. As shown in <FIG>, the system <NUM> may include a terminal <NUM> and a Bluetooth device <NUM>.

The terminal <NUM> may communicate with the Bluetooth device <NUM> by using a Bluetooth technology, including classic Bluetooth and Bluetooth low energy (bluetooth low energy, BLE). The terminal <NUM> may be a terminal device such as a smartphone, a tablet computer, or a personal computer. The Bluetooth device <NUM> may be a device that supports a Bluetooth function, such as a Bluetooth headset, a Bluetooth speaker, or a smartwatch.

<FIG> is a schematic diagram of a structure of the terminal <NUM>.

The following uses the terminal <NUM> as an example to describe embodiments in detail. It should be understood that the terminal <NUM> shown in <FIG> is only an example, and the terminal <NUM> may have more or fewer components than those shown in <FIG>, may have two or more components combined, or may have different component configurations. Various components shown in the figure may be implemented in hardware that includes one or more signal processing and/or application-specific integrated circuits, software, or a combination of hardware and software.

The terminal <NUM> may include a processor <NUM>, an external memory interface <NUM>, an internal memory <NUM>, a universal serial bus (universal serial bus, USB) interface <NUM>, a charging management module <NUM>, a power management module <NUM>, a battery <NUM>, an antenna <NUM>, an antenna <NUM>, a mobile communication module <NUM>, a wireless communication module <NUM>, an audio module <NUM>, a speaker 170A, a receiver 170B, a microphone 170C, a headset jack 170D, a sensor module <NUM>, a button <NUM>, a motor <NUM>, an indicator <NUM>, a camera <NUM>, a display <NUM>, a subscriber identity module (subscriber identification module, SIM) card interface <NUM>, and the like. The sensor module <NUM> may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a range sensor 180F, an optical proximity sensor <NUM>, a fingerprint sensor <NUM>, a temperature sensor 180J, a touch sensor <NUM>, an ambient light sensor <NUM>, a bone conduction sensor <NUM>, and the like.

It may be understood that the structure shown in the embodiment of the present invention does not constitute any specific limitation on the terminal <NUM>. In some other embodiments of this application, the terminal <NUM> may include more or fewer components than those shown in the figure, or some components may be combined, or some components may be split, or different component arrangements may be used. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.

The processor <NUM> may include one or more processing units. For example, the processor <NUM> may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, a neural-network processing unit (neural-network processing unit, NPU), and/or the like. Different processing units may be independent devices, or may be integrated into one or more processors.

The controller may be a nerve center and a command center of the terminal <NUM>. The controller may generate an operation control signal based on instruction operation code and a time sequence signal, to complete control of instruction reading and instruction execution.

A memory may be further disposed in the processor <NUM>, and is configured to store instructions and data. In some embodiments, the memory in the processor <NUM> is a cache. The memory may store instructions or data just used or cyclically used by the processor <NUM>. If the processor <NUM> needs to use the instructions or the data again, the processor <NUM> may directly invoke the instructions or the data from the memory. This avoids repeated access and reduces a waiting time of the processor <NUM>, thereby improving system efficiency.

The interfaces may include an inter-integrated circuit (inter-integrated circuit, I2C) interface, an inter-integrated circuit sound (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (general-purpose input/output, GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, a universal serial bus (universal serial bus, USB) port, and/or the like.

The I2C interface is a two-way synchronous serial bus, including a serial data line (serial data line, SDA) and a serial clock line (serial clock line, SCL). In some embodiments, the processor <NUM> may include a plurality of groups of I2C buses. The processor <NUM> may be separately coupled to the touch sensor <NUM>, a charger, a flash, the camera <NUM>, and the like through different I2C bus interfaces. For example, the processor <NUM> may be coupled to the touch sensor <NUM> by using the I2C interface, so that the processor <NUM> communicates with the touch sensor <NUM> by using the I2C bus interface, to implement a touch function of the terminal <NUM>.

The I2S interface may be used for audio communication. In some embodiments, the processor <NUM> may include a plurality of groups of I2S buses. The processor <NUM> may be coupled to the audio module <NUM> through the I2S bus, to implement communication between the processor <NUM> and the audio module <NUM>. In some embodiments, the audio module <NUM> may transfer an audio signal to the wireless communication module <NUM> through the I2S interface, to implement a function of answering a call through a Bluetooth headset.

The PCM interface may also sample, quantize, and code an analog signal for audio communication. In some embodiments, the audio module <NUM> may be coupled to the wireless communication module <NUM> through a PCM bus interface. In some embodiments, the audio module <NUM> may alternatively transfer an audio signal to the wireless communication module <NUM> through the PCM interface, to implement a function of answering a call through a Bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.

The UART interface is a universal serial data bus used for asynchronous communication. The bus may be a two-way communication bus. The bus converts to-be-transmitted data between a serial communication format and a parallel communication format. In some embodiments, the UART interface is usually used to connect the processor <NUM> to the wireless communication module <NUM>. For example, the processor <NUM> communicates with a Bluetooth module in the wireless communication module <NUM> through the UART interface, to implement a Bluetooth function. In some embodiments, the audio module <NUM> may transfer an audio signal to the wireless communication module <NUM> through the UART interface, to implement a function of playing music through a Bluetooth headset.

The MIPI interface may be used to connect the processor <NUM> to a peripheral component such as the display <NUM> or the camera <NUM>. The MIPI interface includes a camera serial interface (camera serial interface, CSI), a display serial interface (display serial interface, DSI), and the like. In some embodiments, the processor <NUM> communicates with the camera <NUM> through the CSI interface, to implement a photographing function of the terminal <NUM>. The processor <NUM> communicates with the display <NUM> through the DSI interface, to implement a display function of the terminal <NUM>.

The GPIO interface may be configured by using software. The GPIO interface may be configured as a control signal or a data signal. In some embodiments, the GPIO interface may be used to connect the processor <NUM> to the camera <NUM>, the display <NUM>, the wireless communication module <NUM>, the audio module <NUM>, the sensor module <NUM>, or the like. The GPIO interface may alternatively be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, or the like.

The USB interface <NUM> is an interface that complies with a USB standard specification, and may be specifically a mini USB interface, a micro USB interface, a USB Type-C interface, or the like. The USB interface <NUM> may be configured to connect to a charger to charge the terminal <NUM>, and may also be configured to transmit data between the terminal <NUM> and a peripheral device, or may be configured to connect to a headset, to play audio through the headset. The interface may be further configured to connect to another terminal such as an AR device.

It may be understood that an interface connection relationship between the modules that is shown in this embodiment of the present invention is only an example for description, and does not constitute a limitation on the structure of the terminal <NUM>. In some other embodiments, the terminal <NUM> may alternatively use an interface connection manner different from that in the foregoing embodiment, or a combination of a plurality of interface connection manners.

The charging management module <NUM> is configured to receive a charging input from the charger. The charger may be a wireless charger or a wired charger. In some embodiments of wired charging, the charging management module <NUM> may receive a charging input from the wired charger through the USB interface <NUM>. In some embodiments of wireless charging, the charging management module <NUM> may receive a wireless charging input through a wireless charging coil of the terminal <NUM>. When charging the battery <NUM>, the charging management module <NUM> may further supply power to the terminal through the power management module <NUM>.

The power management module <NUM> is configured to connect the battery <NUM> and the charging management module <NUM> to the processor <NUM>. The power management module <NUM> receives an input of the battery <NUM> and/or the charging management module <NUM>, and supplies power to the processor <NUM>, the internal memory <NUM>, an external memory, the display <NUM>, the camera <NUM>, the wireless communication module <NUM>, and the like. The power management module <NUM> may be further configured to monitor parameters such as a battery capacity, a battery cycle count, and a battery health status (electric leakage or impedance). In some other embodiments, the power management module <NUM> may alternatively be disposed in the processor <NUM>. In some other embodiments, the power management module <NUM> and the charging management module <NUM> may alternatively be disposed in a same device.

A wireless communication function of the terminal <NUM> may be implemented by using the antenna <NUM>, the antenna <NUM>, the mobile communication module <NUM>, the wireless communication module <NUM>, the modem processor, the baseband processor, and the like.

The antenna <NUM> and the antenna <NUM> are configured to transmit and receive electromagnetic wave signals. Each antenna in the terminal <NUM> may be configured to cover one or more communication frequency bands. Different antennas may further be multiplexed to improve antenna utilization. For example, the antenna <NUM> may be multiplexed as a diversity antenna in a wireless local area network. In some other embodiments, an antenna may be used in combination with a tuning switch.

The mobile communication module <NUM> may provide a solution for wireless communication including <NUM>, <NUM>, <NUM>, <NUM>, and the like, applied to the terminal <NUM>. The mobile communication module <NUM> may include at least one filter, a switch, a power amplifier, a low noise amplifier (low noise amplifier, LNA), and the like. The mobile communication module <NUM> may receive an electromagnetic wave through the antenna <NUM>, perform processing such as filtering and amplification on the received electromagnetic wave, and transmit a processed electromagnetic wave to the modem processor for demodulation. The mobile communication module <NUM> may further amplify a signal modulated by the modem processor, and convert an amplified signal into an electromagnetic wave for radiation through the antenna <NUM>. In some embodiments, at least some functional modules of the mobile communication module <NUM> may be disposed in the processor <NUM>. In some embodiments, at least some functional modules of the mobile communication module <NUM> and at least some modules of the processor <NUM> may be disposed in a same device.

The modem processor may include a modulator and a demodulator. The modulator is configured to modulate a to-be-sent low-frequency baseband signal into a medium-high-frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. Then, the demodulator transmits the low frequency baseband signal obtained through demodulation to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs a sound signal through an audio device (which is not limited to the speaker 170A, the receiver 170B, or the like), or displays an image or a video through the display <NUM>. In some embodiments, the modem processor may be an independent component. In some other embodiments, the modem processor may be independent of the processor <NUM>, and is disposed in a same device as the mobile communication module <NUM> or another functional module.

The wireless communication module <NUM> may provide wireless communication solutions applicable to the terminal device <NUM>, such as a wireless local area network (wireless local area network, WLAN) (for example, a wireless fidelity (wireless fidelity, Wi-Fi) network), Bluetooth (Bluetooth, BT), a global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), a near field communication (near field communication, NFC) technology, an infrared (infrared, IR) technology, or the like. The wireless communication module <NUM> may be one or more components integrating at least one communication processor module. The wireless communication module <NUM> receives an electromagnetic wave through the antenna <NUM>, performs frequency modulation and filtering processing on an electromagnetic wave signal, and sends a processed signal to the processor <NUM>. The wireless communication module <NUM> may further receive a to-be-sent signal from the processor <NUM>, perform frequency modulation and amplification on the signal. Then, the signal is converted into an electromagnetic wave for radiation through the antenna <NUM>.

In some embodiments, in the terminal <NUM>, the antenna <NUM> is coupled to the mobile communication module <NUM>, and the antenna <NUM> is coupled to the wireless communication module <NUM>, so that the terminal <NUM> can communicate with a network and another device by using a wireless communication technology. The wireless communication technology may include a global system for mobile communications (global system for mobile communications, GSM), a general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, a GNSS, a WLAN, NFC, FM, an IR technology, and/or the like. The GNSS may include a global positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a BeiDou navigation satellite system (BeiDou navigation satellite system, BDS), a quasi-zenith satellite system (quasi-zenith satellite system, QZSS), and/or a satellite based augmentation system (satellite based augmentation system, SBAS).

The terminal <NUM> implements the display function through the GPU, the display <NUM>, the application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display <NUM> and the application processor. The GPU is configured to perform mathematical and geometric calculation, and is configured to render an image. The processor <NUM> may include one or more GPUs that execute program instructions to generate or change display information.

The display <NUM> is configured to display an image, a video, and the like. The display <NUM> includes a display panel. The display panel may be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED), an active-matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), a flexible light-emitting diode (flexible light-emitting diode, FLED), a mini-LED, a micro-LED, a micro-OLED, a quantum dot light emitting diode (quantum dot light emitting diode, QLED), or the like. In some embodiments, the terminal <NUM> may include one or N displays <NUM>, where N is a positive integer greater than <NUM>.

The terminal <NUM> can implement a photographing function by using the ISP, the camera <NUM>, the video codec, the GPU, the display <NUM>, the application processor, and the like.

The ISP is configured to process data fed back by the camera <NUM>. For example, during photographing, a shutter is pressed, light is transmitted to a photosensitive element of the camera through a lens, an optical signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, to convert the electrical signal into a visible image. The ISP may further perform algorithm optimization on noise, brightness, and complexion of the image. The ISP may further optimize parameters such as exposure and a color temperature of a photographing scenario. In some embodiments, the ISP may be disposed in the camera <NUM>.

The camera <NUM> is configured to capture a static image or a video. An optical image of an object is generated through the lens, and is projected to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts an optical signal into an electrical signal, and then transmits the electrical signal to the ISP for converting the electrical signal into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard format such as an RGB format or a YUV format. In some embodiments, the terminal <NUM> may include one or N cameras <NUM>, where N is a positive integer greater than <NUM>.

The digital signal processor is configured to process a digital signal, and may further process another digital signal in addition to a digital image signal. For example, when the terminal <NUM> selects a frequency, the digital signal processor is configured to perform Fourier transform, and the like on frequency energy.

The video codec is configured to compress or decompress a digital video. The terminal <NUM> may support one or more video codecs. In this way, the terminal <NUM> can play or record videos in a plurality of coding formats, for example, moving picture experts group (moving picture experts group, MPEG)-<NUM>, MPEG-<NUM>, MPEG-<NUM>, and MPEG-<NUM>.

The NPU is a neural-network (neural-network, NN) computing processor, and quickly processes input information by referring to a biological neural network structure such as a mode of transmission between human-brain nerve cells, and may further constantly perform self-learning. Applications such as intelligent cognition of the terminal <NUM> may be implemented by using the NPU, for example, image recognition, facial recognition, speech recognition, and text understanding.

The external memory interface <NUM> may be configured to be connected to an external storage card such as a micro SD card, to extend a storage capability of the terminal <NUM>. The external memory card communicates with the processor <NUM> through the external memory interface <NUM>, to implement a data storage function. For example, files such as music and videos are stored in the external memory card.

The internal memory <NUM> may be configured to store computer-executable program code. The executable program code includes instructions. The processor <NUM> runs the instructions stored in the internal memory <NUM>, to implement various function applications and data processing of the terminal <NUM>. The internal memory <NUM> may include a program storage area and a data storage area. The program storage area may store an operating system, an application required by at least one function (for example, a sound playing function or an image playing function), and the like. The data storage area may store data (for example, audio data and an address book) created during use of the terminal <NUM>, and the like. In addition, the internal memory <NUM> may include a high-speed random access memory, and may further include a nonvolatile memory, for example, at least one magnetic disk storage device, a flash memory device, or a universal flash storage (universal flash storage, UFS).

The terminal <NUM> may implement audio functions such as music playing and recording through the audio module <NUM>, the speaker 170A, the receiver 170B, the microphone 170C, the headset jack 170D, the application processor, and the like.

The audio module <NUM> is configured to convert digital audio information into an analog audio signal output, and is also configured to convert an analog audio input into a digital audio signal. The audio module <NUM> may be further configured to code and decode an audio signal. In some embodiments, the audio module <NUM> may be disposed in the processor <NUM>, or some functional modules in the audio module <NUM> are disposed in the processor <NUM>.

The speaker 170A, also referred to as a "loudspeaker", is configured to convert an audio electrical signal into a sound signal. The terminal <NUM> may play music by using a speaker 170A, or receive a hands-free call.

The receiver 170B, also referred to as an "earpiece", is configured to convert an audio electrical signal into a sound signal. When a call is answered or audio information is listened to by using the terminal <NUM>, the receiver 170B may be put close to a human ear to listen to a voice.

The microphone 170C, also referred to as a "mike" or a "microphone", is configured to convert a sound signal into an electrical signal. When making a call or sending a voice message, a user may make a sound near the microphone 170C through the mouth of the user, to input a sound signal to the microphone 170C. At least one microphone 170C may be disposed in the terminal <NUM>. In some other embodiments, two microphones 170C may be disposed in the terminal <NUM>, to collect a sound signal and further implement a noise reduction function. In some other embodiments, three, four, or more microphones 170C may alternatively be disposed in the terminal <NUM>, to collect a sound signal, reduce noise, further identify a sound source, implement a directional recording function, and the like.

The headset jack 170D is configured to connect to a wired headset. The headset jack 170D may be a USB interface <NUM>, or may be a <NUM> open mobile terminal platform (open mobile terminal platform, OMTP) standard interface or cellular telecommunications industry association of the USA (cellular telecommunications industry association of the USA, CTIA) standard interface.

The pressure sensor 180A is configured to sense a pressure signal, and may convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display <NUM>. There are a plurality of types of pressure sensors 180A, such as a resistive pressure sensor, an inductive pressure sensor, and a capacitive pressure sensor. The capacitive pressure sensor may include at least two parallel plates made of conductive materials. When a force is applied to the pressure sensor 180A, capacitance between electrodes changes. The terminal <NUM> determines pressure strength based on a capacitance change. When a touch operation is performed on the display <NUM>, the terminal <NUM> detects intensity of the touch operation by using the pressure sensor 180A. The terminal <NUM> may also calculate a touch position based on a detection signal of the pressure sensor 180A. In some embodiments, touch operations that are performed at a same touch location but have different touch operation strength may correspond to different operation instructions. For example, when a touch operation whose touch operation intensity is less than a first pressure threshold is performed on an SMS message application icon, an instruction for viewing an SMS message is performed. When a touch operation whose touch operation intensity is greater than or equal to the first pressure threshold is performed on the SMS message application icon, an instruction for creating a new SMS message is performed.

The gyro sensor 180B may be configured to determine a moving posture of the terminal <NUM>. In some embodiments, angular velocities of the terminal <NUM> around three axes (namely, x, y, and z axes) may be determined by using the gyro sensor 180B. The gyroscope sensor 180B may be configured to perform image stabilization during photographing. For example, when the shutter is opened, the gyro sensor 180B detects an angle at which the terminal <NUM> jitters, calculates, based on the angle, a distance for which a lens module needs to compensate, and allows the lens to cancel the jitter of the terminal <NUM> through reverse motion, to implement image stabilization. The gyro sensor 180B may be further used in a navigation scenario and a motion-sensing game scenario.

The barometric pressure sensor 180C is configured to measure barometric pressure. In some embodiments, the terminal <NUM> calculates an altitude by using a barometric pressure value measured by the barometric pressure sensor 180C, to assist positioning and navigation.

The magnetic sensor 180D includes a Hall effect sensor. The terminal <NUM> may detect opening and closing of a flip leather case by using the magnetic sensor 180D. In some embodiments, when the terminal <NUM> is a clamshell phone, the terminal <NUM> may detect opening and closing of a flip cover by using the magnetic sensor 180D. Further, a feature such as automatic unlocking upon opening of the flip cover is set based on a detected opening or closing state of the flip cover.

The acceleration sensor 180E may detect values of accelerations in various directions (usually on three axes) of the terminal <NUM>. When the terminal <NUM> is still, a value and a direction of gravity may be detected. The acceleration sensor 180E may be further configured to identify a terminal posture, and is applied to applications such as screen switching between landscape and portrait modes and a pedometer.

The distance sensor 180F is configured to measure a distance. The terminal <NUM> may measure a distance through infrared light or a laser. In some embodiments, in a photographing scenario, the terminal <NUM> may use the distance sensor 180F to measure a distance, to implement fast focusing.

The optical proximity sensor <NUM> may include, for example, a light-emitting diode (LED) and an optical detector such as a photodiode. The light-emitting diode may be an infrared light-emitting diode. The terminal <NUM> emits infrared light by using the light-emitting diode. The terminal <NUM> detects infrared reflected light from a nearby object by using the photodiode. When sufficient reflected light is detected, it may be determined that there is an object near the terminal <NUM>. When insufficient reflected light is detected, the terminal <NUM> may determine that there is no object near the terminal <NUM>. The terminal <NUM> may detect, by using the optical proximity sensor <NUM>, that the terminal <NUM> held by the user is close to an ear for a call, to automatically turn off a screen to save power. The optical proximity sensor <NUM> may also be used in a leather case mode or a pocket mode to automatically unlock or lock the screen.

The ambient light sensor <NUM> is configured to sense ambient light brightness. The terminal <NUM> may adaptively adjust brightness of the display <NUM> based on the sensed ambient light brightness. The ambient light sensor <NUM> may also be configured to automatically adjust white balance during photographing. The ambient light sensor <NUM> may also cooperate with the optical proximity sensor <NUM> to detect whether the terminal <NUM> is in a pocket to prevent a false touch.

The fingerprint sensor <NUM> is configured to collect a fingerprint. The terminal <NUM> may use a feature of the collected fingerprint to implement fingerprint-based unlocking, application lock access, fingerprint-based photographing, fingerprint-based call answering, and the like.

The temperature sensor 180J is configured to detect a temperature. In some embodiments, the terminal <NUM> executes a temperature processing policy based on a temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the terminal <NUM> lowers performance of a processor located near the temperature sensor 180J, to reduce power consumption to implement thermal protection. In some other embodiments, when the temperature is lower than another threshold, the terminal <NUM> heats the battery <NUM> to prevent the terminal <NUM> from being shut down abnormally because of a low temperature. In some other embodiments, when the temperature is lower than still another threshold, the terminal <NUM> boosts an output voltage of the battery <NUM> to avoid abnormal shutdown caused by a low temperature.

The touch sensor <NUM> is also referred to as a touch panel. The touch sensor <NUM> may be disposed on the display <NUM>, and the touch sensor <NUM> and the display <NUM> constitute a touchscreen. The touch sensor <NUM> is configured to detect a touch operation performed on or near the touch sensor. The touch sensor may transfer the detected touch operation to the application processor, to determine a type of a touch event. A visual output related to the touch operation may be provided through the display <NUM>. In some other embodiments, the touch sensor <NUM> may also be disposed on a surface of the terminal <NUM> in a position different from that of the display <NUM>.

The bone conduction sensor <NUM> may obtain a vibration signal. In some embodiments, the bone conduction sensor <NUM> may obtain a vibration signal of a vibration bone of a human vocal-cord part. The bone conduction sensor <NUM> may also be in contact with a human pulse, and receive a blood pressure beating signal. In some embodiments, the bone conduction sensor <NUM> may also be disposed in the headset, to obtain a bone conduction headset. The audio module <NUM> may obtain a voice signal through parsing based on the vibration signal that is of the vibration bone of the vocal-cord part and that is obtained by the bone conduction sensor <NUM>, to implement a voice function. The application processor may parse heart rate information based on the blood pressure beating signal obtained by the bone conduction sensor <NUM>, to implement a heart rate detection function.

The button <NUM> includes a power button, a volume button, and the like. The button <NUM> may be a mechanical button, or may be a touch button. The terminal <NUM> may receive a button input, and generate a button signal input related to user setting and function control of the terminal <NUM>.

The motor <NUM> may generate a vibration prompt. The motor <NUM> may be configured to provide an incoming call vibration prompt or a touch vibration feedback. For example, touch operations performed on different applications (for example, photographing and audio playback) may correspond to different vibration feedback effects. The motor <NUM> may also correspond to different vibration feedback effects for touch operations performed on different areas of the display <NUM>. Different application scenarios (for example, a time reminder, information receiving, an alarm clock, a game) may also correspond to different vibration feedback effects. A touch vibration feedback effect may be further customized.

The SIM card interface <NUM> is configured to connect to a SIM card. The SIM card may be inserted into the SIM card interface <NUM> or plugged from the SIM card interface <NUM>, to implement contact with or separation from the terminal <NUM>. The terminal <NUM> may support one or N SIM card interfaces, where N is a positive integer greater than <NUM>. The SIM card interface <NUM> can support a Nano SIM card, a Micro SIM card, a SIM card, and the like. A plurality of cards may be simultaneously inserted into a same SIM card interface <NUM>. The plurality of cards may be of a same type or of different types. The SIM card interface <NUM> is compatible with different types of SIM cards. The SIM card interface <NUM> is also compatible with an external storage card. The terminal <NUM> interacts with a network via a SIM card, to implement functions such as calling and data communication. In some embodiments, the terminal <NUM> uses an eSIM, namely, an embedded SIM card. The eSIM card may be embedded in the terminal <NUM>, and cannot be separated from the terminal <NUM>.

As shown in <FIG>, an embodiment of this application provides a Bluetooth protocol framework, including but not limited to a host protocol stack (Host), a host controller interface (Host Controller Interface, HCI), and a controller (controller).

The host protocol stack defines a plurality of profiles (profiles) and core protocols (protocols) in the Bluetooth framework, each profile defines a corresponding message format and application rule, and the profile is a Bluetooth service (Application). For interconnection and interworking between different devices on different platforms, specifications for various possible and universal application scenarios are defined in the Bluetooth protocol, for example, the advanced audio distribution profile (advanced audio distribution profile, A2DP), the hands-free profile (hands-free profile, HFP), and the like.

The core protocols include but are not limited to the service discovery protocol (service discovery protocol, SDP), the logical link control and adaptation protocol (logical link control and adaptation protocol, L2CAP), and the like. The core protocols are mandatory for the Bluetooth protocol stack.

The HCI provides an upper-layer protocol with a unified interface for entering a link manager and a unified manner for entering a baseband. There are several transport layers between the host core protocol stack and the controller. These transport layers are transparent and complete a task of transmitting data. The Bluetooth special interest group (Bluetooth Special Interest Group, SIG) defines four physical bus modes to connect to hardware, that is, four HCI transport layers: USB, RS232, UART, and PC card.

The controller defines a bottom-layer hardware part, including a radio frequency (RF), a baseband (BB), and a link manager (LM). An RF layer filters and transmits data bit streams by using microwaves on a <NUM> unlicensed ISM band, and conditions for a Bluetooth transceiver to work properly on this frequency band are mainly defined. The baseband is responsible for frequency hopping and transmission of Bluetooth data and information frames. The link manager is responsible for connection, establishment, and disconnection of links, and security control. A link manager (Link Manager, LM) layer is a link manager layer protocol of the Bluetooth protocol stack, and is responsible for translating an upper-layer HCI command into an operation that can be accepted by a baseband, establishing an asynchronous link (asynchronous connection-oriented link, ACL) and a synchronous link (synchronous connection-oriented/extended, SCO), enabling a Bluetooth device to enter a low-energy working mode, and the like. A link control (link control, LC) layer is responsible for responding to an upper layer LM command (for example, LM commands for establishing a transmission link of a data packet, maintaining a link, and the like) during transmission of a batch of data packets.

According to the method described in this embodiment of this application, some steps implemented by the wireless communication module <NUM> of the terminal <NUM> shown in <FIG> may be specifically performed by a Bluetooth module or a Bluetooth chip.

<FIG> is an example of a schematic structural diagram of a Bluetooth device <NUM> according to an embodiment of this application.

The following uses the Bluetooth device <NUM> as an example to describe the embodiment in detail. It should be understood that the Bluetooth device <NUM> shown in <FIG> is only an example, and the Bluetooth device <NUM> may have more or fewer components than those shown in <FIG>, may have two or more components combined, or may have different component configurations. Various components shown in the figure may be implemented in hardware that includes one or more signal processing and/or application-specific integrated circuits, software, or a combination of hardware and software.

As shown in <FIG>, the Bluetooth device <NUM> may include a processor <NUM>, a memory <NUM>, a Bluetooth communication module <NUM>, an antenna <NUM>, a power switch <NUM>, a USB communication processing module <NUM>, and an audio module <NUM>.

The processor <NUM> may be configured to read and execute computer-readable instructions. During specific implementation, the processor <NUM> may mainly include a controller, an arithmetic unit, and a register. The controller is mainly responsible for decoding an instruction, and sends a control signal for an operation corresponding to the instruction. The arithmetic unit is mainly responsible for storing a register operand, an intermediate operation result, and the like that are temporarily stored during instruction execution. In specific implementation, a hardware architecture of the processor <NUM> may be an application-specific integrated circuit (ASIC) architecture, an MIPS architecture, an ARM architecture, an NP architecture, or the like.

In some embodiments, the processor <NUM> may be configured to parse a signal received by the Bluetooth communication processing module <NUM>, for example, a pairing mode modification request sent by the terminal <NUM>. The processor <NUM> may be configured to perform a corresponding processing operation according to a parsing result, for example, generate a pairing mode modification response.

The memory <NUM> is coupled to the processor <NUM>, and is configured to store various software programs and/or a plurality of sets of instructions. In a specific implementation, the memory <NUM> may include a high-speed random access memory, and may further include a nonvolatile memory, for example, one or more magnetic disk storage devices, a flash memory device, or another nonvolatile solid-state storage device. The memory <NUM> may store an operating system, for example, an embedded operating system such as uCOS, VxWorks, or RTLinux. The memory <NUM> may further store a communication program. The communication program may be used to communicate with the terminal <NUM>, one or more servers, or another device.

The Bluetooth communication module <NUM> may include a classic Bluetooth (BT) module and a Bluetooth low energy (BLE) module.

In some embodiments, the Bluetooth communication module <NUM> may listen for a signal transmitted by another device (for example, the terminal <NUM>), such as a probe request or a scanning signal, and may send a response signal, a scanning response, or the like, so that the another device (for example, the terminal <NUM>) can discover the Bluetooth device <NUM>. The Bluetooth device <NUM> also establishes a wireless communication connection to the another device (for example, the terminal <NUM>), and communicates with the another device (for example, the terminal <NUM>) through Bluetooth.

In some other embodiments, the Bluetooth communication module <NUM> may also transmit a signal, for example, broadcast a BLE signal, so that another device (for example, the terminal <NUM>) can discover the Bluetooth device <NUM>. The Bluetooth device <NUM> also establishes a wireless communication connection to the another device (for example, the terminal <NUM>), and communicates with the another device (for example, the terminal <NUM>) through Bluetooth.

The wireless communication function of the Bluetooth device <NUM> may be implemented by using the antenna <NUM>, the Bluetooth communication module <NUM>, the modem processor, and the like.

The antenna <NUM> may be configured to transmit and receive an electromagnetic wave signal. Each antenna in the Bluetooth device <NUM> may be configured to cover one or more communication frequency bands.

In some embodiments, the Bluetooth communication module <NUM> may have one or more antennas.

The power switch <NUM> may be configured to control a power supply to supply power to the Bluetooth device <NUM>.

The USB communication processing module <NUM> may be configured to communicate with another device through a USB interface (not shown).

The audio module <NUM> may be configured to output an audio signal through an audio output interface, so that the Bluetooth device <NUM> can support audio playback. The audio module may be further configured to receive audio data through an audio input interface. The Bluetooth device <NUM> may be a media playback device such as a Bluetooth headset.

In some embodiments, the Bluetooth device <NUM> may further include a display (not shown). The display may be configured to display an image, prompt information, and the like. The display may be a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (organic light-emitting diode, OLED) display, an active-matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED) display, a flexible light-emitting diode (flexible light-emitting diode, FLED) display, a quantum dot light emitting diode (quantum dot light emitting diodes, QLED) display, or the like.

In some embodiments, the Bluetooth device <NUM> may further include a serial interface such as an RS-<NUM> interface. The serial interface may be connected to another device, for example, an audio loudspeaker device such as a speaker, so that the Bluetooth device <NUM> and the audio loudspeaker device cooperatively play audio and video.

It may be understood that the structure shown in <FIG> does not constitute any specific limitation on the Bluetooth device <NUM>. In some other embodiments of this application, the Bluetooth device <NUM> may include more or fewer components than those shown in the figure, or some components may be combined, or some components may be split, or different component arrangements may be used. The components shown in the figure may be implemented by hardware, software, or a combination of software and hardware.

In the method described in this embodiment of this application, for the Bluetooth protocol framework used by the Bluetooth device, refer to <FIG>.

In a related technology, before the terminal <NUM> performs authentication for pairing with the Bluetooth device <NUM>, the terminal <NUM> needs to obtain a device name of the Bluetooth device <NUM>. After the terminal <NUM> obtains the device name of the Bluetooth device <NUM>, the terminal <NUM> may display the device name of the Bluetooth device <NUM> on the Bluetooth setting interface, so that a user triggers the terminal <NUM> to complete authentication for pairing with the Bluetooth device <NUM>.

As shown in <FIG>, in the existing Bluetooth standard protocol, before the terminal <NUM> completes authentication for pairing with the Bluetooth device <NUM>, the following process is performed:.

Before the terminal <NUM> sends the remote name request to the Bluetooth device <NUM>, because no connection is established between the terminal <NUM> and the Bluetooth device <NUM>, the terminal <NUM> needs to obtain a supported feature (supported feature) of the Bluetooth device <NUM>. Therefore, the terminal <NUM> needs to send a feature request (feature request)/extended feature request (extended feature request) to the Bluetooth device <NUM>, to request to obtain device feature information of the Bluetooth device <NUM>. The feature request or the extended feature request includes device supported feature (device supported feature) information of the terminal <NUM>. After receiving the device feature request/extended feature request sent by the terminal <NUM>, the Bluetooth device <NUM> may return a feature response (feature response)/extended feature response (extended feature response) to the terminal <NUM>. The feature response/extended feature response includes the device supported feature (device supported feature) information of the Bluetooth device <NUM>.

The terminal <NUM> obtains information about a feature (feature) supported by the Bluetooth device <NUM> for connection and interworking between the terminal <NUM> and the Bluetooth device <NUM>. The information about a feature supported by the Bluetooth device <NUM> may include whether the following features are supported: <NUM> slot packets (<NUM> slot packets), <NUM> slot packets (<NUM> slot packets), encryption (encryption), slot offset (slot offset), timing accuracy (timing accuracy), role switch (role switch), hold mode (hold mode), sniff mode (sniff mode), power control request (power control request), channel quality driven data rate (channel quality driven data rate, CQDDR), synchronous connection oriented link (synchronous connection oriented link), secure simple pairing (secure simple pairing), and the like.

For descriptions of device-supported features (features), refer to the device feature (device feature) part in the Bluetooth protocol Core_5. <NUM> Vol2 Part C.

The terminal <NUM> pages the Bluetooth device <NUM>.

After obtaining the device name of the Bluetooth device <NUM>, the terminal <NUM> may display the device name of the Bluetooth device <NUM> in the available device list on the Bluetooth setting interface. The terminal <NUM> may receive a selection operation performed by a user for an option corresponding to the Bluetooth device <NUM> in the available device list. In response to the selection operation, the terminal <NUM> may perform carrier frequency hopping based on a paging hopping sequence, and send a page request (page request) to the Bluetooth device <NUM> in a sending interval, to request the Bluetooth device <NUM> to join a piconet (piconet) where the terminal <NUM> is located. The paging hopping sequence (paging hopping sequence) is generated by using <NUM> least significant bits of the Bluetooth address of the paged device.

The Bluetooth device <NUM> returns a page response (page response) to the terminal <NUM>.

The Bluetooth device <NUM> may listen for a page request of the terminal <NUM> at a specific hopping frequency in a fixed time window at a regular interval. After detecting the page request sent by the terminal <NUM>, the Bluetooth device <NUM> may send a secondary device page response (slave page response) to the terminal <NUM> in a next interval. After receiving the secondary device page response from the Bluetooth device <NUM>, the terminal <NUM> may send a master device page response (master page response) in a next interval.

The terminal <NUM> establishes an asynchronous connectionless (asynchronous connectionless, ACL) connection to the Bluetooth device <NUM>.

After completing paging with the Bluetooth device <NUM>, the terminal <NUM> may establish the ACL connection. After the ACL connection is established, a logical link control and adaptation protocol (logical link control and adaptation protocol, L2CAP) signaling channel (channel ID CID = 0x0001) between the terminal <NUM> and the Bluetooth device <NUM> exists. The terminal <NUM> and the Bluetooth device <NUM> may transmit control signaling and some data over the L2CAP signaling channel. The terminal <NUM> may establish an L2CAP connection to the Bluetooth device <NUM> through the L2CAP signaling channel.

The terminal <NUM> and the Bluetooth device <NUM> complete authentication for pairing.

The pairing between the terminal <NUM> and the Bluetooth device <NUM> may be link manager protocol (link manager protocol, LMP) pairing, secure simple pairing (secure simple pairing, SSP), or another non-standard pairing. After the pairing between the terminal <NUM> and the Bluetooth device <NUM> is completed, a shared key, that is, a link key (link key) may be created. The link key (link key) can be used for mutual authentication between devices and encrypt data to be exchanged.

After the terminal <NUM> is paired with the Bluetooth device <NUM>, the terminal <NUM> and the Bluetooth device <NUM> share a same link key. Then, the terminal <NUM> and the Bluetooth device <NUM> may use the link key to perform identity authentication. After the identity authentication is completed, the terminal <NUM> and the Bluetooth device <NUM> may derive an encryption key (encryption key) by using the link key and a random number that is exchanged recently before encrypted communication. Then, the terminal <NUM> and the Bluetooth device <NUM> may encrypt, by using the encryption key, data to be transmitted between the terminal <NUM> and the Bluetooth device <NUM>.

It can be learned from the foregoing related technologies that, before performing pairing, the terminal <NUM> needs to first send the remote name request to the Bluetooth device <NUM>, to request to obtain the device name of the Bluetooth device <NUM>. Then, the Bluetooth device <NUM> returns the remote name response carrying the device name of the Bluetooth device <NUM> to the terminal <NUM>. As a result, the entire Bluetooth pairing process takes an excessively long time.

Therefore, this application provides a Bluetooth pairing method: After the Bluetooth device <NUM> enters an inquiry scan state and then detects an inquiry request of the terminal <NUM>, the Bluetooth device <NUM> returns an extended inquiry response (extended inquiry response, EIR) to the terminal <NUM>. The extended inquiry response may carry the device name of the Bluetooth device <NUM>. Instead of obtaining the device name of the Bluetooth device <NUM> through a remote device name request (remote name request) in the related technology, this application obtains the device name of the Bluetooth device <NUM> through the extended inquiry response, and obtains device-supported feature information through exchanging a feature request/extended feature request and a feature response/extended feature response. This can reduce time consumed in the pairing process between the terminal <NUM> and the Bluetooth device <NUM>.

The following describes a Bluetooth pairing method provided in this application.

<FIG> shows a Bluetooth pairing method according to an embodiment of this application.

S501: The terminal <NUM> sends an inquiry request to the Bluetooth device <NUM>.

First, the terminal <NUM> may receive an input operation of a user to enable a Bluetooth function. In this embodiment of this application, the operation of enabling the Bluetooth function by the user may be referred to as a first operation.

For example, as shown in <FIG>, the terminal <NUM> displays a home screen interface <NUM>, and the interface <NUM> displays a page on which application icons are placed, the page includes a plurality of application icons (for example, a weather application icon, a stock application icon, a calculator application icon, a setting application icon <NUM>, an email application icon, an Alipay application icon, a Facebook application icon, a browser application icon, a gallery application icon, a music application icon, a video application icon, and an application store icon). Page indicators are further displayed below the application icons, to indicate a position relationship between a currently displayed page and another page. There are a plurality of tray icons (for example, a dial-up application icon, a message application icon, a contact application icon, and a camera application icon) below the page indicators. The tray icons remain displayed during page switching. The page may also include a plurality of application icons and page indicators. Alternatively, the page indicators may exist independently, instead of being a part of the page. The tray icons are also optional. This is not limited in embodiments of this application. A status bar <NUM> is displayed in the upper part of the interface <NUM>. The status bar <NUM> may include: one or more signal strength indicators of a mobile communication signal (which may also be referred to as a cellular signal), one or more signal strength indicators of a wireless fidelity (wireless fidelity, Wi-Fi) signal, a battery status indicator, a time indicator, and so on. A navigation bar <NUM> is displayed below the tray icons. The navigation bar <NUM> may include system navigation buttons such as a return button <NUM>, a home screen (home screen) button <NUM>, and a recent task history button <NUM>. When detecting that the user taps the return button <NUM>, the terminal <NUM> may display a previous page of the current page. When detecting that the user taps the home screen button <NUM>, the terminal <NUM> may display the home screen. When detecting that the user taps the recent task history button <NUM>, the terminal <NUM> may display a task recently opened by the user. Names of the navigation buttons may alternatively be other names. This is not limited in this application. Not limited to a virtual button, each navigation button in the navigation bar <NUM> may alternatively be implemented as a physical button.

The terminal <NUM> may receive an input operation (for example, tapping) performed by the user on the setting icon <NUM>. In response to the input operation on the setting icon <NUM>, the terminal <NUM> may display a setting interface <NUM> shown in <FIG>.

As shown in <FIG>, the setting interface <NUM> displays a wireless and network setting option, a device connection setting option <NUM>, an application and notification setting option, a battery setting option, a display setting option, a sound setting option, a storage setting option, a security and privacy setting option, a user and account setting option, and the like.

The terminal <NUM> may receive an input operation (for example, tapping) performed by the user on the device connection option <NUM>. In response to the input operation on the device connection option <NUM>, the terminal <NUM> may display a device connection interface <NUM> shown in <FIG>.

As shown in <FIG>, the device connection interface <NUM> displays a Bluetooth setting option <NUM>, an NFC setting option, a Huawei Beam setting option, a Huawei Share setting option, a mobile phone projection setting option, a USB setting option, a print setting option, and the like.

The terminal <NUM> may receive an input operation performed by the user on the Bluetooth setting option <NUM> in the device connection interface <NUM>. In response to the input operation on the Bluetooth setting option <NUM>, the terminal <NUM> may display a Bluetooth setting interface <NUM> shown in <FIG>.

As shown in <FIG>, the Bluetooth setting interface <NUM> displays a Bluetooth switch option <NUM>, a device name setting option <NUM>, a file receiving setting option <NUM>, a scanning control <NUM>, and a help control <NUM>. The Bluetooth switch option <NUM> displays a Bluetooth switch <NUM>. The Bluetooth switch <NUM> may be configured to receive a user operation to trigger the terminal <NUM> to enable/disable a Bluetooth function.

For example, when the Bluetooth switch <NUM> is currently in an off state, the terminal <NUM> may receive an input operation (for example, tapping) performed by the user on the Bluetooth switch <NUM>. In response to the input operation on the Bluetooth switch <NUM>, the terminal <NUM> may enable the Bluetooth function.

After the terminal <NUM> enables the Bluetooth function, the terminal <NUM> may enter an inquiry (inquiry) state. After entering the inquiry state, the terminal <NUM> may select a new frequency to send an inquiry request (inquiry request) at a specified interval (for example, <NUM>). The inquiry request includes a Bluetooth address (BD_ADDR) of the terminal <NUM>. If a device near the terminal <NUM> is in a discoverable state, a new frequency may be selected for listening at a specified interval (for example, <NUM>). The terminal <NUM> (inquiry device) and the nearby device (inquired device) may use a low address part (low address part, LAP) of a general inquiry access code (general inquiry access code, GIAC) as an inquiry address. After the inquiry request sent by the terminal <NUM> is received, an inquiry response (inquiry response) may be sent to the terminal <NUM> according to the Bluetooth address of the terminal <NUM> in the inquiry request.

S502: The Bluetooth device <NUM> returns the inquiry response to the terminal <NUM>.

After entering an inquiry scan (inquiry scan) state, the Bluetooth device <NUM> may scan for an inquiry request sent by a surrounding device. After receiving the inquiry request sent by the terminal <NUM>, the Bluetooth device <NUM> may return the inquiry response to the terminal <NUM> according to the Bluetooth address of the terminal <NUM> in the inquiry request. The inquiry response includes a Bluetooth address of the Bluetooth device <NUM>.

In this embodiment of this application, the Bluetooth device <NUM> may enter the inquiry scan state as triggered by an input operation of the user. For example, when the Bluetooth device <NUM> is in a power-off state, the Bluetooth device <NUM> may receive an input operation (for example, pressing and holding a power button for more than <NUM> seconds) performed by the user on the power button. In response to the input operation on the power button, the Bluetooth device <NUM> may be powered on and enter the inquiry scan state.

S503: The Bluetooth device <NUM> returns an extended inquiry response (extended inquiry response) to the terminal <NUM>. The extended inquiry response may carry a device name and device supported features (device supported features) information of the Bluetooth device <NUM>.

After returning the inquiry response (inquiry response) to the terminal <NUM>, the Bluetooth device <NUM> may send the extended inquiry response (extended inquiry response, EIR) to the terminal <NUM> by using an inquiry response frequency hopping sequence (inquiry response hopping sequence).

For a format of the extended inquiry response, refer to <FIG>.

As shown in <FIG>, the EIR may include <NUM>-byte data. The <NUM>-byte data may include a significant part (significant part) and a non-significant part (non-significant part). The significant part includes N extended inquiry response data structures (EIR data structures), where N is a positive integer. The non-significant part is filled with <NUM>.

Each EIR data structure may include a length (Length) field and a data (Data) field. A value of the length field indicates a length of the data field. For example, if a value of the length field is "0x03", it indicates that the length of the data field is three bytes. The foregoing examples are only used to explain this application, and do not constitute any limitation.

The data (Data) field may include an extended inquiry response data type (EIR data type) field and an extended inquiry response data (EIR data) field. The EIR data type field may occupy n bytes, where n is a positive integer. The length of the EIR data field is equal to the value of the length field minus the byte length of the EIR data type.

The EIR data type may include a service universally unique identifier (service universally unique identifier, service UUID), a local device name (local name), a flag (flag), manufacturer specific data (manufacturer specific data), a transmit power level (TX power level), a uniform resource identifier (Uniform Resource Identifier), and the like.

In this embodiment of this application, the EIR carries the device name and the device supported feature information of the Bluetooth device <NUM>. For example, as shown in <FIG>, in EIR data structure <NUM>, the EIR data type of the EIR data structure <NUM> may be a local device name, and the EIR data field of the EIR data structure <NUM> includes the device name of the Bluetooth device <NUM>, for example, "HUAWEI Free Buds". In EIR data structure <NUM>, an EIR data type of the EIR data structure <NUM> may be manufacturer specific data, and an EIR data field of the EIR data structure <NUM> includes the device supported feature information of the Bluetooth device <NUM>. The device-supported feature information may include whether the Bluetooth device <NUM> supports the following features: <NUM> slot packets (<NUM> slot packets), <NUM> slot packets (<NUM> slot packets), encryption (encryption), slot offset (slot offset), timing accuracy (timing accuracy), role switch (role switch), and hold mode (hold mode), sniff mode (sniff mode), power control request (power control request), channel quality driven data rate (channel quality driven data rate, CQDDR), synchronous connection oriented link (synchronous connection oriented link), secure simple pairing (secure simple pairing), and the like.

After the terminal <NUM> receives the extended inquiry response (EIR) returned by the Bluetooth device <NUM>, the terminal <NUM> may obtain the device name of the Bluetooth device <NUM> from the EIR, to display the device name in the available device list on the Bluetooth setting interface of the terminal <NUM>.

For example, as shown in <FIG>, after the terminal <NUM> enables the Bluetooth function, the terminal <NUM> may display a paired device list <NUM> and an available device list <NUM>. The paired device list may display one or more paired device options (for example, a "HUAWEI AM08" device option or a "HUAWEI Mate <NUM>" device option). After obtaining the device name of the Bluetooth device <NUM>, the terminal <NUM> may display a device option <NUM> corresponding to the Bluetooth device <NUM> in the available device list <NUM>. The device option <NUM> displays the device name of the Bluetooth device <NUM> (for example, the device name of the Bluetooth device <NUM> may be "HUAWEI Free Buds").

S504: The terminal <NUM> pages the Bluetooth device <NUM>.

As shown in <FIG>, the terminal <NUM> may receive a selection operation (for example, tapping) performed by the user on the device option <NUM> corresponding to the Bluetooth device <NUM> in the available device list <NUM>. In response to the selection operation, the terminal <NUM> may perform carrier frequency hopping based on a paging hopping sequence, and send a page request (page request) to the Bluetooth device <NUM> in a sending interval, to request the Bluetooth device <NUM> to join a piconet (piconet) where the terminal <NUM> is located. The paging hopping sequence (paging hopping sequence) is generated by using <NUM> least significant bits of the Bluetooth address of the paged device.

In this embodiment of this application, an operation of triggering the terminal <NUM> to page the Bluetooth device <NUM> may be referred to as a second operation (for example, a selection operation on the device option <NUM> corresponding to the Bluetooth device <NUM> shown in <FIG>).

S505: The Bluetooth device <NUM> returns a page response to the terminal <NUM>.

The Bluetooth device <NUM> may listen for a page request of the terminal <NUM> at a specific hopping frequency in a fixed time window at a regular interval. After detecting the page request sent by the terminal <NUM>, the Bluetooth device <NUM> may send a secondary device page response (slave page response) to the terminal <NUM> in a next interval. After receiving the secondary device page response from the Bluetooth device <NUM>, the terminal <NUM> may send a master device page response (master page response) to the Bluetooth device <NUM> in a next interval.

After receiving the master device page response sent by the terminal <NUM>, the Bluetooth device <NUM> may enter a connected state, automatically become a secondary device of the piconet, and return another secondary device page response to the terminal <NUM>. After receiving the secondary device page response sent by the Bluetooth device <NUM>, the terminal <NUM> may enter a connected state and automatically become a master device of the piconet. In the connected state, each communication party of the terminal <NUM> and the Bluetooth device <NUM> hops to a frequency channel at a specified interval (for example, <NUM> microseconds). In the connected state, a channel hopping sequence (channel hopping sequence) used by both communication parties of the terminal <NUM> and the Bluetooth device <NUM> is generated by <NUM> least significant bits of the Bluetooth address of the terminal <NUM>.

S506: The terminal <NUM> establishes an ACL connection to the Bluetooth device <NUM>.

S507: The terminal <NUM> performs pairing with the Bluetooth device <NUM>.

As shown in <FIG>, when the terminal <NUM> is pairing with the Bluetooth device <NUM>, the terminal <NUM> may display text information "Pairing. " on the device option <NUM>, to indicate that the terminal <NUM> is currently pairing with the Bluetooth device <NUM>.

After the terminal <NUM> is paired with the Bluetooth device <NUM>, the terminal <NUM> and the Bluetooth device <NUM> share a same link key. Then, the terminal <NUM> and the Bluetooth device <NUM> may use the link key to perform identity authentication. After the identity authentication is completed, the terminal <NUM> and the Bluetooth device <NUM> may derive an encryption key (encryption key) by using the link key and a random number that is exchanged recently before encrypted communication. Then, the terminal <NUM> and the Bluetooth device <NUM> may encrypt, by using the encryption key, data to be transmitted between the two communication parties.

The following describes an LMP pairing procedure in this embodiment of this application.

The length of the initial key is <NUM> bits (bit) generated by the E22 algorithm.

The input (plaintext) of the E22 algorithm consists of the following three parts: physical address BD_ADDR of a peer device, PIN code and its length, and <NUM>-bit random number IN_RAND.

Before the initial key is generated, the master device obtains the address (BD_ADDRB) of the secondary device in inquiry mode. The address of the master device is BD_ADDRA.

The PIN code is preset by both devices (the master device and the secondary device), for example, "<NUM>" or "<NUM>".

The random number IN_RAND is generated by the master device and transmitted to the secondary device in plain text.

The master and secondary devices use the same E22 algorithm. If the values of the three parts are the same, the initial keys calculated by the two devices should be the same.

After the initial key is generated, the master device generates a <NUM>-bit random number Link_RandA, and the secondary device also generates a <NUM>-bit random number Link_RandB. In the master device, the master device performs a bitwise logical exclusive OR operation on the initial key and Link_RandA, and sends an exclusive OR result to the secondary device. Similarly, in the secondary device, the secondary device performs a bitwise exclusive OR operation on the initial key and Link_RandB, and sends an exclusive OR result to the master device.

The master device may perform an operation according to the exclusive OR result sent by the secondary device and the initial key stored locally to obtain Link_RandB. The secondary device may perform an operation according to the exclusive OR result sent by the master device and the locally stored initial key to obtain Link_RandA. In this way, the master device and the secondary device have the same initial key, Link_RandA, and Link_RandB.

The master device may perform an encryption operation on Link_RandA and BD_ADDRA to obtain Link_KA, and perform an encryption operation on Link_RandB and BD_ADDRB to obtain Link_KB by using an algorithm (for example, the E21 algorithm). Then, the master device may perform an exclusive OR operation on Link_KA and Link_KB to obtain Kab.

Similarly, the secondary device may perform an encryption operation on Link_RandA and BD_ADDRA to obtain Link_KA, and perform an encryption operation on Link_RandB and BD_ADDRB to obtain Link_KB by using an algorithm (for example, the E21 algorithm). Then, the secondary device may perform an exclusive OR operation on Link_KA and Link_KB to obtain Kab.

A two-way authentication challenge-response (challenge-response) manner is used. The master device may be a responder, and the secondary device may be a requester. The responder may generate a <NUM>-bit random number AU_RANDA and send the random number in plain text to the requester. The responder and the requester use the E1 algorithm to encrypt AU_RANDA, Kab, and BD_RANDB to generate their respective <NUM>-bit SRESA and SRESB. The SRESA is generated by the master device as the responder, and the SRESB is generated by the secondary device as the requester. The requester sends the SRESB to the responder. The responder compares the SRESA with the SRESB. If they are the same, the authentication is successful. Otherwise, the authentication fails. After the authentication is complete, the roles of the master device and the secondary device are switched. The master device functions as the requester, and the secondary device functions as the responder. The authentication is performed in the same way.

The terminal <NUM> and the Bluetooth device <NUM> may derive an encryption key (encryption key) by using the link key Kab and a random number that is exchanged recently before encrypted communication. Then, the terminal <NUM> and the Bluetooth device <NUM> may encrypt, by using the encryption key, data to be transmitted between the two communication parties.

As shown in <FIG>, after authentication for pairing between the terminal <NUM> and the Bluetooth device <NUM> is completed, the terminal <NUM> may display a device option <NUM> of the Bluetooth device <NUM> in the paired device list <NUM>. The device option <NUM> of the Bluetooth device <NUM> may display "paired for calls and media audio".

Claim 1:
A Bluetooth pairing method, wherein the method is applied to a Bluetooth system, the Bluetooth system comprises a terminal and a Bluetooth device, and the method comprises:
when the terminal receives a first operation of a user, sending (S501), by the terminal, an inquiry request to the Bluetooth device, wherein the inquiry request is used to obtain a Bluetooth address of the Bluetooth device;
when the Bluetooth device receives the inquiry request, sending (S502), by the Bluetooth device, an inquiry response to the terminal, wherein the inquiry response comprises the Bluetooth address of the Bluetooth device;
sending (S503), by the Bluetooth device, an extended inquiry response to the terminal, wherein the extended inquiry response comprises a device name of the Bluetooth device; and
after the terminal receives the extended inquiry response, displaying, by the terminal, the device name of the Bluetooth device;
characterized in that
the extended inquiry response further comprises information about a feature supported by the Bluetooth device; wherein the information about a feature supported by the Bluetooth device comprises: secure simple pairing, <NUM>-slot packet transmission, <NUM>-slot packet transmission, timing accuracy, and synchronous connection oriented link.