CN112449328A - Bluetooth searching method, system and related device - Google Patents

Bluetooth searching method, system and related device Download PDF

Info

Publication number
CN112449328A
CN112449328A CN201910817160.8A CN201910817160A CN112449328A CN 112449328 A CN112449328 A CN 112449328A CN 201910817160 A CN201910817160 A CN 201910817160A CN 112449328 A CN112449328 A CN 112449328A
Authority
CN
China
Prior art keywords
electronic device
bluetooth
ble broadcast
ble
electronic
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201910817160.8A
Other languages
Chinese (zh)
Other versions
CN112449328B (en
Inventor
萧维廷
彭斌
许浩维
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910817160.8A priority Critical patent/CN112449328B/en
Priority to PCT/CN2020/109383 priority patent/WO2021036835A1/en
Publication of CN112449328A publication Critical patent/CN112449328A/en
Application granted granted Critical
Publication of CN112449328B publication Critical patent/CN112449328B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • 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

Abstract

Disclosed are a Bluetooth searching method, a Bluetooth searching system and a related device, which relate to the technical field of short-distance wireless communication. The method comprises the following steps: the second electronic device sends a BLE broadcast, the BLE broadcast carrying a device address and a device name of the second electronic device. The first electronic device starts the Bluetooth function, and displays the device name of the second electronic device in an available device list according to the received BLE broadcast. Then, the first electronic equipment receives a first user operation; and responding to the first user operation, the first electronic equipment pairs the second electronic equipment according to the equipment address of the second electronic equipment, and establishes Bluetooth connection with the second electronic equipment. Therefore, the Bluetooth searching efficiency can be improved, Bluetooth searching is executed by utilizing BLE broadcasting, and the power consumption is saved.

Description

Bluetooth searching method, system and related device
Technical Field
The present application relates to the field of short-distance wireless communication technologies, and in particular, to a bluetooth search method, system and related apparatus.
Background
Bluetooth (Bluetooth) is a common data transmission mode among electronic devices, can realize short-distance wireless data transmission among electronic devices (such as mobile phones, notebook computers, palm computers, wireless earphones, intelligent sound boxes, intelligent watches and the like), and has the advantages of convenience, rapidness, flexibility and safety.
To establish a bluetooth connection between two electronic devices (e.g., a first electronic device and a second electronic device), the first electronic device may perform a bluetooth search to display the name of the discovered device. In a bluetooth search, the first electronic device may hop over 32 channels to transmit bluetooth broadcasts and the second electronic device may also hop over 32 channels to receive broadcasts. When the first electronic device and the second electronic device respectively transmit and receive the broadcast on the same channel, the first electronic device can receive the response of the second electronic device to display the device name of the second electronic device.
Because the two devices respectively carry out frequency hopping on 32 channels to send and receive broadcast, the number of the channels is large, and thus the situation that the two devices do not hop to the same channel often occurs, the time of Bluetooth searching is prolonged, and the efficiency of Bluetooth searching is reduced.
Disclosure of Invention
The application provides a Bluetooth searching method, a Bluetooth searching system and a related device, which can start searching BLE broadcast when a Bluetooth switch of first electronic equipment is turned on. The time for waiting for the Bluetooth search is reduced, and the Bluetooth search efficiency is improved.
In a first aspect, the present application provides a bluetooth searching method, which is applied to a bluetooth system including a first electronic device and a second electronic device, and includes: the second electronic device sends a low-power-consumption Bluetooth BLE broadcast, wherein the BLE broadcast carries the device address and the device name of the second electronic device; the first electronic device starts a Bluetooth function and receives the BLE broadcast; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast; the first electronic equipment receives first user operation, and the first user operation is used for indicating that Bluetooth connection is established with the second electronic equipment; responding to the first user operation, the first electronic equipment pairs the second electronic equipment according to the equipment address of the second electronic equipment, and establishes Bluetooth connection with the second electronic equipment.
Implementing the bluetooth search method provided in the first aspect, the first electronic device may start searching for BLE broadcasts when the bluetooth switch is turned on. The BLE broadcast can be searched by the first electronic equipment before the Bluetooth setting interface is displayed, so that the time for a user to wait for Bluetooth searching after the Bluetooth setting interface is displayed is reduced, and the Bluetooth searching efficiency is improved. In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
In one possible implementation, the second electronic device transmits a bluetooth low energy BLE broadcast, including: when detecting that the Bluetooth function is started, the second electronic equipment sends a low-power Bluetooth Low Energy (BLE) broadcast.
Optionally, the second electronic device may also send the BLE broadcast within a preset time (e.g., 1 minute) after the bluetooth function is turned on, and stop sending the BLE broadcast after the preset time is exceeded.
(1) The second electronic equipment is a mobile phone, a notebook computer or a palm computer
When the second electronic device is a mobile phone, a notebook computer or a handheld computer, the second electronic device may send the BLE broadcast within a preset time (e.g., 5 minutes) after the bluetooth switch is turned on, and stop sending the BLE broadcast after the preset time is exceeded. In another possible implementation, the second electronic device may also transmit the BLE broadcast within a preset time (e.g., 5 minutes) after receiving a user operation (e.g., a click operation) applied to the scan control.
(2) The second electronic device can be a wireless earphone, an intelligent sound box, an intelligent watch and other peripheral devices
When the second electronic device is a peripheral device such as a wireless headset, a smart speaker, a smart watch, etc., the second electronic device may send the BLE broadcast within a preset time (e.g., 2 minutes) after the second electronic device is turned on, and the sending of the BLE broadcast may be stopped after the preset time is exceeded. The second electronic device may also be configured to transmit a BLE broadcast in response to a particular operation being detected (e.g., a long power key press for more than 5 seconds).
In another possible implementation, the second electronic device establishes a bluetooth connection with another electronic device (e.g., a third electronic device), and the second electronic device stops transmitting the BLE broadcast.
In some embodiments of the present application, when the second electronic device is paired, the second electronic device may transmit BLE broadcasts at a lower frequency than when not paired. When the second electronic device is unpaired, the BLE broadcast is transmitted at a higher frequency than when paired. For example, when not paired, the second electronic device transmits BLE broadcast at a frequency of 1Hz (with a period of 1000 milliseconds). When the paired unconnected state is established, the second electronic device transmits a BLE broadcast at a frequency of 0.5Hz (with a period of 2000 milliseconds).
When the first electronic device and the second electronic device are both mobile phones, the first electronic device can send a BLE broadcast and receive the BLE broadcast within a preset time after the Bluetooth function is turned on, for example, within 1 minute after the Bluetooth switch is turned on. After the bluetooth function is turned on, the second electronic device may also send and receive BLE broadcasts.
In a possible implementation manner, after the first electronic device establishes a bluetooth connection with the second electronic device, the method further includes: the second electronic device stops transmitting the BLE broadcast.
Wherein, bluetooth function opens and to contain, and bluetooth switch opens in the bluetooth sets up the interface.
In a possible implementation manner, after the first electronic device establishes a bluetooth connection with the second electronic device, the method further includes: when the Bluetooth connection disconnection is detected, the second electronic equipment initiates a paging page to the first electronic equipment within a first time; when the second electronic device fails to connect with the first electronic device within the first time according to the initiated page, the second electronic device transmits the BLE broadcast within a second time.
When the second electronic device and the first electronic device are disconnected in a Bluetooth connection mode, the second electronic device can initiatively initiate paging, in this way, the second electronic device and the first electronic device can reestablish Bluetooth connection in time, and convenience of Bluetooth connection is improved.
In one possible implementation, the BLE broadcast further carries a universally unique identifier UUID, where the UUID indicates that the BLE broadcast is used for device discovery; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when detecting that the UUID indicates that the BLE broadcast is for device discovery, the first electronic device displays a device name of the second electronic device in a list of available devices.
The field corresponding to the UUID may be the first two bytes (byte) of the AD Data.
In one possible implementation, the BLE broadcast further carries first indication information indicating whether pairing can be performed; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the first indication information indicates that pairing can be performed, the first electronic device displays the device name of the second electronic device in an available device list.
Wherein the first indication information may be set in the form of a field in the AD Data. The field can occupy 1bit, and when the field takes a value of 0, the field can indicate that the second electronic device does not enter a state capable of being paired currently, that is, the first indication information carried by the BLE broadcast indicates that pairing cannot be performed. When the field takes a value of 1, it may indicate that the second electronic device has currently entered a state in which the second electronic device can be paired, that is, the first indication information indicates that the second electronic device can be paired.
In one possible implementation, the BLE broadcast further carries second indication information indicating whether or not it can be connected; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the first indication information indicates that the connection can be made, the first electronic device displays the device name of the second electronic device in an available device list.
The second indication information may be set in the form of a field in the AD Data. The field can also occupy 1bit, and when the field takes a value of 0, the field can indicate that the second electronic device does not enter a connectable state currently, that is, the BLE broadcast carries information indicating that the second electronic device cannot be connected. When the field takes a value of 1, it may indicate that the second electronic device 200 has currently entered a connectable state, i.e., the BLE broadcast carries information indicating that the connection is possible.
In one possible implementation manner, the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the signal strength of the BLE broadcast is greater than a first threshold, the first electronic device displays the device name of the second electronic device in an available device list.
Wherein the first electronic device may detect a received signal strength indication, RSSI, of the BLE broadcast to determine the signal strength of the BLE broadcast.
In one possible implementation, the second electronic device transmits a bluetooth low energy BLE broadcast, including: the second electronic equipment periodically sends BLE broadcast and periodically enters an inquiry scanning inquiry state; the inquiry scan state is used for the second electronic device to be discovered by a third electronic device, which supports classic bluetooth.
In this application embodiment, the second electronic device can search for the device supporting BLE through BLE broadcasting, and can search for the device supporting classic bluetooth through inquiry scan. In this way, the situation that classic Bluetooth devices cannot be found due to the fact that only BLE broadcasting is supported for searching is reduced, and therefore universality of Bluetooth searching is improved.
In a second aspect, the present application provides a bluetooth searching method, including: the method comprises the steps that the first electronic device starts a Bluetooth function, and receives a BLE broadcast from the second electronic device, wherein the BLE broadcast carries a device address and a device name of the second electronic device; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast; the first electronic equipment receives first user operation, and the first user operation is used for indicating that Bluetooth connection is established with the second electronic equipment; responding to the first user operation, the first electronic equipment pairs the second electronic equipment according to the equipment address of the second electronic equipment, and establishes Bluetooth connection with the second electronic equipment.
Implementing the bluetooth search method provided in the second aspect, the first electronic device may start searching for BLE broadcasts when the bluetooth switch is turned on. The BLE broadcast can be searched by the first electronic equipment before the Bluetooth setting interface is displayed, so that the time for a user to wait for Bluetooth searching after the Bluetooth setting interface is displayed is reduced, and the Bluetooth searching efficiency is improved. In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
In one possible implementation, the BLE broadcast also carries a UUID, which indicates that the BLE broadcast is used for device discovery; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when detecting that the UUID indicates that the BLE broadcast is for device discovery, the first electronic device displays a device name of the second electronic device in a list of available devices.
In one possible implementation, the BLE broadcast further carries first indication information indicating whether pairing can be performed; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the first indication information indicates that pairing can be performed, the first electronic device displays the device name of the second electronic device in an available device list.
In one possible implementation, the BLE broadcast further carries second indication information indicating whether or not it can be connected; the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the first indication information indicates that the connection can be made, the first electronic device displays the device name of the second electronic device in an available device list.
In one possible implementation manner, the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including: when the signal strength of the BLE broadcast is greater than a first threshold, the first electronic device displays the device name of the second electronic device in an available device list.
In a third aspect, the present application provides a bluetooth system comprising a first electronic device and a second electronic device, wherein: the second electronic device is configured to send a low-power-consumption bluetooth BLE broadcast, where the BLE broadcast carries a device address and a device name of the second electronic device; the first electronic device is used for starting a Bluetooth function and receiving the BLE broadcast; the first electronic device is further configured to display a device name of the second electronic device in an available device list according to the BLE broadcast; the first electronic device is further used for receiving a first user operation, wherein the first user operation is a user operation acting on the device name of the second device; the first electronic device is further configured to, in response to the first user operation, pair the second electronic device according to the device address of the second electronic device, and establish a bluetooth connection with the second electronic device.
The third aspect provides the bluetooth system, wherein the first electronic device may start searching for the BLE broadcast when the bluetooth switch is turned on. The BLE broadcast can be searched by the first electronic equipment before the Bluetooth setting interface is displayed, so that the time for a user to wait for Bluetooth searching after the Bluetooth setting interface is displayed is reduced, and the Bluetooth searching efficiency is improved. In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
In a possible implementation manner, the second electronic device is specifically configured to send a bluetooth low energy BLE broadcast when it is detected that the bluetooth function is turned on.
In a possible implementation manner, the second electronic device is further configured to stop sending the BLE broadcast after the first electronic device establishes a bluetooth connection with the second electronic device.
In a possible implementation manner, the second electronic device is further configured to initiate a paging page to the first electronic device within a first time when it is detected that the bluetooth connection is disconnected; the second electronic device is further configured to transmit the BLE broadcast within a second time when a connection with the first electronic device fails within the first time according to the initiated page.
In one possible implementation, the BLE broadcast further carries a universally unique identifier UUID, where the UUID indicates that the BLE broadcast is used for device discovery; the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when it is detected that the UUID indicates that the BLE broadcast is used for device discovery.
In one possible implementation, the BLE broadcast further carries first indication information indicating whether pairing can be performed; the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that pairing can be performed.
In one possible implementation, the BLE broadcast further carries second indication information indicating whether or not it can be connected; the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that the connection is available.
In a possible implementation manner, the first electronic device is specifically configured to display the device name of the second electronic device in the available device list when the signal strength of the BLE broadcast is greater than a first threshold.
In a possible implementation manner, the second electronic device is specifically configured to periodically send BLE broadcasts, and periodically enter an inquiry scan state; the inquiry scan state is used for the second electronic device to be discovered by a third electronic device, which supports classic bluetooth.
In this application embodiment, the second electronic device can search for the device supporting BLE through BLE broadcasting, and can search for the device supporting classic bluetooth through inquiry scan. In this way, the situation that classic Bluetooth devices cannot be found due to the fact that only BLE broadcasting is supported for searching is reduced, and therefore universality of Bluetooth searching is improved.
In a fourth aspect, the present application provides a first electronic device, which is characterized in that the first electronic device includes a bluetooth chip, a memory, a touch screen, and a processor; the memory is coupled with the processor; the Bluetooth chip supports a classic Bluetooth BR/EDR function and a low-power Bluetooth BLE function; the Bluetooth chip is used for starting a Bluetooth function and receiving a BLE broadcast from second electronic equipment, wherein the BLE broadcast carries an equipment address and an equipment name of the second electronic equipment; the processor is used for displaying the device name of the second electronic device in an available device list through the touch screen according to the BLE broadcast; the processor is also used for receiving an instruction for establishing Bluetooth connection with the second electronic equipment; the Bluetooth chip is further used for pairing the second electronic equipment according to the equipment address of the second electronic equipment and establishing Bluetooth connection with the second electronic equipment.
The first electronic device provided in the fourth aspect may start searching for the BLE broadcast when the bluetooth switch is turned on. The BLE broadcast can be searched by the first electronic equipment before the Bluetooth setting interface is displayed, so that the time for a user to wait for Bluetooth searching after the Bluetooth setting interface is displayed is reduced, and the Bluetooth searching efficiency is improved. In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
In one possible implementation, the BLE broadcast also carries a UUID, which indicates that the BLE broadcast is used for device discovery; the processor is specifically configured to, when it is detected that the UUID indicates that the BLE broadcast is used for device discovery, display, by the first electronic device, a device name of the second electronic device in an available device list.
In one possible implementation, the BLE broadcast further carries first indication information indicating whether pairing can be performed; the processor is specifically configured to display the device name of the second electronic device in an available device list when the first indication information indicates that pairing can be performed.
In one possible implementation, the BLE broadcast further carries second indication information indicating whether or not it can be connected; the processor is specifically configured to display the device name of the second electronic device in the available device list when the first indication information indicates that the connection is available.
In one possible implementation, the processor is specifically configured to display the device name of the second electronic device in an available device list when the signal strength of the BLE broadcast is greater than a first threshold.
In a fifth aspect, the present application provides a second electronic device comprising a bluetooth chip, a memory, and a processor; the memory is coupled with the processor; wherein, this bluetooth chip supports classic bluetooth BR EDR function and bluetooth low energy BLE function. The Bluetooth chip is used for sending a low-power consumption Bluetooth BLE broadcast, and the BLE broadcast carries the equipment address and the equipment name of the second electronic equipment. The Bluetooth chip is also used for receiving a connection request sent by the first electronic equipment. The Bluetooth chip is also used for Bluetooth pairing and Bluetooth connection with the Bluetooth chip of the first electronic device.
The second electronic device provided in the fifth aspect may enable the first electronic device to start searching for the BLE broadcast when the bluetooth switch is turned on. The BLE broadcast can be searched by the first electronic equipment before the Bluetooth setting interface is displayed, so that the time for a user to wait for Bluetooth searching after the Bluetooth setting interface is displayed is reduced, and the Bluetooth searching efficiency is improved. In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
In one possible implementation, the processor is configured to send an instruction to the bluetooth chip when the bluetooth function is turned on. And the Bluetooth chip can be specifically used for sending BLE broadcast when an instruction from a processor is detected.
In a possible implementation manner, after the first electronic device establishes a bluetooth connection with the second electronic device, the bluetooth chip is further configured to stop sending BLE broadcasts.
In a possible implementation manner, after the first electronic device establishes the bluetooth connection with the second electronic device, the bluetooth chip is further configured to initiate a paging page to the bluetooth chip of the first electronic device in the first time when detecting that the bluetooth connection is disconnected. The Bluetooth chip is further used for sending the BLE broadcast in a second time when connection with the first electronic equipment fails in a first time according to the initiated paging.
In a sixth aspect, the present application provides a chip system disposed on a first electronic device, where the chip system includes: bluetooth chip and treater. The Bluetooth chip is used for receiving BLE broadcast sent by the Bluetooth chip of the second electronic device. The BLE broadcast carries a device address and a device name of the second electronic device. The processor is also used for receiving an instruction for indicating the establishment of Bluetooth connection with the second electronic equipment; the Bluetooth chip is further used for pairing the second electronic equipment according to the equipment address of the second electronic equipment and establishing Bluetooth connection with the Bluetooth chip of the second electronic equipment.
In a seventh aspect, the present application provides a chip system disposed on a second electronic device, where the chip system includes: bluetooth chip and treater. The Bluetooth chip supports a classic Bluetooth BR/EDR function and a low-power Bluetooth BLE function. The Bluetooth chip is used for sending a low-power consumption Bluetooth BLE broadcast, and the BLE broadcast carries the equipment address and the equipment name of the second electronic equipment. The Bluetooth chip is also used for receiving a connection request sent by the first electronic equipment. The Bluetooth chip is also used for Bluetooth pairing and Bluetooth connection with the Bluetooth chip of the first electronic device.
In an eighth aspect, an embodiment of the present application provides a computer storage medium, which includes computer instructions, and when the computer instructions are executed on a first electronic device, the first electronic device is caused to perform any one of the above-described possible implementation manners of the second aspect, or a method in any one of the above-described possible implementation manners of the second aspect.
In a ninth aspect, the present application provides a computer program product, which when run on a computer, causes the computer to execute the method in any one of the above-mentioned possible implementation manners of the second aspect, or in any one of the above-mentioned possible implementation manners of the second aspect.
It is understood that the chip system provided in the sixth aspect, the chip system provided in the seventh aspect, the computer storage medium provided in the eighth aspect, and the computer storage medium provided in the ninth aspect are all used to execute the method provided in the embodiments of the present application. Therefore, the beneficial effects achieved by the method can refer to the beneficial effects in the corresponding method, and are not described herein again.
Drawings
Fig. 1 is a schematic architecture diagram of a bluetooth system 10 according to an embodiment of the present application;
fig. 2A is a schematic structural diagram of a first electronic device 100 provided in the embodiment of the present application;
fig. 2B is a schematic diagram of a bluetooth protocol framework provided in an embodiment of the present application;
fig. 3 schematically illustrates a structural diagram of a second electronic device 200 provided in an embodiment of the present application;
FIG. 4 is a diagram of frequency hopping in the prior art;
FIG. 5 is a schematic diagram of frequency hopping provided by an embodiment of the present application;
FIGS. 6A-6I are schematic diagrams of some user interfaces provided by embodiments of the present application;
FIGS. 7A-7E are schematic diagrams of some user interfaces provided by embodiments of the present application;
fig. 8 is a flowchart illustrating a bluetooth searching method according to an embodiment of the present application;
figure 9 is a schematic diagram of a format of a BLE broadcast provided in an embodiment of the present application;
fig. 10 is a timing diagram of broadcast and call scanning of a second electronic device 200 according to an embodiment of the present application;
fig. 11 is a schematic flowchart of a search method provided in an embodiment of the present application;
fig. 12 is a timing diagram of broadcasting and calling of a second electronic device 200 according to an embodiment of the present application;
fig. 13 is a timing diagram of broadcast, call scan, and query scan of a second electronic device 200 according to an embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present application will be described in detail and removed with reference to the accompanying drawings. In the description of the embodiments herein, "/" means "or" unless otherwise specified, for example, a/B may mean a or B; "and/or" in the text is only an association relationship describing an associated object, and means that three relationships may exist, for example, a and/or B may mean: three cases of a alone, a and B both, and B alone exist, and in addition, "a plurality" means two or more than two in the description of the embodiments of the present application.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of embodiments of the application, unless stated otherwise, "plurality" means two or more.
A system architecture provided by the embodiments of the present application is described below.
Please refer to fig. 1 and fig. 1, which are schematic structural diagrams of a bluetooth system 10 according to an embodiment of the present application. As shown in fig. 1, the bluetooth system 10 may include: a first electronic device 100 and a second electronic device 200.
The first electronic device 100 and the second electronic device 200 may communicate via bluetooth technology, including classic bluetooth BR/EDR (Basic Rate/Enhanced Data Rate) and Bluetooth Low Energy (BLE).
The first electronic device 100 may be a terminal device supporting a bluetooth function, such as a mobile phone, a notebook computer, a palm computer, or the like. The second electronic device 200 may also be a terminal device supporting a bluetooth function, such as a mobile phone, a notebook computer, a palm computer, or the like. The second electronic device 200 may also be a peripheral device supporting a bluetooth function, such as a wireless headset, a smart speaker, a smart watch, and the like.
Fig. 2A shows a schematic structural diagram of the first electronic device 100.
The first electronic device 100 will be specifically described below. It should be understood that the first electronic device 100 shown in fig. 2A is only one example, and the first electronic device 100 may have more or fewer components than shown in fig. 2A, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The first electronic device 100 may include: the mobile terminal includes a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a Subscriber Identity Module (SIM) card interface 195, and the like. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
Processor 110 may include one or more processing units, such as: the processor 110 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a memory, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
Wherein the controller may be a neural center and a command center of the first electronic device 100. The controller can generate an operation control signal according to the instruction operation code and the timing signal to complete the control of instruction fetching and instruction execution.
A memory may also be provided in processor 110 for storing instructions and data.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) 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.
The I2C interface is a bi-directional synchronous serial bus that includes a serial data line (SDA) and a Serial Clock Line (SCL).
The I2S interface may be used for audio communication. In some embodiments, processor 110 may include multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170.
The PCM interface may also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled by a PCM bus interface.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 110 with the wireless communication module 160.
MIPI interfaces may be used to connect processor 110 with peripheral devices such as display screen 194, camera 193, and the like. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, and the like.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like.
It should be understood that the connection relationship between the modules according to the embodiment of the present invention is only illustrative, and does not limit the structure of the first electronic device 100. In other embodiments of the present application, the first electronic device 100 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The charging management module 140 is configured to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger via the USB interface 130.
The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like.
The wireless communication function of the first electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the first electronic device 100 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including wireless communication of 2G/3G/4G/5G, etc. applied to the first electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a Low Noise Amplifier (LNA), and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then passes the demodulated low frequency baseband signal to a baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional modules, independent of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the first electronic device 100, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), BR/EDR, BLE, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR), and the like. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, the antenna 1 of the first electronic device 100 is coupled to the mobile communication module 150 and the antenna 2 is coupled to the wireless communication module 160 so that the first electronic device 100 can communicate with networks and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), General Packet Radio Service (GPRS), code division multiple access (code division multiple access, CDMA), Wideband Code Division Multiple Access (WCDMA), time-division code division multiple access (time-division code division multiple access, TD-SCDMA), Long Term Evolution (LTE), BR/EDR (Basic Rate/Enhanced Rate), GNSS, WLAN, NFC, FM, and/or IR technologies, etc. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The first electronic device 100 implements the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and an application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
The display screen 194 is used to display images, video, and the like. The display screen 194 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-oeld, a quantum dot light-emitting diode (QLED), and the like.
The first electronic device 100 may implement a photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, the application processor, and the like.
The ISP is used to process the data fed back by the camera 193. For example, when a photo is taken, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converting into an image visible to naked eyes.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image to the photosensitive element. The photosensitive element may be a Charge Coupled Device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The light sensing element converts the optical signal into an electrical signal, which is then passed to the ISP where it is converted into a digital image signal. And the ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into image signal in standard RGB, YUV and other formats. In some embodiments, the first electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process digital image signals and other digital signals. For example, when the first electronic device 100 selects a frequency bin, the digital signal processor is used to perform fourier transform or the like on the frequency bin energy.
Video codecs are used to compress or decompress digital video. The first electronic device 100 may support one or more video codecs. In this way, the first electronic device 100 can play or record video in a plurality of encoding formats, such as: moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and the like.
The NPU is a neural-network (NN) computing processor that processes input information quickly by using a biological neural network structure, for example, by using a transfer mode between neurons of a human brain, and can also learn by itself continuously. The NPU may implement applications such as intelligent recognition of the first electronic device 100, for example: image recognition, face recognition, speech recognition, text understanding, and the like.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the first electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music, video, etc. are saved in an external memory card.
The internal memory 121 may be used to store computer-executable program code, which includes instructions. The processor 110 executes various functional applications and data processing of the first electronic device 100 by executing instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area may store data (such as audio data, a phone book, etc.) created during the use of the first electronic device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like.
The first electronic device 100 can implement an audio function through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or some functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also called a "horn", is used to convert the audio electrical signal into an acoustic signal. The first electronic device 100 can listen to music through the speaker 170A or listen to a hands-free call.
The receiver 170B, also called "earpiece", is used to convert the electrical audio signal into an acoustic signal. When the first electronic device 100 receives a call or voice information, it can receive voice by placing the receiver 170B close to the ear of the person.
The microphone 170C, also referred to as a "microphone," is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can input a voice signal to the microphone 170C by speaking the user's mouth near the microphone 170C. The first electronic device 100 may be provided with at least one microphone 170C.
The headphone interface 170D is used to connect a wired headphone. The headset interface 170D may be the USB interface 130, or may be a 3.5mm open mobile platform (OMTP) standard interface, a cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The pressure sensor 180A is used for sensing a pressure signal, and converting the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A may be disposed on the display screen 194. The pressure sensor 180A can be of a wide variety, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, and the like. The capacitive pressure sensor may be a sensor comprising at least two parallel plates having an electrically conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The first electronic device 100 determines the intensity of the pressure from the change in capacitance. When a touch operation is applied to the display screen 194, the first electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The first electronic device 100 may also calculate the touched position from the detection signal of the pressure sensor 180A. In some embodiments, the touch operations that are applied to the same touch position but different touch operation intensities may correspond to different operation instructions.
The gyro sensor 180B may be used to determine the motion attitude of the first electronic device 100. In some embodiments, the angular velocity of the first electronic device 100 about three axes (i.e., x, y, and z axes) may be determined by the gyroscope sensor 180B. The gyro sensor 180B may be used for photographing anti-shake.
The air pressure sensor 180C is used to measure air pressure. In some embodiments, the first electronic device 100 calculates altitude, aiding positioning and navigation from the barometric pressure value measured by the barometric pressure sensor 180C.
The magnetic sensor 180D includes a hall sensor. The first electronic device 100 may detect the opening and closing of the flip holster using the magnetic sensor 180D. In some embodiments, when the first electronic device 100 is a flip, the first electronic device 100 may detect the opening and closing of the flip according to the magnetic sensor 180D. And then according to the opening and closing state of the leather sheath or the opening and closing state of the flip cover, the automatic unlocking of the flip cover is set.
The acceleration sensor 180E may detect the magnitude of acceleration of the first electronic device 100 in various directions (typically three axes). The magnitude and direction of gravity can be detected when the first electronic device 100 is stationary. The method can also be used for recognizing the terminal gesture, and is applied to horizontal and vertical screen switching, pedometers and other applications.
A distance sensor 180F for measuring a distance. The first electronic device 100 may measure the distance by infrared or laser. In some embodiments, shooting a scene, the first electronic device 100 may utilize the distance sensor 180F to range to achieve fast focus.
The proximity light sensor 180G may include, for example, a Light Emitting Diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The first electronic device 100 emits infrared light to the outside through the light emitting diode. The first electronic device 100 detects infrared reflected light from a nearby object using a photodiode. When sufficient reflected light is detected, it can be determined that there is an object near the first electronic device 100. When insufficient reflected light is detected, the first electronic device 100 may determine that there is no object near the first electronic device 100. The first electronic device 100 can utilize the proximity light sensor 180G to detect that the user holds the first electronic device 100 close to the ear for talking, so as to automatically turn off the screen to achieve the purpose of saving power. The proximity light sensor 180G may also be used in a holster mode, a pocket mode automatically unlocks and locks the screen.
The ambient light sensor 180L is used to sense the ambient light level. The first electronic device 100 may adaptively adjust the brightness of the display screen 194 according to the perceived ambient light level. The ambient light sensor 180L may also be used to automatically adjust the white balance when taking a picture. The ambient light sensor 180L may also cooperate with the proximity light sensor 180G to detect whether the first electronic device 100 is in a pocket, so as to prevent accidental touch.
The fingerprint sensor 180H is used to collect a fingerprint. The first electronic device 100 can utilize the collected fingerprint characteristics to unlock the fingerprint, access the application lock, photograph the fingerprint, answer an incoming call with the fingerprint, and the like.
The temperature sensor 180J is used to detect temperature. In some embodiments, the first electronic device 100 executes a temperature processing strategy using the temperature detected by the temperature sensor 180J. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the first electronic device 100 performs a performance reduction on a processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the first electronic device 100 heats the battery 142 to avoid the abnormal shutdown of the first electronic device 100 caused by the low temperature. In other embodiments, when the temperature is lower than a further threshold, the first electronic device 100 performs boosting on the output voltage of the battery 142 to avoid abnormal shutdown due to low temperature.
The touch sensor 180K is also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor can communicate the detected touch operation to the application processor to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194.
The bone conduction sensor 180M may acquire a vibration signal. In some embodiments, the bone conduction sensor 180M may acquire a vibration signal of the human vocal part vibrating the bone mass. The bone conduction sensor 180M may also contact the human pulse to receive the blood pressure pulsation signal. In some embodiments, the bone conduction sensor 180M may also be disposed in a headset, integrated into a bone conduction headset. The audio module 170 may analyze a voice signal based on the vibration signal of the bone mass vibrated by the sound part acquired by the bone conduction sensor 180M, so as to implement a voice function. The application processor can analyze heart rate information based on the blood pressure beating signal acquired by the bone conduction sensor 180M, so as to realize the heart rate detection function.
The keys 190 include a power-on key, a volume key, and the like. The keys 190 may be mechanical keys. Or may be touch keys. The first electronic device 100 may receive a key input, and generate a key signal input related to user setting and function control of the first electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration cues, as well as for touch vibration feedback. For example, touch operations applied to different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also respond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenes (such as time reminding, receiving information, alarm clock, game and the like) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
Indicator 192 may be an indicator light that may be used to indicate a state of charge, a change in charge, or a message, missed call, notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the first electronic device 100 by being inserted into the SIM card interface 195 or being pulled out of the SIM card interface 195. The first electronic device 100 may support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The first electronic device 100 interacts with the network through the SIM card to implement functions such as a call and data communication. In some embodiments, the first electronic device 100 employs esims, namely: an embedded SIM card. The eSIM card may be embedded in the first electronic device 100 and cannot be separated from the first electronic device 100.
As shown in fig. 2B, the embodiment of the present application provides a schematic diagram of a bluetooth protocol framework, including but not limited to a Host protocol stack, a HCI (Host Controller Interface), and a Controller (Controller).
The Host protocol stack defines a plurality of applications (profiles) and a core protocol (protocol) in a bluetooth framework, each profile defines a respective corresponding message format and Application rule, and the profile is a bluetooth service (Application). In order to realize interconnection and intercommunication of different devices under different platforms, the bluetooth protocol is a specification formulated for various possible and generally meaningful application scenarios, such as A2DP (advanced audio distribution profile), HFP (wings-free profile), and the like. The core Protocol includes, but is not limited to, a bluetooth basic Service Protocol SDP (Service discovery Protocol), a Logical Link Control and Adaptation Protocol L2CAP (Logical Link Control and Adaptation Protocol), and the like. The core protocol is essential in the bluetooth protocol stack.
The HCI provides a unified interface entering a link manager and a unified mode entering a baseband for an upper layer protocol, a plurality of transmission layers exist between a host core protocol stack and a controller, the transmission layers are transparent and complete a data transmission task, and a Bluetooth technical alliance (SIG) specifies four physical bus modes connected with hardware, namely four HCI transmission layers, namely USB, RS232, UART and PC cards.
The controller defines a bottom hardware part, including a Radio Frequency (RF), a baseband (BB) and a Link Management (LM), and the RF layer implements filtering and transmission of a data bit stream through microwaves in an ISM band that does not require authorization at 2.4GHz, and mainly defines conditions that a bluetooth transceiver needs to meet in the frequency band for normal operation. The baseband is responsible for frequency hopping and transmission of bluetooth data and information frames. The link management is responsible for connecting, establishing and removing links and performing security control. The LM (Link Manager) layer is a Link management layer protocol of the bluetooth protocol stack, and is responsible for translating an upper layer HCI command into an operation acceptable by a baseband, establishing an asynchronous Link-oriented Link (ACL) and a synchronous Link-oriented/extended (SCO), and entering a second electronic device into an operating mode in a power saving state, and the like. The LC (Link Control) layer is responsible for responding to upper layer LM commands (e.g., LM commands that perform functions such as establishing a transport Link for packets, maintaining a Link, etc.) during the transmission of a batch of packets.
The method according to the embodiment of the present application is implemented by the wireless communication module 160 of the first electronic device 100 shown in fig. 2A, and may be specifically executed by a bluetooth module or a bluetooth chip.
In this embodiment, when the second electronic device 200 is a mobile phone, a notebook computer or a palm computer, the schematic structural diagram of the second electronic device may be similar to the first electronic device 100, and details thereof are not repeated here. When the second electronic device 200 is a wireless earphone, a smart speaker, a smart watch, or the like, the structural diagram of the second electronic device 200 refers to fig. 3.
Fig. 3 schematically shows a structural diagram of a second electronic device 200 provided in an embodiment of the present application.
The second electronic device 200 is taken as an example to specifically describe the embodiment. It should be understood that the second electronic device 200 shown in fig. 3 is only one example, and the second electronic device 200 may have more or less components than those shown in fig. 3, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits,
as shown in fig. 3, the second electronic device 200 may include: the device comprises a processor 201, a memory 202, a Bluetooth communication module 203, an antenna 204, a power switch 205, a USB communication processing module 206 and an audio module 207. Wherein:
the processor 201 is operable to read and execute computer readable instructions. In particular implementations, the processor 201 may mainly include a controller, an operator, and a register. The controller is mainly responsible for instruction decoding and sending out control signals for operations corresponding to the instructions. The arithmetic unit is mainly responsible for storing register operands, intermediate operation results and the like temporarily stored in the instruction execution process. In a specific implementation, the hardware architecture of the processor 201 may be an Application Specific Integrated Circuit (ASIC) architecture, a MIPS architecture, an ARM architecture, or an NP architecture, etc.
In some embodiments, the processor 201 may be configured to parse a signal received by the bluetooth communication processing module 203, such as a pairing mode modification request sent by the first electronic device 100, and so on. The process 201 may be used to perform corresponding processing operations according to the parsing result, such as generating a pairing mode modification response, and the like.
A memory 202 is coupled to the processor 201 for storing various software programs and/or sets of instructions. In particular implementations, memory 202 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other non-volatile solid-state storage devices. The memory 202 may store an operating system, such as an embedded operating system like uCOS, VxWorks, RTLinux, etc. The memory 202 may also store a communication program that may be used to communicate with the first electronic device 100, one or more servers, or other devices.
The bluetooth communication module 203A may include a classic bluetooth (BR/EDR) module and a Bluetooth Low Energy (BLE) module.
In some embodiments, the bluetooth communication module 203A may listen to signals, such as probe requests, scan signals, etc., transmitted by other devices (such as the first electronic device 100) and may send response signals, scan responses, etc., so that the other devices (such as the first electronic device 100) may discover the second electronic device 200 and establish wireless communication connections with the other devices (such as the first electronic device 100) to communicate with the other devices (such as the first electronic device 100) through bluetooth.
In other embodiments, the bluetooth communication module 203 may also transmit a signal, such as a broadcast BLE signal, so that other devices (e.g., the first electronic device 100) may discover the second electronic device 200 and establish a wireless communication connection with other devices (e.g., the first electronic device 100) to communicate with other devices (e.g., the first electronic device 100) via bluetooth.
The wireless communication function of the second electronic device 200 may be implemented by the antenna 204, the bluetooth communication module 203, the modem processor, and the like.
Antenna 204 may be used to transmit and receive electromagnetic wave signals. Each antenna in the second electronic device 200 may be used to cover a single or multiple communication bands.
There may be one or more antennas of the bluetooth communication module 203 in some embodiments.
The power switch 205 may be used to control the power supply of the power source to the second electronic device 200.
The USB communication processing module 206 may be used to communicate with other devices through a USB interface (not shown).
The audio module 26 is configured to output an audio signal through the audio output interface, such that the second electronic device 200 supports audio playback. The audio module may also be configured to receive audio data via the audio input interface. The second electronic device 200 may be a media playing device such as a bluetooth headset.
In some embodiments, the second electronic device 200 may further include a display screen (not shown), wherein the display screen may be used to display images, prompts, and the like. The display screen may be a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED) display screen, an active-matrix organic light-emitting diode (AMOLED) display screen, a flexible light-emitting diode (FLED) display screen, a quantum dot light-emitting diode (QLED) display screen, or the like.
In some embodiments, the second electronic device 200 may also include a serial interface such as an RS-232 interface. The serial interface may be connected to other devices, such as an audio player device, such as a speaker, so that the second electronic device 200 and the audio player device cooperate to play audio and video.
It is to be understood that the structure illustrated in fig. 3 does not constitute a specific limitation of the second electronic device 200. In other embodiments of the present application, the second electronic device 200 may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In the method provided in the embodiment of the application, the bluetooth protocol framework used by the second electronic device 200 may refer to the bluetooth protocol framework shown in fig. 2B, which is not described herein again.
To establish a bluetooth connection between the first electronic device 100 and the second electronic device 200, the first electronic device 100 may perform a bluetooth search using classic bluetooth and display the name of the discovered device. Specifically, in the bluetooth search, the first electronic device 100 may hop over 32 channels to transmit a broadcast, and the second electronic device 200 hops over the 32 channels to receive the broadcast.
Referring to fig. 4, fig. 4 is a diagram illustrating frequency hopping in the prior art. As shown in fig. 4, the first electronic device 100 and the second electronic device 200 perform bluetooth search using 32 frequency points in the 2.402GHz to 2.480GHz band as channels. The first electronic device 100 may act as a searching device and select a new channel from the 32 channels to perform a query (inquiry), i.e. to transmit a query hopping sequence, every 312.5 microseconds. The second electronic device 200 may be a searched device, and a new channel is selected from 32 channels for query scan (inquirycan) every 1.28 seconds. When the inquiry hopping sequence is scanned, the second electronic device 200 transmits an inquiry response sequence. When the channel where the first electronic device 100 performs the query is the same as the channel where the second electronic device 200 performs the query scan, the first electronic device 100 may receive the query response sequence transmitted by the second electronic device 200 and display the device name of the second electronic device 200.
However, in the bluetooth search method described above, the first electronic device 100 and the second electronic device 200 each transmit and receive a broadcast by hopping frequencies over 32 channels, respectively, and the number of channels is large, so that there is a case where both devices do not hop to the same channel. When the two devices do not respectively transmit and receive broadcasts on the same channel, the first electronic device 100 cannot find the second electronic device 200, thereby increasing the time for bluetooth search and reducing the efficiency of bluetooth search.
In order to improve the bluetooth search efficiency, the embodiment of the application provides a bluetooth search method. In the bluetooth search method, the second electronic device 200 may transmit a BLE broadcast, which may carry a device name, a device address, and a device type. The first electronic device 100 may start to listen to BLE broadcast when the bluetooth switch is turned on, and display the device name and the device type carried in BLE broadcast after receiving BLE broadcast sent by the second electronic device 200, referring to the device option 409 in the interface described in fig. 6D.
In the bluetooth searching method provided in the embodiment of the present application, the second electronic device 200 may only hop frequencies on 3 channels (BLE broadcast channel 37, BLE broadcast channel 38, and BLE broadcast channel 39) to transmit BLE broadcasts, and the first electronic device 100 also listens to BLE broadcasts on the 3 channels.
Specifically, please refer to fig. 5, fig. 5 is a schematic diagram of frequency hopping according to an embodiment of the present application. As shown in fig. 5, the first electronic device 100 and the second electronic device 200 perform bluetooth searches using 3 channels in the 2.402 GHz-2.480 GHz band. The frequency corresponding to the BLE broadcast channel 37 is 2.402GHz, the frequency corresponding to the BLE broadcast channel 38 is 2.426GHz, and the frequency corresponding to the BLE broadcast channel 39 is 2.480 GHz. Since the first electronic device 100 hops over the 3 channels to transmit and BLE broadcasts, the second electronic device 200 hops over the 3 channels to receive BLE broadcasts, the number of channels is reduced compared to the inquiry procedure in the conventional classical bluetooth. Therefore, the time of Bluetooth searching can be reduced, and the efficiency of Bluetooth searching is improved.
A schematic user interface diagram of a bluetooth search method according to an embodiment of the present application is described below.
In this embodiment of the application, the first electronic device 100 starts to monitor BLE broadcast when detecting that the bluetooth switch is turned on. The following presents a schematic view of the user interface involved in the bluetooth switch activation. Referring to fig. 6A to 6I, fig. 6A to 6I are schematic diagrams of some user interfaces provided in an embodiment of the present application.
As shown in fig. 6A, the first electronic device 100 may display the home screen interface 10. The interface 10 includes an application icon 101, a status bar 102, and a navigation bar 103. Wherein:
the application icon 101 may include icons of other applications, such as an icon of Wechat (Wechat), a tweet (Twitter), a Facebook (Facebook), a microblog (Sina Weibo), a QQ (Tencent QQ), a YouTube (YouTube), a Gallery (Gallery), a camera (camera), and a setting icon 1011, and the like, which are not limited in this embodiment of the present invention. The icon of any one of the applications may be used to respond to a user operation, such as a touch operation, so that the first electronic device 100 starts the application corresponding to the icon.
The name of the operator (e.g., china mobile), time, WI-FI icon, signal strength, and current remaining power may be included in the status bar 102.
The navigation bar 103 may include: a return button 1031, a home screen button 1032, an outgoing call task history button 1033, and the like. Here, the home screen interface 10 is an interface displayed by the first electronic device 100 after any one of the user interfaces detects a user operation on the home interface key 1032. When it is detected that the user clicks the return button 1031, the first electronic device 100 may display a user interface previous to the current user interface. When the user is detected to click on the home interface key 1052, the first electronic device 100 may display the home screen interface 10. When it is detected that the user clicks the outgoing job history key 1033, the first electronic device 100 may display the job that the user has recently opened. The names of the navigation keys may also be other keys, for example, 1031 may be called Back Button, 1032 may be called Home Button, 1033 may be called Menu Button, and the application is not limited thereto. Each navigation key in the navigation bar 103 is not limited to a virtual key, and may be implemented as a physical key.
First electronic device 100 may receive a sliding operation (e.g., sliding down from the position of status bar 102) applied to status bar 102, and in response to the sliding operation applied to status bar 102, first electronic device 100 may display window menu 50 as shown in fig. 6B.
As shown in fig. 6B, the window menu 50 may include switch controls for some functions (e.g., a WLAN switch control, a bluetooth switch 501, a flashlight switch control, a reminder switching control, an automatic rotation switch control, a huacheng sharing switch control, a flight mode switch control, a mobile data switch control, a positioning switch control, a screen capture switch control, an eye protection mode switch control, a hotspot switch control, a screen recording switch control, a large screen projection control, an NFC switch control, etc.).
The first electronic device 100 may receive a user operation (e.g., a click operation) applied to the bluetooth switch 501, and in response to the user operation applied to the bluetooth switch 501, the first electronic device 100 may turn on the bluetooth function.
As shown in fig. 6B and 6C, the bluetooth switch 501 is in an off state. In response to the user operation acting on the bluetooth switch 501, after the first electronic device 100 starts the bluetooth function, the bluetooth switch 501 may be switched to the on state for prompting the user that the current bluetooth function is started. After the bluetooth function is turned on, the first electronic device 100 may background search for bluetooth broadcasts (including BLE broadcasts and classic bluetooth broadcasts) of other devices and record the searched broadcasts.
As shown in fig. 6C and 6D, in response to the long-press operation acting on the bluetooth switch 501, the first electronic device 100 may display the bluetooth setting interface 40, as shown in fig. 6D, where the bluetooth setting interface 40 includes a bluetooth switch 401, a device name entry 402, a received file entry 403, a scan control 404, a help control 405, and a paired device list 406. The bluetooth switch 401 may be configured to receive an operation (e.g., a single click operation) from a user, and trigger the first electronic device 100 to turn on/off a bluetooth function.
For example, when the bluetooth switch 401 is currently in the on state, the first electronic device 100 may receive a user operation (e.g., a click operation) acting on the bluetooth switch 401, and in response to the user operation acting on the bluetooth switch 401, the first electronic device 100 may turn off the bluetooth function.
One or more paired device options may be included in the paired device list 406, such as a "HUAWEI AM 08" device option, a "HUAWEI Mate 20" device option, and so on. Wherein the "huabei AM 08" device option contains a device name 4061a and a device type indication 4061 b. The device name 4061a indicates "huabei AM 08", and the device type indication 4061b indicates that the device type is a headphone. The "huabei Mate 20" device option contains a device name 4062a and a device type indication 4061 b. The device name 4062a indicates "huabei Mate 20", and the device type 4062b indicates that the device type is a handset. The first electronic device 100 may display the device options of the paired bluetooth devices in the paired device list 406.
Here, each search of the first electronic device 100 may be limited to a period of time (e.g., 5 seconds), that is, the first electronic device stops searching 5 seconds after the bluetooth function is turned on. After the first electronic device 100 stops searching, the first electronic device 100 may receive a user operation (e.g., a click operation) applied to the scan control 404, and in response to the user operation applied to the scan control 404, the first electronic device 100 may search for a bluetooth broadcast of another device again.
The first electronic device 100 may also display a list of available devices 408 on the bluetooth settings interface 40 when the first electronic device 100 stops searching. The available device list 408 includes device options corresponding to the bluetooth broadcast received by the first electronic device 100. When the first electronic device 100 does not stop searching, the first electronic device 100 may further display a scan prompt 407 on the bluetooth settings interface 40 for prompting that the first electronic device 100 is currently scanning for available devices. Regarding the search hint 407, reference may be made to the embodiment described below in FIG. 7D.
In the embodiment of the present application, the device name of the second electronic device 200 may be "huaweii Free bugs". The second electronic device 200 may send out a BLE broadcast after the bluetooth function is turned on, where the BLE broadcast includes a device address, a device name, and a device type of the second electronic device 200, and the like.
When the first electronic device 100 scans the BLE broadcast of the second electronic device 200, the first electronic device 100 may display the device option of the second electronic device 200 in the available device list 408 according to the BLE broadcast.
Illustratively, as shown in fig. 6D, the first electronic device 100 stops searching for the bluetooth broadcast. The first electronic device 100 may display the device option 409 of the second electronic device 200 in the available device list 408. The device option 409 of the second electronic device 200 includes a device name 409a and a device type 409b of the second electronic device. The device name 409a indicates "HUAWEI Free bugs" and the device type 409b indicates headphones.
Optionally, the BLE broadcast transmitted by the second electronic device 200 may also carry information about whether pairing can be performed and/or information about whether connection can be performed. When the first electronic device 100 detects that the received BLE broadcast up mode information indicates that pairing can be performed and connection can be performed, the device option of the second electronic device 200 may be displayed. When the first electronic device 100 detects that the received BLE broadcast up mode information indicates that pairing cannot be performed or connection cannot be performed, the device option of the second electronic device 200 is not displayed. BLE broadcasts may also carry UUID information to indicate that the BLE broadcast is used for device discovery.
In the prior art, bluetooth searching is performed by using classic bluetooth, and when the electronic device displays the bluetooth setting interface 40 or detects a click operation on the scan control 404, the electronic device will start searching for bluetooth broadcasts of other devices. In this embodiment, the first electronic device 100 may start to search for BLE broadcast when the bluetooth switch is turned on. Compared with the prior art, the first electronic device 100 can search for BLE broadcasts before displaying the bluetooth setting interface 40, so that the time for a user to wait for bluetooth searching after displaying the bluetooth setting interface 40 is reduced, and the bluetooth searching efficiency is improved.
In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
The first electronic device 100 may receive a user operation (e.g., a click operation) applied to the device option 409, and in response to the user operation applied to the device option 409, the first electronic device 100 may perform a classic bluetooth pairing procedure and a classic bluetooth connection procedure with the second electronic device 200.
The following describes the user interfaces involved in the classic bluetooth pairing procedure and classic bluetooth connection procedure. As shown in fig. 6E, the first electronic device 100 may output a prompt to be paired (e.g., display the word "being paired …" in the device option 409) after receiving a user action on the device option 409 and before classic bluetooth pairing is not completed.
As shown in fig. 6F, after the first electronic device 100 and the second electronic device 200 are successfully paired, the first electronic device 100 may display a device option 4063 of the second electronic device 200 in the paired device list 406, where the device option 4063 includes a device name 4063a and a device type 4063b, and indicates that the device type is a mobile phone. The device name 4063a indicates "HUAWEI Free bugs" and the device type 4063b indicates that the device type is a headphone.
After the first electronic device 100 is successfully paired with the second electronic device 200, the first electronic device 100 may establish a classic bluetooth connection with the second electronic device 200.
After the first electronic device 100 establishes the bluetooth connection with the second electronic device 200, the first electronic device 100 may display a connected prompt message on the device option 4063 for prompting the user that the first electronic device 100 has established the classic bluetooth connection with the second electronic device 200.
The classic bluetooth connection established between the first electronic device 100 and the second electronic device 200 may be triggered by the user. For example, after the first electronic device 100 successfully pairs with bluetooth, the first electronic device 100 may display the check code interface. In response to the user operation, the electronic device 100 may establish a classic bluetooth connection with the second electronic device 200 when the check code is successfully checked.
For example, as shown in fig. 6G, the connected prompt information displayed on the device option 4063 by the first electronic device 100 may be a text message of "audio connected for conversation and media", or the like.
As shown in fig. 6H, after establishing the classic bluetooth connection with the second electronic device 200, the first electronic device 100 may prompt the device name of the connected bluetooth device, i.e., the device name of the second electronic device 200 (e.g., "hua wei Free bugs") at the bluetooth switch 501 in the window menu 50.
In some embodiments of the present application, when BLE broadcast is searched after the bluetooth function is turned on, the device name carried by the BLE broadcast may be displayed in the notification bar. When the first electronic device 100 searches for a BLE broadcast transmitted by the second electronic device 200, the first electronic device 100 may determine whether the second electronic device 200 has been paired with the first electronic device 100 according to a device address in the BLE broadcast.
As shown in fig. 6I, if the second electronic device 200 is not paired with the first electronic device 100, the first electronic device 100 may display a notification bar 60 below the window menu 50. The notification bar 60 displays the device name carried by the BLE broadcast, i.e., the device name of the second electronic device 200 (e.g., "huaweii Free bugs"). The first electronic device 100 may receive a user operation, such as a click operation, applied to the notification bar 60, and in response to the user operation applied to the notification bar 60, the first electronic device 100 may display the bluetooth setting interface 40 shown in fig. 6D. If the second electronic device 200 has been paired with the first electronic device 100, the first electronic device 100 can establish a classic bluetooth connection with the second electronic device 200.
In the embodiment of the present application, the bluetooth switch is not limited to be turned on in response to a user operation on the window menu 50, and may be turned on in response to a user operation on the bluetooth setting interface 40. Referring to fig. 7A to 7E, fig. 7A to 7E are schematic diagrams of some user interfaces provided in an embodiment of the present application.
As shown in fig. 7A, the first electronic device 100 may receive a user operation (e.g., a click operation) acting on the setting icon 1011, and in response to the user operation acting on the setting icon 1011, the first electronic device 100 may display the setting interface 20 shown in fig. 7A.
As shown in fig. 7A, the setting interface 20 includes a plurality of setting items: wireless and network entries, device connection entries 201, application and notification entries, battery entries, display entries, voice entries, storage entries, security and privacy entries, user and account entries, and the like.
The first electronic device 100 may receive a user operation (e.g., a click operation) acting on the device connection entry 201, and in response to the user operation acting on the device connection entry 201, the first electronic device 100 may display the device connection interface 30 as shown in fig. 7B.
As shown in fig. 7B, the device connection interface 30 includes a plurality of setting items: bluetooth entry 301, NFC entry, Huawei Beam entry, Huawei Share entry, cell phone screen cast entry, USB entry, print entry, and the like.
The first electronic device 100 may receive a user operation (e.g., a click operation) applied to the bluetooth entry 301 by the user, and in response to the user operation applied to the bluetooth entry 301, the first electronic device 100 may display the bluetooth setting interface 40 as shown in fig. 7C.
As shown in fig. 7C, the bluetooth setup interface 40 includes a bluetooth switch 401, a device name entry 402, a received file entry 403, a scan control 404, and a help control 405. The bluetooth switch 401 may be configured to receive an operation (e.g., a single click operation) from a user, and trigger the first electronic device 100 to turn on/off a bluetooth function.
For example, when the bluetooth switch 401 is currently in the off state, the first electronic device 100 may receive a user operation (e.g., a click operation) acting on the bluetooth switch 401, and in response to the user operation acting on the bluetooth switch 401, the first electronic device 100 may turn on the bluetooth function.
As shown in fig. 7D, after the bluetooth function is turned on, the first electronic device 100 may further display a paired device list 406 and a search prompt 407 on the bluetooth setting interface 40.
Wherein, when the bluetooth function is turned on, the first electronic device 100 may search for bluetooth broadcasts (including BLE broadcasts and classic bluetooth broadcasts) of other devices. When the first electronic device 100 is searching for a bluetooth broadcast of another device, the first electronic device 100 may display the scan prompt 407 for prompting that the first electronic device 100 is currently searching for a bluetooth broadcast. When the first electronic device 100 stops searching for the bluetooth broadcast, the scan prompt 407 is no longer displayed on the bluetooth settings interface 40.
In the embodiment of the present application, the device name of the second electronic device 200 may be "huaweii Free bugs". The second electronic device 200 may send a BLE broadcast to the outside within a preset time after being powered on, where the BLE broadcast includes a device address, a device name, and a device type of the second electronic device 200, and the like.
When the first electronic device 100 searches for the BLE broadcast of the second electronic device 200, the first electronic device 100 may display the device option of the second electronic device 200 in the available device list 408.
For example, as shown in fig. 7E, when the first electronic device 100 determines that the second electronic device 200 is not paired with the first electronic device 100 according to the broadcast device address in the BLE broadcast of the second electronic device 200, the first electronic device 100 may display the device option 409 of the second electronic device 200 in the available device list 408. The drawings described with respect to the device options 409 and fig. 7E may refer to the description of fig. 6D and will not be repeated here.
The first electronic device 100 may receive a user operation (e.g., a click operation) applied to the device option 409, and in response to the user operation applied to the device option 409, the first electronic device 100 may perform a classic bluetooth pairing procedure and a classic bluetooth connection procedure with the second electronic device 200. Reference may be made specifically to the description of the drawings shown in fig. 6E-6H.
A bluetooth search method provided in the present application is specifically described below. Referring to fig. 8, fig. 8 is a flowchart illustrating a bluetooth searching method according to an embodiment of the present disclosure. As shown in fig. 8, the method includes steps S101 to S111.
S101, the second electronic device 200 transmits a BLE broadcast.
The BLE broadcast transmitted by the second electronic device 200 may carry a device name, a device address, and a device type (CoD). Wherein the device address the BLE broadcast may also carry information indicating whether it can be paired and/or information indicating whether it can be connected. The BLE broadcast may also carry a Universal Unique Identifier (UUID).
The device types may include a computer type, a mobile phone type, a network access point, an audio/video device (such as an earphone and the like), a human-computer interaction device (such as a mouse, a keyboard and the like), a printer, a digital camera and the like, a wearable device (such as glasses and the like) and a toy game type.
In this embodiment of the application, the BLE broadcast is not limited, and the second electronic device 200 may also carry data such as a bluetooth device name, a device address, a device type, and the like through a WI-Fi broadcast or other types of broadcasts, which is not limited in this embodiment of the application.
S102, the first electronic device 100 starts a bluetooth function, and searches for BLE broadcasts.
In the embodiment of the present application, the bluetooth function may be performed by the first electronic device 100 in response to a user operation. The user operation for turning on the bluetooth function may specifically refer to a user operation (e.g., a click operation) acting on the bluetooth switch 501 in fig. 6B, and may also refer to a user operation (e.g., a click operation) acting on the bluetooth switch 401 in fig. 7C. For details, reference may be made to the foregoing embodiments shown in fig. 6B and fig. 7C, which are not described herein again.
In this embodiment, the process of searching for BLE broadcasts may be that the first electronic device 100 searches for BLE broadcasts on a plurality of channels (e.g., BLE broadcast channel 37(2.402GHz), BLE broadcast channel 38(2.426GHz), BLE broadcast channel 39(2.480 GHz)). Here, the duration of the search by the first electronic device 100 on one BLE broadcast channel may be referred to as a scanning window, and the interval between the start times of two consecutive scanning windows may be referred to as a scanning interval. The scan window size for the first electronic device 100 to perform the bluetooth search is fixed (e.g., the scan window may take 10ms to 10.24s), and the scan interval is fixed (e.g., the scan interval may take 10ms to 10.24 s).
S103, the first electronic device 100 searches for the BLE broadcast transmitted by the second electronic device 200.
S104, the first electronic device 100 detects whether the second electronic device 200 can be paired or connected. If yes, go to step S105, otherwise go to step S106.
And S105, when detecting that the second electronic device 200 can be paired and connected, the first electronic device 100 displays the second device option in the available device list.
The second device option may include a device name and a device type of the electronic device 200. For example, the device options of the second electronic device 200 may refer to the device options 409 displayed in the available device list 408 in fig. 6D, may refer to the device options 409 displayed in the device list 408 in fig. 7E, may refer to the notification bar 60 in fig. 6I, and so on.
And S106, when detecting that the second electronic equipment 200 can not be paired or connected, ending. When it is detected that the second electronic device 200 cannot be paired or connected, the first electronic device 200 may also display a device option of the second electronic device and prompt the non-connectable device.
The first electronic device 100 may also continuously search for BLE broadcasts of other devices for a preset time.
When paired with the second electronic device 200, the first electronic device 100 does not need to be paired with the second electronic device 200 any more, and the first electronic device 100 displays the device option of the second electronic device 200 in the paired device list. The paired device list may refer to paired device list 406 in fig. 6D-6G.
S107, the first electronic device 100 receives click operation acting on the second device option in the available device list.
The clicking operation applied to the device option of the second electronic device 200 in the available device list may refer to the clicking operation applied to the device option 409 in the available device list 408 in fig. 6D, the clicking operation applied to the device option 409 in the available device list 408 in fig. 7E, and so on. For details, reference may be made to the foregoing embodiments, which are not described herein again.
And S108, responding to the click operation acted on the second equipment option, and pairing the second electronic equipment 200 by the first electronic equipment 100.
When the first electronic device 100 mates with the second electronic device 200, the first electronic device 100 displays the bluetooth setup interface 40 described in fig. 6E.
S109, the first electronic device 100 displays the second device option on the paired device list.
The device option of the second electronic device 200 displayed in the paired device list may refer to the device option 4063 in the paired device list 406 in the example described in fig. 6F, and is not described herein again.
S110, the first electronic device 100 and the second electronic device 200 establish a classic Bluetooth connection.
After the first electronic device 100 establishes the classic bluetooth connection with the second electronic device 200, the first electronic device 100 may display the bluetooth setup interface 40 described in fig. 6G. After the first electronic device 100 establishes the classic bluetooth connection with the second electronic device 200, the first electronic device 100 may also prompt the device name of the connected bluetooth device, i.e., the device name of the second electronic device 200 (e.g., "HUAWEI Free bugs") at the bluetooth switch 501 in the window menu 50 of fig. 6H.
In the bluetooth searching method provided in the embodiment of the present application, the first electronic device 100 may start to search for the BLE broadcast when the bluetooth switch is turned on. Compared with the prior art, the first electronic device 100 can search for BLE broadcasts before displaying the bluetooth setting interface 40, so that the time for a user to wait for bluetooth searching after displaying the bluetooth setting interface 40 is reduced, and the bluetooth searching efficiency is improved.
In addition, this application embodiment utilizes BLE broadcast to carry out bluetooth search, only carries out frequency hopping search on 3 channels, and it improves bluetooth search efficiency to utilize classic bluetooth to carry out bluetooth search among the prior art. And Bluetooth searching is executed by utilizing BLE broadcasting, so that power consumption is saved.
S111, the second electronic device 200 stops transmitting BLE broadcasts.
After establishing the bluetooth connection, the second electronic device 200 may stop BLE broadcasting. After the second electronic device 200 disconnects bluetooth, since the second electronic device 200 has been paired with the first electronic device 100, the second electronic device 100 may transmit BLE broadcast at a lower frequency than when not paired. When the second electronic device 100 is unpaired, the BLE broadcast is transmitted at a higher frequency than when paired. For example, when not paired, the second electronic device 200 transmits BLE broadcast at a frequency of 1Hz (with a period of 1000 milliseconds). When the paired unconnected state is established, the second electronic device 200 transmits BLE broadcast at a frequency of 0.5Hz (with a period of 2000 milliseconds). When the bluetooth connection has been established, the second electronic device 200 may stop BLE broadcasting.
The bluetooth search method described in fig. 8 is explained as follows.
When the first and second electronic devices 200 will transmit BLE broadcast
In the embodiment of the present application, the second electronic device 200 may be a mobile phone, a notebook computer, a palmtop computer, or the like, and may also be a peripheral device such as a wireless headset, a smart speaker, a smart watch, or the like. The following describes the case where the second electronic device transmits BLE broadcast in the above two scenarios.
(1) The second electronic device 200 is a mobile phone, a notebook computer or a palm computer
When the second electronic device 200 is a mobile phone, a notebook computer, or a handheld computer, the second electronic device 200 may send the BLE broadcast within a preset time (e.g., 5 minutes) after the bluetooth switch is turned on, and stop sending the BLE broadcast after the preset time. The description about the bluetooth switch may refer to the bluetooth switch 501 of fig. 6B and the bluetooth switch 401 in fig. 7C.
In another possible implementation, the second electronic device 200 may also transmit the BLE broadcast within a preset time (e.g., 5 minutes) after receiving a user operation (e.g., a click operation) applied to the scan control. For a description of the scan control, reference may be made to scan control 404 in fig. 6D-6G.
When the first electronic device 100 and the second electronic device 200 are both mobile phones, the first electronic device 100 may send a BLE broadcast and receive the BLE broadcast within a preset time after the bluetooth function is turned on, for example, within 1 minute after the bluetooth switch is turned on. After turning on the bluetooth function, the second electronic device 200 may also transmit BLE broadcasts and receive BLE broadcasts.
(2) The second electronic device 200 is a peripheral device such as a wireless earphone, a smart speaker, a smart watch, or the like
When the second electronic device 200 is a peripheral device such as a wireless headset, a smart speaker, a smart watch, etc., the second electronic device 200 may transmit the BLE broadcast within a preset time (e.g., 2 minutes) after being turned on, and may stop transmitting the BLE broadcast after the preset time. The second electronic device 200 may also transmit BLE broadcast in response to a specific operation (e.g., long pressing of the power key for more than 5 seconds) being detected.
In another possible implementation, the second electronic device 200 establishes a bluetooth connection with another electronic device (e.g., a third electronic device), and the second electronic device 200 stops transmitting the BLE broadcast.
When the second electronic device 200 is paired, the second electronic device 200 may transmit BLE broadcasts at a lower frequency than when not paired. When the second electronic device 100 is unpaired, the BLE broadcast is transmitted at a higher frequency than when paired. For example, when not paired, the second electronic device 200 transmits BLE broadcast at a frequency of 1Hz (with a period of 1000 milliseconds). When paired unconnected, the second electronic device 200 transmits BLE broadcasts at a frequency of 0.5Hz (2000 ms period), as described in relation to the timing diagrams provided in fig. 10 and 12.
Information description carried by BLE broadcast
(1) The BLE broadcast may carry information indicating that it may not be paired, information indicating that it may be paired
When the BLE broadcast carries information indicating that pairing cannot be performed, the first electronic device 100 cannot be paired with the second electronic device 200. The BLE broadcast carries information indicating that pairing can be performed, the first electronic device 100 can pair with the second electronic device 200. Several cases are described below in which the BLE broadcast transmitted by the second electronic device 200 carries information indicating that pairing is not possible, information indicating that pairing is possible.
That is, the second electronic device 200 is not paired currently and does not enter a state in which it can be paired, and the transmitted BLE broadcast carries information indicating that it cannot be paired. The second electronic device 200 enters the pairable state upon receiving a specific user operation (e.g., long pressing of the power key for more than 5 seconds). For example, the second electronic device 200 is paired with another electronic device (e.g., a third electronic device) successfully, and then is unpaired with the third electronic device, in which case the second electronic device 200 does not enter the pairable state.
The second electronic device 200 is already paired with another electronic device (e.g., a third electronic device), a bluetooth connection is not currently established with the third electronic device, the second electronic device 200 does not enter a state in which pairing can be performed, and information indicating that pairing cannot be performed is carried on a transmitted BLE broadcast.
Third, the second electronic device 200 has already been paired with another electronic device (e.g., a third electronic device) and currently has established a bluetooth connection, but does not enter a state capable of being paired, and the transmitted BLE broadcast carries information indicating that pairing is impossible.
When the second electronic device 200 is in the unpaired state, the second electronic device 200 enters the mateable state only when a specific user operation is received (e.g., long pressing of the power key for more than 5 seconds). After entering the pairable state, the BLE broadcast transmitted by the second electronic device 200 carries information indicating that pairing can be performed.
(2) The BLE broadcast may carry information indicating that it is not connectable, information indicating that it is connectable
When the BLE broadcast carries information indicating that it is not connectable, the second electronic device 200 cannot pair with the first electronic device 100. The BLE broadcast carries information indicating that pairing can be performed, the second electronic device 200 can pair with the first electronic device 100. Several cases are described below in which the BLE broadcast transmitted by the second electronic device 200 carries information indicating that pairing is not possible, information indicating that pairing is possible.
When the BLE broadcast carries information indicating that it is not connectable, the first electronic device 100 cannot connect with the second electronic device 200. The BLE broadcast carries information indicating that it can be connected, the first electronic device 100 can connect with the second electronic device 200. The following describes a case where the BLE broadcast transmitted by the second electronic device 200 carries information indicating that it is not connectable and information indicating that it is connectable.
When the second electronic device 200 is not paired and does not enter a connectable state, the transmitted BLE broadcast carries information indicating that it is not connectable. The second electronic device 200 enters the connectable state upon receiving a specific user operation (e.g., a user operation applied to a certain key). After entering the connectable state, the BLE broadcast transmitted by the second electronic device 200 carries information indicating that it can be connected.
(3) Information indicating whether pairing can be carried on BLE broadcast in a field mode
The second electronic device 200 may periodically transmit BLE broadcasts. There is a broadcast interval (e.g. 100ms) between every two adjacent BLE broadcasts, i.e. a BLE broadcast period. Each time the second electronic device 200 makes a BLE broadcast, the BLE broadcast may be transmitted on one or more BLE broadcast channels (e.g., BLE broadcast channel 37, BLE broadcast channel 38, BLE broadcast channel 39).
Referring to fig. 9, fig. 9 is a schematic diagram of a format of a BLE broadcast according to an embodiment of the present application. As shown in fig. 9, the BLE broadcast may include a broadcast Header (Header) field and an information content (Payload) field. Wherein the Header field contains information for link control. The link control information may include one or more of: broadcast packet type, sender address type, receive address type, etc. The Least Significant Bit (LSB) of the BLE broadcast is on the left side of the Header field in fig. 9, and the Most Significant Bit (MSB) of the BLE broadcast is on the right side of the Payload field in fig. 9.
The Payload field may include an address (AdvA) field and a data (AdvData) field. The broadcast device address field takes 6 bytes and the broadcast data field takes 31 bytes. The broadcast data field may include a valid data portion and an invalid data portion. Wherein, the effective data part comprises N broadcasting structures (AD structures), and N is a positive integer. Each AD structure includes a Length (Length) field, an AD Type field, and an AD Data field. The invalid data portion is filled with 0.
The Length field occupies 1 byte, and is used for indicating the lengths of the AD Type field and the AD Data in the AD structure. The AD Type field is used to indicate the meaning of AD Data. For example, when the value of the AD Type field is 0xFF, it can be indicated that the AD Data in the AD structure is vendor-defined Data, and the vendor can fill the AD Data at will.
In the embodiment of the present application, information indicating whether or not pairing can be performed may be set in the form of a field in AD Data. The field may occupy 1bit, and when the field takes a value of 0, it may indicate that the second electronic device 200 does not currently enter a state in which the pairing can be performed, that is, the BLE broadcast carries information indicating that the pairing cannot be performed. When the field takes a value of 1, it may indicate that the second electronic device 200 has currently entered a pairable state, that is, the BLE broadcast carries information indicating that pairing can be performed.
In the embodiment of the present application, information indicating whether or not connectable can be set in the form of a field in the AD Data. The field may also occupy 1bit, and when the field takes a value of 0, it may indicate that the second electronic device 200 does not currently enter a connectable state, that is, the BLE broadcast carries information indicating that the connection is not possible. When the field takes a value of 1, it may indicate that the second electronic device 200 has currently entered a connectable state, i.e., the BLE broadcast carries information indicating that the connection is possible.
In some embodiments of the present application, as shown in fig. 9, the BLE broadcast may also carry a UUID. The UUID indicates that the purpose of the BLE broadcast is: the BLE broadcast is searched by the other device (e.g., the first electronic device 100) and the device name and the device type are acquired by the other device. The field corresponding to the UUID may be the first two bytes (bytes) of the AD Data. The value of the UUID is not limited in the embodiment of the present application. The first electronic device 100, after receiving the BLE broadcast carrying the UUID, performs step S104 when detecting that the UUID indicates to be discovered by other devices.
In some embodiments of the present application, when receiving a BLE broadcast, first electronic device 100 may also detect a signal strength of the BLE broadcast. Specifically, the first electronic device 100 may detect a Received Signal Strength Indication (RSSI) of the BLE broadcast to determine the signal strength of the BLE broadcast. When the signal strength of the BLE broadcast is greater than the set threshold, the first electronic device 100 only executes step S104.
Third, the process of Bluetooth pairing in step S108 is explained
The device that first initiates pairing is called Master (Master) and the device that passively pairs is called Slave (Slave). For example, in the embodiment of the present application, the first electronic device 100 actively initiates pairing with the second electronic device 200, and the first electronic device 100 may be referred to as a master device and the second electronic device 200 may be referred to as a slave device.
The bluetooth pairing process may be as follows:
step one, the master device and the slave device respectively generate an initial key (key).
Where the initial key is 128 bits (bit) in length and is generated by the E22 algorithm. Wherein, the input (plaintext) of the E22 algorithm consists of the following three parts: the physical address BD _ ADDR of the slave device, the PIN code and its length, a 128-bit random number IN _ RAND. Physical address of slave before generating the initial key, the master device obtains the address (BD _ ADDRB) of the slave device by means of a query.
The PIN code is preset by both devices (master and slave), for example, "0000" or "1234" or the like.
The random number IN _ RAND is generated by the master device and transmitted to the slave device IN clear.
Since the master and slave devices use the same E22 algorithm, if the values of the above three parts of the two devices are equal, the initial keys calculated by the two devices should be the same.
And step two, the master device and the slave device respectively generate link keys (Kab).
After generating the initial key, the master device may generate a 128-bit random number Link _ RandA and the slave device may also generate a 128-bit random number Link _ RandB. In the master device, the master device performs bit logic exclusive-OR operation on the initial key and Link _ RandA, and an exclusive-OR result is sent to the slave device. Similarly, in the slave device, the slave device performs bit-bit logical exclusive or operation on the initial key and Link _ RandB, and sends an exclusive or result to the master device.
The master device may obtain Link _ RandB through calculation according to the xor result sent by the slave device and the locally stored initial key. The slave device may obtain Link _ RandA through calculation according to the xor result sent by the master device and the locally stored initial key. Thus, both the master and slave devices have the same initial key, Link _ RandA.
The master device may encrypt Link _ RandA and BD _ ADDRA using an algorithm (e.g., the E21 algorithm) to obtain Link _ KA and encrypt Link _ RandB and BD _ ADDRB to obtain Link _ KB. Then, the master device may perform xor according to Link _ KA and Link _ KB to obtain Kab.
Likewise, the slave device may encrypt Link _ RandA and BD _ ADDRA using an algorithm (e.g., E21 algorithm) to obtain Link _ KA, and encrypt Link _ RandB and BD _ ADDRB to obtain Link _ KB. Then, the slave device may perform xor according to Link _ KA and Link _ KB to obtain Kab.
Step three, bidirectional authentication of the master device and the slave device.
Among them, a challenge-response (challenge-response) manner is authenticated in two ways. The master device may be a responder and the slave device may be a requester. The responder may generate a 128-bit random number AU _ RANDA and send it in clear to the requester. The responder and the requester use the E1 algorithm to generate 32-bit SRESA and SRESB, respectively, from the respective AU _ RANDA, Kab, and BD _ RANDB encryption operations. Wherein, SRESA is generated by the main device as the responder, and SRESB is generated by the auxiliary device as the requester. The requesting party sends SRESB to the responding party, the responding party compares SRESA with SRESB, if the SRESA and the SRESB are equal, the authentication is passed, otherwise, the authentication is not passed. After the authentication is executed, the roles of the master device and the slave device are exchanged, the master device serves as a requester, and the slave device serves as a responder to perform authentication in the same way.
After the first electronic device 100 and the second electronic device 200 are authenticated, the first electronic device 100 and the second electronic device 200 may encrypt the transmitted data by using the link key Kab.
After the bluetooth pairing is completed, the second electronic device 200 and the first electronic device 100 do not need to be re-paired the next time the connection is established again. In this embodiment, the second electronic device 200 may stop transmitting BLE broadcast after pairing with the first electronic device 100 is completed. For example, after the first electronic device 100 and the second electronic device 200 are paired, and the second electronic device 200 is powered back on, the BLE broadcast is not sent any more, and the page scan is enabled.
In another possible implementation, after pairing is completed, the BLE broadcast sent by the second electronic device 200 carries information indicating that pairing cannot be performed or information that cannot be connected.
Fourth, description of procedure of bluetooth connection in step S110
In steps S110 to S111, the first electronic device 100 establishes the classic bluetooth procedure, which may include a paging (page) procedure of classic bluetooth. Specifically, after the first electronic device 100 detects a click operation on the device option of the second electronic device 200, the first electronic device 100 may enter a paging state to initiate a page to the second electronic device 200. The second electronic device 200 may periodically transmit BLE broadcast, page scan (page scan). Specifically, referring to fig. 10, fig. 10 is a timing diagram illustrating broadcasting and calling of a second electronic device 200 according to an embodiment of the present disclosure. As shown in fig. 10, the time point at which the BLE broadcast is transmitted by the second electronic device 200 and the time point of the page scan do not overlap.
For example, the period for the second electronic device 200 to transmit the BLE broadcast may be 1000 milliseconds, and the period for the page scan may be 2560 milliseconds. The duration of each time the second electronic device 200 transmits a BLE broadcast may be 1.5 milliseconds, and the duration of each page scan may be 22.5 milliseconds. The period of BLE broadcast, the period of page scan, the duration of each BLE broadcast, and the duration of each page scan shown in fig. 10 are not limited, and other timing designs may also be available, which are not limited in this embodiment of the present invention.
The process of paging to establish a classic bluetooth connection is described in detail below.
Step one, the first electronic device 100 is in a page state and sends a page data packet.
The page data packet may contain a Device Access Code (DAC) of the second electronic device 200.
Step two, when the second electronic device 200 is in the page scan state, the DAC of the second electronic device is monitored.
Step three, the second electronic device 200 may send a reply to the first electronic device 100, and switch from the page scan state to a slave response (slave response) state.
Step four, after receiving the reply sent by the second electronic device 200, the first electronic device 100 may send a Frequency Hopping Sequence (FHS) to the second electronic device 200 according to the reply, and switch from the page state to the master response (master response) state.
Step five, after receiving the FHS, the second electronic device 200 sends a second reply to the first electronic device 100, and switches from the slave response state to the connection (connection) state.
And step six, after the first electronic device 100 receives the reply sent by the second electronic device 200, the first electronic device 100 is switched from the master response state to the connection state.
At this time, the first electronic device 100 and the second electronic device 200 are both in the connected state. In this embodiment, after the bluetooth connection is established, the second electronic device 200 may stop BLE broadcasting. After rebooting, since the second electronic device 200 has been paired with the first electronic device 100, the second electronic device 100 may transmit BLE broadcasts at a lower frequency than before the unpairing. The BLE broadcast carries information indicating that pairing is impossible or information that connection is impossible. For example, when not paired, the second electronic device 200 transmits BLE broadcast at a frequency of 1Hz (with a period of 1000 milliseconds). When the paired unconnected state is established, the second electronic device 200 transmits BLE broadcast at a frequency of 0.5Hz (with a period of 2000 milliseconds). When the bluetooth connection has been established, the second electronic device 200 may stop BLE broadcasting.
The bluetooth connection is established between the first electronic device 100 and the second electronic device 200 through the above steps. When the bluetooth connection between the second electronic device 200 and the first electronic device 100 is disconnected, the second electronic device 200 may send BLE broadcast and perform page, and then perform loop connection to the first electronic device 100 through the page. The following describes a process of the second electronic device 200 and the first electronic device 100 reconnecting to the second electronic device 200. Referring to fig. 11, fig. 11 is a schematic flowchart illustrating a searching method according to an embodiment of the present disclosure. As shown in fig. 11, the search method may include steps S201 to S209.
S201, the second electronic device 200 sends BLE broadcast and page data packets, and performs page scan.
Referring to fig. 12, as shown in fig. 12, the second electronic device 200 may transmit a page packet and transmit a BLE broadcast. The page packet transmission may precede the BLE broadcast. As shown in fig. 12, the period of BLE broadcast may be 2000 milliseconds. The period of this BLE broadcast is greater than the period (1000 milliseconds) during which the broadcast is transmitted by the second electronic device 200 when not paired. The page packet is used for the second electronic device 200 to actively loop back. The second electronic device 200 may also perform a page scan for passive connection of the second electronic device 200.
As shown in fig. 12, the second electronic device may initiate a paging page to the first electronic device within a first time. The second electronic device may transmit a BLE broadcast for a second time when the second electronic device fails to connect with the first electronic device within the first time according to the initiated page. When the connection is successful, the second electronic device may stop transmitting BLE broadcasts. If no bluetooth connection has been established, as shown in fig. 12, the second electronic device may periodically transmit BLE broadcast and page within a preset time (e.g., 3 minutes).
S202, the first electronic device 100 detects that the second electronic device 200 has been paired.
S203, the first electronic device 100 displays the second device option on the paired device list.
The second device option is a device option of the second electronic device 200.
In the embodiment of the present application, steps S205 to S206 are processes of actively connecting back the second electronic device 200, and steps S207 to S208 are processes of passively connecting the second electronic device 200, which may be implemented in any one of the two connection manners. Regarding establishing the connection between the first electronic device 100 and the second electronic device 200 through the page process, reference may be made to the detailed description of the process description of the bluetooth connection in steps S110 to S111, which is not repeated herein.
S204, the first electronic device 100 searches for a page data packet from the second electronic device 200.
S205, the first electronic device 100 executes a page scan to establish a classic bluetooth connection with the second electronic device 200.
S206, the first electronic device 100 receives a click operation acting on the second device option in the paired device list.
S207, in response to the click operation acting on the second device option in the paired device list, the first electronic device 100 establishes a classic bluetooth connection with the second electronic device 200.
S208, the second electronic device 200 stops transmitting BLE broadcasts.
In other embodiments of the present application, the second electronic device 200 may also be used for a periodic inquiry scan (inquiry scan) to connect to a classic bluetooth device. Wherein a classic bluetooth device may be a device that only supports classic bluetooth connections.
Specifically, referring to fig. 13, fig. 13 is a timing diagram illustrating broadcasting, calling and querying of a second electronic device 200 according to an embodiment of the present disclosure. As shown in fig. 13, the period of the second electronic device 200 performing the inquiry scan may be 2560 milliseconds, which is the same as the period of the page scan. The duration of the inquiry scan of the second electronic device 200 may be 11.25 milliseconds at a time. As to the period of BLE broadcast, the period of page scan, the duration of each BLE broadcast, and the duration of each page scan, reference may be made to the description of the example shown in fig. 10, and these parameters may also have other timing designs, which is not limited in this embodiment of the present application. As shown in fig. 13, the time point when the second electronic device 200 transmits the BLE broadcast does not overlap with the time point of the page scan or the time point of the inquiry scan.
When the classic bluetooth device needs to perform bluetooth search, the classic bluetooth device enters an inquiry state. For example, the classic bluetooth device is a cell phone, and the classic bluetooth device may enter an inquiry state when it is detected that a bluetooth switch of the classic bluetooth device is open. A classic bluetooth device may select a new channel from 32 channels to transmit an inquiry hopping sequence every 312.5 microseconds. The second electronic device 200 may perform inquiry scan as a searched device according to the timing shown in fig. 13. When the inquiry hopping sequence from the classic bluetooth device is detected, the second electronic device responds to the inquiry response (inquiry response), i.e. sends an inquiry response sequence. When the channel on which the classic bluetooth device executes the inquiry is the same as the channel on which the second electronic device 200 executes the inquiry response, the classic bluetooth device may receive the inquiry response sequence transmitted by the second electronic device 200 and display the device name of the second electronic device 200. I.e. the classical bluetooth device has discovered the second electronic device 200.
After displaying the device name of the second electronic device 200, the classic bluetooth device may pair with the second electronic device 200 and establish a bluetooth connection. The pairing and bluetooth connection establishment process may refer to step S110 in the example described in fig. 8, and will not be described herein.
According to the example described in fig. 13, BLE broadcasting, inquiry scan, and page scan are performed, and the second electronic device 200 may search for a device supporting BLE through BLE broadcasting and may search for a device supporting classic bluetooth through inquiry scan. In this way, the situation that classic Bluetooth devices cannot be found due to the fact that only BLE broadcasting is supported for searching is reduced, and therefore universality of Bluetooth searching is improved.
In this embodiment of the application, after the bluetooth connection is established, the second electronic device 200 may stop BLE broadcasting, may also stop page scan, and may also stop inquiry scan. The second electronic device 200 may no longer transmit BLE broadcasts after rebooting, but still perform page scan. In another possible implementation, after rebooting, the second electronic device 200 may still transmit BLE broadcasts. The BLE broadcast carries information indicating that pairing is impossible or information that connection is impossible.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.
As used in the above embodiments, the term "when …" may be interpreted to mean "if …" or "after …" or "in response to a determination of …" or "in response to a detection of …", depending on the context. Similarly, depending on the context, the phrase "at the time of determination …" or "if (a stated condition or event) is detected" may be interpreted to mean "if the determination …" or "in response to the determination …" or "upon detection (a stated condition or event)" or "in response to detection (a stated condition or event)".
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk), among others.
One of ordinary skill in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by hardware related to instructions of a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the above method embodiments. And the aforementioned storage medium includes: various media capable of storing program codes, such as ROM or RAM, magnetic or optical disks, etc.

