CN115087134B - Method and electronic device for bluetooth connection - Google Patents
Method and electronic device for bluetooth connection Download PDFInfo
- Publication number
- CN115087134B CN115087134B CN202210855261.6A CN202210855261A CN115087134B CN 115087134 B CN115087134 B CN 115087134B CN 202210855261 A CN202210855261 A CN 202210855261A CN 115087134 B CN115087134 B CN 115087134B
- Authority
- CN
- China
- Prior art keywords
- connection
- external device
- bluetooth
- electronic device
- interface
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及终端技术领域,并且具体地,涉及一种蓝牙连接的方法和电子设备。The present application relates to the technical field of terminals, and in particular, relates to a Bluetooth connection method and an electronic device.
背景技术Background technique
随着无线通信技术的发展,手机可以通过蓝牙(Bluetooth)技术与蓝牙耳机建立通信连接。目前,手机在开启蓝牙功能后,会自动回连上一个连接的蓝牙耳机。但是如果回连耳机处于无法连接的状态时(比如不在身边),会影响用户连接其他蓝牙设备的连接速度。因此,亟需提出一种方案解决此问题。With the development of wireless communication technology, a mobile phone can establish a communication connection with a Bluetooth headset through Bluetooth (Bluetooth) technology. At present, after the mobile phone turns on the Bluetooth function, it will automatically connect back to a connected Bluetooth headset. However, if the reconnecting headset is in a state of being unable to connect (such as not being around), it will affect the connection speed of the user to connect to other Bluetooth devices. Therefore, it is urgent to propose a solution to this problem.
发明内容Contents of the invention
有鉴于此,本申请提供了一种蓝牙连接的方法、电子设备、计算机可读存储介质和计算机程序产品,能够显著提升蓝牙设备的连接速度,从而提升用户体验。In view of this, the present application provides a Bluetooth connection method, an electronic device, a computer-readable storage medium and a computer program product, which can significantly increase the connection speed of the Bluetooth device, thereby improving user experience.
第一方面,提供了一种蓝牙连接的方法,所述方法应用于电子设备,所述方法包括:In a first aspect, a method for Bluetooth connection is provided, the method is applied to an electronic device, and the method includes:
检测到用户的第一操作,所述第一操作用于指示发起所述第一外接设备的蓝牙连接;Detecting a first user operation, where the first operation is used to instruct to initiate the Bluetooth connection of the first external device;
确定当前是否正在连接第二外接设备,所述第二外接设备是自动回连的设备;Determine whether a second external device is currently being connected, and the second external device is a device that automatically connects back;
在所述第二外接设备正在连接的情况下,确定所述第一外接设备是否为优先连接设备;When the second external device is being connected, determine whether the first external device is a priority connection device;
响应于所述第一操作,在确定所述第一外接设备是优先连接设备时,取消所述第二外接设备的连接,并建立所述电子设备与所述第一外接设备间的蓝牙连接。In response to the first operation, when it is determined that the first external device is a priority connection device, cancel the connection of the second external device, and establish a Bluetooth connection between the electronic device and the first external device.
上述方法可以由电子设备或电子设备中的芯片执行。基于上述方案,在检测到用户的第一操作后,判断是否存在正在连接的第二外接设备;在所述第二外接设备正在连接的情况下,再判断所述第一外接设备是否为优先连接设备;在第一外接设备是优先连接设备的情况下,取消正在连接第二外接设备,并建立与第一外接设备的蓝牙连接,能够显著提升第一外接设备的连接速度以及连接成功率。The above method can be executed by an electronic device or a chip in the electronic device. Based on the above scheme, after the first operation of the user is detected, it is judged whether there is a second external device being connected; if the second external device is being connected, it is judged whether the first external device is a priority connection device; in the case that the first external device is the priority connection device, canceling the connection to the second external device and establishing a Bluetooth connection with the first external device can significantly improve the connection speed and connection success rate of the first external device.
在一些可能的实现方式中,在所述检测到用户的第一操作之前,所述方法还包括:In some possible implementation manners, before the detection of the user's first operation, the method further includes:
通过扫描发现所述第一外接设备;discovering the first external device by scanning;
判断所述第一外接设备是否处于可连接以及已配对状态;judging whether the first external device is in a connectable and paired state;
在所述第一外接设备处于可连接以及已配对状态时,将所述第一外接设备确定为优先连接设备。When the first external device is in a connectable and paired state, the first external device is determined as a priority connection device.
本申请实施例将第一外接设备设置为优先连接设备,可方便用户实现第一外接设备的快速连接。In the embodiment of the present application, the first external device is set as the priority connection device, which can facilitate the quick connection of the first external device for the user.
在一些可能的实现方式中,所述方法还包括:In some possible implementations, the method also includes:
显示第一界面,所述第一界面中包括第一窗口,所述第一窗口用于提示第一外接设备可连接。A first interface is displayed, the first interface includes a first window, and the first window is used to prompt that the first external device can be connected.
电子设备发现第一外接设备的方式可以包括BR方式和BLE广播发现方式。The manner in which the electronic device discovers the first external device may include a BR manner and a BLE broadcast discovery manner.
在一些可能的实现方式中,可选地,通过扫描发现所述第一外接设备,包括:In some possible implementation manners, optionally, discovering the first external device through scanning includes:
接收来自所述第一外接设备的低功耗蓝牙BLE广播消息,所述BLE广播消息包括蓝牙地址;Receive a Bluetooth Low Energy BLE broadcast message from the first external device, where the BLE broadcast message includes a Bluetooth address;
通过解析所述BLE广播消息获得所述蓝牙地址,并基于所述蓝牙地址进行匹配。The Bluetooth address is obtained by parsing the BLE broadcast message, and matching is performed based on the Bluetooth address.
在一些可能的实现方式中,可选地,通过扫描发现所述第一外接设备,包括:In some possible implementation manners, optionally, discovering the first external device through scanning includes:
向所述第一外接设备发送查询请求;sending a query request to the first external device;
接收所述第一外接设备返回的响应请求,所述响应请求中包括基础速率BR地址。Receive a response request returned by the first external device, where the response request includes a basic rate BR address.
应理解,上述示出的发现第一外接设备的两种方式只是示例性描述,本申请实施例并不限于此。事实上,电子设备也可以通过其他合理的方式发现第一外接设备。It should be understood that the two manners for discovering the first external device shown above are only exemplary descriptions, and this embodiment of the present application is not limited thereto. In fact, the electronic device may also discover the first external device in other reasonable ways.
在一些可能的实现方式中,在建立所述电子设备与所述第一外接设备间的蓝牙连接后,所述方法还包括:In some possible implementation manners, after establishing the Bluetooth connection between the electronic device and the first external device, the method further includes:
显示第二界面,所述第二界面包括提示信息,所述提示信息用于提示所述第一外接设备已连接。A second interface is displayed, the second interface includes prompt information, and the prompt information is used to prompt that the first external device has been connected.
因此,当第一外接设备与电子设备连接成功后,还可以在界面上向用户提示第一外接设备已经连接成功,从而使得用户可以直观得知第一外接设备已经连接成功。Therefore, when the first external device is successfully connected to the electronic device, the user can be prompted on the interface that the first external device has been successfully connected, so that the user can intuitively know that the first external device has been successfully connected.
在一些可能的实现方式中,所述方法还包括:In some possible implementations, the method also includes:
在确定所述第一外接设备不是优先连接设备时,将所述第一外接设备加入到等待连接列表中,并继续执行所述第二外接设备的连接。When it is determined that the first external device is not the priority connection device, the first external device is added to a waiting list, and the connection of the second external device is continued.
第二方面,提供了一种蓝牙连接的方法,所述方法应用于外接设备,所述方法包括:In a second aspect, a method for Bluetooth connection is provided, the method is applied to an external device, and the method includes:
广播低功耗蓝牙BLE广播消息,所述BLE广播消息包括蓝牙地址;Broadcasting a Bluetooth Low Energy BLE broadcast message, where the BLE broadcast message includes a Bluetooth address;
或者,接收来自电子设备的查询请求,并向所述电子设备发送响应请求信息,所述响应请求信息中包括基础速率BR地址。Or, receive a query request from the electronic device, and send response request information to the electronic device, where the response request information includes a basic rate BR address.
上述方法可以由第一外接设备或第一外接设备中的芯片执行。可选地,第一外接设备可以是蓝牙外接设备(比如,蓝牙耳机)。通过上述方式,能够使得电子设备发现第一外接设备,以便电子设备执行上述第一方面的蓝牙连接方法。The foregoing method may be executed by the first external device or a chip in the first external device. Optionally, the first external device may be a Bluetooth external device (for example, a Bluetooth headset). Through the above manner, the electronic device can be made to discover the first external device, so that the electronic device can execute the Bluetooth connection method of the first aspect above.
第三方面,提供了一种电子设备,包括用于执行第一方面中任一种方法的单元。该电子设备可以是终端(或者终端设备),也可以是终端(或者终端设备)内的芯片。该电子设备包括输入单元、显示单元和处理单元。In a third aspect, an electronic device is provided, including a unit for performing any method in the first aspect. The electronic device may be a terminal (or terminal device), or a chip in the terminal (or terminal device). The electronic device includes an input unit, a display unit and a processing unit.
当该电子设备是终端时,该处理单元可以是处理器,该输入单元可以是通信接口,该显示单元可以是图形处理模块和屏幕;该终端还可以包括存储器,该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该终端执行第一方面中的任一种方法。When the electronic device is a terminal, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the terminal may also include a memory for storing computer program codes , when the processor executes the computer program code stored in the memory, causing the terminal to execute any method in the first aspect.
当该电子设备是终端内的芯片时,该处理单元可以是芯片内部的逻辑处理单元,该输入单元可以是输出接口、管脚或电路等,该显示单元可以是芯片内部的图形处理单元;该芯片还可以包括存储器,该存储器可以是该芯片内的存储器(例如,寄存器、缓存等),也可以是位于该芯片外部的存储器(例如,只读存储器、随机存取存储器等);该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该芯片执行第一方面的任一种方法。When the electronic device is a chip in the terminal, the processing unit may be a logic processing unit inside the chip, the input unit may be an output interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip; The chip may also include a memory, which may be a memory within the chip (for example, a register, a cache, etc.), or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); The computer program code is stored, and when the processor executes the computer program code stored in the memory, the chip is made to perform any method of the first aspect.
第四方面,提供了一种外接设备(比如蓝牙设备),包括用于执行第一方面中任一种方法的单元。比如,该外接设备可以是蓝牙耳机,也可以是蓝牙耳机内的芯片。该外接设备包括输入单元和处理单元。可选地,该外接设备还可以包括显示单元。In a fourth aspect, an external device (such as a Bluetooth device) is provided, including a unit for performing any one of the methods in the first aspect. For example, the external device may be a Bluetooth headset, or a chip in the Bluetooth headset. The external device includes an input unit and a processing unit. Optionally, the external device may also include a display unit.
当该外接设备是蓝牙设备时,该处理单元可以是处理器,该输入单元可以是通信接口,该显示单元可以是图形处理模块和屏幕;该终端还可以包括存储器,该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该蓝牙设备执行第二方面中的任一种方法。When the external device is a Bluetooth device, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the terminal may also include a memory, which is used to store computer programs Code, when the processor executes the computer program code stored in the memory, causing the Bluetooth device to execute any method in the second aspect.
当该外接设备是蓝牙设备内的芯片时,该处理单元可以是芯片内部的逻辑处理单元,该输入单元可以是输出接口、管脚或电路等,该显示单元可以是芯片内部的图形处理单元;该芯片还可以包括存储器,该存储器可以是该芯片内的存储器(例如,寄存器、缓存等),也可以是位于该芯片外部的存储器(例如,只读存储器、随机存取存储器等);该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该芯片执行第二方面的任一种方法。When the external device is a chip in the Bluetooth device, the processing unit may be a logic processing unit inside the chip, the input unit may be an output interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip; The chip may also include a memory, which may be a memory within the chip (for example, a register, a cache, etc.), or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); It is used for storing computer program codes, and when the processor executes the computer program codes stored in the memory, the chip is made to execute any method of the second aspect.
第五方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第一方面中的任一种方法。In a fifth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores computer program codes, and when the computer program codes are executed by an electronic device, the electronic device executes any of the items in the first aspect. a way.
第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序代码,当所述计算机程序代码被外接设备运行时,使得该外接设备执行第二方面中的任一种方法。According to a sixth aspect, a computer-readable storage medium is provided, the computer-readable storage medium stores computer program code, and when the computer program code is run by an external device, the external device executes any of the steps in the second aspect. a way.
第七方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第一方面中的任一种方法。In a seventh aspect, a computer program product is provided, the computer program product comprising: computer program code, when the computer program code is executed by an electronic device, the electronic device is made to execute any method in the first aspect.
第八方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被外接设备运行时,使得该外接设备执行第二方面中的任一种方法。In an eighth aspect, a computer program product is provided, the computer program product comprising: computer program code, when the computer program code is run by an external device, the external device is made to execute any one of the methods in the second aspect.
附图说明Description of drawings
图1是本申请实施例的应用场景的一个示例图;FIG. 1 is an example diagram of an application scenario of an embodiment of the present application;
图2是耳机的一个结构示意图;Fig. 2 is a structural schematic diagram of an earphone;
图3是一种适用于本申请的电子设备的硬件系统的示意图;FIG. 3 is a schematic diagram of a hardware system applicable to the electronic device of the present application;
图4是一种适用于本申请的电子设备的软件系统的示意图;Fig. 4 is a schematic diagram of a software system applicable to the electronic device of the present application;
图5是本申请实施例的确定优先连接设备的方法的示意性流程图;FIG. 5 is a schematic flowchart of a method for determining a priority connection device according to an embodiment of the present application;
图6是本申请实施例的蓝牙连接的方法的示意性流程图;FIG. 6 is a schematic flowchart of a method for Bluetooth connection according to an embodiment of the present application;
图7是本申请实施例的蓝牙连接的方法的一个示例流程图;FIG. 7 is an example flowchart of a method for Bluetooth connection according to an embodiment of the present application;
图8是本申请实施例的一个界面示例图;Fig. 8 is an example interface diagram of the embodiment of the present application;
图9是本申请实施例的另一个界面示意图;Fig. 9 is another schematic interface diagram of the embodiment of the present application;
图10是本申请实施例的蓝牙连接的装置的示意性框图。Fig. 10 is a schematic block diagram of a Bluetooth-connected device according to an embodiment of the present application.
具体实施方式detailed description
下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
本申请实施例提供的蓝牙连接方法可以应用于电子设备中。电子设备可与一个或多个外接设备(或者说无线外接设备)通过无线通信技术进行无线连接。The Bluetooth connection method provided in the embodiment of the present application can be applied to electronic devices. An electronic device can be wirelessly connected with one or more external devices (or wireless external devices) through wireless communication technology.
电子设备可以是终端。终端例如是手机、媒体播放器(例如MP3、MP4等)、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer ,UMPC)、个人数字助理 (personal digital assistant,PDA)、电视或智能手表等设备。本申请实施例对电子设备的类型不作具体限定。An electronic device may be a terminal. The terminal is, for example, a mobile phone, a media player (such as MP3, MP4, etc.), a tablet computer, a notebook computer, an ultra-mobile personal computer (UMPC), a personal digital assistant (personal digital assistant, PDA), a TV or a smart phone. devices such as watches. The embodiment of the present application does not specifically limit the type of the electronic device.
外接设备可以为无线耳机、无线音箱、无线手环、无线车载,无线智能眼镜,无线手表,增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备等设备。本申请实施例对外接设备的类型不作具体限定。The external devices may be wireless earphones, wireless speakers, wireless bracelets, wireless cars, wireless smart glasses, wireless watches, augmented reality (augmented reality, AR)/virtual reality (virtual reality, VR) equipment and other equipment. The embodiment of the present application does not specifically limit the type of the external device.
无线通信技术可以是蓝牙(bluetooth,BT),可以是传统蓝牙或者低功耗BLE蓝牙,无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),Zigbee,调频(frequency modulation,FM),近距离无线通信技术(near fieldcommunication,NFC),红外技术(infrared,IR),或通用2 .4G/5G频段无线通信技术等。无线连接为利用该无线通信技术建立的连接。本申请实施例对无线通信技术的类型不作具体限定。The wireless communication technology may be bluetooth (BT), traditional bluetooth or low power consumption BLE bluetooth, wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), Zigbee, Frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), or general 2.4G/5G frequency band wireless communication technology, etc. A wireless connection is a connection established using the wireless communication technology. The embodiment of the present application does not specifically limit the type of the wireless communication technology.
应理解,本申请实施例是以蓝牙连接为例进行描述,但是也能适用于其他无线通信技术。It should be understood that the embodiment of the present application is described by taking the Bluetooth connection as an example, but it may also be applicable to other wireless communication technologies.
本申请实施例以外接设备是无线耳机为例进行说明。该无线耳机可以有多种类型,例如可以是耳塞式、入耳式、头戴式、耳罩式或挂耳式无线耳机等。无线耳机可以包括分别佩戴于用户左耳和右耳的第一部分和第二部分,可以通过连接线相连,例如颈带式无线耳机;也可以是相互独立的两部分,例如真无线立体声(true wireless stereo,TWS)耳机。示例性的,当无线耳机为TWS耳机时,无线耳机的第一部分和第二部分可以为左耳塞和右耳塞。The embodiment of the present application is described as an example in which the external device is a wireless earphone. The wireless earphone can be of various types, for example, it can be an earplug type, an in-ear type, a head-mounted type, an earmuff type or an ear-hanging type wireless earphone and the like. The wireless earphone may include a first part and a second part worn on the user's left ear and right ear respectively, and may be connected by a connecting wire, such as a neckband wireless earphone; it may also be two parts independent of each other, such as a true wireless stereo (true wireless stereo) stereo, TWS) headphones. Exemplarily, when the wireless earphone is a TWS earphone, the first part and the second part of the wireless earphone may be a left earplug and a right earplug.
图1示出了本申请实施例的应用场景的一个示例图。以电子设备是手机,外接设备是耳机为例,耳机11是手机10最近一次连接的设备。手机10在蓝牙功能开启后,会自动回连最近一次连接的耳机11。耳机11当前不再手机10的通信范围内(比如耳机11关机或者不在手机10附近)。FIG. 1 shows an example diagram of an application scenario of an embodiment of the present application. Taking the electronic device as a mobile phone and the external device as an earphone as an example, the
如图1中(1)所示,界面中显示手机10的蓝牙管理界面。当手机10的蓝牙功能开启后,“蓝牙当前可被附近的蓝牙设备发现”选项处于打开状态。在该选项处于打开状态下,手机10可以执行与蓝牙相关的功能,比如,搜索、配对、连接设备等。As shown in (1) in FIG. 1 , the Bluetooth management interface of the
如图1中(1)所示,界面中包括“已配对的设备”栏。“已配对的设备”栏用于显示与手机10配对过的设备。“已配对的设备”中显示耳机11正在连接中。As shown in (1) in Figure 1, the interface includes a "Paired Devices" column. The “Paired Devices” column is used to display the devices that have been paired with the
另外,在执行耳机11自动回连的过程中,手机10还可以同步进行扫描,发现其他可用设备。比如,如图1中(1)所示,在可用设备栏中显示扫描到的耳机12。在耳机11的连接过程中,如果用户主动点击连接耳机12,则还需要等待耳机11自动回连超时后,才能进行耳机12的连接。在等待一段时间后,耳机11连接失败,手机10界面显示为图1中(2)。In addition, during the automatic reconnection process of the
如图1中(2)所示,耳机11自动回连失败,手机10界面会弹出窗口13,窗口13用于向用户提示耳机11连接失败。As shown in (2) in FIG. 1 , if the automatic reconnection of the
示例性地,窗口13中可以显示连接失败的原因:该设备蓝牙关闭,或不在通信范围内(10米)。窗口13中还可以包括窗口14。窗口14中显示“知道了”。当用户读取窗口13提示的内容后,可点击窗口14。在点击窗口14后,可关闭窗口13。Exemplarily, the reason for the connection failure may be displayed in window 13: the Bluetooth of the device is off, or it is not within the communication range (10 meters).
可选地,如图1中(1)所示或图1中(2)所示,界面中还可以显示“设备名称”的选项,比如,当前设备名称为“荣耀”,即手机10的名称为荣耀。Optionally, as shown in (1) in Figure 1 or (2) in Figure 1, the option of "device name" can also be displayed on the interface, for example, the current device name is "Glory", that is, the name of the
可选地,如图1中(1)所示或图1中(2)所示,界面中还可以显示“接收的文件”的选项。“接收的文件”的选项指手机10通过蓝牙接收的其他设备发送的文件。Optionally, as shown in (1) in FIG. 1 or (2) in FIG. 1 , an option of "received files" may also be displayed in the interface. The option of "received files" refers to the files sent by other devices received by the
应理解,图1中示出的界面只是示例性描述,本申请实施例并不限于此。事实上,上述界面中可以包含更多或更少的选项或控件。It should be understood that the interface shown in FIG. 1 is only an exemplary description, and this embodiment of the present application is not limited thereto. In fact, more or fewer options or controls may be included in the above interface.
还应理解,图1中是以两个外接设备均为耳机为例进行描述,本申请实施例并不限于此。比如,上述耳机11和/或耳机12可以替换为其他蓝牙外设等。又比如,手机10的已配对设备栏或可用设备栏中也可以包括更多数量的外接设备。It should also be understood that, in FIG. 1 , it is described as an example that both external devices are earphones, and this embodiment of the present application is not limited thereto. For example, the
还应理解,图1中的场景只是示意性说明本申请的一个应用场景,这并不对本申请实施例构成限定,本申请并不限于此。It should also be understood that the scene in FIG. 1 is only a schematic illustration of an application scene of the present application, which does not limit the embodiment of the present application, and the present application is not limited thereto.
还应理解,本申请实施例对如何进入到蓝牙管理界面的方式不作具体限定。比如,用户可以点击设置应用,然后在设置应用中点击蓝牙选项,进入蓝牙管理界面,比如图1中(1)所示的蓝牙管理界面。It should also be understood that the embodiment of the present application does not specifically limit the manner of how to enter the Bluetooth management interface. For example, the user can click the setting application, and then click the Bluetooth option in the setting application to enter the Bluetooth management interface, such as the Bluetooth management interface shown in (1) in Figure 1 .
通常来讲,一个外接设备(比如耳机11)会尝试进行两次连接。这两次连接带来的连接超时大约会持续数秒(比如16秒)。在此期间,如果用户主动连接另一个外接设备(比如耳机12),则用户需要一直等待,直到耳机11的回连过程结束,才能建立另一个外接设备(比如耳机12)与电子设备(比如手机10)的连接,这样导致耳机12的连接速度会非常慢,严重影响用户体验。Generally speaking, an external device (such as earphone 11 ) will try to connect twice. The connection timeout caused by these two connections will last for a few seconds (such as 16 seconds). During this period, if the user actively connects to another external device (such as the headset 12), the user needs to wait until the end of the connection process of the
有鉴于此,本申请实施例提出一种蓝牙连接的方法,在第二外接设备(比如耳机11)的连接过程中,如果电子设备检测到用户连接第一外接设备(比如耳机12)的操作请求,那么取消第二外接设备的连接,并建立电子设备与第一外接设备的连接,能够加速第一外接设备的连接。对于第二外接设备因不在通信范围内而导致需等待连接超时的情况,无需再等待前述超时时间,显著提升了第一外接设备的连接速度,提升了用户体验。In view of this, the embodiment of this application proposes a Bluetooth connection method. During the connection process of the second external device (such as the headset 11), if the electronic device detects the user's operation request to connect the first external device (such as the headset 12) , then canceling the connection of the second external device and establishing the connection between the electronic device and the first external device can speed up the connection of the first external device. For the situation that the second external device needs to wait for the connection timeout because it is not within the communication range, there is no need to wait for the aforementioned timeout period, which significantly improves the connection speed of the first external device and improves user experience.
图2是耳机的一个结构示例图。如图2所示,无线耳机100包括至少一个处理器101、至少一个存储器102、无线通信模块103、音频模块104、电源模块105以及输入/输出接口106等。该处理器101可以包括一个或多个接口,用于与无线耳机100的其他部件相连。可选地,该无线耳机100通过耳机盒进行收纳。Fig. 2 is a structural example diagram of an earphone. As shown in FIG. 2 , the
其中,存储器102可以用于存储程序代码,如用于无线耳机100与多个电子设备之间进行连接,处理电子设备的音频业务(例如音乐播放、接/打电话等),以及用于无线耳机100进行充电,无线耳机100与其他电子设备进行无线配对连接的程序代码等。存储器102还可以用于存储其他信息,例如最近连接的电子设备的配对信息。Among them, the
处理器101可以用于执行上述应用程序代码,调用相关模块以实现本申请实施例中无线耳机100的功能。示例性的,在蓝牙耳机接收到电子设备的连接请求信息,则蓝牙耳机可以与电子设备建立物理连接。The
处理器101可以包括一个或多个处理单元,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器101中。处理器101具体可以是集成的控制芯片,也可以由包括各种有源和/或无源部件的电路组成,且该电路被配置为执行本申请实施例描述的属于处理器101的功能。The
无线通信模块103可以用于,支持无线耳机100与其他电子设备或耳机盒之间包括BT,WLAN(如Wi-Fi),Zigbee,FM,NFC,IR,或通用2.4G/5G无线通信技术等无线通信的数据交换。The
在一些实施例中,该无线通信模块103可以为蓝牙芯片。无线耳机100可以通过该蓝牙芯片,与其他电子设备的蓝牙芯片之间进行配对并建立无线连接,以通过该无线连接实现无线耳机100和其他电子设备之间的无线通信和业务处理。该无线连接可以是物理连接或虚拟连接。通常,蓝牙芯片可以支持基础速率(basic rate,BR)/增强速率(enhanceddata rate,EDR)蓝牙和BLE,例如可以收/发寻呼(page)信息,收/发BLE广播消息等。In some embodiments, the
另外,无线通信模块103还可以包括天线,无线通信模块103经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器101。无线通信模块103还可以从处理器101接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。In addition, the
音频模块104可以用于管理音频数据,实现无线耳机100输入和输出音频信号。例如,音频模块104可以从无线通信模块103获取音频信号,或者向无线通信模块103传递音频信号,实现通过蓝牙耳机接打电话、播放音乐、启动/关闭与耳机连接的电子设备的语音助手、接收/发送用户的语音数据等功能。音频模块104可以包括用于输出音频信号的扬声器(或称听筒、受话器)组件,麦克风(或称话筒,传声器),与麦克风相配合的麦克收音电路等。扬声器可以用于将音频电信号转换成声音信号并播放。麦克风可以用于将声音信号转换为音频电信号。The
电源模块105,可以用于提供无线耳机100的系统电源,为无线耳机100各模块供电;支持无线耳机100接收充电输入等。电源模块105可以包括电源管理单元(powermanagement unit,PMU)和电池。其中,电源管理单元可以接收外部的充电输入;将充电路输入的电信号变压后提供给电池充电,还可以将电池提供的电信号变压后提供给音频模块104、无线通信模块103等其他模块;以及防止电池过充、过放、短路或过流等。在一些实施例中,电源模块105还可以包括无线充电线圈,用于对无线耳机100进行无线充电。另外,电源管理单元还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。The
多个输入/输出接口106,可以用于提供无线耳机100与耳机盒之间进行充电或通信的有线连接。在一些实施例中,该输入/输出接口可以为USB接口。在另一些实施例中,输入/输出接口106可以为耳机电连接器,当无线耳机100放置于耳机盒中时,无线耳机100可以通过耳机电连接器与耳机盒中的电连接器建立电连接,从而为无线耳机100中的电池充电。在另一些实施例中,在该电连接建立后,无线耳机100还可以与耳机盒进行数据通信,例如可以接收来自耳机盒的配对指令。A plurality of input/
另外,无线耳机100还可以包括传感器107。例如,该传感器107可以是距离传感器或接近光传感器,可以用于确定无线耳机100是否被用户佩戴。示例性的,无线耳机100可以利用距离传感器来检测无线耳机100附近是否有物体,从而确定无线耳机100是否被用户佩戴。在确定无线耳机100被佩戴时,无线耳机100可以打开扬声器。再例如,该传感器107还可以包括骨传导传感器,结合成骨传导耳机。利用该骨传导传感器,无线耳机100可以获取人体声部振动骨块的振动信号,解析出语音信号,实现语音功能,从而接收用户的语音指令。无线耳机100还可以根据骨传导耳机获取的用户语音信号进行语音鉴权,以在支付交易等业务场景中对用户身份进行认证等。再例如,该传感器107还可以包括:触摸传感器,用于检测用户的触摸操作;指纹传感器,用于检测用户指纹,识别用户身份等;环境光传感器,可以根据感知的环境光的亮度,自适应调节一些参数(如音量大小);以及其他一些传感器。Additionally, the
在一些实施例中,触摸传感器可以检测用户的单击、双击、多次点击、长按、重压等触摸操作,还可以进行用户指纹识别,以在支付交易等业务场景中对用户身份进行鉴权。In some embodiments, the touch sensor can detect the user's touch operations such as single click, double click, multiple clicks, long press, heavy pressure, etc., and can also perform user fingerprint recognition to authenticate the user's identity in business scenarios such as payment transactions. right.
可以理解,本申请实施例示意的结构并不构成对无线耳机100的具体限定。其可以具有比图2示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。例如,在无线耳机100的外表面还可以包括按键108、指示灯(可以指示电量、呼入/呼出、配对模式等状态)、显示屏(可以提示用户相关信息)、防尘网(可以配合听筒使用)等部件。其中,该按键108可以是物理按键或触摸按键(与触摸传感器配合使用)等,用于触发开机、关机、暂停、播放、录音、开始配对、重置等操作。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the
应理解,图2示出的各种部件可以在包括一个或多个信号处理或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。It should be understood that the various components shown in FIG. 2 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing or application specific integrated circuits.
图3是一种适用于本申请的电子设备的硬件系统。Fig. 3 is a hardware system applicable to the electronic equipment of this application.
电子设备300可以是手机、智慧屏、平板电脑、可穿戴电子设备、车载电子设备、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、投影仪等等,本申请实施例对电子设备300的具体类型不作任何限制。The electronic device 300 may be a mobile phone, a smart screen, a tablet computer, a wearable electronic device, a vehicle electronic device, an augmented reality (augmented reality, AR) device, a virtual reality (virtual reality, VR) device, a notebook computer, a super mobile personal computer ( Ultra-mobile personal computer (UMPC), netbook, personal digital assistant (personal digital assistant, PDA), projector, etc., the embodiment of the present application does not impose any limitation on the specific type of the electronic device 300 .
电子设备300可以包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,移动通信模块350,无线通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394,以及用户标识模块(subscriber identification module,SIM)卡接口395等。其中传感器模块380可以包括压力传感器380A,陀螺仪传感器380B,气压传感器380C,磁传感器380D,加速度传感器380E,距离传感器380F,接近光传感器380G,指纹传感器380H,温度传感器380J,触摸传感器380K,环境光传感器380L,骨传导传感器380M等。The electronic device 300 may include a
需要说明的是,图3所示的结构并不构成对电子设备300的具体限定。在本申请另一些实施例中,电子设备300可以包括比图3所示的部件更多或更少的部件,或者,电子设备300可以包括图3所示的部件中某些部件的组合,或者,电子设备300可以包括图3所示的部件中某些部件的子部件。图3示的部件可以以硬件、软件、或软件和硬件的组合实现。It should be noted that the structure shown in FIG. 3 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 those shown in FIG. 3 , or the electronic device 300 may include a combination of some of the components shown in FIG. 3 , or , the electronic device 300 may include subcomponents of some of the components shown in FIG. 3 . The components shown in FIG. 3 can be realized in hardware, software, or a combination of software and hardware.
处理器310可以包括一个或多个处理单元。例如,处理器310可以包括以下处理单元中的至少一个:应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、神经网络处理器(neural-network processing unit,NPU)。其中,不同的处理单元可以是独立的器件,也可以是集成的器件。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.
处理器310中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器310中的存储器为高速缓冲存储器。该存储器可以保存处理器310刚用过或循环使用的指令或数据。如果处理器310需要再次使用该指令或数据,可从所述存储器中直接调用,避免了重复存取,减少了处理器310的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器310可以包括一个或多个接口。该接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI) ,通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments,
其中,I2S接口可以用于音频通信。在一些实施例中,处理器310可以包含多组I2S总线。处理器310可以通过I2S总线与音频模块370耦合,实现处理器310与音频模块370之间的通信。在一些实施例中,音频模块370可以通过I2S接口向无线通信模块360传递音频信号,实现通过蓝牙耳机接听电话的功能。Among them, the I2S interface can be used for audio communication. In some embodiments,
PCM接口也可以用于音频通信,将模拟信号抽样,量化和编码。在一些实施例中,音频模块370与无线通信模块360可以通过PCM总线接口耦合。在一些实施例中,音频模块370也可以通过PCM接口向无线通信模块360传递音频信号,实现通过蓝牙耳机接听电话的功能。I2S接口和PCM接口都可以用于音频通信。The PCM interface can also be used for audio communication, sampling, quantizing and encoding the analog signal. In some embodiments, the
UART接口是一种通用串行数据总线,用于异步通信。该总线可以为双向通信总线。它将要传输的数据在串行通信与并行通信之间转换。在一些实施例中,UART接口通常被用于连接处理器310与无线通信模块360。例如:处理器310通过UART接口与无线通信模块360中的蓝牙模块通信,实现蓝牙功能。在一些实施例中,音频模块370可以通过UART接口向无线通信模块360传递音频信号,实现通过蓝牙耳机播放音乐的功能。The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备300的结构限定。在本申请另一些实施例中,电子设备300也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 300 . In other embodiments of the present application, the electronic device 300 may also adopt different interface connection manners in the foregoing embodiments, or a combination of multiple interface connection manners.
电子设备300的无线通信功能可以通过天线1,天线2,移动通信模块350,无线通信模块360,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 300 can be realized by the
移动通信模块350可以提供应用在电子设备300上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块350可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块350可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块350还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块350的至少部分功能模块可以被设置于处理器310中。在一些实施例中,移动通信模块350的至少部分功能模块可以与处理器310的至少部分模块被设置在同一个器件中。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器370A,受话器370B等)输出声音信号,或通过显示屏394显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器310,与移动通信模块350或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs sound signals through audio equipment (not limited to speaker 370A,
无线通信模块360可以提供应用在电子设备300上的包括WLAN(如Wi-Fi),BT,全球导航卫星系统(global navigation satellite system,GNSS),FM,NFC,IR或通用2 .4G/5G无线通信技术等无线通信的解决方案。无线通信模块360可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块360经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器310。无线通信模块360还可以从处理器310接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The
在一些实施例中,该无线通信模块360可以为蓝牙芯片。电子设备300可以通过该蓝牙芯片,与无线耳机等电子设备的蓝牙芯片之间进行配对并建立无线连接,以通过该无线连接实现电子设备300和其他电子设备之间的无线通信和业务处理。该无线连接可以是物理连接或虚拟连接。蓝牙芯片通常可以支持BR/EDR蓝牙和BLE。In some embodiments, the
电子设备300可以通过GPU、显示屏194以及应用处理器实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器310可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 300 can realize the display function through the GPU, the display screen 194 and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
显示屏394可以用于显示图像或视频。显示屏394包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体(active-matrix organic light-emitting diode,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、迷你发光二极管(mini light-emitting diode,Mini LED)、微型发光二极管(micro light-emitting diode,Micro LED)、微型OLED (Micro OLED)或量子点发光二极管(quantum dotlight emitting diodes,QLED)。在一些实施例中,电子设备300可以包括1个或N个显示屏394,N为大于1的正整数。Display 394 may be used to display images or video. Display 394 includes a display panel. The display panel can adopt liquid crystal display (liquid crystal display, LCD), organic light-emitting diode (organic light-emitting diode, OLED), active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), flexible Light-emitting diode (flex light-emitting diode, FLED), mini light-emitting diode (mini light-emitting diode, Mini LED), micro light-emitting diode (micro light-emitting diode, Micro LED), micro OLED (Micro OLED) or quantum dots Diodes (quantum dotlight emitting diodes, QLEDs). In some embodiments, the electronic device 300 may include 1 or N display screens 394, where N is a positive integer greater than 1.
电子设备300可以通过ISP、摄像头393、视频编解码器、GPU、显示屏394以及应用处理器等实现拍摄功能。The electronic device 300 can realize the shooting function through the ISP, the camera 393 , the video codec, the GPU, the display screen 394 , and the application processor.
ISP 用于处理摄像头393反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP可以对图像的噪点、亮度和色彩进行算法优化,ISP还可以优化拍摄场景的曝光和色温等参数。在一些实施例中,ISP可以设置在摄像头393中。The ISP is used to process the data fed back by the camera 393 . For example, when taking a picture, open the shutter, the light is transmitted to the photosensitive element of the camera through the lens, and the light signal is converted into an electrical signal, and the photosensitive element of the camera transmits the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can optimize the algorithm of image noise, brightness and color, and ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP may be located in the camera 393 .
摄像头393用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的红绿蓝(red green blue,RGB),YUV等格式的图像信号。在一些实施例中,电子设备300可以包括1个或N个摄像头193,N为大于1的正整数。Camera 393 is used to capture still images or video. The object generates an optical image through the lens and projects it to the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a complementary metal-oxide-semiconductor (complementary metal-oxide-semiconductor, CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. DSP converts digital image signals into standard red green blue (red green blue, RGB), YUV and other image signals. In some embodiments, the electronic device 300 may include 1 or N cameras 193 , where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备300在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 300 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
电子设备300可以通过音频模块370、扬声器370A、受话器370B、麦克风370C、耳机接口370D以及应用处理器等实现音频功能,例如,音乐播放和录音。The electronic device 300 can implement audio functions, such as music playing and recording, through the
音频模块370用于将数字音频信息转换成模拟音频信号输出,也可以用于将模拟音频输入转换为数字音频信号。音频模块370还可以用于对音频信号编码和解码。在一些实施例中,音频模块370或者音频模块370的部分功能模块可以设置于处理器310中。The
扬声器370A,也称为喇叭,用于将音频电信号转换为声音信号。电子设备300可以通过扬声器370A收听音乐或免提通话。Speaker 370A, also known as a horn, is used to convert audio electrical signals into sound signals. The electronic device 300 can listen to music or make a hands-free call through the speaker 370A.
受话器370B,也称为听筒,用于将音频电信号转换成声音信号。当用户使用电子设备300接听电话或语音信息时,可以通过将受话器370B靠近耳朵接听语音。
麦克风370C,也称为话筒或传声器,用于将声音信号转换为电信号。当用户拨打电话或发送语音信息时,可以通过靠近麦克风370C发声将声音信号输入麦克风370C。
耳机接口370D用于连接有线耳机。耳机接口370D可以是USB接口330,也可以是3.5mm的开放移动电子设备300平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of theUSA,CTIA)标准接口。The
按键390包括开机键和音量键。按键390可以是机械按键,也可以是触摸式按键。电子设备300可以接收按键输入信号,实现于案件输入信号相关的功能。Keys 390 include a power key and a volume key. The button 390 may be a mechanical button or a touch button. The electronic device 300 can receive key input signals and implement functions related to case input signals.
马达391可以产生振动。马达391可以用于来电提示,也可以用于触摸反馈。马达391可以对作用于不同应用程序的触摸操作产生不同的振动反馈效果。对于作用于显示屏394的不同区域的触摸操作,马达391也可产生不同的振动反馈效果。不同的应用场景(例如,时间提醒、接收信息、闹钟和游戏)可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 391 can generate vibrations. The motor 391 can be used for incoming call notification, and can also be used for touch feedback. The motor 391 can generate different vibration feedback effects for touch operations on different application programs. For touch operations acting on different areas of the display screen 394, the motor 391 can also generate different vibration feedback effects. Different application scenarios (for example, time reminder, receiving information, alarm clock and games) can correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
图3所示的各模块间的连接关系只是示意性说明,并不构成对电子设备300的各模块间的连接关系的限定。可选地,电子设备300的各模块也可以采用上述实施例中多种连接方式的组合。The connection relationship between the modules shown in FIG. 3 is only a schematic illustration, and does not constitute a limitation on the connection relationship between the modules of the electronic device 300 . Optionally, each module of the electronic device 300 may also adopt a combination of various connection modes in the foregoing embodiments.
上文详细描述了电子设备300的硬件系统,下面介绍电子设备300的软件系统。软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构或云架构,本申请实施例以分层架构为例,示例性地描述电子设备300的软件系统。The hardware system of the electronic device 300 is described in detail above, and the software system of the electronic device 300 is introduced below. The software system may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application uses a layered architecture as an example to exemplarily describe the software system of the electronic device 300 .
图4是一种适用于本申请的电子设备的软件系统的示意图。如图4所示,采用分层架构的软件系统分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,软件系统可以分为四层,从上至下分别为应用程序层、应用程序框架层、本地服务native层,硬件抽象层(hardwareabstractlayer,HAL)以及物理层。FIG. 4 is a schematic diagram of a software system applicable to the electronic device of the present application. As shown in Figure 4, a software system adopting a layered architecture is divided into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the software system can be divided into four layers, which are application program layer, application program framework layer, local service native layer, hardware abstract layer (hardware abstract layer, HAL) and physical layer from top to bottom.
其中,应用程序层可以包括一系列应用程序包。图4中示出了设置应用程序和蓝牙应用程序。比如,应用程序层中还可以包括相机、图库、日历、通话、地图、导航、WLAN、音乐、视频、短信息等应用程序。Wherein, the application program layer may include a series of application program packages. The Settings application and the Bluetooth application are shown in FIG. 4 . For example, the application layer may also include application programs such as camera, gallery, calendar, call, map, navigation, WLAN, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用程序编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层可以包括一些预定义的函数。如图4所示,应用程序框架层包括蓝牙服务service。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer can include some predefined functions. As shown in Figure 4, the application framework layer includes the bluetooth service.
可选地,应用程序框架层还可以包括窗口管理器、内容提供器、视图系统、电话管理器、资源管理器和通知管理器。Optionally, the application framework layer may also include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏、锁定屏幕和截取屏幕。A window manager is used to manage window programs. The window manager can get the size of the display, determine whether there is a status bar, lock the screen, and capture the screen.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频、图像、音频、拨打和接听的电话、浏览历史和书签、以及电话簿。Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, and phonebook.
视图系统包括可视控件,例如显示文字的控件和显示图片的控件。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成,例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as those that display text and those that display pictures. The view system can be used to build applications. The display interface may be composed of one or more views, for example, a display interface including an SMS notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备300的通信功能,例如通话状态(接通或挂断)的管理。The phone manager is used to provide communication functions of the electronic device 300, such as management of call status (connected or hung up).
资源管理器为应用程序提供各种资源,比如本地化字符串、图标、图片、布局文件和视频文件。The resource manager provides various resources to the application, such as localized strings, icons, pictures, layout files, and video files.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于下载完成告知和消息提醒。通知管理器还可以管理以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知。通知管理器还可以管理以对话窗口形式出现在屏幕上的通知,例如在状态栏提示文本信息、发出提示音、电子设备振动以及指示灯闪烁。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used for download completion notifications and message reminders. The notification manager can also manage notifications that appear in the status bar at the top of the system in the form of charts or scrolling text, such as notifications from applications running in the background. The notification manager can also manage notifications that appear on the screen in the form of dialog windows, such as prompting text messages in the status bar, making alert sounds, vibrating electronic devices, and blinking lights.
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。Android Runtime includes core library and virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。The core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理、堆栈管理、线程管理、安全和异常的管理、以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes the java files of the application program layer and the application program framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
Native层,可以提高一些本地服务和链接库等。其中,Native层可以包括蓝牙协议栈。在另一些实施例中,也可以通过在Native层中对蓝牙协议栈进行适应性修改,以实现本申请实施例提供的蓝牙连接方法。在一些实施例中,蓝牙协议栈可以包括队列模块。队列模块中可以包括基于蓝牙连接请求生成的节点(node)。比如,在电子设备300自动回连第二外接设备时,队列中生成节点1和节点2。节点1用于处理第二外接设备的通话连接请求,节点2用于处理第二外接设备的媒体(比如音乐)连接请求。比如,队列按照节点1、节点2的先后次序排序。The Native layer can improve some local services and link libraries, etc. Wherein, the Native layer may include a Bluetooth protocol stack. In some other embodiments, the Bluetooth connection method provided by the embodiment of the present application may also be realized by performing adaptive modification on the Bluetooth protocol stack in the Native layer. In some embodiments, the Bluetooth protocol stack may include a queue module. The queue module may include nodes (nodes) generated based on Bluetooth connection requests. For example, when the electronic device 300 automatically connects back to the second external device,
在本申请实施例中,如果在第二外接设备的自动回连过程中,电子设备接收到第一外接设备的连接请求,第一外接设备是优先连接设备,第一外接设备的连接请求通过节点3处理,那么在队列中,将节点3排在节点1与节点2前面,优先处理节点3的请求,即优先连接第一外接设备。比如,队列按照节点3、节点1、节点2的先后次序排序。另外,在第一外接设备连接完成后,可以继续连接第二外接设备,即节点3处理完成后,继续处理节点1、节点2。In this embodiment of the application, if the electronic device receives a connection request from the first external device during the automatic connection back process of the second external device, the first external device is a priority connection device, and the connection request of the first external device passes through the
应理解,此处只是以节点1、节点2和节点3为例进行描述,本申请实施例并不限于此。事实上,队列中也可以包含更多的节点。It should be understood that the
HAL层为位于操作系统内核与硬件电路之间的接口层,可以将硬件抽象化。物理层提供了底层硬件驱动接口。The HAL layer is an interface layer between the operating system kernel and the hardware circuit, which can abstract the hardware. The physical layer provides the underlying hardware driver interface.
内核层是硬件和软件之间的层。内核层可以包括显示驱动、摄像头驱动、音频驱动和传感器驱动等驱动模块。The kernel layer is the layer between hardware and software. The kernel layer may include driver modules such as display driver, camera driver, audio driver and sensor driver.
可以理解的是,电子设备300也可以是其他操作系统,本申请实施例不予限定。在其他一些操作系统中,框架层与Native层也可以设置为一层。因而,在其他一些实施例中,也可以通过在该层中对现有蓝牙协议进行应性修改,以实现本申请实施例提供的蓝牙连接方法。It can be understood that the electronic device 300 may also be another operating system, which is not limited in this embodiment of the present application. In some other operating systems, the framework layer and the Native layer can also be set as one layer. Therefore, in some other embodiments, the Bluetooth connection method provided by the embodiment of the present application may also be implemented by making adaptive modifications to the existing Bluetooth protocol in this layer.
需要说明的是,上述仅是以图3对电子设备的结构进行举例说明,以图4对电子设备的软件架构进行举例说明,本申请实施例对此不作具体限定。It should be noted that, the foregoing is only to illustrate the structure of the electronic device by using FIG. 3 , and to illustrate the software architecture of the electronic device by using FIG. 4 , which is not specifically limited in this embodiment of the present application.
以对框架层中的蓝牙服务Service为例进行说明。在本申请实施例所基于的蓝牙协议中,电子设备框架层中的蓝牙服务Service在确定与蓝牙耳机已配对,并接收到蓝牙耳机发送的BLE广播消息时,向上层蓝牙应用(例如蓝牙设置(setting)应用)上报已与蓝牙耳机连接。例如,框架层中的蓝牙服务Service,具体可以通过安卓广播消息机制向蓝牙setting应用通知已与蓝牙耳机连接。上层蓝牙应用在相关界面上(例如在显示界面的状态栏中,或者在通知栏中,或者在蓝牙管理界面上,或者在负1屏上等)显示已连接的蓝牙耳机的相关信息,例如电量、佩戴状态、业务状态、连接状态、设备名称、设备型号、设备图标、连接标识等已连接信息。其中, BLE广播消息可以包括蓝牙耳机的设备名称、设备类型、设备型号、电池电量、佩戴状态、连接状态或业务状态等工作状态信息中的一种。其中,连接状态信息可以表示是否已与电子设备建立物理连接。业务状态信息可以表示蓝牙耳机当前是否为空闲态,或者蓝牙耳机正在处理的音频业务。并且, BLE广播消息是周期性发送的,蓝牙应用可以根据实时获取的BLE广播消息中蓝牙耳机的状态信息,实时更新相关界面上显示的,已连接蓝牙耳机的相关信息。Take the bluetooth service Service in the framework layer as an example to illustrate. In the Bluetooth protocol based on the embodiment of the present application, the Bluetooth service Service in the framework layer of the electronic device determines that it has been paired with the Bluetooth headset, and when receiving the BLE broadcast message sent by the Bluetooth headset, it sends to the upper-level Bluetooth application (such as Bluetooth settings ( setting) application) to report that it has been connected to the Bluetooth headset. For example, the Bluetooth service Service in the framework layer can specifically notify the Bluetooth setting application that it has been connected to the Bluetooth headset through the Android broadcast message mechanism. The upper-level Bluetooth application displays related information about the connected Bluetooth headset, such as the battery level, on the relevant interface (for example, in the status bar of the display interface, or in the notification bar, or on the Bluetooth management interface, or on the negative 1 screen, etc.) , wearing status, business status, connection status, device name, device model, device icon, connection logo and other connected information. Wherein, the BLE broadcast message may include one of working status information such as device name, device type, device model, battery level, wearing status, connection status or business status of the Bluetooth headset. Wherein, the connection state information may indicate whether a physical connection has been established with the electronic device. The service status information may indicate whether the bluetooth headset is currently in an idle state, or the audio service being processed by the bluetooth headset. Moreover, the BLE broadcast message is sent periodically, and the Bluetooth application can update the relevant information of the connected Bluetooth headset displayed on the relevant interface in real time according to the status information of the Bluetooth headset in the BLE broadcast message obtained in real time.
以下结合图5至图9详细描述本申请实施例的蓝牙连接的方法。本申请实施例以电子设备与外接设备包括蓝牙模块,电子设备与外接设备通过蓝牙进行无线连接为例进行说明。The Bluetooth connection method in the embodiment of the present application will be described in detail below with reference to FIG. 5 to FIG. 9 . In the embodiment of the present application, the electronic device and the external device include a bluetooth module, and the electronic device and the external device are wirelessly connected through bluetooth as an example for description.
参考图5,图5示出了本申请实施例确定优先连接设备的方法500示例图。可以理解,图5中的方法可适用于电子设备中。比如,应用于图1所示的场景中。图5中的方法500包括以下步骤:Referring to FIG. 5 , FIG. 5 shows an exemplary diagram of a
步骤501,电子设备开启蓝牙。In
本申请实施例对电子设备开启蓝牙的入口不作具体限定。比如,用户可以下滑通知栏(或者说状态栏),然后在通知栏中点击蓝牙控件,以开启蓝牙功能。又比如,用户可以在电子设备的设置应用程序或蓝牙应用程序中,进入蓝牙功能开关选项,并选择开启蓝牙功能。The embodiment of the present application does not specifically limit the entry for enabling the Bluetooth of the electronic device. For example, the user can slide down the notification bar (or status bar), and then click the Bluetooth control in the notification bar to enable the Bluetooth function. For another example, the user can enter the Bluetooth function switch option in the setting application program or the Bluetooth application program of the electronic device, and choose to enable the Bluetooth function.
步骤502,电子设备执行自动回连,并同时开启扫描。In
示例性地,电子设备在开启蓝牙功能后,主动尝试连接最近连接过的设备(或者说上次连接的设备)。本申请实施例将最近连接过的设备命名为第二外接设备。比如,第二外接设备是图1中所示的耳机11。Exemplarily, after the Bluetooth function is turned on, the electronic device actively tries to connect to a recently connected device (or last connected device). In the embodiment of the present application, the recently connected device is named as the second external device. For example, the second external device is the
在执行自动回连的同时,电子设备还可以同步启动扫描,以发现其他可连接的外接设备。比如,电子设备扫描到第一外接设备。扫描也可以理解为搜索或发现新设备的过程。While performing automatic reconnection, the electronic device can also start scanning synchronously to discover other connectable external devices. For example, the electronic device scans to the first external device. Scanning can also be understood as the process of searching or discovering new devices.
步骤503,电子设备发现第一外接设备。
比如,第一外接设备可以是图1中所示的耳机12。For example, the first external device may be the
本申请实施例对电子设备如何发现第一外接设备的方式不作具体限定。电子设备可以通过BR扫描的方式发现第一外接设备,也可以通过BLE广播方式发现第一外接设备。The embodiment of the present application does not specifically limit the manner in which the electronic device discovers the first external device. The electronic device may discover the first external device through BR scanning, or may discover the first external device through BLE broadcasting.
可选地,作为一种实现方式,电子设备通过BLE广播方式发现第一外接设备,具体如下:Optionally, as an implementation, the electronic device discovers the first external device through BLE broadcasting, specifically as follows:
第一外接设备广播电子设备低功耗蓝牙BLE广播消息,所述BLE广播消息包括蓝牙地址;相应地,电子设备在接收到BLE广播消息后,通过解析所述BLE广播消息获得所述蓝牙地址。The first external device broadcasts an electronic device Bluetooth Low Energy BLE broadcast message, and the BLE broadcast message includes a Bluetooth address; correspondingly, after receiving the BLE broadcast message, the electronic device obtains the Bluetooth address by parsing the BLE broadcast message.
可选地, BLE广播消息可以是第一外接设备周期性发送的。Optionally, the BLE broadcast message may be sent periodically by the first external device.
应理解,上述BLE广播消息中也可以包含其他信息,本申请实施例对此不作具体限定。It should be understood that the foregoing BLE broadcast message may also include other information, which is not specifically limited in this embodiment of the present application.
可选地,作为一种实现方式,电子设备通过BR扫描发现所述第一外接设备,包括:Optionally, as an implementation manner, the electronic device discovers the first external device through BR scanning, including:
电子设备向第一外接设备发送查询(inquiry)请求;The electronic device sends an inquiry (inquiry) request to the first external device;
第一外接设备向电子设备回复响应请求信息,所述响应请求信息中包括基础速率BR地址。The first external device replies a response request message to the electronic device, and the response request message includes a basic rate BR address.
电子设备在收到响应请求信息后,即可得知扫描到第一外接设备了。After receiving the response request information, the electronic device can know that the first external device has been scanned.
应理解,上述示出的发现第一外接设备的两种方式只是示例性描述,本申请实施例并不限于此。事实上,电子设备也可以通过其他合理的方式发现第一外接设备。It should be understood that the two manners for discovering the first external device shown above are only exemplary descriptions, and this embodiment of the present application is not limited thereto. In fact, the electronic device may also discover the first external device in other reasonable ways.
在扫描到第一外接设备后,电子设备可以基于解析出的蓝牙地址,执行与第一外接设备的匹配操作。After the first external device is scanned, the electronic device may perform a matching operation with the first external device based on the resolved Bluetooth address.
示例性地,电子设备在接收到BLE广播消息后,对BLE广播消息进行解析,获得蓝牙地址,并基于蓝牙地址以及配对列表设备,与第一外接设备进行配对(或者说匹配)。Exemplarily, after receiving the BLE broadcast message, the electronic device parses the BLE broadcast message to obtain the Bluetooth address, and performs pairing (or matching) with the first external device based on the Bluetooth address and the pairing list device.
配对是指在电子设备和第一外接设备之间共享链路密钥(link key)。链路密钥可以用于相互认证蓝牙设备并加密交换的数据。例如,蓝牙设备的配对方式可以包括PIN码配对(PIN code pairing)和安全简易配对(secure simple pairing,SSP)。Pairing refers to sharing a link key (link key) between the electronic device and the first external device. Link keys can be used to mutually authenticate Bluetooth devices and encrypt exchanged data. For example, the pairing manner of the Bluetooth device may include PIN code pairing (PIN code pairing) and secure simple pairing (secure simple pairing, SSP).
当电子设备与第一外接设备配对成功后,可认为第一外接设备处于已配对状态。同时,还可以判断第一外接设备是否可连接。可连接状态可以理解为第一外接设备处于能够被连接的状态。When the electronic device is successfully paired with the first external device, it can be considered that the first external device is in a paired state. At the same time, it can also be determined whether the first external device is connectable. The connectable state may be understood as a state in which the first external device is capable of being connected.
步骤504,判断第一外接设备是否处于可连接以及已配对状态。
示例性地,已配对状态可以理解为:第一外接设备能够被电子设备搜索到,且电子设备与第一外接设备配对成功时的状态。Exemplarily, the paired state can be understood as: the state when the first external device can be searched by the electronic device, and the electronic device and the first external device are successfully paired.
在一些可能的实现方式中,可连接状态可以基于第一外接设备支持连接的设备的最大数量确定。比如,第一外接设备最多支持连接2个设备,如果第一外接设备已经连接了一个设备,说明第一外接设备还可以再进行连接,则第一外接设备为可连接状态。In some possible implementation manners, the connectable state may be determined based on the maximum number of connected devices supported by the first external device. For example, the first external device supports connecting to two devices at most. If the first external device has already connected to one device, it means that the first external device can be connected again, and the first external device is in a connectable state.
如果第一外接设备处于可连接以及已配对状态,则执行步骤504。如果第一外接设备未处于可连接状态或已配对状态,则不执行步骤504。If the first external device is in a connectable and paired state,
可选地,在发现第一外接设备后,电子设备还可显示第一窗口(或者说第一弹窗),以便向用户提示第一外接设备可连接。Optionally, after discovering the first external device, the electronic device may also display a first window (or a first pop-up window), so as to prompt the user that the first external device can be connected.
可选地,所述方法500还包括:Optionally, the
显示第一界面,所述第一界面中包括第一窗口,所述第一窗口用于提示第一外接设备可连接。A first interface is displayed, the first interface includes a first window, and the first window is used to prompt that the first external device can be connected.
示例性地,在第一外接设备处于可连接以及已配对状态后,还可以通过第一窗口提示用户第一外接设备可连接。第一界面可以如后文图8中(1)示出的界面,第一窗口可以是图8中(1)的窗口801。Exemplarily, after the first external device is in a connectable and paired state, the user may also be prompted through the first window that the first external device is connectable. The first interface may be the interface shown in (1) in FIG. 8 later, and the first window may be the
可选地,第一窗口中还可以包括连接第一外接设备的选项或控件。当用户点击第一窗口中的连接第一外接设备的选项后,可发起第一外接设备的连接。第一窗口的示例将在后文图8中的界面进行示例描述。Optionally, the first window may further include an option or a control for connecting the first external device. After the user clicks the option of connecting to the first external device in the first window, the connection of the first external device may be initiated. An example of the first window will be described later in the interface in FIG. 8 .
步骤505,电子设备将第一外接设备设置为优先连接设备。
在本申请实施例中,电子设备将第一外接设备标记为优先连接的设备。优先连接的设备是指:连接次序优于电子设备当前正在连接的设备(比如正在自动回连的设备)。In the embodiment of the present application, the electronic device marks the first external device as a device for preferential connection. The device that is connected with priority means that the connection order is higher than that of the device that the electronic device is currently connecting to (such as the device that is automatically reconnecting).
应理解,本申请实施例对标记优先连接的设备具体的标记方式不作限定。It should be understood that the embodiment of the present application does not limit the specific marking manner of marking the devices for preferential connection.
示例性地,在第一外接设备配对成功的情况下,可以在第一外接设备的配对信息中增加标识信息,所述标识信息用于标识第一外接设备为允许优先连接的设备。Exemplarily, when the pairing of the first external device is successful, identification information may be added to the pairing information of the first external device, where the identification information is used to identify the first external device as a device that allows preferential connection.
示例性地,在第一外接设备还未配对的情况下,可以基于电子设备在本地临时缓存的BLE结果,在连接第一外接设备的过程中将第一外接设备设置为优先连接设备。Exemplarily, in the case that the first external device has not been paired, the first external device may be set as a priority connection device during the process of connecting the first external device based on the BLE result temporarily cached locally by the electronic device.
本申请实施例将第一外接设备设置为优先连接设备,可方便用户实现第一外接设备的快速连接。以下结合图6描述第一外接设备的连接过程。In the embodiment of the present application, the first external device is set as the priority connection device, which can facilitate the quick connection of the first external device for the user. The connection process of the first external device will be described below with reference to FIG. 6 .
参考图6,图6示出了本申请实施例的蓝牙连接的方法600的示意性流程图。可以理解,图6中的方法可适用于电子设备中。比如,应用于图1所示的场景中。还应理解,图6中的方法可与图5中的方法组合实施,也可以独立实施,对此不作具体限定。示例性地,当图5中的方法与图6中的方法组合实施时,可以先执行图5中的方法,然后再执行图6中的方法。Referring to FIG. 6 , FIG. 6 shows a schematic flowchart of a
如图6所示,该方法600包括以下步骤:As shown in FIG. 6, the
步骤601,检测到用户的第一操作,所述第一操作用于指示发起第一外接设备的蓝牙连接。In
第一操作可以是用户手动发起的连接第一外接设备的操作。本申请实施例对第一操作的具体形式不作限定。The first operation may be an operation initiated manually by the user to connect to the first external device. The embodiment of the present application does not limit the specific form of the first operation.
第一操作可以是在电子设备端发起的,也可以是在第一外接设备处发起的,对此不作具体限定。The first operation may be initiated at the electronic device or at the first external device, which is not specifically limited.
一种实现方式,用户可以在电子设备中点击连接第一外接设备。比如,前文图5步骤504的描述提到“当用户点击第一弹窗中的连接第一外接设备的选项后,可发起第一外接设备的连接”,即第一操作可以是用户点击第一弹窗中的连接第一外接设备的选项。例如,第一操作可以是图8中点击窗口801中的“是”选项的操作。In one implementation manner, the user may click on the electronic device to connect to the first external device. For example, the description of
又一种实现方式,用户可以通过触控第一外接设备的触摸操作区域,以发起蓝牙连接。本申请实施例对此不作限定。In yet another implementation manner, the user may initiate a Bluetooth connection by touching the touch operation area of the first external device. This embodiment of the present application does not limit it.
本申请实施例对电子设备如何发现第一外接设备的方式不作具体限定。The embodiment of the present application does not specifically limit the manner in which the electronic device discovers the first external device.
步骤602,确定当前是否正在连接第二外接设备。
可选地,第二外接设备是电子设备的自动回连设备。Optionally, the second external device is an automatic connection back device of the electronic device.
回连是指电子设备正在通过寻呼的方式尝试与之前配对且连接过的第二外接设备进行回连的操作。在一些实施例中,回连包括:电子设备发送寻呼(page)数据包至第二外接设备,以请求建立与第二外接设备间的通信连接。The connection back refers to an operation in which the electronic device is trying to perform a connection back with a previously paired and connected second external device by means of paging. In some embodiments, the connection back includes: the electronic device sends a paging (page) data packet to the second external device to request establishment of a communication connection with the second external device.
或者,可选地,第二外接设备是用户在发起第一操作之前选择连接的设备,且第二外接设备当前无法与电子设备建立连接。示例性地,在检测到用户的第一操作之前,电子设备还检测到了第二操作,第二操作用于指示连接第二外接设备。Or, optionally, the second external device is a device that the user selects to connect to before initiating the first operation, and the second external device cannot currently establish a connection with the electronic device. Exemplarily, before detecting the first operation by the user, the electronic device further detects a second operation, and the second operation is used to indicate to connect the second external device.
示例性地,第二外接设备无法与电子设备建立连接,包括以下一项或多项情况:第二外接设备处于关机状态,无法与电子设备建立连接;第二外接设备与电子设备距离较远,不在电子设备的通信范围内,无法收到电子设备发送的数据;第二外接设备已与其他设备建立连接,且超出了最大连接数量,无法再与电子设备建立连接。Exemplarily, the second external device cannot establish a connection with the electronic device, including one or more of the following situations: the second external device is in a power-off state and cannot establish a connection with the electronic device; the second external device is far away from the electronic device, The data sent by the electronic device cannot be received because it is not within the communication range of the electronic device; the second external device has established a connection with other devices, and the maximum number of connections has been exceeded, so it cannot establish a connection with the electronic device.
应理解,上述关于第二外接设备无法与电子设备建立连接的情况只是示例性描述,本申请实施例并不限于此。It should be understood that the foregoing description about the situation that the second external device cannot establish a connection with the electronic device is only an exemplary description, and this embodiment of the present application is not limited thereto.
如果电子设备正在与第二外接设备连接,则执行步骤603,判断第一外接设备是否为优先连接设备。此处描述的是电子设备与第二外接设备正在连接的情况下,检测到了用户的第一操作。当然,如果电子设备没有与第二外接设备正在连接,则检测到用户的第一操作后,直接发起与第一外接设备的连接即可。If the electronic device is being connected to the second external device,
步骤603,在所述第二外接设备正在连接的情况下,确定所述第一外接设备是否为优先连接设备。
优先连接设备是指连接次序优于电子设备当前正在连接的设备(比如第二外接设备)。The preferential connection device refers to a device (such as a second external device) that is connected in a higher order than the electronic device is currently connected to.
优先连接设备的设置方式可以参考前文图5中步骤504的描述。为了简洁,此处不再赘述。For the setting method of the preferentially connected device, reference may be made to the description of
示例性地,在采用前文图5中步骤504将第一外接设备设置为优先外接设备时,此处即可判断出第一外接设备为优先连接设备,即第一外接设备的连接优于第二外接设备的连接。Exemplarily, when
步骤604,响应于所述第一操作,在确定第一外接设备是优先连接设备时,取消第二外接设备的连接,并建立所述电子设备与所述第一外接设备间的蓝牙连接。
示例性地,取消第二外接设备的连接可理解为:对于正在连接的第二外接设备,取消或终止第二外接设备的物理链路连接。Exemplarily, canceling the connection of the second external device may be understood as: for the second external device being connected, canceling or terminating the physical link connection of the second external device.
可选地,在第一外接设备与电子设备连接完成后,如果还需要恢复第二外接设备的连接,则可以继续尝试连接第二外接设备。Optionally, after the connection between the first external device and the electronic device is completed, if it is necessary to restore the connection of the second external device, you may continue to try to connect the second external device.
在本申请实施例中,在检测到用户的第一操作后,判断是否存在正在连接的第二外接设备;在所述第二外接设备正在连接的情况下,再判断所述第一外接设备是否为优先连接设备;在第一外接设备是优先连接设备的情况下,取消正在连接第二外接设备,并建立与第一外接设备的蓝牙连接,能够显著提升第一外接设备的连接速度以及连接成功率。对于第二外接设备无法连接成功的情况下,本申请实施例在保留自动回连功能的前提下,能够显著提升第一外接设备的连接速度。In the embodiment of the present application, after the first operation of the user is detected, it is judged whether there is a second external device being connected; is the priority connection device; when the first external device is the priority connection device, canceling the connection with the second external device and establishing a Bluetooth connection with the first external device can significantly improve the connection speed and connection success of the first external device Rate. For the case where the second external device cannot be successfully connected, the embodiment of the present application can significantly increase the connection speed of the first external device on the premise of retaining the automatic connection back function.
当然,如果第一外接设备不是优先连接设备,则可以将第一外接设备的连接请求加入到队列中,按照队列次序依次进行连接,比如第二外接设备连接超时或者结束后,再连接第一外接设备。Of course, if the first external device is not the priority connection device, you can add the connection request of the first external device to the queue, and connect in sequence according to the queue order. For example, after the connection of the second external device times out or ends, then connect to the first external device. equipment.
以下结合图7中的流程为例描述。应理解,图7中涉及的部分特征、术语或概念可以参考前文的描述,以下不再赘述。以第一外接设备是A为例,第二外接设备是设备B为例进行描述,如图7所示,包括以下步骤:The following will be described in conjunction with the process in FIG. 7 as an example. It should be understood that for some features, terms, or concepts involved in FIG. 7 , reference may be made to the foregoing description, and details will not be repeated below. Taking the first external device as an example and the second external device as device B as an example, as shown in FIG. 7, the following steps are included:
步骤701,用户请求连接设备A。In
步骤702,电子设备判断是否有其他设备(比如设备B)正在连接中。In
如果设备B正在连接,则执行步骤703;如果没有其他设备正在连接,则执行步骤704。If device B is connecting, execute
步骤703,电子设备判断设备A是否是优先连接设备。In
如果设备A是优先连接设备,则执行步骤705。如果设备A不是优先连接设备,则执行步骤707。If device A is a preferentially connected device, step 705 is performed. If device A is not a preferentially connected device,
步骤704,电子设备直接发起设备A的连接。In
步骤705,电子设备取消设备B的连接,并建立设备A的连接。Step 705, the electronic device cancels the connection of device B, and establishes the connection of device A.
比如,在判断设备A是优先连接的设备时,取消设备B的连接,同时立即发起设备A的连接。For example, when it is determined that device A is the device to be connected with priority, the connection of device B is canceled and the connection of device A is initiated immediately.
可选地,在步骤705执行后,还可以执行步骤706,即继续连接设备B。Optionally, after step 705 is performed,
步骤707,电子设备将设备A的连接请求加入队列中,并执行设备B的连接。In
步骤708,在设备B连接超时或者结束后,执行设备A的连接。
应理解,图7的流程只是示例性描述,本申请实施例并不限于此。事实上,本领域技术人员在图7的基础上可以以更多的步骤或更少的步骤实现上述流程。It should be understood that the process in FIG. 7 is only an exemplary description, and this embodiment of the present application is not limited thereto. In fact, those skilled in the art can implement the above process with more steps or fewer steps on the basis of FIG. 7 .
可选地,在建立所述电子设备与所述第一外接设备间的蓝牙连接后,所述方法600还包括:Optionally, after establishing the Bluetooth connection between the electronic device and the first external device, the
显示第二界面,所述第二界面包括提示信息,所述提示信息用于提示所述第一外接设备已连接。A second interface is displayed, the second interface includes prompt information, and the prompt information is used to prompt that the first external device has been connected.
也就是说,当第一外接设备与电子设备连接成功后,还可以在界面上向用户提示第一外接设备已经连接成功,从而使得用户可以直观得知第一外接设备已经连接成功。That is to say, after the first external device is successfully connected to the electronic device, the user can be prompted on the interface that the first external device has been successfully connected, so that the user can intuitively know that the first external device has been successfully connected.
可以理解,上述第二界面中还可以显示其他信息,本申请实施例对此不作具体限定。It can be understood that other information may also be displayed on the second interface, which is not specifically limited in this embodiment of the present application.
以下结合图8和图9中的界面示例进行描述。The following description will be made in conjunction with the interface examples in FIG. 8 and FIG. 9 .
参考图8,图8示出了根据本申请实施例的界面示例图。如图8中(1)所示,界面中显示手机10的蓝牙管理界面。图8中(1)所示的界面与前文图1中(1)所示的界面类似,此处不再赘述界面中的具体内容。Referring to FIG. 8, FIG. 8 shows an example diagram of an interface according to an embodiment of the present application. As shown in (1) in FIG. 8 , the Bluetooth management interface of the
在采用本申请实施例的蓝牙连接的方法后,如图8中(1)所示,当耳机11正在自动回连时,如果耳机12与手机10配对成功,手机10的界面中还可以弹出窗口801(对应前文的第一窗口)。窗口801中包括“是”和“否”的选项。窗口801用于提示用户扫描到耳机12可以连接,是否连接耳机12。如果用户点击窗口801中的“是”选项,则界面显示如图8中(2)所示的界面。相比于前文示出的图1,此处图8中的耳机12无需再等待耳机11连接超时后,才能建立与手机10的连接。因此,图8中(2)的界面不会出现图1中(2)所示的连接失败窗口13。After adopting the Bluetooth connection method of the embodiment of the present application, as shown in (1) in Figure 8, when the
应理解,窗口801中包括的选项、窗口801在界面中所处的位置以及窗口801的尺寸大小只是示例性描述,本申请实施例不限于此。It should be understood that the options included in the
示例性地,前文步骤601的第一操作可以是用户点击窗口801中的“是”选项。Exemplarily, the first operation of
如图8中(2)所示的界面,耳机12显示正在连接中,耳机11位于耳机12的下方。也就是说,手机10在检测到用户针对耳机12的连接请求后,会取消耳机11的连接,并发起耳机12的连接,以便满足用户连接耳机12的需求。As shown in (2) in FIG. 8 , the
当耳机12与手机10建立连接后,手机10的界面可以显示如图8中(3)所示的界面(对应前文第二界面)。如图8中(3)所示,在已配对的设备栏中,耳机12显示已连接(对应第二界面中的提示信息)。另外,手机10的蓝牙界面中还可以包括控件901。控件901用于进入耳机12的管理界面。类似地,对于耳机11,也可以具备相应的控件。After the connection between the
在一些实施例中,蓝牙应用或设置应用还可以在电子设备的界面上显示蓝牙的名称、设备类型、设备型号、设备的电量等信息。In some embodiments, the Bluetooth application or the setting application can also display information such as the name of the Bluetooth, device type, device model, and power of the device on the interface of the electronic device.
如图9中(1)所示,用户可以点击控件901对耳机12进行设置。在手机10检测到用户点击控件901后,界面如图9中(2)所示。如图9中(2)所示,手机10的界面中可以显示蓝牙耳机12的详细信息。该详细信息可以包括:重命名选项、通话音频开关选项、媒体音频开关选项、蓝牙自动连接开关选项、电量信息(包括左耳机和右耳机)、来电铃声同步开关选项、取消配对窗口等。As shown in (1) in FIG. 9 , the user can click the
重命名选项用于对耳机12的名称进行修改。当用户点击重命名选项后,可对耳机12的名称进行编辑或修改。The rename option is used to modify the name of the
通话音频开关选项用于选择手机10的通话音频是否通过蓝牙耳机播放。比如,当用户开启通话音频选项后,手机10的通话音频可以通过耳机12播放;当用户关闭通话音频选项后,手机10的通话音频不通过耳机12播放。The call audio switch option is used to select whether the call audio of the
媒体音频开关选项用于选择手机10的媒体音频是否通过蓝牙耳机播放。比如,当用户开启媒体音频选项后,手机10的媒体音频可以通过耳机12播放;当用户关闭媒体音频选项后,手机10的媒体音频不通过耳机12播放。The media audio switch option is used to select whether the media audio of the
蓝牙自动连接开关选项用于选择是否自动连接该蓝牙耳机。比如,当用户开启蓝牙自动连接开关选项后,如果搜索到耳机12,则手机10自动连接该耳机12。The Bluetooth automatic connection switch option is used to select whether to automatically connect the Bluetooth headset. For example, after the user turns on the Bluetooth automatic connection switch option, if the
来电铃声同步开关选项用于选择来电时,耳机12是否自动播放手机铃声。The ringtone synchronization switch option for incoming calls is used to select whether the
取消配对窗口用于选择是否取消当前耳机12的配对。The cancel pairing window is used to select whether to cancel the pairing of the
应理解,图8和图9中示出的界面只是示例性描述,并非要将本申请实施例限定在该场景下,本申请实施例不限于此。It should be understood that the interfaces shown in FIG. 8 and FIG. 9 are only exemplary descriptions, and are not intended to limit the embodiment of the present application to this scenario, and the embodiment of the present application is not limited thereto.
可选地,在耳机12与手机10建立连接后,还可以在手机显示已连接的蓝牙耳机的状态信息。一种实现方式,蓝牙应用或设置应用可以在手机10的界面上显示已连接的蓝牙耳机的状态信息。比如,如图8中(3)中所示的蓝牙管理界面或图9中(1)所示的蓝牙管理界面中,已配对的设备栏下方显示耳机12的已连接信息。又比如,也可以在手机的状态栏中显示耳机12的连接图标和电量标识。本申请实施例对此不作具体限定。Optionally, after the connection between the
上文结合图1至图9,详细描述了本申请实施例提供的一种蓝牙连接的方法。下面将结合图10详细描述本申请的装置实施例。A Bluetooth connection method provided by an embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 9 . The device embodiment of the present application will be described in detail below with reference to FIG. 10 .
应理解,本申请实施例的蓝牙连接的装置可以执行前述本申请实施例的各种蓝牙连接的方法的实施例,即以下各种产品的具体工作过程,可以参考前述方法实施例中的对应过程。It should be understood that the Bluetooth-connected device of the embodiment of the present application can execute the various Bluetooth connection method embodiments of the above-mentioned embodiment of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the foregoing method embodiment .
图10是本申请实施例的蓝牙连接的装置1000的一个示意性框图。如图10所示,该装置1000包括:输入单元1010,处理单元1020,显示单元1030。应理解,装置1000可以执行图5至图9的蓝牙连接的方法。FIG. 10 is a schematic block diagram of a Bluetooth-connected device 1000 according to an embodiment of the present application. As shown in FIG. 10 , the device 1000 includes: an input unit 1010 , a processing unit 1020 , and a display unit 1030 . It should be understood that the device 1000 may execute the Bluetooth connection methods shown in FIG. 5 to FIG. 9 .
在一种可能的示例中,所述输入单元1010用于检测到用户的第一操作,所述第一操作用于指示发起所述第一外接设备的蓝牙连接;In a possible example, the input unit 1010 is configured to detect a first user operation, and the first operation is used to instruct to initiate the Bluetooth connection of the first external device;
所述处理单元1020用于:确定当前是否正在连接第二外接设备,所述第二外接设备是自动回连的设备;在所述第二外接设备正在连接的情况下,确定所述第一外接设备是否为优先连接设备;响应于所述第一操作,在确定所述第一外接设备是优先连接设备时,取消所述第二外接设备的连接,并建立所述电子设备与所述第一外接设备间的蓝牙连接。The processing unit 1020 is configured to: determine whether a second external device is currently being connected, and the second external device is a device that automatically connects back; if the second external device is being connected, determine that the first external device Whether the device is a priority connection device; in response to the first operation, when it is determined that the first external device is a priority connection device, cancel the connection of the second external device, and establish the connection between the electronic device and the first Bluetooth connection between external devices.
可选地,作为一种可能的实现方式,所述处理单元1020还用于在所述检测到用户的第一操作之前,通过扫描发现所述第一外接设备;Optionally, as a possible implementation manner, the processing unit 1020 is further configured to discover the first external device by scanning before the first user operation is detected;
判断所述第一外接设备是否处于可连接以及已配对状态;judging whether the first external device is in a connectable and paired state;
在所述第一外接设备处于可连接以及已配对状态时,将所述第一外接设备确定为优先连接设备。When the first external device is in a connectable and paired state, the first external device is determined as a priority connection device.
可选地,作为一种可能的实现方式,所述处理单元1020还用于:Optionally, as a possible implementation manner, the processing unit 1020 is further configured to:
调用所述显示单元1030显示第一界面,所述第一界面中包括第一窗口,所述第一窗口用于提示第一外接设备可连接。The display unit 1030 is invoked to display a first interface, the first interface includes a first window, and the first window is used to prompt that the first external device can be connected.
可选地,作为一种可能的实现方式,所述处理单元1020用于通过扫描发现所述第一外接设备,包括:Optionally, as a possible implementation manner, the processing unit 1020 is configured to discover the first external device by scanning, including:
调用所述输入单元1010接收来自所述第一外接设备的低功耗蓝牙BLE广播消息,所述BLE广播消息包括蓝牙地址;Invoking the input unit 1010 to receive a Bluetooth Low Energy BLE broadcast message from the first external device, where the BLE broadcast message includes a Bluetooth address;
通过解析所述BLE广播消息获得所述蓝牙地址,并基于所述蓝牙地址进行匹配。The Bluetooth address is obtained by parsing the BLE broadcast message, and matching is performed based on the Bluetooth address.
可选地,作为一种可能的实现方式,所述处理单元1020用于通过扫描发现所述第一外接设备,包括:Optionally, as a possible implementation manner, the processing unit 1020 is configured to discover the first external device by scanning, including:
向所述第一外接设备发送查询请求;sending a query request to the first external device;
接收所述第一外接设备返回的响应请求信息,所述响应请求信息中包括基础速率BR地址。Receiving response request information returned by the first external device, where the response request information includes a basic rate BR address.
可选地,作为一种可能的实现方式,在建立所述装置1000与所述第一外接设备间的蓝牙连接后,所述处理单元1020还用于调用所述显示单元1030:Optionally, as a possible implementation manner, after the Bluetooth connection between the apparatus 1000 and the first external device is established, the processing unit 1020 is further configured to call the display unit 1030:
显示第二界面,所述第二界面包括提示信息,所述提示信息用于提示所述第一外接设备已连接。A second interface is displayed, the second interface includes prompt information, and the prompt information is used to prompt that the first external device has been connected.
可选地,作为一种可能的实现方式,所述输入单元1010还用于在确定所述第一外接设备不是优先连接设备时,将所述第一外接设备加入到等待连接列表中,并继续执行所述第二外接设备的连接。Optionally, as a possible implementation, the input unit 1010 is further configured to, when it is determined that the first external device is not a priority connection device, add the first external device to a list waiting for connection, and continue performing the connection of the second external device.
应理解,上述装置1000以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件的形式实现,本申请实施例对此不作具体限定。It should be understood that the above device 1000 is embodied in the form of functional units. The term "unit" here may be implemented in the form of software and/or hardware, which is not specifically limited in this embodiment of the present application.
例如,“单元”可以是实现上述功能的软件程序、硬件电路或者二者结合。所述硬件电路可能包括(applicationspecificintegratedcircuit,ASIC)应用特定集成电路、电子电路、执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、集成逻辑电路,和/或其他可以提供上述功能的合适器件。在一个简单的实施例中,本领域的技术人员可以想到装置1000可以采用图4所示的形式。For example, a "unit" may be a software program, a hardware circuit or a combination of both to realize the above functions. The hardware circuit may include (application specific integrated circuit, ASIC) application-specific integrated circuits, electronic circuits, processors (such as shared processors, dedicated processors or group processors, etc.) that execute one or more software or firmware programs, and memory, Integrated logic circuits, and/or other suitable devices that can provide the above functions. In a simple embodiment, those skilled in the art can imagine that the device 1000 can take the form shown in FIG. 4 .
由上可知,本申请实施例提供的蓝牙连接的方法,在第二外接设备正在连接的情况下,通过判断所述第一外接设备是否为优先连接设备;在第一外接设备是优先连接设备的情况下,取消正在连接第二外接设备,并建立与第一外接设备的蓝牙连接,即通过调整连接次序,显著提升第一外接设备的连接速度以及连接成功率。As can be seen from the above, the Bluetooth connection method provided by the embodiment of the present application, when the second external device is being connected, judges whether the first external device is a priority connection device; In this case, cancel the connection to the second external device, and establish a Bluetooth connection with the first external device, that is, by adjusting the connection sequence, the connection speed and connection success rate of the first external device are significantly improved.
本申请还提供了一种计算机程序产品,该计算机程序产品被处理器执行时实现本申请中任一方法实施例所述的方法。The present application also provides a computer program product, which implements the method described in any method embodiment in the present application when the computer program product is executed by a processor.
该计算机程序产品可以存储在存储器中,经过预处理、编译、汇编和链接等处理过程最终被转换为能够被处理器执行的可执行目标文件。The computer program product can be stored in a memory, and finally converted into an executable object file that can be executed by a processor after preprocessing, compiling, assembling, linking and other processing processes.
本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机执行时实现本申请中任一方法实施例所述的方法。该计算机程序可以是高级语言程序,也可以是可执行目标程序。The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment in the present application is implemented. The computer program may be a high-level language program or an executable object program.
该计算机可读存储介质可以是易失性存储器或非易失性存储器,或者,可以同时包括易失性存储器和非易失性存储器。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rateSDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(directrambus RAM,DR RAM)。The computer readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. Among them, the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erases programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rateSDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM) And direct memory bus random access memory (directrambus RAM, DR RAM).
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和设备的具体工作过程以及产生的技术效果,可以参考前述方法实施例中对应的过程和技术效果,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process and technical effects of the devices and equipment described above can refer to the corresponding processes and technical effects in the foregoing method embodiments, here No longer.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the 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 May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory ROM, random access memory RAM, magnetic disk or optical disk, and other media capable of storing program codes.
应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请的实施例的实施过程构成任何限定。It should be understood that in various embodiments of the present application, the sequence numbers of the processes do not mean the order of execution, and the execution order of the processes should be determined by their functions and internal logic, rather than by the embodiments of the present application. The implementation process constitutes any limitation.
本申请实施例中出现的术语(或者说编号)“第一”、“第二”、…等,仅用于描述目的,即只是为了区分不同的对象,比如,不同的“外接设备”等,并不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、…等的特征可以明示或者隐含地包括一个或者更多个特征。在本申请实施例的描述中,“至少一个(项)”是指一个或多个。“多个”的含义是两个或两个以上。“以下至少一个(项)”或其类似表达,是指这些项中的任意组合,包括单个(项)或复数个(项)的任意组合。The terms (or numbers) "first", "second", ..., etc. appearing in the embodiments of this application are only used for description purposes, that is, to distinguish different objects, such as different "external devices", etc. It is not to be understood as indicating or implying relative importance or implying the number of technical features indicated. Thus, features defined as "first", "second", ... etc. may expressly or implicitly include one or more features. In the description of the embodiments of this application, "at least one (item)" means one or more. "Plurality" means two or more. "At least one of the following (items)" or similar expressions refer to any combination of these items, including any combination of a single (item) or a plurality of (items).
另外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中的术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。Additionally, the terms "system" and "network" are often used herein interchangeably. The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B, which can mean: A exists alone, A and B exist simultaneously, and A and B exist alone. There are three cases of B. In addition, the character "/" in this article generally indicates that the contextual objects are an "or" relationship.
例如,本申请实施例中出现的类似于“项目包括如下中至少一种:A,B,以及C”表述的含义,如无特别说明,通常是指该项目可以为如下中任一个:A;B;C;A和B;A和C;B和C;A,B和C;A和A;A,A和A;A,A和B;A,A和C,A,B和B;A,C和C;B和B,B,B和B,B,B和C,C和C;C,C和C,以及其他A,B和C的组合。以上是以A,B和C共3个元素进行举例来说明该项目的可选用条目,当表达为“项目包括如下中至少一种:A,B,……,以及X”时,即表达中具有更多元素时,那么该项目可以适用的条目也可以按照前述规则获得。For example, the meaning similar to "the item includes at least one of the following: A, B, and C" appearing in the embodiment of this application, unless otherwise specified, usually means that the item can be any of the following: A; B;C;A and B;A and C;B and C;A,B and C;A and A;A,A and A;A,A and B;A,A and C,A,B and B; A, C and C; B and B, B, B and B, B, B and C, C and C; C, C and C, and other combinations of A, B and C. The above is an example of the three elements of A, B and C to illustrate the optional items of the project. When the expression is "the project includes at least one of the following: A, B, ..., and X", it is in the expression When there are more elements, then the applicable entries for this item can also be obtained according to the aforementioned rules.
总之,以上所述仅为本申请技术方案的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。In a word, the above descriptions are only preferred embodiments of the technical solutions of the present application, and are not intended to limit the scope of protection of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included within the protection scope of this application.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210855261.6A CN115087134B (en) | 2022-07-20 | 2022-07-20 | Method and electronic device for bluetooth connection |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210855261.6A CN115087134B (en) | 2022-07-20 | 2022-07-20 | Method and electronic device for bluetooth connection |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN115087134A CN115087134A (en) | 2022-09-20 |
| CN115087134B true CN115087134B (en) | 2023-01-13 |
Family
ID=83260480
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210855261.6A Active CN115087134B (en) | 2022-07-20 | 2022-07-20 | Method and electronic device for bluetooth connection |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN115087134B (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2025053649A1 (en) * | 2023-09-08 | 2025-03-13 | 삼성전자 주식회사 | Capability-based connection control method and electronic device therefor |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106162535A (en) * | 2016-08-29 | 2016-11-23 | 中科创达软件股份有限公司 | The method and device that a kind of bluetooth connects |
| CN108307365A (en) * | 2017-09-30 | 2018-07-20 | 宇龙计算机通信科技(深圳)有限公司 | Connection method of Bluetooth device, device and user terminal |
| CN110191442A (en) * | 2019-04-18 | 2019-08-30 | 华为技术有限公司 | Bluetooth connection method, equipment and system |
| CN111436039A (en) * | 2019-10-23 | 2020-07-21 | 珠海市杰理科技股份有限公司 | Bluetooth connection method and system, Bluetooth master and slave device connection method and Bluetooth master and slave device |
| CN112272417A (en) * | 2020-10-23 | 2021-01-26 | 海信视像科技股份有限公司 | double-Bluetooth sound box reconnection method and display device |
| CN112449332A (en) * | 2019-08-30 | 2021-03-05 | 华为技术有限公司 | Bluetooth connection method and electronic equipment |
| CN114500730A (en) * | 2022-02-28 | 2022-05-13 | 歌尔股份有限公司 | Popup window function control method, device and computer readable storage medium |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9356687B2 (en) * | 2012-12-03 | 2016-05-31 | Samsung Electronics Co., Ltd. | Information providing method and mobile terminal therefor |
| EP3474511A1 (en) * | 2017-10-20 | 2019-04-24 | Tap Sound System | A device and method for automatic switching of streaming bluetooth multimedia device |
| CN113691939B (en) * | 2021-08-05 | 2024-05-14 | Oppo广东移动通信有限公司 | Prompt method, electronic device, Bluetooth headset and computer storage medium |
-
2022
- 2022-07-20 CN CN202210855261.6A patent/CN115087134B/en active Active
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106162535A (en) * | 2016-08-29 | 2016-11-23 | 中科创达软件股份有限公司 | The method and device that a kind of bluetooth connects |
| CN108307365A (en) * | 2017-09-30 | 2018-07-20 | 宇龙计算机通信科技(深圳)有限公司 | Connection method of Bluetooth device, device and user terminal |
| CN110191442A (en) * | 2019-04-18 | 2019-08-30 | 华为技术有限公司 | Bluetooth connection method, equipment and system |
| CN112449332A (en) * | 2019-08-30 | 2021-03-05 | 华为技术有限公司 | Bluetooth connection method and electronic equipment |
| CN111436039A (en) * | 2019-10-23 | 2020-07-21 | 珠海市杰理科技股份有限公司 | Bluetooth connection method and system, Bluetooth master and slave device connection method and Bluetooth master and slave device |
| CN112272417A (en) * | 2020-10-23 | 2021-01-26 | 海信视像科技股份有限公司 | double-Bluetooth sound box reconnection method and display device |
| CN114500730A (en) * | 2022-02-28 | 2022-05-13 | 歌尔股份有限公司 | Popup window function control method, device and computer readable storage medium |
Non-Patent Citations (1)
| Title |
|---|
| 张凡凡.蓝牙技术在智能家居中的应用研究.《电子制作》.2015,(第10期), * |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2025053649A1 (en) * | 2023-09-08 | 2025-03-13 | 삼성전자 주식회사 | Capability-based connection control method and electronic device therefor |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115087134A (en) | 2022-09-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11683850B2 (en) | Bluetooth reconnection method and related apparatus | |
| CN112822663B (en) | Bluetooth connection method and related device | |
| CN112469013B (en) | Bluetooth connection method and related device | |
| CN110602686B (en) | A method and electronic device for using a remote SIM module | |
| WO2021043198A1 (en) | Bluetooth pairing method, and related device | |
| CN112789934B (en) | Bluetooth service query method and electronic equipment | |
| WO2020224447A1 (en) | Method and system for adding smart home device to contacts | |
| CN120499627A (en) | Bluetooth communication method, wearable device and system | |
| CN112543447A (en) | Device discovery method based on address list, audio and video communication method and electronic device | |
| CN115297405A (en) | A kind of audio output method and terminal device | |
| WO2021218544A1 (en) | Wireless connection providing system, method, and electronic apparatus | |
| CN114567871B (en) | File sharing method, device, electronic device and readable storage medium | |
| CN115460445A (en) | Screen projection method of electronic equipment and electronic equipment | |
| CN114928898B (en) | Method and device for establishing session based on WiFi direct connection | |
| CN116077943B (en) | Method for scheduling system resources and related device | |
| CN115087134B (en) | Method and electronic device for bluetooth connection | |
| CN115174727B (en) | Method for transmitting information and electronic device | |
| CN116680020B (en) | Multi-device collaborative management method, electronic device and storage medium | |
| WO2024260185A1 (en) | Data transmission method, terminal, and system | |
| CN114697438B (en) | Method, device, equipment and storage medium for carrying out call by utilizing intelligent equipment | |
| CN115248885A (en) | Device discovery method and system and electronic device thereof | |
| CN113950045A (en) | Subscription data downloading method and electronic equipment | |
| CN117354884B (en) | APN switching method and related equipment | |
| WO2025195182A1 (en) | Data transmission method, electronic device, and system | |
| WO2024159925A1 (en) | Screen mirroring method, screen mirroring system, and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
| CP03 | Change of name, title or address |