[go: up one dir, main page]

CN109450851B - Device connection method, electronic device, and computer-readable medium - Google Patents

Device connection method, electronic device, and computer-readable medium Download PDF

Info

Publication number
CN109450851B
CN109450851B CN201811161268.8A CN201811161268A CN109450851B CN 109450851 B CN109450851 B CN 109450851B CN 201811161268 A CN201811161268 A CN 201811161268A CN 109450851 B CN109450851 B CN 109450851B
Authority
CN
China
Prior art keywords
wireless audio
transmission protocol
audio playback
playback device
target
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.)
Expired - Fee Related
Application number
CN201811161268.8A
Other languages
Chinese (zh)
Other versions
CN109450851A (en
Inventor
龚金华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811161268.8A priority Critical patent/CN109450851B/en
Publication of CN109450851A publication Critical patent/CN109450851A/en
Priority to PCT/CN2019/096611 priority patent/WO2020063062A1/en
Application granted granted Critical
Publication of CN109450851B publication Critical patent/CN109450851B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1101Session protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/08Protocols for interworking; Protocol conversion

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a device connection method, a device, electronic equipment and a computer readable medium, and relates to the technical field of communication. The method comprises the following steps: detecting whether a wireless audio playing device to be connected supports a target transmission protocol or not; if not, sending an updating instruction to the wireless audio playing device, and indicating the wireless audio playing device to update the supported transmission protocol and be capable of supporting the target transmission protocol; and connecting with the wireless audio playing device based on the target transmission protocol. Therefore, before connection is established, the wireless audio playing equipment is ensured to be connected after supporting the target transmission protocol, and poor user experience caused by connection failure is avoided.

Description

设备连接方法、电子设备及计算机可读介质Device connection method, electronic device and computer readable medium

技术领域technical field

本申请涉及通信技术领域,更具体地,涉及一种设备连接方法、装置、电子设备及计算机可读介质。The present application relates to the field of communication technologies, and more particularly, to a device connection method, apparatus, electronic device, and computer-readable medium.

背景技术Background technique

目前,使用无线音频播放设备播放电子设备内的音频数据,能够减少有线耳机所带来的不便,而且,电子设备能够同时连接两个无线音频播放设备,两个无线音频播放设备能够实现音频的混合播放效果。电子设备在连接无线音频播放设备时,用户会操作电子设备按照所需求的协议连接,但是,如果无线音频播放设备不支持该协议,会导致连接失败。At present, using a wireless audio playback device to play audio data in an electronic device can reduce the inconvenience caused by wired headphones, and the electronic device can be connected to two wireless audio playback devices at the same time, and the two wireless audio playback devices can realize audio mixing. Play effect. When the electronic device is connected to the wireless audio playback device, the user will operate the electronic device to connect according to the required protocol. However, if the wireless audio playback device does not support the protocol, the connection will fail.

发明内容SUMMARY OF THE INVENTION

本申请提出了一种设备连接方法、装置、电子设备及计算机可读介质,以改善上述缺陷。The present application proposes a device connection method, device, electronic device, and computer-readable medium to improve the above-mentioned defects.

第一方面,本申请实施例提供了一种设备连接方法,应用于电子设备,所述方法包括:检测待连接的无线音频播放设备是否支持目标传输协议;如果不支持,发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议且能够支持所述目标传输协议;基于所述目标传输协议与所述无线音频播放设备连接。In a first aspect, an embodiment of the present application provides a device connection method, which is applied to an electronic device. The method includes: detecting whether a wireless audio playback device to be connected supports a target transmission protocol; if not, sending an update instruction to the A wireless audio playback device, instructing the wireless audio playback device to update the supported transmission protocol and capable of supporting the target transmission protocol; and connecting with the wireless audio playback device based on the target transmission protocol.

第二方面,本申请实施例还提供了一种设备连接装置,应用于电子设备,所述装置包括:检测单元、发送单元和连接单元。检测单元,用于检测待连接的无线音频播放设备是否支持目标传输协议。发送单元,用于如果不支持,发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议且能够支持所述目标传输协议。连接单元,用于基于所述目标传输协议与所述无线音频播放设备连接。In a second aspect, an embodiment of the present application further provides an apparatus for connecting devices, which is applied to an electronic device. The apparatus includes: a detecting unit, a sending unit, and a connecting unit. The detection unit is used to detect whether the wireless audio playback device to be connected supports the target transmission protocol. A sending unit, configured to send an update instruction to the wireless audio playback device if it is not supported, instructing the wireless audio playback device to update the supported transmission protocol and be able to support the target transmission protocol. A connection unit, configured to connect with the wireless audio playback device based on the target transmission protocol.

第三方面,本申请实施例还提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述方法。In a third aspect, embodiments of the present application further provide an electronic device, including: one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to perform the above method.

第四方面,本申请实施例还提供了一种具有处理器可执行的程序代码的计算机可读介质,所述程序代码使所述处理器执行上述方法。In a fourth aspect, an embodiment of the present application further provides a computer-readable medium having program code executable by a processor, where the program code enables the processor to execute the above method.

相对于现有技术,本申请提供的方案,在电子设备欲通过目标传输协议与无线音频播放设备连接之前,先检测待连接的无线音频播放设备是否支持该目标传输协议,如果支持,则直接通过该协议连接,如果不支持,则先发送更新指令指示该无线音频播放设备更新所支持的传输协议,以便能够支持该目标传输协议,然后,再根据该目标传输协议建立连接。由此,在建立连接之前,确保无线音频播放设备支持目标传输协议之后再连接,避免连接失败而导致用户体验过差。Compared with the prior art, in the solution provided by this application, before the electronic device wants to connect with the wireless audio playback device through the target transmission protocol, it is first detected whether the wireless audio playback device to be connected supports the target transmission protocol. If the protocol connection is not supported, send an update instruction to instruct the wireless audio playback device to update the supported transmission protocol so as to support the target transmission protocol, and then establish a connection according to the target transmission protocol. Therefore, before establishing the connection, make sure that the wireless audio playback device supports the target transmission protocol before connecting, so as to avoid connection failure and cause poor user experience.

附图说明Description of drawings

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that are used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained from these drawings without creative effort.

图1示出了本申请一实施例提供的语音系统的模块框图;FIG. 1 shows a module block diagram of a voice system provided by an embodiment of the present application;

图2示出了本申请另一实施例提供的语音系统的模块框图;FIG. 2 shows a module block diagram of a voice system provided by another embodiment of the present application;

图3示出了本申请一实施例提供的一种设备连接方法的方法流程图;FIG. 3 shows a method flowchart of a device connection method provided by an embodiment of the present application;

图4示出了本申请实施例提供的设备管理界面的示意图;FIG. 4 shows a schematic diagram of a device management interface provided by an embodiment of the present application;

图5示出了图3中的S301的方法流程图;Fig. 5 shows the method flowchart of S301 in Fig. 3;

图6示出了本申请另一实施例提供的一种设备连接方法的方法流程图;FIG. 6 shows a method flowchart of a device connection method provided by another embodiment of the present application;

图7示出了本申请实施例提供的一种设备连接装置的模块框图;FIG. 7 shows a module block diagram of a device connection apparatus provided by an embodiment of the present application;

图8示出了本申请实施例提供的电子设备的模块框图;FIG. 8 shows a module block diagram of an electronic device provided by an embodiment of the present application;

图9示出了本申请实施例提供的用于保存或者携带实现根据本申请实施例的音频播放方法的程序代码的存储单元。FIG. 9 shows a storage unit provided by an embodiment of the present application for storing or carrying a program code for implementing the audio playback method according to the embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the solutions of the present application, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application.

随着音频播放设备的种类增多以及播放音效的提升,更多的用户会选择将手机、平板电脑等电子设备待播放的音频输出到音频播放设备进行播放。其中,常见的音频播放设备包括车载音乐播放器、音箱以及耳机等。With the increase of the types of audio playback devices and the improvement of playback sound effects, more users will choose to output the audio to be played from electronic devices such as mobile phones and tablet computers to the audio playback device for playback. Among them, common audio playback devices include car music players, speakers, and headphones.

而音频播放设备根据连接方式不同,可以分为有线音频播放设备和无线音频播放设备,则电子设备可以与无线音频播放设备之间通过无线网络进行交互以传输信号,其中,该无线网络可以是蓝牙、wi fi、LTE网络或者 NFC等等。Audio playback devices can be divided into wired audio playback devices and wireless audio playback devices according to different connection methods. The electronic device can interact with the wireless audio playback device through a wireless network to transmit signals, wherein the wireless network can be Bluetooth. , wi fi, LTE network or NFC and so on.

示例性地,如图1所示,示出了本申请实施例提供的语音系统1的模块图。具体地,该语音系统1包括电子设备100、第一无线音频播放设备 210和第二无线音频播放设备220,电子设备100能够同时与第一无线音频播放设备210和第二无线音频播放设备220连接。Exemplarily, as shown in FIG. 1 , a block diagram of a speech system 1 provided by an embodiment of the present application is shown. Specifically, the voice system 1 includes an electronic device 100, a first wireless audio playback device 210 and a second wireless audio playback device 220, and the electronic device 100 can be connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time .

在本发明实施例中,电子设备100内安装有能够播放音频的应用程序,具体地,该应用程序可以是音频播放软件、视频播放软件或者通话软件等。电子设备100将需要播放的音频发送给第一无线音频播放设备210或第二无线音频播放设备220,由第一无线音频播放设备210或第二无线音频播放设备220播放语音。In this embodiment of the present invention, an application program capable of playing audio is installed in the electronic device 100 , and specifically, the application program may be audio playback software, video playback software, or call software. The electronic device 100 sends the audio to be played to the first wireless audio playback device 210 or the second wireless audio playback device 220, and the first wireless audio playback device 210 or the second wireless audio playback device 220 plays the audio.

本发明实施例中,第一无线音频播放设备210和第二无线音频播放设备220均可以是蓝牙音响或者蓝牙耳机,第一无线音频播放设备210和第二无线音频播放设备220可以通过开启蓝牙功能实现与电子设备100的连接,且在建立连接之后,电子设备100将其需要播放的语音发送给蓝牙音响,由蓝牙音响实现语音播放。In this embodiment of the present invention, both the first wireless audio playback device 210 and the second wireless audio playback device 220 may be Bluetooth speakers or Bluetooth headsets, and the first wireless audio playback device 210 and the second wireless audio playback device 220 can be enabled by enabling the Bluetooth function The connection with the electronic device 100 is realized, and after the connection is established, the electronic device 100 sends the voice to be played to the Bluetooth speaker, and the Bluetooth speaker realizes the voice playback.

当第一无线音频播放设备210和第二无线音频播放设备220均为蓝牙设备时,电子设备100能够通过蓝牙模块同时与第一无线音频播放设备210 和第二无线音频播放设备220连接,作为一种实施方式,可以是电子设备内的蓝牙模块可以支持多点连接,从而能够实现图1所示的电子设备分别与第一无线音频播放设备210和第二无线音频播放设备220连接,则在建立连接之后,电子设备100能够获取到第一无线音频播放设备210和第二无线音频播放设备220的标识,该标识可以是MAC地址。具体地,当电子设备的蓝牙功能开启的时候,电子设备会对周围一定距离范围内的蓝牙设备扫描,具体地,由电子设备的蓝牙芯片或者其他底层网络模块接收到扫描命令后,按照预设的信道扫描顺序进行扫描,如先扫描常用信道1、7、13 信道,再扫描其他的非常用信道,由此获得当前范围内的所有蓝牙设备的标识,并显示在电子设备的蓝牙列表界面内。When the first wireless audio playback device 210 and the second wireless audio playback device 220 are both Bluetooth devices, the electronic device 100 can simultaneously connect to the first wireless audio playback device 210 and the second wireless audio playback device 220 through the Bluetooth module, as a In this embodiment, the Bluetooth module in the electronic device can support multi-point connection, so that the electronic device shown in FIG. After the connection, the electronic device 100 can obtain the identifiers of the first wireless audio playback device 210 and the second wireless audio playback device 220, and the identifiers may be MAC addresses. Specifically, when the Bluetooth function of the electronic device is turned on, the electronic device will scan the Bluetooth devices within a certain distance. For example, scan the common channels 1, 7, and 13 first, and then scan other uncommon channels, thereby obtaining the identifiers of all Bluetooth devices within the current range and displaying them in the Bluetooth list interface of the electronic device. .

如果在所扫描到的蓝牙设备的标识中存在已经连接过且信号强度较好的蓝牙设备,电子设备会自动与该蓝牙设备连接,则用户也可以在蓝牙列表界面内选择一个蓝牙设备进行连接。If there is a bluetooth device that has been connected and has good signal strength in the scanned bluetooth device identifier, the electronic device will automatically connect with the bluetooth device, and the user can also select a bluetooth device in the bluetooth list interface to connect.

当电子设备与外部的蓝牙设备连接时,则电子设备的系统会过去到一个状态值,该状态值表示电子设备当前已经连接蓝牙设备。从而,电子设备能够检测到已经蓝牙设备,从而获取到蓝牙设备的设备标识。When the electronic device is connected to an external Bluetooth device, the system of the electronic device will pass to a state value, and the state value indicates that the electronic device is currently connected to the Bluetooth device. Therefore, the electronic device can detect the Bluetooth device, and thus obtain the device identification of the Bluetooth device.

作为另一种实施方式,如图2所示,电子设备100与第一无线音频播放设备210通过蓝牙连接,然后,第一无线音频播放设备210再通过蓝牙和第二无线音频播放设备220连接,从而,电子设备100、第一无线音频播放设备210和第二无线音频播放设备220通过组网的方式实现同时连接,即第一无线音频播放设备210作为电子设备100和第二无线音频播放设备220的中继器。具体地,电子设备可以通过真无线立体声协议(True Wireless Stereo,TWS)同时连接两个无线音频播放设备,例如,蓝牙音箱和手机为例,手机通过连接主音箱,再由主音箱通过蓝牙无线方式连接从音箱,实现真正的蓝牙左右声道无线分离使用。As another implementation, as shown in FIG. 2 , the electronic device 100 is connected with the first wireless audio playback device 210 through Bluetooth, and then the first wireless audio playback device 210 is connected with the second wireless audio playback device 220 through Bluetooth, Therefore, the electronic device 100 , the first wireless audio playback device 210 and the second wireless audio playback device 220 are connected simultaneously through networking, that is, the first wireless audio playback device 210 acts as the electronic device 100 and the second wireless audio playback device 220 the repeater. Specifically, the electronic device can simultaneously connect two wireless audio playback devices through the True Wireless Stereo (TWS) protocol. For example, a Bluetooth speaker and a mobile phone are used as an example. The mobile phone is connected to the main speaker, and then the main speaker is connected to the main speaker through Bluetooth wireless Connect from the speaker to achieve true Bluetooth left and right channel wireless separation.

因此,在电子设备100同时与第一无线音频播放设备210和第二无线音频播放设备220连接之后,可以实现不同的音频播放设备播放不同的音频数据,当然,也可以是不同的音频播放设备播放相同的音频数据,以实现立体声等效果。也可以是使用其中一个无线音频播放设备播放音频数据,而另一个无线音频播放设备处于待机状态而不播放音频。Therefore, after the electronic device 100 is connected to the first wireless audio playback device 210 and the second wireless audio playback device 220 at the same time, different audio playback devices can be implemented to play different audio data, and of course, different audio playback devices can also be played. The same audio data for effects such as stereo. It is also possible to use one of the wireless audio playback devices to play audio data, while the other wireless audio playback device is in a standby state and does not play audio.

电子设备与无线音频播放设备之间的连接需要通过一定的传输协议建立,但是,发明人在研究中发现,如果电子设备欲通过某个协议与无线音频播放设备连接,但是,该无线音频播放设备不支持该协议的时候,会导致连接失败,而为用户带来非常差的用户体验。The connection between the electronic device and the wireless audio playback device needs to be established through a certain transmission protocol. However, the inventor found in research that if the electronic device wants to connect with the wireless audio playback device through a certain protocol, the wireless audio playback device When this protocol is not supported, the connection will fail, which will bring a very poor user experience to the user.

因此,为了解决上述技术缺陷,如图3所示,本申请实施例提供了一种设备连接方法,应用于上述电子设备,具体地,该方法包括:S301至S303。Therefore, in order to solve the above technical defects, as shown in FIG. 3 , an embodiment of the present application provides a device connection method, which is applied to the above electronic device. Specifically, the method includes: S301 to S303.

S301:检测待连接的无线音频播放设备是否支持目标传输协议。S301: Detect whether the wireless audio playback device to be connected supports the target transmission protocol.

当电子设备的蓝牙功能开启的时候,电子设备会对周围一定距离范围内的蓝牙设备扫描,具体地,由电子设备的蓝牙芯片或者其他底层网络模块接收到扫描命令后,按照预设的信道扫描顺序进行扫描,如先扫描常用信道 1、7、13信道,再扫描其他的非常用信道,由此获得当前范围内的所有蓝牙设备的标识,并显示在电子设备的蓝牙列表界面内。When the Bluetooth function of the electronic device is turned on, the electronic device will scan the Bluetooth devices within a certain distance. Scan in sequence, for example, first scan common channels 1, 7, and 13, and then scan other uncommon channels, thereby obtaining the identifiers of all Bluetooth devices within the current range, and displaying them in the Bluetooth list interface of the electronic device.

如果在所扫描到的蓝牙设备的标识中存在已经连接过且信号强度较好的蓝牙设备,电子设备会自动与该蓝牙设备连接,则用户也可以在蓝牙列表界面内选择一个蓝牙设备进行连接。If there is a bluetooth device that has been connected and has good signal strength in the scanned bluetooth device identifier, the electronic device will automatically connect with the bluetooth device, and the user can also select a bluetooth device in the bluetooth list interface to connect.

具体地,电子设备与无线音频播放设备之间的连接需要按照一定的协议传输数据,也就是,需要通过一定的协议连接,以无线音频播放设备为蓝牙设备为例,常用的蓝牙协议包括PPP、UDP/TCP/IP、OBEX、WAP、vCard、 vCal、IrMC、WAE、TWS以及TWS+等。只有在电子设备与无线音频播放设备均支持某一种协议,电子设备才能够通过该协议与无线音频播放设备连接。Specifically, the connection between the electronic device and the wireless audio playback device needs to transmit data according to a certain protocol, that is, it needs to be connected through a certain protocol. Taking the wireless audio playback device as a Bluetooth device as an example, commonly used Bluetooth protocols include PPP, UDP/TCP/IP, OBEX, WAP, vCard, vCal, IrMC, WAE, TWS and TWS+ etc. Only when the electronic device and the wireless audio playback device both support a certain protocol, the electronic device can connect with the wireless audio playback device through this protocol.

则用户可以通过操作电子设备的方式,输入电子设备与无线音频播放设备的连接请求,具体地,该操作界面如图4所示,示出了电子设备的设备管理界面,在该设备管理界面内,显示有电子设备所连接的两个无线音频播放设备的操作界面,具体地,包括两个无线音频播放设备的选择按钮,图4 中的每个设备对应的选择按钮,例如,在圆形按钮位于左侧时,用户输入了电子设备与该无线音频播放设备的连接请求。Then the user can input the connection request between the electronic device and the wireless audio playback device by operating the electronic device. Specifically, the operation interface is shown in Figure 4, which shows the device management interface of the electronic device. In the device management interface , the operation interface of the two wireless audio playback devices connected to the electronic device is displayed, specifically, including the selection buttons of the two wireless audio playback devices, the selection buttons corresponding to each device in FIG. 4 , for example, in the round button On the left side, the user inputs a connection request between the electronic device and the wireless audio playback device.

另外,在该界面内,每个无线音频播放设备还对应一个下拉菜单,用户能够通过该下拉菜单为无线音频播放设备配置蓝牙协议,例如,为设备1配置TWS协议,则所输入的连接请求用于指示电子设备通过所指定的TWS协议与无线音频播放设备1建立连接。In addition, in this interface, each wireless audio playback device also corresponds to a drop-down menu, and the user can configure the Bluetooth protocol for the wireless audio playback device through the drop-down menu. It is used to instruct the electronic device to establish a connection with the wireless audio playback device 1 through the specified TWS protocol.

而在响应该连接请求建立连接之前,也就是说,当获取到该连接请求时,检测待连接的无线音频播放设备是否支持目标传输协议,其中,该连接请求用于指示电子设备通过目标传输协议与无线音频播放设备连接。Before establishing the connection in response to the connection request, that is, when the connection request is acquired, it is detected whether the wireless audio playback device to be connected supports the target transmission protocol, wherein the connection request is used to instruct the electronic device to pass the target transmission protocol Connect with wireless audio playback devices.

具体地,如图5所示,检测待连接的无线音频播放设备是否支持目标传输协议的具体实施方式可以是:S3011至S3013。Specifically, as shown in FIG. 5 , the specific implementation manner of detecting whether the wireless audio playback device to be connected supports the target transmission protocol may be: S3011 to S3013.

S3011:发送协议询问指令至所述无线音频播放设备,所述协议询问指令用于询问所述无线音频播放设备是否支持目标传输协议。S3011: Send a protocol inquiry instruction to the wireless audio playback device, where the protocol inquiry instruction is used to inquire whether the wireless audio playback device supports a target transmission protocol.

具体地,电子设备在获取到该连接请求时,该连接请求用于指示电子设备通过目标传输协议与无线音频播放设备连接,即已经具体指定了采用目标传输协议与无线音频播放设备连接,则电子设备接下来需要确认无线音频播放设备是否支持该目标传输协议,具体地,电子设备发送协议询问指令至所述无线音频播放设备,该协议询问指令包括目标传输协议的标识,无线音频播放设备在获取到该协议询问指令之后,解析该协议询问指令获取到该目标传输协议的标识,查找无线音频播放设备所支持的所有协议的标识,具体地,可以是预先存储在无线音频播放设备内的所支持的所有协议的标识。确定在所支持的所有协议的标识中是否包括目标传输协议的标识,如果包括,则确定无线音频播放设备支持目标传输协议,如果不包括,则确定无线音频播放设备不支持目标传输协议。Specifically, when the electronic device acquires the connection request, the connection request is used to instruct the electronic device to connect with the wireless audio playback device through the target transmission protocol, that is, it has been specifically specified to use the target transmission protocol to connect with the wireless audio playback device, then the electronic device The device next needs to confirm whether the wireless audio playback device supports the target transmission protocol. Specifically, the electronic device sends a protocol inquiry instruction to the wireless audio playback device, and the protocol inquiry instruction includes the identifier of the target transmission protocol. After arriving at the protocol inquiry instruction, parse the protocol inquiry instruction to obtain the identifier of the target transmission protocol, and search for the identifiers of all protocols supported by the wireless audio playback device. identities of all protocols. It is determined whether the identifier of the target transmission protocol is included in the identifiers of all supported protocols. If so, it is determined that the wireless audio playback device supports the target transmission protocol. If not, it is determined that the wireless audio playback device does not support the target transmission protocol.

作为另一种实施方式,还可以是电子设备发送协议询问指令至无线音频播放设备,指示无线音频播放设备基于该协议询问指令返回所支持的所有协议的标识。电子设备获取到该无线音频播放设备所支持的所有协议的标识,电子设备判断在所获取的该无线音频播放设备所支持的所有协议的标识中是否包括目标传输协议的标识,如果包括,则确定无线音频播放设备支持目标传输协议,如果不包括,则确定无线音频播放设备不支持目标传输协议。As another implementation manner, the electronic device may also send a protocol query instruction to the wireless audio playback device, instructing the wireless audio playback device to return the identifiers of all supported protocols based on the protocol query instruction. The electronic device acquires the identifiers of all protocols supported by the wireless audio playback device, and the electronic device determines whether the acquired identifiers of all protocols supported by the wireless audio playback device include the identifier of the target transmission protocol, if included, then determine The wireless audio playback device supports the target transmission protocol. If it is not included, it is determined that the wireless audio playback device does not support the target transmission protocol.

另外,电子设备发送至无线音频播放设备的协议询问指令还可以是指示无线音频播放设备反馈该无线音频播放设备的设备信息,该设备信息可以是该无线音频播放设备的名称,也可以是该无线音频播放设备的类型,在获取到该设备信息之后,根据预设的设备信息所支持的协议的对应关系,确定无线音频播放设备的设备信息对应的所支持的协议,从而确定设备信息所对应的所支持的协议是否包括目标传输协议,如果包括,则确定无线音频播放设备支持目标传输协议,如果不包括,则确定无线音频播放设备不支持目标传输协议。In addition, the protocol query instruction sent by the electronic device to the wireless audio playback device may also be instructing the wireless audio playback device to feed back the device information of the wireless audio playback device, and the device information may be the name of the wireless audio playback device or the wireless audio playback device. The type of audio playback device, after acquiring the device information, determine the supported protocol corresponding to the device information of the wireless audio playback device according to the corresponding relationship of the protocols supported by the preset device information, so as to determine the corresponding protocol of the device information. Whether the supported protocol includes the target transmission protocol, if so, it is determined that the wireless audio playback device supports the target transmission protocol, if not, it is determined that the wireless audio playback device does not support the target transmission protocol.

S3012:获取所述无线音频播放设备返回的询问结果。S3012: Obtain the query result returned by the wireless audio playback device.

其中,询问结果为基于协议询问指令而返回的信息,具体地,可以是所返回的无线音频播放设备所判定自己是否支持目标传输协议的结果,也可以是,无线音频播放设备返回的所支持的所有协议的标识,还可以是无线音频播放设备的设备信息。Wherein, the inquiry result is the information returned based on the protocol inquiry instruction, specifically, it may be the result of whether the returned wireless audio playback device determines whether it supports the target transmission protocol, or it may be the supported data returned by the wireless audio playback device. The identifiers of all protocols can also be the device information of the wireless audio playback device.

S3013:基于所述询问结果,确定待连接的无线音频播放设备是否支持目标传输协议。S3013: Based on the query result, determine whether the wireless audio playback device to be connected supports the target transmission protocol.

基于不同的询问结果,所确定的待连接的无线音频播放设备是否支持目标传输协议方式不同。作为一种实施方式,上述的无线音频播放设备获取到电子设备发送的协议查询请求中包括目标传输协议的标识,则确定在所支持的所有协议的标识中是否包括目标传输协议的标识,如果包括,会返回第一信息而如果不包括,则会返回第二信息,其中,第一信息和第二信息可以是两个不同的数值,例如,第一信息是1,第二信息是0,则电子设备获取到该第一信息和第二信息能够根据事先约定的规则,确定该第一信息或第二信息所对应的结果表示无线音频播放设备是否支持目标传输协议。例如,第一信息是1,则1表示该无线音频播放设备支持目标传输协议,而0 表示该无线音频播放设备不支持目标传输协议。Based on different query results, it is determined whether the wireless audio playback device to be connected supports the target transmission protocol in different ways. As an embodiment, the above-mentioned wireless audio playback device obtains that the protocol query request sent by the electronic device includes the identifier of the target transmission protocol, and then determines whether the identifier of the target transmission protocol is included in the identifiers of all supported protocols. , will return the first information and if not included, will return the second information, where the first information and the second information can be two different values, for example, the first information is 1, the second information is 0, then When the electronic device obtains the first information and the second information, it can determine whether the result corresponding to the first information or the second information indicates whether the wireless audio playback device supports the target transmission protocol according to the pre-agreed rule. For example, if the first information is 1, 1 indicates that the wireless audio playback device supports the target transmission protocol, and 0 indicates that the wireless audio playback device does not support the target transmission protocol.

作为另一种实施方式,该询问结果是无线音频播放设备返回的无线音频播放设备所支持的所有协议的标识,作为又一种实施方式,该询问结果是无线音频播放设备返回的无线音频播放设备的设备信息,则确定的基于所述询问结果,确定待连接的无线音频播放设备是否支持目标传输协议的可参考前述描述。As another implementation manner, the query result is the identifiers of all protocols supported by the wireless audio playback device returned by the wireless audio playback device. As another implementation manner, the query result is the wireless audio playback device returned by the wireless audio playback device. If the device information is determined, based on the query result, to determine whether the wireless audio playback device to be connected supports the target transmission protocol, reference may be made to the foregoing description.

S302:发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议且能够支持所述目标传输协议。S302: Send an update instruction to the wireless audio playback device, instructing the wireless audio playback device to update the supported transmission protocol and be able to support the target transmission protocol.

如果无线音频播放设备支持目标传输协议,则执行S303,如果无线音频播放设备不支持目标传输协议,则发送更新指令至所述无线音频播放设备。If the wireless audio playback device supports the target transmission protocol, execute S303, and if the wireless audio playback device does not support the target transmission protocol, send an update instruction to the wireless audio playback device.

作为一种实施方式,更新指令为指示信息,该是指示信息用于指示无线音频播放设备在数据服务器下载目标传输协议对应的数据包,根据该数据包的安装能够使得无线音频播放设备支持目标传输协议。其中,如果在电子设备发送协议询问指令至所述无线音频播放设备的时候,已经将目标传输协议发送至无线音频播放设备,则在发送更新指令的时候,可以通过该更新指令将目标传输协议的标识发送至无线音频播放设备,指示无线音频播放设备在数据服务器下载目标传输协议对应的数据包,其中,数据服务器可以是无线音频播放设备对应的服务器,该数据服务器内存储有无线音频播放设备对应的一些的用于升级系统或者蓝牙传输协议的数据,无线音频播放设备通过指定的域名地址能够在访问该数据服务器,并且在该数据服务器内获取到所需求的目标传输协议对应的数据包。As an embodiment, the update instruction is instruction information, which is used to instruct the wireless audio playback device to download a data packet corresponding to the target transmission protocol on the data server, and the installation of the data packet enables the wireless audio playback device to support the target transmission protocol. Wherein, if the target transmission protocol has been sent to the wireless audio playback device when the electronic device sends the protocol inquiry command to the wireless audio playback device, then when the update command is sent, the target transmission protocol can be updated by the update command. The identifier is sent to the wireless audio playback device, instructing the wireless audio playback device to download the data packet corresponding to the target transmission protocol in the data server, wherein the data server can be the server corresponding to the wireless audio playback device, and the data server stores the corresponding data of the wireless audio playback device. Some of the data used to upgrade the system or the Bluetooth transmission protocol, the wireless audio playback device can access the data server through the specified domain name address, and obtain data packets corresponding to the required target transmission protocol in the data server.

另外,如果在电子设备发送协议询问指令至所述无线音频播放设备的时候,未将目标传输协议发送至无线音频播放设备,则在发送更新指令的时候,发送目标传输协议的标识至无线音频播放设备,指示无线音频播放设备在数据服务器下载目标传输协议对应的数据包。In addition, if the electronic device does not send the target transmission protocol to the wireless audio playback device when the electronic device sends the protocol inquiry command to the wireless audio playback device, then when sending the update command, the identifier of the target transmission protocol is sent to the wireless audio playback device. device, instructing the wireless audio playback device to download the data packet corresponding to the target transmission protocol in the data server.

具体地,电子设备可以把自己所支持的目标传输协议的版本号也发送至无线音频播放设备,无线音频播放设备根据该版本号在数据服务器内下载与该版本号对应的数据包,从而对无线音频播放设备更新,以使得该无线音频播放设备能够支持目标传输协议。Specifically, the electronic device can also send the version number of the target transmission protocol supported by itself to the wireless audio playback device, and the wireless audio playback device downloads the data package corresponding to the version number in the data server according to the version number, so that the wireless audio playback device downloads the data package corresponding to the version number in the data server. The audio playback device is updated to enable the wireless audio playback device to support the target transport protocol.

作为另一种实施方式,不需要无线音频播放设备在数据服务器内下载该目标传输协议对应的数据包,而由电子设备直接将该数据包发送至无线音频播放设备,具体地,发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议,以便能够支持所述目标传输协议的具体实施方式为:发送更新数据包至所述无线音频播放设备,指示所述无线音频播放设备根据所述更新数据包更新所支持的传输协议,以便能够支持所述目标传输协议。具体地,所发送的更新数据包的内容就是目标传输协议的数据包,该目标传输协议的数据包用于无线音频播放设备对所支持的蓝牙传输协议更新,以便能够支持目标传输协议。则上述更新请求内包括该更新数据包。As another implementation, it is not necessary for the wireless audio playback device to download the data packet corresponding to the target transmission protocol in the data server, and the electronic device directly sends the data packet to the wireless audio playback device. Specifically, the update instruction is sent to The wireless audio playback device instructs the wireless audio playback device to update the supported transmission protocol so as to be able to support the target transmission protocol. The specific implementation is: sending an update packet to the wireless audio playback device, instructing the The wireless audio playback device updates the supported transmission protocol according to the update data packet, so as to be able to support the target transmission protocol. Specifically, the content of the sent update data packet is the data packet of the target transmission protocol, and the data packet of the target transmission protocol is used for the wireless audio playback device to update the supported Bluetooth transmission protocol so as to be able to support the target transmission protocol. Then the above update request includes the update data package.

具体地,电子设备在确定无线音频播放设备不支持目标传输协议之后,确定电子设备内是否存储有目标传输协议的数据包,如果存储有目标传输协议的数据包,则发送更新数据包至所述无线音频播放设备,指示所述无线音频播放设备根据所述更新数据包更新所支持的传输协议,以便能够支持所述目标传输协议,其中,更新数据包为目标传输协议的数据包。如果未存储有目标传输协议的数据包,则发送指示信息至所述无线音频播放设备,指示所述无线音频播放设备下载该目标传输协议对应的数据包,以更新所述无线音频播放设备的蓝牙传输协议,从而能够支持目标传输协议。Specifically, after determining that the wireless audio playback device does not support the target transmission protocol, the electronic device determines whether a data packet of the target transmission protocol is stored in the electronic device, and if a data packet of the target transmission protocol is stored, sends an update data packet to the The wireless audio playback device instructs the wireless audio playback device to update the supported transmission protocol according to the update data packet, so as to be able to support the target transmission protocol, wherein the update data packet is a data packet of the target transmission protocol. If the data packet of the target transmission protocol is not stored, send instruction information to the wireless audio playback device, instructing the wireless audio playback device to download the data packet corresponding to the target transmission protocol to update the Bluetooth of the wireless audio playback device transport protocol, so that the target transport protocol can be supported.

再者,还可以根据电子设备与无线音频播放设备之间的信道的信道质量确定采用哪种方式更新无线音频播放设备的蓝牙传输协议,具体地,电子设备在确定无线音频播放设备不支持目标传输协议之后,获取电子设备与无线音频播放设备之间的信道的信道质量,如果该信道质量满足预设条件,则发送更新数据包至所述无线音频播放设备,指示所述无线音频播放设备根据所述更新数据包更新所支持的传输协议,以便能够支持所述目标传输协议,其中,更新数据包为目标传输协议的数据包,如果不满足预设条件,则发送指示信息至所述无线音频播放设备,指示所述无线音频播放设备下载该目标传输协议对应的数据包,以更新所述无线音频播放设备的蓝牙传输协议,从而能够支持目标传输协议。Furthermore, it can also be determined according to the channel quality of the channel between the electronic device and the wireless audio playback device which method is used to update the Bluetooth transmission protocol of the wireless audio playback device. Specifically, when the electronic device determines that the wireless audio playback device does not support the target transmission After the agreement, obtain the channel quality of the channel between the electronic device and the wireless audio playback device, if the channel quality meets the preset conditions, send an update packet to the wireless audio playback device, instructing the wireless audio playback device according to the The update data packet updates the supported transmission protocol so as to be able to support the target transmission protocol, wherein the update data packet is the data packet of the target transmission protocol, and if the preset conditions are not met, send instruction information to the wireless audio player device, instructing the wireless audio playback device to download the data packet corresponding to the target transmission protocol, so as to update the Bluetooth transmission protocol of the wireless audio playback device, so as to be able to support the target transmission protocol.

其中,信道质量可以是信道的误差向量幅度、接入点个数、信号强度等。其中,误差向量幅度(Error Vector Magnitude,简称EVM)指在给定时刻理想无误差基准信号与实际发射信号的向量差,用于衡量调制信号的幅度误差和相位误差,EVM具体表示接收终端对信号进行解调时产生的IQ分量与理想信号分量的接近程度,是考量调制信号质量的一种指标。EVM越小,信道的信道质量越好。而接入点的个数也可以在信道扫描的时候,获取每个信道上的接入点,由此就能够确定每个信道上的接入点个数,接入点的个数越多,信道质量越差,反之,越好。同理,信号强度也可以在信道扫描的时候获得,信号强度越高,则信道质量越高,反之,越低。The channel quality may be the error vector magnitude of the channel, the number of access points, the signal strength, and the like. Among them, Error Vector Magnitude (EVM for short) refers to the vector difference between the ideal error-free reference signal and the actual transmitted signal at a given moment, which is used to measure the amplitude error and phase error of the modulated signal. EVM specifically represents the signal received by the receiving terminal. The closeness of the IQ component generated during demodulation to the ideal signal component is an index to consider the quality of the modulated signal. The smaller the EVM, the better the channel quality of the channel. The number of access points can also be obtained by acquiring the access points on each channel during channel scanning, so that the number of access points on each channel can be determined. The worse the channel quality, and vice versa, the better. Similarly, the signal strength can also be obtained during channel scanning. The higher the signal strength, the higher the channel quality, and vice versa.

则信道质量满足预设条件,可以是该信道的EVM值小于预设值。其中,该预设值可以是用户根据实际需求而设定的,则由于EVM值越小则信道质量越高,则EVM小于预设值,可以表示当前信道的信道质量比较理想,发送更新数据包至无线音频播放设备的时候,不会由于信道过差而导致传送过慢,而如果EVM大于或等于预设值,则表示当前信道的信道质量较差,无线音频播放设备可以通过与数据服务器之间的链路而下载目标传输协议对应的数据包。Then the channel quality satisfies the preset condition, which may be that the EVM value of the channel is less than the preset value. The preset value may be set by the user according to actual needs. Since the smaller the EVM value is, the higher the channel quality will be. If the EVM value is smaller than the preset value, it can indicate that the channel quality of the current channel is ideal, and an update data packet is sent. When it reaches the wireless audio playback device, the transmission will not be too slow due to poor channel. If the EVM is greater than or equal to the preset value, it means that the channel quality of the current channel is poor. The wireless audio playback device can communicate with the data server. The link between them downloads the data packets corresponding to the target transport protocol.

S303:基于所述目标传输协议与所述无线音频播放设备连接。S303: Connect with the wireless audio playback device based on the target transmission protocol.

则在发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议之后,电子设备发送连接请求至无线音频播放设备,该连接请求内包括目标传输协议的名称,则无线音频播放设备与电子设备基于目标传输协议传输数据。Then after sending an update instruction to the wireless audio playback device to instruct the wireless audio playback device to update the supported transmission protocol, the electronic device sends a connection request to the wireless audio playback device, and the connection request includes the name of the target transmission protocol, Then the wireless audio playback device and the electronic device transmit data based on the target transmission protocol.

则考虑到无线音频播放设备更新所支持的蓝牙传输协议需要一定的时间,如果,在发送更新指令至所述无线音频播放设备之后,基于所述目标传输协议与所述无线音频播放设备连接,则有可能无线音频播放设备并没有更新完毕,则依然不支持目标传输协议,则此时建立连接,电子设备与无线音频播放设备依然无法通过目标传输协议建立连接。Then considering that it takes a certain time for the wireless audio playback device to update the supported Bluetooth transmission protocol, if, after sending the update instruction to the wireless audio playback device, it is connected to the wireless audio playback device based on the target transmission protocol, then It is possible that the wireless audio playback device has not been updated, and the target transmission protocol is still not supported. At this time, a connection is established, and the electronic device and the wireless audio playback device still cannot establish a connection through the target transmission protocol.

因此,作为一种实施方式,基于所述目标传输协议与所述无线音频播放设备连接的具体实施方式可以是:判断是否接收到所述无线音频播放设备反馈的成功更新的信息;如果接收到,则基于所述目标传输协议与所述无线音频播放设备连接。Therefore, as an implementation manner, the specific implementation of the connection with the wireless audio playback device based on the target transmission protocol may be: judging whether to receive the successfully updated information fed back by the wireless audio playback device; if received, then connect with the wireless audio playback device based on the target transmission protocol.

具体地,无线音频播放设备在成功更新了蓝牙传输协议并且能够支持目标传输协议的时候,会反馈一个更新成功信息至电子设备,其中,该更新成功信息可以是一个文本信息或者一个参数值,电子设备解析该文本信息或参数值能够确定无线音频播放设备已经成功更新了蓝牙传输协议并且能够支持目标传输协议。另外,该更新成功信息也可以是无线音频播放设备在成功更新了蓝牙传输协议并且能够支持目标传输协议时反馈的建立连接请求,则电子设备在获取到该建立连接请求之后,基于所述目标传输协议与所述无线音频播放设备连接。Specifically, when the wireless audio playback device successfully updates the Bluetooth transmission protocol and can support the target transmission protocol, it will feed back an update success message to the electronic device, where the update success message can be a text message or a parameter value, the electronic device By parsing the text information or the parameter value, the device can determine that the wireless audio playback device has successfully updated the Bluetooth transmission protocol and can support the target transmission protocol. In addition, the update success information may also be a connection establishment request fed back by the wireless audio playback device when the Bluetooth transmission protocol has been successfully updated and can support the target transmission protocol. The protocol is connected with the wireless audio playback device.

作为另一种实施方式,还可以是电子设备在发送更新指令至无线音频播放设备之后,延时一定时间再基于所述目标传输协议与所述无线音频播放设备连接,具体地,请参阅图6所示的实施例。As another implementation manner, after the electronic device sends the update instruction to the wireless audio playback device, it delays for a certain period of time and then connects with the wireless audio playback device based on the target transmission protocol. Specifically, please refer to FIG. 6 example shown.

图6示出了本申请另一实施例提供的一种设备连接方法,应用于上述电子设备,具体地,该方法包括:S601至S605。FIG. 6 shows a device connection method provided by another embodiment of the present application, which is applied to the above electronic device. Specifically, the method includes: S601 to S605.

S601:检测待连接的无线音频播放设备是否支持目标传输协议。S601: Detect whether the wireless audio playback device to be connected supports the target transmission protocol.

S602:发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议且能够支持所述目标传输协议。S602: Send an update instruction to the wireless audio playback device, instructing the wireless audio playback device to update the supported transmission protocol and be able to support the target transmission protocol.

其中,如果无线音频播放设备支持目标传输协议则执行S605,如果无线音频播放设备不支持目标传输协议,则可以执行S603,另外,考虑到如果要播放的音频数据比较紧急,则可以不执行S603,而选择使用其他的传输协议建立连接。Wherein, if the wireless audio playback device supports the target transmission protocol, then perform S605, if the wireless audio playback device does not support the target transmission protocol, then perform S603, in addition, considering that if the audio data to be played is urgent, then S603 may not be performed, Instead, choose to use another transport protocol to establish the connection.

具体地,确定电子设备当前欲通过无线音频播放设备播放的音频数据,作为目标音频数据,具体地,可以是电子设备当前正在播放音频数据,但是,没有通过无线音频播放设备播放该音频数据,而是通过其他播放设备,例如,电子设备的扬声器或者有线耳机播放音频数据,此时用户停止使用该其他播放设备,建立电子设备与无线音频播放设备的连接,从而继续通过该无线音频播放设备播放该音频数据。Specifically, it is determined that the audio data that the electronic device currently wants to play through the wireless audio playback device is used as the target audio data. Specifically, it may be that the electronic device is currently playing audio data, but the audio data is not played through the wireless audio playback device, but It is to play audio data through other playback devices, such as speakers of electronic devices or wired headphones. At this time, the user stops using the other playback devices, establishes a connection between the electronic device and the wireless audio playback device, and continues to play the audio data through the wireless audio playback device. audio data.

则电子设备确定该目标音频数据的实时性级别,如果该目标音频数据的实时性级别高于预设级别,则基于预设传输协议与所述无线音频播放设备连接。其中,预设传输协议为电子设备曾经与无线音频播放设备连接时所使用的传输协议,具体地,可以是电子设备内设置有电子设备与无线音频播放设备连接记录,该连接记录内记录有电子设备与无线音频播放设备每次连接的时间点以及所使用的传输协议,则将该连接记录内的传输协议中的一个传输协议作为预设传输协议,具体地,可以是选择最近连接所使用的传输协议作为预设传输协议。另外,该预设传输协议还可以是基本传输协议,例如,可以是支持蓝牙连接的所有设备都支持的基本传输协议。The electronic device determines the real-time level of the target audio data, and if the real-time level of the target audio data is higher than a preset level, connects with the wireless audio playback device based on a preset transmission protocol. The preset transmission protocol is the transmission protocol used when the electronic device was once connected to the wireless audio playback device. Specifically, it may be that the electronic device is provided with a connection record between the electronic device and the wireless audio playback device, and the connection record records the electronic device. The time point of each connection between the device and the wireless audio playback device and the transmission protocol used, then one of the transmission protocols in the connection record is used as the default transmission protocol. The transport protocol is used as the default transport protocol. In addition, the preset transmission protocol may also be a basic transmission protocol, for example, may be a basic transmission protocol supported by all devices supporting Bluetooth connection.

音频数据存在实时性级别,一些数据的实时性要求高,例如,语音聊天或者视频聊天内的音频数据,或者通话过程中的语音,也或者与视频同步播放的音频。而一些数据的实时性要求低,比如,播放的歌曲等,即纯歌曲而非视频。Audio data has a real-time level, and some data have high real-time requirements, for example, audio data in voice chat or video chat, or voice during a call, or audio played synchronously with video. However, some data have low real-time requirements, such as playing songs, etc., that is, pure songs instead of videos.

作为一种实施方式,确定音频数据对应的应用程序的标识,再根据该应用程序的标识确定音频数据的实时性级别。具体地,确定发送该音频数据的播放请求的目标应用程序的标识,再确定该目标应用程序的标识所对应的应用程序的类型。As an implementation manner, the identifier of the application program corresponding to the audio data is determined, and then the real-time level of the audio data is determined according to the identifier of the application program. Specifically, the identifier of the target application that sends the playback request of the audio data is determined, and then the type of the application corresponding to the identifier of the target application is determined.

在获取到目标应用程序的标识之后,根据该标识确定目标应用程序的类型,其中,目标应用程序的标识可以是应用程序的包名、名称等。例如,电子设备内预先存储有应用程序的标识和和应用程序的类别的对应关系,如下表1所示:After the identifier of the target application is acquired, the type of the target application is determined according to the identifier, where the identifier of the target application may be the package name, name, etc. of the application. For example, the identification of the application program and the corresponding relationship with the category of the application program are pre-stored in the electronic device, as shown in Table 1 below:

表1Table 1

应用程序的标识Application ID 应用程序的类别category of application Apk1Apk1 游戏game Apk2Apk2 视频video Apk3Apk3 音频 audio

由此,根据上述表1所示的应用程序的标识和和应用程序的类别的对应关系,就能够确定目标应用程序所对应的应用程序的类别。例如,于本申请实施例中,通过无线音频播放设备播放电子设备的游戏软件的游戏画面,该游戏画面包括图像以及音乐,该音乐可以是游戏音乐、游戏音效等,例如,该游戏音效可以是枪声或者脚步声。则作为一种实施例,音频数据可以是游戏音效,则该游戏音效对应的应用程序是某某游戏APP,所属的类别是游戏类型,然后根据应用程序的类型确定所述音频数据的类型,具体地,可以将应用程序的类型作为音频数据的类型,例如,应用程序的类型为游戏,则音频数据的类型也为游戏。In this way, according to the corresponding relationship between the identifier of the application program and the category of the application program shown in Table 1, the category of the application program corresponding to the target application program can be determined. For example, in the embodiment of the present application, the game screen of the game software of the electronic device is played through the wireless audio playback device, and the game screen includes images and music, and the music may be game music, game sound effects, etc. For example, the game sound effects may be Gunshots or footsteps. As an example, the audio data may be game sound effects, the application program corresponding to the game sound effects is a certain game APP, and the category to which it belongs is a game type, and then the type of the audio data is determined according to the type of the application program. The type of the application can be used as the type of the audio data. For example, if the type of the application is a game, the type of the audio data is also a game.

然后,再根据该应用程序的类型确定音频数据对应的实时性级别。具体地,电子设备内存储有应用程序的类型所对应实时性级别,如下表2所示:Then, the real-time level corresponding to the audio data is determined according to the type of the application. Specifically, the real-time level corresponding to the type of application stored in the electronic device is shown in Table 2 below:

表2Table 2

应用程序的标识Application ID 应用程序的类别category of application 实时性级别real-time level Apk1Apk1 游戏game J1J1 Apk2Apk2 视频video J2J2 Apk3Apk3 音频audio J3J3 Apk4Apk4 社交social contact J1 J1

从而就能够确定音频数据对应的实时性级别。另外,如果确定音频数据对应的应用程序的类别为音频,则能够播放音频的应用程序可能还可以播放视频,则需要对该音频数据是否为视频中的音频进行判定。Thus, the real-time level corresponding to the audio data can be determined. In addition, if it is determined that the category of the application program corresponding to the audio data is audio, the application program that can play audio may also play video, and it is necessary to determine whether the audio data is audio in the video.

具体地,在一些实施例中,判断当前是否正在播放视频,具体地,电子设备在播放视频的时候,会将视频中的音频数据提取出发送至系统内的音频处理模块,以调用电子设备内音频处理电路,即将音频数据发送至音频处理电路以进行音频的编码等操作,因此在接收到音频数据的播放请求之后,判断当前是否正在播放视频,如果是,则表示当前要播放的音频是属于当前正在播放的视频内的音频数据的,即音频数据属于视频中的音频。Specifically, in some embodiments, it is determined whether a video is currently being played. Specifically, when the electronic device is playing a video, it will extract the audio data in the video and send it to the audio processing module in the system to call the electronic device. The audio processing circuit sends the audio data to the audio processing circuit for audio encoding and other operations. Therefore, after receiving the playback request of the audio data, it determines whether the video is currently being played. If so, it means that the audio to be played currently belongs to The audio data in the video currently being played, that is, the audio data belongs to the audio in the video.

在另一些实施例中,电子设备在播放视频的流程为,数据解协议、解封装之后,分为音频解码和视频解码,将解码后的音频数据送入音频播放设备播放,将视频数据送入视频播放设备播放。所以,为了方便将视频和音频同步播放,会将视频中的音频和视频帧设置相似的标识,例如,音频和视频帧都使用A+B的标识格式,其中,A为前序部分,用于表示属于某个视频,则在获取到要播放的音频数据时,根据该音频数据的标识的格式就能够确定该音频是否对应有视频帧,即是否属于视频中的音频。In some other embodiments, the process of the electronic device playing the video is: after data de-protocol and de-encapsulation, it is divided into audio decoding and video decoding, the decoded audio data is sent to the audio playback device for playback, and the video data is sent to Video playback device playback. Therefore, in order to facilitate the simultaneous playback of video and audio, the audio and video frames in the video will be set with similar identifiers. For example, both audio and video frames use the A+B identifier format, where A is the preamble, which is used for Indicates that it belongs to a certain video, then when the audio data to be played is acquired, it can be determined whether the audio corresponds to a video frame, that is, whether it belongs to the audio in the video, according to the format of the identification of the audio data.

而如果在确定音频数据对应的应用程序的类别是音频类之后,再确定该音频数据是否为视频中的音频,如果是,则确定更改音频数据的实时性级别为视频类应用程序对应的实时性级别,而非音频类应用程序对应的实时性级别。However, if it is determined that the category of the application corresponding to the audio data is the audio category, it is then determined whether the audio data is audio in the video, and if so, it is determined that the real-time level of the audio data is changed to the real-time level corresponding to the video-type application. level, rather than the real-time level corresponding to audio applications.

在获取到目标音频数据的实时性级别之后,判断所述实时性级别是否高于预设级别。判断所述音频数据的实时性级别是否属于大于预设级别。其中,预设级别为预先设定的需要减少音频播放延时的类型对应的实时性级别,可以是用户根据需求而设定的。例如,预设级别为J2及以上。则如果音频数据对应的实时性级别为J1,则音频数据的实时性级别大于预设级别,否则,则判定小于或等于预设级别。如果大于预设级别,则基于预设传输协议与所述无线音频播放设备连接,从而放弃执行本次方法。After acquiring the real-time level of the target audio data, it is determined whether the real-time level is higher than a preset level. It is judged whether the real-time level of the audio data belongs to a level greater than a preset level. The preset level is a preset real-time level corresponding to the type of audio playback delay that needs to be reduced, and may be set by the user according to requirements. For example, the preset level is J2 and above. Then, if the real-time level corresponding to the audio data is J1, the real-time level of the audio data is greater than the preset level; otherwise, it is determined to be less than or equal to the preset level. If it is greater than the preset level, connect to the wireless audio playback device based on the preset transmission protocol, thereby giving up executing this method.

S603:以更新时间点为起点,计时预设时间长度,其中,所述更新时间点为发送所述更新指令的时间点。S603: Starting from an update time point, time a preset time length, where the update time point is the time point at which the update instruction is sent.

其中,预设时间长度可以是用户根据需求而设定,一般可以设定一个时间较长的数值,但是又要考虑到用户的感受,而不能时间过长,则可以通过统计用户对等待更新时间长度的期望时间,则在设定预设时间长度的时候,该预设时间长度小于或等于该期望时间。Among them, the preset time length can be set by the user according to the needs. Generally, a long time value can be set, but the user's feeling must be taken into consideration, and the time cannot be too long. If the preset time length is set, the preset time length is less than or equal to the desired time.

另外,考虑到电子设备与所述无线音频播放设备之间的信道的信道质量过差的话,电子设备发送至无线音频播放设备所需要的时间长度更久,则需要根据信道质量确定所述预设时间长度。具体地,电子设备与所述无线音频播放设备之间的信道的信道质量的获取方式可以参考前述实施例,在此不再赘述。在获取到信道质量之后,根据信道质量确定预设时间长度,作为一种实施方式,可以是确定信道质量对应的数据传输速率,以及电子设备发送至无线音频播放设备时的更新数据包的大小,根据数据传输速率和更新数据包的大小确定将更新数据包的所有内容传输至无线音频播放设备所需要的第一最大时间长度,设定预设时间长度大于或等于第一最大时间长度。In addition, considering that if the channel quality of the channel between the electronic device and the wireless audio playback device is too poor, the time required for the electronic device to send to the wireless audio playback device is longer, and the preset needs to be determined according to the channel quality. length of time. Specifically, for the acquisition method of the channel quality of the channel between the electronic device and the wireless audio playback device, reference may be made to the foregoing embodiments, and details are not described herein again. After the channel quality is obtained, the preset time length is determined according to the channel quality. As an implementation manner, the data transmission rate corresponding to the channel quality and the size of the update data packet when the electronic device sends to the wireless audio playback device can be determined, According to the data transmission rate and the size of the update data packet, determine the first maximum time length required to transmit all the content of the update data packet to the wireless audio playback device, and set the preset time length to be greater than or equal to the first maximum time length.

另外,如果电子设备没有发送更新数据包至无线音频播放设备,而是发送指示信息至无线音频播放设备,指示无线音频播放设备在数据服务器下载目标传输协议对应的数据包,根据该数据包的安装能够使得无线音频播放设备支持目标传输协议,则由于指示信息的数据量很小,则电子设备与无线音频播放设备之间的信道质量对指示信息的传输的影响很小,则电子设备发送下载速录获取请求至无线音频播放设备,指示无线音频播放设备根据该下载速录获取请求获取数据服务器与无线音频播放设备之间的下载速率,即无线音频播放设备从数据服务器下载数据时的下载速率,并将该下载速率返回值电子设备。电子设备根据更新数据包与下载速率,确定无线音频播放设备将更新数据包的所有内容从数据服务器下载至无线音频播放设备所需要的第二最大时间长度,设定预设时间长度大于或等于第一最大时间长度。In addition, if the electronic device does not send the update data packet to the wireless audio playback device, but sends instruction information to the wireless audio playback device, instructing the wireless audio playback device to download the data packet corresponding to the target transmission protocol in the data server, according to the installation of the data packet If the wireless audio playback device can be made to support the target transmission protocol, since the data volume of the indication information is very small, the channel quality between the electronic device and the wireless audio playback device has little influence on the transmission of the indication information, and the electronic device sends the download speed. record the acquisition request to the wireless audio playback device, instruct the wireless audio playback device to acquire the download rate between the data server and the wireless audio playback device according to the download quick record acquisition request, that is, the download rate when the wireless audio playback device downloads data from the data server, and return that download rate to the value electronic device. The electronic device determines the second maximum time length required by the wireless audio playback device to download all the contents of the update data package from the data server to the wireless audio playback device according to the update data package and the download rate, and the preset time length is set to be greater than or equal to the first time. a maximum length of time.

因此,设定预设时间长度大于或等于第一最大时间长度之前还包括,确定电子设备发送指示信息还是更新数据包至无线音频播放设备,如果是发送指示信息至无线音频播放设备,则发送下载速录获取请求至无线音频播放设备,指示无线音频播放设备根据该下载速录获取请求获取数据服务器与无线音频播放设备之间的下载速率,并将该下载速率返回值电子设备,电子设备根据更新数据包与下载速率,确定无线音频播放设备将更新数据包的所有内容从数据服务器下载至无线音频播放设备所需要的第二最大时间长度,设定预设时间长度大于或等于第一最大时间长度。如果发送更新数据包至无线音频播放设备,则获取所述电子设备与所述无线音频播放设备之间的信道对应的信道质量,基于所述信道质量确定所述预设时间长度。Therefore, before setting the preset time length to be greater than or equal to the first maximum time length, it also includes determining whether the electronic device sends the instruction information or the update data packet to the wireless audio playback device. The quick recording acquisition request is sent to the wireless audio playback device, and the wireless audio playback device is instructed to acquire the download rate between the data server and the wireless audio playback device according to the download quick recording acquisition request, and the download rate is returned to the electronic device. Data package and download rate, determine the second maximum time length required by the wireless audio playback device to download all the contents of the update data package from the data server to the wireless audio playback device, and set the preset time length to be greater than or equal to the first maximum time length . If the update data packet is sent to the wireless audio playback device, the channel quality corresponding to the channel between the electronic device and the wireless audio playback device is acquired, and the preset time length is determined based on the channel quality.

S604:判断计时是否结束。S604: Determine whether the timing is over.

具体地,判断计时时间长度是否大于预设时间长度,如果大于,则判定技术结束,则执行S605,否则,返回执行S604。Specifically, it is judged whether the timing time length is greater than the preset time length, and if it is greater than the preset time length, it is judged that the technology is over, and the execution of S605 is performed; otherwise, the execution of S604 is returned.

S605:基于所述目标传输协议与所述无线音频播放设备连接。S605: Connect with the wireless audio playback device based on the target transmission protocol.

示例性,当用户操作电子设备播放音频数据的时候,点击播放按钮,此时通过电子设备的扬声器或者有线耳机等设备播放该音频数据,例如,是正在和别人语音聊天或者正在通话,则此时用户点击切换按钮,将音频输出设备从扬声器或者有线耳机切换至未连接的无线音频播放设备播放,则电子设备会先发起连接请求至无线音频播放设备,在建立连接之后再通过无线音频播放设备继续播放该音频数据。Exemplarily, when the user operates the electronic device to play audio data, clicks the play button, and the audio data is played through a device such as a speaker of the electronic device or a wired headset. The user clicks the switch button to switch the audio output device from the speaker or wired headset to the unconnected wireless audio playback device, then the electronic device will first initiate a connection request to the wireless audio playback device, and then continue through the wireless audio playback device after the connection is established Play the audio data.

则电子设备在与无线音频播放设备建立连接的时候,确定要与无线音频播放设备连接所使用的目标传输协议,检测无线音频播放设备是否支持目标传输协议,如果支持,则基于目标传输协议与所述无线音频播放设备连接,并控制无线音频播放设备继续播放音频数据。Then when the electronic device establishes a connection with the wireless audio playback device, it determines the target transmission protocol to be used to connect with the wireless audio playback device, and detects whether the wireless audio playback device supports the target transmission protocol. The wireless audio playback device is connected, and the wireless audio playback device is controlled to continue playing audio data.

具体地,可以是在获取到用户将音频输出设备从扬声器或者有线耳机切换至未连接的无线音频播放设备播放时的音频数据的播放时间点作为音频数据的播放进度,则在电子设备在与无线音频播放设备建立连接之后,控制无线音频播放设备以音频数据的播放进度继续播放音频数据。Specifically, the playback time point of the audio data when the user switches the audio output device from the speaker or wired earphone to the unconnected wireless audio playback device can be obtained as the playback progress of the audio data, then when the electronic device is connected to the wireless After the audio playback device is connected, the wireless audio playback device is controlled to continue to play the audio data at the playback progress of the audio data.

则如果检测到无线音频播放设备不支持目标传输协议,则确定音频数据的实时性级别,如果该实时性级别大于预设级别,在电子设备采用基本传输协议与无线音频播放设备建立连接,然后,控制无线音频播放设备继续播放音频数据。而如果该实时性级别小于或等于预设级别,则以更新时间点为起点,计时预设时间长度,若计时结束,则基于所述目标传输协议与所述无线音频播放设备连接,然后控制无线音频播放设备继续播放音频数据。Then, if it is detected that the wireless audio playback device does not support the target transmission protocol, the real-time level of the audio data is determined, and if the real-time level is greater than the preset level, the electronic device uses the basic transmission protocol to establish a connection with the wireless audio playback device, and then, Control the wireless audio playback device to continue playing audio data. If the real-time level is less than or equal to the preset level, the update time point is used as the starting point, and the preset time length is counted. If the timing ends, the wireless audio playback device is connected to the wireless audio playback device based on the target transmission The audio playback device continues to play audio data.

请参阅图7,其示出了本申请实施例提供的一种设备连接装置700的结构框图,该装置可以包括:检测单元701、发送单元702和连接单元703。Please refer to FIG. 7 , which shows a structural block diagram of a device connection apparatus 700 provided by an embodiment of the present application. The apparatus may include: a detection unit 701 , a transmission unit 702 , and a connection unit 703 .

检测单元701,用于检测待连接的无线音频播放设备是否支持目标传输协议。The detection unit 701 is configured to detect whether the wireless audio playback device to be connected supports the target transmission protocol.

发送单元702,用于如果不支持,发送更新指令至所述无线音频播放设备,指示所述无线音频播放设备更新所支持的传输协议且能够支持所述目标传输协议。The sending unit 702 is configured to send an update instruction to the wireless audio playback device if it is not supported, instructing the wireless audio playback device to update the supported transmission protocol and be able to support the target transmission protocol.

连接单元703,用于基于所述目标传输协议与所述无线音频播放设备连接。A connection unit 703, configured to connect with the wireless audio playback device based on the target transmission protocol.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described devices and modules, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In several embodiments provided in this application, the coupling between the modules may be electrical, mechanical or other forms of coupling.

另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically alone, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules.

请参考图8,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、蓝牙模块140以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 8 , which shows a structural block diagram of an electronic device provided by an embodiment of the present application. The electronic device 100 may be an electronic device capable of running an application program, such as a smart phone, a tablet computer, an electronic book, or the like. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, a Bluetooth module 140, and one or more application programs, wherein the one or more application programs may be stored in the memory 120 and accessed by Configured to be executed by one or more processors 110, the one or more programs are configured to execute the methods described in the foregoing method embodiments.

处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列 (ProgrammableLogic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(CentralProcessing Unit,CPU)、图像处理器 (Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing the instructions, programs, code sets or instruction sets stored in the memory 120, and calling the data stored in the memory 120. Various functions of the electronic device 100 and processing data. Optionally, the processor 110 may employ at least one of a digital signal processing (Digital Signal Processing, DSP), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and a Programmable Logic Array (Programmable Logic Array, PLA). implemented in hardware. The processor 110 may integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU), a modem, and the like. Among them, the CPU mainly handles the operating system, user interface and application programs, etc.; the GPU is used for rendering and drawing of the display content; the modem is used to handle wireless communication. It can be understood that, the above-mentioned modem may also not be integrated into the processor 110, and is implemented by a communication chip alone.

存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储电子设备100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (Random Access Memory, RAM), or may include read-only memory (Read-Only Memory). Memory 120 may be used to store instructions, programs, codes, sets of codes, or sets of instructions. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.) , instructions for implementing the following method embodiments, and the like. The storage data area may also store data (such as phone book, audio and video data, chat record data) created by the electronic device 100 during use.

蓝牙模块140用于实现电子设备与蓝牙设备之间的蓝牙连接,以及与蓝牙设备之间的数据交互。具体地,可以与蓝牙设备通过蓝牙协议 5.0/4.2/4.1/2.1/2.0,也可以通过蓝牙低能耗技术(Bluetooh Low Energy, BLE)、蓝牙增强速率技术(Enhanced Data Rate,EDR)或者蓝牙基本速率 (Base Rate,BR)等。则蓝牙模块140可以包括功率放大器、无线收发器、收发切换器、低噪声放大器以及天线等。发送信号时,收发器本身会直接输出小功率的微弱的射频信号,送至功率放大器(Power Amplifier,PA)进行功率放大,然后通过收发切换器(Transmit/Receive Switch)经由天线 (Antenna)辐射至空间。接收信号时,天线会感应到空间中的电磁信号,通过切换器之后送至低噪声放大器(Low Noise Amplifier,LNA)进行放大,这样,放大后的信号就可以直接送给收发器进行处理,进行解调,该蓝牙模块140可以使用2.4GHz频段。The Bluetooth module 140 is used to realize the Bluetooth connection between the electronic device and the Bluetooth device, and the data interaction with the Bluetooth device. Specifically, it can communicate with the Bluetooth device through the Bluetooth protocol 5.0/4.2/4.1/2.1/2.0, or through the Bluetooth low energy technology (Bluetooh Low Energy, BLE), Bluetooth enhanced rate technology (Enhanced Data Rate, EDR) or Bluetooth basic rate (Base Rate, BR) and so on. Then the Bluetooth module 140 may include a power amplifier, a wireless transceiver, a transceiver switch, a low noise amplifier, an antenna, and the like. When sending a signal, the transceiver itself will directly output a low-power weak radio frequency signal, send it to a power amplifier (Power Amplifier, PA) for power amplification, and then radiate it through an antenna (Antenna) through the Transmit/Receive Switch. space. When receiving the signal, the antenna will sense the electromagnetic signal in the space, and then send it to the Low Noise Amplifier (LNA) for amplification after passing through the switch. In this way, the amplified signal can be directly sent to the transceiver for processing. For demodulation, the Bluetooth module 140 can use the 2.4GHz frequency band.

请参考图9,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读存储介质900中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 9 , which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable storage medium 900 stores program codes, and the program codes can be invoked by the processor to execute the methods described in the above method embodiments.

计算机可读存储介质900可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质900包括非易失性计算机可读介质(non-transitory computer- readable storage medium)。计算机可读存储介质900具有执行上述方法中的任何方法步骤的程序代码910的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码910可以例如以适当形式进行压缩。The computer-readable storage medium 900 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 900 includes a non-transitory computer-readable storage medium. Computer readable storage medium 900 has storage space for program code 910 to perform any of the method steps in the above-described methods. These program codes can be read from or written to one or more computer program products. Program code 910 may be compressed, for example, in a suitable form.

最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: it can still be Modifications are made to the technical solutions described in the foregoing embodiments, or some technical features thereof are equivalently replaced; and these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (9)

1. A device connection method is applied to an electronic device, and the method comprises the following steps:
when the electronic equipment plays target audio data through other equipment, if a switching request for switching to the playing of the unconnected wireless audio playing equipment is acquired, determining a target transmission protocol used for connecting with the wireless audio playing equipment, wherein the other equipment is equipment which can play audio data and is other than the wireless audio playing equipment;
detecting whether a wireless audio playing device to be connected supports a target transmission protocol or not;
if so, connecting the wireless audio playing device based on a target transmission protocol, and controlling the wireless audio playing device to continue playing the target audio data at a playing progress, wherein the playing progress is a playing time point of the target audio data when the switching request is obtained;
if not, acquiring the real-time level of the target audio data;
if the real-time level of the target audio data is higher than a preset level, connecting the target audio data with the wireless audio playing equipment based on a preset transmission protocol, and controlling the wireless audio playing equipment to continuously play the target audio data according to the playing progress, wherein the preset transmission protocol is a transmission protocol used when the electronic equipment is connected with the wireless audio playing equipment;
if the real-time level of the target audio data is not higher than the preset level, sending an updating instruction to the wireless audio playing equipment to instruct the wireless audio playing equipment to update the supported transmission protocol and support the target transmission protocol;
and connecting the target transmission protocol with the wireless audio playing equipment based on the target transmission protocol, and controlling the wireless audio playing equipment to continuously play the target audio data at the playing progress.
2. The method of claim 1, wherein the detecting whether the wireless audio playback device to be connected supports the target transport protocol comprises:
sending a protocol inquiry instruction to the wireless audio playing device, wherein the protocol inquiry instruction is used for inquiring whether the wireless audio playing device supports a target transmission protocol;
acquiring an inquiry result returned by the wireless audio playing equipment;
and determining whether the wireless audio playing equipment to be connected supports the target transmission protocol or not based on the inquiry result.
3. The method of claim 1, wherein the sending an update instruction to the wireless audio playback device instructing the wireless audio playback device to update the supported transport protocol so that the target transport protocol can be supported, if not supported, comprises:
and if not, sending an update data packet to the wireless audio playing device, and indicating the wireless audio playing device to update the supported transmission protocol according to the update data packet so as to support the target transmission protocol.
4. The method of claim 1, wherein the connecting with the wireless audio playback device based on the target transport protocol comprises:
judging whether successfully updated information fed back by the wireless audio playing equipment is received or not;
and if so, connecting the wireless audio playing device based on the target transmission protocol.
5. The method of claim 1, wherein the connecting with the wireless audio playback device based on the target transport protocol comprises:
timing a preset time length by taking an updating time point as a starting point, wherein the updating time point is a time point for sending the updating instruction;
and if the timing is finished, connecting the wireless audio playing equipment based on the target transmission protocol.
6. The method of claim 5, wherein the counting the preset time length starting from the update time point further comprises:
acquiring channel quality corresponding to a channel between the electronic equipment and the wireless audio playing equipment;
determining the preset time length based on the channel quality.
7. The method of any of claims 1-6, wherein the target transmission protocol comprises a true wireless stereo protocol.
8. An electronic device, comprising:
one or more processors;
a memory;
one or more computer programs, wherein the one or more computer programs are stored in the memory and configured to be executed by the one or more processors, the one or more computer programs configured to perform the method of any of claims 1-7.
9. A computer-readable medium, in which a computer program is stored which can be invoked by a processor to perform the method according to any one of claims 1 to 7.
CN201811161268.8A 2018-09-30 2018-09-30 Device connection method, electronic device, and computer-readable medium Expired - Fee Related CN109450851B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811161268.8A CN109450851B (en) 2018-09-30 2018-09-30 Device connection method, electronic device, and computer-readable medium
PCT/CN2019/096611 WO2020063062A1 (en) 2018-09-30 2019-07-18 Device connection method and apparatus, electronic device, and computer-readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811161268.8A CN109450851B (en) 2018-09-30 2018-09-30 Device connection method, electronic device, and computer-readable medium

Publications (2)

Publication Number Publication Date
CN109450851A CN109450851A (en) 2019-03-08
CN109450851B true CN109450851B (en) 2020-09-22

Family

ID=65546119

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811161268.8A Expired - Fee Related CN109450851B (en) 2018-09-30 2018-09-30 Device connection method, electronic device, and computer-readable medium

Country Status (2)

Country Link
CN (1) CN109450851B (en)
WO (1) WO2020063062A1 (en)

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109450851B (en) * 2018-09-30 2020-09-22 Oppo广东移动通信有限公司 Device connection method, electronic device, and computer-readable medium
CN114501397A (en) * 2020-10-28 2022-05-13 华为技术有限公司 Communication method, electronic equipment and system
CN112637755A (en) * 2020-12-22 2021-04-09 广州番禺巨大汽车音响设备有限公司 Audio playing control method, device and playing system based on wireless connection
WO2022152320A1 (en) 2021-01-14 2022-07-21 海信视像科技股份有限公司 Display device and sound and picture parameter adjusting method
CN114302190B (en) * 2021-01-14 2023-07-14 海信视像科技股份有限公司 Display equipment and image quality adjusting method
CN112911086B (en) * 2021-01-29 2023-10-10 卡莱特云科技股份有限公司 Classification control method and device for batch video processing equipment
CN115226096A (en) * 2021-03-29 2022-10-21 华为技术有限公司 Method and system for continuing playing of audio
CN113423142B (en) * 2021-06-11 2023-06-27 泰凌微电子(上海)股份有限公司 Wireless signal transmission method and device
CN114171018A (en) * 2021-11-08 2022-03-11 科大讯飞股份有限公司 Voice transmission method, receiving end, user end and voice transmission system
CN116634031A (en) * 2022-02-10 2023-08-22 Oppo广东移动通信有限公司 A communication method, device, equipment and storage medium
CN119545578A (en) * 2023-08-29 2025-02-28 华为技术有限公司 Device connection method, electronic device and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771707A (en) * 2010-02-08 2010-07-07 中兴通讯股份有限公司 Method for realizing resource share among terminals, resource processing system and terminals
CN105302752A (en) * 2015-10-20 2016-02-03 北京小鸟听听科技有限公司 Connection method of audio equipment and audio playing device
CN106408912A (en) * 2016-09-09 2017-02-15 惠州Tcl移动通信有限公司 AVRCP (audio video remote control profile) instruction allocation method and system based on device types
CN106970783A (en) * 2016-09-06 2017-07-21 上海赫千电子科技有限公司 The communication means of on-vehicle host and electronic equipment

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8761202B2 (en) * 2004-09-27 2014-06-24 Raghupathy Sivakumar Architecture for dynamically adaptive transport protocols
US8244179B2 (en) * 2005-05-12 2012-08-14 Robin Dua Wireless inter-device data processing configured through inter-device transmitted data
CN101394408A (en) * 2008-10-15 2009-03-25 中山大学 A Protocol Management System for Digital Video Surveillance System
CN106254363A (en) * 2016-08-17 2016-12-21 广州市中海达测绘仪器有限公司 The adaptive approach of wireless digital broadcasting station communication protocol and device
CN106708466A (en) * 2016-12-29 2017-05-24 深圳Tcl数字技术有限公司 Audio playing control method and device
CN109450851B (en) * 2018-09-30 2020-09-22 Oppo广东移动通信有限公司 Device connection method, electronic device, and computer-readable medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101771707A (en) * 2010-02-08 2010-07-07 中兴通讯股份有限公司 Method for realizing resource share among terminals, resource processing system and terminals
CN105302752A (en) * 2015-10-20 2016-02-03 北京小鸟听听科技有限公司 Connection method of audio equipment and audio playing device
CN106970783A (en) * 2016-09-06 2017-07-21 上海赫千电子科技有限公司 The communication means of on-vehicle host and electronic equipment
CN106408912A (en) * 2016-09-09 2017-02-15 惠州Tcl移动通信有限公司 AVRCP (audio video remote control profile) instruction allocation method and system based on device types

Also Published As

Publication number Publication date
CN109450851A (en) 2019-03-08
WO2020063062A1 (en) 2020-04-02

Similar Documents

Publication Publication Date Title
CN109450851B (en) Device connection method, electronic device, and computer-readable medium
CN111199743B (en) Audio coding format determining method and device, storage medium and electronic equipment
CN109445740B (en) Audio playback method, device, electronic device and storage medium
US11563500B2 (en) Method for electromagnetic interference control and related devices
US9501259B2 (en) Audio output device to dynamically generate audio ports for connecting to source devices
US9900692B2 (en) System and method for playback in a speaker system
CN105828134B (en) Playing control method and device in audio and video playing system
CN105142010A (en) Bluetooth connection selection method of multi-play device and main play device
CN109379490B (en) Audio playing method and device, electronic equipment and computer readable medium
WO2020063046A1 (en) Audio playback method and device, electronic device and storage medium
CN111132111B (en) BLE-based audio sharing method, system and computer readable storage medium
CN105812906A (en) Communication control method and device for playing device
KR101034554B1 (en) Method and device for controlling call quality of mobile terminal
US20240022783A1 (en) Multimedia playback synchronization
JP2023509407A (en) Multicast service processing method, multicast service configuration method, terminal and network equipment
CN106126165A (en) A kind of audio stream processing method and mobile terminal
CN106095132B (en) Method and device for setting key function of playing equipment
CN108063840A (en) Access the method and Related product of network
CN104092658B (en) Audio data play method and device
CN105703987B (en) Audio and video playing system control method and device
CN105828253A (en) Wireless connection control method and device in audio playing system
CN109155803B (en) Audio data processing method, terminal device and storage medium
CN113395576B (en) A scene switching method, computer equipment and storage medium
WO2017185655A1 (en) Method and device for controlling smart terminal
CN106686259A (en) Method and device for sharing background sound in talking process

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200922