CN112543361B - Multi-device playing method and device based on intelligent cabin and electronic terminal - Google Patents
- ️Tue Feb 28 2023
具体实施方式Detailed ways
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合附图对本申请的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. the embodiment. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
本申请实施例中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "including" and "having" mentioned in the embodiments of the present application and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes other unlisted steps or units, or optionally also includes Other steps or elements inherent to the process, method, product or apparatus are included.
目前,随着互联网技术的快速发展,智能手机、中控屏终端、平板和头枕屏终端的使用变得更加普遍,使得汽车娱乐的形式变得更加丰富和智能。在汽车娱乐办公系统中,头枕屏终端具有屏幕大的优势,可以播放视频等多媒体资源,手机及平板等具有使用便利的优势,中控屏终端具有性能较强的优势。At present, with the rapid development of Internet technology, the use of smart phones, central control screen terminals, tablets and headrest screen terminals has become more common, making the forms of car entertainment more abundant and intelligent. In the automotive entertainment and office system, the headrest screen terminal has the advantage of a large screen and can play multimedia resources such as videos, the mobile phone and tablet have the advantages of convenient use, and the central control screen terminal has the advantage of strong performance.
虽然头枕屏终端、手机、平板及中控屏终端都有各自的优势,但是在使用他们时,只能分别单独控制头枕屏终端、手机、平板及中控屏终端,即只能单独使用以上设备,例如,当用户在汽车客厅环境下,只能单独对手机、平板及中控屏终端等操作。因此,座舱相关的多设备综合使用便利性较低。Although the headrest screen terminal, mobile phone, tablet and central control screen terminal have their own advantages, when using them, the headrest screen terminal, mobile phone, tablet and central control screen terminal can only be controlled separately, that is, they can only be used alone For the above devices, for example, when the user is in the car living room environment, he can only operate the mobile phone, tablet and central control screen terminal alone. Therefore, the convenience of comprehensive use of multiple devices related to the cockpit is low.
基于此,本申请实施例提供了一种基于智能座舱的多设备播放方法、装置以及电子设备,通过该方法可以缓解座舱相关的多设备综合使用便利性较低的技术问题。Based on this, an embodiment of the present application provides a smart cockpit-based multi-device playback method, device, and electronic device, through which the technical problem of low convenience for comprehensive use of multi-device related to the cockpit can be alleviated.
下面结合附图对本申请实施例进行进一步地介绍。The embodiments of the present application will be further introduced below in conjunction with the accompanying drawings.
图1为本申请实施例提供的一种基于智能座舱的多设备播放方法的流程示意图。其中,该方法应用于电子终端,通过终端提供第一图形用户界面,第一图形用户界面中包含第一设备对应的第一选项,以及第二设备对应的第二选项。如图1所示,该方法包括:Fig. 1 is a schematic flowchart of a smart cockpit-based multi-device playback method provided by an embodiment of the present application. Wherein, the method is applied to an electronic terminal, and a first graphical user interface is provided through the terminal, and the first graphical user interface includes a first option corresponding to the first device and a second option corresponding to the second device. As shown in Figure 1, the method includes:
步骤S110,响应于针对第一选项和第二选项的选择操作,分别与第一设备以及第二设备进行配对连接。Step S110, in response to the selection operation on the first option and the second option, perform pairing connection with the first device and the second device respectively.
需要说明的是,所述第一设备和第二设备是电子终端在局域网内发现的,其中,电子终端可以是手机、平板等设备;局域网可以是车载局域网,或者家庭局域网等等,对网络类型不做限定;所述第一设备可以是中控屏终端,第二设备可以是头枕屏终端,具体的发现过程是:It should be noted that the first device and the second device are discovered by an electronic terminal in a local area network, wherein the electronic terminal can be a mobile phone, a tablet, etc.; the local area network can be a vehicle local area network, or a home local area network, etc. Not limited; the first device may be a central control screen terminal, and the second device may be a headrest screen terminal. The specific discovery process is:
步骤a),手机获取到自己的关于网络地址等信息的交换描述信息时,向局域网中发送广播报文,其中,广播报文内携带手机自己的交换描述信息;Step a), when the mobile phone obtains its own exchange description information about network address and other information, it sends a broadcast message to the local area network, wherein the broadcast message carries the exchange description information of the mobile phone itself;
步骤b),中控屏终端和头枕屏终端对局域网中指定端口进行监听,监听到手机发出的广播报文时,获取广播报文内携带的交换描述信息;Step b), the central control screen terminal and the headrest screen terminal monitor the designated port in the local area network, and when the broadcast message sent by the mobile phone is monitored, obtain the exchange description information carried in the broadcast message;
步骤c),中控屏终端和头枕屏终端对交换描述信息进行判断,当确定交换描述信息符合配对连接服务时,中控屏终端和头枕屏终端均分别携带自身的交换描述信息向电子终端进行单播响应,进而,根据中控屏终端的交换描述信息向电子终端宣告中控屏终端的存在,根据头枕屏终端的交换描述信息向电子终端宣告头枕屏终端的存在;Step c), the central control screen terminal and the headrest screen terminal judge the exchange description information, and when it is determined that the exchange description information conforms to the pairing connection service, the central control screen terminal and the headrest screen terminal respectively carry their own exchange description information to the electronic The terminal performs a unicast response, and then announces the existence of the central control screen terminal to the electronic terminal according to the exchange description information of the central control screen terminal, and announces the existence of the headrest screen terminal to the electronic terminal according to the exchange description information of the headrest screen terminal;
具体的,所述交换描述信息是指对设备通信的基本描述信息,可参考下表1:Specifically, the exchange description information refers to the basic description information for device communication, which can be referred to in Table 1 below:
表1Table 1
变量variable 类型type 说明illustrate IpIP StringString 设备通信IP地址Device communication IP address Portport IntInt 设备通信端口,用于后续建立通信服务Device communication port, used for subsequent establishment of communication services MacMac StringString 设备唯一标识Device unique identifier Namename StringString 设备名称device name Typetype StringString 设备类型(手机、电视、电脑)Device Type (Mobile Phone, TV, Computer)
电子终端发现中控屏终端和头枕屏终端后,需分别与中控屏终端和头枕屏终端进行配对连接,具体的配对连接过程是:中控屏终端产生配对验证码1,头枕屏终端产生配对验证码2,在电子终端输入配对验证码1时,电子终端与中控屏终端进行配对连接,在电子终端输入配对验证码2时,电子终端与头枕屏终端进行配对连接。After the electronic terminal discovers the central control screen terminal and the headrest screen terminal, it needs to pair and connect with the central control screen terminal and the headrest screen terminal respectively. The specific pairing and connection process is: the central control screen terminal generates a pairing verification code 1, and the headrest screen terminal The terminal generates a pairing verification code 2. When the electronic terminal enters the pairing verification code 1, the electronic terminal performs a pairing connection with the central control screen terminal. When the electronic terminal enters the pairing verification code 2, the electronic terminal performs a pairing connection with the headrest screen terminal.
具体的,电子终端发现和连接部分实现的主要类包括:FindAndConnectDevices和DeviceItem两个类。DeviceItem类定义了本申请的设备描述信息,包括IP、端口、设备类型等信息;FindAndConnectDevices类用于实现设备发现和设备连接功能,其属性mTVList和mPCList分别表示电子终端发现的头枕屏终端和中控屏终端信息列表,属性mPhoneSelfInfo表示电子终端自己的设备信息,方法initParam()用于获取电子终端自己的设备信息,方法broadcastAndListen()用于向局域网广播发现设备的信息并监听响应,方法connect()用于和指定的设备验证配对码并建立连接。Specifically, the main classes implemented in the electronic terminal discovery and connection part include two classes: FindAndConnectDevices and DeviceItem. The DeviceItem class defines the device description information of this application, including information such as IP, port, and device type; the FindAndConnectDevices class is used to realize device discovery and device connection functions, and its attributes mTVList and mPCList represent the headrest screen terminals and middle Control screen terminal information list, the attribute mPhoneSelfInfo indicates the device information of the electronic terminal itself, the method initParam() is used to obtain the device information of the electronic terminal itself, the method broadcastAndListen() is used to broadcast the information of the discovered device to the LAN and monitor the response, the method connect( ) is used to verify the pairing code and establish a connection with the specified device.
步骤S120,对配对连接完成后的第一设备中的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送多媒体资源。Step S120, accessing the multimedia resource in the first device after the pairing connection is completed, and controlling the first device to send the multimedia resource to the second device after the pairing connection is completed.
需要说明的是,本申请中,在根据电子终端(包含安卓软件RDP)向第二设备进行投屏时,如果已经对头枕屏终端和中控屏终端完成配对,电子终端选择要投屏的中控屏终端即可实现投屏功能。It should be noted that, in this application, when the electronic terminal (including Android software RDP) is used to project the screen to the second device, if the headrest screen terminal and the central control screen terminal have been paired, the electronic terminal selects the central control screen terminal to be projected. The control screen terminal can realize the screen projection function.
该模块的实现主要包括RdpControlService和RdpAccessibilityService两个类。RdpControlService类是用来提供RDP软件的远程控制服务,其方法openRdp()和exitRdp()分别用于打开RDP投屏和退出RDP投屏,方法openAccessibility()用于打开头枕屏终端的无障碍服务。The implementation of this module mainly includes two classes, RdpControlService and RdpAccessibilityService. The RdpControlService class is used to provide the remote control service of RDP software. Its methods openRdp() and exitRdp() are used to open RDP screen projection and exit RDP screen projection respectively. The method openAccessibility() is used to open the accessibility service of the headrest screen terminal .
RdpAccessibilityService类是监测安卓系统中屏幕画面的变化,当检测到智能头枕屏终端画面为RDP选择中控屏终端投屏界面时,自动点击完成选择。其属性pcName和pcIp分别表示要投屏的目标中控屏终端,方法onAccessibilityEvent()用于获取安卓系统当前画面,并分析其节点信息是否匹配RDP选择中控屏终端投屏界面,方法autoClick()用于自动点击RDP选择中控屏终端投屏界面中的目标中控屏终端选项;中控屏终端画面投屏远程控制操作指令格式如下表2:The RdpAccessibilityService class monitors the changes of the screen in the Android system. When it detects that the terminal screen of the smart headrest screen is the RDP selection screen projection interface of the central control screen terminal, it automatically clicks to complete the selection. Its attributes pcName and pcIp respectively represent the target central control screen terminal to be projected. The method onAccessibilityEvent() is used to obtain the current screen of the Android system and analyze whether its node information matches the RDP selection central control terminal screen projection interface. The method autoClick() It is used to automatically click RDP to select the target central control screen terminal option in the central control screen terminal screen projection interface; the format of the central control screen terminal screen projection remote control operation command format is shown in Table 2:
表2Table 2
步骤S130,控制第二设备播放多媒体资源。Step S130, controlling the second device to play multimedia resources.
需要说明的是,电子终端可以对第二设备远程控制,具体的,远程控制包括但不限于:暂停、开始、快进、调节音量、调节亮度、加载网络字幕和退出等;所述第二设备主要用于播放远程投影过来的视频、音频和图片,另外,也向电子终端提供远程控制媒体播放的命令接口,这是本实施例的基础。It should be noted that the electronic terminal can remotely control the second device. Specifically, the remote control includes but is not limited to: pause, start, fast forward, adjust volume, adjust brightness, load network subtitles and exit, etc.; the second device It is mainly used to play video, audio and pictures projected from a remote location. In addition, a command interface for remote control of media playback is also provided to the electronic terminal, which is the basis of this embodiment.
本申请实施例能够响应于针对第一选项和第二选项的选择操作,分别与第一设备以及第二设备进行配对连接;对配对连接完成后的第一设备中的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送多媒体资源。控制第二设备播放多媒体资源。本方案中,电子终端能够分别和第一设备和第二设备进行配对连接,配对连接成功后,电子终端、第一设备和第二设备之间实现了互通互联,便于用户通过电子终端对第一设备进行远程访问,便于用户通过电子终端将第一设备的多媒体资源发送向第二设备,进而,便于用户通过电子终端远程控制第二设备播放多媒体资源,从而实现了电子终端、第一设备和第二设备之间的互通互联,缓解了座舱相关的多设备综合使用便利性较低的技术问题。In this embodiment of the present application, in response to the selection operation for the first option and the second option, respectively perform pairing connection with the first device and the second device; access the multimedia resources in the first device after the pairing connection is completed, and control the second A device sends multimedia resources to the second device after the pairing connection is completed. Control the second device to play the multimedia resource. In this solution, the electronic terminal can be paired and connected with the first device and the second device respectively. After the pairing connection is successful, the electronic terminal, the first device and the second device realize intercommunication, which is convenient for the user to pair the first device through the electronic terminal. Remote access to the device facilitates the user to send the multimedia resources of the first device to the second device through the electronic terminal, and further facilitates the user to remotely control the second device to play multimedia resources through the electronic terminal, thereby realizing the electronic terminal, the first device and the second device. The interconnection between the two devices alleviates the technical problem of low convenience in the comprehensive use of multi-device related to the cockpit.
下面对上述步骤进行详细介绍。The above steps are described in detail below.
在一些实施例中,可以将本地的多媒体资源发送至第二设备。作为一个示例,所述方法还可以包括如下步骤:In some embodiments, the local multimedia resources may be sent to the second device. As an example, the method may also include the following steps:
步骤d),响应于针对第二选项的资源推送操作,将本地的多媒体资源发送至第二设备。Step d), sending the local multimedia resource to the second device in response to the resource push operation for the second option.
需要说明的是,当用户针对第二选项做出资源推送操作时,电子终端可以将本地的多媒体资源发送至第二设备。It should be noted that when the user performs a resource push operation for the second option, the electronic terminal may send the local multimedia resource to the second device.
本申请实施例中,响应于针对所述第二选项的资源推送操作,将本地的多媒体资源发送至所述第二设备。所以,电子终端可以将自身的多媒体资源发送至第二设备,以使第二设备播放该多媒体资源,进而,可以将电子终端的便利性与第二设备的大屏特性结合起来,提高了对电子终端及第二设备操作的便利性。In this embodiment of the present application, in response to the resource push operation for the second option, local multimedia resources are sent to the second device. Therefore, the electronic terminal can send its own multimedia resources to the second device, so that the second device can play the multimedia resources. Furthermore, the convenience of the electronic terminal can be combined with the large-screen feature of the second device, which improves the user experience of the electronic terminal. The convenience of terminal and second device operation.
在一些实施例中,可以将多媒体资源分类存放,以使用户方便快捷的访问多媒体资源。作为一个示例,所述多媒体资源的类型包括多种,所述方法还可以包括以下步骤:In some embodiments, the multimedia resources can be classified and stored, so that users can access the multimedia resources conveniently and quickly. As an example, the types of the multimedia resources include multiple types, and the method may also include the following steps:
步骤e),根据每个多媒体资源对应的目标类型,将多媒体资源存入与目标类型对应的预设集合内;Step e), according to the target type corresponding to each multimedia resource, store the multimedia resource in a preset set corresponding to the target type;
其中,所述多媒体资源的类型包括视频、音频及图片中的任意多种;所述预设集合内包括视频集合、音频集合及图片集合中的任意多种。Wherein, the type of the multimedia resource includes any multiple of video, audio, and picture; the preset set includes any multiple of video set, audio set, and picture set.
需要说明的是,电子终端可以对多媒体资源的类型进行判断,确定每个多媒体资源对应的目标类型后,根据每个多媒体资源对应的目标类型,将多媒体资源存入与目标类型对应的预设集合内。It should be noted that the electronic terminal can judge the type of the multimedia resource, and after determining the target type corresponding to each multimedia resource, store the multimedia resource into the preset set corresponding to the target type according to the target type corresponding to each multimedia resource Inside.
示例性的,将从设备中搜索到的视频文件信息放入videoSets,搜索到的音频文件信息放入audioSets,搜索到的图片文件信息放入imageSets,从而可以把设备上所有的多媒体资源信息统一的组织管理起来,并显示视频文件夹、音频文件夹及图片文件夹。当用户向中控屏终端请求资源服务时,可以看到视频文件夹、音频文件夹及图片文件夹,进而,可以获取到不同文件夹内的多媒体内容;用MediaStore类实现电子终端上视频的搜索,音乐和图片的实现的流程与视频基本相同。For example, put the video file information searched from the device into videoSets, the searched audio file information into audioSets, and the searched picture file information into imageSets, so that all multimedia resource information on the device can be unified Organize and display video folders, audio folders and picture folders. When the user requests resource services from the central control screen terminal, he can see the video folder, audio folder and picture folder, and then obtain the multimedia content in different folders; use the MediaStore class to realize the video search on the electronic terminal , the implementation process of music and pictures is basically the same as that of video.
本申请实施例中,根据每个多媒体资源对应的目标类型,将多媒体资源存入与目标类型对应的预设集合内;其中,多媒体资源的类型包括视频、音频及图片中的任意多种;预设集合包括视频集合、音频集合及图片集合中的任意多种。所以,电子终端可以将多媒体资源分类存放,便于用户按照类型访问多媒体资源,便于用户寻找不同类型的多媒体资源。In the embodiment of the present application, according to the target type corresponding to each multimedia resource, the multimedia resource is stored in a preset set corresponding to the target type; wherein, the type of the multimedia resource includes any variety of video, audio and picture; preset It is assumed that the collection includes any kind of video collection, audio collection and picture collection. Therefore, the electronic terminal can classify and store multimedia resources, so that users can access multimedia resources according to types, and it is convenient for users to search for different types of multimedia resources.
在一些实施例中,基于上述步骤S120,可以根据预设集合的类型,分别访问多媒体资源。基于此,所述步骤S120包括:In some embodiments, based on the above step S120, the multimedia resources can be accessed respectively according to the type of the preset collection. Based on this, the step S120 includes:
步骤f),对配对连接完成后的第一设备中预设集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送预设集合内的多媒体资源。Step f), accessing the multimedia resources in the preset set in the first device after the pairing connection is completed, and controlling the first device to send the multimedia resources in the preset set to the second device after the pairing connection is completed.
示例性的,电子设备对配对连接完成后的第一设备中视频集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送视频集合内的多媒体资源;或者,对配对连接完成后的第一设备中音频集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送音频集合内的多媒体资源;或者,对配对连接完成后的第一设备中图片集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送图片集合内的多媒体资源。Exemplarily, the electronic device accesses the multimedia resources in the video collection of the first device after the pairing connection is completed, and controls the first device to send the multimedia resources in the video collection to the second device after the pairing connection is completed; After the connection is completed, the first device accesses the multimedia resources in the audio collection, and controls the first device to send the multimedia resources in the audio collection to the second device after the pairing connection is completed; or, to the first device after the pairing connection is completed. The multimedia resources in the picture collection are accessed, and the first device is controlled to send the multimedia resources in the picture collection to the second device after the pairing connection is completed.
本申请实施例可以对配对连接完成后的第一设备中预设集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送预设集合内的多媒体资源。所以,可以通过预设集合的类型,将多媒体资源分类存放,进而,便于用户有针对性的访问多媒体资源。The embodiment of the present application can access the multimedia resources in the preset set in the first device after the pairing connection is completed, and control the first device to send the multimedia resources in the preset set to the second device after the pairing connection is completed. Therefore, multimedia resources can be classified and stored by presetting the types of collections, and furthermore, it is convenient for users to access multimedia resources in a targeted manner.
在一些实施例中,可以控制第二设备播放多媒体资源的播放进度等信息。作为一个示例,上述步骤S130可以包括如下步骤:In some embodiments, the second device can be controlled to play information such as the playback progress of the multimedia resource. As an example, the above step S130 may include the following steps:
步骤g),当第一设备向第二设备发送的是视频集合内的第一多媒体资源和/或音频集合内的第二多媒体资源时,获取播放的第一多媒体资源的第一实时进度信息和/或第二多媒体资源的第二实时进度信息;Step g), when the first device sends to the second device the first multimedia resource in the video collection and/or the second multimedia resource in the audio collection, obtain the information of the played first multimedia resource The first real-time progress information and/or the second real-time progress information of the second multimedia resource;
步骤h),响应于针对第一实时进度信息和/或第二实时进度信息进行更改的选择操作,向第二设备发送用于跳转到指定进度信息的第一指令;Step h), in response to a selection operation for modifying the first real-time progress information and/or the second real-time progress information, sending a first instruction for jumping to specified progress information to the second device;
步骤i),根据第一指令控制第二设备播放第一多媒体资源和/或第二多媒体资源。Step i), controlling the second device to play the first multimedia resource and/or the second multimedia resource according to the first instruction.
对于上述步骤g),需要说明的是,当第一设备向第二设备发送的是视频集合内的第一多媒体资源和/或音频集合内的第二多媒体资源时,第二设备开始播放第一多媒体资源和/或第二多媒体资源,并将当前播放的实时进度信息和总时间长度信息发送给电子终端,所以,电子终端获取当前播放的实时进度信息和总时间长度信息。For the above step g), it should be noted that when the first device sends the second device the first multimedia resource in the video collection and/or the second multimedia resource in the audio collection, the second device Start playing the first multimedia resource and/or the second multimedia resource, and send the current playing real-time progress information and total time length information to the electronic terminal, so the electronic terminal obtains the current playing real-time progress information and total time length information.
示例性的,当第一设备向第二设备发送的是视频集合内的第一多媒体资源时,第二设备开始播放第一多媒体资源,并将当前播放第一多媒体资源的第一实时进度信息和总时间长度信息发送给电子终端,所以,电子终端获取当前播放的第一实时进度信息和总时间长度信息。Exemplarily, when the first device sends the first multimedia resource in the video collection to the second device, the second device starts to play the first multimedia resource, and The first real-time progress information and the total time length information are sent to the electronic terminal, so the electronic terminal acquires the currently played first real-time progress information and the total time length information.
对于上述步骤h),示例性的,当前播放的是第一多媒体资源,即视频,第一实时进度信息是5分钟,总时间长度信息是30分钟,第一指令是将5分钟更改为10分钟,当用户针对第一实时进度信息进行更改时,电子终端向第二设备发送用于跳转到指定进度信息的第一指令;For the above step h), exemplary, what is playing currently is the first multimedia resource, i.e. video, the first real-time progress information is 5 minutes, the total time length information is 30 minutes, and the first instruction is to change 5 minutes to 10 minutes, when the user makes changes to the first real-time progress information, the electronic terminal sends a first instruction for jumping to the specified progress information to the second device;
对于上述步骤i),示例性地,电子终端控制第二设备播放第一多媒体资源时,根据第一指令控制第二设备将第一多媒体资源的第一实时进度信息5分钟更改为10分钟,使第二设备按照10分钟时的指定进度信息开始播放。For the above step i), for example, when the electronic terminal controls the second device to play the first multimedia resource, it controls the second device according to the first instruction to change the first real-time progress information of the first multimedia resource for 5 minutes to 10 minutes, so that the second device starts playing according to the specified progress information at 10 minutes.
本申请实施例中,当第一设备向第二设备发送的是视频集合内的第一多媒体资源和/或音频集合内的第二多媒体资源时,获取播放的第一多媒体资源的第一实时进度信息和/或第二多媒体资源的第二实时进度信息;当接收到用户发送的用于更改第一实时进度信息和/或第二实时进度信息的第一指令时,向第二设备发送第一指令;根据第一指令控制第二设备播放第一多媒体资源和/或第二多媒体资源。所以,电子终端可以远程控制第二设备播放多媒体资源的进度,提高了对第二设备操作的便利性。In this embodiment of the application, when the first device sends the first multimedia resource in the video collection and/or the second multimedia resource in the audio collection to the second device, the first multimedia resource to be played is acquired The first real-time progress information of the resource and/or the second real-time progress information of the second multimedia resource; when the first instruction for changing the first real-time progress information and/or the second real-time progress information sent by the user is received , sending a first instruction to the second device; controlling the second device to play the first multimedia resource and/or the second multimedia resource according to the first instruction. Therefore, the electronic terminal can remotely control the progress of the second device playing multimedia resources, which improves the convenience of operating the second device.
在一些实施例中,可以控制第二设备播放多媒体资源的播放方式及播放时间间隔等信息。作为一个示例,上述步骤S130可以包括如下步骤:In some embodiments, information such as the playing manner and playing time interval of the multimedia resource played by the second device may be controlled. As an example, the above step S130 may include the following steps:
步骤j),当第一设备向第二设备发送的是图片集合内的多媒体资源时,响应于针对播放方式的选择操作,向第二设备发送第二指令;Step j), when the first device sends the multimedia resource in the picture collection to the second device, in response to the selection operation for the playback mode, send the second instruction to the second device;
步骤k),响应于针对播放时间间隔的选择操作,向第二设备发送第三指令;Step k), in response to the selection operation for the playing time interval, sending a third instruction to the second device;
步骤l),根据第二指令及第三指令控制第二设备播放多媒体资源。Step 1), controlling the second device to play the multimedia resource according to the second instruction and the third instruction.
对于上述步骤j),需要说明的是,所述播放方式是指针对图片的播放方式,例如,播放方式是幻灯片方式,当第一设备向第二设备发送的是图片集合内的多媒体资源,即图片时,当用户选择幻灯片方式,电子终端向第二设备发送关于幻灯片方式的第二指令;For the above step j), it should be noted that the playback mode refers to the playback mode for pictures, for example, the playback mode is a slide show mode, when the first device sends multimedia resources in the picture collection to the second device, For pictures, when the user selects the slideshow mode, the electronic terminal sends a second instruction about the slideshow mode to the second device;
对于上述步骤k),需要说明的是,用户可以自定义播放图片的播放时间间隔,例如,用户设置的播放时间间隔是3秒、5秒或8秒等,当用户自定义播放时间间隔是5秒时,电子终端向第二设备发送关于5秒的第三指令;For the above step k), it should be noted that the user can customize the playing time interval of playing pictures, for example, the playing time interval set by the user is 3 seconds, 5 seconds or 8 seconds, etc., when the user-defined playing time interval is 5 seconds seconds, the electronic terminal sends a third instruction about 5 seconds to the second device;
对于上述步骤l),需要说明的是,电子终端对第二设备的控制操作包括:播放、暂停、下一张、上一张和退出等。示例性的,根据第二指令及第三指令,控制第二设备按照幻灯片方式播放图片,且每隔5秒切换一张图片。For the above step 1), it should be noted that the control operations of the electronic terminal on the second device include: play, pause, next, previous, and exit. Exemplarily, according to the second instruction and the third instruction, the second device is controlled to play pictures in a slide show, and switch a picture every 5 seconds.
本申请实施例中,当第一设备向第二设备发送的是图片集合内的多媒体资源时,响应于针对播放方式的选择操作,向第二设备发送第二指令;响应于针对播放时间间隔的选择操作,向第二设备发送第三指令;根据第二指令及所述第三指令控制第二设备播放多媒体资源。所以,电子终端可以按照播放时间间隔及播放方式远程控制第二设备播放多媒体资源,便于用户根据适宜的播放速度观看多媒体资源。In the embodiment of the present application, when the first device sends the multimedia resources in the picture collection to the second device, in response to the selection operation for the playback mode, send the second instruction to the second device; in response to the playback time interval Select an operation to send a third instruction to the second device; control the second device to play multimedia resources according to the second instruction and the third instruction. Therefore, the electronic terminal can remotely control the second device to play multimedia resources according to the playing time interval and playing mode, so that users can watch multimedia resources at an appropriate playing speed.
在一些实施例中,可以根据语音指令控制第二设备播放多媒体资源。作为一个示例,上述步骤S130可以包括如下步骤:In some embodiments, the second device can be controlled to play multimedia resources according to the voice command. As an example, the above step S130 may include the following steps:
步骤m),接收用于控制第二设备播放多媒体资源的语音指令;Step m), receiving voice instructions for controlling the second device to play multimedia resources;
步骤n),对语音指令进行识别,得到相应的实际关键词;Step n), recognizing the voice command to obtain the corresponding actual keyword;
步骤o),在预设关键词集合内查找与实际关键词匹配的预设关键词;Step o), searching for preset keywords matching actual keywords in the preset keyword set;
步骤p),根据预设关键词在预设语音指令集合内确定相应的预设语音指令;Step p), determining the corresponding preset voice command in the preset voice command set according to the preset keywords;
步骤q),将预设语音指令发送至第二设备,并根据预设语音指令控制第二设备播放多媒体资源。In step q), the preset voice command is sent to the second device, and the second device is controlled to play multimedia resources according to the preset voice command.
对于上述步骤m),需要说明的是,电子终端可以根据语音指令对第二设备进行远程控制,具体的,电子终端先开启语音控制服务,当用户对电子设备发出语音指令时,电子终端接收该语音指令,例如,电子终端接收的语音指令是增大音量。For the above step m), it should be noted that the electronic terminal can remotely control the second device according to the voice command. Specifically, the electronic terminal first starts the voice control service. When the user sends a voice command to the electronic device, the electronic terminal receives the voice command. Voice command, for example, the voice command received by the electronic terminal is to increase the volume.
对于上述步骤n),需要说明的是,对输入的语音指令进行识别时,需要集成百度语音识别SDK,示例性的,对“增大音量”的语音指令进行识别,得到相应的实际关键词:增大、音量。For the above step n), it should be noted that when the input voice command is recognized, the Baidu voice recognition SDK needs to be integrated. For example, the voice command of "increase the volume" is recognized to obtain the corresponding actual keyword: Increase, volume.
对于上述步骤o),需要说明的是,预设关键词集合内有多个预设关键词,例如,预设关键词集合是:{预设增大音量1、预设减小音量1、预设播放1、预设暂停1...},在预设关键词集合内查找与实际关键词匹配的预设关键词,由于实际关键词是增大、音量,预设关键词集合内有预设增大音量1,所以,与实际关键词匹配的预设关键词是:预设增大音量1。For the above step o), it should be noted that there are multiple preset keywords in the preset keyword set, for example, the preset keyword set is: {preset increase volume 1, preset decrease volume 1, preset Set play 1, preset pause 1...}, search for preset keywords matching the actual keywords in the preset keyword set, because the actual keywords are increase, volume, there are preset keywords in the preset keyword set It is assumed that the volume is increased by 1, so the preset keyword matching the actual keyword is: preset volume up 1.
对于上述步骤p),需要说明的是,预设语音指令集合内有多个预设语音指令,例如,预设语音指令集合是:{预设增大音量2、预设减小音量2、预设播放2、预设暂停2...},根据预设关键词在预设语音指令集合内确定相应的预设语音指令,由于实际关键词是预设增大音量1,预设关键词集合内有预设增大音量2,所以,与预设关键词匹配的预设语音指令是:预设增大音量2。For the above step p), it should be noted that there are multiple preset voice commands in the preset voice command set, for example, the preset voice command set is: {preset increase volume 2, preset volume down 2, preset Set play 2, preset pause 2...}, determine the corresponding preset voice command in the preset voice command set according to the preset keyword, because the actual keyword is the preset increase volume 1, the preset keyword set There is preset to increase the volume 2, so the preset voice command matching the preset keyword is: preset to increase the volume 2.
对于上述步骤q),示例性的,电子终端将预设语音指令发送至第二设备,并根据预设语音指令控制第二设备增大音量。For the above step q), for example, the electronic terminal sends the preset voice command to the second device, and controls the second device to increase the volume according to the preset voice command.
本申请实施例可以接收用于控制第二设备播放多媒体资源的语音指令;对语音指令进行识别,得到相应的实际关键词;在预设关键词集合内查找与实际关键词匹配的预设关键词;根据预设关键词在预设控制指令集合内确定相应的预设控制指令;将预设控制指令发送至所述第二设备,并根据预设控制指令控制第二设备播放多媒体资源。所以,电子终端可以通过语音对第二设备远程控制,提高了用户控制第二设备的便利性。The embodiment of the present application can receive voice instructions for controlling the second device to play multimedia resources; recognize the voice instructions to obtain the corresponding actual keywords; search for preset keywords that match the actual keywords in the preset keyword set ; Determine the corresponding preset control command in the preset control command set according to the preset keywords; send the preset control command to the second device, and control the second device to play multimedia resources according to the preset control command. Therefore, the electronic terminal can remotely control the second device through voice, which improves the convenience for the user to control the second device.
在一些实施例中,可以控制第二设备播放视频时加载字幕,或者控制第二设备播放音频时加载歌词。作为一个示例,上述步骤S130可以包括如下步骤:In some embodiments, it is possible to control the second device to load subtitles when playing a video, or control the second device to load lyrics when playing audio. As an example, the above step S130 may include the following steps:
步骤r),向字幕歌词服务器发送用于查找与多媒体资源对应的字幕文件或歌词文件的第四指令;Step r), send the 4th instruction that is used for searching the subtitle file or the lyrics file corresponding to the multimedia resource to the subtitle lyrics server;
步骤s),接收字幕歌词服务器返回的字幕文件列表或歌词文件列表;Step s), receiving the subtitle file list or the lyrics file list returned by the subtitle lyrics server;
步骤t),响应于根据字幕文件列表或歌词文件列表确定目标文件的选择操作,向第二设备发送用于加载目标文件的第五指令,第五指令内包含目标文件的位置信息;Step t), in response to the selection operation of determining the target file according to the subtitle file list or the lyrics file list, send the fifth instruction for loading the target file to the second device, the fifth instruction includes the position information of the target file;
步骤u),根据第五指令控制第二设备对目标文件进行下载;Step u), controlling the second device to download the target file according to the fifth instruction;
步骤v),控制第二设备对多媒体资源与目标文件进行同步播放。Step v), controlling the second device to play the multimedia resource and the target file synchronously.
对于上述步骤r),示例性的,电子终端向字幕歌词服务器发送用于查找与多媒体资源对应的字幕文件的第四指令;For the above step r), exemplary, the electronic terminal sends a fourth instruction for searching the subtitle file corresponding to the multimedia resource to the subtitle lyrics server;
对于上述步骤s),示例性的,电子终端接收字幕歌词服务器返回的字幕文件列表,例如,字幕文件列表是:字幕文件1;字幕文件2;字幕文件3。For the above step s), for example, the electronic terminal receives the subtitle file list returned by the subtitle lyrics server, for example, the subtitle file list is: subtitle file 1; subtitle file 2; subtitle file 3.
对于上述步骤t),示例性的,当接收到用户根据字幕文件列表确定目标文件的第四指令时,电子终端向第二设备发送用于加载目标文件的第五指令,第五指令内包含目标文件的位置信息及加载目标文件的信息,位置信息即URL信息,第二设备可以根据位置信息下载对应目标文件,其中,目标文件是字幕文件1。For the above step t), for example, when receiving the fourth instruction that the user determines the target file according to the subtitle file list, the electronic terminal sends the fifth instruction for loading the target file to the second device, and the fifth instruction contains the target The location information of the file and the information of the loading target file, where the location information is URL information, the second device can download the corresponding target file according to the location information, wherein the target file is the subtitle file 1 .
对于上述步骤u),示例性的,电子终端根据第五指令控制第二设备对在位置信息下载目标文件。For the above step u), for example, the electronic terminal controls the second device to download the target file based on the location information according to the fifth instruction.
对于上述步骤v),示例性的,电子终端控制第二设备对多媒体资源与目标文件1进行同步播放,也就是控制第二设备对视频与字幕文件1进行同步播放。For the above step v), for example, the electronic terminal controls the second device to play the multimedia resource and the target file 1 synchronously, that is, controls the second device to play the video and the subtitle file 1 synchronously.
本申请实施例可以向字幕歌词服务器发送用于查找与多媒体资源对应的字幕文件或歌词文件的第四指令;接收字幕歌词服务器返回的字幕文件列表或歌词文件列表;响应于根据字幕文件列表或歌词文件列表确定目标文件的选择操作,向第二设备发送用于加载目标文件的第五指令,第五指令内包含目标文件的位置信息;根据第五指令控制第二设备对目标文件进行下载;控制第二设备对多媒体资源与目标文件进行同步播放。所以,电子终端可以远程控制第二设备播放视频资源时加载字幕,控制第二设备播放音频资源时加载歌词,使得第二设备同步播放视频资源与字幕,同步播放音频与歌词,成功实现了外挂字幕或歌词,便于用户观看多媒体资源。In the embodiment of the present application, a fourth instruction for searching a subtitle file or a lyric file corresponding to a multimedia resource may be sent to the subtitle lyric server; a subtitle file list or a lyric file list returned by the subtitle lyric server; The file list determines the selection operation of the target file, sends the fifth instruction for loading the target file to the second device, and the fifth instruction contains the location information of the target file; controls the second device to download the target file according to the fifth instruction; controls The second device synchronously plays the multimedia resource and the target file. Therefore, the electronic terminal can remotely control the second device to load subtitles when playing video resources, and control the second device to load lyrics when playing audio resources, so that the second device can play video resources and subtitles synchronously, and play audio and lyrics synchronously, successfully implementing external subtitles or lyrics, which is convenient for users to watch multimedia resources.
在一些实施例中,可以针对多个历史用户控制第二设备加载的多个历史字幕文件或历史歌词文件,对多个历史字幕文件或历史歌词文件添加标识,以便对字幕文件列表或歌词文件列表进行智能排序。作为一个示例,所述方法还可以包括如下步骤:In some embodiments, multiple historical subtitle files or historical lyric files loaded by the second device can be controlled by multiple historical users, and multiple historical subtitle files or historical lyric files can be identified, so that the subtitle file list or lyric file list Do smart sorting. As an example, the method may also include the following steps:
步骤w),当接收到用户确定选中的目标文件是有效文件的第六指令时,对目标文件添加有效标识;Step w), when receiving the sixth instruction that the user determines that the selected target file is a valid file, add a valid mark to the target file;
步骤x),当接收到用户确定选中的目标文件是无效文件的第七指令时,对目标文件添加无效标识;Step x), when receiving the seventh instruction that the user determines that the selected target file is an invalid file, add an invalid mark to the target file;
步骤y),根据目标文件的标识种类,对字幕文件列表内的字幕文件进行排序,或对歌词文件列表内的歌词文件进行排序。In step y), sort the subtitle files in the subtitle file list, or sort the lyric files in the lyric file list according to the identification type of the target file.
对于上述步骤w),需要说明的是,字幕文件列表或歌词文件列表内有多个文件,当用户选择其中一个文件作为目标文件,并确定选中的目标文件是有效文件时,电子终端会对该目标文件添加有效标识,例如,取字幕文件列表,字幕文件列表是:字幕文件1;字幕文件2;字幕文件3,当用户1选择字幕文件2作为目标文件,并确定字幕文件2是有效文件时,电子终端会对字幕文件2添加有效标识;当用户2选择字幕文件2作为目标文件,并确定字幕文件2是有效文件时,电子终端会对字幕文件2添加有效标识。For the above step w), it should be noted that there are multiple files in the subtitle file list or lyrics file list, when the user selects one of the files as the target file and determines that the selected target file is a valid file, the electronic terminal will check the selected target file. Add a valid identifier to the target file, for example, take the subtitle file list, the subtitle file list is: subtitle file 1; subtitle file 2; subtitle file 3, when user 1 selects subtitle file 2 as the target file and confirms that subtitle file 2 is a valid file , the electronic terminal will add a valid identifier to the subtitle file 2; when the user 2 selects the subtitle file 2 as the target file and determines that the subtitle file 2 is a valid file, the electronic terminal will add a valid identifier to the subtitle file 2.
对于上述步骤x),示例性的,当用户选择其中一个文件作为目标文件,并确定选中的目标文件是无效文件,如乱码或时间乱序等时,电子终端会对该目标文件添加无效标识,例如,由于字幕文件列表是:字幕文件1;字幕文件2;字幕文件3,当用户3选择字幕文件1作为目标文件,并确定字幕文件1是无效文件时,电子终端会对字幕文件1添加无效标识。For the above step x), for example, when the user selects one of the files as the target file and determines that the selected target file is an invalid file, such as garbled characters or time disorder, the electronic terminal will add an invalid mark to the target file, For example, since the subtitle file list is: subtitle file 1; subtitle file 2; subtitle file 3, when user 3 selects subtitle file 1 as the target file and determines that subtitle file 1 is an invalid file, the electronic terminal will add invalid subtitle file 1 logo.
对于上述步骤y),需要说明的是,本申请使用的字幕库由“射手网”提供,歌词库由酷狗歌词提供,用户对目标文件的有效使用和无效使用的记录都将发送给电子终端,用于评价该目标字幕文件并进行智能排序。示例性的,根据历史数据预先建立的关于字幕文件、标识种类及标识种类的数量的字幕文件列表如下表3:For the above step y), it should be noted that the subtitle library used in this application is provided by "Shooter.com", the lyrics library is provided by Kugou Lyrics, and the records of the user's effective use and invalid use of the target file will be sent to the electronic terminal , used to evaluate the target subtitle file and perform intelligent sorting. Exemplarily, the list of subtitle files about subtitle files, identification types and the number of identification types pre-established according to historical data is shown in Table 3:
表3table 3
通过查询上表3可知,字幕文件1包含1个无效标识,字幕文件2包含2个有效标识,根据目标文件的标识种类,对字幕文件列表内的字幕文件进行排序,得到的顺序是:字幕文件2;字幕文件1;字幕文件3。By querying the above table 3, we can see that subtitle file 1 contains 1 invalid identifier, and subtitle file 2 contains 2 valid identifiers. According to the identifier type of the target file, sort the subtitle files in the subtitle file list, and the obtained order is: subtitle file 2; subtitle file 1; subtitle file 3.
另外,为了避免流行度失衡问题,防止出现流行度高的目标文件愈来愈靠近列表顶端,也就是说目标文件拥有的有效标识越来越多,而阻碍新的字幕文件或歌词文件被推荐给用户,本申请还采用遗忘函数对流行度值进行修正,即对目标文件拥有的有效标识进行修正。In addition, in order to avoid the imbalance problem of popularity, prevent the target file with high popularity from getting closer and closer to the top of the list, that is to say, the target file has more and more effective identifiers, which prevents new subtitle files or lyrics files from being recommended to User, this application also uses the forgetting function to correct the popularity value, that is, to correct the effective identifier owned by the target file.
具体的,本实施例的实现主要包括SubtitleControlService、SubtitleUtil和Subtitle三个类。Subtitle类是用来描述一个字幕文件的基本属性,包含ID、字幕文件名称、字幕文件URL地址和字幕文件流行度指标的值四个属性。Specifically, the implementation of this embodiment mainly includes three classes: SubtitleControlService, SubtitleUtil and Subtitle. The Subtitle class is used to describe the basic attributes of a subtitle file, including four attributes: ID, subtitle file name, subtitle file URL address, and subtitle file popularity index value.
SubtitleControlService类是用来提供字幕智能推荐的远程控制服务,其方法searchSubs()用于搜索符合指定视频文件的所有字幕文件,并对搜索到的字幕文件按本系统设计的流行度推荐算法排序;方法sendSubsUrlToPhone()用于把智能推荐的字幕文件结果返回给电子终端。The SubtitleControlService class is used to provide remote control services for subtitle intelligent recommendation. Its method searchSubs() is used to search for all subtitle files that match the specified video file, and sort the searched subtitle files according to the popularity recommendation algorithm designed by this system; method sendSubsUrlToPhone() is used to return the subtitle file result of intelligent recommendation to the electronic terminal.
SubtitleUtil类是用来实现字幕智能推荐中的一些具体操作,其方法getInternetSubs()主要是调用“射手网”提供的字幕API来按视频名称获取字幕文件;方法doSort()用于将获取的多个字幕文件按流行度指标排序;方法getSubSorce()和updateSorce()分别用于获取和更新字幕文件的流行度指标值。电子终端获取到字幕文件URL后,传送到第二设备即可。The SubtitleUtil class is used to implement some specific operations in subtitle intelligent recommendation. Its method getInternetSubs() mainly calls the subtitle API provided by "Shooter.com" to obtain subtitle files according to the video name; the method doSort() is used to obtain multiple The subtitle files are sorted according to the popularity index; the methods getSubSorce() and updateSorce() are used to obtain and update the popularity index value of the subtitle file respectively. After the electronic terminal obtains the URL of the subtitle file, it only needs to transmit it to the second device.
本申请实施例中,当接收到用户确定选中的目标文件是有效文件的第六指令时,对目标文件添加有效标识;当接收到用户确定选中的目标文件是无效文件的第七指令时,对目标文件添加无效标识;根据目标文件的标识种类,对字幕文件列表内的字幕文件进行排序,或对歌词文件列表内的歌词文件进行排序。所以,电子终端可以通过流行度的推荐算法对字幕文件列表或歌词文件列表智能排序,通过遗忘函数对流行度值进行修正,以便定时更新字幕文件列表或歌词文件列表。In the embodiment of the present application, when the sixth instruction that the user determines that the selected target file is a valid file is received, a valid mark is added to the target file; when the seventh instruction that the user determines that the selected target file is an invalid file is received, the Add an invalid mark to the target file; sort the subtitle files in the subtitle file list, or sort the lyric files in the lyric file list according to the mark type of the target file. Therefore, the electronic terminal can intelligently sort the subtitle file list or the lyric file list through the popularity recommendation algorithm, and correct the popularity value through the forgetting function, so as to regularly update the subtitle file list or the lyric file list.
在一些实施例中,作为一个示例,上述步骤s)可以包括如下步骤:In some embodiments, as an example, the above step s) may include the following steps:
步骤s1),接收字幕歌词服务器返回的根据标识种类进行排序的字幕文件列表或歌词文件列表。Step s1), receiving a list of subtitle files or a list of lyric files sorted according to identification types returned by the subtitle lyrics server.
在一些实施例中,可以向第二设备发送第八指令,以控制第二设备连接蓝牙设备。作为一个示例,所述方法还可以包括以下步骤:In some embodiments, an eighth instruction may be sent to the second device to control the second device to connect to the Bluetooth device. As an example, the method may also include the following steps:
步骤z1),向第二设备发送用于连接蓝牙设备的第八指令;Step z1), sending an eighth instruction for connecting the Bluetooth device to the second device;
步骤z2),根据第八指令控制第二设备与蓝牙设备进行连接,以根据蓝牙设备播放多媒体资源。Step z2), control the second device to connect with the bluetooth device according to the eighth instruction, so as to play multimedia resources according to the bluetooth device.
对于上述步骤z1)和步骤z2),需要说明的是,蓝牙设备可以是带有蓝牙功能的设备,例如,蓝牙音箱,示例性的,电子终端向第二设备发送用于连接蓝牙音箱的第八指令,并根据第八指令控制第二设备与蓝牙音箱进行连接,进而,第二设备可以根据蓝牙音箱播放多媒体资源。For the above step z1) and step z2), it should be noted that the bluetooth device may be a device with a bluetooth function, for example, a bluetooth speaker. Exemplarily, the electronic terminal sends the eighth command, and control the second device to connect with the Bluetooth speaker according to the eighth command, and then, the second device can play multimedia resources according to the Bluetooth speaker.
本申请实施例可以向第二设备发送用于连接蓝牙音箱的第八指令;根据第四请求控制第二设备与蓝牙音箱进行连接,以根据蓝牙音箱播放多媒体资源。所以,电子终端可以远程控制第二设备连接蓝牙设备,并通过蓝牙设备播放音频,提高了用户对多媒体资源的观看体验。In the embodiment of the present application, an eighth instruction for connecting the Bluetooth speaker can be sent to the second device; and the second device is controlled to connect with the Bluetooth speaker according to the fourth request, so as to play multimedia resources according to the Bluetooth speaker. Therefore, the electronic terminal can remotely control the second device to connect to the bluetooth device, and play audio through the bluetooth device, which improves the user's viewing experience of multimedia resources.
在一些实施例中,可以向第二设备发送第九指令,以对第二设备上的应用进行管理。作为一个示例,所述方法还可以包括以下步骤:In some embodiments, a ninth instruction may be sent to the second device to manage applications on the second device. As an example, the method may also include the following steps:
步骤z3),向第二设备发送用于管理应用的第九指令;Step z3), sending a ninth instruction for managing applications to the second device;
步骤z4),根据第九指令对第二设备上的应用进行管理。Step z4), manage the applications on the second device according to the ninth instruction.
对于上述步骤z3)和步骤z4),需要说明的是,电子终端通过向头枕屏终端发送第九指令,根据第九指令对头枕屏终端提供应用管理控制服务,具体的,电子终端向头枕屏终端发送第九指令,头枕屏终端根据第九指令向电子终端返回已安装应用列表,进而,电子终端获取头枕屏终端上的已安装应用列表,然后对头枕屏终端上的应用进行打开和卸载操作。示例性的,电子终端向头枕屏终端发送第九指令,第九指令包含打开腾讯APP的信息,并根据第五请求控制第二设备打开腾讯APP。For the above step z3) and step z4), it should be noted that the electronic terminal provides application management and control services to the headrest screen terminal according to the ninth instruction by sending the ninth instruction to the headrest screen terminal. Specifically, the electronic terminal sends the headrest screen terminal The screen terminal sends the ninth instruction, and the headrest screen terminal returns the installed application list to the electronic terminal according to the ninth instruction, and then, the electronic terminal obtains the installed application list on the headrest screen terminal, and then opens the application on the headrest screen terminal and uninstall operations. Exemplarily, the electronic terminal sends a ninth instruction to the headrest screen terminal, the ninth instruction includes information about opening the Tencent APP, and controls the second device to open the Tencent APP according to the fifth request.
具体的,本实施例的实现主要包括AppControlService和AppItem两个类。其中AppItem类是用来描述一个APP的基本属性,包含应用名称、应用包名和应用图标URL地址三个属性。AppControlService类用于头枕屏终端应用控制服务的具体实现,其属性mAppList表示头枕屏终端应用集合,方法scanApp()用于获取设备上的系统应用和第三方安装应用,方法createAppIcon()用于为设备应用生成应用图标,方法setAppList()和getAppList()分别用于设置和获取设备应用列表,方法startApp()和unInstallApp()分别用于打开和卸载设备应用。Specifically, the implementation of this embodiment mainly includes two classes, AppControlService and AppItem. The AppItem class is used to describe the basic attributes of an APP, including three attributes: application name, application package name and application icon URL address. The AppControlService class is used to realize the application control service of the headrest screen terminal. Its attribute mAppList indicates the collection of headrest screen terminal applications. The method scanApp() is used to obtain the system applications and third-party installed applications on the device. The method createAppIcon() is used to Generate application icons for device applications, methods setAppList() and getAppList() are used to set and obtain device application lists respectively, methods startApp() and unInstallApp() are used to open and uninstall device applications respectively.
头枕屏终端应用的远程控制操作指令的格式如下表4:The format of the remote control operation instruction for the headrest screen terminal application is as follows: Table 4:
表4Table 4
本申请实施例可以向第二设备发送用于管理应用的第九指令;根据第九指令对第二设备上的应用进行管理,所以,电子终端可以根据第九指令对第二设备上的应用进行远程控制,提高了用户控制第二设备的便利性。In this embodiment of the present application, the ninth instruction for managing applications can be sent to the second device; the application on the second device is managed according to the ninth instruction, so the electronic terminal can manage the application on the second device according to the ninth instruction. Remote control, which improves the convenience for the user to control the second device.
在一些实施例中,可以根据高级加密标准对媒体资源进行加密,以保证传输多媒体资源的安全性。作为一个示例,在步骤S120内的控制第一设备向配对连接完成后的第二设备发送多媒体资源的步骤之前,还可以包括以下步骤:In some embodiments, the media resource can be encrypted according to the Advanced Encryption Standard, so as to ensure the security of the transmitted multimedia resource. As an example, before the step of controlling the first device to send multimedia resources to the second device after the pairing connection is completed in step S120, the following steps may also be included:
步骤z5),根据高级加密标准对多媒体资源进行加密,得到加密后的多媒体资源。In step z5), the multimedia resource is encrypted according to the Advanced Encryption Standard to obtain the encrypted multimedia resource.
需要说明的是,对称加密的加密速度非常快,用于经常发送数据的场合,非常适合本申请的使用环境,所以,本申请实施例采用高级加密标准(即AES加密算法)对多设备之间的交互信息进行加密及解密处理,具体的加密及解密过程如下:It should be noted that the encryption speed of symmetric encryption is very fast, and it is very suitable for the use environment of this application when data is often sent. Therefore, the embodiment of this application adopts the Advanced Encryption Standard (that is, the AES encryption algorithm) The interaction information is encrypted and decrypted. The specific encryption and decryption process is as follows:
步骤z51),发送方使用AES加密函数,并将其密钥设置为KEY,根据密钥KEY对待传输的明文进行加密,得到加密后的密文,之后便可将密文在网络中进行传输,如传输到第二设备,其中,发送方可以是电子终端自身,或者第一设备等等。Step z51), the sender uses the AES encryption function, and sets its key as KEY, encrypts the plaintext to be transmitted according to the key KEY, obtains the encrypted ciphertext, and then transmits the ciphertext in the network, For example, the transmission to the second device, wherein the sender may be the electronic terminal itself, or the first device, and so on.
步骤z52),接受方在收到密文后,同样根据密钥KEY使用AES解密函数,对接收的密文进行解密处理,得到相应的明文。In step z52), after receiving the ciphertext, the recipient also uses the AES decryption function according to the key KEY to decrypt the received ciphertext to obtain the corresponding plaintext.
本申请实施例可以根据高级加密标准对多媒体资源进行加密,得到加密后的多媒体资源,所以,通过对明文加密后再在网络中进行传输,提高了数据传输的安全性,最大程度的避免明文对应的多媒体资源泄露。The embodiment of the present application can encrypt multimedia resources according to the Advanced Encryption Standard to obtain encrypted multimedia resources. Therefore, by encrypting the plaintext and then transmitting it in the network, the security of data transmission is improved, and the plaintext correspondence is avoided to the greatest extent. multimedia resource leaks.
在一些实施例中,可以根据实时流传输协议控制第一设备向第二设备发送加密后的多媒体资源。作为一个示例,步骤S120内的控制第一设备向配对连接完成后的第二设备发送多媒体资源的步骤可以包括以下步骤:In some embodiments, the first device may be controlled to send the encrypted multimedia resource to the second device according to the real-time streaming protocol. As an example, the step of controlling the first device to send multimedia resources to the second device after the pairing connection is completed in step S120 may include the following steps:
步骤z6),根据实时流传输协议控制第一设备向配对连接完成后的第二设备发送加密后的多媒体资源。Step z6), according to the real-time streaming protocol, the first device is controlled to send the encrypted multimedia resource to the second device after the pairing connection is completed.
需要说明的是,针对在多设备之间传输多媒体资源,本申请采用的是实时流传输协议,即RTSP,具体的使用RTSP传输的实现方法如下:It should be noted that, for the transmission of multimedia resources between multiple devices, this application adopts the real-time streaming transmission protocol, that is, RTSP, and the specific implementation method of using RTSP transmission is as follows:
步骤z61),头枕屏终端向中控屏终端或电子终端发送OPTION请求,询问中控屏终端或电子终端有哪些方法可用,中控屏终端或电子终端响应消息中包括提供的所有可用方法;Step z61), the headrest screen terminal sends an OPTION request to the central control screen terminal or electronic terminal, asking which methods are available on the central control screen terminal or electronic terminal, and the central control screen terminal or electronic terminal responds with all available methods provided;
步骤z62),头枕屏终端向中控屏终端或电子终端发送DESCRIBE请求,要求获取中控屏终端或电子终端提供的媒体初始化描述信息;Step z62), the headrest screen terminal sends a DESCRIBE request to the central control screen terminal or electronic terminal, requesting to obtain the media initialization description information provided by the central control screen terminal or electronic terminal;
步骤z63),头枕屏终端向中控屏终端或电子终端发送SETUP请求,和中控屏终端或电子终端建立会话,中控屏终端或电子终端建立会话并返回会话标识符及相关会话信息;Step z63), the headrest screen terminal sends a SETUP request to the central control screen terminal or electronic terminal, and establishes a session with the central control screen terminal or electronic terminal, and the central control screen terminal or electronic terminal establishes a session and returns a session identifier and related session information;
步骤z64),头枕屏终端向中控屏终端或电子终端发送PLAY请求,请求播放多媒体文件,中控屏终端或电子终端回应请求信息并开始发送流媒体数据;Step z64), the headrest screen terminal sends a PLAY request to the central control screen terminal or electronic terminal, requesting to play multimedia files, and the central control screen terminal or electronic terminal responds to the request information and starts to send streaming media data;
步骤z65),头枕屏终端向中控屏终端或电子终端发送TEARDOWN请求,请求关闭和中控屏终端或电子终端的会话,中控屏终端或电子终端回应请求并结束会话。Step z65), the headrest screen terminal sends a TEARDOWN request to the central control screen terminal or electronic terminal, requesting to close the session with the central control screen terminal or electronic terminal, and the central control screen terminal or electronic terminal responds to the request and ends the session.
另外,考虑到网络状况是一直发生变化的,本实施例还能实现流传输动态码自适应,使用的是常用的流量控制算法,是基于常数乘性增长和乘性减少的流量控制算法。具体的,本申请集成的VLC开源播放器支持RTSP数据流,并实现了对I、P帧的处理。用ThresHold作为丢包率的门限值,用于判断当前网络是否发送拥塞,当丢包率大于ThresHold时,认为发现网络拥塞,需要降低发送速率来减少包的丢失;当丢包率远小于ThresHold时,认为网络状况较好,需要提高发送速率,从而提高网络带宽的利用率。In addition, considering that network conditions are constantly changing, this embodiment can also realize dynamic code adaptation for streaming, using a commonly used flow control algorithm based on constant multiplicative increase and multiplicative decrease. Specifically, the VLC open source player integrated in this application supports RTSP data streams, and realizes the processing of I and P frames. Use ThresHold as the threshold value of the packet loss rate to determine whether the current network is congested. When the packet loss rate is greater than ThresHold, it is considered that the network is congested, and the sending rate needs to be reduced to reduce packet loss; when the packet loss rate is much smaller than ThresHold When , it is considered that the network is in good condition, and the sending rate needs to be increased to increase the utilization rate of the network bandwidth.
本实施例的实现主要包括RtspServer、RequestListener、WorkThread、Request、Response和Session六个类。RtspServer类实现了RTSP服务器,用于实现流传输服务,包括初始化信息、调用工作线程进行流传输、监听request等信息、计算丢包率并动态调整传输码率;RequestListener类是被RtspServer使用的一个监听器,可用于监听RTSP报文信息;WorkThread类是执行流传输的工作线程,用于解析来至客户端的请求,并将响应信息返回给客户端,另外该类还对session进行控制;Request和Response是定义请求信息和响应的信息的类;Session实现了对数据流的具体控制,包括把动态变化的传输码率设置给视频流。The implementation of this embodiment mainly includes six classes: RtspServer, RequestListener, WorkThread, Request, Response and Session. The RtspServer class implements the RTSP server, which is used to implement the streaming service, including initialization information, calling the worker thread for streaming, monitoring information such as requests, calculating the packet loss rate and dynamically adjusting the transmission bit rate; the RequestListener class is a listener used by the RtspServer Device, which can be used to monitor RTSP message information; WorkThread class is a worker thread that executes stream transmission, used to parse the request from the client, and return the response information to the client. In addition, this class also controls the session; Request and Response It is a class that defines request information and response information; Session realizes specific control of data flow, including setting dynamically changing transmission bit rate to video flow.
本申请实施例可以根据高级加密标准对多媒体资源进行加密,得到加密后的多媒体资源,所以,可以通过高级加密标准对多媒体资源进行加密,提高了传输多媒体资源的安全性,降低了向第二设备发送高质量视频的传输时延,提高了用户体验。The embodiment of the present application can encrypt the multimedia resources according to the Advanced Encryption Standard to obtain the encrypted multimedia resources. Therefore, the multimedia resources can be encrypted through the Advanced Encryption Standard, which improves the security of transmitting multimedia resources and reduces the transmission of multimedia resources to the second device. The transmission delay of sending high-quality video improves the user experience.
图2为本申请实施例提供的一种基于智能座舱的多设备播放方法的流程示意图。其中,该方法应用于电子终端,通过终端之外的其他终端提供第二图形用户界面,第二图形用户界面中包含第一设备对应的第一选项,以及第二设备对应的第二选项;如图2所示,所述方法包括:Fig. 2 is a schematic flowchart of a smart cockpit-based multi-device playback method provided by an embodiment of the present application. Wherein, the method is applied to an electronic terminal, and a second graphical user interface is provided through a terminal other than the terminal, and the second graphical user interface includes a first option corresponding to the first device and a second option corresponding to the second device; As shown in Figure 2, the method includes:
步骤S210,响应于针对第一选项和第二选项的选择操作,分别与第一设备以及第二设备进行配对连接;Step S210, performing pairing connection with the first device and the second device respectively in response to the selection operation for the first option and the second option;
步骤S220,获取配对连接完成后的第二设备针对所述多媒体资源的播放信息;Step S220, acquiring the playback information of the multimedia resource by the second device after the pairing connection is completed;
步骤S230,控制第二设备对播放信息进行更改。Step S230, controlling the second device to modify the playing information.
对于上述步骤S210,需要说明的是,电子终端1分别与第一设备和第二设备配对连接后,可以将本地的多媒体资源或第一设备的多媒体资源发送至第二设备,并控制第二设备播放多媒体资源,同时,电子终端2、电子终端3等其他的电子终端也可以分别与第一设备和第二设备配对连接,而且,电子终端2、电子终端3等也能访问第一设备上的多媒体资源,进而将本地的多媒体资源或第一设备的多媒体资源发送至第二设备。For the above step S210, it should be noted that after the electronic terminal 1 is paired and connected with the first device and the second device, it can send the local multimedia resource or the multimedia resource of the first device to the second device, and control the second device Play multimedia resources, at the same time, other electronic terminals such as electronic terminal 2 and electronic terminal 3 can also be paired and connected with the first device and the second device respectively, and electronic terminal 2, electronic terminal 3, etc. can also access the first device. multimedia resources, and then send the local multimedia resources or the multimedia resources of the first device to the second device.
对于上述步骤S220,示例性的,电子终端2获取第二设备正在播放多媒体资源的进度信息,例如,进度信息是:该多媒体资源的总时间长度是30分钟,正在播放到第10分钟。For the above step S220, for example, the electronic terminal 2 acquires the progress information of the multimedia resource being played by the second device, for example, the progress information is: the total duration of the multimedia resource is 30 minutes, and the multimedia resource is being played to the 10th minute.
对于上述步骤S230,示例性的,电子终端2控制第二设备对播放信息进行更改,即:可以控制第二设备暂停播放该多媒体资源,或者控制第二设备快进该多媒体资源的播放进度等。For the above step S230, for example, the electronic terminal 2 controls the second device to modify the playing information, that is, it can control the second device to pause playing the multimedia resource, or control the second device to fast-forward the playing progress of the multimedia resource.
本申请实施例可以响应于针对第一选项和第二选项的选择操作,分别与第一设备以及第二设备进行配对连接;获取配对连接完成后的第二设备针对多媒体资源的播放信息;控制第二设备对播放信息进行更改。所以,多个电子终端均可以获取第二设备的播放信息,进而,控制第二设备更改播放信息,从而便于多个用户控制第二设备的播放信息,缓解了座舱相关的多设备综合使用便利性较低的技术问题,提高了用户体验。In this embodiment of the present application, in response to the selection operation for the first option and the second option, respectively perform pairing connection with the first device and the second device; obtain the playback information of the multimedia resource of the second device after the pairing connection is completed; control the second device The second device changes the playback information. Therefore, multiple electronic terminals can obtain the playback information of the second device, and then control the second device to change the playback information, so that multiple users can control the playback information of the second device, and ease the convenience of comprehensive use of multiple devices related to the cockpit Lower technical issues and improved user experience.
另外,在上述实施例的基础上,本申请还使用了异步消息队列,在实际使用过程中可能出现多个电子终端和同一个头枕屏终端建立连接,而这多个电子终端可能同时与该头枕屏终端进行信息交互,这可能出现一定程度的并发问题。另外,电子终端给头枕屏终端发送指令时,头枕屏终端需要做一些耗时操作,如下载字幕、获取视频等,如果采用单线程执行,这可能导致信息丢失。为了解决上述问题,本申请采用了异步消息队列。In addition, on the basis of the above-mentioned embodiments, this application also uses an asynchronous message queue. In actual use, multiple electronic terminals may establish connections with the same headrest screen terminal, and these multiple electronic terminals may simultaneously communicate with the headrest screen terminal. The pillow screen terminal performs information interaction, which may cause a certain degree of concurrency problems. In addition, when the electronic terminal sends instructions to the headrest screen terminal, the headrest screen terminal needs to perform some time-consuming operations, such as downloading subtitles, obtaining videos, etc. If single-threaded execution is used, this may lead to information loss. In order to solve the above problems, this application adopts an asynchronous message queue.
具体的,本申请中电子终端向头枕屏终端发送的交互指令,会首先进入消息队列中,而不是直接发送给业务处理系统,这种方式让电子终端发送端和头枕屏终端接受端两者之间没有依赖性,发送者发送消息之后,不管业务需要处理多久,都不会影响到发送者下次发送消息,业务处理系统使用轮询的方式从消息队列中取消息,并进行业务处理,其中的耗时任务也可以并发执行。因此,可以避免电子终端发送过多的指令导致信息丢失,提高了处理效率。Specifically, in this application, the interactive commands sent by the electronic terminal to the headrest screen terminal will first enter the message queue instead of being sent directly to the business processing system. This way allows the sending end of the electronic terminal and the receiving end of the headrest screen terminal There is no dependency between senders. After the sender sends a message, no matter how long the business needs to be processed, it will not affect the sender's next message sending. The business processing system uses polling to fetch messages from the message queue and perform business processing , the time-consuming tasks in it can also be executed concurrently. Therefore, it is possible to avoid information loss caused by the electronic terminal sending too many instructions, thereby improving processing efficiency.
在上述实施例的基础上,本申请还使用了网络断开通知策略,具体的,网络断开通知策略包括:头枕屏终端和/或中控屏终端离开局域网时,如果电子终端不知道头枕屏终端和/或中控屏终端断开的信息,依旧将头枕屏终端和/或中控屏终端的信息展示给用户,会给用户的使用带来困扰。所以,本申请采用的方法是,在头枕屏终端和/或中控屏终端关闭软件时,将自身离开的消息告诉给电子终端,值得注意的是,如果出现设备突然断电、断网等情况,头枕屏终端和/或中控屏终端离开的消息不能传送给电子终端,因此,电子终端还需要定时发送广播消息,判断头枕屏终端和/或中控屏终端是否在线,如果在线就不做更新,如果设备离线,则需要更新设备显示列表。为了节省自身和网络资源,只在用户处于设备连接界面时才激活定时广播,用户离开该界面时关闭定时广播。因此,可以通过网络断开通知策略及时发现第一设备和/第二设备等多个设备是否在线,便于及时通知用户多个设备的在线情况。On the basis of the above-mentioned embodiments, this application also uses a network disconnection notification strategy. Specifically, the network disconnection notification strategy includes: when the headrest screen terminal and/or the central control screen terminal leave the local area network, if the electronic terminal does not know the headrest The headrest screen terminal and/or central control screen terminal disconnection information still displays the information of the headrest screen terminal and/or central control screen terminal to the user, which will bring troubles to the user. Therefore, the method adopted in this application is to tell the electronic terminal the news of its own departure when the headrest screen terminal and/or the central control screen terminal close the software. In some cases, the message that the headrest screen terminal and/or the central control screen terminal has left cannot be transmitted to the electronic terminal. Therefore, the electronic terminal also needs to regularly send broadcast messages to determine whether the headrest screen terminal and/or the central control screen terminal are online. Do not update, if the device is offline, you need to update the device display list. In order to save itself and network resources, the scheduled broadcast is only activated when the user is in the device connection interface, and the scheduled broadcast is turned off when the user leaves the interface. Therefore, whether multiple devices such as the first device and/or the second device are online can be discovered in time through the network disconnection notification strategy, so as to facilitate timely notification of the online status of multiple devices to the user.
本申请实施例提供的基于智能座舱的多设备播放方法,与上述实施例提供的基于智能座舱的多设备播放方法具有相同的技术特征,所以也能解决相同的技术问题,达到相同的技术效果。The smart cockpit-based multi-device playback method provided in the embodiment of the present application has the same technical features as the smart cockpit-based multi-device playback method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effect.
图3提供了一种基于智能座舱的多设备播放装置的结构示意图。该装置可以应用于电子终端,通过终端提供第一图形用户界面,第一图形用户界面中包含第一设备对应的第一选项,以及第二设备对应的第二选项;如图3所示,基于智能座舱的多设备播放装置300包括:Fig. 3 provides a schematic structural diagram of a multi-device playback device based on a smart cockpit. The apparatus can be applied to an electronic terminal, and a first graphical user interface is provided through the terminal, and the first graphical user interface includes a first option corresponding to a first device and a second option corresponding to a second device; as shown in FIG. 3 , based on The multi-device playback device 300 of the smart cockpit includes:
第一连接模块301,用于响应于针对所述第一选项和所述第二选项的选择操作,分别与所述第一设备以及所述第二设备进行配对连接;The first connection module 301 is configured to perform pairing connection with the first device and the second device respectively in response to selection operations on the first option and the second option;
发送模块302,用于对配对连接完成后的第一设备中的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送多媒体资源。The sending module 302 is configured to access the multimedia resource in the first device after the pairing connection is completed, and control the first device to send the multimedia resource to the second device after the pairing connection is completed.
播放模块303,用于控制第二设备播放多媒体资源。The playing module 303 is configured to control the second device to play multimedia resources.
在一些实施例中,所述基于智能座舱的多设备播放装置300还用于:In some embodiments, the multi-device playback device 300 based on the smart cockpit is also used for:
响应于针对第二选项的资源推送操作,将本地的多媒体资源发送至第二设备。In response to the resource push operation for the second option, the local multimedia resource is sent to the second device.
在一些实施例中,多媒体资源的类型包括多种,基于智能座舱的多设备播放装置300还用于:In some embodiments, the types of multimedia resources include multiple types, and the multi-device playback device 300 based on the smart cockpit is also used for:
根据每个多媒体资源对应的目标类型,将多媒体资源存入与目标类型对应的预设集合内;According to the target type corresponding to each multimedia resource, store the multimedia resource in a preset set corresponding to the target type;
其中,多媒体资源的类型包括视频、音频及图片中的任意多种;预设集合包括视频集合、音频集合及图片集合中的任意多种。Wherein, the types of multimedia resources include any multiples of video, audio, and pictures; the preset collection includes any multiples of video sets, audio sets, and picture sets.
在一些实施例中,发送模块302具体用于:In some embodiments, the sending module 302 is specifically used to:
对配对连接完成后的第一设备中预设集合内的多媒体资源进行访问,控制第一设备向配对连接完成后的第二设备发送预设集合内的多媒体资源。Accessing the multimedia resources in the preset set in the first device after the pairing connection is completed, and controlling the first device to send the multimedia resources in the preset set to the second device after the pairing connection is completed.
在一些实施例中,播放模块303具体用于:In some embodiments, the playback module 303 is specifically used for:
当第一设备向第二设备发送的是视频集合内的第一多媒体资源和/或音频集合内的第二多媒体资源时,获取播放的第一多媒体资源的第一实时进度信息和/或第二多媒体资源的第二实时进度信息;When the first device sends the first multimedia resource in the video collection and/or the second multimedia resource in the audio collection to the second device, acquire the first real-time progress of the played first multimedia resource information and/or second real-time progress information of the second multimedia resource;
响应于针对第一实时进度信息和/或第二实时进度信息进行更改的选择操作,向第二设备发送用于跳转到指定进度信息的第一指令;In response to a selection operation for modifying the first real-time progress information and/or the second real-time progress information, sending a first instruction for jumping to specified progress information to the second device;
根据第一指令控制第二设备播放第一多媒体资源和/或第二多媒体资源。Control the second device to play the first multimedia resource and/or the second multimedia resource according to the first instruction.
在一些实施例中,播放模块303具体用于:In some embodiments, the playback module 303 is specifically used for:
当第一设备向第二设备发送的是图片集合内的多媒体资源时,响应于针对播放方式的选择操作,向第二设备发送第二指令;When the first device sends the multimedia resources in the picture collection to the second device, in response to the selection operation for the playback mode, send the second instruction to the second device;
响应于针对播放时间间隔的选择操作,向第二设备发送第三指令;sending a third instruction to the second device in response to the selection operation for the playing time interval;
根据第二指令及第三指令控制第二设备播放多媒体资源。The second device is controlled to play the multimedia resource according to the second instruction and the third instruction.
在一些实施例中,播放模块303具体用于:In some embodiments, the playing module 303 is specifically used for:
接收用于控制第二设备播放多媒体资源的语音指令;receiving voice instructions for controlling the second device to play multimedia resources;
对所述语音指令进行识别,得到相应的实际关键词;Recognizing the voice command to obtain corresponding actual keywords;
在预设关键词集合内查找与实际关键词匹配的预设关键词;Find preset keywords matching actual keywords in the preset keyword set;
根据预设关键词在预设语音指令集合内确定相应的预设语音指令;Determining corresponding preset voice commands in the preset voice command set according to preset keywords;
将预设语音指令发送至第二设备,并根据预设语音指令控制第二设备播放多媒体资源。Send the preset voice command to the second device, and control the second device to play multimedia resources according to the preset voice command.
在一些实施例中,基于智能座舱的多设备播放装置300还用于:In some embodiments, the multi-device playback device 300 based on the smart cockpit is also used for:
查找模块,用于向字幕歌词服务器发送用于查找与多媒体资源对应的字幕文件或歌词文件的第四指令;A search module, configured to send a fourth instruction for searching a subtitle file or a lyric file corresponding to a multimedia resource to the subtitle lyrics server;
接收模块,用于接收字幕歌词服务器返回的字幕文件列表或歌词文件列表;The receiving module is used to receive the subtitle file list or the lyric file list returned by the subtitle lyrics server;
加载模块,用于响应于根据字幕文件列表或歌词文件列表确定目标文件的选择操作,向第二设备发送用于加载目标文件的第五指令,第五指令内包含目标文件的位置信息;The loading module is used to respond to the selection operation of determining the target file according to the subtitle file list or the lyric file list, and send a fifth instruction for loading the target file to the second device, and the fifth instruction includes the location information of the target file;
下载模块,用于根据第五指令控制第二设备对目标文件进行下载;A download module, configured to control the second device to download the target file according to the fifth instruction;
第一播放模块,用于控制第二设备对多媒体资源与目标文件进行同步播放。The first playing module is used to control the second device to play the multimedia resource and the target file synchronously.
在一些实施例中,基于智能座舱的多设备播放装置300还用于:In some embodiments, the multi-device playback device 300 based on the smart cockpit is also used for:
当接收到用户确定选中的目标文件是有效文件的第六指令时,对目标文件添加有效标识;When receiving the sixth instruction that the user determines that the selected target file is a valid file, add a valid mark to the target file;
当接收到用户确定选中的目标文件是无效文件的第七指令时,对目标文件添加无效标识;When receiving the seventh instruction that the user determines that the selected target file is an invalid file, add an invalid mark to the target file;
根据目标文件的标识种类,对字幕文件列表内的字幕文件进行排序,或对歌词文件列表内的歌词文件进行排序。According to the identification type of the target file, the subtitle files in the subtitle file list are sorted, or the lyrics files in the lyrics file list are sorted.
在一些实施例中,接收模块具体用于:In some embodiments, the receiving module is specifically used for:
接收字幕歌词服务器返回的根据标识种类进行排序的字幕文件列表或歌词文件列表。Receive the subtitle file list or the lyric file list sorted according to the identification type returned by the subtitle lyrics server.
在一些实施例中,基于智能座舱的多设备播放装置300还用于:In some embodiments, the multi-device playback device 300 based on the smart cockpit is also used for:
向第二设备发送用于连接蓝牙设备的第八指令;sending an eighth instruction for connecting to the Bluetooth device to the second device;
根据第八指令控制第二设备与蓝牙设备进行连接,以根据蓝牙设备播放多媒体资源。The second device is controlled to connect with the bluetooth device according to the eighth instruction, so as to play multimedia resources according to the bluetooth device.
在一些实施例中,基于智能座舱的多设备播放装置300还用于:In some embodiments, the multi-device playback device 300 based on the smart cockpit is also used for:
向第二设备发送用于管理应用的第九指令;sending a ninth instruction for managing applications to the second device;
根据第九指令对第二设备上的应用进行管理。Manage applications on the second device according to the ninth instruction.
在一些实施例中,在发送模块302中的控制第一设备向配对连接完成后的第二设备发送多媒体资源之前,包括加密模块,加密模块具体用于:In some embodiments, before controlling the first device in the sending module 302 to send the multimedia resource to the second device after the pairing connection is completed, an encryption module is included, and the encryption module is specifically used for:
根据高级加密标准对多媒体资源进行加密,得到加密后的多媒体资源。The multimedia resource is encrypted according to the Advanced Encryption Standard to obtain the encrypted multimedia resource.
在一些实施例中,针对发送模块302中的控制第一设备向配对连接完成后的第二设备发送多媒体资源,具体用于:In some embodiments, for the control in the sending module 302, the first device sends multimedia resources to the second device after the pairing connection is completed, specifically for:
根据实时流传输协议控制第一设备向配对连接完成后的第二设备发送加密后的多媒体资源。According to the real-time streaming protocol, the first device is controlled to send the encrypted multimedia resource to the second device after the pairing connection is completed.
本申请实施例提供的基于智能座舱的多设备播放装置,与上述实施例提供的基于智能座舱的多设备播放方法具有相同的技术特征,所以也能解决相同的技术问题,达到相同的技术效果。The smart cockpit-based multi-device playback device provided in the embodiment of the present application has the same technical features as the smart cockpit-based multi-device playback method provided in the above embodiments, so it can also solve the same technical problems and achieve the same technical effect.
图4提供了一种基于智能座舱的多设备播放装置的结构示意图。该装置可以应用于电子终端,通过终端之外的其他终端提供第二图形用户界面,第二图形用户界面中包含第一设备对应的第一选项,以及第二设备对应的第二选项。如图4所示,基于智能座舱的多设备播放装置400包括:Fig. 4 provides a schematic structural diagram of a multi-device playback device based on an intelligent cockpit. The apparatus can be applied to an electronic terminal, and a second graphical user interface is provided through a terminal other than the terminal, and the second graphical user interface includes a first option corresponding to the first device and a second option corresponding to the second device. As shown in Figure 4, the multi-device playback device 400 based on the smart cockpit includes:
第二连接模块401,用于响应于针对第一选项和第二选项的选择操作,分别与第一设备以及第二设备进行配对连接;The second connection module 401 is configured to perform pairing connection with the first device and the second device respectively in response to selection operations on the first option and the second option;
获取模块402,用于获取配对连接完成后的第二设备针对多媒体资源的播放信息;An acquisition module 402, configured to acquire the playback information of the multimedia resource of the second device after the pairing connection is completed;
更改模块403,用于控制第二设备对播放信息进行更改。A modification module 403, configured to control the second device to modify the playback information.
本申请实施例提供的基于智能座舱的多设备播放装置,与上述实施例提供的基于智能座舱的多设备播放方法以及装置具有相同的技术特征,所以也能解决相同的技术问题,达到相同的技术效果。The smart cockpit-based multi-device playback device provided in the embodiment of the present application has the same technical features as the smart cockpit-based multi-device playback method and device provided in the above embodiments, so it can also solve the same technical problems and achieve the same technology Effect.
本申请实施例提供的一种电子终端,如图5所示,电子设备500包括存储器501、处理器502,所述存储器中存储有可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述实施例提供的方法的步骤。An electronic terminal provided by an embodiment of the present application, as shown in FIG. 5 , an electronic device 500 includes a memory 501 and a processor 502, the memory stores a computer program that can run on the processor, and the processor When the computer program is executed, the steps of the methods provided by the foregoing embodiments are realized.
参见图5,电子设备还包括:总线503和通信接口504,处理器502、通信接口504和存储器501通过总线503连接;处理器502用于执行存储器501中存储的可执行模块,例如计算机程序。5, the electronic device also includes: a bus 503 and a communication interface 504, the processor 502, the communication interface 504 and the memory 501 are connected through the bus 503; the processor 502 is used to execute executable modules stored in the memory 501, such as computer programs.
其中,存储器501可能包含高速随机存取存储器(Random Access Memory,简称RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。通过至少一个通信接口504(可以是有线或者无线)实现该系统网元与至少一个其他网元之间的通信连接,可以使用互联网,广域网,本地网,城域网等。Wherein, the memory 501 may include a high-speed random access memory (Random Access Memory, RAM for short), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 504 (which may be wired or wireless), and the Internet, wide area network, local network, metropolitan area network, etc. can be used.
总线503可以是ISA总线、PCI总线或EISA总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。The bus 503 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into address bus, data bus, control bus and so on. For ease of representation, only one double-headed arrow is used in FIG. 5 , but it does not mean that there is only one bus or one type of bus.
其中,存储器501用于存储程序,所述处理器502在接收到执行指令后,执行所述程序,前述本申请任一实施例揭示的过程定义的装置所执行的方法可以应用于处理器502中,或者由处理器502实现。Wherein, the memory 501 is used to store a program, and the processor 502 executes the program after receiving an execution instruction, and the method performed by the process-defined device disclosed in any embodiment of the foregoing application can be applied to the processor 502 , or implemented by the processor 502.
处理器502可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器502中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器502可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(DigitalSignal Processing,简称DSP)、专用集成电路(Application Specific IntegratedCircuit,简称ASIC)、现成可编程门阵列(Field-Programmable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器501,处理器502读取存储器501中的信息,结合其硬件完成上述方法的步骤。The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 502 or an instruction in the form of software. The above-mentioned processor 502 can be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a network processor (Network Processor, referred to as NP), etc.; it can also be a digital signal processor (Digital Signal Processing, referred to as DSP) , Application Specific Integrated Circuit (ASIC for short), off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the memory 501, and the processor 502 reads the information in the memory 501, and completes the steps of the above method in combination with its hardware.
对应于上述基于智能座舱的多设备播放方法,本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可运行指令,所述计算机可运行指令在被处理器调用和运行时,所述计算机可运行指令促使所述处理器运行上述基于智能座舱的多设备播放方法的步骤。Corresponding to the above-mentioned smart cockpit-based multi-device playback method, the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are processed When the controller is invoked and executed, the computer-executable instructions prompt the processor to execute the steps of the above-mentioned intelligent cockpit-based multi-device playback method.
本申请实施例所提供的基于智能座舱的多设备播放装置可以为设备上的特定硬件或者安装于设备上的软件或固件等。本申请实施例所提供的装置,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,前述描述的系统、装置和单元的具体工作过程,均可以参考上述方法实施例中的对应过程,在此不再赘述。The multi-device playback device based on the smart cockpit provided in the embodiment of the present application may be specific hardware on the device or software or firmware installed on the device. The implementation principles and technical effects of the device provided by the embodiment of the present application are the same as those of the aforementioned method embodiment. For brief description, for the parts not mentioned in the device embodiment, reference may be made to the corresponding content in the aforementioned method embodiment. Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the above-mentioned method embodiments, and will not be repeated here.
在本申请所提供的实施例中,应该理解到,所揭露装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some communication interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
再例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。For another example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functions and operations of possible implementations of devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or part of code that includes one or more Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or action , or may be implemented by a combination of dedicated hardware and computer instructions.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请提供的实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in the embodiments provided by the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述基于智能座舱的多设备播放方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-OnlyMemory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the smart cockpit-based multi-device playback method described in various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), magnetic disk or optical disk, etc., which can store program codes. medium.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释,此外,术语“第一”、“第二”、“第三”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that like numerals and letters denote similar items in the following drawings, therefore, once an item is defined in one drawing, it does not require further definition and explanation in subsequent drawings, In addition, the terms "first", "second", "third", etc. are only used for distinguishing descriptions, and should not be construed as indicating or implying relative importance.
最后应说明的是:以上所述实施例,仅为本申请的具体实施方式,用以说明本申请的技术方案,而非对其限制,本申请的保护范围并不局限于此,尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应技术方案的本质脱离本申请实施例技术方案的范围。都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。Finally, it should be noted that: the above-described embodiments are only specific implementations of the application, used to illustrate the technical solutions of the application, rather than limiting it, and the scope of protection of the application is not limited thereto, although referring to the aforementioned The embodiment has described this application in detail, and those of ordinary skill in the art should understand that any person familiar with this technical field can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in this application Changes may be easily conceived, or equivalent replacements may be made to some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application. All should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.