Claims (28)

1. A Bluetooth searching method is applied to a Bluetooth system, the Bluetooth system comprises a first electronic device and a second electronic device, and the method comprises the following steps:
the second electronic equipment sends a low-power-consumption Bluetooth BLE broadcast, wherein the BLE broadcast carries an equipment address and an equipment name of the second electronic equipment;
the first electronic equipment starts a Bluetooth function and receives the BLE broadcast;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast;
the first electronic equipment receives first user operation, and the first user operation is used for indicating that Bluetooth connection is established with the second electronic equipment;
and responding to the first user operation, the first electronic equipment pairs the second electronic equipment according to the equipment address of the second electronic equipment, and establishes Bluetooth connection with the second electronic equipment.
2. The method according to claim 1, wherein the second electronic device transmits a Bluetooth Low Energy (BLE) broadcast comprising:
when detecting that the Bluetooth function is started, the second electronic device sends a Bluetooth Low Energy (BLE) broadcast.
3. The method of claim 1 or 2, wherein after the first electronic device establishes a bluetooth connection with the second electronic device, the method further comprises:
the second electronic device stops transmitting the BLE broadcast.
4. The method of any of claims 1-3, wherein after the first electronic device establishes a Bluetooth connection with the second electronic device, the method further comprises:
when the Bluetooth connection disconnection is detected, the second electronic equipment initiates a paging page to the first electronic equipment within a first time;
when the second electronic device fails to connect with the first electronic device within the first time according to the initiated page,
the second electronic device transmits the BLE broadcast within a second time.
5. The method according to any one of claims 1 to 4, wherein the BLE broadcast also carries a Universally Unique Identifier (UUID) indicating that the BLE broadcast is for device discovery;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when detecting that the UUID indicates that the BLE broadcast is for device discovery, the first electronic device displays a device name of the second electronic device in a list of available devices.
6. The method according to any one of claims 1 to 5, wherein the BLE broadcast also carries first indication information indicating whether pairing can be performed;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when the first indication information indicates that pairing can be performed, the first electronic device displays a device name of the second electronic device in an available device list.
7. The method according to any one of claims 1 to 6, wherein the BLE broadcast also carries second indication information indicating whether or not it can be connected;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when the first indication information indicates that the connection can be made, the first electronic device displays the device name of the second electronic device in an available device list.
8. The method according to any one of claims 1 to 7, wherein the first electronic device displays the device name of the second electronic device in a list of available devices according to the BLE broadcast, including:
when the signal strength of the BLE broadcast is greater than a first threshold, the first electronic device displays the device name of the second electronic device in an available device list.
9. The method according to any one of claims 1 to 8, wherein the second electronic device transmits a Bluetooth Low Energy (BLE) broadcast comprising:
the second electronic equipment periodically sends BLE broadcast and periodically enters an inquiry scanning inquiry state;
the inquiry scan state is used for the second electronic device to be discovered by a third electronic device, and the third electronic device supports classic Bluetooth.
10. A bluetooth searching method, the method comprising:
the method comprises the steps that a first electronic device starts a Bluetooth function, and receives a BLE broadcast from a second electronic device, wherein the BLE broadcast carries a device address and a device name of the second electronic device;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast;
the first electronic equipment receives first user operation, and the first user operation is used for indicating that Bluetooth connection is established with the second electronic equipment;
and responding to the first user operation, the first electronic equipment pairs the second electronic equipment according to the equipment address of the second electronic equipment, and establishes Bluetooth connection with the second electronic equipment.
11. The method according to claim 10, wherein the BLE broadcast also carries a UUID indicating that the BLE broadcast is for device discovery;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when detecting that the UUID indicates that the BLE broadcast is for device discovery, the first electronic device displays a device name of the second electronic device in a list of available devices.
12. The method according to claim 10 or 11, wherein the BLE broadcast also carries first indication information indicating whether pairing can be done or not;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when the first indication information indicates that pairing can be performed, the first electronic device displays a device name of the second electronic device in an available device list.
13. The method according to any one of claims 10 to 12, wherein the BLE broadcast also carries second indication information indicating whether it can be connected;
the first electronic device displays the device name of the second electronic device in an available device list according to the BLE broadcast, including:
when the first indication information indicates that the connection can be made, the first electronic device displays the device name of the second electronic device in an available device list.
14. The method according to any one of claims 10 to 13, wherein the first electronic device displays the device name of the second electronic device in a list of available devices according to the BLE broadcast, including:
when the signal strength of the BLE broadcast is greater than a first threshold, the first electronic device displays the device name of the second electronic device in an available device list.
15. A bluetooth system, comprising a first electronic device and a second electronic device, wherein:
the second electronic device is configured to send a low-power-consumption bluetooth BLE broadcast, where the BLE broadcast carries a device address and a device name of the second electronic device;
the first electronic device is used for starting a Bluetooth function and receiving the BLE broadcast;
the first electronic device is further configured to display a device name of the second electronic device in an available device list according to the BLE broadcast;
the first electronic device is further configured to receive a first user operation, where the first user operation is a user operation acting on a device name of the second device;
the first electronic device is further configured to, in response to the first user operation, pair the second electronic device according to the device address of the second electronic device, and establish bluetooth connection with the second electronic device.
16. The system according to claim 15, wherein the second electronic device is specifically configured to transmit a Bluetooth Low Energy (BLE) broadcast when it is detected that the Bluetooth function is turned on.
17. The system of claim 15 or 16,
the second electronic device is further configured to stop sending the BLE broadcast after the first electronic device establishes a bluetooth connection with the second electronic device.
18. The system according to any one of claims 15 to 17,
the second electronic device is further configured to initiate a paging page to the first electronic device within a first time when it is detected that the bluetooth connection is disconnected;
the second electronic device is further configured to transmit the BLE broadcast within a second time when a connection with the first electronic device fails within the first time according to the initiated page.
19. The system according to any one of claims 15 to 18, wherein the BLE broadcast also carries a universally unique identifier UUID indicating that the BLE broadcast is for device discovery;
the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when it is detected that the UUID indicates that the BLE broadcast is used for device discovery.
20. The system according to any one of claims 15 to 19, wherein the BLE broadcast also carries first indication information indicating whether it can be paired;
the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that pairing can be performed.
21. The system according to any one of claims 15 to 20, wherein the BLE broadcast also carries second indication information indicating whether it can be connected;
the first electronic device is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that the second electronic device can be connected.
22. The system according to any one of claims 15 to 21, wherein the first electronic device is specifically configured to display the device name of the second electronic device in a list of available devices when the signal strength of the BLE broadcast is greater than a first threshold.
23. The system according to any one of claims 15 to 22, wherein the second electronic device is specifically configured to periodically transmit BLE broadcasts and periodically enter into the inquiry scan inquiry state; the inquiry scan state is used for the second electronic device to be discovered by a third electronic device, and the third electronic device supports classic Bluetooth.
24. A first electronic device is characterized by comprising a Bluetooth chip, a memory, a touch screen and a processor; the memory is coupled with the processor; the Bluetooth chip supports a classic Bluetooth BR/EDR function and a low-power Bluetooth BLE function;
the Bluetooth chip is used for starting a Bluetooth function and receiving a BLE broadcast from second electronic equipment, wherein the BLE broadcast carries an equipment address and an equipment name of the second electronic equipment;
the processor is used for displaying the device name of the second electronic device in an available device list through the touch screen according to the BLE broadcast;
the processor is further configured to receive an instruction for instructing to establish a bluetooth connection with the second electronic device;
the Bluetooth chip is further used for pairing the second electronic equipment according to the equipment address of the second electronic equipment and establishing Bluetooth connection with the second electronic equipment.
25. The first electronic device of claim 24, wherein the BLE broadcast further carries a UUID indicating that the BLE broadcast is for device discovery;
the processor is specifically configured to, when it is detected that the UUID indicates that the BLE broadcast is used for device discovery, display, by the first electronic device, a device name of the second electronic device in an available device list.
26. The first electronic device according to claim 24 or 25, wherein the BLE broadcast also carries first indication information indicating whether pairing can be made;
the processor is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that pairing can be performed.
27. The first electronic device according to any one of claims 24 to 26, wherein the BLE broadcast also carries second indication information indicating whether it can be connected;
the processor is specifically configured to display a device name of the second electronic device in an available device list when the first indication information indicates that the second electronic device can be connected.
28. The first electronic device according to any one of claims 24 to 27, wherein the processor is specifically configured to display the device name of the second electronic device in a list of available devices when the signal strength of the BLE broadcast is greater than a first threshold.
CN201910817160.8A 2019-08-30 2019-08-30 Bluetooth searching method, system and related device Active CN112449328B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910817160.8A CN112449328B (en) 2019-08-30 2019-08-30 Bluetooth searching method, system and related device
PCT/CN2020/109383 WO2021036835A1 (en) 2019-08-30 2020-08-14 Bluetooth search method and system, and related apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910817160.8A CN112449328B (en) 2019-08-30 2019-08-30 Bluetooth searching method, system and related device

Publications (2)

Publication Number Publication Date
CN112449328A true CN112449328A (en) 2021-03-05
CN112449328B CN112449328B (en) 2023-08-22

Family

ID=74685082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910817160.8A Active CN112449328B (en) 2019-08-30 2019-08-30 Bluetooth searching method, system and related device

Country Status (2)

Country Link
CN (1) CN112449328B (en)
WO (1) WO2021036835A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113473386A (en) * 2021-06-02 2021-10-01 Tcl通讯(宁波)有限公司 Method and device for acquiring low-power-consumption Bluetooth information, mobile terminal and storage medium
CN113766482A (en) * 2021-09-15 2021-12-07 荣耀终端有限公司 Method for searching Bluetooth device, electronic device and storage medium
CN114363871A (en) * 2021-05-14 2022-04-15 华为技术有限公司 Wireless connection method and electronic equipment
CN114938542A (en) * 2022-04-26 2022-08-23 珠海极海半导体有限公司 BLE protocol stack multilink management method, chip and system
WO2022213315A1 (en) * 2021-04-08 2022-10-13 海能达通信股份有限公司 Bluetooth pairing and connection method and device, and terminal
WO2023020439A1 (en) * 2021-08-18 2023-02-23 Oppo广东移动通信有限公司 Bluetooth audio receiving method and apparatus, terminal and storage medium
WO2023030531A1 (en) * 2021-09-06 2023-03-09 Oppo广东移动通信有限公司 Prompt information display method and apparatus, electronic device, and storage medium
WO2023065813A1 (en) * 2021-10-22 2023-04-27 华为技术有限公司 Method for establishing slb connection, electronic device, and communication system
WO2023093328A1 (en) * 2021-11-23 2023-06-01 Oppo广东移动通信有限公司 Bluetooth back-connection method and apparatus, information storage method and apparatus, and terminal device
CN116546365A (en) * 2023-07-06 2023-08-04 深圳市湖山科技有限公司 Wireless microphone capable of automatically searching and locking channels
WO2024037500A1 (en) * 2022-08-19 2024-02-22 华为技术有限公司 Communication method and related apparatus

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115776644A (en) * 2021-09-06 2023-03-10 Oppo广东移动通信有限公司 Broadcast message transmitting method and device, electronic equipment and storage medium
CN114025338B (en) * 2021-11-09 2024-02-13 深圳万兴软件有限公司 Method and device for improving reverse control Bluetooth connection efficiency and related components
CN114339591B (en) * 2021-12-09 2024-03-08 青岛海信移动通信技术有限公司 Method and related device for positioning based on ultra-wideband chip
CN117750492A (en) * 2024-02-20 2024-03-22 荣耀终端有限公司 Synchronous playing method, electronic equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150335A (en) * 2006-09-21 2008-03-26 中兴通讯股份有限公司 Bluetooth phone terminal device for realizing multiple functions
CN104768123A (en) * 2015-03-18 2015-07-08 广东欧珀移动通信有限公司 Bluetooth connection method, device and system
CN105516896A (en) * 2015-12-02 2016-04-20 惠州Tcl移动通信有限公司 Bluetooth interconnection method and system for wearable device and mobile terminal
CN106878926A (en) * 2017-02-08 2017-06-20 泰凌微电子(上海)有限公司 A kind of data transmission method based on low-power consumption bluetooth, from main equipment and system
CN108811182A (en) * 2018-06-14 2018-11-13 歌尔科技有限公司 A kind of method, apparatus and wireless headset of wireless headset pairing
US20190230408A1 (en) * 2018-01-22 2019-07-25 Qualcomm Incorporated System, method, and apparatus for temporary wireless connection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019013683A1 (en) * 2017-07-14 2019-01-17 Telefonaktiebolaget Lm Ericsson (Publ) Method and device for connection-less advertising in bluetooth low energy
CN109743715B (en) * 2018-12-29 2021-01-15 联想(北京)有限公司 Processing method and system and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101150335A (en) * 2006-09-21 2008-03-26 中兴通讯股份有限公司 Bluetooth phone terminal device for realizing multiple functions
CN104768123A (en) * 2015-03-18 2015-07-08 广东欧珀移动通信有限公司 Bluetooth connection method, device and system
CN105516896A (en) * 2015-12-02 2016-04-20 惠州Tcl移动通信有限公司 Bluetooth interconnection method and system for wearable device and mobile terminal
CN106878926A (en) * 2017-02-08 2017-06-20 泰凌微电子(上海)有限公司 A kind of data transmission method based on low-power consumption bluetooth, from main equipment and system
US20190230408A1 (en) * 2018-01-22 2019-07-25 Qualcomm Incorporated System, method, and apparatus for temporary wireless connection
CN108811182A (en) * 2018-06-14 2018-11-13 歌尔科技有限公司 A kind of method, apparatus and wireless headset of wireless headset pairing

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022213315A1 (en) * 2021-04-08 2022-10-13 海能达通信股份有限公司 Bluetooth pairing and connection method and device, and terminal
CN114363871A (en) * 2021-05-14 2022-04-15 华为技术有限公司 Wireless connection method and electronic equipment
CN114363871B (en) * 2021-05-14 2023-03-03 华为技术有限公司 Wireless connection method and electronic equipment
CN113473386A (en) * 2021-06-02 2021-10-01 Tcl通讯(宁波)有限公司 Method and device for acquiring low-power-consumption Bluetooth information, mobile terminal and storage medium
WO2023020439A1 (en) * 2021-08-18 2023-02-23 Oppo广东移动通信有限公司 Bluetooth audio receiving method and apparatus, terminal and storage medium
WO2023030531A1 (en) * 2021-09-06 2023-03-09 Oppo广东移动通信有限公司 Prompt information display method and apparatus, electronic device, and storage medium
CN113766482A (en) * 2021-09-15 2021-12-07 荣耀终端有限公司 Method for searching Bluetooth device, electronic device and storage medium
CN113766482B (en) * 2021-09-15 2022-10-14 荣耀终端有限公司 Method for searching Bluetooth device, electronic device and storage medium
WO2023065813A1 (en) * 2021-10-22 2023-04-27 华为技术有限公司 Method for establishing slb connection, electronic device, and communication system
WO2023093328A1 (en) * 2021-11-23 2023-06-01 Oppo广东移动通信有限公司 Bluetooth back-connection method and apparatus, information storage method and apparatus, and terminal device
CN114938542A (en) * 2022-04-26 2022-08-23 珠海极海半导体有限公司 BLE protocol stack multilink management method, chip and system
CN114938542B (en) * 2022-04-26 2023-10-27 珠海极海半导体有限公司 BLE protocol stack multilink management method, chip and system
WO2024037500A1 (en) * 2022-08-19 2024-02-22 华为技术有限公司 Communication method and related apparatus
CN116546365A (en) * 2023-07-06 2023-08-04 深圳市湖山科技有限公司 Wireless microphone capable of automatically searching and locking channels
CN116546365B (en) * 2023-07-06 2023-09-26 深圳市湖山科技有限公司 Wireless microphone capable of automatically searching and locking channels

