Search

CN-122028149-A - Bluetooth connection method and electronic equipment

CN122028149ACN 122028149 ACN122028149 ACN 122028149ACN-122028149-A

Abstract

The application discloses a Bluetooth connection method and electronic equipment, relates to the technical field of electronics, and is used for reducing power consumption when the electronic equipment scans Bluetooth broadcast messages of other electronic equipment. The Bluetooth connection method comprises the steps that a first electronic device controls a Bluetooth chip to scan Bluetooth broadcast messages through a first Bluetooth interface, if the Bluetooth chip detects that data of a preset domain in the first Bluetooth broadcast messages of a second electronic device meet the filtering rules of the preset domain, the Bluetooth chip sends the first Bluetooth broadcast messages to an upper layer application through the first Bluetooth interface, the first electronic device controls the Bluetooth chip to establish Bluetooth connection with the second electronic device through a second Bluetooth interface, wherein the first Bluetooth interface does not support establishment of Bluetooth connection, the second Bluetooth interface supports establishment of Bluetooth connection, the first Bluetooth interface supports configuration of filtering rules to the Bluetooth chip, and the second Bluetooth interface does not support configuration of filtering rules to the Bluetooth chip.

Inventors

  • ZHANG JIA
  • ZHOU BIN
  • LI XIAORUI

Assignees

  • 荣耀终端股份有限公司

Dates

Publication Date
20260512
Application Date
20241112

Claims (12)

  1. 1. A bluetooth connection method, comprising: the first electronic equipment controls the Bluetooth chip to scan Bluetooth broadcast messages through a first Bluetooth interface; if the Bluetooth chip detects that the data of the preset domain in the first Bluetooth broadcast message of the second electronic device meets the filtering rule of the preset domain, the Bluetooth chip sends the first Bluetooth broadcast message to an upper layer application through the first Bluetooth interface; The first electronic device controls the Bluetooth chip to establish Bluetooth connection with the second electronic device through a second Bluetooth interface; Wherein the first Bluetooth interface does not support establishing Bluetooth connection, and the second Bluetooth interface supports establishing Bluetooth connection; the first Bluetooth interface supports configuration of the filtering rules to the Bluetooth chip, the second Bluetooth interface does not support configuration of the filtering rules to the Bluetooth chip, and the filtering rules are used for indicating the Bluetooth chip to report Bluetooth broadcast messages of data of a preset domain in an effective data range.
  2. 2. The method as recited in claim 1, further comprising: The first electronic device configures enabling information of the filtering rules of each preset domain to the Bluetooth chip through the first Bluetooth interface, wherein the enabling information is used for indicating whether the filtering rules of the corresponding preset domains are effective or not.
  3. 3. The method according to claim 1 or 2, wherein the first electronic device controlling the bluetooth chip to establish a bluetooth connection with the second electronic device through a second bluetooth interface, comprises: the first electronic equipment controls the Bluetooth chip to scan Bluetooth broadcast messages through the second Bluetooth interface; If the identification information of the electronic equipment in the second Bluetooth broadcast message is the same as the identification information of the electronic equipment in the first Bluetooth broadcast message, the first electronic equipment controls the Bluetooth chip to stop scanning through the second Bluetooth interface, and controls the Bluetooth chip to establish Bluetooth connection with the second electronic equipment through the second Bluetooth interface.
  4. 4. The method according to claim 1 or 2, wherein said controlling the bluetooth chip to establish a bluetooth connection with the second electronic device via a second bluetooth interface comprises: The first electronic equipment obtains Bluetooth connection related information of the second electronic equipment from the first Bluetooth broadcast message; And according to the Bluetooth connection related information of the second electronic equipment, creating an object of the second electronic equipment through the second Bluetooth interface, and controlling the Bluetooth chip to establish Bluetooth connection with the second electronic equipment through the second Bluetooth interface.
  5. 5. The method of any of claims 1-4, wherein the predetermined domain comprises a manufacturer data specific domain, wherein the data of the predetermined domain in the first bluetooth broadcast message satisfies a filtering rule of the predetermined domain, comprising: The valid data range of the manufacturer data specific domain is a value M, and the data of the manufacturer data specific domain in the first bluetooth broadcast message is also a value M; Or alternatively The valid data range of the manufacturer data specific domain is a value interval [ M1, M2], and the data of the manufacturer data specific domain in the first Bluetooth broadcast message is a value M, M epsilon [ M1, M2].
  6. 6. The method according to any one of claims 1-5, wherein the preset domain includes a service data specific domain, and wherein the data of the preset domain in the first bluetooth broadcast message satisfies a filtering rule of the preset domain, including: the effective data range of the service data specific domain is a value M, and the data of the service data specific domain in the first Bluetooth broadcast message is also a value M; Or alternatively The effective data range of the service data specific domain is a numerical value interval [ M1, M2], and the data of the service data specific domain in the first Bluetooth broadcast message is a numerical value M, M epsilon [ M1, M2].
  7. 7. The method according to any one of claims 1-6, wherein the preset domain includes a media access control MAC address domain, and wherein the data of the preset domain in the first bluetooth broadcast message satisfies a filtering rule of the preset domain, including: The effective data range of the MAC address field is a 6-byte value, and the 6-byte value of the MAC address field in the first Bluetooth broadcast message is the same as the 6-byte value of the effective data range of the MAC address field.
  8. 8. The method according to any one of claims 1-7, wherein the preset domain includes a device name domain, and wherein the data of the preset domain in the first bluetooth broadcast message satisfies a filtering rule of the preset domain, including: The valid data range of the device name field includes at least one string, and the string of the device name field in the first bluetooth broadcast message is identical to one string of the valid data range of the device name field.
  9. 9. The method according to any one of claims 1-8, wherein the preset domain includes a service identification domain, and wherein the data of the preset domain in the first bluetooth broadcast message satisfies a filtering rule of the preset domain, including: the effective data range of the service identification domain is a number N, and the data of the service identification domain in the first bluetooth broadcast message is also a number N.
  10. 10. The method according to any one of claims 1-9, wherein the preset domain includes a manufacturer identification domain, and wherein the data of the preset domain in the first bluetooth broadcast message satisfies a filtering rule of the preset domain, including: the valid data range of the manufacturer identification field is a number N, and the data of the manufacturer identification field in the first bluetooth broadcast message is also a number N.
  11. 11. An electronic device comprising a processor and a memory, the memory storing instructions that, when executed by the processor, perform the method of any of claims 1-10.
  12. 12. A computer readable storage medium comprising instructions which, when run on an electronic device, cause the electronic device to perform the method of any of claims 1-10.

