











技术领域technical field
本申请涉及芯片技术和芯片安全领域,尤其涉及一种动态调整音频/视频远程控制协议(Audio/Video Remote Control Profile,AVRCP)版本的方法及终端设备。The present application relates to the field of chip technology and chip security, and in particular, to a method and terminal device for dynamically adjusting the version of an audio/video remote control protocol (Audio/Video Remote Control Profile, AVRCP).
背景技术Background technique
AVRCP定义了如何控制流媒体的特征,包括暂停、停止、启动重放、音量控制以及其他类型的远程控制操作。AVRCP定义了两个设备角色,即控制设备(controller,CT)和目标设备(target,TG)。CT通常为远程控制设备,TG为特征可以更改的设备。CT可通过发送命令帧到TG发起传输过程,TG可接收命令帧并按命令帧响应。CT可以为个人电脑(personalcomputer,PC)、掌上电脑(Personal Digital Assistant,PDA)、电话、车载系统、耳机和播放/录音设备等,TG可以为播放/录音设备、电视和耳机等。例如,CT为车载系统,TG为手机,当手机和车载系统通过蓝牙技术连接上时,车载系统可以控制手机进行音乐播放,显示手机上音乐播放时的状态、歌名以及歌手等信息,还可以浏览手机上的音乐文件和显示播放列表等。AVRCP defines how to control the characteristics of streaming media, including pause, stop, start playback, volume control, and other types of remote control operations. AVRCP defines two device roles, namely the control device (controller, CT) and the target device (target, TG). CT is usually a remote control device, and TG is a device whose characteristics can be changed. The CT can initiate the transmission process by sending a command frame to the TG, and the TG can receive the command frame and respond according to the command frame. CT can be a personal computer (PC), a PDA (Personal Digital Assistant, PDA), a telephone, a car system, a headset and a playback/recording device, and the TG can be a playback/recording device, a TV, and a headset. For example, CT is the in-vehicle system, and TG is the mobile phone. When the mobile phone and the in-vehicle system are connected through Bluetooth technology, the in-vehicle system can control the mobile phone to play music, display the music status, song name, singer and other information on the mobile phone. Browse music files on your phone, display playlists, and more.
AVRCP有多个服务版本,不同版本的兼容性不同,TG如果支持高版本的AVRCP,可能导致CT如果要播放TG中的音乐文件时CT侧无法显示音乐文件的歌曲信息。AVRCP has multiple service versions, and the compatibility of different versions is different. If the TG supports a higher version of AVRCP, it may cause that the CT side cannot display the song information of the music files if the CT wants to play the music files in the TG.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供一种动态调整AVRCP版本的方法,能够解决支持高版本的AVRCP的TG,可能导致CT播放TG中的音乐文件时CT无法显示歌曲信息的问题。The embodiment of the present application provides a method for dynamically adjusting the AVRCP version, which can solve the problem that a TG supporting a higher version of AVRCP may cause the CT to fail to display song information when the CT plays a music file in the TG.
第一方面,提供一种动态调整AVRCP版本的方法,应用于终端设备;终端设备包括媒体播放器,该方法包括:终端设备响应于对端设备发送的第一服务发现协议SDP请求消息,向对端设备发送第一SDP响应消息,第一SDP响应消息携带第一AVRCP版本的版本号;终端设备响应对端设备发送的至少两个浏览请求消息,浏览请求消息用于对端设备请求显示媒体播放器的媒体信息;终端设备响应于对端设备发送的第二SDP请求消息,第二SDP请求消息为终端设备与对端设备断开连接后再次连接时发送的,向对端设备发送第二SDP响应消息,第二SDP响应消息携带第二AVRCP版本的版本号,第二AVRCP版本的版本号低于第一AVRCP版本的版本号。第一AVRCP版本可以表征终端设备支持对端设备可查询终端设备的媒体播放器列表,第二AVRCP版本可以表征终端设备不支持对端设备查询终端设备的媒体播放器列表。终端设备在回复对端设备的AVRCP版本号不同时,终端设备与对端设备后续的链路行为也不同。这样,在终端设备支持对端设备可查询终端设备的媒体播放器列表的情况下,如果终端设备接收到对端设备发送的至少两个浏览请求消息,终端设备可知道对端设备请求的媒体播放器不支持对端设备访问媒体信息,那么在下一次连接时,终端设备可以将终端设备的第一AVRCP版本降为第二AVRCP版本,对端设备就不会向终端设备发送该浏览请求消息,以避开终端设备支持对端设备可查询终端设备的媒体播放器列表,但是对端设备请求的媒体播放器不支持对端设备访问媒体信息的情况,也就避免了对端设备访问不到媒体播放器的媒体信息导致对端设备无法显示媒体信息的问题。其中的终端设备例如可以为手机,对端设备为车载设备,媒体播放器为音乐播放器,媒体信息为音乐播放器的音乐文件夹的歌曲信息。A first aspect provides a method for dynamically adjusting an AVRCP version, which is applied to a terminal device; the terminal device includes a media player, and the method includes: the terminal device responds to a first service discovery protocol SDP request message sent by the opposite terminal The terminal device sends a first SDP response message, where the first SDP response message carries the version number of the first AVRCP version; the terminal device responds to at least two browsing request messages sent by the peer device, and the browse request messages are used for the peer device to request display media playback media information of the device; the terminal device responds to the second SDP request message sent by the opposite end device, and the second SDP request message is sent when the terminal device is disconnected from the opposite end device and reconnects, and sends the second SDP to the opposite end device. In the response message, the second SDP response message carries the version number of the second AVRCP version, and the version number of the second AVRCP version is lower than the version number of the first AVRCP version. The first AVRCP version can represent that the terminal device supports the peer device and can query the media player list of the terminal device, and the second AVRCP version can represent that the terminal device does not support the peer device to query the media player list of the terminal device. When the terminal device replies with different AVRCP version numbers of the peer device, the subsequent link behavior between the terminal device and the peer device is also different. In this way, when the terminal device supports that the peer device can query the media player list of the terminal device, if the terminal device receives at least two browsing request messages sent by the peer device, the terminal device can know the media playback requested by the peer device. If the remote device does not support the peer device to access media information, the terminal device can downgrade the first AVRCP version of the terminal device to the second AVRCP version during the next connection, and the peer device will not send the browse request message to the terminal device. To avoid the situation that the terminal device supports the peer device and can query the media player list of the terminal device, but the media player requested by the peer device does not support the peer device to access media information, which also prevents the peer device from accessing media playback. The media information of the remote device causes the problem that the media information of the peer device cannot be displayed. The terminal device may be, for example, a mobile phone, the peer device is a vehicle-mounted device, the media player is a music player, and the media information is song information of a music folder of the music player.
在一种可能的设计中,第一AVRCP版本的版本号为AVRCP1.4,第二AVRCP版本的版本号为AVRCP1.3。即,当终端设备的AVRCP版本为AVRCP1.4,对端设备可查询终端设备的媒体播放器列表,当终端设备的AVRCP版本为AVRCP1.3,对端设备后续不查询终端设备的媒体播放器列表,也不向终端设备的媒体播放器请求浏览媒体信息,也就避免了终端设备支持对端设备可查询终端设备的媒体播放器列表,但是终端设备的媒体播放器不支持访问媒体信息从而导致对端设备无法显示媒体信息问题。In a possible design, the version number of the first AVRCP version is AVRCP1.4, and the version number of the second AVRCP version is AVRCP1.3. That is, when the AVRCP version of the terminal device is AVRCP1.4, the peer device can query the media player list of the terminal device. When the AVRCP version of the terminal device is AVRCP1.3, the peer device will not query the media player list of the terminal device subsequently. , and also does not request the media player of the terminal device to browse media information, which prevents the terminal device from supporting the peer device to query the media player list of the terminal device, but the media player of the terminal device does not support accessing media information, which leads to The end device cannot display media information.
在一种可能的设计中,当终端设备接收到一个浏览请求消息时,该方法还包括:终端设备向对端设备发送浏览响应消息,浏览响应消息指示媒体播放器不支持对端设备请求显示媒体播放器的媒体信息。媒体播放器例如可以为网易云音乐、QQ音乐和酷狗音乐等。媒体信息例如可以为网易云音乐的歌曲信息。媒体播放器不支持对端设备请求显示媒体播放器的媒体信息可以理解为媒体播放器不支持AVRCP浏览(browsing)。由于不支持AVRCPbrowsing,对端设备会重复地向终端设备发送浏览请求消息,终端设备识别出这种重复发送的行为说明对端设备请求的媒体播放器不支持AVRCP浏览。In a possible design, when the terminal device receives a browsing request message, the method further includes: the terminal device sends a browsing response message to the peer device, where the browsing response message indicates that the media player does not support the peer device's request to display media Media information for the player. For example, the media player may be NetEase Cloud Music, QQ Music, Kugou Music, and so on. The media information can be, for example, song information of NetEase Cloud Music. If the media player does not support the peer device's request to display the media information of the media player, it can be understood that the media player does not support AVRCP browsing (browsing). Since AVRCP browsing is not supported, the peer device will repeatedly send browsing request messages to the terminal device. The terminal device recognizes that the repeated sending behavior indicates that the media player requested by the peer device does not support AVRCP browsing.
在一种可能的设计中,若终端设备接收到至少两个浏览请求消息,则该方法还包括:终端设备将对端设备的设备信息记录在预置的设备信息集合中;在终端设备向对端设备发送第二SDP响应消息之前,该方法还包括:终端设备查询对端设备的设备信息是否在预置的设备信息集合中;若对端设备的设备信息在预置的设备信息集合中,则终端设备确定向对端设备发送第二SDP响应消息。如果对端设备的设备信息在预置的设备信息集合中,说明终端设备与对端设备上一次连接过程中出现了对端设备无法访问终端设备的媒体播放器的媒体信息的行为,相当于将这种历史行为记录下来,以便终端设备与对端设备断开后再次连接时,如果对端设备请求获知终端设备的AVRCP版本时,终端设备降版本回复给对端设备,以便终端设备与对端设备的链路行为发生变化,避免对端设备再次发送出现媒体信息无法访问的浏览请求消息。In a possible design, if the terminal device receives at least two browsing request messages, the method further includes: the terminal device records the device information of the peer device in a preset device information set; Before the end device sends the second SDP response message, the method further includes: the terminal device inquires whether the device information of the opposite end device is in the preset device information set; if the device information of the opposite end device is in the preset device information set, Then the terminal device determines to send the second SDP response message to the opposite terminal device. If the device information of the peer device is in the preset device information set, it means that the peer device cannot access the media information of the media player of the terminal device during the last connection between the terminal device and the peer device. This historical behavior is recorded so that when the terminal device is disconnected from the peer device and reconnected, if the peer device requests to know the AVRCP version of the terminal device, the terminal device downgrades the version and replies to the peer device, so that the terminal device can communicate with the peer device. The link behavior of the device changes to prevent the peer device from sending the browse request message that the media information cannot be accessed again.
在一种可能的设计中,该方法还包括:若对端设备的设备信息不在预置的设备信息集合中,则终端设备向终端设备发送第一SDP响应消息。这里如果对端设备的设备信息不在预置的设备信息集合中,说明之前未出现对端设备请求访问终端设备的媒体播放器的媒体信息时无法访问的情况,终端设备可以正常回复对端设备AVRCP的版本号,不需要降版本回复。In a possible design, the method further includes: if the device information of the peer device is not in the preset device information set, the terminal device sends a first SDP response message to the terminal device. Here, if the device information of the peer device is not in the preset device information set, it means that the peer device cannot access the media information of the media player of the terminal device when it requests to access the media player of the terminal device before, and the terminal device can normally reply to the peer device AVRCP version number, no downgrade is required.
在一种可能的设计中,对端设备的设备信息包括对端设备的蓝牙信息,或对端设备的设备信息包括对端设备的蓝牙信息和设备类型;其中,蓝牙信息为对端设备的蓝牙地址的前三位,或蓝牙信息为对端设备的蓝牙名称,或蓝牙信息为对端设备的蓝牙地址的前三位以及蓝牙名称;预置的设备信息集合包括至少一个设备的蓝牙信息或至少一个设备的蓝牙信息和设备类型,或预置的设备信息集合为空。设备的蓝牙地址一般有六位,且设备的蓝牙地址对于每个设备来说是唯一的,如果记录设备的蓝牙地址的全六位,只能记录这一个设备,因此,可以将蓝牙地址的前三位记录下来,这样,可以将设备的厂商记录下来,也就将该厂商的其他设备都记录下来,也避免了该厂商的其他设备都出现媒体信息无法显示的情况。In a possible design, the device information of the peer device includes the Bluetooth information of the peer device, or the device information of the peer device includes the Bluetooth information and device type of the peer device; wherein the Bluetooth information is the Bluetooth information of the peer device The first three bits of the address, or the Bluetooth information is the Bluetooth name of the peer device, or the Bluetooth information is the first three bits of the Bluetooth address of the peer device and the Bluetooth name; the preset device information set includes the Bluetooth information of at least one device or at least the Bluetooth name of the peer device. The Bluetooth information and device type of a device, or the preset device information set is empty. The Bluetooth address of the device generally has six digits, and the Bluetooth address of the device is unique for each device. If all six digits of the Bluetooth address of the device are recorded, only this device can be recorded. Record three digits, so that the manufacturer of the equipment can be recorded, and other equipment of the manufacturer can be recorded, and the situation that the media information cannot be displayed on the other equipment of the manufacturer can be avoided.
在一种可能的设备中,若终端设备接收到至少两个浏览请求消息,则该方法还包括:终端设备将蓝牙配对文件中对端设备对应的AVRCP版本字段的内容置为第二AVRCP版本的版本号,蓝牙配对文件包括与终端设备进行蓝牙配对的对端设备的设备信息,设备信息包括对端设备对应的AVRCP版本字段。这样,终端设备与对端设备断开后再次连接时,可以查询蓝牙配对文件中对端设备的AVRCP版本字段的内容,以便向对端设备回复终端设备的AVRCP版本为第二ACRVP版本的版本号。In a possible device, if the terminal device receives at least two browsing request messages, the method further includes: the terminal device sets the content of the AVRCP version field corresponding to the peer device in the Bluetooth pairing file to the second AVRCP version. The version number, the Bluetooth pairing file includes the device information of the opposite end device that performs Bluetooth pairing with the terminal device, and the device information includes the AVRCP version field corresponding to the opposite end device. In this way, when the terminal device is disconnected from the peer device and reconnected, it can query the content of the AVRCP version field of the peer device in the Bluetooth pairing file, so as to reply to the peer device that the AVRCP version of the terminal device is the version number of the second ACRVP version .
在一种可能的设计中,第二SDP响应消息还包括第二AVRCP版本支持的特性;该方法还包括:终端设备将终端设备中第一AVRCP版本的特性更新为第二AVRCP版本的特性。也就是说,终端设备在回复给对端设备AVRCP的版本号时降版本回复的同时,也需要降终端设备中AVRCP版本的版本特性的参数值修改为降低后的版本的参数值,以便终端设备与对端设备根据修改后的参数值继续通信。In a possible design, the second SDP response message further includes features supported by the second AVRCP version; the method further includes: the terminal device updating the features of the first AVRCP version in the terminal device to the features of the second AVRCP version. That is to say, when the terminal device replies to the AVRCP version number of the peer device, when the version number is downgraded, it also needs to modify the parameter value of the version feature of the downgraded AVRCP version in the terminal device to the parameter value of the downgraded version, so that the terminal device can Continue to communicate with the peer device according to the modified parameter value.
在一种可能的设计中,媒体信息包括歌曲信息,歌曲信息包括歌曲名、歌曲数量、歌词以及歌曲的播放时长。In a possible design, the media information includes song information, and the song information includes the song title, the number of songs, the lyrics, and the playing time of the songs.
第二方面,提供一种终端设备,终端设备包括存储器、处理器、收发器和显示器,存储器存储有指令,当指令被处理器执行时,使得终端设备执行以下操作:响应于对端设备发送的第一SDP请求消息,向对端设备发送第一SDP响应消息,第一SDP响应消息携带第一AVRCP版本的版本号;响应对端设备发送的至少两个浏览请求消息,浏览请求消息用于对端设备请求显示媒体播放器的媒体信息,向对端设备发送每个浏览请求消息对应的浏览响应消息,浏览响应消息指示媒体播放器不支持对端设备请求显示媒体播放器的媒体信息;将对端设备的设备信息记录在预置的设备信息集合中;响应于对端设备发送的第二SDP请求消息,第二SDP请求消息为终端设备与对端设备断开连接后再次连接时发送的,查询对端设备的设备信息是否在预置的设备信息集合中;若对端设备的设备信息在预置的设备信息集合中,则向对端设备发送第二SDP响应消息;第二SDP响应消息携带第二AVRCP版本的版本号,第二AVRCP版本的版本号低于第一AVRCP版本的版本号。In a second aspect, a terminal device is provided. The terminal device includes a memory, a processor, a transceiver and a display. The memory stores an instruction. When the instruction is executed by the processor, the terminal device is made to perform the following operations: The first SDP request message sends a first SDP response message to the peer device, where the first SDP response message carries the version number of the first AVRCP version; in response to at least two browse request messages sent by the peer device, the browse request message is used to The terminal device requests to display the media information of the media player, and sends a browsing response message corresponding to each browsing request message to the peer device. The browsing response message indicates that the media player does not support the peer device's request to display the media information of the media player; The device information of the end device is recorded in the preset device information set; in response to the second SDP request message sent by the opposite end device, the second SDP request message is sent when the end device is disconnected from the opposite end device and reconnected, Query whether the device information of the peer device is in the preset device information set; if the device information of the peer device is in the preset device information set, send a second SDP response message to the peer device; the second SDP response message Carry the version number of the second AVRCP version, and the version number of the second AVRCP version is lower than the version number of the first AVRCP version.
在一种可能的设计中,第一AVRCP版本的版本号为AVRCP1.4,第二AVRCP版本的版本号为AVRCP1.3。In a possible design, the version number of the first AVRCP version is AVRCP1.4, and the version number of the second AVRCP version is AVRCP1.3.
在一种可能的设计中,该操作还包括:若对端设备的设备信息不在预置的设备信息集合中,则向终端设备发送第一SDP响应消息。In a possible design, the operation further includes: if the device information of the peer device is not in the preset device information set, sending a first SDP response message to the terminal device.
在一种可能的设计中,对端设备的设备信息包括对端设备的蓝牙信息,或对端设备的设备信息包括对端设备的蓝牙信息和设备类型;其中,蓝牙信息为对端设备的蓝牙地址的前三位,或蓝牙信息为对端设备的蓝牙名称,或蓝牙信息为对端设备的蓝牙地址的前三位以及蓝牙名称;预置的设备信息集合包括至少一个设备的蓝牙信息或至少一个设备的蓝牙信息和设备类型,或预置的设备信息集合为空。In a possible design, the device information of the peer device includes the Bluetooth information of the peer device, or the device information of the peer device includes the Bluetooth information and device type of the peer device; wherein the Bluetooth information is the Bluetooth information of the peer device The first three bits of the address, or the Bluetooth information is the Bluetooth name of the peer device, or the Bluetooth information is the first three bits of the Bluetooth address of the peer device and the Bluetooth name; the preset device information set includes the Bluetooth information of at least one device or at least the Bluetooth name of the peer device. The Bluetooth information and device type of a device, or the preset device information set is empty.
在一种可能的设计中,第二SDP响应消息还包括第二AVRCP版本支持的特性;操作还包括:将所述终端设备中所述第一AVRCP版本的特性更新为所述第二AVRCP版本的特性。In a possible design, the second SDP response message further includes the feature supported by the second AVRCP version; the operation further includes: updating the feature of the first AVRCP version in the terminal device to the feature of the second AVRCP version characteristic.
在一种可能的设计中,媒体信息包括歌曲信息,歌曲信息包括歌曲名、歌曲数量、歌词以及歌曲的播放时长。In a possible design, the media information includes song information, and the song information includes the song title, the number of songs, the lyrics, and the playing time of the songs.
第三方面,提供一种芯片,芯片包括存储器和处理器,存储器存储有指令,当指令被处理器执行时,使得芯片执行如第一方面所述的方法。In a third aspect, a chip is provided, the chip includes a memory and a processor, the memory stores instructions, and when the instructions are executed by the processor, the chip executes the method described in the first aspect.
第四方面,提供一种终端设备,包括存储器,存储器存储有计算机指令,当计算机指令被执行时,使得终端设备执行如第一方面所述的方法。In a fourth aspect, a terminal device is provided, including a memory, where computer instructions are stored in the memory, and when the computer instructions are executed, the terminal device is caused to execute the method described in the first aspect.
第五方面,提供一种计算机存储介质,所述计算机存储介质存储有计算机指令,当所述计算机指令被计算机执行时,使得所述计算机执行如第一方面所述的方法。In a fifth aspect, a computer storage medium is provided, the computer storage medium stores computer instructions that, when executed by a computer, cause the computer to perform the method according to the first aspect.
由此,本申请提供的ACRCP查询方法,能够使得对端设备无法访问终端设备的媒体播放器的媒体信息从而能无法显示该媒体信息时,终端设备对AVRCP版本进行降版本处理,使得终端设备与对端设备断开后再次连接时,根据降后的版本进行通信,避免对端设备无法访问终端设备的媒体播放器的媒体信息从而能无法显示该媒体信息的问题。Therefore, the ACRCP query method provided by the present application can make the terminal device downgrade the AVRCP version when the peer device cannot access the media information of the media player of the terminal device and thus cannot display the media information, so that the terminal device can When the peer device is disconnected and reconnected, the communication is performed according to the downgraded version, so as to avoid the problem that the peer device cannot access the media information of the media player of the terminal device and thus cannot display the media information.
附图说明Description of drawings
图1为本申请实施例提供的一种网络架构示意图;FIG. 1 is a schematic diagram of a network architecture provided by an embodiment of the present application;
图2为本申请实施例提供的一种终端设备的结构示意图;FIG. 2 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
图3为TG与CT遵循的蓝牙协议架构示意图;Figure 3 is a schematic diagram of the Bluetooth protocol architecture followed by TG and CT;
图4为TG与CT通过ACRCP查询TG与CT间的服务版本与特性之间的信号交互示意图;4 is a schematic diagram of the signal interaction between the TG and the CT querying the service version and the characteristic between the TG and the CT through ACRCP;
图4A为手机与车载设备的屏幕显示示意图;4A is a schematic diagram of a screen display of a mobile phone and a vehicle-mounted device;
图4B为手机与车载设备的屏幕显示示意图;4B is a schematic diagram of screen display of a mobile phone and a vehicle-mounted device;
图5为TG与CT通过ACRCP查询TG与CT间的服务版本与特性之间的信号交互示意图;Fig. 5 is a schematic diagram of signal interaction between TG and CT inquiring about service versions and characteristics between TG and CT through ACRCP;
图6为本申请实施例提供的一种动态调整AVRCP版本的方法的信号交互图;6 is a signal interaction diagram of a method for dynamically adjusting an AVRCP version provided by an embodiment of the present application;
图7为本申请实施例提供的一种动态调整AVRCP版本的方法的信号交互图;7 is a signal interaction diagram of a method for dynamically adjusting an AVRCP version provided by an embodiment of the present application;
图8为本申请实施例提供的一种芯片的结构示意图;FIG. 8 is a schematic structural diagram of a chip according to an embodiment of the present application;
图9为本申请实施例提供的一种终端设备的结构示意图;FIG. 9 is a schematic structural diagram of a terminal device according to an embodiment of the present application;
图10为本申请实施例提供的一种终端设备的结构示意图。FIG. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
具体实施方式Detailed ways
本申请实施例提供一种动态调整AVRCP版本的方法及装置,可以应用于终端设备与对端设备蓝牙连接后,对端设备播放终端设备中的媒体文件的过程,例如终端设备与对端设备蓝牙连接成功后,对端设备可以播放并显示终端设备中的音乐文件。The embodiments of the present application provide a method and apparatus for dynamically adjusting the AVRCP version, which can be applied to a process in which the peer device plays a media file in the terminal device after the terminal device and the peer device are connected via Bluetooth, for example, the terminal device and the peer device Bluetooth After the connection is successful, the peer device can play and display the music files in the terminal device.
本申请的网络架构可以包括终端设备和对端设备,终端设备可以是手机和平板电脑等具有蓝牙功能、安装有媒体播放器且支持AVRCP的设备,对端设备可以是车载设备、蓝牙耳机以及PC等支持蓝牙功能、安装有媒体播放器且支持AVRCP的设备。如图1所示,终端设备11可以为手机,对端设备12为车载设备。例如媒体播放器为音乐播放器时,终端设备与对端设备通过蓝牙连接成功后,终端设备在显示音乐播放进度的同时,对端设备可以同时播放终端设备中的音乐文件,并且显示终端设备中音乐播放时的状态、歌手以及歌手信息等,用户还可操作对端设备来控制音乐的暂停、停止、启动播放、音量控制以及其他类型的控制操作。这里的终端设备就相当于TG,对端设备就相当于CT。The network architecture of the present application may include a terminal device and a peer device. The terminal device may be a mobile phone, a tablet computer, or other devices with Bluetooth function, installed with a media player and supporting AVRCP, and the peer device may be a vehicle-mounted device, a Bluetooth headset, and a PC. and other devices that support Bluetooth, have a media player installed, and support AVRCP. As shown in FIG. 1 , the
在一个示例中,终端设备可以通过如图2所示的结构实现。以终端设备为手机为例,图2示出了手机的通用硬件架构进行说明。图2所示的手机可以包括:射频(radioFrequency,RF)电路210、存储器220、其他输入设备230、显示屏240、传感器250、音频电路260、I/O子系统270、处理器280、以及电源290等部件。本领域技术人员可以理解,图2所示的手机的结构并不构成对手机的限定,可以包括比图示更多或者更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。本领域技术人员可以理解显示屏240属于用户界面(user Interface,UI),显示屏240可以包括显示面板241和触摸面板242。且手机可以包括比图示更多或者更少的部件。尽管未示出,手机还可以包括摄像头、蓝牙模块等功能模块或器件,在此不再赘述。In an example, the terminal device may be implemented by the structure shown in FIG. 2 . Taking the terminal device as a mobile phone as an example, FIG. 2 shows a general hardware architecture of the mobile phone for illustration. The cell phone shown in FIG. 2 may include a radio frequency (RF)
进一步地,处理器280分别与RF电路210、存储器220、音频电路260、I/O子系统270、以及电源290均连接。I/O子系统270分别与其他输入设备230、显示屏240、传感器250均连接。其中,RF电路210可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器280处理。存储器220可用于存储软件程序以及模块。处理器280通过运行存储在存储器220的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。其他输入设备230可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。显示屏240可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单,还可以接受用户输入。传感器250可以为光传感器、运动传感器或者其他传感器。音频电路260可提供用户与手机之间的音频接口。I/O子系统270用来控制输入输出的外部设备,外部设备可以包括其他设备输入控制器、传感器控制器、显示控制器。处理器280是手机200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器220内的软件程序和/或模块,以及调用存储在存储器220内的数据,执行手机200的各种功能和处理数据,从而对手机进行整体监控。电源290(比如电池)用于给上述各个部件供电,优选的,电源可以通过电源管理系统与处理器280逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗等功能。Further, the
在本申请实施例中,RF电路210可以向对端设备发送信息和接收对端设备的信息,并将接收的信息发送给处理器280进行处理。存储器220可用于存储执行本申请实施例方法的软件程序以及模块。处理器280可通过运行存储在存储器220的软件程序以及模块,从而执行手机的各种功能应用以及数据处理,例如执行本申请实施例中的方法步骤。显示屏240可以用于显示媒体播放器播放媒体文件时的图像。In this embodiment of the present application, the
本申请可以适用于蓝牙工作模式为基本速率(Basic Rate,BR)和增强速率(Enhanced Data Rate,EDR)的设备,且适用于蓝牙5.0及5.0以下的蓝牙技术标准,例如还适用于蓝牙4.2、4.0以及3.0等技术标准。This application can be applied to devices whose Bluetooth working modes are Basic Rate (BR) and Enhanced Data Rate (EDR), and is applicable to Bluetooth 5.0 and Bluetooth technology standards below 5.0, such as Bluetooth 4.2, 4.0 and 3.0 and other technical standards.
当手机作为TG与CT蓝牙连接时,TG与CT遵循的蓝牙协议架构可以如图3所示,包括可并行工作的连接管理协议(Link Manager Protocol,LMP)和逻辑链路控制和适配协议(Logical Link Control and Adaption Protocol,L2CAP)、音/视频控制传输(Audio/Video Control Transport Protocol,AVCTP)、服务发现协议(Service DiscoveryProtocol,SDP)、音视频远程控制协议(Audio/Video Remote ControlProfile,AVRCP)以及应用(Application)。When the mobile phone is used as the TG to connect with the CT Bluetooth, the Bluetooth protocol architecture followed by the TG and the CT can be shown in Figure 3, including the connection management protocol (Link Manager Protocol, LMP) that can work in parallel and the logical link control and adaptation protocol ( Logical Link Control and Adaption Protocol (L2CAP), Audio/Video Control Transport Protocol (AVCTP), Service Discovery Protocol (SDP), Audio/Video Remote ControlProfile (AVRCP) and Application.
LMP负责各蓝牙设备间连接的建立;L2CAP与LMP并行工作,当业务数据不经过LMP时,L2CAP为上层提供服务;AVCTP协议描述了蓝牙设备间音/视频的控制信号交换的格式和机制,AVCTP是一个总体的协议,具体的控制信息由其指定的协议(如AVRCP)实现,AVCTP本身只指定控制命令(command)和响应(response)的总体的格式。SDP是所有用户模式的基础,使用SDP可以查询到设备信息和服务类型,从而在蓝牙设备间建立相应的连接。AVRCP用于提供控制设备的标准接口,即定义了如何控制流媒体的特征,包括暂停、停止、启动重放、音量控制及其它类型的远程控制操作;Application为TG与CT之间的应用程序之间通信。LMP is responsible for the establishment of connections between Bluetooth devices; L2CAP and LMP work in parallel. When business data does not pass through LMP, L2CAP provides services for the upper layer; AVCTP protocol describes the format and mechanism of audio/video control signal exchange between Bluetooth devices, AVCTP It is an overall protocol, and the specific control information is implemented by the specified protocol (such as AVRCP). AVCTP itself only specifies the overall format of the control command (command) and the response (response). SDP is the basis of all user modes. Using SDP, device information and service types can be queried to establish corresponding connections between Bluetooth devices. AVRCP is used to provide a standard interface for controlling devices, that is, it defines the characteristics of how to control streaming media, including pause, stop, start playback, volume control and other types of remote control operations; Application is the application between TG and CT. communication between.
首先可通过TG与CT建立异步无连接(Asynchronous Connectionless Less,ACL)物理链路,在此基础上建立LMP协议和L2CAP连接,TG与CT建立一对一或一对多的连接,再通过SDP可以查询到设备信息和服务类型,从而在TG与CT间建立相应的连接,接下来再通过AVCTP协议建立TG与CT间音/视频的控制信号交换的格式和机制,而后通过ACRCP协议实现TG与CT间的控制信令交互。First, an Asynchronous Connectionless Less (ACL) physical link can be established between the TG and the CT. On this basis, the LMP protocol and the L2CAP connection can be established. The TG and the CT can establish a one-to-one or one-to-many connection. Query the device information and service type, so as to establish the corresponding connection between TG and CT, then establish the format and mechanism of audio/video control signal exchange between TG and CT through AVCTP protocol, and then realize TG and CT through ACRCP protocol control signaling interaction between them.
其中,AVRCP有多个服务版本,包括AVRCP1.0、AVRCP1.3、AVRCP1.4以及AVRCP1.5等。随着版本的演进,功能不断增加,且每个版本的链路流程也不同。当TG的AVRCP的服务版本为AVRCP1.4时,TG与CT建立蓝牙连接以播放CT中的音乐文件的过程中,TG与CT通过ACRCP查询TG与CT间的服务版本与特性之间的信号交互可以如图4所示,包括如下步骤。Among them, AVRCP has multiple service versions, including AVRCP1.0, AVRCP1.3, AVRCP1.4, and AVRCP1.5. With the evolution of the version, the functions continue to increase, and the link process of each version is also different. When the service version of TG's AVRCP is AVRCP1.4, during the process of establishing a Bluetooth connection between TG and CT to play music files in CT, TG and CT query the signal interaction between the service version and characteristics between TG and CT through ACRCP As shown in Figure 4, the following steps are included.
步骤41、CT可先向TG发送SDP请求(SDP request),用于请求查询TG的AVRCP服务版本与特性;Step 41, the CT can first send an SDP request (SDP request) to the TG for requesting to query the AVRCP service version and characteristics of the TG;
步骤42、当TG的AVRCP服务版本为AVRCP1.4时,TG向CT回复SDP响应(SDPresponse)消息,该SDP响应消息指示TG的AVRCP服务版本为AVRCP1.4,说明TG支持AVRCPbrowsing;需要说明的是,从AVRCP协议的角度来说,AVRCP1.3是不支持浏览(browsing)的,AVRCP1.4是支持browsing的。如果一个设备的AVRCP版本是1.3,说明该设备不支持browsing;如果一个设备AVRCP版本是AVRCP1.4,设备在出厂时,设备厂商可以定义AVRCP1.4支持browsing或不支持browsing。本申请是以设备的AVRCP版本是AVRCP1.4且AVRCP1.4支持browsing进行说明的。这里的设备支持browsing在AVRCP协议中可以这样理解,以TG为手机,CT为车载设备来说,如果手机支持browsing,那么车载设备侧可以获取手机中的音乐播放器的列表,例如音乐播放器的列表指示手机侧的音乐播放器包括QQ音乐、网易云音乐以及酷狗音乐等,车载设备侧可以进一步选择浏览列表中的任一音乐播放器,例如选择浏览网易云音乐的这一音乐播放器时,浏览网易云音乐可以理解为:浏览网易云音乐的音乐文件夹,该音乐文件夹在车载设备屏幕中可以显示有多个歌曲的歌曲名、多个歌手以及多种音乐类型等,这样用户就可以在音乐文件夹中选择或搜索要播放的歌曲。这样,用户既可以在手机侧的网易云音乐中选择要播放的歌曲,也可以在车载设备显示的网易云音乐的音乐文件夹中选择要播放的歌曲,当播放某一歌曲时,手机侧只是显示歌曲的播放进度,车载设备侧可同时播放这一歌曲,且在车载设备的屏幕中显示有正在播放的歌曲的歌词、歌手信息、歌曲评论以及歌曲的专辑等。Step 42. When the AVRCP service version of the TG is AVRCP 1.4, the TG replies to the CT an SDP response (SDPresponse) message, which indicates that the AVRCP service version of the TG is AVRCP 1.4, indicating that the TG supports AVRCP browsing; it should be noted that , From the perspective of the AVRCP protocol, AVRCP1.3 does not support browsing, and AVRCP1.4 supports browsing. If the AVRCP version of a device is 1.3, it means that the device does not support browsing; if the AVRCP version of a device is AVRCP 1.4, the device manufacturer can define that AVRCP 1.4 supports browsing or does not support browsing when the device leaves the factory. In this application, the AVRCP version of the device is AVRCP 1.4 and AVRCP 1.4 supports browsing. The device here supports browsing, which can be understood in the AVRCP protocol. Taking TG as the mobile phone and CT as the in-vehicle device, if the mobile phone supports browsing, the in-vehicle device side can obtain the list of music players in the mobile phone, such as the music player's The list indicates that the music players on the mobile phone include QQ Music, Netease Cloud Music, Kugou Music, etc. The in-vehicle device side can further choose to browse any music player in the list, for example, when selecting this music player of Netease Cloud Music , browsing Netease Cloud Music can be understood as: browsing the music folder of Netease Cloud Music, the music folder can display the song names of multiple songs, multiple singers, and multiple music types on the screen of the in-vehicle device, so that the user can Songs to play can be selected or searched for in the music folder. In this way, the user can either select the song to be played in the NetEase Cloud Music on the mobile phone side, or select the song to be played in the music folder of NetEase Cloud Music displayed on the in-vehicle device. When a certain song is played, the mobile phone side only The playback progress of the song is displayed, and the in-vehicle device side can play the song at the same time, and the screen of the in-vehicle device displays the lyrics, singer information, song comments, and albums of the song being played.
步骤43、在CT确定TG支持AVRCP browsing的情况下,CT再向TG发送获取文件项目请求(get folder item request),以请求获取TG的音乐播放器的列表,列表中包括TG侧多个音乐播放器的应用程序的ID;Step 43, when CT determines that TG supports AVRCP browsing, CT sends again to TG to obtain a file item request (get folder item request), to request the list of the music player of TG, including multiple music players on the TG side in the list the ID of the applicator's application;
步骤44、TG向CT回复获取文件项目响应(get folder item response),获取文件项目响应包括该列表;例如该列表中多个音乐播放器的应用程序的ID包括QQ音乐、网易云音乐以及酷狗音乐等应用程序的ID,如表1所示;Step 44, TG replies to CT to obtain a file item response (get folder item response), and the obtain file item response includes this list; for example, the IDs of the applications of multiple music players in the list include QQ Music, Netease Cloud Music and Kugou IDs of applications such as music, as shown in Table 1;
表1Table 1
步骤45、CT再向GT发送请求浏览播放器请求(set browsed player request),setbrowsed player request中包括CT选定的音乐播放器的ID,以请求浏览TG中的音乐播放器;例如CT选定的音乐播放器为网易云音乐,那么set browsed player request中包括网易云音乐的应用程序的ID:01,以请求浏览网易云音乐;以下步骤以网易云音乐为例进行说明。Step 45, CT sends request browsing player request (set browsed player request) to GT again, and the ID of the music player selected by CT is included in the setbrowsed player request, to request to browse the music player in the TG; If the music player is NetEase Cloud Music, then the set browsed player request includes the ID of the NetEase Cloud Music application: 01 to request to browse NetEase Cloud Music; the following steps take NetEase Cloud Music as an example to illustrate.
步骤46、TG中网易云音乐如果支持浏览,TG向CT回复播放器支持浏览响应(setbrowsed player response),以指示CT该TG中的网易云音乐支持AVRCP browsing;如果TG中的网易云音乐不支持浏览,TG向CT回复播放器不支持浏览(player not browsable)的响应。音乐播放器是不是支持AVRCP浏览,可以决定于音乐播放器的应用程序是否注册支持AVRCP浏览的服务,即如果音乐播放器的应用程序未注册支持AVRCP浏览的服务,那么音乐播放器不支持ACRCP浏览;或者说,音乐播放器不支持AVRCP浏览是音乐播放器支持的音频格式与CT不兼容,例如音乐播放器支持wav、ogg以及mid等格式,而CT支持的格式有mp3、amr、以及flac等;或者,音乐播放器不支持AVRCP浏览,是由于音乐播放器的不支持AVRCP的蓝牙协议,不能被CT访问;或者说,音乐播放器不支持AVRCP浏览是由于音乐播放器的应用程序不支持蓝牙传输音频数据至CT等。If NetEase cloud music in step 46, TG supports browsing, TG replies to CT that player supports browsing response (setbrowsed player response), to indicate that the NetEase cloud music in this TG of CT supports AVRCP browsing; if the NetEase cloud music in TG does not support Browsing, the TG replies to the CT that the player does not support browsing (player not browsable). Whether the music player supports AVRCP browsing can be determined by whether the application of the music player is registered for the service that supports AVRCP browsing, that is, if the application of the music player does not register the service that supports AVRCP browsing, then the music player does not support ACRCP browsing. ; In other words, the music player does not support AVRCP browsing because the audio format supported by the music player is incompatible with CT. For example, the music player supports formats such as wav, ogg, and mid, while the formats supported by CT include mp3, amr, and flac, etc. ; Or, the music player does not support AVRCP browsing because the music player does not support the AVRCP Bluetooth protocol and cannot be accessed by CT; or, the music player does not support AVRCP browsing because the music player application does not support Bluetooth Transfer audio data to CT etc.
步骤47、如果TG中网易云音乐支持浏览,那么CT可以继续向TG发送获取项目属性的浏览命令(browsing command for get item attributes),以向TG获取网易云音乐的歌曲信息等,而后继续执行步骤48;但是如果网易云音乐不支持浏览,CT在接收到player notbrowsable的响应后,不会发送browsing command for get item attributes给TG,而是会重复向TG发送set browsed player request,但是TG又不给CT响应set browsed playerresponse,导致播放音乐时CT无法显示歌曲信息;以TG为手机,CT为车载设备为例,这时手机侧的屏幕中显示的图像可以为车载设备请求浏览的音乐播放器的画面,车载设备侧在接收到player not browsable的响应时,可以显示有歌曲信息获取失败的提示信息,例如该提示信息可以为:“获取歌曲信息失败”或者“未知”等,或者屏幕中不显示任何提示信息,即黑屏状态。如图4A为手机向车载设备发送player not browsable的响应时手机和车载设备的屏幕显示示意图。Step 47, if NetEase Cloud Music supports browsing in the TG, then CT can continue to send the browsing command (browsing command for get item attributes) for obtaining item attributes to TG, to obtain the song information of NetEase Cloud Music etc. from TG, and then continue to perform the steps 48; But if NetEase Cloud Music does not support browsing, CT will not send browsing command for get item attributes to TG after receiving the response of player notbrowsable, but will repeatedly send set browsed player request to TG, but TG will not give CT responds to set browsed playerresponse, so that CT cannot display song information when playing music. Taking TG as the mobile phone and CT as the in-vehicle device as an example, the image displayed on the screen of the mobile phone can be the picture of the music player requested by the in-vehicle device to browse. , when the in-vehicle device side receives the response of player not browsable, it can display a prompt message that the song information has failed to obtain, for example, the prompt message can be: "Failed to obtain song information" or "unknown", etc., or the screen does not display any Prompt information, that is, the black screen state. FIG. 4A is a schematic diagram of screen display of the mobile phone and the in-vehicle device when the mobile phone sends a response of player not browsable to the in-vehicle device.
步骤48、TG再向CT回复获取项目属性的响应(response for get itemattributes),response for get item attributes中携带网易云音乐的歌曲信息。以TG为手机,CT为车载设备为例,如图4B,这时手机侧的屏幕中显示的图像可以为车载设备请求浏览的音乐播放器的画面,车载设备侧在接收到网易云音乐的歌曲信息时,可以在车载设备侧的屏幕中显示网易云音乐的歌曲的歌曲名、网易云音乐的播放器名称以及歌曲的演唱者等。Step 48: The TG replies to the CT a response for getting item attributes (response for get item attributes), and the response for get item attributes carries the song information of NetEase Cloud Music. Taking the TG as the mobile phone and the CT as the in-vehicle device as an example, as shown in Figure 4B, the image displayed on the screen of the mobile phone can be the image of the music player requested by the in-vehicle device to browse, and the in-vehicle device side receives the songs of Netease Cloud Music When the information is displayed, the song name of the song of Netease Cloud Music, the player name of Netease Cloud Music, and the singer of the song can be displayed on the screen on the side of the in-vehicle device.
举例来说,如果CT为车载设备,TG为手机,在手机与车载系统通过蓝牙技术连接以播放手机中的音乐时,车载设备可首先查询手机的服务版本与特性,当手机回复AVRCP版本为AVRCP1.4,表征手机支持AVRCP浏览,车载系统可继续发送携带网易云音乐的标识的set_browsed_player request命令给手机,以请求浏览网易云音乐的歌曲信息,当手机中的网易云音乐应用程序不支持AVRCP浏览时,手机会向车载系统回复player_not_browsable响应,以指示网易云音乐不支持AVRCP浏览,这时车载系统不再发送用于获取歌曲信息的请求至手机,而是重复发送set_browsed_playerrequest命令至手机,导致车载系统播放手机中的网易云音乐的音乐文件时车载系统无法显示歌曲信息。For example, if CT is a vehicle-mounted device and TG is a mobile phone, when the mobile phone and the vehicle-mounted system are connected through Bluetooth technology to play music in the mobile phone, the in-vehicle device can first query the service version and features of the mobile phone, and when the mobile phone responds to the AVRCP version as AVRCP1 .4, indicating that the mobile phone supports AVRCP browsing, the vehicle system can continue to send the set_browsed_player request command carrying the logo of NetEase Cloud Music to the mobile phone to request to browse the song information of NetEase Cloud Music, when the NetEase Cloud Music application in the mobile phone does not support AVRCP browsing At this time, the mobile phone will reply the player_not_browsable response to the in-vehicle system to indicate that NetEase Cloud Music does not support AVRCP browsing. At this time, the in-vehicle system no longer sends the request for obtaining song information to the mobile phone, but repeatedly sends the set_browsed_playerrequest command to the mobile phone, causing the in-vehicle system to When playing the music files of NetEase Cloud Music in the mobile phone, the in-vehicle system cannot display the song information.
如图5所示,如果CT向TG发送SDP request请求查询TG的AVRCP服务版本与特性,当TG的AVRCP服务版本为AVRCP1.3时,TG向CT回复的SDPresponse指示TG的AVRCP服务版本为AVRCP1.3,AVRCP1.3版本不支持AVRCP browsing,这时CT会直接向TG发送获取元素属性命令(get element attributes command)以获取TG端的音乐播放器的歌曲信息,TG就会向CT回复获取元素属性响应(get element attributes response)将该歌曲信息发送给CT。As shown in Figure 5, if CT sends SDP request to TG to request to query the AVRCP service version and characteristics of TG, when the AVRCP service version of TG is AVRCP1.3, the SDPresponse returned by TG to CT indicates that the AVRCP service version of TG is AVRCP1. 3. AVRCP version 1.3 does not support AVRCP browsing. At this time, CT will directly send a get element attributes command to TG to obtain the song information of the music player on the TG side, and TG will reply to CT to get the element attribute response. (get element attributes response) Send the song information to CT.
由此看来,TG向CT回复的SDP响应消息中携带的TG的AVRCP的服务版本不同,CT的后续行为也不同,即TG与CT建立的链路不同。其中,get element attributes command和get element attributes response属于get element attributes的命令,browsingcommand for get item attributes和response for get item attributes属于get itemattributes的命令,get element attributes和get item attributes的命令都用于获取歌曲信息,区别在于请求获取的歌曲信息的字段不同,相应的response中回复的歌曲信息也有所不同。From this, it can be seen that the AVRCP service version of the TG carried in the SDP response message returned by the TG to the CT is different, and the subsequent behavior of the CT is also different, that is, the links established by the TG and the CT are different. Among them, get element attributes command and get element attributes response belong to the command of get element attributes, browsingcommand for get item attributes and response for get item attributes belong to the command of get item attributes, and the commands of get element attributes and get item attributes are used to obtain song information , the difference is that the fields of the song information obtained by the request are different, and the song information replied in the corresponding response is also different.
针对CT在与TG蓝牙连接以播放TG中的音乐文件,而TG中的音乐播放器不支持浏览导致CT无法显示歌曲信息的问题,本申请提供一种动态调整AVRCP版本的方法,如图6所示,包括:Aiming at the problem that CT is connected with TG Bluetooth to play music files in TG, but the music player in TG does not support browsing, so CT cannot display song information, the present application provides a method for dynamically adjusting the AVRCP version, as shown in Figure 6 display, including:
601、终端设备响应于对端设备发送的第一SDP请求消息,向对端设备发送第一SDP响应消息,第一SDP响应消息携带第一AVRCP版本的版本号。601. In response to the first SDP request message sent by the opposite terminal device, the terminal device sends a first SDP response message to the opposite terminal device, where the first SDP response message carries the version number of the first AVRCP version.
终端设备可以为TG,对端设备可以为CT,例如TG为具有蓝牙功能,安装有音乐播放且支持AVRCP的手机,CT为具有蓝牙功能,安装有音乐播放且支持AVRCP的车载设备,在手机与车载设备建立蓝牙连接以便车载设备播放手机音乐播放器中的音乐文件的过程中,如果手机接收到车载设备发送的SDP request,手机支持的AVRCP版本为AVRCP1.4,那么手机回复车载设备的第一SDP response中指示手机支持的AVRCP版本为AVRCP1.4,即第一AVRCP版本的版本号为AVRCP1.4。The terminal device can be a TG, and the peer device can be a CT. For example, TG is a mobile phone with Bluetooth function, installed with music playback and supports AVRCP, and CT is a vehicle-mounted device with Bluetooth function, installed with music playback and supports AVRCP. When the in-vehicle device establishes a Bluetooth connection so that the in-vehicle device can play the music files in the mobile phone music player, if the mobile phone receives the SDP request sent by the in-vehicle device, and the AVRCP version supported by the mobile phone is AVRCP1. The SDP response indicates that the AVRCP version supported by the mobile phone is AVRCP1.4, that is, the version number of the first AVRCP version is AVRCP1.4.
602、终端设备响应对端设备发送的至少两个浏览请求消息,浏览请求消息用于请求对端设备请求显示媒体播放器的媒体信息。602. The terminal device responds to at least two browsing request messages sent by the peer device, where the browsing request messages are used to request the peer device to request to display media information of the media player.
根据图4的交互流程,示例性的,车载设备在得知手机支持AVRCP1.4时,确定手机支持AVRCP browsing,而后会继续向手机发送set browsed player request,set browsedplayer request中包括车载设备选定的音乐播放器的ID,以请求浏览手机中的该音乐播放器,手机中该音乐播放器如果不支持浏览,手机向车载设备回复player not browsable的响应,以指示该音乐播放器不支持浏览,那么车载设备会向手机重复发送set browsedplayer request,而不发送browsing command for get item attributes给手机,导致车载设备无法显示歌曲信息,于是,手机可以将车载设备重复发送set browsed playerrequest的操作识别为车载设备在请求浏览媒体播放器时存在异常操作,或者说,识别出车载设备在请求浏览媒体播放器时存在特定行为。According to the interaction process in FIG. 4 , for example, when the in-vehicle device learns that the mobile phone supports AVRCP 1.4, it determines that the mobile phone supports AVRCP browsing, and then continues to send a set browsed player request to the mobile phone, and the set browsed player request includes the information selected by the in-vehicle device. The ID of the music player to request to browse the music player in the mobile phone. If the music player in the mobile phone does not support browsing, the mobile phone returns a player not browsable response to the in-vehicle device to indicate that the music player does not support browsing, then The in-vehicle device will repeatedly send the set browsedplayer request to the mobile phone, instead of sending the browsing command for get item attributes to the mobile phone, so that the in-vehicle device cannot display the song information. Therefore, the mobile phone can recognize the operation of repeatedly sending the set browsed playerrequest from the in-vehicle device as the in-vehicle device in the There is an abnormal operation when requesting to browse the media player, or in other words, it is identified that the in-vehicle device has a specific behavior when requesting to browse the media player.
603、终端设备响应于对端设备发送的第二SDP请求消息,第二SDP请求消息为终端设备与对端设备断开连接后再次连接时发送的,向对端设备发送第二SDP响应消息,第二SDP响应消息携带第二AVRCP版本的版本号,第二AVRCP版本的版本号低于第一AVRCP版本的版本号。603. The terminal device sends a second SDP response message to the opposite end device in response to the second SDP request message sent by the opposite end device, where the second SDP request message is sent when the terminal device is disconnected from the opposite end device and reconnected, The second SDP response message carries the version number of the second AVRCP version, and the version number of the second AVRCP version is lower than the version number of the first AVRCP version.
示例性的,在手机识别出车载设备存在异常操作的情况下,如果手机与车载设备断开蓝牙连接,再次建立蓝牙连接以便车载设备播放手机音乐播放器中的音乐文件的过程中,如果手机接收到车载设备发送的SDP request,这时手机向车载设备发送的SDPresponse中可以指示手机支持的AVRCP版本为AVRCP1.3,即第二AVRCP版本的版本号为AVRCP1.3。AVRCP1.3的版本号低于AVRCP1.4的版本号。这样一来,手机与车载设备的链路与上一次建立蓝牙连接的链路不同,这一次手机与车载设备建立蓝牙连接的操作可以如图5所示,不会发生车载设备向手机发送set browsed player request,也就不会出现车载设备重复向手机发送set browsed player request的异常操作。Exemplarily, in the case that the mobile phone recognizes that the in-vehicle device has an abnormal operation, if the mobile phone and the in-vehicle device are disconnected from the Bluetooth connection, the Bluetooth connection is re-established so that the in-vehicle device plays the music file in the mobile phone's music player. To the SDP request sent by the in-vehicle device, the SDPresponse sent by the mobile phone to the in-vehicle device can indicate that the AVRCP version supported by the mobile phone is AVRCP1.3, that is, the version number of the second AVRCP version is AVRCP1.3. The version number of AVRCP1.3 is lower than that of AVRCP1.4. In this way, the link between the mobile phone and the in-vehicle device is different from the link that established the Bluetooth connection last time. This time, the operation of establishing a Bluetooth connection between the mobile phone and the in-vehicle device can be as shown in Figure 5, and the in-vehicle device will not send set browsed to the mobile phone. player request, there will be no abnormal operation of the in-vehicle device repeatedly sending the set browsed player request to the mobile phone.
这样通过本申请图6所示的实施例,手机与车载设备蓝牙配对连接播放音乐时,手机能够识别出车载设备重复发送set browsed player request的异常行为,手机与车载设备断开蓝牙连接后再次连接时,车载设备在发送SDP request查询手机侧的AVRCP版本时,会将手机原本支持的第一AVRCP版本降低,降为第二AVRCP版本,以避免在向车载设备回复第一AVRCP版本时车载设备出现的异常行为,第二AVRCP版本不支持AVRCP browsing,且会使得车载设备向手机发送get element attributes来获取歌曲信息,避免了车载设备下一次继续出现重复发送set browsed player request至手机,导致的车载设备无法显示歌曲信息的问题。In this way, through the embodiment shown in FIG. 6 of the present application, when the mobile phone is paired and connected to the in-vehicle device to play music, the mobile phone can identify the abnormal behavior of the in-vehicle device repeatedly sending the set browsed player request, and the mobile phone and the in-vehicle device are disconnected from the Bluetooth connection and reconnected. When the in-vehicle device sends an SDP request to query the AVRCP version on the mobile phone side, it will reduce the first AVRCP version originally supported by the mobile phone to the second AVRCP version, so as to avoid the in-vehicle device appearing when replying the first AVRCP version to the in-vehicle device. The second AVRCP version does not support AVRCP browsing, and will make the in-vehicle device send get element attributes to the mobile phone to obtain song information, which avoids the in-vehicle device from repeatedly sending the set browsed player request to the mobile phone next time. Unable to display song information.
下面以终端设备为手机,对端设备为车载设备进一步对本申请实施例进行说明,如图7所述,本申请实施例的方法可以包括:The embodiments of the present application are further described below by taking the terminal device as a mobile phone and the opposite terminal device as a vehicle-mounted device. As shown in FIG. 7 , the method of the embodiment of the present application may include:
701、车载设备向手机发送SDP请求,即SDP request,以查询手机的AVRCP版本。701. The in-vehicle device sends an SDP request, that is, an SDP request, to the mobile phone to query the AVRCP version of the mobile phone.
车载设备与手机建立蓝牙连接的过程中,车载设备若要播放手机中的音乐播放器的音乐文件时,车载设备需要向手机发送SDP请求来查询手机的AVRCP版本,以便车载设备可以根据手机的AVRCP版本来确定播放音乐文件时的操作的标准接口,即如何控制音乐文件的特征,包括暂停、停止、启动重放、音量控制及其它类型的远程控制操作等。AVRCP版本可以是前述举例的AVRCP1.0、AVRCP1.3、AVRCP1.4以及AVRCP1.5等其中的一种。In the process of establishing a Bluetooth connection between the in-vehicle device and the mobile phone, if the in-vehicle device wants to play the music files of the music player in the mobile phone, the in-vehicle device needs to send an SDP request to the mobile phone to query the AVRCP version of the mobile phone, so that the in-vehicle device can be based on the mobile phone's AVRCP version. Version to determine the standard interface for operations when playing music files, that is, how to control the characteristics of music files, including pause, stop, start playback, volume control, and other types of remote control operations. The AVRCP version may be one of the AVRCP1.0, AVRCP1.3, AVRCP1.4, and AVRCP1.5 exemplified above.
702、手机向车载设备发送第一SDP响应,即第一SDP response,第一SDP响应携带第一AVRCP版本的版本号AVRCP1.4。702. The mobile phone sends a first SDP response, that is, a first SDP response, to the vehicle-mounted device, where the first SDP response carries the version number AVRCP1.4 of the first AVRCP version.
如果手机的AVRCP版本为AVRCP1.4,可以继续如图4所示的流程。If the AVRCP version of the mobile phone is AVRCP 1.4, the process shown in Figure 4 can be continued.
703、车载设备向手机发送获取文件项目请求,即get folder item request,以请求获取手机中的媒体播放器的列表。703. The in-vehicle device sends a request for obtaining a file item, that is, a get folder item request, to the mobile phone, so as to request to obtain a list of media players in the mobile phone.
每个媒体播放器都对应一个ID。Each media player corresponds to an ID.
704、手机向车载设备发送获取文件项目响应,即get folder item response,该get folder item response中包括手机中的媒体播放器的列表。704. The mobile phone sends an acquisition file item response, that is, a get folder item response, to the vehicle-mounted device, where the get folder item response includes a list of media players in the mobile phone.
705、车载设备向手机发送浏览请求消息,即发送前述的浏览播放器请求setbrowsed player request,浏览请求消息用于请求浏览播放器。705. The in-vehicle device sends a browsing request message to the mobile phone, that is, sending the foregoing browsing player request setbrowsed player request, and the browsing request message is used to request the browsing player.
请求浏览播放器可以理解为请求浏览音乐播放器中的音乐文件,包括歌曲信息,例如歌手,歌曲时长以及歌曲名等。浏览请求消息中包括车载设备请求的媒体播放器的ID。The request to browse the player may be understood as a request to browse the music files in the music player, including song information, such as singer, song duration, and song name. The browsing request message includes the ID of the media player requested by the in-vehicle device.
706、手机向车载设备发送浏览响应消息,浏览响应消息用于指示播放器不支持浏览。706. The mobile phone sends a browsing response message to the in-vehicle device, where the browsing response message is used to indicate that the player does not support browsing.
如果由于手机中的音乐播放器不支持通过蓝牙协议浏览,或者音乐播放器的版本太低而不支持浏览时,从图4的说明可知,手机可以向车载设备发送不支持浏览的响应,即发送的player not browsable的响应。If the music player in the mobile phone does not support browsing through the Bluetooth protocol, or the version of the music player is too low to support browsing, it can be seen from the description in Figure 4 that the mobile phone can send a response that does not support browsing to the in-vehicle device, that is, send The player not browsable response.
707、若手机在预设时间段内接收到车载设备发送的至少N个浏览请求消息,手机确定车载设备存在异常操作,或者说,确定车载设备无法显示播放器的媒体信息。N为正整数。707. If the mobile phone receives at least N browsing request messages sent by the in-vehicle device within the preset time period, the mobile phone determines that the in-vehicle device has an abnormal operation, or determines that the in-vehicle device cannot display the media information of the player. N is a positive integer.
从图4的说明可知,如果车载设备接收到手机发送的player not browsable的响应,不会继续发送browsing command for get item attributes给TG,而是会重复向手机发送set browsed player request,如果这里的预设时间段为1s,N为3,那么也就是说,如果手机在1s内接收到车载设备发动的至少3个浏览请求消息,手机就会确定车载设备存在异常操作,或者说,手机确定车载设备存在特定行为。N也可以为其它值,本申请不做限定。也就是说,在本申请实施例中,手机侧增加了识别手机的对端设备的特定行为的机制。It can be seen from the description in Figure 4 that if the vehicle-mounted device receives the player not browsable response sent by the mobile phone, it will not continue to send the browsing command for get item attributes to the TG, but will repeatedly send the set browsed player request to the mobile phone. Set the time period to 1s and N to be 3, that is to say, if the mobile phone receives at least 3 browsing request messages initiated by the in-vehicle device within 1s, the mobile phone will determine that the in-vehicle device has an abnormal operation, or the mobile phone will determine that the in-vehicle device has an abnormal operation. specific behavior exists. N may also be other values, which are not limited in this application. That is to say, in the embodiment of the present application, a mechanism for identifying the specific behavior of the peer device of the mobile phone is added on the mobile phone side.
708、手机将车载设备的设备信息记录在预置的设备信息集合中。708. The mobile phone records the device information of the in-vehicle device in a preset device information set.
一种可能的实现中,车载设备的设备信息可以包括车载设备的蓝牙信息,或车载设备的设备信息包括车载设备的蓝牙信息和设备类型。In a possible implementation, the device information of the in-vehicle device may include the Bluetooth information of the in-vehicle device, or the device information of the in-vehicle device includes the Bluetooth information and the device type of the in-vehicle device.
其中,蓝牙信息为车载设备的蓝牙地址的前三位,或蓝牙信息为车载设备的蓝牙名称,或蓝牙信息为车载设备的蓝牙地址的前三位以及蓝牙名称。这里记录蓝牙地址的前三位是由于:设备的蓝牙地址有六位:XX:XX:XX:XX:XX:XX,每个设备的蓝牙地址都不一样,即蓝牙地址对不同的设备来说是不同的,如果记录设备的蓝牙地址的六位时,只标记了这一个设备存在特定行为,而蓝牙地址的前三位能够标记出设备的厂商或者该设备用到的蓝牙芯片的厂商,如果厂商的一个设备存在特定行为,为了设备能够便利该厂商的设备或蓝牙芯片都能够顺利获得要连接蓝牙的设备的歌曲信息,可以将这个设备或蓝牙芯片的厂商都记录在预置的设备信息集合中,这样,一旦该蓝牙芯片或该设备厂商的一个设备的设备信息被记录在该预置的设备信息集合中,可以认为该蓝牙芯片或设备厂商的设备都会存在这种特定行为。因此,只将蓝牙地址的前三位存储于该预置的设备信息集合中即可。The Bluetooth information is the first three digits of the Bluetooth address of the in-vehicle device, or the Bluetooth information is the Bluetooth name of the in-vehicle device, or the Bluetooth information is the first three digits of the Bluetooth address of the in-vehicle device and the Bluetooth name. The first three digits of the Bluetooth address are recorded here because: the Bluetooth address of the device has six digits: XX:XX:XX:XX:XX:XX, and the Bluetooth address of each device is different, that is, the Bluetooth address is different for different devices. It is different. If the six digits of the Bluetooth address of the device are recorded, only this device is marked with a specific behavior, and the first three digits of the Bluetooth address can mark the manufacturer of the device or the manufacturer of the Bluetooth chip used by the device. If A device of a manufacturer has a specific behavior. In order for the device to facilitate the device or Bluetooth chip of the manufacturer to successfully obtain the song information of the device to be connected to Bluetooth, the manufacturer of the device or Bluetooth chip can be recorded in the preset device information set. In this way, once the device information of the Bluetooth chip or a device of the device manufacturer is recorded in the preset device information set, it can be considered that the Bluetooth chip or the device of the device manufacturer will have this specific behavior. Therefore, only the first three bits of the Bluetooth address can be stored in the preset device information set.
相应的,预置的设备信息集合包括至少一个设备的蓝牙信息或至少一个设备的蓝牙信息和设备类型,或预置的设备信息集合为空,即在未记录设备信息之前,该集合初始时为空。Correspondingly, the preset device information set includes the Bluetooth information of at least one device or the Bluetooth information and device type of at least one device, or the preset device information set is empty, that is, before the device information is not recorded, the set is initially set to null.
另一种可能的实现中,步骤708还可以替换为:手机将蓝牙配对文件中车载设备对应的AVRCP版本字段的内容置为第二AVRCP版本的版本号。例如第二AVRCP版本的版本号可以为AVRCP 1.3。蓝牙配对文件可以为bt_config.conf文件,该bt_config.conf文件用于记录已经与手机建立蓝牙配对的设备的设备信息,本申请在bt_config.conf文件中新增一个字段AVRCP version,即AVRCP版本字段,该字段指示手机向与手机建立蓝牙配对的设备回复SDP响应时携带的手机的第二AVRCP版本的版本号,例如bt_config.conf文件中车载设备在该字段下的内容为AVRCP 1.3,表示手机在向车载设备发送SDP响应时,应该回复车载设备该手机的AVRCP版本的版本号为AVRCP 1.3。该蓝牙配对文件也可以为本申请在手机侧的一个新建文件,新建文件中包括AVRCP version字段。In another possible implementation, step 708 can also be replaced by: the mobile phone sets the content of the AVRCP version field corresponding to the vehicle-mounted device in the Bluetooth pairing file as the version number of the second AVRCP version. For example, the version number of the second AVRCP version may be AVRCP 1.3. The Bluetooth pairing file can be the bt_config.conf file, which is used to record the device information of the device that has established Bluetooth pairing with the mobile phone. In this application, a new field AVRCP version is added to the bt_config.conf file, that is, the AVRCP version field. This field indicates the version number of the second AVRCP version of the mobile phone carried when the mobile phone replies the SDP response to the device that establishes Bluetooth pairing with the mobile phone. For example, the content of the vehicle-mounted device in the bt_config. When the in-vehicle device sends an SDP response, it should reply to the in-vehicle device that the version number of the AVRCP version of the mobile phone is AVRCP 1.3. The Bluetooth pairing file may also be a newly created file on the mobile phone side of the application, and the newly created file includes an AVRCP version field.
709、手机再次接收到车载设备发送的SDP请求消息。709. The mobile phone receives the SDP request message sent by the in-vehicle device again.
这里的再次接收到SDP请求消息,可以理解为在步骤708之后,手机与车载设备断开蓝牙连接之后,再次建立蓝牙连接时,手机接收到车载设备发送的SDP请求消息。Here, the SDP request message is received again can be understood as after step 708 , after the mobile phone disconnects the Bluetooth connection from the in-vehicle device, when the Bluetooth connection is re-established, the mobile phone receives the SDP request message sent by the in-vehicle device.
710、手机查询车载设备的设备信息是否在预置的设备信息集合中,若车载设备的设备信息在预置的设备信息集合中,则手机确定向车载设备发送第二SDP响应消息,第二SDP响应消息携带第二AVRCP版本的版本号,第二AVRCP版本的版本号低于第一AVRCP版本的版本号。而后,执行步骤711。若车载设备的设备信息不在预置的设备信息集合中,则返回步骤702继续执行。710. The mobile phone queries whether the device information of the in-vehicle device is in the preset device information set, and if the device information of the in-vehicle device is in the preset device information set, the mobile phone determines to send a second SDP response message to the in-vehicle device, the second SDP The response message carries the version number of the second AVRCP version, and the version number of the second AVRCP version is lower than the version number of the first AVRCP version. Then, step 711 is executed. If the device information of the in-vehicle device is not in the preset device information set, return to step 702 to continue the execution.
若设备信息为车载设备的蓝牙地址的前三位,手机在查询到车载设备的蓝牙地址的前三位在预置的设备信息集合中,则手机确定向车载设备这次发送第二SDP响应消息,第二SDP响应消息携带第二AVRCP版本的版本号,即携带ACRCP1.3,ACRCP1.3低于ACRCP1.4。If the device information is the first three bits of the Bluetooth address of the in-vehicle device, and the mobile phone finds that the first three bits of the Bluetooth address of the in-vehicle device are in the preset device information set, the mobile phone determines to send the second SDP response message to the in-vehicle device this time. , the second SDP response message carries the version number of the second AVRCP version, that is, carries ACRCP1.3, and ACRCP1.3 is lower than ACRCP1.4.
或者,按照步骤708中的另一种可能的实现,步骤710也可以替换为:手机查询蓝牙配对文件中车载设备对应的AVRCP版本字段的内容为第二AVRCP版本的版本号。Alternatively, according to another possible implementation in step 708, step 710 can also be replaced with: the mobile phone queries the AVRCP version field corresponding to the vehicle-mounted device in the Bluetooth pairing file, and the content is the version number of the second AVRCP version.
711、手机向车载设备发送第二SDP响应消息。711. The mobile phone sends a second SDP response message to the in-vehicle device.
第二SDP响应消息中携带第二AVRCP版本的版本号,即ACRCP1.3,也就是说,手机通知车载设备获知手机侧的ACRCP版本为ACRCP1.3。The second SDP response message carries the version number of the second AVRCP version, that is, ACRCP1.3, that is, the mobile phone notifies the in-vehicle device that the ACRCP version on the mobile phone side is ACRCP1.3.
该第二SDP响应消息还包括第二AVRCP版本支持的特性。由于手机侧这一次与车载设备建立蓝牙连接时向车载设备回复的第二SDP响应消息相较于上一次回复的第一SDP响应消息更改了手机侧的ACRCP版本的版本号,那么相应的,手机侧就可以将更改后的第二ACRCP版本ACRCP1.3支持的特性也告知给车载设备。The second SDP response message also includes features supported by the second AVRCP version. Since the second SDP response message returned by the mobile phone to the in-vehicle device when establishing a Bluetooth connection with the in-vehicle device this time changes the version number of the ACRCP version on the mobile phone side compared to the first SDP response message replied last time, the mobile phone accordingly The side can also inform the in-vehicle device of the features supported by the changed second ACRCP version ACRCP1.3.
相应的,该方法还可以包括:手机将手机中第一AVRCP版本的特性更新为第二AVRCP版本的特性,即手机将手机中ACRCP1.4的特性对应的字段以及字段的内容更新为ACRCP1.3的字段以及字段的内容。Correspondingly, the method may further include: the mobile phone updates the characteristics of the first AVRCP version in the mobile phone to the characteristics of the second AVRCP version, that is, the mobile phone updates the fields corresponding to the characteristics of ACRCP1.4 in the mobile phone and the content of the fields to ACRCP1.3 field and the content of the field.
712、车载设备向手机发送获取元素属性命令,即发送的get element attributescommand,以获取手机播放器的媒体文件信息。712. The in-vehicle device sends a get element attribute command to the mobile phone, that is, the sent get element attributes command, to obtain the media file information of the mobile phone player.
从图5的流程来看,如果手机向车载设备回复的SDP响应消息中指示手机的ACRCP版本的版本号为ACRCP1.3,那么车载设备在接收到该SDP响应消息时,不再执行如上一次建立蓝牙连接时的步骤703,而是向手机发送获取元素属性命令来获取手机播放器的媒体文件信息,例如媒体文件信息可以为音乐播放器的歌曲信息。From the flow of Figure 5, if the SDP response message returned by the mobile phone to the vehicle-mounted device indicates that the version number of the ACRCP version of the mobile phone is ACRCP1.3, then the vehicle-mounted device will no longer execute the previous setup when receiving the SDP response message. In step 703 when the Bluetooth is connected, a command to acquire element attributes is sent to the mobile phone to acquire the media file information of the mobile phone player, for example, the media file information may be the song information of the music player.
713、手机向车载设备发送获取元素属性响应,即发送的get element attributesresponse,获取元素属性响应中包括媒体文件信息。713. The mobile phone sends a response to obtaining element attributes, that is, the sent get element attributes response, to the in-vehicle device, and the response to obtaining element attributes includes media file information.
这样一来,手机与车载设备建立蓝牙连接的过程中,一旦手机侧识别到车载设备发生了异常操作或者特定行为,在手机与车载设备断开蓝牙连接后再次连接时,车载设备在查询手机侧的AVRCP版本时,手机可以向车载设备回复的AVRCP版本的版本号比上一次建立连接的版本号低,不同的版本号下手机与车载设备的链路行为不同,例如AVRCP版本的版本号为ACRCP1.4时,链路行为如图4所示,AVRCP版本的版本号为ACRCP1.4时,链路行为如图5所示,这样避免了图4中如果手机侧的音乐播放器不支持浏览时,车载设备重复发送setbrowsed player request至手机,导致的车载设备无法显示歌曲信息的问题。In this way, in the process of establishing a Bluetooth connection between the mobile phone and the in-vehicle device, once the mobile phone side recognizes that the in-vehicle device has an abnormal operation or a specific behavior, when the mobile phone and the in-vehicle device are disconnected from the Bluetooth connection and reconnected, the in-vehicle device will query the mobile phone side. When the AVRCP version is selected, the version number of the AVRCP version that the mobile phone can reply to the in-vehicle device is lower than the version number of the last connection established. The link behavior between the mobile phone and the in-vehicle device is different under different version numbers. For example, the version number of the AVRCP version is ACRCP1 .4, the link behavior is shown in Figure 4. When the version number of the AVRCP version is ACRCP1.4, the link behavior is shown in Figure 5, which avoids the situation in Figure 4 if the music player on the mobile phone does not support browsing. , the in-vehicle device repeatedly sends the setbrowsed player request to the mobile phone, resulting in the problem that the in-vehicle device cannot display the song information.
图8示出了本申请提供的一种芯片的结构示意图。FIG. 8 shows a schematic structural diagram of a chip provided by the present application.
芯片可以为系统级芯片(System-on-a-Chip,SoC)80,也可称片上系统,是一个有专用目标的集成电路,其中包含完整系统并有嵌入软件的全部内容。从狭义角度讲,SoC是信息系统核心的芯片集成,是将系统关键部件集成在一块芯片上;从广义角度讲,SoC是一个微小型系统。一般将SoC定义为将微处理器或者核(core)81、模拟知识产权核(Intellectual Property core,IP核)82、数字IP核83和存储器(或片外存储控制接口)84集成在单一芯片上。The chip can be a System-on-a-Chip (SoC) 80, also called a System-on-Chip, which is an integrated circuit with a dedicated target, which includes a complete system and all contents of embedded software. From a narrow point of view, SoC is the chip integration of the core of the information system, which integrates key components of the system on a chip; from a broad point of view, SoC is a micro-miniature system. SoC is generally defined as the integration of a microprocessor or
core81,例如是中央处理器(central processing unit,CPU)的Core,即算术逻辑运算单元(arithmetic logic unit,ALU),用于运行SoC的存储器84中的指令以及处理软件中的数据等;The
存储器84包括各种易失、非易失以及Cache等存储器;The
模拟IP核82和数字IP核83,可将一些在数字电路中常用,但比较复杂的功能模块设计成可修改参数的模块。如有限长单位冲激响应(Finite Impulse Response,FIR)滤波器、同步动态随机存储器(Synchronous Dynamic Random Access Memory,SDRAM)控制器、外设部件互连标准(Peripheral Component Interconnect,PCI)接口等。The
在本申请实施例中,SoC80可以与蓝牙芯片85配合工作实施本申请的技术方案,例如SoC80和蓝牙芯片85都设计在TG的主板电路上,SoC80中的存储器84中存储有执行本申请实施例的方法步骤的程序和数据,例如具体存储在SoC80的只读存储器(Read-OnlyMemory,ROM)中,core81可以运行ROM中存储的方法步骤的程序和数据。In the embodiments of the present application, the
以TG为手机,TC为车载设备为例,手机与车载设备蓝牙连接时,手机中的蓝牙芯片85通过蓝牙协议接收CT发送的SDP请求和浏览请求消息等,并将SDP请求和浏览请求消息传输给SoC80进行处理,SoC80可通过蓝牙芯片85向CT发送SDP响应和浏览响应消息等。当SoC80接收到至少两个浏览请求消息时,可以识别出车载设备无法显示媒体信息,可以将车载设备的设备信息记录在存储器84中,当手机与车载设备断开后再次连接时,当SoC80通过蓝牙芯片85接收到车载设备发送的SDP请求消息,SoC80可以查询到车载设备的设备信息记录在存储器84中,SoC80确定通过蓝牙芯片85向车载设备发送降低AVRCP版本后的AVRCP版本号,以便车载设备与手机的链路行为发生变化,避免车载设备无法显示媒体信息的问题。Taking the TG as the mobile phone and the TC as the in-vehicle device as an example, when the mobile phone is connected to the in-vehicle device via Bluetooth, the
图9示出了本申请提供的一种终端设备的结构示意图。FIG. 9 shows a schematic structural diagram of a terminal device provided by the present application.
终端设备可被称为接入终端、UE、用户单元、用户站、移动站、移动台、远方站、远程终端、移动设备、用户终端、终端、无线通信设备、用户代理或用户装置。接入终端可以是蜂窝电话、具有无线通信功能的手持设备、计算设备或连接到无线调制解调器的其它处理设备、车载设备、可穿戴设备以及第五代移动通信技术(5-Generation,5G)通信系统中的用户设备。上述各个电子设备仅是对终端设备的举例说明,终端设备还可以是其它电子设备,例如包含SoC80和蓝牙芯片85的手机和Pad等。A terminal device may be referred to as an access terminal, UE, subscriber unit, subscriber station, mobile station, mobile station, remote station, remote terminal, mobile device, user terminal, terminal, wireless communication device, user agent, or user equipment. An access terminal can be a cellular phone, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a wearable device, and a 5-Generation (5G) communication system user device in . The above electronic devices are only examples of terminal devices, and the terminal devices may also be other electronic devices, such as mobile phones and
如图9所示,当终端设备为手机时,手机90包括SoC80、蓝牙芯片85、控制电路、天线以及输入输出装置。SoC80主要用于对通信协议以及通信数据进行处理,以及对整个终端设备进行控制,执行软件程序,处理软件程序的数据。蓝牙芯片85可用于通过蓝牙协议与对端设备进行通信。控制电路主要用于基带信号与射频信号的转换以及对射频信号的处理。控制电路和天线一起也可以叫做收发器,主要用于收发电磁波形式的射频信号。输入输出装置,例如触摸屏、显示屏或键盘,主要用于接收用户输入的数据以及对用户输出数据。As shown in FIG. 9 , when the terminal device is a mobile phone, the
本领域技术人员可以理解,为了便于说明,图9仅示出了一个处理器(SoC80)。在实际的终端设备中,可以存在多个处理器。Those skilled in the art can understand that, for the convenience of description, FIG. 9 only shows one processor (SoC 80). In an actual terminal device, there may be multiple processors.
如图10所示,本申请实施例还提供一种终端设备10,终端设备包括存储器100、处理器102、收发器103和显示器104,存储器100存储有指令,存储器100、处理器102、收发器103和显示器104通过总线105相互连接;总线105可以是外设部件互连标准(PeripheralComponent Interconnect,PCI)总线或扩展工业标准结构(Extended Industry StandardArchitecture,EISA)总线等。总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。显示器104可以用于显示媒体播放器的图像等。As shown in FIG. 10 , an embodiment of the present application further provides a
当指令被处理器102执行时,使得终端设备10执行以下操作:When executed by the
响应于对端设备发送的第一服务发现协议SDP请求消息,向对端设备发送第一SDP响应消息,第一SDP响应消息携带第一AVRCP版本的版本号;In response to the first service discovery protocol SDP request message sent by the peer device, send a first SDP response message to the peer device, where the first SDP response message carries the version number of the first AVRCP version;
响应对端设备发送的至少两个浏览请求消息,浏览请求消息用于对端设备请求显示媒体播放器的媒体信息,向对端设备发送每个浏览请求消息对应的浏览响应消息,浏览响应消息指示媒体播放器不支持对端设备请求显示媒体播放器的媒体信息;In response to at least two browsing request messages sent by the peer device, the browsing request message is used for the peer device to request to display the media information of the media player, and sends a browsing response message corresponding to each browsing request message to the peer device, and the browsing response message indicates The media player does not support the request of the peer device to display the media information of the media player;
将对端设备的设备信息记录在预置的设备信息集合中;Record the device information of the peer device in the preset device information set;
响应于对端设备发送的第二SDP请求消息,第二SDP请求消息为终端设备与对端设备断开连接后再次连接时发送的,查询对端设备的设备信息是否在预置的设备信息集合中;若对端设备的设备信息在预置的设备信息集合中,则向对端设备发送第二SDP响应消息;第二SDP响应消息携带第二AVRCP版本的版本号,第二AVRCP版本的版本号低于第一AVRCP版本的版本号。In response to the second SDP request message sent by the peer device, the second SDP request message is sent when the terminal device is disconnected from the peer device and reconnected, and query whether the device information of the peer device is in the preset device information set. in; if the device information of the peer device is in the preset device information set, send a second SDP response message to the peer device; the second SDP response message carries the version number of the second AVRCP version, the version of the second AVRCP version The version number is lower than the version number of the first AVRCP version.
该操作具体的实现方式可以参照图6或图7中的实施例中的说明,本申请不再赘述。For a specific implementation manner of this operation, reference may be made to the description in the embodiment in FIG. 6 or FIG. 7 , which will not be repeated in this application.
在一种可能的设计中,第一AVRCP版本的版本号为AVRCP1.4,第二AVRCP版本的版本号为AVRCP1.3。In a possible design, the version number of the first AVRCP version is AVRCP1.4, and the version number of the second AVRCP version is AVRCP1.3.
操作还可以包括:若对端设备的设备信息不在预置的设备信息集合中,则向终端设备发送第一SDP响应消息。The operation may further include: if the device information of the peer device is not in the preset device information set, sending a first SDP response message to the terminal device.
其中,对端设备的设备信息包括对端设备的蓝牙信息,或对端设备的设备信息包括对端设备的蓝牙信息和设备类型;其中,蓝牙信息为对端设备的蓝牙地址的前三位,或蓝牙信息为对端设备的蓝牙名称,或蓝牙信息为对端设备的蓝牙地址的前三位以及蓝牙名称;预置的设备信息集合包括至少一个设备的蓝牙信息或至少一个设备的蓝牙信息和设备类型,或预置的设备信息集合为空。The device information of the peer device includes the Bluetooth information of the peer device, or the device information of the peer device includes the Bluetooth information and device type of the peer device; wherein the Bluetooth information is the first three bits of the Bluetooth address of the peer device, Or the Bluetooth information is the Bluetooth name of the peer device, or the Bluetooth information is the first three bits of the Bluetooth address of the peer device and the Bluetooth name; the preset device information set includes the Bluetooth information of at least one device or the Bluetooth information of at least one device and The device type, or the preset device information set is empty.
需要说明的是,第二SDP响应消息还包括第二AVRCP版本支持的特性;相应地,该操作还可以包括:将终端设备中第一AVRCP版本的特性更新为第二AVRCP版本的特性。It should be noted that the second SDP response message also includes features supported by the second AVRCP version; correspondingly, the operation may further include: updating the features of the first AVRCP version in the terminal device to the features of the second AVRCP version.
以上,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed by the present invention can easily think of changes or replacements, which should cover within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/CN2018/119934WO2020113591A1 (en) | 2018-12-07 | 2018-12-07 | Method and terminal device for dynamically adjusting version of avrcp |
| Publication Number | Publication Date |
|---|---|
| CN112889096A CN112889096A (en) | 2021-06-01 |
| CN112889096Btrue CN112889096B (en) | 2022-05-24 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201880098310.8AActiveCN112889096B (en) | 2018-12-07 | 2018-12-07 | Method for dynamically adjusting AVRCP version and terminal equipment |
| Country | Link |
|---|---|
| CN (1) | CN112889096B (en) |
| WO (1) | WO2020113591A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113572890B (en)* | 2021-06-16 | 2023-02-17 | 荣耀终端有限公司 | Volume management method and electronic device |
| CN113660636B (en)* | 2021-08-13 | 2025-03-04 | Oppo广东移动通信有限公司 | Device type determination method, device, device and storage medium |
| CN114374958A (en)* | 2021-12-30 | 2022-04-19 | 展讯通信(上海)有限公司 | Bluetooth communication method, device and equipment |
| CN115022391B (en)* | 2022-06-17 | 2024-05-03 | Oppo广东移动通信有限公司 | Service discovery method and device for Bluetooth device, terminal device and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105577293A (en)* | 2014-10-13 | 2016-05-11 | 炬芯(珠海)科技有限公司 | Bluetooth equipment testing method, Bluetooth equipment testing device and Bluetooth equipment testing system |
| CN106408912A (en)* | 2016-09-09 | 2017-02-15 | 惠州Tcl移动通信有限公司 | AVRCP (audio video remote control profile) instruction allocation method and system based on device types |
| CN106900080A (en)* | 2015-12-18 | 2017-06-27 | 展讯通信(上海)有限公司 | Bluetooth connecting method and device |
| CN107025912A (en)* | 2015-06-24 | 2017-08-08 | 联发科技(新加坡)私人有限公司 | Audio play control method and remote control based on bluetooth |
| CN107409265A (en)* | 2014-12-23 | 2017-11-28 | T·德格雷伊 | Audio sharing method and system |
| CN107509092A (en)* | 2017-09-07 | 2017-12-22 | 深圳创维数字技术有限公司 | Set top box plays method, set top box, terminal and the storage medium of audio in real time |
| CN108024128A (en)* | 2017-11-30 | 2018-05-11 | 广东欧珀移动通信有限公司 | Control method and device for Bluetooth music playing, terminal equipment and storage medium |
| CN108476040A (en)* | 2016-12-30 | 2018-08-31 | 华为技术有限公司 | Method and device for managing media files in managed equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR20110054609A (en)* | 2009-11-18 | 2011-05-25 | 삼성전자주식회사 | Remote control method and apparatus of a Bluetooth device |
| TWI572155B (en)* | 2014-05-30 | 2017-02-21 | 絡達科技股份有限公司 | Multi-role bluetooth device and connection method thereof |
| US10034035B2 (en)* | 2014-12-10 | 2018-07-24 | DISH Technologies L.L.C. | Methods, devices and systems for audiovisual synchronization with multiple output devices |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105577293A (en)* | 2014-10-13 | 2016-05-11 | 炬芯(珠海)科技有限公司 | Bluetooth equipment testing method, Bluetooth equipment testing device and Bluetooth equipment testing system |
| CN107409265A (en)* | 2014-12-23 | 2017-11-28 | T·德格雷伊 | Audio sharing method and system |
| CN107025912A (en)* | 2015-06-24 | 2017-08-08 | 联发科技(新加坡)私人有限公司 | Audio play control method and remote control based on bluetooth |
| CN106900080A (en)* | 2015-12-18 | 2017-06-27 | 展讯通信(上海)有限公司 | Bluetooth connecting method and 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 |
| CN108476040A (en)* | 2016-12-30 | 2018-08-31 | 华为技术有限公司 | Method and device for managing media files in managed equipment |
| CN107509092A (en)* | 2017-09-07 | 2017-12-22 | 深圳创维数字技术有限公司 | Set top box plays method, set top box, terminal and the storage medium of audio in real time |
| CN108024128A (en)* | 2017-11-30 | 2018-05-11 | 广东欧珀移动通信有限公司 | Control method and device for Bluetooth music playing, terminal equipment and storage medium |
| Publication number | Publication date |
|---|---|
| WO2020113591A1 (en) | 2020-06-11 |
| CN112889096A (en) | 2021-06-01 |
| Publication | Publication Date | Title |
|---|---|---|
| CN112889096B (en) | Method for dynamically adjusting AVRCP version and terminal equipment | |
| CN107889092B (en) | Bluetooth device communication control method, device, terminal device and storage medium | |
| CN107168905B (en) | File display method and device, storage medium and mobile terminal | |
| US10187474B2 (en) | Method and device for resource sharing between devices | |
| CN112055424B (en) | Electronic device and method for switching electronic device | |
| CN112789934B (en) | Bluetooth service query method and electronic equipment | |
| CN110287036A (en) | A device sharing method, device and system | |
| CN103298072A (en) | Method, system and mobile communication terminal for automatically connecting to WiFi access point | |
| WO2022053062A1 (en) | Method and terminal for managing iot device | |
| CN113810887A (en) | Bluetooth protocol connection method, device, storage medium and related equipment | |
| CN112119623A (en) | Method for sharing content based on account group and electronic device executing the same | |
| CN108415863A (en) | Hardware compatible implementation method of electronic device and related product | |
| CN105959483A (en) | Audio stream processing method and mobile terminal | |
| US20060160569A1 (en) | Cellular phone and portable storage device using the same | |
| CN114999604A (en) | Visit report generation method and device for clinical research project | |
| WO2020135131A1 (en) | Network hotspot switching method, intelligent terminal and computer-readable storage medium | |
| CN110166819A (en) | A kind of method, apparatus, terminal and system playing multimedia resource | |
| WO2024234837A1 (en) | Login method, electronic device, and storage medium | |
| CN107291327A (en) | Application control method and related product | |
| CN106126726A (en) | The exhibiting method of a kind of file scene and relevant device | |
| CN111858182B (en) | Data reading method and device, storage medium and mobile terminal | |
| CN106303616B (en) | Play control method, device and terminal | |
| CN117412109A (en) | Device connection method, device, electronic device and computer storage medium | |
| CN106899733B (en) | Intelligent terminal and system address book phone number processing method and device | |
| CN114173321B (en) | Equipment communication connection establishment method and equipment communication system |
| 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 |