Also Published As

Publication number Publication date
CN112449328B (en) 2023-08-22
WO2021036835A1 (en) 2021-03-04

Similar Documents

Publication Publication Date Title
CN112449328B (en) Bluetooth searching method, system and related device
CN113382397B (en) Bluetooth connection method, device and system
CN113225690B (en) Bluetooth connection method, system and electronic equipment
US20220039179A1 (en) Bluetooth Connection Method and Device
CN112469013B (en) Bluetooth connection method and related device
CN112449332B (en) Bluetooth connection method and electronic equipment
CN112822663B (en) Bluetooth connection method and related device
CN110730114B (en) Method and equipment for configuring network configuration information
CN114710768B (en) Bluetooth connection method and related device
CN111132137A (en) Wi-Fi connection method and device
US11844119B2 (en) Bluetooth pairing method and related apparatus
CN113423106B (en) Mobile network hotspot sharing method and device and hotspot sharing equipment
CN110557740A (en) Electronic equipment control method and electronic equipment
CN113676879A (en) Method, electronic device and system for sharing information
CN112469012A (en) Bluetooth communication method and related device
CN114554012A (en) Incoming call answering method, electronic equipment and storage medium
CN114339698A (en) Method for establishing wireless connection through equipment touch, electronic equipment and chip
CN112996066B (en) Network residing method and related equipment
CN113438102B (en) Network configuration system, network configuration method, electronic device and routing device
CN113676902B (en) System, method and electronic equipment for providing wireless internet surfing
CN115802326A (en) Bluetooth connection method and electronic equipment
CN113676902A (en) System and method for providing wireless internet access and electronic equipment
CN117255434A (en) Data transmission management method, electronic device and storage medium
CN114980238A (en) Wi-Fi access method and related equipment
CN116133165A (en) Headset connection system, method, headset, electronic device, and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant