Bluetooth scanning method and electronic equipment
By implementing the method of scanning Bluetooth broadcasting based on filtering conditions of different Bluetooth applications in electronic devices, the problem of failure of filtering conditions when multiple Bluetooth applications are run at the same time in the prior art is solved, and the effect of accurate scanning and convenient connection is achieved.
Patent Information
- Application Number
- CN202311647951.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-04
- Publication Date
- 2025-06-13
AI Technical Summary
The prior art cannot effectively filter and display Bluetooth broadcasts that support different Bluetooth applications when multiple Bluetooth applications are running simultaneously, resulting in the filtering conditions of some Bluetooth applications being invalid and the function of some Bluetooth applications being invalid.
A Bluetooth scanning method is provided, allowing electronic devices to simultaneously scan Bluetooth broadcasts based on filtering conditions of different Bluetooth applications and display Bluetooth device information that meets each filtering conditions.
It realizes that when multiple Bluetooth applications are running simultaneously, accurately scans Bluetooth broadcasts that support different Bluetooth applications, avoiding the problem of filtering conditions failure and improving the convenience of users triggering Bluetooth connections.
Smart Images

Figure CN120151807A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of wireless communication technologies, and in particular, to a Bluetooth scanning method and an electronic device. Background Art
[0002] Bluetooth is a short-range wireless communication technology with the advantages of low cost and high data transmission speed, and is widely used in short-range data transmission between devices. The process of an electronic device establishing a Bluetooth connection includes Bluetooth broadcast scanning and connection. Exemplarily, a Bluetooth chip in the electronic device can scan Bluetooth broadcasts sent by near-field Bluetooth devices and report the received Bluetooth broadcasts to a Bluetooth application in the electronic device. The Bluetooth application can display device information of the Bluetooth device corresponding to the scanned Bluetooth broadcast for the user. After that, in response to the user selecting a target Bluetooth device in the Bluetooth application, a connection process for the electronic device to establish a Bluetooth connection with the target Bluetooth device is triggered.
[0003] Related technologies can adopt a filtering method to reduce the number of Bluetooth broadcasts reported by the Bluetooth chip to the Bluetooth application, so as to reduce the power consumption of the electronic device. However, the Bluetooth broadcasts obtained by using the filtering method in the related technologies cannot meet the requirements of multiple Bluetooth applications in the electronic device. Summary of the Invention
[0004] The embodiments of the present application provide a Bluetooth scanning method and an electronic device, which can accurately scan Bluetooth broadcasts supporting different Bluetooth applications.
[0005] To achieve the above object, the embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, a Bluetooth scanning method is provided, which is applied to an electronic device. The electronic device has the Bluetooth function enabled, and a first Bluetooth application and a second Bluetooth application are running in the electronic device. The first filtering condition of the first Bluetooth application is different from the second filtering condition of the second Bluetooth application. The first filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices supporting the first Bluetooth application, and the second filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices supporting the second Bluetooth application. The method includes: during the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition; displaying first device information of a first Bluetooth device that sends a first Bluetooth broadcast, and displaying second device information of a second Bluetooth device that sends a second Bluetooth broadcast; where the first Bluetooth broadcast meets the first filtering condition, and the second Bluetooth broadcast meets the second filtering condition.
[0007] In the conventional solution, when multiple different Bluetooth applications are running on an electronic device, the electronic device can only filter the scanned Bluetooth broadcasts according to the filtering conditions of the latest started Bluetooth application, and clear the filtering conditions of the Bluetooth applications started before this Bluetooth application. This causes the filtering conditions of the Bluetooth applications started before this Bluetooth application to become invalid, which may lead to the failure of the functions of the Bluetooth applications started before this Bluetooth application. In this application, multiple (at least two) different Bluetooth applications can run on the electronic device, and the electronic device can simultaneously scan Bluetooth broadcasts supporting different Bluetooth applications based on different filtering conditions of different Bluetooth applications. In this way, it is possible to avoid the filtering conditions of the previously started Bluetooth applications from becoming invalid after starting a new Bluetooth application. This application can meet the scanning requirements of different Bluetooth applications. Moreover, the electronic device can display the first device information of the Bluetooth device that sends the first Bluetooth broadcast satisfying the first filtering condition to the user, and display the second device information of the Bluetooth device that sends the second Bluetooth broadcast satisfying the second filtering condition to the user, which helps the user quickly and conveniently trigger the Bluetooth connection between the electronic device and the Bluetooth device.
[0008] In a possible implementation manner of the first aspect, an operating system is installed in the electronic device. Operating system.
[0009] In a possible implementation manner of the first aspect, the electronic device displays the first device information in a preset manner, and the electronic device displays the second device information in a preset manner; wherein, the preset manner includes the manner of a pop-up window or a notification message. The electronic device can display the first device information and the second device information in the manner of a pop-up window or a notification message.
[0010] In a possible implementation manner of the first aspect, the electronic device displays the first device information on the scanning interface of the first Bluetooth application, and the electronic device displays the second device information through a pop-up window or a notification message.
[0011] In a possible implementation manner of the first aspect, the first Bluetooth application can run in the background, the second Bluetooth application can run in the background, and the electronic device can display the first device information of the first Bluetooth device that sends the first Bluetooth broadcast in the manner of a pop-up window or a notification message. The electronic device can display the second device information of the first Bluetooth device that sends the second Bluetooth broadcast in the manner of a pop-up window or a notification message.
[0012] In a possible implementation manner of the first aspect, the first Bluetooth application can run in the foreground, and the second Bluetooth application can run in the background. The electronic device can display the first device information on the scanning interface of the first Bluetooth application, and the electronic device displays the second device information through a pop-up window or a notification message.
[0013] In a possible implementation of the first aspect, the first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service among the multiple Bluetooth services includes a corresponding third filtering condition. The electronic device can receive a user's selection operation on a first target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application. After that, during the process of scanning Bluetooth broadcasts, the electronic device can identify whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition. Finally, the electronic device displays first device information of a first Bluetooth device that sends the first Bluetooth broadcast, and displays second device information of a second Bluetooth device that sends the second Bluetooth broadcast; wherein, the first Bluetooth broadcast meets the first filtering condition, and the second Bluetooth broadcast meets the second filtering condition. Among them, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
[0014] In this application, the Bluetooth application can include multiple Bluetooth services, and each Bluetooth service among the multiple Bluetooth services includes its own corresponding third filtering condition. The electronic device can also receive a user's selection operation on a first target Bluetooth service among the multiple Bluetooth services. When scanning Bluetooth broadcasts, according to the third filtering condition of the first target Bluetooth service and the second filtering condition, it can accurately screen out Bluetooth broadcasts sent by Bluetooth devices that support the first target Bluetooth service, and Bluetooth broadcasts sent by Bluetooth devices that support the second Bluetooth application.
[0015] In a possible implementation of the first aspect, the electronic device can update and obtain the filtering condition of the first Bluetooth application in response to an operation on the first Bluetooth application. Specifically, after the electronic device displays the first device information of the first Bluetooth device that sends the first Bluetooth broadcast, the electronic device can also receive a user's selection operation on a second target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application. After that, in response to the selection operation on the second target Bluetooth service, during the process of scanning Bluetooth broadcasts, the electronic device can identify whether the scanned Bluetooth broadcast meets the fourth filtering condition or the second filtering condition; the fourth filtering condition is the third filtering condition corresponding to the second target Bluetooth service. The electronic device displays third device information of a third Bluetooth device that sends the third Bluetooth broadcast; the third Bluetooth broadcast meets the fourth filtering condition. In this way, it can screen out Bluetooth broadcasts sent by Bluetooth devices that support the target Bluetooth service selected by the user in response to different selections of the user, shorten the scanning duration, and thus shorten the Bluetooth connection duration.
[0016] In a possible implementation of the first aspect, the electronic device further includes a third Bluetooth application without a set filtering condition. During the process of scanning Bluetooth broadcasts, after the electronic device identifies whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition, the electronic device can also run the third Bluetooth application in response to a user's operation to start the third Bluetooth application; wherein, the third Bluetooth application does not have a set filtering condition. After that, during the process of scanning Bluetooth broadcasts, the electronic device identifies whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition.
[0017] The electronic device further includes a third Bluetooth application without a set filtering condition. In the conventional technology, the first Bluetooth application starts first, and the electronic device filters the scanned Bluetooth broadcasts according to the first filtering condition. After the third Bluetooth application starts later, since the third Bluetooth application does not have a set filtering condition, the electronic device does not filter the scanned Bluetooth broadcasts, which causes the first filtering condition to fail, and the first Bluetooth application cannot effectively obtain the required Bluetooth broadcasts. In this application, the electronic device first filters the scanned Bluetooth broadcasts according to the first filtering condition and the second filtering condition. After that, when the third Bluetooth application starts, the electronic device still filters the scanned Bluetooth broadcasts according to the first filtering condition and the second filtering condition. This application will not cause the first filtering condition and the second filtering condition to fail, and can scan the Bluetooth broadcasts required by the first Bluetooth application and the second Bluetooth application. Moreover, the electronic device can display all the scanned Bluetooth broadcasts on the scanning interface of the third Bluetooth application.
[0018] In a possible implementation of the first aspect, in response to the Bluetooth function being turned on, the electronic device scans Bluetooth broadcasts.
[0019] In a possible implementation of the first aspect, the Bluetooth architecture in the electronic device may include a Bluetooth application, a Bluetooth host, and a Bluetooth chip. The Bluetooth chip can obtain the first filtering condition and the second filtering condition through the Bluetooth host. During the process of scanning Bluetooth broadcasts, the Bluetooth chip identifies whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition. The Bluetooth chip reports the first device information to the first Bluetooth application through the Bluetooth host, and reports the second device information to the second Bluetooth application through the Bluetooth host.
[0020] The first Bluetooth application displays the first device information, and the second Bluetooth application displays the second device information. The ways for the Bluetooth applications running in the foreground and the background to display device information are different. Specifically, the first Bluetooth application running in the background and the second Bluetooth application running in the background can display the first device information and the second device information in the form of a pop-up window or a notification message. The first Bluetooth application running in the foreground can display the first device information on the scanning interface of the first Bluetooth application. The second Bluetooth application running in the background can display the second device information in the form of a pop-up window or a notification message.
[0021] In a possible implementation of the first aspect, the Bluetooth application can instruct the Bluetooth chip to obtain filtering conditions through the Bluetooth host. Specifically, in the present application, the first Bluetooth application instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host, and the second Bluetooth application instructs the Bluetooth chip to obtain the second filtering condition through the Bluetooth host; the Bluetooth chip obtains the first filtering condition in response to the instruction of the first Bluetooth application and obtains the second filtering condition in response to the instruction of the second Bluetooth application.
[0022] In a possible implementation of the first aspect, the Bluetooth application and the Bluetooth host can instruct the Bluetooth chip to obtain filtering conditions through command interaction. Specifically, the first Bluetooth application sends a first scan command to the Bluetooth host; in response to the first scan command, the Bluetooth host sends a first HCI command to the Bluetooth chip; in response to the first HCI command, the Bluetooth chip obtains the first filtering condition of the first Bluetooth application; in response to the Bluetooth function being turned on, the second Bluetooth application sends a second scan command to the Bluetooth host; in response to the second scan command, the Bluetooth host sends a second HCI command to the Bluetooth chip; in response to the second HCI command, the Bluetooth chip obtains the second filtering condition of the second Bluetooth application.
[0023] In a possible implementation of the first aspect, the first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service in the multiple Bluetooth services includes a corresponding third filtering condition. Before the first Bluetooth application instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host, the method further includes: the first Bluetooth application receives a selection operation by the user on a first target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application; wherein, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service. In the present application, the Bluetooth chip can accurately screen out Bluetooth broadcasts sent by Bluetooth devices that support the first target Bluetooth service and Bluetooth broadcasts sent by Bluetooth devices that support the second Bluetooth application.
[0024] In a possible implementation of the first aspect, after the first Bluetooth application displays the first device information and the second Bluetooth application displays the second device information, the method further includes: the first Bluetooth application receives a selection operation of a second target Bluetooth service among multiple Bluetooth services of the first Bluetooth application; in response to the selection operation of the second target Bluetooth service, during the process of scanning Bluetooth broadcasts, it is identified whether the scanned Bluetooth broadcast meets the fourth filtering condition or the second filtering condition, including: in response to the selection operation of the second target Bluetooth service, the first Bluetooth application instructs the Bluetooth chip to obtain the fourth filtering condition through the Bluetooth host; during the process of the Bluetooth chip scanning Bluetooth broadcasts, it is identified whether the scanned Bluetooth broadcast meets the fourth filtering condition or the second filtering condition; the first Bluetooth application displays the third device information of a third Bluetooth device that sends a third Bluetooth broadcast; wherein, the third Bluetooth broadcast meets the fourth filtering condition. In this application, the Bluetooth chip can, according to different selections of the user, filter out Bluetooth broadcasts sent by Bluetooth devices that support the target Bluetooth service selected by the user, shorten the scanning duration, and thus shorten the Bluetooth connection duration.
[0025] In a possible implementation of the first aspect, the electronic device further includes a Bluetooth host and a Bluetooth chip. The first Bluetooth application sends a fifth filtering condition to the Bluetooth chip through the Bluetooth host, and the fifth filtering condition is the union of the first filtering condition and the second filtering condition. During the process of the Bluetooth chip scanning Bluetooth broadcasts, it is identified whether the scanned Bluetooth broadcast meets the fifth filtering condition, wherein if the Bluetooth broadcast meets the fifth filtering condition, then the Bluetooth broadcast meets the first filtering condition or the second filtering condition. The Bluetooth chip reports the first device information to the first Bluetooth application through the Bluetooth host, and reports the second device information to the second Bluetooth application through the Bluetooth host; the first Bluetooth application displays the first device information, and the second Bluetooth application displays the second device information.
[0026] The first Bluetooth application displays the first device information, and the second Bluetooth application displays the second device information. The way of displaying device information by the Bluetooth application running in the foreground is different from that of the Bluetooth application running in the background. Specifically, the first Bluetooth application running in the background and the second Bluetooth application running in the background can display the first device information and the second device information in the form of a pop-up window or a notification message. The first Bluetooth application running in the foreground can display the first device information on the scanning interface of the first Bluetooth application. The second Bluetooth application running in the background can display the second device information in the form of a pop-up window or a notification message.
[0027] In a possible implementation of the first aspect, the first Bluetooth application includes multiple Bluetooth services, and each of the multiple Bluetooth services includes a corresponding third filtering condition. Before the first Bluetooth application sends a fifth filtering condition to the Bluetooth chip through the Bluetooth host, the first Bluetooth application receives a selection operation by the user for a first target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application. The first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
[0028] In a possible implementation of the first aspect, after the first Bluetooth application displays first device information and the second Bluetooth application displays second device information, the first Bluetooth application receives a selection operation by the user for a second target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application. In response to the selection operation for the second target Bluetooth service, the first Bluetooth application sends a sixth filtering condition to the Bluetooth chip through the Bluetooth host. The sixth filtering condition is the union of the fourth filtering condition and the second filtering condition. During the process of the Bluetooth chip scanning Bluetooth broadcasts, it identifies whether the scanned Bluetooth broadcasts meet the sixth filtering condition. Among them, if the Bluetooth broadcasts meet the sixth filtering condition, then the Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition. The first Bluetooth application displays third device information of a third Bluetooth device that sends a third Bluetooth broadcast. The third Bluetooth broadcast meets the fourth filtering condition.
[0029] In a second aspect, an electronic device is provided. The electronic device includes: a memory, a wireless communication module, a display screen, and one or more processors. The wireless communication module receives and sends data under the control of the processor to implement communication between the electronic device and other electronic devices. The memory and the display screen are coupled to the processor. Among them, the memory is used to store computer program code, and the computer program code includes computer instructions. When the computer instructions are executed by the processor, the electronic device executes the method as described in the first aspect.
[0030] In a third aspect, the present application provides a chip system, and this chip system can be applied to an electronic device including a memory. The chip system includes one or more interface circuits and one or more processors. The interface circuits and the processors are interconnected by lines. The interface circuits are used to receive a signal from the above-mentioned memory and send the signal to the processor, and the signal includes computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device executes the method as described in the first aspect and any of its possible design manners.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium, and this computer-readable storage medium includes computer instructions. When the computer instructions run on the electronic device, the electronic device is caused to execute the method as described in the first aspect and any of its possible design manners.
[0032] In a fifth aspect, the present application provides a computer program product, which, when running on a computer, causes the computer to execute the method according to the first aspect and any possible design thereof.
[0033] It can be understood that for the beneficial effects that can be achieved by the electronic device in the second aspect and the computer program product in the fifth aspect above, reference can be made to the beneficial effects in the first aspect and any possible design thereof, which will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 FIG. is a schematic structural diagram of a communication system provided by an embodiment of the present application;
[0035] Figure 2 FIG. is a schematic diagram for comparing different scanning methods of an electronic device provided by an embodiment of the present application;
[0036] Figure 3 FIG. is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application;
[0037] Figure 4 FIG. is a schematic software and hardware architecture diagram of an electronic device provided by an embodiment of the present application;
[0038] Figure 5 FIG. is a schematic flowchart of a Bluetooth scanning method provided by an embodiment of the present application;
[0039] Figure 6A FIG. is a schematic flowchart of another Bluetooth scanning method provided by an embodiment of the present application;
[0040] Figure 6B FIG. is a schematic flowchart of yet another Bluetooth scanning method provided by an embodiment of the present application;
[0041] Figure 7 FIG. is a schematic interface diagram of an electronic device starting a Bluetooth application provided by an embodiment of the present application;
[0042] Figure 8 FIG. is a schematic display interface diagram of an electronic device provided by an embodiment of the present application;
[0043] Figure 9 FIG. is a schematic flowchart of another Bluetooth scanning method provided by an embodiment of the present application;
[0044] Figure 10 FIG. is a schematic diagram of a Bluetooth scanning method of an electronic device provided by an embodiment of the present application;
[0045] Figure 11 FIG. is a schematic diagram of a PC and a mobile phone establishing a super call service provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0046] Bluetooth is a short - range wireless communication technology with the advantages of low cost and high data transmission speed, and is widely used in short - range data transmission between devices. For example, after establishing a Bluetooth connection, a mobile phone can exchange data with devices such as smart watches, Bluetooth speakers, and wireless earphones. Another example is that a laptop computer can exchange data with a Bluetooth mouse, a Bluetooth stylus, and a Bluetooth keyboard after establishing a Bluetooth connection. The data can include various types of data such as audio data, video data, text data, and application data.
[0047] The process of an electronic device establishing a Bluetooth connection includes Bluetooth broadcast scanning and connection. Taking the electronic device as a PC as an example, the Figure 1 connection process of Bluetooth will be introduced. Figure 1 Shown is a schematic structural diagram of a communication system composed of a personal computer (PC) and Bluetooth earphones. As Figure 1 shown, the Bluetooth architecture on the PC side includes a Bluetooth application 101, a Bluetooth host 102, and a Bluetooth chip 103.
[0048] The Bluetooth application 101 can be an application that supports Bluetooth communication. The Bluetooth application 101 can send Bluetooth scanning instructions, Bluetooth connection instructions, receive data from other Bluetooth devices, and send data to other Bluetooth devices through an interface. The Bluetooth application 101 can be a collaborative APP, a sharing APP, an audio APP, a video APP, a settings APP, etc. that support data transmission via Bluetooth.
[0049] The Bluetooth host 102 stores the Bluetooth protocols required for Bluetooth communication. The Bluetooth host 102 is the core part of the Bluetooth architecture. The Bluetooth host 102 communicates with the Bluetooth chip 103 through the host controller interface (HCI) between the Bluetooth host and the Bluetooth chip. Among them, the Bluetooth host 102 communicates with other Bluetooth devices through the Bluetooth chip 103 and provides Bluetooth functions such as file transfer and audio transmission. The Bluetooth chip 103 is used to communicate with other Bluetooth devices in response to the instructions of the Bluetooth host 102. The Bluetooth chip 103 communicates with the Bluetooth host 102 through the HCI interface.
[0050] Taking the settings APP as an example, in response to the user turning on the Bluetooth switch in the interface of the settings APP, the settings APP interface calls to instruct the Bluetooth host 102 to start a Bluetooth broadcast scanning task. In response to this instruction, the Bluetooth host 102 issues a scanning instruction to the Bluetooth chip 103 through the HCI interface. In response to this scanning instruction, the Bluetooth chip 103 obtains the Bluetooth broadcasts sent by the near-field Bluetooth devices. Among them, the Bluetooth broadcasts may include device information, and the device information may be one or more of various types of information such as the device MAC address, device type, device name, and device identity (Identity document, ID).
[0051] Exemplarily, a Bluetooth headset may include a Bluetooth chip 1, and the Bluetooth chip 1 may send out Bluetooth broadcasts. After the Bluetooth chip 103 obtains a Bluetooth broadcast (such as the Bluetooth broadcast sent by the Bluetooth headset), it can report the Bluetooth broadcast to the Bluetooth host 102 through the HCI interface. The Bluetooth host 102 may return the device information carried in the Bluetooth broadcast to the settings APP. For example, the Bluetooth host 102 returns the device name of the Bluetooth device to the settings APP. The settings APP may display the device information of the scanned Bluetooth devices in the available device list. After that, in response to the user clicking on the target device name in the available device list, the settings APP triggers the Bluetooth host 102 to start a Bluetooth connection task. For example, in response to the user connecting to the Bluetooth headset in the settings APP, the Bluetooth chip negotiates with the Bluetooth chip 1 in the Bluetooth headset to establish a Bluetooth connection.
[0052] As described above, after the Bluetooth chip 103 scans a Bluetooth broadcast, it will report the Bluetooth broadcast to the Bluetooth host 102. In this way, the Bluetooth chip 103 will report to the Bluetooth host 102 all the Bluetooth broadcasts that the Bluetooth chip 103 can scan. After that, the Bluetooth host 102 will process each Bluetooth broadcast one by one and return the device name in each of them to the settings application one by one. The interaction times between the Bluetooth chip and the Bluetooth host are numerous, and the Bluetooth host needs to receive the device information of all Bluetooth devices, process each piece of device information, and report the name of each Bluetooth device to the settings application, resulting in a long time consumption and high power consumption during the Bluetooth connection process of the electronic device.
[0053] Generally, the power consumption of the electronic device can be reduced by setting filtering conditions to reduce the number of Bluetooth broadcasts reported by the Bluetooth chip to the Bluetooth host. However, the Bluetooth broadcasts filtered by the existing filtering methods cannot meet the requirements of multiple Bluetooth applications.
[0054] Exemplarily, taking an electronic device that includes a first Bluetooth application and a second Bluetooth application, where the first Bluetooth application is a fast pairing APP and the second Bluetooth application is a computer manager APP as an example.
[0055] As Figure 2As shown in 2a, after the quick pairing APP is launched, the quick pairing APP can instruct the Bluetooth chip through the Bluetooth host to screen Bluetooth broadcasts that meet filtering condition A according to filtering condition A. Filtering condition A can be used to screen Bluetooth broadcasts sent by Bluetooth devices that support the quick pairing APP.
[0056] As Figure 2 As shown in 2a, after the computer management APP is launched, the computer management APP will instruct the Bluetooth chip through the Bluetooth host to screen Bluetooth broadcasts that meet filtering condition B according to filtering condition B, instead of screening Bluetooth broadcasts according to filtering condition A. Among them, filtering condition B can be used to screen Bluetooth broadcasts sent by Bluetooth devices that support device collaboration.
[0057] In the conventional technology, the Bluetooth chip will respond to the instruction of the recently launched computer management APP, clear the filtering condition of the quick pairing APP launched before the computer management APP, and screen Bluetooth broadcasts according to the filtering condition B of the computer management APP. This fails to effectively screen Bluetooth broadcasts sent by Bluetooth devices that support the quick pairing APP, resulting in the quick pairing APP being unable to obtain Bluetooth broadcasts, and further causing the function of the quick pairing APP to fail. If the computer management APP is launched first and then the quick pairing APP is launched. Using the conventional technology, the Bluetooth chip will respond to the instruction of the recently launched quick pairing APP, clear the filtering condition B of the computer management APP launched before the quick pairing APP, and screen Bluetooth broadcasts according to the filtering condition A of the quick pairing APP. This fails to effectively screen Bluetooth broadcasts sent by Bluetooth devices that support the computer management APP, resulting in the computer management APP being unable to obtain Bluetooth broadcasts, and further causing the function of the computer management APP to fail.
[0058] Therefore, an embodiment of the present application provides a Bluetooth broadcast filtering method and an electronic device. The method is applied to an electronic device. Different filtering conditions can be set for different Bluetooth applications in the electronic device. For example, a first filtering condition is set for the first Bluetooth application. The first filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices that support the first Bluetooth application, that is, the first filtering condition is used to filter Bluetooth broadcasts that meet the requirements of the first Bluetooth application. A second filtering condition is set for the second Bluetooth application. The second filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices that support the second Bluetooth application, that is, the second filtering condition is used to filter Bluetooth broadcasts that meet the requirements of the second Bluetooth application.
[0059] In this solution, when the electronic device enables the Bluetooth function, it can obtain the filtering conditions of the above different Bluetooth applications. For example, the first filtering condition of the first Bluetooth application and the second filtering condition of the second Bluetooth application. Then, during the process of scanning Bluetooth broadcasts, the electronic device can identify whether the scanned Bluetooth broadcasts meet each of the above filtering conditions (such as the first filtering condition and the second filtering condition). If a Bluetooth broadcast meets any of the above filtering conditions (such as the first filtering condition or the second filtering condition), the electronic device can reflect the device information of the Bluetooth device that sent the Bluetooth broadcast in the scan result. Specifically, the electronic device can display the first device information of the Bluetooth broadcast that meets the first filtering condition, and can also display the second device information of the Bluetooth broadcast that meets the second filtering condition.
[0060] Combined with the above example, in this solution, as Figure 2 shown in 2b, the Quick Pairing APP sets the filtering condition A for the Bluetooth chip through the Bluetooth host, and the Computer Manager APP sets the filtering condition B for the Bluetooth chip through the Bluetooth host. When the Bluetooth chip scans the near-field Bluetooth broadcasts, it takes A∪B as the target filtering condition. The Bluetooth chip filters the near-field Bluetooth broadcasts according to A∪B. That is, the Bluetooth chip filters the Bluetooth broadcasts that meet the filtering condition A or the filtering condition B. The Bluetooth chip reports the Bluetooth broadcasts that meet A∪B to the Settings APP and the Computer Manager APP respectively. Or, the Bluetooth chip creates two threads. Thread A is used to filter the Bluetooth broadcasts that meet the filtering condition A, and thread B is used to filter the Bluetooth broadcasts that meet the filtering condition B. Then, thread A reports the Bluetooth broadcasts that meet the filtering condition A to the Settings APP, and thread B reports the Bluetooth broadcasts that meet the filtering condition B to the Computer Manager APP.
[0061] In the conventional solution, when multiple different Bluetooth applications are running on the electronic device, the electronic device can only filter the scanned Bluetooth broadcasts according to the filtering conditions of the latest started Bluetooth application, and clears the filtering conditions of the Bluetooth applications started before this Bluetooth application. This causes the filtering conditions of the Bluetooth applications started before this Bluetooth application to become invalid, which may cause the functions of the Bluetooth applications started before this Bluetooth application to fail. In this application, multiple (at least two) different Bluetooth applications can run on the electronic device, and the electronic device can simultaneously scan the Bluetooth broadcasts that support different Bluetooth applications based on the different filtering conditions of different Bluetooth applications. In this way, it can be avoided that after starting a new Bluetooth application, the filtering conditions of the previously started Bluetooth applications become invalid. This application can meet the scanning requirements of different Bluetooth applications, and moreover, the electronic device can display the first device information of the Bluetooth device that sends the first Bluetooth broadcast that meets the first filtering condition to the user, and display the second device information of the Bluetooth device that sends the second Bluetooth broadcast that meets the second filtering condition to the user, which helps the user quickly and conveniently trigger the Bluetooth connection between the electronic device and the Bluetooth device.
[0062] The method provided by the embodiments of the present application can be applied to an electronic device with data processing capabilities. The above-mentioned electronic device may include a server, a mobile phone, a tablet computer, a laptop computer, a personal computer (PC), an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a smart home device (such as a smart TV, a smart screen, a large screen, a smart speaker, a smart air conditioner, etc.), a personal digital assistant (PDA), a wearable device (such as a smart watch, a smart bracelet, etc.), a vehicle-mounted device, a virtual reality device, etc. The embodiments of the present application do not make any restrictions on this. In the embodiments of the present application, the above-mentioned electronic device is an electronic device that can run an operating system and install application programs. Optionally, the operating system run by the electronic device may be system.
[0063] Exemplarily, please refer to Figure 3 , which shows a schematic structural diagram of an electronic device 300. The electronic device 300 may include a processor 310, an external memory interface 320, an internal memory 321, an audio module 330, a speaker 330A, a microphone 330B, a display screen 340, a wireless communication module 350, a power module 360, an input device 370, a sensor module 380, etc. Among them, the sensor module 380 may include a pressure sensor, a touch sensor, etc.
[0064] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 300. In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0065] The processor 310 may include one or more processing units. For example, the processor 310 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent components or integrated in one or more processors. In some embodiments, the electronic device 300 may also include one or more processors 310.
[0066] Among them, the controller is the nerve center and command center of the electronic device 300. It can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0067] The operating system of the electronic device 300 can run on the application processor, which is used to manage the hardware and software resources of the electronic device 300. For example, manage and configure memory, determine the priority order of system resource supply and demand, control input and output devices, operate the network, manage the file system, manage drivers, etc. The operating system can also be used to provide an operation page for users to interact with the system. Among them, various software can be installed in the operating system, such as drivers, applications (Apps), etc.
[0068] The NPU is a neural-network (NN) computing processor. By learning from the structure of biological neural networks, such as the transmission mode between human brain neurons, it can quickly process input information and can also continuously self-learn. Through the NPU, applications such as intelligent cognition of the electronic device 300 can be realized.
[0069] A memory may also be provided in the processor 310 for storing instructions and data. In some embodiments, the memory in the processor 310 is a cache memory. This memory can store the instructions or data that the processor 310 has just used or recycled. If the processor 310 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 310, and thus improves the efficiency of the system.
[0070] In some embodiments, the processor 310 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an integrated circuit sound (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 SIM card interface, and / or a USB interface, etc.
[0071] It can be understood that the interface connection relationships among the modules illustrated in the embodiments of the present application are only illustrative descriptions and do not constitute a structural limitation on the electronic device 300. In some other embodiments of the present application, the electronic device 300 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0072] The external memory interface 320 may be used to connect to an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 300. The external memory card communicates with the processor 310 through the external memory interface 320 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.
[0073] The internal memory 321 may be used to store one or more computer programs, and the one or more computer programs include instructions. The processor 310 may execute the above instructions stored in the internal memory 321, so that the electronic device 300 executes the application running method provided in some embodiments of the present application, as well as various applications and data management, etc. The internal memory 321 may include a code storage area and a data storage area. Among them, the data storage area may store data created during the use of the electronic device 300, etc. In addition, the internal memory 321 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more disk storage components, flash memory components, universal flash storage (UFS), etc. In some embodiments, the processor 310 may execute the application running method provided in the embodiments of the present application, as well as other applications and data management, by running the instructions stored in the internal memory 321 and / or the instructions stored in the memory provided in the processor 310.
[0074] The electronic device 300 can implement audio functions through the audio module 330, the speaker 330A, the microphone 330B, and the application processor, etc. For example, music playback, recording, etc. The audio module 330 is used to convert digital audio information into an analog audio signal for output, and is also used to convert an analog audio input into a digital audio signal. The audio module 330 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 330 can be disposed in the processor 310, or some functional modules of the audio module 330 can be disposed in the processor 310.
[0075] The speaker 330A, also known as the "loudspeaker", is used to convert an audio electrical signal into a sound signal.
[0076] The microphone 330B, also known as the "microphone" or "transmitter", is used to convert a sound signal into an electrical signal. The user can make a sound close to the microphone 330B with the mouth, and input the sound signal into the microphone 330B.
[0077] The communication function of the electronic device 300 can be implemented through the antenna 1, the antenna 2, and the wireless communication module 350, etc.
[0078] The wireless communication module 350 can provide wireless communication solutions applied to the electronic device 300, including cellular, Wi-Fi, Bluetooth (BT), wireless data transmission modules (such as 433 MHz, 868 MHz, 915 MHz), etc. The wireless communication module 350 can be one or more devices integrating at least one communication processing module. The wireless communication module 350 receives electromagnetic waves via the antenna 1 or the antenna 2, filters and frequency-modulates the electromagnetic wave signals, and sends the processed signals to the processor 310. The wireless communication module 350 can also receive the signals to be sent from the processor 310, frequency-modulate and amplify them, and convert them into electromagnetic waves through the antenna 1 or the antenna 2 for radiation.
[0079] The electronic device 300 implements a display function through the GPU, the display screen 340, and the application processor, etc. The GPU is a microprocessor for image processing, and is connected to the display screen 340 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 310 may include one or more GPUs, which execute program instructions to generate or change display information.
[0080] The display screen 340 is used to display images, videos, etc. The display screen 340 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicrOLED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include one or N display screens 340, where N is a positive integer greater than 1. In the embodiments of the present application, the display screen 340 can be used to display the UI and receive user operations on the UI.
[0081] In some embodiments, a pressure sensor, a touch sensor, etc. are provided on the display screen 340. The pressure sensor is used to sense pressure signals and can convert the pressure signals into electrical signals. When a touch operation acts on the display screen 340, the electronic device 300 detects the intensity of the touch operation according to the pressure sensor. The electronic device 300 can also calculate the position of the touch according to the detection signal of the pressure sensor. The touch sensor, also called the "touch panel", can form a touch screen, also called the "touch screen", with the display screen 340. The touch sensor is used to detect touch operations acting on or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can also be provided through the display screen 340. The power module 360 can be used to supply power to each component included in the electronic device 300. In some embodiments, the power module 360 can be a battery, such as a rechargeable battery.
[0082] The input device 370 may include a keyboard, a mouse, etc. The keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device 300, thereby sending commands to the electronic device 300 and inputting data, etc. The mouse is an indicator for positioning the horizontal and vertical coordinates of the display system of the electronic device 300 and is used to input instructions to the electronic device 300, etc. Among them, the input device 370 can be connected to the electronic device 300 by a wired connection method. For example, the input device 370 is connected to the electronic device 300 through a GPIO interface, a USB interface, etc. The input device 370 can also be connected to the electronic device 300 wirelessly. For example, the input device 370 is connected to the electronic device 300 through Bluetooth, infrared, etc.
[0083] Taking the above electronic device 300 as a PC as an example. The software system of the electronic device 300 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, taking the system as an example, the software structure of the electronic device 300 will be exemplarily described below in conjunction with Figure 4 the following.
[0084] Figure 4 is the software structure block diagram of the electronic device 300 in the embodiments of the present invention.
[0085] In the PC, the operating system can generally be divided into a kernel mode and a user mode. Among them, the application layer can run in the user mode. The application layer can include applications such as a camera, a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, and social applications. In the embodiments of the present application, the application layer can include a Bluetooth application, and the Bluetooth application can be a settings APP, a collaboration APP, a sharing APP, a computer manager APP, etc.
[0086] Furthermore, the computer manager APP provides a user-interactive interface to implement pop-up reminders and Bluetooth pairing connections. The computer manager APP can also include functional modules such as Nearby and a short-range connection module. Nearby discovers nearby devices and communicates with them based on technologies such as Bluetooth, Wi-Fi, and ultrasonic waves, including data transmission between devices and message subscriptions. The short-range connection module is used to connect Bluetooth devices and has ranging capabilities.
[0087] In some embodiments, other components can also be included in the user mode of the second device. For example, subsystems corresponding to each application can be set in the user mode. When an application (such as the computer manager APP) runs, it can call the application programming interface (native application programming interface, API) in the corresponding subsystem to achieve internal communication with the kernel mode. For example, the application calls the API function of the subsystem, and the subsystem converts the API function into a native API (Native API). The Native API can correspond to a system service function, and the system service function can be passed to the kernel mode to call the corresponding module to implement the corresponding function.
[0088] Taking Figure 4 as an example, the kernel mode can include a Bluetooth host, a Bluetooth link manager, and an HCI interface. The hardware includes a wireless communication module, a display screen, a Bluetooth chip, etc.
[0089] The following takes an electronic device being a PC as an example to introduce a Bluetooth scanning method provided by an embodiment of the present application. After the PC enables the Bluetooth function, the PC can filter Bluetooth broadcasts that meet the filtering conditions of multiple Bluetooth applications based on the filtering conditions of multiple Bluetooth applications.
[0090] Taking the PC including a first Bluetooth application and a second Bluetooth application as an example. The PC enables the Bluetooth function, and the first Bluetooth application and the second Bluetooth application are running in the PC. The first Bluetooth application includes a corresponding first filtering condition, and the first filtering condition is used to filter Bluetooth broadcasts sent by Bluetooth devices that support the first Bluetooth application. The second Bluetooth application includes a corresponding second filtering condition, and the second filtering condition is used to filter Bluetooth broadcasts sent by Bluetooth devices that support the second Bluetooth application. During the process of the PC scanning Bluetooth broadcasts, it identifies whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition. The PC displays the first device information of the first Bluetooth device that sends the first Bluetooth broadcast, and the PC displays the second device information of the second Bluetooth device that sends the second Bluetooth broadcast. Among them, the first Bluetooth broadcast meets the first filtering condition, and the second Bluetooth broadcast meets the second filtering condition. The first filtering condition is different from the second filtering condition.
[0091] Optionally, in response to the PC enabling the Bluetooth function, the PC scans Bluetooth broadcasts sent by near-field devices.
[0092] The PC may further include a Bluetooth host and a Bluetooth chip. The first Bluetooth application and the second Bluetooth application interact with the Bluetooth host and the Bluetooth chip, enabling the PC to execute a Bluetooth scanning method provided by an embodiment of the present application, as Figure 5 shown.
[0093] S501, the Bluetooth function of the PC is enabled (not shown in the figure).
[0094] In response to the user turning on the Bluetooth switch, the PC enables the Bluetooth function. For example, in response to the user clicking the Bluetooth switch in the status bar of the PC, in response to the user turning on the Bluetooth switch in the Settings APP, or in response to the user inputting a startup instruction to turn on the Bluetooth switch, the PC enables the Bluetooth function.
[0095] S502, the Bluetooth chip obtains the first filtering condition of the first Bluetooth application.
[0096] The first filtering condition is used to filter Bluetooth broadcasts sent by Bluetooth devices that support fast pairing.
[0097] S503, the Bluetooth chip obtains the second filtering condition of the second Bluetooth application.
[0098] The second filtering condition is used to filter Bluetooth broadcasts sent by Bluetooth devices that support device collaboration.
[0099] A Bluetooth application is an application that implements Bluetooth services based on a Bluetooth connection, such as a collaborative APP, a sharing APP, an audio APP or a video APP that supports data transmission via Bluetooth. The Bluetooth application can also be an APP for managing Bluetooth connections, such as a settings APP. In some embodiments, the PC provides various Bluetooth connection functions, such as a quick pairing function, a proximity discovery function, etc. The above Bluetooth connection functions can also be regarded as Bluetooth applications.
[0100] In some embodiments, after the Bluetooth function of the PC is turned on, the Bluetooth chip can actively obtain the filtering conditions of each Bluetooth application through the Bluetooth host. Among them, each Bluetooth application can run in the background or in the foreground. For example, in response to the PC turning on the Bluetooth function, the Bluetooth chip actively obtains the filtering conditions of a preset Bluetooth application. The preset Bluetooth application can run in the background.
[0101] In some other embodiments, after the Bluetooth function of the PC is turned on, the Bluetooth application can actively notify the Bluetooth chip of the filtering conditions of the Bluetooth application through the Bluetooth host. Exemplarily, as Figure 6A shown, before the Bluetooth chip executes S502, the method further includes S601 - S602:
[0102] S601, the first Bluetooth application instructs the Bluetooth chip to obtain the first filtering condition of the first Bluetooth application through the Bluetooth host.
[0103] Among them, the first Bluetooth application can instruct the Bluetooth chip to obtain the first filtering condition of the first Bluetooth application through the Bluetooth host in response to the PC's Bluetooth function being turned on or in response to the user's first operation.
[0104] S602, the second Bluetooth application instructs the Bluetooth chip to obtain the second filtering condition of the second Bluetooth application through the Bluetooth host.
[0105] Among them, the second Bluetooth application can instruct the Bluetooth chip to obtain the second filtering condition of the second Bluetooth application through the Bluetooth host in response to the PC's Bluetooth function being turned on or in response to the user's second operation.
[0106] For example, both the first Bluetooth application and the second Bluetooth application are Bluetooth applications running in the background. The first Bluetooth application and the second Bluetooth application can detect in real time whether the PC's Bluetooth function is turned on. After the PC turns on the Bluetooth function, they actively instruct the Bluetooth chip to obtain the first filtering condition and the second filtering condition through the Bluetooth host, and screen Bluetooth broadcasts according to the first filtering condition and the second filtering condition. For example, the first Bluetooth application can be a computer manager APP running in the background, and the second Bluetooth application can be a quick pairing APP running in the background.
[0107] For another example, both the first Bluetooth application and the second Bluetooth application are Bluetooth applications that need to be enabled by the user. For example, the first Bluetooth application can be the unrun computer management APP, and the second Bluetooth application can be the quick pairing APP. In response to the user's first operation, the first Bluetooth application (such as the quick pairing APP) instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host. In response to the user's second operation, the second Bluetooth application (such as the computer management APP) instructs the Bluetooth chip to obtain the second filtering condition through the Bluetooth host.
[0108] Among them, the first operation is used to trigger the first Bluetooth application to instruct the Bluetooth chip to obtain the first filtering condition through the Bluetooth host. Taking the first Bluetooth application as the quick pairing APP as an example, as Figure 7 shown, the quick pairing APP includes an interface 701, and the interface 701 includes a Bluetooth quick pairing switch. After the PC enables the Bluetooth function, in response to the user's click operation (the first operation) on the Bluetooth quick pairing switch in the interface 701, the quick pairing APP instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host.
[0109] The second operation is used to trigger the second Bluetooth application to instruct the Bluetooth chip to obtain the second filtering condition through the Bluetooth host. Taking the second Bluetooth application as the computer management APP as an example, as Figure 8 shown for example, the PC displays the computer desktop, and the computer desktop includes the application icon of the computer management APP. In response to the user's click on the application icon of the computer management APP, the computer management APP instructs the Bluetooth chip to obtain the second filtering condition through the Bluetooth host.
[0110] For another example, one of the first Bluetooth application and the second Bluetooth application runs in the background. For example, the first Bluetooth application runs in the background. After the PC enables the Bluetooth function, the first Bluetooth application actively instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host. The second Bluetooth application instructs the Bluetooth chip to obtain the second filtering condition through the Bluetooth host in response to the user's second operation.
[0111] Exemplarily, the first Bluetooth application can adopt an instruction interaction method to instruct the Bluetooth chip to obtain the first filtering condition of the first Bluetooth application through the Bluetooth host. Specifically, as Figure 6B shown, S601 can include S601a - S601b. The second Bluetooth application can adopt an instruction interaction method to instruct the Bluetooth chip to obtain the second filtering condition of the second Bluetooth application through the Bluetooth host. Specifically, as Figure 6B shown, S602 can include S602a - S602b.
[0112] S601a, the first Bluetooth application sends a first scan instruction to the Bluetooth host.
[0113] Among them, in response to the Bluetooth function of the PC being turned on, the first Bluetooth application can send a first scan instruction to the Bluetooth host. The first scan instruction includes the application identifier of the first Bluetooth application, which is used to uniquely identify the first Bluetooth application, and this identifier can be the name or ID of the first Bluetooth application. For example, the first scan instruction can include the application identifier a of the Computer Manager APP.
[0114] S601b, in response to the first scan instruction, the Bluetooth host sends a first HCI instruction to the Bluetooth chip.
[0115] The first HCI instruction includes the application identifier of the first Bluetooth application. For example, it includes the application identifier of the Computer Manager APP, which is used to uniquely identify the Computer Manager APP, and this identifier can be the name or ID of the Computer Manager APP.
[0116] S602a, the second Bluetooth application sends a second scan instruction to the Bluetooth host.
[0117] Among them, in response to the Bluetooth function of the PC being turned on, the second Bluetooth application can send a second scan instruction to the Bluetooth host. The second scan instruction includes the identifier of the second Bluetooth application, which is used to uniquely identify the second Bluetooth application, and this identifier can be the name or ID of the second Bluetooth application. For example, the second scan instruction can include the application identifier b of the Quick Pairing APP.
[0118] S602b, in response to the second scan instruction, the Bluetooth host sends a second HCI instruction to the Bluetooth chip.
[0119] The second HCI instruction includes the application identifier of the second Bluetooth application. For example, it includes the application identifier of the Quick Pairing APP, which is used to uniquely identify the Quick Pairing APP, and this identifier can be the name or ID of the Quick Pairing APP.
[0120] Exemplarily, the above-mentioned Quick Pairing APP can be a system APP built into the PC, and the Computer Manager APP can be a third-party APP downloaded by the user to the PC. The Quick Pairing APP can send a first scan instruction to the Bluetooth host through the first interface. The Computer Manager APP can send a second scan instruction to the Bluetooth host through the second interface. For example, the first interface and the second interface can be the same or different. The first interface can be a system interface. The second interface can be a Bluetooth driver interface.
[0121] In this embodiment, the Bluetooth chip can execute S502 to obtain the first filtering condition of the first Bluetooth application in response to the indication of the first Bluetooth application. For example, the Bluetooth chip executes S502 to obtain the first filtering condition of the first Bluetooth application in response to the above first HCI command. The Bluetooth chip can execute S503 to obtain the second filtering condition of the second Bluetooth application in response to the indication of the second Bluetooth application. For example, the Bluetooth chip executes S503 to obtain the second filtering condition of the second Bluetooth application in response to the above second HCI command.
[0122] The first filtering condition is used to filter the Bluetooth broadcasts sent by the Bluetooth devices that support the first Bluetooth application. Specifically, the first filtering condition is specifically used to filter the first Bluetooth broadcasts, where the first Bluetooth broadcasts are the Bluetooth broadcasts sent by the Bluetooth devices that can interact with the PC to enable the PC to implement the Bluetooth services of the first Bluetooth application. The second filtering condition is used to filter the Bluetooth broadcasts sent by the Bluetooth devices that support the second Bluetooth application. Specifically, the second filtering condition is used to filter the second Bluetooth broadcasts, where the second Bluetooth broadcasts are the Bluetooth broadcasts sent by the Bluetooth devices that can interact with the PC to enable the PC to implement the Bluetooth services of the second Bluetooth application.
[0123] Exemplarily, the first filtering condition of the fast pairing APP is used to filter out the Bluetooth broadcasts sent by the Bluetooth devices that support Bluetooth fast pairing. The first filtering condition of the proximity discovery APP is used to filter the Bluetooth broadcasts sent by the Bluetooth devices that support proximity discovery. The first filtering condition of the computer manager APP is used to filter the Bluetooth broadcasts sent by the Bluetooth devices that support device collaboration. Optionally, the first filtering condition is also used to filter out the Bluetooth broadcasts sent by the Bluetooth devices of the target type. Among them, the Bluetooth devices of the target type can be the Bluetooth devices of brand A, or the Bluetooth broadcasts with a signal strength greater than or equal to the threshold.
[0124] The filtering conditions (including the first filtering condition and the second filtering condition) can be pre-saved in the Bluetooth chip or the memory. The Bluetooth chip also stores the first mapping relationship between the filtering condition and the Bluetooth application. The Bluetooth chip obtains the first filtering condition based on the first Bluetooth application and the first mapping relationship. The Bluetooth chip obtains the second filtering condition based on the second Bluetooth application and the first mapping relationship. Exemplarily, the filtering condition can be pre-configured in the Bluetooth chip. The Bluetooth chip responds to receiving the first HCI command sent by the Bluetooth host. The Bluetooth chip reads the first filtering condition based on the application identifier in the first HCI command and the first mapping relationship. The Bluetooth chip responds to receiving the second HCI command sent by the Bluetooth host. The Bluetooth chip reads the second filtering condition based on the application identifier in the second HCI command and the first mapping relationship.
[0125] Optionally, the filtering conditions (including the first filtering condition and the second filtering condition) can be sent by the Bluetooth application to the Bluetooth chip. For example, the first scanning instruction includes the first filtering condition, and the second scanning instruction includes the second filtering condition. Or, the first scanning instruction includes the storage address of the first filtering condition, and the second scanning instruction includes the storage address of the second filtering condition. The Bluetooth chip reads the first filtering condition and the second filtering condition from the storage address. Or, the first scanning instruction includes the identifier of the first filtering condition, and the second scanning instruction includes the identifier of the second filtering condition. The Bluetooth chip reads the first filtering condition and the second filtering condition from the multiple stored filtering conditions based on the identifier.
[0126] S504. During the process of the Bluetooth chip scanning Bluetooth broadcasts, identify whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition.
[0127] During the Bluetooth scanning process of the Bluetooth chip, the Bluetooth chip continuously identifies whether each scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition. Exemplarily, the first filtering condition is A, and the second filtering condition is B. The Bluetooth chip filters each scanned Bluetooth broadcast in the manner of A∪B to obtain the first Bluetooth broadcast that meets the first filtering condition or the second Bluetooth broadcast that meets the second filtering condition. The manner of A∪B specifically means that the Bluetooth broadcast only needs to meet any one of the filtering conditions of A or B.
[0128] The Bluetooth broadcast scanned by the Bluetooth chip may only meet the first filtering condition, or only meet the second filtering condition, or may meet both the first filtering condition and the second filtering condition, or may not meet either the first filtering condition or the second filtering condition.
[0129] The Bluetooth chip can identify whether the Bluetooth broadcast meets the first filtering condition or the second filtering condition after scanning a Bluetooth broadcast. That is, the Bluetooth chip individually identifies whether each scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition based on the first filtering condition and the second filtering condition. If the Bluetooth broadcast does not meet the first filtering condition nor the second filtering condition, the Bluetooth chip continues to identify the next scanned Bluetooth broadcast based on the first filtering condition and the second filtering condition.
[0130] Optionally, the Bluetooth chip can cache the scanned Bluetooth broadcasts in a list, and for each Bluetooth broadcast in the list, the Bluetooth chip filters and identifies them one by one based on the first filtering condition and the second filtering condition.
[0131] The Bluetooth chip can filter Bluetooth broadcasts based on fields in the Bluetooth broadcast. Bluetooth devices can broadcast Bluetooth broadcasts based on the Bluetooth protocol. A Bluetooth broadcast can include multiple fields. For example, a Bluetooth broadcast can be a 37-byte data packet. A Bluetooth broadcast can include relevant fields such as device address (e.g., MAC address), Universally Unique Identifier (UUID), transmission power level, device ID, manufacturer identifier, device type, device name, and preset identifier, etc.
[0132] The first filtering condition and the second filtering condition can be whether the Bluetooth broadcast includes a preset field, or whether the field at a preset position in the Bluetooth broadcast is within a preset range, or whether the field at a preset position in the Bluetooth broadcast is a preset field, or whether the field at a preset position in the Bluetooth broadcast is one of multiple preset fields. Among them, the preset field can be one or more of the field of the device name, the field corresponding to the manufacturer identifier, the device UUID field, and the identifier field.
[0133] For example, the Bluetooth broadcast sent by a Bluetooth device that supports proximity discovery carries an identifier field a. The Bluetooth chip can identify whether the Bluetooth broadcast carries the identifier field a to filter the Bluetooth broadcast. Another example, the Bluetooth broadcast sent by a Bluetooth device that supports Bluetooth fast pairing has an identifier field b at a preset position 1. The Bluetooth chip can identify whether the identifier field b is carried at the preset position 1 in the Bluetooth broadcast to filter the Bluetooth broadcast.
[0134] Another example, the Bluetooth broadcast sent by a Bluetooth device of brand A can include an identifier field c. The Bluetooth chip can filter out the Bluetooth devices of brand A based on whether the Bluetooth broadcast includes the identifier field c.
[0135] Another example, the Bluetooth broadcast carries the device type of the Bluetooth device that sent the Bluetooth broadcast. The Bluetooth chip can identify whether the field of the Bluetooth broadcast device type is a preset field to filter the Bluetooth broadcasts sent by the target device type.
[0136] S505, the Bluetooth chip reports the first Bluetooth broadcast that meets the first filtering condition and the second Bluetooth broadcast that meets the second filtering condition to the Bluetooth host respectively.
[0137] S506, the Bluetooth host reports the first device information in the first Bluetooth broadcast to the first Bluetooth application.
[0138] S507, the Bluetooth host reports the second device information in the second Bluetooth broadcast to the second Bluetooth application.
[0139] Exemplarily, the Bluetooth chip obtains the first filtering condition of the fast pairing APP and the second filtering condition of the proximity discovery APP. If the Bluetooth broadcast only meets the first filtering condition, the Bluetooth host reports the Bluetooth broadcast to the fast pairing APP. If the Bluetooth broadcast only meets the second filtering condition, the Bluetooth host reports the Bluetooth broadcast to the proximity discovery APP. If the Bluetooth broadcast meets both the first filtering condition and the second filtering condition, the Bluetooth host reports the Bluetooth broadcast to the fast pairing APP and the proximity discovery APP.
[0140] Optionally, the Bluetooth host reports the Bluetooth broadcasts that meet the first filtering condition and the Bluetooth broadcasts that meet the second filtering condition to the first Bluetooth application. The Bluetooth chip reports the Bluetooth broadcasts that meet the first filtering condition and the Bluetooth broadcasts that meet the second filtering condition to the second Bluetooth application.
[0141] The first device information is the device information of the Bluetooth device that sends the first Bluetooth broadcast. The second device information is the device information of the Bluetooth device that sends the second Bluetooth broadcast. The first Bluetooth broadcast carries the first device information, and the second Bluetooth broadcast carries the second device information. The first device information and the second device information include, but are not limited to, the device name of the Bluetooth device, the MAC address of the Bluetooth device, the manufacturer information of the Bluetooth device, etc.
[0142] Optionally, before the Bluetooth host reports the device information in the first Bluetooth broadcast that meets the filtering condition to the second Bluetooth application and / or the first Bluetooth application, it can first identify the running states of the second Bluetooth application and / or the first Bluetooth application. The Bluetooth chip only reports device information to the running Bluetooth applications and does not report device information to the non-running Bluetooth applications to avoid unnecessary instruction waste.
[0143] In this way, the PC can obtain the first device information of the first Bluetooth broadcast that meets the first filtering condition and the second device information of the second Bluetooth broadcast that meets the second filtering condition. After that, the PC can display the first device information and can also display the second device information. For example, the first Bluetooth application in the PC displays the first device information, and the second Bluetooth application in the PC displays the second device information. After S507, the method further includes:
[0144] S508, the first Bluetooth application displays the first device information.
[0145] S509, the second Bluetooth application displays the second device information.
[0146] Among them, the first Bluetooth application can interact with the underlying layer to trigger the PC's display screen to display the above-mentioned first device information, and the second Bluetooth application can interact with the underlying layer to trigger the PC's display screen to display the second device information. In this article, when the Bluetooth application displays device information, it specifically means that the Bluetooth application triggers the PC's display screen to display the device information.
[0147] The first Bluetooth application can display the first device information in one or more of the following ways: device list, pop-up window, or notification message. The second Bluetooth application can display the second device information in one or more of the following ways: device list, pop-up window, or notification message.
[0148] Optionally, the display interface of the first Bluetooth application and / or the second Bluetooth application includes a control. In response to the user clicking on the control, the first Bluetooth application and / or the second Bluetooth application displays the first device information or the second device information in one or more of the following ways: device list, pop-up window, or notification message.
[0149] In some embodiments, the first Bluetooth application can display the first device information in a preset manner, and the second Bluetooth application can display the second device information in a preset manner. Wherein, the preset manner can include a pop-up window or a notification message.
[0150] In this embodiment, the PC can run the first Bluetooth application and the second Bluetooth application in the background. In this case, the PC can display the first device information and the second device information in the above-mentioned preset manner. For example, the first Bluetooth application is a fast pairing APP running in the background, and the second Bluetooth application is a proximity discovery APP running in the background. The fast pairing APP can display the first device information in a first pop-up window or a first notification message, and the proximity discovery APP can display the second device information in a second pop-up window or a second notification message.
[0151] Of course, in this embodiment, the PC can also run the first Bluetooth application in the foreground and the second Bluetooth application in the background. That is to say, regardless of whether the Bluetooth application runs in the foreground or the background, the PC can display the first device information and the second device information in the above-mentioned preset manner.
[0152] Wherein, the above-mentioned first device information can be triggered by the first Bluetooth application for display, and the second device information can be triggered by the second Bluetooth application for display.
[0153] In some other embodiments, the first Bluetooth application can display the first device information on the scanning interface of the first Bluetooth application, and the second Bluetooth application can display the second device information in a preset manner.
[0154] In this embodiment, the first Bluetooth application can be the Bluetooth application running in the foreground at the current moment, and the second Bluetooth application runs in the background at the current moment. That is to say, when the PC runs the first Bluetooth application in the foreground, it can display the first device information on the scanning interface of the first Bluetooth application running in the foreground. When the PC runs the second Bluetooth application in the background, it can display the second device information in a preset manner. In this way, the second device information does not occupy the display interface of the Bluetooth application running in the foreground.
[0155] Exemplarily, after the PC enables the Bluetooth function, the proximity discovery APP starts and runs in the background. After the Bluetooth chip reports the first broadcast to the Bluetooth host, the Bluetooth host reports the first device information to the proximity discovery APP. The proximity discovery APP can display a pop-up window, which can display "Discover Bluetooth device XXX". The pop-up window can also include a connection control. In response to the user clicking on the connection control, the Bluetooth connection process is triggered. As Figure 8 shown, in response to the user clicking on the application icon of the computer management APP, the computer management APP starts and runs in the foreground. The computer management APP interacts with the Bluetooth host and the Bluetooth chip and executes the method as Figure 5 shown. The computer management APP can display interface 802. Interface 802 includes a list of available devices of Bluetooth devices that can perform device collaboration with the PC. The device information in this list of available devices is the device information of the Bluetooth devices corresponding to the Bluetooth broadcasts that meet the second filtering condition. The second filtering condition can be used to filter the Bluetooth broadcasts sent by Bluetooth devices that support device collaboration with the PC through interaction.
[0156] In this way, when the Bluetooth chip scans the Bluetooth broadcasts sent by the near-field Bluetooth devices, it can filter the scanned Bluetooth broadcasts based on the filtering conditions of multiple different Bluetooth applications. Moreover, the Bluetooth chip can report the Bluetooth broadcasts that meet the filtering conditions of the Bluetooth application to different Bluetooth applications. It can not only accurately scan the Bluetooth broadcasts required by different Bluetooth applications, but also, for one Bluetooth application, the Bluetooth chip only reports the Bluetooth broadcasts that meet the filtering conditions of this Bluetooth application to this Bluetooth application, rather than reporting all the Bluetooth broadcasts. This can reduce the CPU occupancy and system consumption, and thus reduce the power consumption of the PC.
[0157] Furthermore, the first Bluetooth application or the second Bluetooth application can include a type of Bluetooth service. The Bluetooth service includes a device collaboration service, a Bluetooth fast pairing service, and a proximity discovery service. For example, after the PC enables Bluetooth fast pairing, the PC can provide the Bluetooth fast pairing service. The PC has the proximity discovery function and can provide the proximity discovery service. Furthermore, the Bluetooth service can include multiple types of Bluetooth services. For example, the device collaboration APP can provide various device collaboration services such as screen extension, screen mirroring, super call, screen mirroring, super notification, multi-screen collaboration, keyboard and mouse sharing, file sharing, remote control, super camera, and application continuation.
[0158] Taking the first Bluetooth application as an example, the first Bluetooth application can include a first filtering condition. For example, the first Bluetooth application includes a first Bluetooth service, and the first Bluetooth application includes a first filtering condition corresponding to the first Bluetooth service. This first filtering condition is used to screen out the Bluetooth broadcasts sent by the target Bluetooth devices that support the first Bluetooth service.
[0159] The first Bluetooth application may further include third filtering conditions corresponding one-to-one to various types of Bluetooth services. The multiple third filtering conditions correspond one-to-one to various types of Bluetooth services. The third filtering condition is specifically used to filter out Bluetooth broadcasts sent by target Bluetooth devices that support Bluetooth services of a target type with a PC. The target Bluetooth device may be, for example, a device capable of playing audio or video, a peripheral device such as a keyboard or mouse, or a wearable device, etc.
[0160] Different Bluetooth services have different focuses. Therefore, the third filtering conditions for different Bluetooth services are also different. For example, the third filtering condition for the Bluetooth fast pairing service may be to filter out Bluetooth broadcasts sent by Bluetooth devices that support Bluetooth fast pairing. The third filtering condition for the proximity discovery service may be to filter out Bluetooth broadcasts sent by Bluetooth devices that support proximity discovery. The third filtering condition for the collaboration service may be to filter out Bluetooth broadcasts sent by Bluetooth devices that support device collaboration. For different types of collaboration services, their corresponding third filtering conditions are different. For example, the third filtering condition for the multi-screen collaboration service may filter out Bluetooth broadcasts sent by Bluetooth devices of the device types of large screens, mobile phones, and tablets.
[0161] Therefore, the first scan instruction may further include a service identifier, which is used to mark the current Bluetooth service of the first Bluetooth device. The Bluetooth chip also stores a second mapping relationship between the filtering condition and the Bluetooth application and the Bluetooth service of the Bluetooth application. The Bluetooth chip obtains the first filtering condition or the second filtering condition based on the first Bluetooth application, the Bluetooth service of the Bluetooth application, and the second mapping relationship.
[0162] On the display interface of the first Bluetooth application, the PC can receive a selection operation for a first target Bluetooth service among multiple Bluetooth services of the first Bluetooth application, and during the process of scanning Bluetooth broadcasts, identify whether the scanned Bluetooth broadcasts meet the third filtering condition or the second filtering condition; where the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
[0163] Further, on the display interface of the first Bluetooth application, the PC instructs the Bluetooth chip to update the filtering condition. Specifically, after the PC displays the first device information of the first Bluetooth device that sends the first Bluetooth broadcast and the second device information of the second Bluetooth device that sends the second Bluetooth broadcast, the PC can receive a selection operation for a second target Bluetooth service among multiple Bluetooth services of the first Bluetooth application. After that, during the process of scanning Bluetooth broadcasts, identify whether the scanned Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition; where the fourth filtering condition is the third filtering condition corresponding to the second target Bluetooth service. After that, the PC can display the third device information of the third Bluetooth device that sends the third Bluetooth broadcast; where the third Bluetooth broadcast meets the fourth filtering condition.
[0164] Exemplarily, such asFigure 8 As shown, in response to the user clicking on the icon of the Computer Manager APP, the Bluetooth chip obtains filtering condition A (the first filtering condition), and filtering condition A is used to filter Bluetooth broadcasts sent by Bluetooth devices that support device collaboration (the first target Bluetooth service). At the same time, the Bluetooth chip obtains filtering condition B (the second filtering condition) of the proximity discovery APP. The Bluetooth chip filters and reports Bluetooth broadcasts according to the filtering condition of A∪B. The Computer Manager APP can display interface 801. Interface 801 also includes a smart connection control, a multi-screen collaboration control, and a sharing control. That is, the Computer Manager APP integrates the functions of the smart connection APP, the multi-screen collaboration APP, and the sharing APP. Optionally, the PC can separately include the smart connection APP, the multi-screen collaboration APP, and the sharing APP.
[0165] In response to the user clicking on the multi-screen collaboration control in interface 801, the Computer Manager APP can send a third scan instruction to the Bluetooth host. In response to this third scan instruction, the Bluetooth host can instruct the Bluetooth chip to obtain the third filtering condition C for multi-screen collaboration (the second target Bluetooth service), and the Bluetooth chip filters and reports Bluetooth broadcasts according to the filtering condition of C∪B. The third filtering condition C for multi-screen collaboration is used to filter Bluetooth broadcasts sent by Bluetooth devices that support the multi-screen collaboration service of the Computer Manager APP. As Figure 8 shown, the Computer Manager APP can display interface 802, and the interface 802 includes third device information. The device information is the device information of the Bluetooth device corresponding to the Bluetooth broadcast that meets the third filtering condition C.
[0166] As another example, in response to the user clicking on the icon of the Computer Manager APP, the Computer Manager APP displays interface 3, and interface 3 does not include a list of available devices. That is, when the Computer Manager APP is started, it does not trigger the Bluetooth chip to filter the scanned Bluetooth broadcasts, nor does it trigger the Bluetooth chip to report the scanned Bluetooth broadcasts. In response to the user clicking on the multi-screen collaboration (the first target Bluetooth service) control in interface 803, the Computer Manager APP can send a first scan instruction to the Bluetooth host. In response to this first scan instruction, the Bluetooth host can instruct the Bluetooth chip to obtain the third filtering condition C for multi-screen collaboration, and the Bluetooth chip filters and reports Bluetooth broadcasts according to the filtering condition of C∪B. As Figure 8 shown, the Computer Manager APP can display interface 802. Then, in response to the user clicking on the sharing (the second target Bluetooth service) control in interface 802, the Computer Manager APP can send a fourth scan instruction to the Bluetooth host. In response to this fourth scan instruction, the Bluetooth host can instruct the Bluetooth chip to obtain the fourth filtering condition D, and the Bluetooth chip filters and reports Bluetooth broadcasts according to the filtering condition of D∪B. As Figure 8As shown, the computer management APP can display interface 804, and interface 804 includes third device information. The third device information is the device information of the Bluetooth device corresponding to the Bluetooth broadcast that meets the fourth filtering condition D. The fourth filtering condition D is used to filter the Bluetooth broadcasts sent by the Bluetooth devices that support the data sharing service of the computer management.
[0167] Schematically, as Figure 9 shown, S502 can be S901.
[0168] S901, obtain the third filtering of the first Bluetooth application, and the third filtering condition is the first filtering condition.
[0169] The third filtering condition is used to screen out the Bluetooth broadcasts sent by the Bluetooth devices that support the first target Bluetooth service of the first Bluetooth application. The first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service includes a corresponding filtering condition. The first target Bluetooth service can be the target Bluetooth service selected by the user on the first Bluetooth application interface. As Figure 8 shown, in response to the user clicking the multi-screen collaboration button on interface 801 or interface 803, the Bluetooth host instructs the Bluetooth chip to obtain the third filtering condition.
[0170] After S509, the method further includes:
[0171] S902, obtain the fourth filtering condition of the first Bluetooth application.
[0172] The fourth filtering condition is used to screen out the Bluetooth broadcasts sent by the Bluetooth devices that support the second target Bluetooth service of the first Bluetooth application. The second target Bluetooth service can be the target Bluetooth service selected by the current user on the first Bluetooth application interface. As Figure 8 shown, in response to the user clicking the share button on interface 802, the Bluetooth host instructs the Bluetooth chip to obtain the fourth filtering condition. The third filtering condition is different from the fourth filtering condition.
[0173] S903, during the Bluetooth scanning process, the Bluetooth chip filters the third Bluetooth broadcasts that meet the fourth filtering condition and the second Bluetooth broadcasts that meet the second filtering condition.
[0174] S904, the Bluetooth chip reports to the Bluetooth host the third Bluetooth broadcasts that meet the fourth filtering condition and the second Bluetooth broadcasts that meet the second filtering condition respectively.
[0175] S905, the Bluetooth host reports the third device information in the third Bluetooth broadcast to the first Bluetooth application,
[0176] S906, the Bluetooth host reports the second device information in the second Bluetooth broadcast to the second Bluetooth application.
[0177] S907, the first Bluetooth application displays the third device information,
[0178] S908, the second Bluetooth application displays the second device information.
[0179] It can be seen that in this solution, the first Bluetooth application includes multiple filtering conditions, and the multiple filtering conditions are related to multiple Bluetooth services of the first Bluetooth application. When filtering Bluetooth broadcasts, the Bluetooth chip can also filter out the Bluetooth broadcasts sent by Bluetooth devices that meet the current Bluetooth service requirements according to the filtering conditions corresponding to the Bluetooth services running in the first Bluetooth application, further accurately scan the Bluetooth broadcasts required by the current Bluetooth service of the first Bluetooth application, shorten the scanning duration of Bluetooth broadcasts, and further reduce the number of Bluetooth broadcasts reported by the Bluetooth chip, further reducing the power consumption of the PC.
[0180] Optionally, one of the first Bluetooth application and the second Bluetooth application runs in the background. For example, when the first Bluetooth application runs in the background, after the PC enables the Bluetooth function, the first Bluetooth application actively sends a first scanning instruction to the Bluetooth host to trigger the Bluetooth chip to obtain the first filtering condition. The second Bluetooth application responds to the user's operation and reads the first filtering condition of the first Bluetooth application. The first filtering condition can be pre-stored in the Bluetooth chip. The second Bluetooth application can first read the first filtering condition, and then the second Bluetooth application can send the first filtering condition and the second filtering condition to the Bluetooth host, and trigger the Bluetooth chip to use the union of the first filtering condition and the second filtering condition as the latest filtering condition to filter the scanned Bluetooth devices.
[0181] Previously, after the Bluetooth chip obtains multiple different filtering conditions of different Bluetooth applications, it can filter Bluetooth broadcasts based on the multiple different filters at the same time. Optionally, the Bluetooth chip can also execute the filtering conditions of the latest started Bluetooth application, but the latest started Bluetooth application can send the union of the filtering conditions of multiple Bluetooth applications to the Bluetooth chip. In this way, without modifying the previous execution logic of the Bluetooth chip, it is also possible to obtain the Bluetooth broadcasts of Bluetooth devices that support different Bluetooth applications. Among them, the latest started Bluetooth application can be the first Bluetooth application or the second Bluetooth application. Taking the first Bluetooth application as an example, exemplarily, the first Bluetooth application can send a fifth filtering condition to the Bluetooth chip through the Bluetooth host, where the fifth filtering condition is the union of the first filtering condition and the second filtering condition. If a Bluetooth broadcast meets the fifth filtering condition, then the Bluetooth broadcast meets the first filtering condition or the second filtering condition. After the Bluetooth host receives the Bluetooth broadcast, it can send the first device information of the Bluetooth device that sends the Bluetooth broadcast that meets the first filtering condition to the first Bluetooth application. The first Bluetooth application can display the first device information. Similarly, the second electronic device displays the second device information of the Bluetooth device that sends the Bluetooth broadcast that meets the second filtering condition.
[0182] For example, such as Figure 10As shown in a. After the Quick Pairing APP detects that the PC has enabled the Bluetooth function, it actively sends Filtering Condition A (the second filtering condition) to the Bluetooth chip via the Bluetooth host. If, in response to the user clicking on the application icon of the Computer Manager APP on the PC desktop, the Computer Manager APP sends Filtering Condition B (the first filtering condition) to the Bluetooth chip via the Bluetooth host, then Filtering Condition A becomes invalid. Therefore, in the embodiments of this application, in response to the user clicking on the application icon of the Computer Manager APP on the PC desktop, the Computer Manager APP calls an interface to read Filtering Condition A obtained by the Bluetooth chip. Subsequently, the Computer Manager APP sends Filtering Condition A ∪ B (the fifth filtering condition) to the Bluetooth chip via the Bluetooth host. Herein, the fifth filtering condition is the union of the first filtering condition and the second filtering condition.
[0183] For another example, as Figure 10 shown in b, in response to the user clicking on the application icon of the Computer Manager APP on the PC desktop, if the Computer Manager APP sends Filtering Condition B (the first filtering condition) to the Bluetooth chip via the Bluetooth host. In response to the user enabling the Quick Pairing function, the Quick Pairing APP sends Filtering Condition A (the second filtering condition) to the Bluetooth chip via the Bluetooth host, then Filtering Condition B becomes invalid. Subsequently, the Bluetooth chip can indicate filtering invalidation to the Computer Manager APP via the Bluetooth host. In response to this indication, the Computer Manager APP calls an interface to read Filtering Condition A obtained by the Bluetooth chip. Subsequently, the Computer Manager APP sends Filtering Condition A ∪ B (the fifth filtering condition) to the Bluetooth chip via the Bluetooth host. Herein, the fifth filtering condition is the union of the first filtering condition and the second filtering condition.
[0184] It should be understood that any one of the first Bluetooth application or the second Bluetooth application can send the fifth filtering condition or the sixth filtering condition to the Bluetooth chip via the Bluetooth host.
[0185] Optionally, before the first Bluetooth application sends the fifth filtering condition to the Bluetooth chip via the Bluetooth host, the first Bluetooth application can, in response to the user's selection operation on the first target Bluetooth service among multiple Bluetooth services of the first Bluetooth application, obtain the third filtering condition corresponding to the first target Bluetooth service. Herein, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service. Subsequently, the first Bluetooth application sends the fifth filtering condition to the Bluetooth chip via the Bluetooth host.
[0186] Optionally, after the first Bluetooth application displays the first device information and the second Bluetooth application displays the second device information, the first Bluetooth application may, in response to a user's selection operation on a second target Bluetooth service among multiple Bluetooth services of the first Bluetooth application, obtain a third filtering condition (fourth filtering condition) corresponding to the second target Bluetooth service. The first Bluetooth application sends a sixth filtering condition to the Bluetooth chip through the Bluetooth host, and the sixth filtering condition is the union of the fourth filtering condition and the second filtering condition. During the process of scanning Bluetooth broadcasts, the Bluetooth chip identifies Bluetooth broadcasts that meet the sixth filtering condition. If a Bluetooth broadcast meets the sixth filtering condition, then the Bluetooth broadcast meets the fourth filtering condition or the second filtering condition. Finally, the Bluetooth chip reports the device information of the Bluetooth device corresponding to the Bluetooth broadcast that meets the sixth filtering condition to the Bluetooth host. The Bluetooth host may report the device information of the Bluetooth device that sends the Bluetooth broadcast that meets the fourth filtering condition to the first Bluetooth application, and report the device information of the Bluetooth device that sends the Bluetooth broadcast that meets the second filtering condition to the second Bluetooth application. Among them, the third Bluetooth broadcast that meets the fourth filtering condition, and the Bluetooth device that sends the third Bluetooth broadcast is the third Bluetooth device.
[0187] For example, as Figure 8 shown, in response to the user clicking the control for multi-screen collaboration on the interface 803, the Computer Manager APP obtains the third filtering condition corresponding to the multi-screen collaboration service. Then the Computer Manager APP sends the union of the third filtering condition corresponding to the multi-screen collaboration service and the second filtering condition of the Quick Pairing APP to the Bluetooth chip through the Bluetooth host. In response to the user clicking the sharing control on the interface 802, the Computer Manager APP sends the union of the third filtering condition corresponding to the sharing service and the second filtering condition of the Quick Pairing APP (sixth filtering condition) to the Bluetooth chip through the Bluetooth host. Finally, the Computer Manager APP may display the third device information of the third Bluetooth application that sends the Bluetooth broadcast that meets the third filtering condition corresponding to the sharing service on the interface 804. The Quick Pairing APP may display the second device information of the second Bluetooth device that sends the Bluetooth broadcast that meets the second filtering condition in the form of a pop-up window or a notification message.
[0188] Optionally, the PC further includes a third Bluetooth application without a filtering condition. Taking Figure 2 2a in the above as an example, in the conventional solution, the Quick Pairing APP instructs the Bluetooth chip to obtain the filtering condition A through the Bluetooth host. During the process of scanning Bluetooth broadcasts, the Bluetooth chip filters Bluetooth broadcasts according to the filtering condition A. If the third Bluetooth application (not shown in the figure) is started, since the third Bluetooth application does not include a filtering condition, the third Bluetooth application instructs the Bluetooth chip not to filter Bluetooth broadcasts and reports all scanned Bluetooth broadcasts. In this way, the Bluetooth chip does not filter Bluetooth broadcasts and reports all Bluetooth broadcasts, which increases the power consumption of the system and makes it impossible to quickly scan the Bluetooth broadcasts required by the Quick Pairing APP.
[0189] To this end, in this solution, during the process of the PC scanning Bluetooth broadcasts, after identifying whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition, in response to the user's operation of starting the third Bluetooth application, the PC runs the third Bluetooth application. After the PC runs the third Bluetooth application, the PC still filters the scanned Bluetooth broadcasts based on the first filtering condition and the second filtering condition, that is, the PC still identifies whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition during the process of scanning Bluetooth broadcasts. The third Bluetooth application in the PC can display the device information in the Bluetooth broadcasts scanned by the PC. For example, the Bluetooth chip does not filter the scanned Bluetooth broadcasts and reports all the scanned Bluetooth broadcasts to the third Bluetooth application.
[0190] As Figure 11 shown, Figure 11 illustrated is the collaborative service of call sharing performed between the PC and the mobile phone. After adopting this solution, since the power consumption of the PC is reduced, the PC can perform the collaborative service of call sharing without being connected to a power supply.
[0191] An embodiment of the present application provides an electronic device, which includes: a memory, a wireless communication module, a display screen, and one or more processors. The wireless communication module receives and sends data under the control of the processor to achieve communication between the electronic device and other electronic devices. The memory, the display screen are coupled to the processor; wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions run on the above-mentioned electronic device (such as Figure 3 the electronic device 300 shown), it enables the electronic device to execute each function or step in the above-mentioned method embodiments.
[0192] An embodiment of the present application also provides a computer program product, which enables a computer to execute each function or step in the above-mentioned method embodiments when the computer program product runs on the computer.
[0193] An embodiment of the present application also provides a chip system, which includes at least one processor and at least one interface circuit. The processor and the interface circuit can be interconnected through a line. For example, the interface circuit can be used to receive signals from other devices (such as the memory of an electronic device). For another example, the interface circuit can be used to send signals to other devices (such as the processor). Exemplarily, the interface circuit can read the instructions stored in the memory and send the instructions to the processor. When the instructions are executed by the processor, it can enable the electronic device to execute each step in the above-mentioned embodiments. Of course, the chip system can also include other discrete devices, and the embodiments of the present application do not make specific limitations on this.
[0194] From the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
[0195] In several embodiments provided in the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical or other forms.
[0196] The units described as separate components may or may not be physically separated. The components displayed as units may be one physical unit or multiple physical units, that is, they can be located in one place, or they can be distributed to multiple different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0197] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.
[0198] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The software product is stored in a storage medium and includes several instructions to enable a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods of the various embodiments of the present application. The foregoing storage medium includes: USB flash drives, mobile hard disks, read only memory (ROM), random access memory (RAM), magnetic disks or optical disks and other various media that can store program codes.
[0199] The above content is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A Bluetooth scanning method, characterized in that, applied to an electronic device, the electronic device has the Bluetooth function enabled, the first Bluetooth application and the second Bluetooth application are running in the electronic device, the first filtering condition of the first Bluetooth application is different from the second filtering condition of the second Bluetooth application, the first filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices that support the first Bluetooth application, and the second filtering condition is used to screen Bluetooth broadcasts sent by Bluetooth devices that support the second Bluetooth application; the method includes: During the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition; Displaying the first device information of the first Bluetooth device that sends the first Bluetooth broadcast, and displaying the second device information of the second Bluetooth device that sends the second Bluetooth broadcast; wherein, the first Bluetooth broadcast meets the first filtering condition, and the second Bluetooth broadcast meets the second filtering condition.
2. The method according to claim 1, characterized in that, The electronic device is installed with an operating system.
3. The method according to claim 1 or 2, characterized in that, The step of displaying the first device information of the first Bluetooth device that sends the first Bluetooth broadcast and displaying the second device information of the second Bluetooth device that sends the second Bluetooth broadcast includes: Displaying the first device information through a preset method, and displaying the second device information through the preset method; wherein, the preset method includes a pop-up window or a notification message.
4. The method according to claim 1 or 2, characterized in that, The step of displaying the first device information of the first Bluetooth device that sends the first Bluetooth broadcast and displaying the second device information of the second Bluetooth device that sends the second Bluetooth broadcast includes: Displaying the first device information on the scanning interface of the first Bluetooth application, and displaying the second device information through a preset method; wherein, the preset method includes a pop-up window or a notification message.
5. The method according to claim 3, characterized in that, The first Bluetooth application and the second Bluetooth application are running in the electronic device, including: the first Bluetooth application and the second Bluetooth application are running in the background of the electronic device.
6. The method according to claim 3 or 4, characterized in that, The first Bluetooth application and the second Bluetooth application are running in the electronic device, including: the first Bluetooth application is running in the foreground of the electronic device, and the second Bluetooth application is running in the background of the electronic device.
7. The method according to claim 4 or 6, characterized in that, The first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service in the multiple Bluetooth services includes a corresponding third filtering condition; the method further includes: Receiving a selection operation of a first target Bluetooth service from the multiple Bluetooth services of the first Bluetooth application by the user; wherein, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
8. The method according to claim 7, characterized in that, After the step of displaying the first device information of the first Bluetooth device that sends the first Bluetooth broadcast, the method further includes: Receive a user's selection operation on a second target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application; In response to the selection operation on the second target Bluetooth service, during the process of scanning Bluetooth broadcasts, identify whether the scanned Bluetooth broadcast meets the fourth filtering condition or the second filtering condition; the fourth filtering condition is the third filtering condition corresponding to the second target Bluetooth service; Display third device information of a third Bluetooth device that sends a third Bluetooth broadcast; wherein, the third Bluetooth broadcast meets the fourth filtering condition.
9. The method according to any one of claims 1-8, characterized in that, after identifying whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition during the process of scanning Bluetooth broadcasts, the method further includes: In response to a user's start operation on a third Bluetooth application, run the third Bluetooth application; wherein, the third Bluetooth application is not set with a filtering condition; wherein, after running the third Bluetooth application, during the process of scanning Bluetooth broadcasts by the electronic device, identify whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition.
10. The method according to any one of claims 1-9, characterized in that, the method further includes: In response to the Bluetooth function being turned on, scan the Bluetooth broadcasts.
11. The method according to any one of claims 1-10, characterized in that, the electronic device further includes a Bluetooth host and a Bluetooth chip, and the method includes: The Bluetooth chip obtains the first filtering condition and the second filtering condition through the Bluetooth host; wherein, during the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition includes: During the process of the Bluetooth chip scanning Bluetooth broadcasts, identify whether the scanned Bluetooth broadcast meets the first filtering condition or the second filtering condition; the method further includes: The Bluetooth chip reports the first device information to the first Bluetooth application through the Bluetooth host, and reports the second device information to the second Bluetooth application through the Bluetooth host; The first Bluetooth application displays the first device information, and the second Bluetooth application displays the second device information.
12. The method according to claim 11, characterized in that, the Bluetooth chip obtaining the first filtering condition and the second filtering condition through the Bluetooth host includes: The first Bluetooth application instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host, and the second Bluetooth application instructs the Bluetooth chip to obtain the second filtering condition through the Bluetooth host; The Bluetooth chip obtains the first filtering condition in response to the instruction of the first Bluetooth application, and obtains the second filtering condition in response to the instruction of the second Bluetooth application.
13. The method according to claim 11, characterized in that, the Bluetooth chip obtaining the first filtering condition and the second filtering condition through the Bluetooth host includes: The first Bluetooth application sends a first scan instruction to the Bluetooth host; in response to the first scan instruction, the Bluetooth host sends a first HCI instruction to the Bluetooth chip; in response to the first HCI instruction, the Bluetooth chip obtains a first filtering condition of the first Bluetooth application; The second Bluetooth application sends a second scan instruction to the Bluetooth host; in response to the second scan instruction, the Bluetooth host sends a second HCI instruction to the Bluetooth chip; in response to the second HCI instruction, the Bluetooth chip obtains a second filtering condition of the second Bluetooth application.
14. The method according to claim 12 or 13, wherein, the first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service in the multiple Bluetooth services includes a corresponding third filtering condition. Before the first Bluetooth application instructs the Bluetooth chip to obtain the first filtering condition through the Bluetooth host, the method further includes: the first Bluetooth application receives a selection operation of a first target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application by a user; wherein, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
15. The method according to claim 14, wherein, after the first Bluetooth application displays the first device information and the second Bluetooth application displays the second device information, the method further includes: the first Bluetooth application receives a selection operation of a second target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application by a user; in response to the selection operation of the second target Bluetooth service, during the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition includes: in response to the selection operation of the second target Bluetooth service, the first Bluetooth application instructs the Bluetooth chip to obtain the fourth filtering condition through the Bluetooth host; during the process of the Bluetooth chip scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition; the first Bluetooth application displays third device information of a third Bluetooth device that sends a third Bluetooth broadcast; wherein, the third Bluetooth broadcast meets the fourth filtering condition.
16. The method according to any one of claims 1-10, wherein, the electronic device further includes a Bluetooth host and a Bluetooth chip, and the method includes: the first Bluetooth application sends a fifth filtering condition to the Bluetooth chip through the Bluetooth host, and the fifth filtering condition is the union of the first filtering condition and the second filtering condition; wherein, during the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the first filtering condition or the second filtering condition includes: during the process of the Bluetooth chip scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the fifth filtering condition, wherein if the Bluetooth broadcast meets the fifth filtering condition, then the Bluetooth broadcast meets the first filtering condition or the second filtering condition; the method further includes: The Bluetooth chip reports the first device information to the first Bluetooth application through the Bluetooth host, and reports the second device information to the second Bluetooth application through the Bluetooth host; The first Bluetooth application displays the first device information, and the second Bluetooth application displays the second device information.
17. The method according to claim 16, wherein, The first Bluetooth application includes multiple Bluetooth services, and each Bluetooth service in the multiple Bluetooth services includes a corresponding third filtering condition. Before the first Bluetooth application sends a fifth filtering condition to the Bluetooth chip through the Bluetooth host, the method further includes: The first Bluetooth application receives a selection operation of a first target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application by a user; wherein, the first filtering condition is the third filtering condition corresponding to the first target Bluetooth service.
18. The method according to claim 17, wherein, After the first Bluetooth application displays the first device information and the second Bluetooth application displays the second device information, the method further includes: The first Bluetooth application receives a selection operation of a second target Bluetooth service among the multiple Bluetooth services of the first Bluetooth application by a user; In response to the selection operation of the second target Bluetooth service, during the process of scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition includes: In response to the selection operation of the second target Bluetooth service by the user, the first Bluetooth application sends a sixth filtering condition to the Bluetooth chip through the Bluetooth host, and the sixth filtering condition is the union of the fourth filtering condition and the second filtering condition; During the process of the Bluetooth chip scanning Bluetooth broadcasts, identifying whether the scanned Bluetooth broadcasts meet the sixth filtering condition. If the Bluetooth broadcasts meet the sixth filtering condition, then the Bluetooth broadcasts meet the fourth filtering condition or the second filtering condition; The first Bluetooth application displays the third device information of a third Bluetooth device that sends a third Bluetooth broadcast; wherein, the third Bluetooth broadcast meets the fourth filtering condition.
19. An electronic device, including wherein, The electronic device includes: a memory, a wireless communication module, a display screen, and one or more processors; the wireless communication module receives and sends data under the control of the processor to implement communication between the electronic device and other electronic devices; the memory, the display screen are coupled to the processor; wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the computer instructions are executed by the processor, the electronic device executes the method according to any one of claims 1-18.
20. A computer-readable storage medium, wherein, including computer instructions, when the computer instructions run on an electronic device, the electronic device executes the method according to any one of claims 1-18.
Citation Information
Cited By
Service execution method, Bluetooth system, storage medium and electronic equipment
CN121310105A