










技术领域technical field
本申请涉及通信技术领域,具体涉及一种蓝牙连接方法、装置、电子设备及计算机可读存储介质。The present application relates to the technical field of communication, and in particular to a Bluetooth connection method, device, electronic equipment, and computer-readable storage medium.
背景技术Background technique
随着人们生活内容的丰富,用户使用耳机设备的需求越来越多。在某些场景下,用户有需要将耳机设备的两只耳机分别单独进行使用,而在另一些场景下用户又需要两只耳机共同使用。目前,市面上为了贴合用户对于耳机设备在不同场景下的使用需求,出现了许多既能够支持两只耳机分别单独使用,也能够支持两只耳机共同使用的耳机设备。但是,这些耳机设备通常需要较为繁琐的操作方式,才能将耳机设备从两只耳机分别单独使用的状态变为两只耳机共同使用的状态。With the enrichment of people's life content, users have more and more demands for earphone devices. In some scenarios, the user needs to use the two earphones of the earphone device separately, and in other scenarios, the user needs to use the two earphones together. At present, in order to meet the needs of users for the use of earphones in different scenarios, there are many earphones on the market that can support the use of two earphones separately, and can also support the use of two earphones together. However, these earphone devices generally require relatively cumbersome operations to change the earphone device from a state where two earphones are used separately to a state where two earphones are used together.
发明内容Contents of the invention
本申请实施例公开了一种蓝牙连接方法、装置、电子设备及计算机可读存储介质,能够简化将耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态的操作方式,提高切换效率,且不会影响用户对第一耳机的使用。The embodiment of the present application discloses a Bluetooth connection method, device, electronic equipment, and computer-readable storage medium, which can simplify the operation mode of switching the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together. The switching efficiency is improved without affecting the user's use of the first earphone.
本申请实施例公开了一种蓝牙连接方法,应用于耳机设备,所述耳机设备包括第一耳机及第二耳机,所述方法包括:The embodiment of the present application discloses a Bluetooth connection method, which is applied to a headset device. The headset device includes a first headset and a second headset. The method includes:
在所述第一耳机与第一终端设备建立蓝牙连接,且所述第一耳机未与所述第二耳机建立蓝牙连接的情况下,所述第二耳机响应于连接操作,发送广播信号;When the first earphone establishes a Bluetooth connection with the first terminal device, and the first earphone does not establish a Bluetooth connection with the second earphone, the second earphone sends a broadcast signal in response to a connection operation;
所述广播信号用于触发接收到所述广播信号的所述第一终端设备向所述第一耳机发送连接指令,以使所述第一耳机根据所述连接指令与所述第二耳机建立蓝牙连接;或,所述广播信号用于触发接收到所述广播信号的所述第一耳机与所述第二耳机建立蓝牙连接。The broadcast signal is used to trigger the first terminal device receiving the broadcast signal to send a connection instruction to the first earphone, so that the first earphone can establish Bluetooth with the second earphone according to the connection instruction. connection; or, the broadcast signal is used to trigger the first earphone receiving the broadcast signal to establish a Bluetooth connection with the second earphone.
本申请实施例公开了一种蓝牙连接方法,应用于终端设备,所述终端设备与耳机设备中的第一耳机建立蓝牙连接,所述耳机设备还包括第二耳机,所述方法包括:The embodiment of the present application discloses a Bluetooth connection method, which is applied to a terminal device. The terminal device establishes a Bluetooth connection with the first earphone in the earphone device, and the earphone device also includes a second earphone. The method includes:
接收所述第二耳机发送的广播信号,所述广播信号为所述第二耳机响应于连接操作发送的;receiving a broadcast signal sent by the second earphone, where the broadcast signal is sent by the second earphone in response to a connection operation;
根据所述广播信号向所述第一耳机发送连接指令,所述连接指令用于指示所述第一耳机根据所述连接指令与所述第二耳机建立蓝牙连接。Sending a connection instruction to the first earphone according to the broadcast signal, where the connection instruction is used to instruct the first earphone to establish a Bluetooth connection with the second earphone according to the connection instruction.
本申请实施例公开了一种蓝牙连接装置,应用于耳机设备,所述耳机设备包括第一耳机及第二耳机,所述装置包括:The embodiment of the present application discloses a Bluetooth connection device, which is applied to earphone equipment, the earphone equipment includes a first earphone and a second earphone, and the device includes:
广播模块,用于在所述第一耳机与第一终端设备建立蓝牙连接,且所述第一耳机未与所述第二耳机建立蓝牙连接的情况下,由所述第二耳机响应于连接操作,发送广播信号;A broadcast module, configured to respond to the connection operation by the second earphone when the first earphone establishes a Bluetooth connection with the first terminal device, and the first earphone does not establish a Bluetooth connection with the second earphone , to send a broadcast signal;
所述广播信号用于触发所述第一终端设备向所述第一耳机发送连接指令,以使所述第一耳机根据所述连接指令与所述第二耳机建立蓝牙连接;或,所述广播信号用于触发接收到所述广播信号的所述第一耳机与所述第二耳机建立蓝牙连接。The broadcast signal is used to trigger the first terminal device to send a connection instruction to the first earphone, so that the first earphone establishes a Bluetooth connection with the second earphone according to the connection instruction; or, the broadcast The signal is used to trigger the first earphone receiving the broadcast signal to establish a Bluetooth connection with the second earphone.
本申请实施例公开了一种蓝牙连接装置,应用于终端设备,所述终端设备与耳机设备中的第一耳机建立蓝牙连接,所述耳机设备还包括第二耳机,所述装置包括:The embodiment of the present application discloses a Bluetooth connection device, which is applied to a terminal device. The terminal device establishes a Bluetooth connection with the first earphone in the earphone device. The earphone device also includes a second earphone. The device includes:
广播接收模块,用于接收所述第二耳机发送的广播信号,所述广播信号为所述第二耳机响应于连接操作发送的;A broadcast receiving module, configured to receive a broadcast signal sent by the second earphone, where the broadcast signal is sent by the second earphone in response to a connection operation;
指令发送模块,用于根据所述广播信号向所述第一耳机发送连接指令,所述连接指令用于指示所述第一耳机根据所述连接指令与所述第二耳机建立蓝牙连接。An instruction sending module, configured to send a connection instruction to the first earphone according to the broadcast signal, and the connection instruction is used to instruct the first earphone to establish a Bluetooth connection with the second earphone according to the connection instruction.
本申请实施例公开了一种电子设备,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器实现如上所述的方法。The embodiment of the present application discloses an electronic device, including a memory and a processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method as described above.
本申请实施例公开了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的方法。The embodiment of the present application discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above method is realized.
本申请实施例公开的蓝牙连接方法、装置、电子设备及计算机可读存储介质,在耳机设备的第一耳机与第一终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,也即第一耳机也第二耳机分别单独使用,第二耳机可响应于连接操作,发送广播信号,接收到该广播信号的第一终端设备向第一耳机发送连接指令,以使第一耳机根据该连接指令与第二耳机建立蓝牙连接,或接收到该广播信号的第一耳机直接与第二耳机建立蓝牙连接,成功切换为两只耳机共同使用的状态。在本申请实施例中,用户只需要进行针对第二耳机的连接操作即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,相较于相关技术中需要将两只耳机都放置到耳机充电盒,并对耳机充电盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第一耳机的正常使用。The Bluetooth connection method, device, electronic device, and computer-readable storage medium disclosed in the embodiments of the present application establish a Bluetooth connection between the first earphone of the earphone device and the first terminal device, and the first earphone does not establish a Bluetooth connection with the second earphone. In the case where the first earphone and the second earphone are used separately, the second earphone may send a broadcast signal in response to the connection operation, and the first terminal device that receives the broadcast signal sends a connection instruction to the first earphone, so that the second earphone An earphone establishes a bluetooth connection with the second earphone according to the connection command, or the first earphone that receives the broadcast signal directly establishes a bluetooth connection with the second earphone, and successfully switches to a state where the two earphones are used together. In the embodiment of the present application, the user only needs to perform the connection operation on the second earphone to switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together. Both earphones are placed in the earphone charging box, and the state switching can be realized by performing corresponding operations on the earphone charging box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the first earphone by the user.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.
图1为一个实施例中蓝牙连接方法的应用场景图;Fig. 1 is an application scenario diagram of a bluetooth connection method in an embodiment;
图2A为一个实施例中蓝牙连接方法的时序图;FIG. 2A is a sequence diagram of a Bluetooth connection method in an embodiment;
图2B为另一个实施例中蓝牙连接方法的时序图;FIG. 2B is a sequence diagram of a Bluetooth connection method in another embodiment;
图3为一个实施例中蓝牙连接方法的流程图;Fig. 3 is a flowchart of the bluetooth connection method in an embodiment;
图4为一个实施例中蓝牙连接方法的时序交互示意图;FIG. 4 is a schematic diagram of sequence interaction of a Bluetooth connection method in an embodiment;
图5为另一个实施例中蓝牙连接方法的流程图;Fig. 5 is the flowchart of bluetooth connection method in another embodiment;
图6为另一个实施例中蓝牙连接方法的时序交互示意图;FIG. 6 is a schematic diagram of sequence interaction of a Bluetooth connection method in another embodiment;
图7为又一个实施例中蓝牙连接方法的流程图;Fig. 7 is the flowchart of bluetooth connection method in another embodiment;
图8为一个实施例中蓝牙连接装置的框图;Figure 8 is a block diagram of a bluetooth connection device in one embodiment;
图9为另一个实施例中蓝牙连接装置的框图;Fig. 9 is a block diagram of a bluetooth connection device in another embodiment;
图10为一个实施例中耳机设备的结构框图。Fig. 10 is a structural block diagram of an earphone device in one embodiment.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the application with reference to the drawings in the embodiments of the application. Apparently, the described embodiments are only some, not all, embodiments of the application. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the drawings are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally further includes For other steps or units inherent in these processes, methods, products or apparatuses.
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一耳机称为第二耳机,且类似地,可将第二耳机称为第一耳机。第一耳机和第二耳机两者属于耳机,但其不是同一只耳机。另外,需要说明的是,本申请实施例中所使用的术语“多个”等指的是两个或两个以上。It can be understood that the terms "first", "second" and the like used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first headset could be termed a second headset, and, similarly, a second headset could be termed a first headset, without departing from the scope of the present application. Both the first earphone and the second earphone belong to earphones, but they are not the same earphone. In addition, it should be noted that the term "plurality" and the like used in the embodiments of the present application refer to two or more.
图1为一个实施例中蓝牙连接方法的应用场景图。如图1所示,耳机设备10可包括第一耳机110及第二耳机120。耳机设备10可包括但不限于头戴式耳机、入耳式耳机、耳塞式耳机及挂耳式耳机等,进一步地,该耳机设备10可为无线蓝牙耳机,例如真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等。Fig. 1 is an application scene diagram of a Bluetooth connection method in an embodiment. As shown in FIG. 1 , the
在本申请实施例中,耳机设备10既能够支持第一耳机110与第二耳机120分别单独使用(即第一耳机110及第二耳机120能够分别播放不同终端设备的音频数据),也能够支持第一耳机110与第二耳机120共同使用(即第一耳机110及第二耳机120播放同一终端设备的音频数据)。In the embodiment of the present application, the
可选地,耳机设备10中的第一耳机110及第二耳机120分别单独使用,可包括但不限于以下几种场景:1、第一耳机110与第一终端设备20建立蓝牙连接,第二耳机120不与第一耳机110建立蓝牙连接,且第二耳机120不与任一终端设备建立蓝牙连接;2、第一耳机110与第一终端设备20建立蓝牙连接,第二耳机120与第二终端设备建立蓝牙连接,但第二耳机120与第一耳机110之间未建立蓝牙连接;3、第二耳机120与第二终端设备建立蓝牙连接,第一耳机110不与第二耳机120建立蓝牙连接,且第一耳机110不与任一终端设备建立蓝牙连接等。Optionally, the
其中,第一终端设备20、第二终端设备可包括但不限于可穿戴设备(如手环、智能手表、智能眼镜等)、车载终端、手机、平板电脑、笔记本电脑等。Among them, the first
在相关的技术中,当用户想要将分别单独使用的第一耳机110及第二耳机120,切换为第一耳机110与第二耳机120共同使用时,通过需要较为繁琐的操作才能实现,以耳机设备10为TWS耳机为例,需要用户将第一耳机110及第二耳机120均放入到耳机充电盒中,并按压耳机充电盒上的按键或是关闭耳机充电盒一段时间,才能将单独使用的第一耳机110及第二耳机120,切换为共同使用的模式。操作方式繁琐,且如果用户此时正在使用第一耳机110或第二耳机120,就会对用户的正常使用造成影响。In the related technology, when the user wants to switch the
在本申请实施例中,在第一耳机110与第一终端设备20建立蓝牙连接,且第一耳机110未与第二耳机120建立蓝牙连接的情况下,也即第一耳机110与第二耳机120分别单独使用,在用户想要将单独使用的第一耳机110及第二耳机120切换为共同使用的模式时,可进行针对第二耳机120的连接操作。第二耳机120可响应于该连接操作,发送广播信号。In this embodiment of the application, when the
在一些实施例中,在第一终端设备20扫描并接收到该广播信号时,可根据该广播信号向第一耳机110发送连接指令。第一耳机110可根据第一终端设备20发送的连接指令与第二耳机120建立蓝牙连接。在一些实施例中,若第二耳机120扫描并接收到该广播信号,也可直接根据该广播信号与第一耳机110建立蓝牙连接。在第一耳机110与第二耳机120建立蓝牙连接后,第二耳机120即可获取到第一终端设备20发送的音频数据,并播放该音频数据,第一耳机110及第二耳机120能够共同播放第一终端设备20的音频数据,成功切换至共同使用的模式。In some embodiments, when the first
图2A为一个实施例中蓝牙连接方法的时序图。如图2所示,该蓝牙连接方法可主要包括以下步骤:FIG. 2A is a sequence diagram of a Bluetooth connection method in an embodiment. As shown in Figure 2, the Bluetooth connection method may mainly include the following steps:
步骤1、在第一耳机110与第一终端设备20建立蓝牙连接,且第二耳机120与第一耳机110未建立蓝牙连接的情况下,第二耳机120响应于用户进行的连接操作,发送广播信号。Step 1. When the
步骤2、第一终端设备20接收到第二耳机120发送的广播信号,并根据该广播信号向第一耳机110发送连接指令。Step 2, the first
步骤3、第一耳机110接收第一终端设备20发送的连接指令,并根据该连接指令向第二耳机120发送蓝牙连接请求,第二耳机120可响应该蓝牙连接请求,与第一耳机110建立蓝牙连接。Step 3. The
图2B为另一个实施例中蓝牙连接方法的时序图。如图2所示,该蓝牙连接方法可主要包括以下步骤:FIG. 2B is a sequence diagram of a Bluetooth connection method in another embodiment. As shown in Figure 2, the Bluetooth connection method may mainly include the following steps:
步骤1、在第一耳机110与第一终端设备20建立蓝牙连接,且第二耳机120与第一耳机110未建立蓝牙连接的情况下,第二耳机120响应于用户进行的连接操作,发送广播信号。Step 1. When the
步骤2、第一耳机110接收到第二耳机120发送的广播信号,并根据该广播信号向第二耳机120发送蓝牙连接请求,第二耳机120可响应该蓝牙连接请求,与第一耳机110建立蓝牙连接。Step 2. The
相较于相关技术中需要将两只耳机都放置到耳机充电盒,并对耳机充电盒进行相应操作才能实现状态切换的方式,在本申请实施例中,用户只需要进行针对第二耳机120的连接操作即可实现耳机设备10从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,更为简便快捷,提高了切换效率,且不会影响用户对第一耳机110的正常使用。Compared with the way in the related art that both earphones need to be placed in the earphone charging box, and corresponding operations are performed on the earphone charging box to realize the state switching, in the embodiment of the present application, the user only needs to perform the
上述的蓝牙连接可以是基于经典蓝牙协议(例如,由蓝牙技术联盟Bluetooth SIG制定的蓝牙4.0等版本的协议)实现的,也可以基于蓝牙低功耗(Bluetooth Low Energy,BLE)协议(例如蓝牙5.0等版本的协议)实现的,在此不作限定,可随着蓝牙协议的发展而变化。The above-mentioned bluetooth connection can be realized based on the classic bluetooth protocol (for example, bluetooth 4.0 and other versions established by the bluetooth technology alliance bluetooth and other versions of the protocol) are implemented, and are not limited here, and may change with the development of the Bluetooth protocol.
如图3所示,在一个实施例中,提供一种蓝牙连接方法,可应用于上述的耳机设备,该方法可包括以下步骤:As shown in FIG. 3, in one embodiment, a Bluetooth connection method is provided, which can be applied to the above-mentioned earphone device, and the method may include the following steps:
步骤310,在第一耳机与第一终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,第二耳机响应于连接操作,发送广播信号;该广播信号用于触发接收到广播信号的第一终端设备向第一耳机发送连接指令,以使第一耳机根据连接指令与第二耳机建立蓝牙连接;或,广播信号用于触发接收到广播信号的第一耳机与第二耳机建立蓝牙连接。
在本申请实施例中,耳机设备可同时支持第一耳机与第二耳机分别单独使用,以及第一耳机与第二耳机共同使用两种使用模式,并且耳机设备可根据用户的实际需求在该两种使用模式之间切换。In this embodiment of the application, the earphone device can simultaneously support two usage modes: the first earphone and the second earphone are used separately, and the first earphone and the second earphone are used together, and the earphone device can be used according to the actual needs of the user. switch between usage modes.
在第一耳机与第一终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,第二耳机与第一终端设备未建立蓝牙连接,耳机设备中的第一耳机与第二耳机处于分别单独使用的状态。其中,第一耳机与第二耳机处于分别单独使用的状态可指的是第一耳机与第二耳机可分别与不同的终端设备建立蓝牙连接,并播放不同终端设备的音频数据的状态,第一耳机与第二耳机播放的音频数据不同步。在第一耳机与第二耳机处于分别单独使用时,第一耳机与第二耳机之间不建立蓝牙连接。When the first earphone establishes a bluetooth connection with the first terminal device, and the first earphone does not establish a bluetooth connection with the second earphone, the second earphone does not establish a bluetooth connection with the first terminal device, and the first earphone in the earphone device and The second earphones are in the state of being used separately. Wherein, the state that the first earphone and the second earphone are in separate use may refer to the state that the first earphone and the second earphone can respectively establish Bluetooth connections with different terminal devices and play audio data of different terminal devices. The audio data played by the earphone and the second earphone are out of sync. When the first earphone and the second earphone are used separately, no Bluetooth connection is established between the first earphone and the second earphone.
当用户需要将第一耳机与第二耳机处于分别单独使用的状态,切换为第一耳机与第二耳机共同使用的状态时,可进行针对第二耳机的连接操作。可选地,该第二耳机可以是耳机设备中当前没有正在处理业务的耳机,比如,该第二耳机可以是当前未与任一终端设备连接的耳机,也可以是当前与第二终端设备连接,但是未与第二终端设备进行数据传输的耳机等。通过对当前没有正在处理业务的耳机进行连接操作,可以避免出现影响耳机正常使用的情况,且用户不需要特意记住是对左耳机还是右耳机进行连接操作,更符合用户的操作习惯。When the user needs to switch the first earphone and the second earphone from the state of using the first earphone and the second earphone separately to the state of using the first earphone and the second earphone together, the connection operation for the second earphone can be performed. Optionally, the second earphone may be an earphone that is not currently processing business in the earphone device, for example, the second earphone may be an earphone that is not currently connected to any terminal device, or may be currently connected to the second terminal device , but no data transmission with the second terminal device, such as earphones. By connecting the earphones that are not currently processing services, the situation that affects the normal use of the earphones can be avoided, and the user does not need to remember whether to connect the left earphone or the right earphone, which is more in line with the user's operating habits.
上述的连接操作的操作方式可根据实际应用及需求进行设置。在一些实施例中,用户可在第二耳机上进行连接操作,第二耳机可设置有一种或多种传感器,如触控传感器、压力传感器、距离传感器、温度传感器等中的一种或多种,并通过一种或多种传感器检测用户进行的连接操作。例如,该连接操作可以是单击操作,则第二耳机可通过触控传感器检测到单击操作,即确定检测到连接操作;该连接操作也可以是按压操作,则第二耳机可通过压力传感器检测到按压操作,即确定检测到连接操作等,但不限于此。The operation mode of the above connection operation may be set according to actual applications and requirements. In some embodiments, the user can perform a connection operation on the second earphone, and the second earphone can be provided with one or more sensors, such as one or more of a touch sensor, a pressure sensor, a distance sensor, a temperature sensor, etc. , and detect the connection operation performed by the user through one or more sensors. For example, the connection operation can be a click operation, then the second earphone can detect the click operation through the touch sensor, that is, it is determined to detect the connection operation; The pressing operation is detected, that is, it is determined that the connection operation and the like are detected, but not limited thereto.
在一些实施例中,第二耳机可响应于检测到的连接操作,发送广播信号,以使接收到该广播信号的第一终端设备根据该广播信号向第一耳机发送连接指令,该连接指令可用于指示第一耳机与第二耳机建立蓝牙连接。In some embodiments, the second earphone can send a broadcast signal in response to the detected connection operation, so that the first terminal device that receives the broadcast signal sends a connection instruction to the first earphone according to the broadcast signal, and the connection instruction can be used Instructing the first earphone to establish a Bluetooth connection with the second earphone.
可选地,该广播信号可包括BLE广播信号,第二耳机在检测到连接操作时,可基于BLE蓝牙协议在广播信道上发送BLE广播信号。在一些实施例中,第一终端设备的蓝牙模块可处于扫描状态,对各个广播信道进行监听,并在扫描到第二耳机发送的BLE广播信号时,通过与第一耳机之间的蓝牙连接,向第一耳机发送连接指令。在一些实施例中,第二耳机的蓝牙模块可处于扫描状态,对各个广播信道进行监听,并在扫描到第二耳机发送的BLE广播信号时,基于该BLE广播信号与第二耳机建立蓝牙连接。Optionally, the broadcast signal may include a BLE broadcast signal, and when the second earphone detects the connection operation, it may send the BLE broadcast signal on the broadcast channel based on the BLE Bluetooth protocol. In some embodiments, the Bluetooth module of the first terminal device can be in the scanning state, monitor each broadcast channel, and when scanning the BLE broadcast signal sent by the second earphone, through the Bluetooth connection with the first earphone, A connection instruction is sent to the first earphone. In some embodiments, the Bluetooth module of the second earphone can be in a scanning state, monitor each broadcast channel, and when scanning the BLE broadcast signal sent by the second earphone, establish a Bluetooth connection with the second earphone based on the BLE broadcast signal .
在一些实施例中,上述的广播信号包括第一特定信息。可选地,该广播信号用于触发接收到广播信号的第一终端设备在确定第一特定信息与第二特定信息相同时,向第一耳机发送连接指令,其中,第二特定信息是第一耳机发送给第一终端设备的;或,广播信号用于触发接收到广播信号的第一终端设备将第一特定信息及连接指令发送给第一耳机,以使第一耳机在确定第一特定信息与第一耳机中存储的第二特定信息相同时,根据连接指令与第二耳机建立蓝牙连接。In some embodiments, the above-mentioned broadcast signal includes first specific information. Optionally, the broadcast signal is used to trigger the first terminal device receiving the broadcast signal to send a connection instruction to the first earphone when it determines that the first specific information is the same as the second specific information, where the second specific information is the first The earphone sends to the first terminal device; or, the broadcast signal is used to trigger the first terminal device receiving the broadcast signal to send the first specific information and the connection instruction to the first earphone, so that the first earphone determines the first specific information When it is the same as the second specific information stored in the first earphone, a Bluetooth connection is established with the second earphone according to the connection instruction.
属于同一耳机设备的第一耳机及第二耳机可预先约定有特定信息,并分别存储该约定的特定信息,第一耳机与第二耳机存储的特定信息相同。进一步地,该特定信息可以是数字、字母、符号等中的一种或多种组成的字符串,通过该特定信息可识别第一耳机与第二耳机为匹配的耳机,属于同一耳机设备。可选地,该特定信息可以是耳机设备在出厂前设置的固定特定信息,每个耳机设备的特定信息不同。该特定信息也可以是耳机设备每次在切换到两只耳机分别单独使用的状态时,生成并存储到第一耳机及第二耳机中,耳机设备每次生成的特定信息可能不同。The first earphone and the second earphone belonging to the same earphone device may pre-agreed with specific information, and respectively store the agreed specific information, and the specific information stored in the first earphone and the second earphone is the same. Further, the specific information may be a character string composed of one or more of numbers, letters, symbols, etc., through which it can be identified that the first earphone and the second earphone are matching earphones and belong to the same earphone device. Optionally, the specific information may be fixed specific information set by the earphone device before leaving the factory, and the specific information of each earphone device is different. The specific information may also be generated and stored in the first earphone and the second earphone each time the earphone device is switched to a state where the two earphones are used independently, and the specific information generated by the earphone device may be different each time.
在一些实施例中,在第一耳机与第一终端设备建立蓝牙连接后,第一耳机可将存储的第二特定信息发送给第一终端设备。在第二耳机检测到连接操作后,可获取存储的第一特定信息,并生成携带有该第一特定信息的广播信号进行广播。第一终端设备在接收到该广播信号后,可对广播信号进行解析,得到第一特定信息,并将解析得到的第一特定信息与第一耳机发送的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,说明该广播信号是与第一耳机属于同一耳机设备的第二耳机发送的,则可向第一耳机发送连接指令。In some embodiments, after the first earphone establishes a Bluetooth connection with the first terminal device, the first earphone may send the stored second specific information to the first terminal device. After the second earphone detects the connection operation, it can acquire the stored first specific information, and generate and broadcast a broadcast signal carrying the first specific information. After receiving the broadcast signal, the first terminal device can analyze the broadcast signal to obtain the first specific information, compare the analyzed first specific information with the second specific information sent by the first earphone, and determine are the same. If the first specific information is the same as the second characteristic information, it means that the broadcast signal is sent by a second earphone belonging to the same earphone device as the first earphone, and a connection instruction may be sent to the first earphone.
在另一些实施例中,在第一终端设备解析得到的第一特定信息后,也可将第一特定信息及连接指令发送给第一耳机,第一耳机可将该第一特定信息与存储的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,则可响应该连接指令,根据该连接指令与第二耳机建立蓝牙连接。In other embodiments, after the first terminal device parses the first specific information, it can also send the first specific information and the connection instruction to the first earphone, and the first earphone can combine the first specific information with the stored The second specific information is compared to determine whether the two are the same. If the first specific information is the same as the second feature information, a Bluetooth connection can be established with the second earphone according to the connection instruction in response to the connection instruction.
在本申请实施例中,第一终端设备或第一耳机通过广播信号中携带的第二特定信息可准确识别发送广播信号的第二耳机的身份,提高了第一耳机与第二耳机进行蓝牙连接的准确性。In the embodiment of the present application, the first terminal device or the first earphone can accurately identify the identity of the second earphone sending the broadcast signal through the second specific information carried in the broadcast signal, which improves the Bluetooth connection between the first earphone and the second earphone. accuracy.
第一耳机可通过与第一终端设备之间的蓝牙连接,接收第一终端设备发送的连接指令。在第一耳机接收到该连接指令时,可向第二耳机发送蓝牙连接请求,第二耳机接收到该蓝牙连接请求后,可响应该蓝牙连接请求,以与第一耳机建立蓝牙连接。The first earphone can receive the connection instruction sent by the first terminal device through the Bluetooth connection with the first terminal device. When the first earphone receives the connection instruction, it can send a Bluetooth connection request to the second earphone, and after receiving the Bluetooth connection request, the second earphone can respond to the Bluetooth connection request to establish a Bluetooth connection with the first earphone.
在一些实施例中,上述的广播信号还可包括第二耳机对应的蓝牙地址。在第一耳机与第二耳机分别单独使用的情况下,第一耳机及第二耳机可分别对应不同的蓝牙地址,从而可单独与不同的终端设备建立蓝牙连接。在第二耳机检测到连接操作后,可发送携带第一特定信息及自身蓝牙地址的广播信号。第一终端设备在接收到该广播信号后,可解析得到该第一特定信息及第二耳机对应的蓝牙地址。若确定该第一特定信息与第二特征信息相同,则可向第一耳机发送包括该蓝牙地址的连接指令。In some embodiments, the above-mentioned broadcast signal may further include a Bluetooth address corresponding to the second earphone. In the case that the first earphone and the second earphone are used separately, the first earphone and the second earphone can correspond to different bluetooth addresses respectively, so that bluetooth connections can be independently established with different terminal devices. After the second earphone detects the connection operation, it can send a broadcast signal carrying the first specific information and its own Bluetooth address. After receiving the broadcast signal, the first terminal device can analyze and obtain the first specific information and the Bluetooth address corresponding to the second earphone. If it is determined that the first specific information is the same as the second feature information, a connection instruction including the Bluetooth address may be sent to the first earphone.
第一耳机在接收到该连接指令后,可对该连接指令进行解析,得到第二耳机的蓝牙地址,并基于该第二耳机的蓝牙地址向第二耳机发送蓝牙连接请求。在本申请实施例,采用由与第一耳机连接的第一终端设备进行信息中转的方式,使得第一耳机能够获取到第二耳机的蓝牙地址,并准确向第二耳机发起蓝牙连接请求,保证了第一耳机与第二耳机进行蓝牙连接的可靠性。After receiving the connection instruction, the first earphone can analyze the connection instruction to obtain the Bluetooth address of the second earphone, and send a Bluetooth connection request to the second earphone based on the Bluetooth address of the second earphone. In the embodiment of this application, the first terminal device connected to the first earphone is used to transfer information, so that the first earphone can obtain the Bluetooth address of the second earphone, and accurately initiate a Bluetooth connection request to the second earphone, ensuring This improves the reliability of the Bluetooth connection between the first earphone and the second earphone.
在第一耳机与第二耳机建立蓝牙连接后,第一耳机与第二耳机可共享同一蓝牙地址,该同一蓝牙地址可以是第一耳机的蓝牙地址,也可以是第二耳机的蓝牙地址,则第一耳机与第二耳机处于共同使用的状态。其中,共同使用的状态可指的是第一耳机与第二耳机之间数据同步,第一耳机及第二耳机可共同播放同一终端设备传输的音频数据,比如,第一耳机及第二耳机可共同播放第一终端设备传输的音频数据。After the first earphone and the second earphone establish the bluetooth connection, the first earphone and the second earphone can share the same bluetooth address, and this same bluetooth address can be the bluetooth address of the first earphone, also can be the bluetooth address of the second earphone, then The first earphone and the second earphone are in the state of being used together. Wherein, the state of common use may refer to the data synchronization between the first earphone and the second earphone, and the first earphone and the second earphone can jointly play the audio data transmitted by the same terminal device, for example, the first earphone and the second earphone can The audio data transmitted by the first terminal device is jointly played.
示例性地,图4为一个实施例中蓝牙连接方法的时序交互示意图。如图4所示,耳机设备可包括耳机A及耳机B,耳机A与耳机B之间未建立蓝牙连接,分别单独使用。耳机B与终端设备C建立蓝牙连接,并向终端设备C发送第二特定信息。在用户需要将耳机A与耳机B从单独使用的状态切换为共同使用的状态时,可进行针对耳机A的连接操作。耳机A响应该连接操作,并发送广播信号,该广播信号可携带有第一特定信息及耳机A的蓝牙地址。终端设备C在接收到该广播信号,可对该广播信号进行解析,得到第一特定信息及耳机A的蓝牙地址。终端设备C可将该第一特定信息与耳机B发送的第二特定信息进行比对,并在确定该第一特定信息与该第二特定信息相同时,向耳机B发送连接指令,该连接指令包含耳机A的蓝牙地址。耳机B在接收到该连接指令后,可基于连接指令包含的耳机A的蓝牙地址,向耳机A发送蓝牙连接请求,并与耳机A建立蓝牙连接。在耳机A与耳机B建立蓝牙连接后,耳机A与耳机B之间数据同步,共同播放同一终端设备传输的音频数据。Exemplarily, FIG. 4 is a schematic diagram of sequence interaction of a Bluetooth connection method in an embodiment. As shown in FIG. 4 , the earphone device may include an earphone A and an earphone B, and no Bluetooth connection is established between the earphone A and the earphone B, and they are used separately. The headset B establishes a Bluetooth connection with the terminal device C, and sends the second specific information to the terminal device C. When the user needs to switch the earphone A and earphone B from the state of independent use to the state of joint use, the connection operation for earphone A can be performed. The earphone A responds to the connection operation and sends a broadcast signal, where the broadcast signal may carry the first specific information and the Bluetooth address of the earphone A. After receiving the broadcast signal, the terminal device C can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the earphone A. The terminal device C can compare the first specific information with the second specific information sent by the earphone B, and when it is determined that the first specific information is the same as the second specific information, send a connection instruction to the earphone B, and the connection instruction Contains the Bluetooth address of headset A. After receiving the connection instruction, the headset B can send a Bluetooth connection request to the headset A based on the Bluetooth address of the headset A included in the connection command, and establish a Bluetooth connection with the headset A. After the Bluetooth connection between earphone A and earphone B is established, the data between earphone A and earphone B is synchronized, and the audio data transmitted by the same terminal device is jointly played.
在另一些实施例中,第二耳机可响应于检测到的连接操作,发送广播信号,以使接收到该广播信号的第一耳机直接与第二耳机建立蓝牙连接。In some other embodiments, the second earphone may send a broadcast signal in response to the detected connection operation, so that the first earphone that receives the broadcast signal directly establishes a Bluetooth connection with the second earphone.
可选地,广播信号可包括第一特定信息及第二耳机对应的蓝牙地址,该广播信号可用于触发接收到广播信号的第一耳机在确定第一特定信息与第一耳机中存储的第二特定信息相同时,根据蓝牙地址向第二耳机发送蓝牙连接请求,以使第二耳机响应蓝牙连接请求,与第一耳机建立蓝牙连接。Optionally, the broadcast signal may include the first specific information and the Bluetooth address corresponding to the second earphone, and the broadcast signal may be used to trigger the first earphone receiving the broadcast signal to determine the first specific information and the second earphone stored in the first earphone. When the specific information is the same, a Bluetooth connection request is sent to the second earphone according to the Bluetooth address, so that the second earphone responds to the Bluetooth connection request and establishes a Bluetooth connection with the first earphone.
若第一耳机接收到第二耳机发送的广播信号,可对该广播信号进行解析,得到第一特定信息及第二耳机的蓝牙地址。第一耳机可将解析得到的第一特定信息与存储的第二特定信息进行比对,判断二者是否相同。若该第一特定信息与该第二特征信息相同,则可根据第二耳机的蓝牙地址向第二耳机发送蓝牙连接请求,从而与第二耳机建立蓝牙连接。If the first earphone receives the broadcast signal sent by the second earphone, it can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the second earphone. The first earphone can compare the analyzed first specific information with the stored second specific information to determine whether the two are the same. If the first specific information is the same as the second feature information, a Bluetooth connection request may be sent to the second earphone according to the Bluetooth address of the second earphone, thereby establishing a Bluetooth connection with the second earphone.
在本申请实施例中,用户只需要进行针对第二耳机的连接操作即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,相较于相关技术中需要将两只耳机都放置到耳机充电盒,并对耳机充电盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第一耳机的正常使用。In the embodiment of the present application, the user only needs to perform the connection operation on the second earphone to switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together. Both earphones are placed in the earphone charging box, and the state switching can be realized by performing corresponding operations on the earphone charging box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the first earphone by the user.
如图5所示,在另一个实施例中,提供一种蓝牙连接方法,可应用于上述的耳机设备,该方法可包括以下步骤:As shown in FIG. 5, in another embodiment, a Bluetooth connection method is provided, which can be applied to the above-mentioned earphone device, and the method may include the following steps:
步骤502,在第一耳机与第一终端设备建立蓝牙连接,第二耳机与第二终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,第二耳机响应于连接操作,断开与第二终端设备之间的蓝牙连接,并发送广播信号;该广播信号用于触发接收到广播信号的第一终端设备向第一耳机发送连接指令,以使第一耳机根据连接指令与第二耳机建立蓝牙连接;或,广播信号用于触发接收到广播信号的第一耳机与第二耳机建立蓝牙连接。
在本申请实施例中,第一耳机与第二耳机分别单独使用,可包括第一耳机与第一终端设备建立蓝牙连接,第二耳机与第二终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的场景,该第一终端设备与第二终端设备为两个不同的终端设备。In this embodiment of the application, the first earphone and the second earphone are used separately, which may include establishing a Bluetooth connection between the first earphone and the first terminal device, establishing a Bluetooth connection between the second earphone and the second terminal device, and the first earphone not being connected to the In a scenario where the second earphone establishes a Bluetooth connection, the first terminal device and the second terminal device are two different terminal devices.
在用户需要将第一耳机与第二耳机从单独使用的状态切换为共同使用的状态时,可进行针对第二耳机的连接操作。在一些实施例中,针对第二耳机的连接操作可以是用户在第二耳机上进行的操作,也可以是用户在第二终端设备上进行的操作。在用户需要将第一耳机与第二耳机从单独使用的状态切换为共同使用的状态时,可以在第二终端设备上进行连接操作,第二终端设备检测到该连接操作后,可向第二耳机发送操作指令,第二耳机可响应该操作指令,断开与第二终端设备之间的蓝牙连接并发送广播信号。When the user needs to switch the first earphone and the second earphone from the state of independent use to the state of common use, the connection operation for the second earphone can be performed. In some embodiments, the connection operation for the second earphone may be an operation performed by the user on the second earphone, or an operation performed by the user on the second terminal device. When the user needs to switch the first earphone and the second earphone from the state of independent use to the state of joint use, the connection operation can be performed on the second terminal device. After the second terminal device detects the connection operation, it can send the The earphone sends an operation instruction, and the second earphone can respond to the operation instruction, disconnect the Bluetooth connection with the second terminal device and send a broadcast signal.
可选地,在第二终端设备上进行的连接操作,可包括但不限于触控操作、语音操作、手势操作等中的一种或多种。例如,用户可控制第二终端设备进入蓝牙设置界面,该蓝牙设置界面可包括切换按钮,用户可点击该切换按钮,以触发第一耳机与第二耳机从单独使用的状态切换为共同使用的状态,在第二终端设备检测到针对该切换按钮的点击操作时,确定检测到连接操作。能够丰富连接操作的操作方式,提高操作的便捷性。Optionally, the connection operation performed on the second terminal device may include but not limited to one or more of touch operation, voice operation, gesture operation, and the like. For example, the user can control the second terminal device to enter the bluetooth setting interface, and the bluetooth setting interface can include a switch button, and the user can click the switch button to trigger the first earphone and the second earphone to switch from the state of independent use to the state of common use , when the second terminal device detects a click operation on the switching button, it determines that a connection operation is detected. The operation mode of connection operation can be enriched, and the convenience of operation can be improved.
在一些实施例中,该第二耳机在响应连接操作之前,可处于未与第二终端设备进行数据传输的状态,也即,第二耳机当前没有处理第二终端设备的业务。在第二耳机当前没有处理第二终端设备的业务的情况下,用户可进行针对第二耳机的连接操作,第二耳机可响应该连接操作,断开与第二终端设备之间的蓝牙连接,并发送广播信号。由于第一耳机与第二耳机在分别单独使用的状态,第一耳机与第二耳机可以分别使用不同的蓝牙地址与不同的终端设备建立蓝牙连接,当第一耳机与第二耳机切换为共同使用的状态时,第一耳机与第二耳机共享同一个蓝牙地址,以实现第一耳机与第二耳机同步输出同一终端设备的音频数据。因此,在第一耳机与第二耳机建立蓝牙连接之前,第二耳机可以先与第二终端设备断开蓝牙连接,以避免蓝牙地址发生变化后出现连接错误的情况。In some embodiments, the second earphone may be in a state of not performing data transmission with the second terminal device before responding to the connection operation, that is, the second earphone is not currently processing services of the second terminal device. In the case that the second earphone is not currently handling the business of the second terminal device, the user may perform a connection operation on the second earphone, and the second earphone may disconnect the Bluetooth connection with the second terminal device in response to the connection operation, and send broadcast signals. Since the first earphone and the second earphone are in the state of being used separately, the first earphone and the second earphone can respectively use different Bluetooth addresses to establish Bluetooth connections with different terminal devices. When the first earphone and the second earphone are switched to common use In the state, the first earphone and the second earphone share the same bluetooth address, so that the first earphone and the second earphone can synchronously output the audio data of the same terminal device. Therefore, before the first earphone establishes the bluetooth connection with the second earphone, the second earphone may first disconnect the bluetooth connection with the second terminal device, so as to avoid connection errors after the bluetooth address changes.
在本申请实施例中,可选择当前没有处理业务的第二耳机断开与第二终端设备之间的蓝牙连接,并在第一耳机与第二耳机建立蓝牙连接后,第二耳机可共享使用第一耳机的蓝牙地址,能够避免对第一终端设备与第一耳机之间的数据传输产生影响,影响用户的正常使用。In the embodiment of this application, the second earphone that is not currently processing business can be selected to disconnect the Bluetooth connection with the second terminal device, and after the first earphone establishes a Bluetooth connection with the second earphone, the second earphone can be shared. The bluetooth address of the first earphone can avoid affecting the data transmission between the first terminal device and the first earphone, and affecting the normal use of the user.
需要说明的是,本申请实施例不对第二耳机断开与第二终端设备之间的蓝牙连接,以及发送广播信号的先后顺序进行限定,第二耳机可以先断开蓝牙连接再发送广播信号,也可以发送广播信号再断开蓝牙连接,还可以断开蓝牙连接与发送广播信号同步进行等。It should be noted that the embodiment of the present application does not limit the order in which the second earphone disconnects the Bluetooth connection with the second terminal device and sends the broadcast signal. The second earphone may first disconnect the Bluetooth connection and then send the broadcast signal. You can also send a broadcast signal and then disconnect the Bluetooth connection, and you can also disconnect the Bluetooth connection and send the broadcast signal synchronously.
在一些实施例中,在第二耳机开始发送广播信号时,可启动计时器,该计时器可用于记录第二耳机发送广播信号的持续时长。当第二耳机接收到第一耳机发送的蓝牙连接请求,或计时器记录的时长达到时长阈值时,第二耳机可停止发送广播信号,可避免第二耳机长时间发送广播信号导致功耗损失过大。In some embodiments, when the second earphone starts to send the broadcast signal, a timer can be started, and the timer can be used to record the duration of the broadcast signal sent by the second earphone. When the second earphone receives the Bluetooth connection request sent by the first earphone, or the time recorded by the timer reaches the duration threshold, the second earphone can stop sending broadcast signals, which can prevent the second earphone from sending broadcast signals for a long time and causing excessive power loss. big.
可选地,在计时器记录的时长达到时长阈值时,若第二耳机依然未与第一耳机成功建立蓝牙请求,则可输出第一提示信息,该第一提示信息可用于提示用户第二耳机未成功与第一耳机建立蓝牙连接,以方便用户做进一步调整(比如将第二耳机放置在距离第一终端设备较近的地方等)。Optionally, when the duration recorded by the timer reaches the duration threshold, if the second earphone still has not successfully established a Bluetooth request with the first earphone, first prompt information may be output, and the first prompt information may be used to remind the user that the second earphone Failed to establish a Bluetooth connection with the first earphone, so that the user can make further adjustments (such as placing the second earphone closer to the first terminal device, etc.).
可选地,若第二耳机与第一耳机成功建立蓝牙连接,则第二耳机也可输出第二提示信息,该第二提示信息用于提示用户第二耳机成功与第一耳机建立蓝牙连接,即第二耳机与第一耳机成功切换至共同使用的状态。上述的第一提示信息与第二提示信息可包括但不限于语音提示、提示音提示、震动提示等方式,在此不作限定。通过输出提示信息可让用户准确获取耳机设备当前的使用模式,提高用户体验。Optionally, if the second earphone successfully establishes a Bluetooth connection with the first earphone, the second earphone may also output a second prompt message, which is used to prompt the user that the second earphone successfully establishes a Bluetooth connection with the first earphone, That is, the second earphone and the first earphone are successfully switched to the common use state. The aforementioned first prompt information and second prompt information may include, but are not limited to, voice prompts, prompt sound prompts, vibration prompts, etc., which are not limited herein. By outputting the prompt information, the user can accurately obtain the current usage mode of the earphone device, thereby improving the user experience.
需要说明的是,若第一耳机与第二耳机均没有处理业务,用户也可以选择进行针对第一耳机的连接操作,由第一耳机发送广播信号,并由第二耳机向第一耳机发起蓝牙连接请求,其过程与第二耳机发送广播信号发方式相似,在此不再重复赘述。It should be noted that if neither the first earphone nor the second earphone is processing services, the user can also choose to perform a connection operation for the first earphone, and the first earphone will send a broadcast signal, and the second earphone will initiate a Bluetooth connection to the first earphone. The process of the connection request is similar to that of the broadcast signal sent by the second earphone, and will not be repeated here.
步骤504,第一耳机与第二耳机同步输出第一终端设备传输的音频数据。
在一些实施例中,若第一耳机在向第二耳机发送蓝牙连接请求时,正在与第一终端设备进行音频数据传输,则在第一耳机与第二耳机建立蓝牙连接后,第一耳机与第二耳机可同步输出第一终端设备传输的音频数据。In some embodiments, if the first earphone is transmitting audio data with the first terminal device when sending a Bluetooth connection request to the second earphone, after the first earphone establishes a Bluetooth connection with the second earphone, the first earphone and the second earphone The second earphone can synchronously output the audio data transmitted by the first terminal device.
在一些实施例中,耳机设备可包括主耳机及从耳机,在耳机设备与终端设备建立蓝牙连接时,主耳机与终端设备建立蓝牙物理链路,并可与终端设备直接进行数据传输。从耳机可对主耳机与终端设备之间的蓝牙物理链路进行监听,或是由主耳机将终端设备发送的数据同步给从耳机,从耳机并不与终端设备直接进行连接。其中,蓝牙物理链路可包括但不限于ACL(Asynchronous Connectionless,异步无连接)等物理链路。In some embodiments, the headset device may include a master headset and a slave headset. When the headset device establishes a Bluetooth connection with the terminal device, the master headset establishes a Bluetooth physical link with the terminal device and can directly perform data transmission with the terminal device. The slave headset can monitor the Bluetooth physical link between the master headset and the terminal device, or the master headset can synchronize the data sent by the terminal device to the slave headset, and the slave headset is not directly connected to the terminal device. Wherein, the Bluetooth physical link may include but not limited to physical links such as ACL (Asynchronous Connectionless, asynchronous connectionless).
在一些实施例中,上述的第一耳机可以是主耳机,第二耳机可以是从耳机。可选地,在第一耳机与第二耳机建立蓝牙连接后,第一耳机可向第二耳机同步第一终端设备的连接信息,以使第二耳机根据该连接信息对第一耳机与第一终端设备之间的蓝牙连接进行监听。可选地,该连接信息可包括但不限于跳频信息、信道信息、时钟信息等。第二耳机通过监听第一耳机与第一终端设备之间的蓝牙连接的方式可同步获取到第一终端设备向第一耳机传输的音频数据,并对该音频数据进行播放,实现主从耳机之间的同步。In some embodiments, the above-mentioned first earphone may be a master earphone, and the second earphone may be a slave earphone. Optionally, after the first earphone establishes a Bluetooth connection with the second earphone, the first earphone can synchronize the connection information of the first terminal device to the second earphone, so that the second earphone can connect the first earphone and the first earphone according to the connection information. Monitor the Bluetooth connection between end devices. Optionally, the connection information may include but not limited to frequency hopping information, channel information, clock information, and the like. The second earphone can synchronously acquire the audio data transmitted from the first terminal device to the first earphone by monitoring the Bluetooth connection between the first earphone and the first terminal device, and play the audio data to realize the master-slave earphone communication. synchronization between.
可选地,在第一耳机与第二耳机建立蓝牙连接后,第一耳机可将与第一终端设备之间传输的数据同步给第二耳机,第二耳机可获取第一耳机同步的音频数据,并对该音频数据进行播放,实现主从耳机之间的同步。Optionally, after the first earphone establishes a Bluetooth connection with the second earphone, the first earphone can synchronize the data transmitted with the first terminal device to the second earphone, and the second earphone can obtain the audio data synchronized by the first earphone , and play the audio data to realize the synchronization between the master and slave earphones.
在一些实施例中,上述的第一耳机可以是从耳机,第二耳机可以是主耳机。可选地,在第一耳机与第二耳机建立蓝牙连接后,第一耳机可向第二耳机同步第一终端设备的连接信息,从而将第一终端设备的蓝牙连接对象从第一耳机切换至第二耳机,也即将第一耳机与第一终端设备的蓝牙连接切换成第二耳机与第一终端设备的蓝牙连接。第一耳机可对第二耳机与第一终端设备之间的数据传输进行监听,或是由第二耳机将与第一终端设备之间传输的数据同步给第一耳机,实现主从耳机之间的同步。In some embodiments, the above-mentioned first earphone may be a slave earphone, and the second earphone may be a master earphone. Optionally, after the first earphone establishes a Bluetooth connection with the second earphone, the first earphone can synchronize the connection information of the first terminal device to the second earphone, thereby switching the Bluetooth connection object of the first terminal device from the first earphone to The second earphone is to switch the Bluetooth connection between the first earphone and the first terminal device to the Bluetooth connection between the second earphone and the first terminal device. The first earphone can monitor the data transmission between the second earphone and the first terminal device, or the second earphone will synchronize the data transmitted between the first terminal device and the first earphone to realize the master-slave earphone communication synchronization.
示例性地,图6为另一个实施例中蓝牙连接方法的时序交互示意图。如图6所示,耳机设备可包括耳机A及耳机B,耳机A与耳机B之间未建立蓝牙连接,分别单独使用。耳机B与终端设备C建立蓝牙连接,并向终端设备C发送第二特定信息,耳机A与终端设备D建立蓝牙连接,并向终端设备D发送第一特定信息。耳机B可处理终端设备C发送的音频数据,耳机A可处理终端设备D发送的音频数据。Exemplarily, FIG. 6 is a schematic diagram of sequence interaction of a Bluetooth connection method in another embodiment. As shown in FIG. 6 , the earphone device may include an earphone A and an earphone B, and no Bluetooth connection is established between the earphone A and the earphone B, and they are used separately. The headset B establishes a Bluetooth connection with the terminal device C, and sends the second specific information to the terminal device C, and the headset A establishes a Bluetooth connection with the terminal device D, and sends the first specific information to the terminal device D. Earphone B can process audio data sent by terminal device C, and earphone A can process audio data sent by terminal device D.
在终端设备D停止向耳机A发送音频数据后,若用户想要将耳机A与耳机B从单独使用的状态切换为共同使用的状态,则可进行针对耳机A的连接操作。耳机A响应该连接操作,断开与终端设备D之间的蓝牙连接,并发送广播信号,该广播信号可携带有第一特定信息及耳机A的蓝牙地址。终端设备C在接收到该广播信号,可对该广播信号进行解析,得到第一特定信息及耳机A的蓝牙地址。终端设备C可将该第一特定信息与耳机B发送的第二特定信息进行比对,并在确定该第一特定信息与该第二特定信息相同时,向耳机B发送连接指令,该连接指令包含耳机A的蓝牙地址。耳机B在接收到该连接指令后,可基于连接指令包含的耳机A的蓝牙地址,向耳机A发送蓝牙连接请求,并与耳机A建立蓝牙连接。在耳机A与耳机B建立蓝牙连接后,耳机A与耳机B之间数据同步,共同播放终端设备C传输的音频数据。After the terminal device D stops sending audio data to the earphone A, if the user wants to switch the earphone A and the earphone B from the state of independent use to the state of joint use, the connection operation for the earphone A can be performed. In response to the connection operation, the earphone A disconnects the Bluetooth connection with the terminal device D, and sends a broadcast signal, where the broadcast signal may carry the first specific information and the Bluetooth address of the earphone A. After receiving the broadcast signal, the terminal device C can analyze the broadcast signal to obtain the first specific information and the Bluetooth address of the earphone A. The terminal device C can compare the first specific information with the second specific information sent by the earphone B, and when it is determined that the first specific information is the same as the second specific information, send a connection instruction to the earphone B, and the connection instruction Contains the Bluetooth address of headset A. After receiving the connection instruction, the headset B can send a Bluetooth connection request to the headset A based on the Bluetooth address of the headset A included in the connection command, and establish a Bluetooth connection with the headset A. After the earphone A and the earphone B establish the Bluetooth connection, the data between the earphone A and the earphone B are synchronized, and the audio data transmitted by the terminal device C is played together.
在一些实施例中,若用户需要将耳机设备从两只耳机共同使用的状态切换为两只耳机分别单独使用的状态,则可将第一耳机或第二耳机放入耳机充电盒中,并对耳机充电盒上设置的按键进行操作,比如可长按该按键。耳机充电盒检测到针对按键的操作后,可向放入耳机充电盒中的目标耳机(可以是第一耳机或第二耳机)发送断连指令,该断连指令用于指示放入耳机充电盒中的目标耳机断开与另一只耳机之间的蓝牙连接。可选地,目标耳机在断开与另一只耳机之间的蓝牙连接后,可将自身的蓝牙地址设置为与另一只耳机不同的蓝牙地址,耳机设备的两只耳机分别对应不同的蓝牙地址,则可实现分别单独使用。In some embodiments, if the user needs to switch the earphone device from the state where the two earphones are used together to the state where the two earphones are used separately, the first earphone or the second earphone can be put into the earphone charging box, and the The button set on the earphone charging box is operated, for example, the button can be long pressed. After the earphone charging box detects the operation of the button, it can send a disconnection command to the target earphone (which can be the first earphone or the second earphone) placed in the earphone charging box. The disconnection command is used to instruct the earphone to be placed in the earphone charging box The target headset in disconnects the Bluetooth connection with the other headset. Optionally, after the target headset disconnects the Bluetooth connection with the other headset, it can set its own Bluetooth address to a different Bluetooth address from the other headset, and the two headsets of the headset device correspond to different Bluetooth addresses. Addresses can be used separately.
在本申请实施例中,用户通过简单、快捷的操作即可将耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,提高切换效率,且不会影响用户对第一耳机的正常使用,满足了用户在不同场景下对于耳机设备的不同使用需求。In the embodiment of the present application, the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together through simple and quick operations, which improves the switching efficiency and does not affect the user's first The normal use of the headset meets the different needs of the user for the headset device in different scenarios.
如图7所示,在一个实施例中,提供另一种蓝牙连接方法,可应用于终端设备(如上述的第一终端设备),该终端设备可与耳机设备中的第一耳机建立蓝牙连接,耳机设备还包括第二耳机。该方法可包括以下步骤:As shown in Figure 7, in one embodiment, another Bluetooth connection method is provided, which can be applied to a terminal device (such as the above-mentioned first terminal device), and the terminal device can establish a Bluetooth connection with the first earphone in the earphone device , the earphone device further includes a second earphone. The method may include the steps of:
步骤710,接收第二耳机发送的广播信号,该广播信号为第二耳机响应于连接操作发送的。Step 710: Receive a broadcast signal sent by the second earphone, where the broadcast signal is sent by the second earphone in response to the connection operation.
步骤720,根据广播信号向第一耳机发送连接指令,该连接指令用于指示第一耳机根据连接指令与第二耳机建立蓝牙连接。Step 720: Send a connection instruction to the first earphone according to the broadcast signal, where the connection instruction is used to instruct the first earphone to establish a Bluetooth connection with the second earphone according to the connection instruction.
在一些实施例中,广播信号包括第一特定信息。在步骤710之前,该方法还包括:接收第一耳机发送的第二特定信息。步骤根据广播信号向第一耳机发送连接指令,包括:对广播信号进行解析,以得到第一特定信息;若第一特定信息与第二特征信息相同,则向第一耳机发送连接指令。In some embodiments, the broadcast signal includes first specific information. Before
在一些实施例中,广播信号还包括第二耳机的蓝牙地址。步骤根据广播信号向第一耳机发送连接指令,包括:根据广播信号向第一耳机发送包括蓝牙地址的连接指令,连接指令用于指示第一耳机根据蓝牙地址向第二耳机发送蓝牙连接请求,以与第二耳机建立蓝牙连接。In some embodiments, the broadcast signal also includes the Bluetooth address of the second headset. The step of sending a connection instruction to the first earphone according to the broadcast signal includes: sending a connection instruction including a Bluetooth address to the first earphone according to the broadcast signal, the connection instruction being used to instruct the first earphone to send a Bluetooth connection request to the second earphone according to the Bluetooth address, to Establish a Bluetooth connection with the second headset.
在一些实施例中,广播信号包括第一特定信息。步骤根据广播信号向第一耳机发送连接指令,包括:对广播信号进行解析,以得到第一特定信息;向第一耳机发送第一特定信息及连接指令,以使第一耳机在确定第一特定信息与存储的第二特定信息相同时,根据连接指令与第二耳机建立蓝牙连接。In some embodiments, the broadcast signal includes first specific information. The step of sending a connection instruction to the first earphone according to the broadcast signal includes: parsing the broadcast signal to obtain the first specific information; sending the first specific information and the connection instruction to the first earphone so that the first earphone determines the first specific information. When the information is the same as the stored second specific information, a Bluetooth connection is established with the second earphone according to the connection instruction.
需要说明的是,本申请实施例公开的应用于终端设备的蓝牙连接方法的描述,可参考上述各实施例中公开的应用于耳机设备的蓝牙连接方法的相关描述,在此不再赘述。It should be noted that, for the description of the Bluetooth connection method applied to the terminal device disclosed in the embodiments of the present application, reference may be made to the related descriptions of the Bluetooth connection method applied to the earphone device disclosed in the above embodiments, and details are not repeated here.
在本申请实施例中,与第一耳机建立蓝牙连接的终端设备在接收到第二耳机发送的广播信号时,可向第一耳机发送连接指令,以使第一耳机与第二耳机建立蓝牙连接,用户只需要进行针对第二耳机的连接操作即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,操作方式更为简便快捷,提高了切换效率,且不会影响用户对第一耳机的正常使用。In this embodiment of the application, when the terminal device that establishes a Bluetooth connection with the first earphone receives the broadcast signal sent by the second earphone, it can send a connection instruction to the first earphone, so that the first earphone can establish a Bluetooth connection with the second earphone. , the user only needs to perform the connection operation for the second earphone to switch the earphone device from the state of the two earphones being used separately to the state of the two earphones being used together. The operation method is simpler and faster, and the switching efficiency is improved. It will affect the user's normal use of the first earphone.
如图8所示,在一个实施例中,提供一种蓝牙连接装置800,可应用于上述的耳机设备。该蓝牙连接装置800,包括广播模块810及连接模块820。As shown in FIG. 8 , in one embodiment, a
广播模块810,用于在第一耳机与第一终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,由第二耳机响应于连接操作,发送广播信号;广播信号用于触发接收到广播信号的第一终端设备向第一耳机发送连接指令,以使第一耳机根据连接指令与第二耳机建立蓝牙连接;或,广播信号用于触发接收到广播信号的第一耳机与第二耳机建立蓝牙连接。The
在一个实施例中,广播信号包括BLE广播信号。In one embodiment, the broadcast signal includes a BLE broadcast signal.
在一个实施例中,广播信号包括第一特定信息。广播信号用于触发第一终端设备在确定第一特定信息与第二特定信息相同时,向第一耳机发送连接指令,其中,第二特定信息是第一耳机发送给第一终端设备的;或,广播信号用于触发接收到广播信号的第一终端设备将第一特定信息及连接指令发送给第一耳机,以使第一耳机在确定第一特定信息与第一耳机中存储的第二特定信息相同时,根据连接指令与第二耳机建立蓝牙连接。In one embodiment, the broadcast signal includes first specific information. The broadcast signal is used to trigger the first terminal device to send a connection instruction to the first earphone when it is determined that the first specific information is the same as the second specific information, where the second specific information is sent by the first earphone to the first terminal device; or , the broadcast signal is used to trigger the first terminal device receiving the broadcast signal to send the first specific information and the connection instruction to the first earphone, so that the first earphone determines the first specific information and the second specific information stored in the first earphone. When the information is the same, a Bluetooth connection is established with the second earphone according to the connection instruction.
连接模块820,用于由第一耳机根据连接指令与第二耳机建立蓝牙连接。The
在一个实施例中,广播信号还包括第二耳机对应的蓝牙地址;连接指令包括该蓝牙地址。连接模块820,还用于由第一耳机根据蓝牙地址向第二耳机发送蓝牙连接请求;由第二耳机响应蓝牙连接请求,与第一耳机建立蓝牙连接。In one embodiment, the broadcast signal further includes the Bluetooth address corresponding to the second earphone; the connection instruction includes the Bluetooth address. The
或,or,
连接模块820,用于由第一耳机根据广播信号与第二耳机建立蓝牙连接。The
在一个实施例中,广播信号包括第一特定信息及第二耳机对应的蓝牙地址。广播信号用于触发接收到广播信号的第一耳机在确定第一特定信息与所述第一耳机中存储的第二特定信息相同时,根据蓝牙地址向第二耳机发送蓝牙连接请求,以使第二耳机响应所述蓝牙连接请求,与第一耳机建立蓝牙连接。In one embodiment, the broadcast signal includes the first specific information and the Bluetooth address corresponding to the second earphone. The broadcast signal is used to trigger the first earphone receiving the broadcast signal to send a Bluetooth connection request to the second earphone according to the Bluetooth address when determining that the first specific information is the same as the second specific information stored in the first earphone, so that the second earphone The second earphone responds to the bluetooth connection request and establishes a bluetooth connection with the first earphone.
连接模块820,还用于由第一耳机在确定第一特定信息与所述第一耳机中存储的第二特定信息相同时,根据蓝牙地址向第二耳机发送蓝牙连接请求,以使第二耳机响应该蓝牙连接请求,与第一耳机建立蓝牙连接。The
在本申请实施例中,用户只需要进行针对第二耳机的连接操作即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,相较于相关技术中需要将两只耳机都放置到耳机充电盒,并对耳机充电盒进行相应操作才能实现状态切换的方式,更为简便快捷,提高了切换效率,且不会影响用户对第一耳机的正常使用。In the embodiment of the present application, the user only needs to perform the connection operation on the second earphone to switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together. Both earphones are placed in the earphone charging box, and the state switching can be realized by performing corresponding operations on the earphone charging box, which is simpler and faster, improves the switching efficiency, and will not affect the normal use of the first earphone by the user.
在一个实施例中,第二耳机响应连接操作之前,第二耳机与第二终端设备蓝牙连接,且第二耳机处于未与第二终端设备进行数据传输的状态。In one embodiment, before the second earphone responds to the connection operation, the second earphone is connected to the second terminal device via Bluetooth, and the second earphone is in a state of not performing data transmission with the second terminal device.
在一个实施例中,上述的蓝牙连接装置800,除了包括广播模块810及连接模块820,还包括断开模块。In one embodiment, the above-mentioned
断开模块,用于由第二耳机断开与第二终端设备之间的蓝牙连接。The disconnection module is used for disconnecting the bluetooth connection between the second earphone and the second terminal device by the second earphone.
在一个实施例中,上述的蓝牙连接装置800,还包括同步模块。In one embodiment, the above-mentioned
同步模块,用于由第一耳机向第二耳机同步第一终端设备的连接信息,以使第二耳机根据连接信息对第一耳机与第一终端设备之间的蓝牙连接进行监听;或,用于由第一耳机将与第一终端设备之间传输的数据同步给第二耳机。The synchronization module is used to synchronize the connection information of the first terminal device from the first earphone to the second earphone, so that the second earphone can monitor the Bluetooth connection between the first earphone and the first terminal device according to the connection information; or, use Because the first earphone synchronizes the data transmitted with the first terminal device to the second earphone.
在本申请实施例中,用户通过简单、快捷的操作即可将耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,提高切换效率,且不会影响用户对第一耳机的正常使用,满足了用户在不同场景下对于耳机设备的不同使用需求。In the embodiment of the present application, the user can switch the earphone device from the state where the two earphones are used separately to the state where the two earphones are used together through simple and quick operations, which improves the switching efficiency and does not affect the user's first The normal use of the headset meets the different needs of the user for the headset device in different scenarios.
如图9所示,在一个实施例中,提供一种蓝牙连接装置900,可应用于终端设备(如上述的第一终端设备),该终端设备与耳机设备中的第一耳机建立蓝牙连接,耳机设备还包括第二耳机。该蓝牙连接装置900,包括广播接收模块910及指令发送模块920。As shown in FIG. 9, in one embodiment, a
广播接收模块910,用于接收第二耳机发送的广播信号,广播信号为第二耳机响应于连接操作发送的。The
指令发送模块920,用于根据广播信号向第一耳机发送连接指令,连接指令用于指示第一耳机根据连接指令与第二耳机建立蓝牙连接。The
在一个实施例中,广播信号包括第一特定信息。In one embodiment, the broadcast signal includes first specific information.
蓝牙连接装置900还包括接收模块,用于接收第一耳机发送的第二特定信息。The
指令发送模块920,还用于对广播信号进行解析,以得到第一特定信息;若该第一特定信息与第二特征信息相同,则向第一耳机发送连接指令。The
在一个实施例中,广播信号还包括第二耳机的蓝牙地址。指令发送模块920,还用于根据广播信号向第一耳机发送包括蓝牙地址的连接指令,该连接指令用于指示第一耳机根据蓝牙地址向第二耳机发送蓝牙连接请求,以与第二耳机建立蓝牙连接。In one embodiment, the broadcast signal further includes the Bluetooth address of the second earphone. The
在一个实施例中,广播信号包括第一特定信息。指令发送模块920,还用于对广播信号进行解析,以得到第一特定信息;向第一耳机发送第一特定信息及连接指令,以使第一耳机在确定第一特定信息与存储的第二特定信息相同时,根据连接指令与第二耳机建立蓝牙连接。In one embodiment, the broadcast signal includes first specific information. The
在本申请实施例中,与第一耳机建立蓝牙连接的终端设备在接收到第二耳机发送的广播信号时,可向第一耳机发送连接指令,以使第一耳机与第二耳机建立蓝牙连接,用户只需要进行针对第二耳机的连接操作即可实现耳机设备从两只耳机分别单独使用的状态切换为两只耳机共同使用的状态,操作方式更为简便快捷,提高了切换效率,且不会影响用户对第一耳机的正常使用。In this embodiment of the application, when the terminal device that establishes a Bluetooth connection with the first earphone receives the broadcast signal sent by the second earphone, it can send a connection instruction to the first earphone, so that the first earphone can establish a Bluetooth connection with the second earphone. , the user only needs to perform the connection operation for the second earphone to switch the earphone device from the state of the two earphones being used separately to the state of the two earphones being used together. The operation method is simpler and faster, and the switching efficiency is improved. It will affect the user's normal use of the first earphone.
图10为一个实施例中耳机设备的结构框图。如图10所示,耳机设备1000可以包括一个或多个如下部件:处理器1010、与处理器1010耦合的存储器1020,其中存储器1020可存储有一个或多个计算机程序,一个或多个计算机程序可以被配置为由一个或多个处理器1010执行时实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。Fig. 10 is a structural block diagram of an earphone device in one embodiment. As shown in FIG. 10 , the
处理器1010可以包括一个或者多个处理核。处理器1010利用各种接口和线路连接整个耳机设备1000内的各个部分,通过运行或执行存储在存储器1020内的指令、程序、代码集或指令集,以及调用存储在存储器1020内的数据,执行耳机设备1000的各种功能和处理数据。可选地,处理器1010可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1010可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1010中,单独通过一块通信芯片进行实现。
存储器1020可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。存储器1020可用于存储指令、程序、代码、代码集或指令集。存储器1020可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现上述各个方法实施例的指令等。存储数据区还可以存储耳机设备1000在使用中所创建的数据等。The
耳机设备1000还可包括蓝牙模块,蓝牙模块可用于提供蓝牙通信功能,与其它电子设备建立蓝牙连接,并进行蓝牙数据传输。蓝牙模块可支持一种或多种蓝牙协议,如经典蓝牙、BLE等),但不限于此,可随着蓝牙协议的发展而变化。The
在一些实施例中,耳机设备包括第一耳机及第二耳机,第一耳机及第二耳机中均可至少包括上述的处理器1010、存储器1020及蓝牙模块。In some embodiments, the earphone device includes a first earphone and a second earphone, and both the first earphone and the second earphone may include at least the above-mentioned
可选地,在第一耳机通过蓝牙模块与第一终端设备建立蓝牙连接,且第一耳机未与第二耳机建立蓝牙连接的情况下,第二耳机的处理器1010,用于可用于响应于连接操作,并控制第二耳机的蓝牙模块发送广播信号。该广播信号用于触发第一终端设备向第一耳机发送连接指令。第一耳机的处理器1010,用于通过第一耳机的蓝牙模块接收该连接指令,并根据该连接指令指示第一耳机的蓝牙模块与第二耳机的蓝牙模块建立蓝牙连接。Optionally, when the first earphone establishes a bluetooth connection with the first terminal device through the bluetooth module, and the first earphone does not establish a bluetooth connection with the second earphone, the
可以理解地,耳机设备1000可包括比上述结构框图中更多或更少的结构元件,例如,包括电源模块、物理按键、传感器等,还可在此不进行限定。It can be understood that the
本申请实施例公开一种终端设备,包括存储器及处理器,该存储器中存储有计算机程序,该计算机程序被该处理器执行时,使得该处理器实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。The embodiment of the present application discloses a terminal device, including a memory and a processor, and a computer program is stored in the memory. When the computer program is executed by the processor, the processor implements the terminal device as described in the above-mentioned embodiments. Bluetooth connection method.
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被处理器执行时实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。The embodiment of the present application discloses a computer-readable storage medium, which stores a computer program, wherein, when the computer program is executed by a processor, the Bluetooth connection method applied to the earphone device as described in the above-mentioned embodiments is implemented.
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被处理器执行时实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。The embodiment of the present application discloses a computer-readable storage medium, which stores a computer program, wherein, when the computer program is executed by a processor, the Bluetooth connection method applied to the terminal device as described in the foregoing embodiments is implemented.
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被处理器执行时实现如上述各实施例描述的应用于耳机设备的蓝牙连接方法。The embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the applications described in the above-mentioned embodiments can be implemented. The Bluetooth connection method of the headset device.
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被处理器执行时实现如上述各实施例描述的应用于终端设备的蓝牙连接方法。The embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the applications described in the above-mentioned embodiments can be implemented. The Bluetooth connection method of the terminal device.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、ROM等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be realized through computer programs to instruct related hardware, and the programs can be stored in a non-volatile computer-readable storage medium When the program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a ROM, or the like.
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括ROM、可编程ROM(Programmable ROM,PROM)、可擦除PROM(Erasable PROM,EPROM)、电可擦除PROM(Electrically ErasablePROM,EEPROM)或闪存。易失性存储器可包括随机存取存储器(random access memory,RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM可为多种形式,诸如静态RAM(Static RAM,SRAM)、动态RAM(Dynamic Random Access Memory,DRAM)、同步DRAM(synchronous DRAM,SDRAM)、双倍数据率SDRAM(Double Data Rate SDRAM,DDR SDRAM)、增强型SDRAM(Enhanced Synchronous DRAM,ESDRAM)、同步链路DRAM(Synchlink DRAM,SLDRAM)、存储器总线直接RAM(Rambus DRAM,RDRAM)及直接存储器总线动态RAM(DirectRambus DRAM,DRDRAM)。Any reference to memory, storage, database or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (Erasable PROM, EPROM), Electrically Erasable PROM (Electrically Erasable PROM, EEPROM) or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM can take many forms, such as static RAM (Static RAM, SRAM), dynamic RAM (Dynamic Random Access Memory, DRAM), synchronous DRAM (synchronous DRAM, SDRAM), double data rate SDRAM (Double Data Rate) Data Rate SDRAM, DDR SDRAM), enhanced SDRAM (Enhanced Synchronous DRAM, ESDRAM), synchronous link DRAM (Synchlink DRAM, SLDRAM), memory bus direct RAM (Rambus DRAM, RDRAM) and direct memory bus dynamic RAM (DirectRambus DRAM, DRDRAM).
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定特征、结构或特性可以以任意适合的方式结合在一个或多个实施例中。本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本申请所必须的。It should be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the present application. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout the specification are not necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by this application.
在本申请的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的必然先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In various embodiments of the present application, it should be understood that the sequence numbers of the above-mentioned processes do not necessarily mean the order of execution. The implementation of the examples constitutes no limitation.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可位于一个地方,或者也可以分布到多个网络单元上。可根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, located in one place, or 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. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
以上对本申请实施例公开的一种蓝牙连接方法、装置、耳机设备及计算机可读存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A Bluetooth connection method, device, earphone device, and computer-readable storage medium disclosed in the embodiments of the present application have been described above in detail. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application. The above embodiments The description is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, based on the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification should not be construed as limiting the application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111180582.2ACN115967926A (en) | 2021-10-11 | 2021-10-11 | Bluetooth connection method, device, electronic device, and computer-readable storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111180582.2ACN115967926A (en) | 2021-10-11 | 2021-10-11 | Bluetooth connection method, device, electronic device, and computer-readable storage medium |
| Publication Number | Publication Date |
|---|---|
| CN115967926Atrue CN115967926A (en) | 2023-04-14 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111180582.2APendingCN115967926A (en) | 2021-10-11 | 2021-10-11 | Bluetooth connection method, device, electronic device, and computer-readable storage medium |
| Country | Link |
|---|---|
| CN (1) | CN115967926A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116828631A (en)* | 2023-06-25 | 2023-09-29 | 爱科微半导体(上海)有限公司 | Link establishment method, device, equipment and medium for Bluetooth headset audio device group |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116828631A (en)* | 2023-06-25 | 2023-09-29 | 爱科微半导体(上海)有限公司 | Link establishment method, device, equipment and medium for Bluetooth headset audio device group |
| Publication | Publication Date | Title |
|---|---|---|
| US11368777B2 (en) | Method and system for upgrading program of TWS headset, and TWS headset | |
| US20250168906A1 (en) | Information updating method and electronic device | |
| WO2023036178A1 (en) | Bluetooth connection method and apparatus, earphone device, and computer-readable storage medium | |
| CN110602683A (en) | Bluetooth control method, device, mobile terminal and storage medium | |
| US20250211892A1 (en) | Method, electronic device, and storage medium for sharing audio data | |
| WO2021233398A1 (en) | Wireless audio system, wireless communication method, and device | |
| CN114374959A (en) | Bluetooth connection method, device, electronic device and storage medium | |
| CN106095132B (en) | Method and device for setting key function of playing equipment | |
| WO2023103732A1 (en) | State control method and apparatus for earphone device, earphone device and storage medium | |
| WO2023035782A1 (en) | Bluetooth connection method and apparatus, earphone device and computer-readable storage medium | |
| CN115580944A (en) | Audio device connection method and device, storage medium and device | |
| WO2023279928A1 (en) | Signal transmission method and apparatus, information prompt method and apparatus, and electronic device | |
| CN113645573B (en) | Earphone configuration data sharing method, earphone and storage medium | |
| CN115967926A (en) | Bluetooth connection method, device, electronic device, and computer-readable storage medium | |
| CN115776661A (en) | Bluetooth-based control method and device, electronic equipment and storage medium | |
| CN115996371A (en) | Bluetooth connection method and device, electronic equipment and storage medium | |
| WO2024082906A1 (en) | Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium | |
| CN117479131A (en) | Bluetooth connection method, device, electronic device and computer-readable storage medium | |
| CN113472379A (en) | Intercommunication method, earphone box, earphone and storage medium | |
| CN113556830A (en) | Device connection method, device and wireless earphone | |
| WO2023246017A1 (en) | Bluetooth device configuration method and apparatus, and electronic device and storage medium | |
| CN116367125A (en) | Audio transmission method, device, terminal equipment and storage medium | |
| WO2023246045A1 (en) | Device connection method and apparatus, audio playing device and apparatus, and storage medium | |
| CN117319974A (en) | Bluetooth device configuration method, device, electronic device and storage medium | |
| CN116156470A (en) | Bluetooth connection back method and device, information storage method and device, terminal equipment |
| 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 |