Description

Bluetooth connection method and electronic equipment Technical Field The present application relates to the field of electronic technologies, and in particular, to a bluetooth connection method and an electronic device. Background In a smart networking scenario, various electronic devices within near field communication range, such as personal computers (personal computer, PCs), cell phones, tablets, large screens, internet of things (internet of things, ioT) devices, etc., may be mutually perceived and discovered between electronic devices through bluetooth communication (e.g., bluetooth low energy (Bluetooth low energy, BLE) communication). However, the bluetooth communication function of the operating system operated by some electronic devices is not perfect, and the power consumption is still high when the bluetooth broadcast message of other electronic devices is scanned and the bluetooth connection is established. Disclosure of Invention The embodiment of the application provides a Bluetooth connection method and electronic equipment, which are used for reducing the power consumption of the electronic equipment. In order to achieve the above purpose, the embodiment of the present application adopts the following technical scheme: The Bluetooth connection method includes the steps that a first electronic device controls a Bluetooth chip to scan Bluetooth broadcast messages through a first Bluetooth interface, if the Bluetooth chip detects that data of a preset domain in the first Bluetooth broadcast messages of a second electronic device meet a filtering rule of the preset domain, the Bluetooth chip sends the first Bluetooth broadcast messages to an upper layer application through the first Bluetooth interface, the first electronic device controls the Bluetooth chip to establish Bluetooth connection with the second electronic device through a second Bluetooth interface, the first Bluetooth interface does not support establishment of Bluetooth connection, the second Bluetooth interface supports establishment of Bluetooth connection, the first Bluetooth interface supports configuration of the filtering rule to the Bluetooth chip, the second Bluetooth interface does not support configuration of the filtering rule to the Bluetooth chip, and the filtering rule is used for indicating the Bluetooth chip to report the Bluetooth broadcast messages of the data of the preset domain in an effective data range. In the bluetooth connection method provided by the embodiment of the application, on one hand, in the period of scanning the bluetooth broadcast message, since the second bluetooth interface does not support configuration filtering rules for the bluetooth chip, if the bluetooth chip is controlled by the second bluetooth interface to scan the bluetooth broadcast message, the bluetooth chip can report all scanned bluetooth broadcast messages, and the first electronic device can analyze and process all bluetooth broadcast messages, so that the power consumption of the first electronic device is higher. The first bluetooth interface supports configuring a filtering rule for the bluetooth chip, and the bluetooth chip reports a first bluetooth broadcast message of the data of the preset domain in an effective data range according to the filtering rule, and other bluetooth broadcast messages of the data of the preset domain which do not meet the filtering rule are filtered by the bluetooth chip and cannot be reported for further processing, so that the power consumption of the first electronic device can be reduced. On the other hand, in the stage of establishing the bluetooth connection with the second electronic device, since the first bluetooth interface does not support establishing the bluetooth connection and the second bluetooth interface supports establishing the bluetooth connection, after the first bluetooth broadcast message meeting the filtering rule is scanned through the first bluetooth interface, the bluetooth chip is controlled to establish the bluetooth connection with the second electronic device through the second bluetooth interface. In summary, the bluetooth connection method can reduce power consumption when the electronic device scans bluetooth broadcast messages of other electronic devices and establishes bluetooth connection. In one possible implementation manner, the first electronic device configures, through the first bluetooth interface, enabling information of filtering rules of each preset domain to the bluetooth chip, where the enabling information is used to indicate whether the filtering rules of the corresponding preset domain are valid. When the filtering rules of a plurality of preset domains are effective, the Bluetooth chip sends the first Bluetooth broadcasting message to the upper layer application through the first Bluetooth interface as long as any preset domain of the first Bluetooth broadcasting message received by the first electronic device meets the filtering rules of