CN114786139B - Connection establishment method, device, apparatus, storage medium, and program product - Google Patents
Connection establishment method, device, apparatus, storage medium, and program product Download PDFInfo
- Publication number
- CN114786139B CN114786139B CN202210188399.5A CN202210188399A CN114786139B CN 114786139 B CN114786139 B CN 114786139B CN 202210188399 A CN202210188399 A CN 202210188399A CN 114786139 B CN114786139 B CN 114786139B
- Authority
- CN
- China
- Prior art keywords
- audio
- audio device
- connection
- identification information
- equipment
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
- H04W4/08—User group management
-
- 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/14—Direct-mode setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/40—Connection management for selective distribution or broadcast
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Mobile Radio Communication Systems (AREA)
- Telephone Function (AREA)
Abstract
本申请实施例公开了一种连接建立方法、装置、设备、存储介质及程序产品,属于蓝牙技术领域。所述方法包括:接收第一音频设备发送的蓝牙广播消息;当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接。上述方案节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。
The embodiment of the present application discloses a connection establishment method, device, equipment, storage medium and program product, which belongs to the field of Bluetooth technology. The method includes: receiving a Bluetooth broadcast message sent by a first audio device; when the first audio device and the second audio device belong to the same device group, establishing an audio connection with the first audio device according to the attribute support information of the second audio device. The above scheme saves the process of querying the service to the first audio device, greatly shortens the time of establishing the audio connection, and improves the efficiency of establishing the audio connection.
Description
技术领域Technical Field
本申请实施例涉及蓝牙技术领域,特别涉及一种连接建立方法、装置、设备、存储介质及程序产品。The embodiments of the present application relate to the field of Bluetooth technology, and in particular to a connection establishment method, apparatus, device, storage medium and program product.
背景技术Background Art
随着蓝牙等短距离无线通信技术的不断发展,无线耳机等基于蓝牙的音频设备的应用也越来越广泛。With the continuous development of short-range wireless communication technologies such as Bluetooth, the application of Bluetooth-based audio devices such as wireless headphones is becoming more and more widespread.
在相关技术中,终端设备接收到音频设备发送的蓝牙广播消息后,可以向音频设备发起服务查询,以查询音频设备支持的属性,并根据服务查询的结果,与音频设备建立音频连接。In the related art, after receiving the Bluetooth broadcast message sent by the audio device, the terminal device can initiate a service query to the audio device to query the attributes supported by the audio device, and establish an audio connection with the audio device based on the result of the service query.
发明内容Summary of the invention
本申请实施例提供了一种连接建立方法、装置、设备、存储介质及程序产品。所述技术方案包括:The embodiments of the present application provide a connection establishment method, apparatus, device, storage medium and program product. The technical solution includes:
一方面,本申请实施例提供了一种连接建立方法,所述方法由终端设备执行,所述方法包括:On the one hand, an embodiment of the present application provides a connection establishment method, which is performed by a terminal device and includes:
接收第一音频设备发送的蓝牙广播消息;Receiving a Bluetooth broadcast message sent by a first audio device;
当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;When the first audio device and the second audio device belong to the same device group, establishing an audio connection with the first audio device according to the attribute support information of the second audio device;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。The second audio device is an audio device that the terminal device is connected to or determined to be connected to; and the attribute support information is used to indicate the services supported by the audio device.
一方面,本申请实施例提供了一种连接建立装置,所述装置包括:On the one hand, an embodiment of the present application provides a connection establishment device, the device comprising:
广播接收模块,用于接收第一音频设备发送的蓝牙广播消息;A broadcast receiving module, used for receiving a Bluetooth broadcast message sent by a first audio device;
连接建立模块,用于当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;a connection establishing module, configured to establish an audio connection with the first audio device according to the attribute support information of the second audio device when the first audio device and the second audio device belong to the same device group;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。The second audio device is an audio device that the terminal device is connected to or determined to be connected to; and the attribute support information is used to indicate the services supported by the audio device.
另一方面,本申请实施例提供了一种处理芯片,所述处理芯片用于执行如上所述的连接建立方法。On the other hand, an embodiment of the present application provides a processing chip, which is used to execute the connection establishment method as described above.
另一方面,本申请实施例提供了一种处理芯片,所述处理芯片中设置有如上所述的连接建立装置。On the other hand, an embodiment of the present application provides a processing chip, in which the connection establishing device as described above is provided.
另一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器,所述处理器和所述存储器之间通过总线相连;所述处理器执行所述存储器中存储的计算机指令,以使得所述计算机设备实现如上所述的连接建立方法。On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory, and the processor and the memory are connected via a bus; the processor executes computer instructions stored in the memory so that the computer device implements the connection establishment method as described above.
又一方面,本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机指令,所述计算机指令用于被处理器执行,以实现上述连接建立方法。On the other hand, an embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. The computer instructions are used to be executed by a processor to implement the above-mentioned connection establishment method.
又一方面,本申请提供了一种计算机程序产品,该计算机程序产品包括计算机指令,该计算机指令存储在计算机可读存储介质中。该计算机程序产品用于实现上述连接建立方法。In another aspect, the present application provides a computer program product, the computer program product comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. The computer program product is used to implement the above connection establishment method.
又一方面,本申请提供了一种计算机程序,该计算机程序由计算机设备的处理器执行,以实现上述连接建立方法。On the other hand, the present application provides a computer program, which is executed by a processor of a computer device to implement the above connection establishment method.
本申请实施例提供的技术方案至少包括如下有益效果:The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:
终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。When the terminal device receives the Bluetooth broadcast message sent by the first audio device, if an audio connection has been established with the second audio device, if the first audio device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, thereby saving the process of querying the service of the first audio device, greatly shortening the time of establishing the audio connection, and improving the efficiency of establishing the audio connection.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请一个示例性实施例提供的无线音频播放系统的系统架构图;FIG1 is a system architecture diagram of a wireless audio playback system provided by an exemplary embodiment of the present application;
图2是本申请涉及的RSI值的消息结构图;FIG2 is a message structure diagram of the RSI value involved in this application;
图3示出了本申请涉及的音频连接示意图;FIG3 shows a schematic diagram of an audio connection involved in the present application;
图4示出了本申请涉及的服务查询示意图;FIG4 shows a schematic diagram of a service query involved in the present application;
图5示出了本申请涉及的GATT结构示意图;FIG5 shows a schematic diagram of the GATT structure involved in this application;
图6示出了本申请一个示例性实施例提供的连接建立方法的流程图;FIG6 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application;
图7示出了本申请一个示例性实施例提供的连接建立方法的流程图;FIG7 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application;
图8示出了本申请一个示例性实施例提供的连接建立方法的流程图;FIG8 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application;
图9是图8所示实施例涉及的一种音频连接的流程图;FIG9 is a flow chart of an audio connection involved in the embodiment shown in FIG8 ;
图10示出了本申请一个示例性实施例提供的连接建立方法的流程图;FIG10 shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application;
图11是本申请一个示例性实施例提供的连接建立装置的结构示意图;FIG11 is a schematic diagram of the structure of a connection establishment device provided by an exemplary embodiment of the present application;
图12是本申请一个示例性实施例提供的计算机设备的结构示意图。FIG. 12 is a schematic diagram of the structure of a computer device provided by an exemplary embodiment of the present application.
具体实施方式DETAILED DESCRIPTION
为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。The term "multiple" as used herein refers to two or more than two. "And/or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the related objects are in an "or" relationship.
应理解,在本申请的实施例中提到的“指示”可以是直接指示,也可以是间接指示,还可以是表示具有关联关系。举例说明,A指示B,可以表示A直接指示B,例如B可以通过A获取;也可以表示A间接指示B,例如A指示C,B可以通过C获取;还可以表示A和B之间具有关联关系。It should be understood that the "indication" mentioned in the embodiments of the present application can be a direct indication, an indirect indication, or an indication of an association relationship. For example, A indicates B, which can mean that A directly indicates B, for example, B can be obtained through A; it can also mean that A indirectly indicates B, for example, A indicates C, B can be obtained through C; it can also mean that there is an association relationship between A and B.
在本申请实施例的描述中,术语“对应”可表示两者之间具有直接对应或间接对应的关系,也可以表示两者之间具有关联关系,也可以是指示与被指示、配置与被配置等关系。In the description of the embodiments of the present application, the term "corresponding" may indicate a direct or indirect correspondence between two items, or an association relationship between the two items, or a relationship between indication and being indicated, configuration and being configured, and the like.
本申请实施例中,“预定义”可以通过在设备(例如,包括终端设备和网络设备)中预先保存相应的代码、表格或其他可用于指示相关信息的方式来实现,本申请对于其具体的实现方式不做限定。比如预定义可以是指协议中定义的。In the embodiments of the present application, "pre-definition" can be implemented by pre-saving corresponding codes, tables or other methods that can be used to indicate relevant information in a device (for example, including a terminal device and a network device), and the present application does not limit the specific implementation method. For example, pre-definition can refer to what is defined in the protocol.
得益于蓝牙(Bluetooth,BT)等短距离无线通信技术的发展,无线耳机等基于蓝牙的音频设备也越来越多的被用户所接受,其实现形式也越来越多样化。比如,目前的无线耳机有真无线立体声(True Wireless Stereo,TWS)蓝牙耳机等等。Thanks to the development of short-range wireless communication technologies such as Bluetooth (BT), Bluetooth-based audio devices such as wireless headphones are increasingly accepted by users, and their implementation forms are becoming more and more diverse. For example, current wireless headphones include True Wireless Stereo (TWS) Bluetooth headphones, etc.
无线耳机等音频设备在使用时,需要与终端设备(即音源设备)建立基于蓝牙的无线音频连接,并播放终端设备推送的音频数据。在某些业务场景下,音频设备还可以向终端设备反馈用户操作,以及用户的语音数据等等。When using audio devices such as wireless headphones, they need to establish a Bluetooth-based wireless audio connection with the terminal device (i.e., the audio source device) and play the audio data pushed by the terminal device. In some business scenarios, the audio device can also feedback user operations and user voice data to the terminal device.
请参考图1,其示出了本申请一个示例性实施例提供的无线音频播放系统的系统架构图。如图1所示,该系统包括音频设备110以及终端设备120。Please refer to FIG1 , which shows a system architecture diagram of a wireless audio playback system provided by an exemplary embodiment of the present application. As shown in FIG1 , the system includes an audio device 110 and a terminal device 120 .
其中,音频设备110可以是蓝牙耳机、或者支持蓝牙协议的其它音频播放设备,比如蓝牙音箱等等。音频设备110也可以是支持蓝牙协议的计算机设备,例如,可以是智能手机、平板电脑、智能电视、以及个人电脑等等。The audio device 110 may be a Bluetooth headset or other audio playback device supporting the Bluetooth protocol, such as a Bluetooth speaker, etc. The audio device 110 may also be a computer device supporting the Bluetooth protocol, such as a smart phone, a tablet computer, a smart TV, a personal computer, etc.
音频设备110具有播放音频的功能,例如,音频设备110中设置有扬声器组件。The audio device 110 has a function of playing audio. For example, a speaker component is provided in the audio device 110 .
可选的,音频设备110还具有音频采集功能、操作接收功能等等。比如,音频设备110中还设置有拾音器/麦克风、操作按键、以及触摸传感器等等。Optionally, the audio device 110 also has an audio collection function, an operation receiving function, etc. For example, the audio device 110 is also provided with a pickup/microphone, an operation button, a touch sensor, etc.
终端设备120可以是支持蓝牙协议的计算机设备,例如,终端设备120可以是智能手机、平板电脑、智能电视、以及个人电脑等等。The terminal device 120 may be a computer device supporting the Bluetooth protocol, for example, the terminal device 120 may be a smart phone, a tablet computer, a smart TV, a personal computer, and the like.
终端设备120与音频设备110之间通过蓝牙协议建立连接后,终端设备120可以向音频设备110推送音频数据,由音频设备对该音频数据进行播放。After the terminal device 120 and the audio device 110 are connected via the Bluetooth protocol, the terminal device 120 can push audio data to the audio device 110, and the audio device plays the audio data.
可选的,音频设备110可以采集用户的语音(比如,在通话场景或者语音控制场景),获得用户的语音数据,并将语音数据回传给终端设备120。Optionally, the audio device 110 may collect the user's voice (for example, in a call scenario or a voice control scenario), obtain the user's voice data, and transmit the voice data back to the terminal device 120 .
可选的,音频设备110也可以在接收到对音频设备110中的操作按键或者触摸传感器的操作时,将操作信号传输给终端设备120,由终端设备120根据该操作信号执行相应的操作。Optionally, when receiving an operation on an operation button or a touch sensor in the audio device 110 , the audio device 110 may transmit an operation signal to the terminal device 120 , and the terminal device 120 may perform a corresponding operation according to the operation signal.
比如,在一些方案中,音频设备110可以根据接收到的用户操作,向终端设备120发送控制信息,以对终端设备120中与音频播放相关的功能进行控制,比如切换至上一首、切换至下一首、音量调节、接听/挂断电话等等。For example, in some scenarios, the audio device 110 can send control information to the terminal device 120 based on the received user operations to control the functions related to audio playback in the terminal device 120, such as switching to the previous song, switching to the next song, adjusting the volume, answering/hanging up the phone, etc.
蓝牙低功耗音频(Bluetooth Low Energy Audio,BLE-Audio,也称为LE-Audio),是蓝牙协议的一项新的音频传输技术,给人们带来更低功耗、更低成本、更高质量、以及更低延迟的无线音频服务,而TWS耳机是当下市场最火的蓝牙产品之一。Bluetooth Low Energy Audio (BLE-Audio, also known as LE-Audio) is a new audio transmission technology of the Bluetooth protocol, which brings people wireless audio services with lower power consumption, lower cost, higher quality, and lower latency. TWS headphones are one of the hottest Bluetooth products on the market.
BLE Audio提供了CSIP(Coordinated Set Identification Profile,协调集识别配置文件)协议,可以让属于同一个组合中的设备在与外部设备交互时,达成协调同步的目的。该协议中主要说明了外部设备如何将一个组合中的多个独立的设备识别为同一个组合。针对属于同一个组合中的多个设备,要想同时与外部设备一起使用的话,每一个设备都需要跟外部设备建立独立的BLE Audio连接,同时可以根据获取到的每个设备的组合标识信息,比如,组合标识解析值(Set Identity Resolving Key,SIRK)进行判断,将具有相同SIRK值的设备组成一个组合。BLE Audio provides the CSIP (Coordinated Set Identification Profile) protocol, which allows devices belonging to the same group to achieve coordination and synchronization when interacting with external devices. This protocol mainly describes how external devices can identify multiple independent devices in a group as the same group. For multiple devices belonging to the same group, if they are to be used with external devices at the same time, each device needs to establish an independent BLE Audio connection with the external device. At the same time, based on the obtained combination identification information of each device, such as the combination identification resolution value (Set Identity Resolving Key, SIRK), devices with the same SIRK value can be grouped into a group.
针对首次连接,支持BLE Audio的TWS耳机,在耳机开盖时,两只耳机会发送LEAudio广播,用户选择连接一只耳机时,手机(终端设备)先与该耳机1进行连接,以建立LEAudio连接,并获取该耳机的SIRK,此时,耳机1可以正常与手机之间进行语音数据的交互。手机在收到耳机2的LE Audio广播时,可以解析判断此耳机2与当前连接的耳机1是否属于相同的协调集(即是否属于相同的设备分组)。For the first connection, TWS earphones that support BLE Audio will send LE Audio broadcasts when the earphones are opened. When the user chooses to connect one earphone, the mobile phone (terminal device) first connects to earphone 1 to establish an LE Audio connection and obtain the SIRK of the earphone. At this time, earphone 1 can interact with the mobile phone for voice data. When the mobile phone receives the LE Audio broadcast from earphone 2, it can parse and determine whether earphone 2 and the currently connected earphone 1 belong to the same coordination set (that is, whether they belong to the same device group).
请参考图2,其示出了本申请涉及的RSI值的消息结构图。如图2所示,LE Audio广播消息中的RSI值包含hash值和prand字段,其中,prand字段包含随机部分和固定部分(即结尾的1和0)。hash值可以由SIRK和prand字段计算得到。Please refer to Figure 2, which shows the message structure diagram of the RSI value involved in this application. As shown in Figure 2, the RSI value in the LE Audio broadcast message includes a hash value and a prand field, where the prand field includes a random part and a fixed part (i.e., the 1 and 0 at the end). The hash value can be calculated from the SIRK and prand fields.
手机根据耳机1的SIRK,与耳机2的广播消息携带的RSI值中的prand字段,计算出一个hash值,然后将计算得到的hash值与耳机2的广播消息中的RSI值的hash字段比对,确定两者是否一致。若两者一致,则手机自动与另一只耳机2建立LE Audio连接。The phone calculates a hash value based on the SIRK of earphone 1 and the prand field in the RSI value carried in the broadcast message of earphone 2, and then compares the calculated hash value with the hash field of the RSI value in the broadcast message of earphone 2 to determine whether the two are consistent. If the two are consistent, the phone automatically establishes an LE Audio connection with the other earphone 2.
请参考图3,其示出了本申请涉及的音频连接示意图。如图3所示,手机与TWS耳机建立LE-Audio的过程可以如下:Please refer to Figure 3, which shows a schematic diagram of the audio connection involved in this application. As shown in Figure 3, the process of establishing LE-Audio between the mobile phone and the TWS headset can be as follows:
S31,TWS耳机中的耳机1和耳机2发送LE-Audio广播。S31, earphone 1 and earphone 2 in the TWS earphone send LE-Audio broadcast.
其中,TWS耳机的耳机盒打开之后,耳机1和耳机2将各自发送LE-Audio广播。Among them, after the earphone box of the TWS earphone is opened, earphone 1 and earphone 2 will each send LE-Audio broadcasts.
S32,手机打开蓝牙低功耗LE扫描后,扫描到耳机1发送的LE-Audio广播(广播1)。S32, after the mobile phone turns on the Bluetooth low energy LE scan, it scans the LE-Audio broadcast (broadcast 1) sent by earphone 1.
S33,用户点击连接耳机1,手机与耳机1之间建立LE连接,向耳机1发起服务查询,根据服务查询结果与耳机1建立LE-Audio连接。S33, the user clicks to connect to earphone 1, an LE connection is established between the mobile phone and earphone 1, a service query is initiated to earphone 1, and an LE-Audio connection is established with earphone 1 according to the service query result.
S34,手机向耳机1获取SIRK。S34, the mobile phone obtains SIRK from the headset 1.
S35,手机扫描到耳机2发送的LE-Audio广播(广播2)。S35, the mobile phone scans the LE-Audio broadcast (broadcast 2) sent by earphone 2.
S36,手机根据耳机1的SIRK以及广播2中的RSI值的prand字段计算hash值。S36, the mobile phone calculates a hash value according to the SIRK of earphone 1 and the prand field of the RSI value in broadcast 2.
S37,手机判断计算出hash值与广播2中的hash字段是否一致;若是,进入S38,否则结束。S37, the mobile phone determines whether the calculated hash value is consistent with the hash field in broadcast 2; if so, enter S38, otherwise end.
S38,手机与耳机2之间建立LE连接,向耳机2发起服务查询,根据服务查询结果与耳机2建立LE-Audio连接。S38, an LE connection is established between the mobile phone and the headset 2, a service query is initiated to the headset 2, and an LE-Audio connection is established with the headset 2 according to the service query result.
其中,上述步骤S36与后续的步骤S35至步骤S38之间的执行顺序并不限定,也就是说,步骤S36与步骤S35至步骤S38可以同步执行,也可以按照先后顺序执行。比如,手机在执行步骤S36的同时,还可以执行步骤S35至步骤S38。The execution order of the above step S36 and the subsequent steps S35 to S38 is not limited, that is, step S36 and steps S35 to S38 can be executed simultaneously or in a sequential order. For example, the mobile phone can execute steps S35 to S38 while executing step S36.
请参考图4,其示出了本申请涉及的服务查询示意图。如图4所示,上述服务查询的过程,是指客户端41(Client)向服务端42(Server)查询其支持的各项属性的过程。其中,在服务查询过程中,客户端41向服务端42发送ATT(Attribute,属性)请求/命令,服务端42向客户端41返回ATT响应,该ATT响应中包含服务端42支持的属性的相关信息。Please refer to Figure 4, which shows a schematic diagram of the service query involved in this application. As shown in Figure 4, the above service query process refers to the process in which the client 41 (Client) queries the server 42 (Server) for the various attributes it supports. Among them, during the service query process, the client 41 sends an ATT (Attribute) request/command to the server 42, and the server 42 returns an ATT response to the client 41, and the ATT response contains relevant information about the attributes supported by the server 42.
在LE-Audio协议中,服务查询的结果为通用属性协调集协议(Generic AttributeProfile,GATT)结构信息。请参考图5,其示出了本申请涉及的GATT结构示意图。In the LE-Audio protocol, the result of the service query is the Generic Attribute Profile (GATT) structure information. Please refer to FIG5 , which shows a schematic diagram of the GATT structure involved in the present application.
如图5所示,GATT结构信息指示服务端支持的一致多项服务(service),每项服务对应有自己的特征(characteristic)、描述(descriptor)等字段,在服务查询过程中,每一个字段都需要进行单独的ATT查询,因此,当service较多且其内容较复杂时,需要花费的ATT查询的时间将会很多。As shown in Figure 5, the GATT structure information indicates the consistent multiple services supported by the server. Each service has its own characteristic, descriptor and other fields. During the service query process, each field requires a separate ATT query. Therefore, when there are many services and their contents are complex, the ATT query will take a lot of time.
由于LE-Audio底层采用的是GATT协议的连接架构,无论是手机端还是耳机端支持的service都较多,因此,两边的服务查询流程耗时都较长,以目前LE-audio需要用到的协议为例,手机针对单个耳机的服务查询时间需要2~3秒钟左右,两只耳机的时间需要5~6s,导致首次LE-Audio的连接速度非常慢,影响用户体验。Since LE-Audio uses the GATT protocol connection architecture at the bottom layer, both the mobile phone and the headset support many services. Therefore, the service query process on both sides takes a long time. Taking the protocol currently required by LE-audio as an example, the service query time for a single headset by a mobile phone takes about 2 to 3 seconds, and 5 to 6 seconds for two headsets. As a result, the first LE-Audio connection speed is very slow, affecting the user experience.
请参考图6,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以用于终端设备中;其中,该终端设备可以是上述图1所示系统中的终端设备120。该方法可以包括如下步骤。Please refer to Figure 6, which shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application. The method can be used in a terminal device; wherein the terminal device can be the terminal device 120 in the system shown in Figure 1 above. The method can include the following steps.
步骤601,接收第一音频设备发送的蓝牙广播消息。Step 601: Receive a Bluetooth broadcast message sent by a first audio device.
在本申请实施例中,第一音频设备可以是图1所示系统中的音频设备110。In the embodiment of the present application, the first audio device may be the audio device 110 in the system shown in FIG. 1 .
其中,第一音频设备可以周期性的发送蓝牙广播消息,以便周围的终端设备可以发现该第一音频设备。The first audio device may periodically send a Bluetooth broadcast message so that surrounding terminal devices can discover the first audio device.
步骤602,当第一音频设备与第二音频设备属于同一设备分组时,根据第二音频设备的属性支持信息与第一音频设备建立音频连接;第二音频设备是终端设备已连接或确定连接的音频设备;属性支持信息用于指示音频设备支持的服务。Step 602: When the first audio device and the second audio device belong to the same device group, establish an audio connection with the first audio device according to attribute support information of the second audio device; the second audio device is an audio device that the terminal device has connected or is determined to be connected; the attribute support information is used to indicate the services supported by the audio device.
其中,第二音频设备是终端设备已连接的音频设备,可以是指终端设备已经与第二音频设备之间建立了音频连接或者底层连接。The second audio device is an audio device to which the terminal device is connected, which may mean that an audio connection or a bottom layer connection has been established between the terminal device and the second audio device.
上述第二音频设备是终端设备确定连接的音频设备,可以是指终端设备接收到与第二音频设备之间建立音频连接的指令,且终端尚未完成与第二音频设备之间的音频连接或者底层连接的建立。The second audio device is an audio device that the terminal device determines to connect to, which may mean that the terminal device receives an instruction to establish an audio connection with the second audio device, and the terminal has not yet completed the audio connection or the establishment of the underlying connection with the second audio device.
当第一音频设备和第二音频设备属于同一个设备分组时,比如,第一音频设备和第二音频设备组成一对TWS耳机时,第一音频设备和第二音频设备支持的属性类型是相同的,因此,在建立音频连接时,如果第二音频设备是终端设备已连接或确定连接的音频设备,则终端设备可以使用第二音频设备的属性支持信息来建立与第一音频设备之间的音频连接,不需要再通过服务查询的方式向第一音频设备查询其支持的属性,从而节省了对第一音频设备进行服务查询的步骤。When the first audio device and the second audio device belong to the same device group, for example, when the first audio device and the second audio device form a pair of TWS headphones, the attribute types supported by the first audio device and the second audio device are the same. Therefore, when establishing an audio connection, if the second audio device is an audio device that the terminal device is already connected or determined to be connected, the terminal device can use the attribute support information of the second audio device to establish an audio connection with the first audio device, and there is no need to query the first audio device for its supported attributes through service query, thereby saving the step of performing service query on the first audio device.
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。To summarize, through the scheme shown in the embodiment of the present application, when the terminal device receives the Bluetooth broadcast message sent by the first audio device, if an audio connection has been established with the second audio device, if the first audio device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, thereby saving the process of querying the service to the first audio device, greatly shortening the time of establishing the audio connection, and improving the efficiency of establishing the audio connection.
在上述6所示的方案的一种可能的实现方式中,终端设备可以获取第二音频设备的组合标识信息,并根据该第二音频设备的组合标识信息来确定第一音频设备和第二音频设备是否属于同一个设备分组。当根据该第二音频设备的组合标识信息确定第一音频设备和第二音频设备属于同一个设备分组时,即可以根据第二音频设备的属性支持信息与第一音频设备建立音频连接。In a possible implementation of the solution shown in 6 above, the terminal device may obtain the combination identification information of the second audio device, and determine whether the first audio device and the second audio device belong to the same device group according to the combination identification information of the second audio device. When it is determined that the first audio device and the second audio device belong to the same device group according to the combination identification information of the second audio device, an audio connection may be established with the first audio device according to the attribute support information of the second audio device.
基于上述图6所示的方案,请参考图7,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。以终端设备是手机,第一音频设备和第二音频设备是TWS蓝牙耳机,建立的连接为LE-Audio连接为例,该方法可以包括如下步骤。Based on the scheme shown in Figure 6 above, please refer to Figure 7, which shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application. Taking the terminal device as a mobile phone, the first audio device and the second audio device as TWS Bluetooth headsets, and the established connection as an LE-Audio connection as an example, the method may include the following steps.
步骤701,耳机开盖,耳机1和耳机2进配对后开始发送蓝牙低功耗广播。Step 701: The headset cover is opened, and headset 1 and headset 2 are paired and start sending Bluetooth low energy broadcasts.
步骤702,手机打开蓝牙,同时开启BLE扫描。Step 702: The mobile phone turns on Bluetooth and starts BLE scanning.
步骤703,手机首先扫描到耳机1发送的广播,与耳机1完成底层LE链路的连接。Step 703 , the mobile phone first scans the broadcast sent by earphone 1 and completes the connection of the underlying LE link with earphone 1 .
步骤704,手机向耳机1获取耳机1的SIRK;同时,手机对耳机1发起服务查询,根据服务查询得到的属性支持信息建立与耳机1之间的LE-Audio协议的连接。Step 704, the mobile phone obtains the SIRK of the headset 1 from the headset 1; at the same time, the mobile phone initiates a service query to the headset 1, and establishes a LE-Audio protocol connection with the headset 1 according to the attribute support information obtained from the service query.
步骤705,手机扫描到耳机2的广播,判断耳机2与耳机1属于同一个设备分组。Step 705: The mobile phone scans the broadcast of earphone 2 and determines that earphone 2 and earphone 1 belong to the same device group.
步骤706,手机根据向耳机1查询得到的属性支持信息,建立与耳机1之间的LE-Audio协议的连接。Step 706 : The mobile phone establishes an LE-Audio protocol connection with the headset 1 according to the attribute support information obtained from the headset 1 .
在上述步骤706中,手机不需要向耳机1发起服务查询。In the above step 706 , the mobile phone does not need to initiate a service query to the headset 1 .
在一些实施例中,在根据第二音频设备的组合标识信息确定第一音频设备与第二音频设备属于同一设备分组的过程中,终端设备在获取到第二音频设备的组合标识信息后,可以从第一音频设备获取该第一音频设备的组合标识信息,进而确定第一音频设备的组合标识信息与第二音频设备的组合标识信息是否相同,从而确定第一音频设备与第二音频设备是否属于同一设备分组。In some embodiments, in the process of determining that the first audio device and the second audio device belong to the same device group based on the combination identification information of the second audio device, after the terminal device obtains the combination identification information of the second audio device, it can obtain the combination identification information of the first audio device from the first audio device, and then determine whether the combination identification information of the first audio device is the same as the combination identification information of the second audio device, thereby determining whether the first audio device and the second audio device belong to the same device group.
请参考图8,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以由终端设备执行;其中,该终端设备可以是图1所示系统中的终端设备120。该方法可以包括如下步骤。Please refer to Figure 8, which shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application. The method may be executed by a terminal device; wherein the terminal device may be the terminal device 120 in the system shown in Figure 1. The method may include the following steps.
步骤801,终端设备接收第二音频设备发送的蓝牙广播消息。Step 801: The terminal device receives a Bluetooth broadcast message sent by a second audio device.
在本申请实施例中,终端设备打开蓝牙扫描功能后,可以接收周围的音频设备发送的蓝牙广播消息。In an embodiment of the present application, after the terminal device turns on the Bluetooth scanning function, it can receive Bluetooth broadcast messages sent by surrounding audio devices.
步骤802,终端设备执行与第二音频设备之间建立音频连接的流程。Step 802: The terminal device executes a process of establishing an audio connection with a second audio device.
可选的,终端设备接收到第二音频设备发送的蓝牙广播消息后,可以在蓝牙扫描界面上显示第二音频设备的信息,此时,若接收到用户对蓝牙扫描界面上显示的第二音频设备的选项的点击操作,则终端设备可以接收到与第二音频设备建立连接的指令,则终端设备可以执行与第二音频设备之间建立音频连接的流程。Optionally, after the terminal device receives the Bluetooth broadcast message sent by the second audio device, the information of the second audio device can be displayed on the Bluetooth scanning interface. At this time, if the user clicks on the option of the second audio device displayed on the Bluetooth scanning interface, the terminal device can receive an instruction to establish a connection with the second audio device, and the terminal device can execute the process of establishing an audio connection with the second audio device.
其中,上述终端设备与第二音频设备之间建立音频连接的流程可以包括如下子步骤:The process of establishing an audio connection between the terminal device and the second audio device may include the following sub-steps:
S802a,终端设备建立与第二音频设备之间的底层连接。S802a: The terminal device establishes a bottom layer connection with the second audio device.
以蓝牙低功耗场景为例,终端设备可以与第二音频设备之间建立底层LE连接,并通过底层LE连接与第二音频设备之间进行密钥协商,以实现链路层数据的加密。Taking the Bluetooth low energy scenario as an example, the terminal device can establish an underlying LE connection with the second audio device, and perform key negotiation with the second audio device through the underlying LE connection to achieve encryption of link layer data.
其中,上述底层LE连接建立以及链路层数据加密等步骤可以按照BLE标准中规定的方式执行。Among them, the above-mentioned steps such as establishing the underlying LE connection and encrypting the link layer data can be performed in the manner specified in the BLE standard.
S802b,终端设备向第二音频设备发起服务查询,获得第二音频设备的属性支持信息。S802b: The terminal device initiates a service query to the second audio device to obtain attribute support information of the second audio device.
其中,终端设备向第二音频设备发起的服务查询过程,可以查询第二音频设备支持哪些服务,以及第二音频设备支持的服务对应的能力/属性等信息。The service query process initiated by the terminal device to the second audio device may query which services the second audio device supports, and information such as capabilities/attributes corresponding to the services supported by the second audio device.
比如,终端设备可以向第二音频设备查询以下信息中的至少一种:For example, the terminal device may query the second audio device for at least one of the following information:
1)第二音频设备是否支持媒体播放功能;1) Whether the second audio device supports the media playback function;
2)第二音频设备是否支持通话功能;2) Whether the second audio device supports the call function;
3)第二音频设备是否支持操作控制;3) Whether the second audio device supports operation control;
4)第二音频设备支持哪些操作控制(比如,是否支持暂停播放操作、是否支持下一曲的切换操作、是否支持上一曲的切换操作等等);4) What operation controls does the second audio device support (for example, whether it supports the pause operation, whether it supports the next song switching operation, whether it supports the previous song switching operation, etc.);
5)第二音频设备的编码能力/编码方式;5) Coding capability/coding mode of the second audio device;
6)第二音频设备使用的编码参数。6) Encoding parameters used by the second audio device.
其中,在上终端设备对第二音频设备发起服务查询时,终端设备可以向第二音频设备发送服务查询指令,第二音频设备接收到该服务查询指令后,可以向终端设备返回其支持的服务的相关信息。When the upper terminal device initiates a service query to the second audio device, the terminal device may send a service query instruction to the second audio device. After receiving the service query instruction, the second audio device may return relevant information of the services it supports to the terminal device.
其中,上述服务查询的过程可以按照BLE标准(例如LE Audio协议的相关标准)中规定的方式执行。查询到的属性支持信息的信息结构可以参考上述图5所示的结构。The service query process may be performed in accordance with the method specified in the BLE standard (eg, the relevant standard of the LE Audio protocol). The information structure of the queried attribute support information may refer to the structure shown in FIG. 5 .
S802c,终端设备根据第二音频设备的属性支持信息,与第二音频设备之间建立音频连接。S802c: The terminal device establishes an audio connection with the second audio device according to the attribute support information of the second audio device.
终端设备与第二音频设备之间建立音频连接时,可以根据步骤802b中查询到的,与第二音频设备支持的服务相关的信息发送音频连接建立请求。When establishing an audio connection between the terminal device and the second audio device, an audio connection establishment request may be sent according to the information related to the service supported by the second audio device queried in step 802b.
比如,终端设备在完成对第二音频设备的服务查询之后,可以向第二音频设备发送用于配置音频连接的指令,比如ATT协议(Attribute Protocol,属性协议)写指令,该ATT写指令用于在音频设备中写入第二音频连接的相关配置信息,以完成音频连接的例。相应的,第二音频设备接收到该ATT写指令之后,根据ATT写指令中的相关配置信息来执行对音频连接的配置。For example, after completing the service query for the second audio device, the terminal device can send an instruction for configuring the audio connection to the second audio device, such as an ATT protocol (Attribute Protocol) write instruction, and the ATT write instruction is used to write the relevant configuration information of the second audio connection in the audio device to complete the example of the audio connection. Correspondingly, after receiving the ATT write instruction, the second audio device performs the configuration of the audio connection according to the relevant configuration information in the ATT write instruction.
其中,上述音频连接的建立过程可以按照BLE标准(例如LE Audio协议的相关标准)中规定的音频连接建立方式来执行。The audio connection establishment process may be performed in accordance with an audio connection establishment method specified in a BLE standard (eg, a standard related to the LE Audio protocol).
此外,终端设备与第二音频设备之间建立音频连接的流程还可以包括:In addition, the process of establishing an audio connection between the terminal device and the second audio device may also include:
S802d,终端设备向第二音频设备发起标识查询,获得第二音频设备的组合标识信息。S802d: The terminal device initiates an identification query to the second audio device to obtain the combined identification information of the second audio device.
在本申请实施例中,在建立与第二音频设备之间的底层连接后,终端设备还可以向第二音频设备查询其组合标识信息。In the embodiment of the present application, after establishing the underlying connection with the second audio device, the terminal device may also query the second audio device for its combined identification information.
比如,以BLE协议为例,上述底层连接为底层LE连接时,上述组合标识信息可以是SIRK。For example, taking the BLE protocol as an example, when the underlying connection is an underlying LE connection, the combined identification information may be SIRK.
步骤803,终端设备接收第一音频设备发送的蓝牙广播消息。Step 803: The terminal device receives the Bluetooth broadcast message sent by the first audio device.
其中,上述第一音频设备是第二音频设备之外的另一个蓝牙设备。在本申请实施例中,终端设备接收到第一音频设备发送的蓝牙广播消息,且确定该蓝牙广播消息的发送方不是第二音频设备时,可以执行后续步骤。The first audio device is another Bluetooth device other than the second audio device. In the embodiment of the present application, when the terminal device receives a Bluetooth broadcast message sent by the first audio device and determines that the sender of the Bluetooth broadcast message is not the second audio device, subsequent steps may be performed.
步骤804,终端设备获取第二音频设备的组合标识信息。Step 804: The terminal device obtains the combination identification information of the second audio device.
在本申请实施例中,步骤804可以在步骤802之后执行,也可以在步骤802执行的过程中执行。在步骤804执行时,终端设备已经与第二音频设备之间建立了底层连接或者音频连接;或者,在步骤804时,终端设备已经接收到了与第二音频设备进行连接的指令。也就是说,此时终端设备已连接或确定连接上述第二音频设备。In the embodiment of the present application, step 804 may be performed after step 802, or may be performed during the execution of step 802. When step 804 is performed, the terminal device has established a bottom layer connection or an audio connection with the second audio device; or, when step 804 is performed, the terminal device has received an instruction to connect to the second audio device. That is, at this time, the terminal device has been connected or determined to be connected to the second audio device.
在一种可能的实现方式中,当终端设备已经向第二音频设备查询到第二音频设备的组合标识信息(比如按照上述S802d的流程查询到第二音频设备的组合标识信息)时,在步骤804中,可以直接从本地读取查询到第二音频设备的组合标识信息。In a possible implementation, when the terminal device has queried the combination identification information of the second audio device from the second audio device (for example, the combination identification information of the second audio device is queried according to the above-mentioned process S802d), in step 804, the combination identification information of the second audio device can be directly read and queried locally.
在另一种可能的实现方式中,当终端设备尚未向第二音频设备查询到第二音频设备的组合标识信息时,在步骤804中,终端设备可以按照上述S802d的流程,向第二音频设备查询其组合标识信息。此时,步骤804与上述S802d为同一个步骤。In another possible implementation, when the terminal device has not queried the second audio device for the combination identification information of the second audio device, in step 804, the terminal device may query the second audio device for its combination identification information according to the above process of S802d. In this case, step 804 is the same as the above step S802d.
步骤805,终端设备获取第一音频设备的组合标识信息。Step 805: The terminal device obtains the combination identification information of the first audio device.
在本申请实施例中,终端设备可以向第一音频设备查询该第一音频设备的组合标识信息。In the embodiment of the present application, the terminal device may query the first audio device for the combination identification information of the first audio device.
比如,终端设备可以建立与第一音频设备之间的底层连接,并通过与第一音频设备之间的底层连接,向第一音频设备查询其组合标识信息。For example, the terminal device may establish an underlying connection with the first audio device, and query the first audio device for its combination identification information through the underlying connection with the first audio device.
在一种可能的实现方式中,第一音频设备发送的蓝牙广播消息中包含第一哈希字段;In a possible implementation manner, the Bluetooth broadcast message sent by the first audio device includes a first hash field;
在获取第一音频设备的组合标识信息之前,终端设备可以根据第二音频设备的组合标识信息生成第二哈希字段;当第一哈希字段与第二哈希字段相同时,建立与第一音频设备之间的底层连接。Before acquiring the combined identification information of the first audio device, the terminal device may generate a second hash field according to the combined identification information of the second audio device; when the first hash field is the same as the second hash field, an underlying connection with the first audio device is established.
以BLE协议为例,在本申请实施例中,第一音频设备发送的蓝牙广播消息的RSI值中包含第一哈希字段以及prand字段,终端设备可以提取第一音频设备发送的蓝牙广播消息中的第一哈希字段以及prand字段,根据提取到的prand字段和第二音频设备的SIRK做哈希计算,得到第二哈希字段,当比对确定第一哈希字段与第二哈希字段相同时,终端设备可以建立与第一音频设备之间的底层连接。Taking the BLE protocol as an example, in an embodiment of the present application, the RSI value of the Bluetooth broadcast message sent by the first audio device includes a first hash field and a prand field. The terminal device can extract the first hash field and the prand field in the Bluetooth broadcast message sent by the first audio device, and perform a hash calculation based on the extracted prand field and the SIRK of the second audio device to obtain the second hash field. When the comparison determines that the first hash field is the same as the second hash field, the terminal device can establish a bottom-level connection with the first audio device.
步骤806,当第一音频设备的组合标识信息与第二音频设备的组合标识信息相同时,终端设备确定第一音频设备与第二音频设备属于同一设备分组。Step 806: When the combination identification information of the first audio device is the same as the combination identification information of the second audio device, the terminal device determines that the first audio device and the second audio device belong to the same device group.
在本申请实施例中,终端设备通过与第一音频设备之间的底层连接获取到第一音频设备的组合标识信息之后,将其与第二音频设备的组合标识信息进行比对,若两者一致,则第一音频设备的组合标识信息与第二音频设备的组合标识信息匹配,即认为第一音频设备与第二音频设备属于同一设备分组。In an embodiment of the present application, after the terminal device obtains the combination identification information of the first audio device through the underlying connection between the terminal device and the first audio device, it compares it with the combination identification information of the second audio device. If the two are consistent, the combination identification information of the first audio device matches the combination identification information of the second audio device, that is, the first audio device and the second audio device are considered to belong to the same device group.
步骤807,当第一音频设备与第二音频设备属于同一设备分组时,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接。Step 807: When the first audio device and the second audio device belong to the same device group, the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device.
在一种可能的实现方式中,当第一音频设备与第二音频设备属于同一设备分组时,根据第二音频设备的属性支持信息与第一音频设备建立音频连接,包括:In a possible implementation, when the first audio device and the second audio device belong to the same device group, establishing an audio connection with the first audio device according to the attribute support information of the second audio device includes:
当第一音频设备与第二音频设备属于同一设备分组时,将第二音频设备的属性支持信息获取为第一音频设备的属性支持信息;When the first audio device and the second audio device belong to the same device group, acquiring the attribute support information of the second audio device as the attribute support information of the first audio device;
根据第一音频设备的属性支持信息,与第一音频设备建立音频连接。An audio connection is established with the first audio device according to the attribute support information of the first audio device.
在本申请实施例中,当终端设备确定第一音频设备与第二音频设备属于同一设备分组时,可以认为第一音频设备与第二音频设备是同一套音频设备,比如同一副TWS耳机,可以认为两者的属性支持信息(比如上述GATT结构信息)也是相同的,此时,终端设备可以直接使用第二音频设备的组合标识信息与第一音频设备建立音频连接,不需要再向第一音频设备查询属性支持信息。In an embodiment of the present application, when the terminal device determines that the first audio device and the second audio device belong to the same device group, it can be considered that the first audio device and the second audio device are the same set of audio devices, such as the same pair of TWS headphones, and the attribute support information of the two (such as the above-mentioned GATT structure information) can be considered to be the same. At this time, the terminal device can directly use the combination identification information of the second audio device to establish an audio connection with the first audio device, and there is no need to query the first audio device for attribute support information.
在一种可能的实现方式中,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接之前,还可以将第二音频设备的属性支持信息,复用为第一音频设备的属性支持信息。In a possible implementation, before the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device, the terminal device may further multiplex the attribute support information of the second audio device as the attribute support information of the first audio device.
比如,在一个示例性的方案中,终端设备在确定上述第一哈希字段与第二哈希字段相同之后,或者,在建立与第一音频设备之间的底层连接之后,即可以将第二音频设备的属性支持信息,暂时复用为第一音频设备的属性支持信息。For example, in an exemplary scheme, after the terminal device determines that the first hash field is the same as the second hash field, or after establishing the underlying connection with the first audio device, the attribute support information of the second audio device can be temporarily multiplexed as the attribute support information of the first audio device.
再比如,在另一个示例性的方案中,终端设备在确定第一音频设备与第二音频设备属于同一设备分组后,将第二音频设备的属性支持信息,复用为第一音频设备的属性支持信息。For another example, in another exemplary solution, after determining that the first audio device and the second audio device belong to the same device group, the terminal device multiplexes the attribute support information of the second audio device as the attribute support information of the first audio device.
在本申请实施例中,当属性支持信息包括GATT结构信息时,终端设备将第二音频设备的属性支持信息复用为第一音频设备的属性支持信息之后,除了根据该属性支持信息与第一音频设备建立音频连接之外,还可以进一步读取GATT结构信息中的各字段对应的参数值。对于第一音频设备和第二音频设备来说,当两者属于同一设备分组时,两者的GATT结构信息虽然相同,但是两者的GATT结构信息中的字段对应的参数值可能是不同的。In an embodiment of the present application, when the attribute support information includes GATT structure information, after the terminal device multiplexes the attribute support information of the second audio device as the attribute support information of the first audio device, in addition to establishing an audio connection with the first audio device according to the attribute support information, the terminal device can further read the parameter values corresponding to each field in the GATT structure information. For the first audio device and the second audio device, when the two belong to the same device group, although the GATT structure information of the two is the same, the parameter values corresponding to the fields in the GATT structure information of the two may be different.
步骤808,当第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,终端设备通过底层连接,向第一音频设备发起服务查询,获得第一音频设备的属性支持信息。Step 808: When the combination identification information of the first audio device is different from the combination identification information of the second audio device, the terminal device initiates a service query to the first audio device through the bottom layer connection to obtain the attribute support information of the first audio device.
在本申请实施例中,若第一音频设备的组合标识信息与第二音频设备的组合标识信息不同,则终端设备可以认为第一音频设备与第二音频设备不是同一套音频设备,两者的属性支持信息可能不同,此时,终端设备可以向第一音频设备发起服务查询。In an embodiment of the present application, if the combination identification information of the first audio device is different from the combination identification information of the second audio device, the terminal device may consider that the first audio device and the second audio device are not the same set of audio devices, and the attribute support information of the two may be different. At this time, the terminal device may initiate a service query to the first audio device.
步骤809,终端设备根据第一音频设备的属性支持信息,与第一音频设备建立音频连接。Step 809: The terminal device establishes an audio connection with the first audio device according to the attribute support information of the first audio device.
其中,在BLE协议场景下,上述蓝牙广播消息可以为蓝牙低功耗LE广播消息,上述音频连接可以为蓝牙低功耗LE音频连接。Among them, in the BLE protocol scenario, the above-mentioned Bluetooth broadcast message can be a Bluetooth low energy LE broadcast message, and the above-mentioned audio connection can be a Bluetooth low energy LE audio connection.
其中,上述第一音频设备和第二音频设备可以为真无线立体声TWS耳机。Among them, the first audio device and the second audio device mentioned above can be true wireless stereo TWS headphones.
请参考图9,其示出了本申请实施例涉及的一种音频连接的流程图。如图9所示,以BLE协议场景下,终端设备是手机,第一音频设备和第二音频设备是一副耳机为例,该音频连接的流程可以如下:Please refer to Figure 9, which shows a flow chart of an audio connection involved in an embodiment of the present application. As shown in Figure 9, in a BLE protocol scenario, the terminal device is a mobile phone, and the first audio device and the second audio device are a pair of headphones. For example, the process of the audio connection can be as follows:
S901,耳机开盖,耳机1和耳机2进配对后开始发送蓝牙低功耗广播。S901, the headset cover is opened, and headset 1 and headset 2 start sending Bluetooth low energy broadcasts after pairing.
S902,手机打开蓝牙,同时开启BLE扫描。S902, turn on Bluetooth on your phone and start BLE scanning at the same time.
S903,手机首先扫描到耳机1发送的广播1,与耳机1完成底层LE链路的连接。S903, the mobile phone first scans the broadcast 1 sent by the headset 1, and completes the connection of the underlying LE link with the headset 1.
S904,手机向耳机1获取耳机1的SIRK1;同时,手机对耳机1发起服务查询,根据服务查询得到的GATT结构建立与耳机1之间的LE-Audio协议的连接。S904, the mobile phone obtains SIRK1 of earphone 1 from earphone 1; at the same time, the mobile phone initiates a service query to earphone 1, and establishes an LE-Audio protocol connection with earphone 1 according to the GATT structure obtained from the service query.
S905,手机扫描到耳机2的广播2,根据SIRK1与广播2中的信息计算哈希值。S905, the mobile phone scans Broadcast 2 of earphone 2 and calculates a hash value based on SIRK1 and the information in Broadcast 2.
S906,手机判断计算得到的哈希值与广播2中的哈希字段是否相同;若是,进入S907,否则结束。S906, the mobile phone determines whether the calculated hash value is the same as the hash field in broadcast 2; if so, proceed to S907, otherwise end.
S907,手机与耳机2完成底层LE链路的连接。S907: The mobile phone and the headset 2 complete the connection of the underlying LE link.
S908,暂时复用耳机1的GATT结构,作为耳机2的GATT结构。S908: Temporarily reuse the GATT structure of earphone 1 as the GATT structure of earphone 2.
S909,手机向耳机2获取耳机2的SIRK2。S909: The mobile phone obtains SIRK2 of earphone 2 from earphone 2.
S910,手机判断SIRK1与SIRK2是否一致;若是,进入S911,否则,进入S912。S910, the mobile phone determines whether SIRK1 is consistent with SIRK2; if so, it proceeds to S911, otherwise, it proceeds to S912.
S911,使用复用的耳机1的GATT结构,与耳机2建立LE-Audio协议的连接。S911, use the reused GATT structure of earphone 1 to establish an LE-Audio protocol connection with earphone 2.
S912,对耳机1发起服务查询;根据服务查询得到的GATT结构建立与耳机2之间的LE-Audio协议的连接。S912, initiate a service query for earphone 1; and establish an LE-Audio protocol connection with earphone 2 according to the GATT structure obtained from the service query.
在上述图9所示的方案中,当手机解析到耳机2的广播中的哈希字段与广播内容计算出来的hash值一致时,手机发起对耳机2的LE连接。In the solution shown in FIG. 9 , when the mobile phone parses the hash field in the broadcast of the headset 2 and finds that the hash value calculated from the broadcast content is consistent, the mobile phone initiates an LE connection to the headset 2 .
由于耳机1和耳机2代码是同一套代码,只是两种初始化的角色不同,因此两者的GATT结构是相同的,也可以变相认为是同一个设备,只是两者之间可能一些属性值不同,比如左耳耳机在与手机的协议连接阶段会配置接收左声道数据,右耳耳机会配置接收左声道数据。因此,对于手机来说没有必要针对耳机2再做一遍服务发现及查询的过程。在本申请实施例中,当手机主动发起对耳机2的LE连接时,手机先暂时复用耳机1的GATT结构给耳机2,同时进行对耳机2的SIRK读取步骤。Since the codes of earphone 1 and earphone 2 are the same set of codes, but the two initialization roles are different, the GATT structures of the two are the same, and they can also be regarded as the same device in disguise, but some attribute values may be different between the two. For example, the left earphone will be configured to receive left channel data during the protocol connection stage with the mobile phone, and the right earphone will be configured to receive left channel data. Therefore, it is not necessary for the mobile phone to perform the service discovery and query process for earphone 2 again. In an embodiment of the present application, when the mobile phone actively initiates an LE connection to earphone 2, the mobile phone temporarily reuses the GATT structure of earphone 1 to earphone 2, and performs the SIRK reading step for earphone 2 at the same time.
由于上述方案中,手机通过底层LE连接查询耳机的SIRK,因此,SIRK可以采取加密的方式进行传输,即查询到的SIRK是基于底层LE连接且经过加密得到的SIRK,其是唯一且安全的。当手机获取到SIRK2后,手机将耳机1与耳机2的SIRK进行对比,如果发现一致,说明这两耳机是一对,因为通常情况下,SIRK是产品出厂固化的,只有是匹配成对的耳机才拥有相同的SIRK。至此,手机将直接复用耳机1的GATT结构给耳机2,省去针对耳机2的服务查询过程,随后发起对耳机2的LE-Audio协议连接。Since in the above scheme, the mobile phone queries the SIRK of the headset through the underlying LE connection, the SIRK can be transmitted in an encrypted manner, that is, the queried SIRK is based on the underlying LE connection and is encrypted, which is unique and secure. When the mobile phone obtains SIRK2, the mobile phone compares the SIRK of headset 1 with that of headset 2. If they are consistent, it means that the two headsets are a pair, because usually, the SIRK is fixed when the product leaves the factory, and only matched pairs of headsets have the same SIRK. At this point, the mobile phone will directly reuse the GATT structure of headset 1 for headset 2, eliminating the service query process for headset 2, and then initiate an LE-Audio protocol connection to headset 2.
如果手机发现SIRK1与SIRK2不一致,则说明耳机2并非与耳机1一对,有可能是外部设备盗用耳机1的广播内容进行伪造,此时手机不会将耳机1与耳机2认为是一副设备。而手机也需要单独针对耳机2进行完整的服务查询以及LE-audio协议的连接。If the phone finds that SIRK1 and SIRK2 are inconsistent, it means that earphone 2 is not a pair with earphone 1. It is possible that an external device has stolen the broadcast content of earphone 1 to forge it. At this time, the phone will not regard earphone 1 and earphone 2 as a pair of devices. The phone also needs to perform a complete service query and LE-audio protocol connection for earphone 2 separately.
通过本申请上述方案,一方面,在保证安全的情况下,手机通过复用耳机1的GATT结构,从而省去手机针对耳机2的服务查询环节,进而节省出2~3s的连接时间。并且,如果外围设备数量更多,即多个外部设备组成一个Group并且都支持CSIP协议时,通过此方案可以节省出更多的连接时间。Through the above solution of the present application, on the one hand, while ensuring safety, the mobile phone reuses the GATT structure of earphone 1, thereby eliminating the service query link for earphone 2, thereby saving 2 to 3 seconds of connection time. In addition, if there are more peripheral devices, that is, multiple external devices form a group and all support the CSIP protocol, this solution can save more connection time.
另一方面,增加了SIRK的判断环节,而不是简单地通过耳机2广播字段的解析来判断耳机2和耳机1为一对设备,因为广播内容容易被外部设备所伪造,即第三方设备盗用耳机1的广播内容进行LE广播,使手机误认为该三方设备和耳机1为一组设备而直接复用其GATT结构,但其实该三方设备的GATT结构和耳机1并不相同,最终会导致手机与该三方设备无法正常进行工作,同时也存在通信安全等风险。通过对SIRK的判断,可以对两个设备是否会一副设备进行深层次的判断,保证其安全性。On the other hand, the SIRK judgment link is added, instead of simply judging that earphone 2 and earphone 1 are a pair of devices by parsing the broadcast field of earphone 2, because the broadcast content can be easily forged by external devices, that is, a third-party device steals the broadcast content of earphone 1 for LE broadcast, making the mobile phone mistakenly believe that the three-party device and earphone 1 are a group of devices and directly reuse their GATT structure. However, in fact, the GATT structure of the three-party device is different from that of earphone 1, which will eventually cause the mobile phone and the three-party device to not work properly, and there are also risks such as communication security. By judging SIRK, it is possible to make a deep judgment on whether the two devices are a pair of devices to ensure their security.
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。To summarize, through the scheme shown in the embodiment of the present application, when the terminal device receives the Bluetooth broadcast message sent by the first audio device, if an audio connection has been established with the second audio device, if the first audio device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, thereby saving the process of querying the service to the first audio device, greatly shortening the time of establishing the audio connection, and improving the efficiency of establishing the audio connection.
在另一些实施例中,在根据第二音频设备的组合标识信息确定第一音频设备与第二音频设备属于同一设备分组时,终端设备在获取到第二音频设备的组合标识信息后,通过第一音频设备发送的蓝牙广播消息,即可以确定第一音频设备与第二音频设备是否属于同一设备分组。In other embodiments, when it is determined that the first audio device and the second audio device belong to the same device group based on the combination identification information of the second audio device, after the terminal device obtains the combination identification information of the second audio device, it can determine whether the first audio device and the second audio device belong to the same device group through the Bluetooth broadcast message sent by the first audio device.
请参考图10,其示出了本申请一个示例性实施例提供的连接建立方法的流程图。该方法可以由终端设备和音频设备交互执行;其中,该音频设备可以是上述图1所示系统中的音频设备110,该终端设备可以是图1所示系统中的终端设备120。该方法可以包括如下步骤。Please refer to Figure 10, which shows a flow chart of a connection establishment method provided by an exemplary embodiment of the present application. The method can be interactively executed by a terminal device and an audio device; wherein the audio device can be the audio device 110 in the system shown in Figure 1 above, and the terminal device can be the terminal device 120 in the system shown in Figure 1. The method can include the following steps.
步骤1001,终端设备接收第二音频设备发送的蓝牙广播消息。Step 1001: The terminal device receives a Bluetooth broadcast message sent by a second audio device.
步骤1002,终端设备执行与第二音频设备之间建立音频连接的流程。Step 1002: The terminal device executes a process of establishing an audio connection with a second audio device.
步骤1003,终端设备接收第一音频设备发送的蓝牙广播消息。Step 1003: The terminal device receives a Bluetooth broadcast message sent by the first audio device.
步骤1004,终端设备获取第二音频设备的组合标识信息。Step 1004: The terminal device obtains the combination identification information of the second audio device.
其中,上述步骤1001至步骤1004的执行过程,与图8所示实施例中的步骤801至步骤804的执行过程类似,此处不再赘述。The execution process of the above steps 1001 to 1004 is similar to the execution process of steps 801 to 804 in the embodiment shown in FIG. 8 , and will not be described in detail here.
步骤1005,终端设备根据第二音频设备的组合标识信息生成第二哈希字段。Step 1005: The terminal device generates a second hash field according to the combined identification information of the second audio device.
步骤1006,当第一哈希字段与第一音频设备发送的蓝牙广播消息中的第二哈希字段相同时,确定第一音频设备与第二音频设备属于同一设备分组。Step 1006: When the first hash field is the same as the second hash field in the Bluetooth broadcast message sent by the first audio device, it is determined that the first audio device and the second audio device belong to the same device group.
在本申请实施例中,上述第二哈希字段的计算方式可以参考上述图8所示实施例中的描述,此处不再赘述。In the embodiment of the present application, the calculation method of the above-mentioned second hash field can refer to the description in the embodiment shown in the above-mentioned Figure 8, and will not be repeated here.
步骤1007,当第一音频设备与第二音频设备属于同一设备分组时,终端设备根据第二音频设备的属性支持信息与第一音频设备建立音频连接。Step 1007: When the first audio device and the second audio device belong to the same device group, the terminal device establishes an audio connection with the first audio device according to the attribute support information of the second audio device.
在本申请实施例中,终端设备在根据第一广播消息和第二音频设备的组合标识信息,确定出第一音频设备与第二音频设备属于同一设备分组后,可以直接根据第二音频设备的属性支持信息与第一音频设备建立音频连接,不需要再进行组合标识信息的直接比对,从而进一步缩短了音频连接的时长。In an embodiment of the present application, after the terminal device determines that the first audio device and the second audio device belong to the same device group based on the combined identification information of the first broadcast message and the second audio device, it can directly establish an audio connection with the first audio device based on the attribute support information of the second audio device, without the need to directly compare the combined identification information, thereby further shortening the duration of the audio connection.
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。To summarize, through the scheme shown in the embodiment of the present application, when the terminal device receives the Bluetooth broadcast message sent by the first audio device, if an audio connection has been established with the second audio device, if the first audio device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, thereby saving the process of querying the service to the first audio device, greatly shortening the time of establishing the audio connection, and improving the efficiency of establishing the audio connection.
请参考图11,其示出了本申请一个示例性实施例提供的在连接建立装置的结构示意图。该连接建立装置1100可以用于执行如上述图6或图8所示的实施例中,由终端设备执行的全部或者部分步骤;该装置包括:Please refer to Figure 11, which shows a schematic diagram of the structure of a connection establishment device provided by an exemplary embodiment of the present application. The connection establishment device 1100 can be used to execute all or part of the steps executed by the terminal device in the embodiment shown in Figure 6 or Figure 8 above; the device includes:
广播接收模块1101,用于接收第一音频设备发送的蓝牙广播消息;The broadcast receiving module 1101 is used to receive a Bluetooth broadcast message sent by a first audio device;
连接建立模块1102,用于当所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;A connection establishing module 1102, configured to establish an audio connection with the first audio device according to attribute support information of the second audio device when the first audio device and the second audio device belong to the same device group;
其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。The second audio device is an audio device that the terminal device is connected to or determined to be connected to; and the attribute support information is used to indicate the services supported by the audio device.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第一标识信息获取模块,用于在所述连接建立模块根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第二音频设备的组合标识信息;所述组合标识用于指示音频设备所属的设备分组;A first identification information acquisition module, configured to acquire the combined identification information of the second audio device before the connection establishment module establishes an audio connection with the first audio device according to the attribute support information of the second audio device; the combined identification is used to indicate the device group to which the audio device belongs;
所述连接建立模块1102,用于当根据所述第二音频设备的组合标识信息确定所述第一音频设备与所述第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接。The connection establishing module 1102 is configured to establish an audio connection with the first audio device according to the attribute support information of the second audio device when it is determined that the first audio device and the second audio device belong to the same device group according to the combination identification information of the second audio device.
在一种可能的实现方式中,所述蓝牙广播消息中包含第一哈希字段;In a possible implementation manner, the Bluetooth broadcast message includes a first hash field;
所述装置还包括:The device also includes:
第一字段生成模块,用于在所述连接建立模块1102根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;A first field generating module, configured to generate a second Hash field according to the combined identification information of the second audio device before the connection establishing module 1102 establishes an audio connection with the first audio device according to the attribute support information of the second audio device;
第一确定模块,用于当所述第一哈希字段与所述第二哈希字段相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。The first determining module is configured to determine that the first audio device and the second audio device belong to the same device group when the first hash field is the same as the second hash field.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
第一标识信息获取模块,用于在所述连接建立模块1102根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接之前,获取所述第一音频设备的组合标识信息;A first identification information acquisition module, configured to acquire the combined identification information of the first audio device before the connection establishment module 1102 establishes an audio connection with the first audio device according to the attribute support information of the second audio device;
第二确定模块,用于当所述第一音频设备的组合标识信息与所述第二音频设备的组合标识信息相同时,确定所述第一音频设备与所述第二音频设备属于同一设备分组。The second determining module is configured to determine that the first audio device and the second audio device belong to the same device group when the combination identification information of the first audio device is the same as the combination identification information of the second audio device.
在一种可能的实现方式中,所述蓝牙广播消息中包含第一哈希字段;In a possible implementation manner, the Bluetooth broadcast message includes a first hash field;
所述装置还包括:The device also includes:
第一字段生成模块,用于在所述第一标识信息获取模块获取所述第一音频设备的组合标识信息之前,根据所述第二音频设备的组合标识信息生成第二哈希字段;A first field generating module, configured to generate a second Hash field according to the combined identification information of the second audio device before the first identification information acquiring module acquires the combined identification information of the first audio device;
连接建立模块1102,还用于当所述第一哈希字段与所述第二哈希字段相同时,建立与所述第一音频设备之间的底层连接。The connection establishing module 1102 is further configured to establish a bottom layer connection with the first audio device when the first hash field is the same as the second hash field.
在一种可能的实现方式中,所述第一标识信息获取模块,用于通过所述底层连接,向所述第一音频设备获取所述第一音频设备的组合标识信息。In a possible implementation manner, the first identification information acquisition module is configured to acquire the combined identification information of the first audio device from the first audio device through the underlying connection.
在一种可能的实现方式中,所述装置还包括:In a possible implementation manner, the device further includes:
服务查询模块,用于当所述第一音频设备的组合标识信息与第二音频设备的组合标识信息不同时,通过所述底层连接,向所述第一音频设备发起服务查询,获得所述第一音频设备的属性支持信息;a service query module, configured to initiate a service query to the first audio device through the underlying connection to obtain attribute support information of the first audio device when the combination identification information of the first audio device is different from the combination identification information of the second audio device;
所述连接建立模块1102,还用于根据所述第一音频设备的属性支持信息,与所述第一音频设备建立音频连接。The connection establishing module 1102 is further configured to establish an audio connection with the first audio device according to the attribute support information of the first audio device.
在一种可能的实现方式中,所述蓝牙广播消息为蓝牙低功耗LE广播消息;所述音频连接为蓝牙低功耗LE音频连接。In a possible implementation, the Bluetooth broadcast message is a Bluetooth low energy LE broadcast message; and the audio connection is a Bluetooth low energy LE audio connection.
在一种可能的实现方式中,所述组合标识信息为组合标识解析值SIRK;所述属性支持信息为通用属性协调集协议GATT结构信息。In a possible implementation manner, the combined identification information is a combined identification resolution value SIRK; and the attribute support information is general attribute coordination set protocol GATT structure information.
在一种可能的实现方式中,所述第一音频设备和所述第二音频设备为真无线立体声TWS耳机。In a possible implementation, the first audio device and the second audio device are true wireless stereo TWS headphones.
综上所述,通过本申请实施例所示的方案,终端设备在接收到第一音频设备发送的蓝牙广播消息时,在已经与第二音频设备建立了音频连接的情况下,若第一音频设备与第二音频设备属于同一设备分组,则根据第二音频设备的属性支持信息与第一音频设备建立音频连接,节省了向第一音频设备进行服务查询的过程,极大的缩短了音频连接的建立时间,提高了音频连接的建立效率。To summarize, through the scheme shown in the embodiment of the present application, when the terminal device receives the Bluetooth broadcast message sent by the first audio device, if an audio connection has been established with the second audio device, if the first audio device and the second audio device belong to the same device group, an audio connection is established with the first audio device according to the attribute support information of the second audio device, thereby saving the process of querying the service to the first audio device, greatly shortening the time of establishing the audio connection, and improving the efficiency of establishing the audio connection.
需要说明的一点是,上述实施例提供的装置在实现其功能时,仅以上述各个功能模块的划分进行举例说明,实际应用中,可以根据实际需要而将上述功能分配由不同的功能模块完成,即将设备的内容结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。One point that needs to be explained is that the device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example to implement its functions. In actual applications, the above-mentioned functions can be assigned to different functional modules according to actual needs, that is, the content structure of the device can be divided into different functional modules to complete all or part of the functions described above.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
请参考图12,其示出了本申请一个实施例提供的计算机设备1200的结构示意图。该计算机设备1200可以包括:处理器1201、接收器1202、发射器1203、存储器1204和总线1205。Please refer to FIG12 , which shows a schematic diagram of the structure of a computer device 1200 provided in one embodiment of the present application. The computer device 1200 may include: a processor 1201 , a receiver 1202 , a transmitter 1203 , a memory 1204 and a bus 1205 .
处理器1201包括一个或者一个以上处理核心,处理器1201通过运行软件程序以及模块,从而执行各种功能应用以及信息处理。The processor 1201 includes one or more processing cores. The processor 1201 executes various functional applications and information processing by running software programs and modules.
接收器1202和发射器1203可以实现为一个通信组件,该通信组件可以是一块通信芯片。该通信芯片也可以称为收发器。The receiver 1202 and the transmitter 1203 may be implemented as a communication component, which may be a communication chip, which may also be called a transceiver.
存储器1204通过总线1205与处理器1201相连。The memory 1204 is connected to the processor 1201 via a bus 1205 .
存储器1204可用于存储计算机程序,处理器1201用于执行该计算机程序,以实现上述方法实施例中的各个步骤。The memory 1204 may be used to store a computer program, and the processor 1201 may be used to execute the computer program to implement each step in the above method embodiment.
此外,存储器1204可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,易失性或非易失性存储设备包括但不限于:磁盘或光盘,电可擦除可编程只读存储器,可擦除可编程只读存储器,静态随时存取存储器,只读存储器,磁存储器,快闪存储器,可编程只读存储器。In addition, memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, and volatile or non-volatile storage devices include but are not limited to: magnetic disks or optical disks, electrically erasable programmable read-only memory, erasable programmable read-only memory, static random access memory, read-only memory, magnetic memory, flash memory, and programmable read-only memory.
在一个示例性的方案中,当计算机设备1200实现为终端设备时,所述接收器1202,用于接收第一音频设备发送的蓝牙广播消息;In an exemplary solution, when the computer device 1200 is implemented as a terminal device, the receiver 1202 is used to receive a Bluetooth broadcast message sent by the first audio device;
处理器1201,当所述第一音频设备与第二音频设备属于同一设备分组时,根据所述第二音频设备的属性支持信息与所述第一音频设备建立音频连接;其中,所述第二音频设备是所述终端设备已连接或确定连接的音频设备;所述属性支持信息用于指示音频设备支持的服务。Processor 1201, when the first audio device and the second audio device belong to the same device group, establishes an audio connection with the first audio device according to attribute support information of the second audio device; wherein the second audio device is an audio device that the terminal device has connected or is determined to be connected; and the attribute support information is used to indicate services supported by the audio device.
其中,上述计算机设备1200中的处理器1201和/或接收器1202执行的过程可以参考上述各个方法实施例中,由终端设备执行的各个步骤。The process executed by the processor 1201 and/or the receiver 1202 in the above-mentioned computer device 1200 may refer to the various steps executed by the terminal device in the above-mentioned method embodiments.
本申请实施例还提供了一种计算机可读存储介质,所述存储介质中存储有计算机指令,所述计算机指令由处理器加载并执行以实现上述各个方法实施例中,由终端设备或者音频设备执行的全部或者部分步骤。An embodiment of the present application also provides a computer-readable storage medium, in which computer instructions are stored. The computer instructions are loaded and executed by a processor to implement all or part of the steps performed by a terminal device or an audio device in the above-mentioned method embodiments.
本申请还提供了一种芯片,该芯片用于在计算机设备中运行,以使得计算机设备执行上述各个方法实施例中,由终端设备执行的全部或者部分步骤。The present application also provides a chip, which is used to run in a computer device so that the computer device executes all or part of the steps executed by the terminal device in the above-mentioned various method embodiments.
本申请还提供了一种计算机程序产品,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。上述计算机程序产品可以用于实现上述各个方法实施例中,由终端设备执行的全部或者部分步骤。The present application also provides a computer program product, the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The above computer program product can be used to implement all or part of the steps executed by the terminal device in the above various method embodiments.
本申请还提供了一种计算机程序产品,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得计算机设备执行上述各个方法实施例中,由终端设备执行的全部或者部分步骤。The present application also provides a computer program product, the computer program product or computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes all or part of the steps executed by the terminal device in the above-mentioned various method embodiments.
本申请还提供了一种计算机程序,该计算机程序由计算机设备的处理器执行,以实现上述各个方法实施例中,由终端设备执行的全部或者部分步骤。The present application also provides a computer program, which is executed by a processor of a computer device to implement all or part of the steps executed by a terminal device in each of the above method embodiments.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
以上所述仅为本申请的示例性实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The above description is only an exemplary embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims (24)
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210188399.5A CN114786139B (en) | 2022-02-28 | 2022-02-28 | Connection establishment method, device, apparatus, storage medium, and program product |
| PCT/CN2022/142346 WO2023160212A1 (en) | 2022-02-28 | 2022-12-27 | Connection establishment method and apparatus, device, storage medium, and program product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210188399.5A CN114786139B (en) | 2022-02-28 | 2022-02-28 | Connection establishment method, device, apparatus, storage medium, and program product |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114786139A CN114786139A (en) | 2022-07-22 |
| CN114786139B true CN114786139B (en) | 2024-10-29 |
Family
ID=82423859
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210188399.5A Active CN114786139B (en) | 2022-02-28 | 2022-02-28 | Connection establishment method, device, apparatus, storage medium, and program product |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN114786139B (en) |
| WO (1) | WO2023160212A1 (en) |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114786139B (en) * | 2022-02-28 | 2024-10-29 | Oppo广东移动通信有限公司 | Connection establishment method, device, apparatus, storage medium, and program product |
| EP4529237A4 (en) * | 2022-08-22 | 2025-06-25 | Huawei Technologies Co., Ltd. | Communication method, apparatus and system |
| CN115665671B (en) * | 2022-09-16 | 2025-08-26 | Oppo广东移动通信有限公司 | Audio data sharing method, device, electronic device and storage medium |
| WO2025123525A1 (en) * | 2023-12-12 | 2025-06-19 | 海信视像科技股份有限公司 | Display device and device control method |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113366439A (en) * | 2018-12-26 | 2021-09-07 | 荣耀终端有限公司 | Method and device for connecting Bluetooth device |
| CN113810887A (en) * | 2020-05-29 | 2021-12-17 | Oppo广东移动通信有限公司 | Bluetooth protocol connection method, device, storage medium and related equipment |
Family Cites Families (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103095344B (en) * | 2011-11-07 | 2015-11-25 | 联想(北京)有限公司 | Set up method and the electronic equipment of wireless transfer channel |
| US9591684B2 (en) * | 2014-06-06 | 2017-03-07 | BBPOS Limited | System and method of bluetooth pairing with a group of bluetooth devices |
| CN109788441A (en) * | 2017-11-13 | 2019-05-21 | 北京小鸟听听科技有限公司 | A kind of information processing method, terminal and computer storage medium |
| US10299300B1 (en) * | 2018-05-16 | 2019-05-21 | Bose Corporation | Secure systems and methods for establishing wireless audio sharing connection |
| CN112868244B (en) * | 2018-11-30 | 2022-06-24 | 华为技术有限公司 | A point-to-multipoint data transmission method and device |
| WO2020124581A1 (en) * | 2018-12-21 | 2020-06-25 | 华为技术有限公司 | Audio data transmission method and electronic device |
| CN110809243B (en) * | 2019-10-30 | 2022-03-25 | 歌尔科技有限公司 | Wireless earphone, wireless earphone pairing method, terminal and system |
| CN111629369B (en) * | 2020-05-27 | 2022-11-04 | 歌尔科技有限公司 | Bluetooth headset, pairing connection method and device thereof, and TWS headset |
| CN112367654B (en) * | 2020-11-06 | 2023-05-12 | 炬力(珠海)微电子有限公司 | TWS equipment team forming method and device, electronic equipment and storage medium |
| CN114786139B (en) * | 2022-02-28 | 2024-10-29 | Oppo广东移动通信有限公司 | Connection establishment method, device, apparatus, storage medium, and program product |
-
2022
- 2022-02-28 CN CN202210188399.5A patent/CN114786139B/en active Active
- 2022-12-27 WO PCT/CN2022/142346 patent/WO2023160212A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113366439A (en) * | 2018-12-26 | 2021-09-07 | 荣耀终端有限公司 | Method and device for connecting Bluetooth device |
| CN113810887A (en) * | 2020-05-29 | 2021-12-17 | Oppo广东移动通信有限公司 | Bluetooth protocol connection method, device, storage medium and related equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2023160212A1 (en) | 2023-08-31 |
| CN114786139A (en) | 2022-07-22 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114786139B (en) | Connection establishment method, device, apparatus, storage medium, and program product | |
| US8244179B2 (en) | Wireless inter-device data processing configured through inter-device transmitted data | |
| WO2018032455A1 (en) | Bluetooth communication method and terminal | |
| WO2017028396A1 (en) | Connection method for multimedia playing device, master device, control terminal, and system | |
| CN113766477A (en) | Device connection method, device, electronic device and computer readable medium | |
| CN113784001B (en) | Audio data playback method, device, electronic equipment and storage medium | |
| WO2023284454A1 (en) | Bluetooth connection prompting method and apparatus, device, storage medium, and program product | |
| WO2016065977A1 (en) | Call processing method and device, communication terminal and server | |
| CN104639409A (en) | Method and device for automatically adding speakers to speaker ad hoc network | |
| CN113473435B (en) | Device connection method, device, electronic device and storage medium based on Bluetooth | |
| CN115002734A (en) | Audio sharing method, device and system and readable storage medium | |
| CN112272319A (en) | Audio and video data transmission method and device, storage medium and electronic equipment | |
| CN106095132B (en) | Method and device for setting key function of playing equipment | |
| WO2024016948A1 (en) | Information updating method and apparatus, audio sharing method and system, and electronic device | |
| CN115580944A (en) | Audio device connection method and device, storage medium and device | |
| CN114844983A (en) | A display device, a call device and a screen projection control method | |
| CN113783938A (en) | Wearable device-based data sharing method, system, device and storage medium | |
| CN115665671B (en) | Audio data sharing method, device, electronic device and storage medium | |
| CN113677039B (en) | Device connection method, device, electronic device and storage medium based on Bluetooth | |
| CN105682010A (en) | Bluetooth connection control method and device in audio playing system, and player | |
| CN114630303B (en) | A Bluetooth connection method, system, intelligent terminal and computer storage medium | |
| WO2016107013A1 (en) | Transmission processing and remote processing method and apparatus and computer storage medium | |
| WO2022237353A1 (en) | Method, apparatus, and device for configuring earphones in earphone holding case, and program product | |
| CN114363876A (en) | Connection establishing method, device, equipment, storage medium and program product | |
| CN117479131A (en) | Bluetooth connection method, device, electronic device and computer-readable storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |