CN113395549B - Play resource downloading method, device, equipment and storage medium - Google Patents
Play resource downloading method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113395549B CN113395549B CN202110710762.0A CN202110710762A CN113395549B CN 113395549 B CN113395549 B CN 113395549B CN 202110710762 A CN202110710762 A CN 202110710762A CN 113395549 B CN113395549 B CN 113395549B
- Authority
- CN
- China
- Prior art keywords
- playback
- resource
- time
- download
- resources
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/238—Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2187—Live feed
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/438—Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/475—End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data
- H04N21/4758—End-user interface for inputting end-user data, e.g. personal identification number [PIN], preference data for providing answers, e.g. voting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4781—Games
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Information Transfer Between Computers (AREA)
- Indexing, Searching, Synchronizing, And The Amount Of Synchronization Travel Of Record Carriers (AREA)
Abstract
本公开公开了一种播放资源下载方法、装置、设备、存储介质及程序产品,涉及数据处理技术领域,尤其涉及视频播放技术领域。具体实现方案为:获得各播放资源的资源量以及加载时刻;根据各播放资源的资源量和网络速度,预测各播放资源的下载时长;根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻;在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。应用本公开实施例提供的方案下载播放资源,能够提高视频播放的时效性。
The present disclosure discloses a playback resource downloading method, device, device, storage medium and program product, and relates to the technical field of data processing, in particular to the technical field of video playback. The specific implementation scheme is: obtaining the resource amount and loading time of each playback resource; predicting the download time of each playback resource according to the resource amount and network speed of each playback resource; according to the download time of each playback resource, at the loading time of each playback resource Before, the starting download time of each playback resource is determined; during the video playback process, after reaching the start download time of each playback resource, each playback resource is downloaded. Using the solution provided by the embodiments of the present disclosure to download playback resources can improve the timeliness of video playback.
Description
技术领域technical field
本公开涉及数据处理技术领域,尤其涉及视频播放技术领域。The present disclosure relates to the technical field of data processing, and in particular, to the technical field of video playback.
背景技术Background technique
视频播放过程中,为增强互动性,可以引导用户参与游戏、答题等,为增强播放趣味性,可以更换背景图片、背景音乐等。为此,视频播放过程中需要下载游戏、题目、背景图片、背景音乐等播放资源。During video playback, in order to enhance interactivity, users can be guided to participate in games, answer questions, etc. In order to enhance the fun of playing, background pictures, background music, etc. can be replaced. To this end, during the video playback process, you need to download playback resources such as games, titles, background pictures, and background music.
现有技术中,进行视频播放时,一般是在开始视频播放之前,下载整个视频播放过程中需要的所有播放资源。In the prior art, when playing a video, generally, before starting the video playing, all the playing resources required in the entire video playing process are downloaded.
发明内容SUMMARY OF THE INVENTION
本公开提供了一种用于播放资源下载的方法、装置、设备、存储介质及程序产品。The present disclosure provides a method, apparatus, device, storage medium and program product for playing resource download.
根据本公开的一方面,提供了一种播放资源下载方法,所述方法包括:According to an aspect of the present disclosure, a method for downloading playback resources is provided, and the method includes:
获得各播放资源的资源量以及加载时刻;Obtain the resource amount and loading time of each playback resource;
根据各播放资源的资源量和网络速度,预测各播放资源的下载时长;According to the resource amount and network speed of each playback resource, predict the download time of each playback resource;
根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻;According to the download duration of each playback resource, before the loading time of each playback resource, determine the start download time of each playback resource;
在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。In the process of video playback, each playback resource is downloaded after the starting download time of each playback resource is reached.
根据本公开的另一方面,提供了一种播放资源下载装置,所述装置包括:According to another aspect of the present disclosure, there is provided an apparatus for downloading playback resources, the apparatus comprising:
信息获得模块,用于获得各播放资源的资源量以及加载时刻;The information obtaining module is used to obtain the resource amount and loading time of each playback resource;
时长预测模块,用于根据各播放资源的资源量和网络速度,预测各播放资源的下载时长;The duration prediction module is used to predict the download duration of each playback resource according to the resource amount and network speed of each playback resource;
时刻确定模块,用于根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻;a time determining module, configured to determine the starting download time of each play resource before the loading time of each play resource according to the download duration of each play resource;
资源下载模块,用于在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。The resource download module is used for downloading each playback resource after reaching the initial download time of each playback resource during the video playback process.
根据本公开的另一方面,提供了一种电子设备,包括:According to another aspect of the present disclosure, there is provided an electronic device, comprising:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行播放资源下载方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method for downloading playback resources.
根据本公开的另一方面,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行根据上述播放资源下载方法。According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method for downloading playback resources according to the above.
根据本公开的另一方面,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述播放资源下载方法。According to another aspect of the present disclosure, a computer program product is provided, including a computer program, the computer program implementing the above method for downloading playback resources when executed by a processor.
由以上可见,应用本公开的实施例提供的方案下载播放资源,是在视频播放过程中下载各播放资源,也就是,一边进行视频播放、一边下载播放资源,相较于现有技术,不需要在视频播放开始之前等待所有的播放资源下载完毕,然后才开始视频播放,提高了视频播放的时效性。It can be seen from the above that applying the solution provided by the embodiments of the present disclosure to download playback resources is to download each playback resource during the video playback process, that is, while performing video playback, while downloading playback resources, compared with the prior art, it does not require Waiting for all the playback resources to be downloaded before starting the video playback, and then starting the video playback, improves the timeliness of the video playback.
另外,本公开的实施例提供的方案中,下载各播放资源,具体是在视频播放过程中,到达各播放资源的起始下载时刻后启动的。其中,上述起始下载时刻位于播放资源的加载时刻之前、且根据播放资源的下载时长确定。上述下载时长表示在当前网络速度下、下载播放资源所需的时长,这样从起始下载时刻开始下载播放资源,能够有效保证在到达加载时刻时将播放资源下载到本地,从而在加载时刻时能够直接加载已下载到本地的播放资源,减少视频播放过程中等待播放资源下载的情况,进一步提高了视频播放的时效性。In addition, in the solution provided by the embodiments of the present disclosure, the downloading of each playback resource is specifically started after reaching the initial download time of each playback resource during the video playback process. Wherein, the above-mentioned starting download time is located before the loading time of the playback resource, and is determined according to the download duration of the playback resource. The above download duration indicates the duration required to download the playback resources at the current network speed. In this way, the playback resources are downloaded from the initial download time, which can effectively ensure that the playback resources are downloaded to the local when the loading time is reached, so that the playback resources can be downloaded at the loading time. Directly load the playback resources that have been downloaded to the local, reduce the situation of waiting for the playback resources to be downloaded during the video playback process, and further improve the timeliness of video playback.
应当理解,本部分所描述的内容并非旨在标识本公开的实施例的关键或重要特征,也不用于限制本公开的范围。本公开的其它特征将通过以下的说明书而变得容易理解。It should be understood that what is described in this section is not intended to identify key or critical features of embodiments of the disclosure, nor is it intended to limit the scope of the disclosure. Other features of the present disclosure will become readily understood from the following description.
附图说明Description of drawings
附图用于更好地理解本方案,不构成对本公开的限定。其中:The accompanying drawings are used for better understanding of the present solution, and do not constitute a limitation to the present disclosure. in:
图1为本公开的实施例提供的一种播放资源下载方法的流程示意图;1 is a schematic flowchart of a method for downloading playback resources according to an embodiment of the present disclosure;
图2a为本公开的实施例提供的一种下载时长的示意图;2a is a schematic diagram of a download duration provided by an embodiment of the present disclosure;
图2b为本公开的实施例提供的一种时序示意图;FIG. 2b is a schematic diagram of a timing sequence provided by an embodiment of the present disclosure;
图2c为本公开的实施例提供的另一种时序示意图;FIG. 2c is another schematic timing diagram provided by an embodiment of the present disclosure;
图3为本公开的实施例提供的另一种播放资源下载方法的流程示意图;3 is a schematic flowchart of another method for downloading playback resources provided by an embodiment of the present disclosure;
图4为本公开的实施例提供的一种播放资源下载装置的结构示意图;4 is a schematic structural diagram of a playback resource downloading apparatus provided by an embodiment of the present disclosure;
图5为本公开的实施例提供的一种电子设备的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下结合附图对本公开的示范性实施例做出说明,其中包括本公开实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本公开的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding and should be considered as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted from the following description for clarity and conciseness.
由于现有技术中在开始视频播放之前下载所有播放资源,导致视频播放的时效性较差,为解决这一技术问题,本公开实施例提供了一种播放资源下载方法、装置、设备、存储介质及程序产品。Since all playback resources are downloaded before starting video playback in the prior art, the timeliness of video playback is poor. To solve this technical problem, embodiments of the present disclosure provide a playback resource downloading method, device, device, and storage medium and program products.
本公开的一个实施例中,提供了一种播放资源下载方法,该方法包括:In an embodiment of the present disclosure, a method for downloading playback resources is provided, and the method includes:
获得各播放资源的资源量以及加载时刻;Obtain the resource amount and loading time of each playback resource;
根据各播放资源的资源量和网络速度,预测各播放资源的下载时长;According to the resource amount and network speed of each playback resource, predict the download time of each playback resource;
根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻;According to the download duration of each playback resource, before the loading time of each playback resource, determine the start download time of each playback resource;
在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。In the process of video playback, each playback resource is downloaded after the starting download time of each playback resource is reached.
由以上可见,应用本公开的实施例提供的方案下载播放资源,是在视频播放过程中下载各播放资源,也就是,一边进行视频播放、一边下载播放资源,相较于现有技术,不需要在视频播放开始之前等待所有的播放资源下载完毕,然后才开始视频播放,提高了视频播放的时效性。It can be seen from the above that applying the solution provided by the embodiments of the present disclosure to download playback resources is to download each playback resource during the video playback process, that is, while performing video playback, while downloading playback resources, compared with the prior art, it does not require Waiting for all the playback resources to be downloaded before starting the video playback, and then starting the video playback, improves the timeliness of the video playback.
另外,本公开的实施例提供的方案中,下载各播放资源,具体是在视频播放过程中,到达各播放资源的起始下载时刻后启动的。其中,上述起始下载时刻位于播放资源的加载时刻之前、且根据播放资源的下载时长确定。上述下载时长表示在当前网络速度下、下载播放资源所需的时长,这样从起始下载时刻开始下载播放资源,能够有效保证在到达加载时刻时将播放资源下载到本地,从而在加载时刻时能够直接加载已下载到本地的播放资源,减少视频播放过程中等待播放资源下载的情况,进一步提高了视频播放的时效性。In addition, in the solution provided by the embodiments of the present disclosure, the downloading of each playback resource is specifically started after reaching the initial download time of each playback resource during the video playback process. Wherein, the above-mentioned starting download time is located before the loading time of the playback resource, and is determined according to the download duration of the playback resource. The above download duration indicates the duration required to download the playback resources at the current network speed. In this way, the playback resources are downloaded from the initial download time, which can effectively ensure that the playback resources are downloaded to the local when the loading time is reached, so that the playback resources can be downloaded at the loading time. Directly load the playback resources that have been downloaded to the local, reduce the situation of waiting for the playback resources to be downloaded during the video playback process, and further improve the timeliness of video playback.
下面先对本公开实施例中涉及的几个概念进行介绍。The following first introduces several concepts involved in the embodiments of the present disclosure.
本公开实施例中提及的“视频播放过程”可以是:播放过程中需要与用户进行交互的播放视频的过程,也可以是播放过程中需要更新辅助信息的播放视频的过程。其中,上述辅助信息是指:辅助完成视频播放的信息,例如,视频的标题、背景图片、背景音乐等。The "video playback process" mentioned in the embodiments of the present disclosure may be a process of playing a video that requires interaction with a user during the playback process, or a process of playing a video that requires updating auxiliary information during the playback process. The above auxiliary information refers to information that assists in completing the video playback, for example, the video title, background picture, background music, and the like.
鉴于上述情况,在视频播放过程中需要加载与用户进行交互的资源、视频的标题、背景图片、背景音乐等资源。本公开实施例中将上述资源称为播放资源。In view of the above situation, resources such as resources for interacting with the user, video titles, background pictures, background music and other resources need to be loaded during the video playback process. In the embodiments of the present disclosure, the above-mentioned resources are referred to as playback resources.
本公开的一个实施例中,上述视频播放过程可以分为播放直播视频的过程和播放录播视频的过程。这样可以认为视频播放的模式包括:直播模式和录播模式。In an embodiment of the present disclosure, the above-mentioned video playing process can be divided into a process of playing a live video and a process of playing a recorded video. In this way, it can be considered that the modes of video playback include: live mode and recording mode.
下面再对本公开实施例所提供方案的应用场景进行说明。The application scenarios of the solutions provided by the embodiments of the present disclosure will be described below.
本公开实施例提供的方案应用于视频播放场景,例如,课程视频播放场景、购物视频播放场景等。The solutions provided by the embodiments of the present disclosure are applied to video playback scenarios, for example, course video playback scenarios, shopping video playback scenarios, and the like.
在视频播放场景中,客户端从服务器获得与视频播放相关的数据,并依据所获得的数据向用户显示播放视频。在视频播放过程中,客户端需要加载各种不同的播放资源。In the video playback scenario, the client obtains data related to video playback from the server, and displays the playback video to the user according to the obtained data. During video playback, the client needs to load various playback resources.
从前面可以得知,视频播放可以存在不同的模式,视频播放的模式可以是录播模式,也可以是直播模式。在录播模式下,视频播放过程中所播放的视频是预先录制的视频,也称为录制视频。在直播式模式下,视频播放过程中所播放的视频是实时录制的视频,也称为直播视频。As can be seen from the foregoing, there may be different modes of video playback, and the mode of video playback may be a recording mode or a live mode. In the recording mode, the video played during the video playback is a pre-recorded video, also called a recorded video. In the live mode, the video played during the video playback is real-time recorded video, also known as live video.
视频播放过程中,除了播放视频之外,还可以向用户展示或者播放各种不同的资源,这些资源为播放资源。播放资源包括互动资源和非互动资源。其中,互动资源是引导用户参与播放互动的资源,互动资源能够增强播放互动性,提高用户参与播放互动的频率。例如,互动资源可以包括:互动游戏资源、互动问答资源、互动虚拟动漫人物资源等。与互动资源相对应,非互动资源不能引导用户参与播放互动,但是非互动资源可以用于增强播放趣味性、吸引用户观看播放。例如,非互动资源可以包括:背景图片、背景音乐、视频标题等资源。During the video playback, in addition to playing the video, various resources can be displayed or played to the user, and these resources are playback resources. Playback assets include interactive and non-interactive assets. Among them, the interactive resource is a resource that guides users to participate in the play interaction, and the interactive resource can enhance the play interactivity and increase the frequency of the user's participation in the play interaction. For example, the interactive resources may include: interactive game resources, interactive question-and-answer resources, interactive virtual animation character resources, and the like. Corresponding to interactive resources, non-interactive resources cannot guide users to participate in playback interaction, but non-interactive resources can be used to enhance playback fun and attract users to watch playback. For example, non-interactive resources may include: background images, background music, video titles, and other resources.
以下针对具体应用场景进行说明。The following describes specific application scenarios.
一、课程视频播放场景1. Course video playback scene
假设,播放资源包括:互动游戏资源、背景图片和背景音乐。Suppose, the playback resources include: interactive game resources, background pictures and background music.
情况一:视频播放的模式为:录播模式。Case 1: The video playback mode is: recording mode.
由于这种情况下播放的视频是预先录制的课程视频,播放过程中各时刻所播放的课程内容是确定的,课程内容又决定各播放资源的加载时刻,所以,各播放资源的加载时刻是预先确定的,该预先确定的加载时刻是播放资源的实际加载时刻。Since the video played in this case is a pre-recorded course video, the course content played at each moment during the playback process is determined, and the course content determines the loading time of each playback resource. Therefore, the loading time of each playback resource is pre-recorded. It is determined that the predetermined loading time is the actual loading time of the playback resource.
视频播放过程中,到达各个播放资源的加载时刻后,开始加载播放资源。因此,在录播模式下,播放资源加载的触发条件是:视频播放过程中到达预先设定的播放资源的加载时刻。During the video playback process, when the loading time of each playback resource is reached, the playback resource starts to be loaded. Therefore, in the recording and playback mode, the triggering condition for the loading of the playback resources is: the preset loading time of the playback resources is reached during the video playback process.
例如,互动游戏资源的加载时刻为T1、背景图片的加载时刻为T2、背景音乐的加载时刻为T3。在播放课程视频过程中,播放时间到达时刻 T1后,加载并显示互动游戏资源;播放时间到达时刻T2后,加载并显示背景图片;播放时间到达时刻T3后,加载并播放背景音乐。For example, the loading time of the interactive game resource is T1, the loading time of the background image is T2, and the loading time of the background music is T3. During the course video playback, when the playback time reaches time T1, the interactive game resources are loaded and displayed; when the playback time reaches time T2, the background image is loaded and displayed; when the playback time reaches time T3, the background music is loaded and played.
情况二:视频播放的模式为:直播模式。Case 2: The video playback mode is: live broadcast mode.
这种情况下,播放的视频是实时录制的课程视频,虽然播放过程中老师会按照事先准备的教案教授课程内容,但是受老师的表述方式具有随机性等因素影响,需要加载的播放资源并不能在预先设定的时刻播放,可能提前也可能错后,即使如此,也需要为每一播放资源预先设置一个可能的加载时刻,以为播放资源下载提供时间参考。该加载时刻并非实际要进行播放资源加载的时刻,该加载时刻可作为下载参考时刻,用于确定播放资源的起始下载时刻。In this case, the video played is a real-time recorded course video. Although the teacher will teach the course content according to the pre-prepared lesson plan during the playback process, but due to factors such as the randomness of the teacher's expression, the playback resources that need to be loaded cannot be Playing at a preset time may be in advance or wrong. Even so, it is necessary to preset a possible loading time for each playback resource to provide a time reference for downloading the playback resource. The loading time is not the time when the playback resource is actually loaded, and the loading time can be used as a download reference time for determining the starting download time of the playback resource.
鉴于上述情况,直播模式下,可以由老师控制播放资源的实际加载时刻,服务器获得老师的播放资源加载指令后,向客户端转发老师的播放资源加载指令,进而客户端启动播放资源加载。因此,在直播模式下,播放资源加载的触发条件是:获得了播放资源加载指令。In view of the above situation, in the live mode, the actual loading time of the playback resource can be controlled by the teacher. After the server obtains the playback resource loading instruction from the teacher, it forwards the playback resource loading instruction from the teacher to the client, and then the client starts the playback resource loading. Therefore, in the live broadcast mode, the triggering condition for the loading of the playback resources is: the instruction to load the playback resources is obtained.
例如,预先为互动游戏资源、背景图片、背景音乐分别配置了加载时刻T4、T5和T6,这里,T4、T5和T6用于确定互动游戏资源、背景图片、背景音乐的起始下载时刻。在视频播放过程中,若没有接收到老师针对互动游戏资源、背景图片、背景音乐的播放资源加载指令,即便播放时间达到了T4、T5和T6也不会启动播放资源加载,而是在接收到老师针对播放资源的加载指令后才开始加载。For example, loading times T4, T5 and T6 are respectively configured for interactive game resources, background pictures and background music. Here, T4, T5 and T6 are used to determine the starting download times of interactive game resources, background pictures and background music. During the video playback process, if the teacher does not receive the playback resource loading instruction for interactive game resources, background pictures, and background music, even if the playback time reaches T4, T5, and T6, the playback resource loading will not be started. Loading starts after the teacher gives the loading instruction for the playback resource.
二、购物视频播放场景2. Shopping video playback scene
购物视频播放场景中视频播放模式一般为直播模式,假设,播放资源包括:互动游戏资源、商品图片、背景音乐。The video playback mode in the shopping video playback scenario is generally a live broadcast mode. It is assumed that the playback resources include: interactive game resources, product pictures, and background music.
这种情况下,播放的视频是实时录制的购物视频,虽然播放过程中导购会按照事先准备的商品介绍流程介绍各个商品,但是由于导购在介绍产品过程中还有可能会回答顾客的问题等,需要加载的播放资源并不能在预先设定的时刻播放,可能提前也可能错后,即使如此,也需要为每一播放资源预先设置一个可能的加载时刻,以为播放资源下载提供时间参考。该加载时刻并非实际要进行播放资源加载的时刻,该加载时刻可作为下载参考时刻,用于确定播放资源的起始下载时刻。In this case, the video played is a real-time recorded shopping video. Although the shopping guide will introduce each product according to the product introduction process prepared in advance, the shopping guide may also answer the customer's questions in the process of introducing the product. The playback resource that needs to be loaded cannot be played at the preset time, and may be played in advance or wrong. Even so, it is necessary to preset a possible loading time for each playback resource to provide a time reference for the download of the playback resource. The loading time is not the time when the playback resource is actually loaded, and the loading time can be used as a download reference time for determining the starting download time of the playback resource.
鉴于上述情况,直播模式下,可以由导购控制播放资源的实际加载时刻,播放服务器获得导购的播放资源加载指令后,向客户端转发导购的播放资源加载指令,进而客户端启动播放资源加载。由该场景也可以看出,直播模式下,播放资源加载的触发条件是:获得了播放资源加载指令。In view of the above situation, in the live mode, the shopping guide can control the actual loading time of the playback resources. After the playback server obtains the shopping guide's playback resource loading instruction, it forwards the shopping guide's playback resource loading instruction to the client, and then the client starts the playback resource loading. It can also be seen from this scene that in the live broadcast mode, the triggering condition for the loading of the playback resources is: the instruction to load the playback resources is obtained.
例如,预先为互动游戏资源、商品图片、背景音乐分别配置了加载时刻T7、T8和T9,这里,T7、T8和T9用于确定互动游戏资源、商品图片、背景音乐的起始下载时刻。在视频播放过程中,若没有接收到导购针对互动游戏资源、商品图片、背景音乐的播放资源加载指令,即便播放时间达到了T7、T8和T9也不会启动播放资源加载,而是在接收到导购针对播放资源的加载指令后才开始加载。For example, the loading times T7, T8 and T9 are respectively configured for interactive game resources, product pictures and background music. Here, T7, T8 and T9 are used to determine the starting download time of interactive game resources, product pictures and background music. During the video playback process, if the shopping guide does not receive the playback resource loading instruction for interactive game resources, product pictures, and background music, even if the playback time reaches T7, T8, and T9, the playback resource loading will not be started, but will not start the playback resource loading. The shopping guide starts loading after the loading instruction for the playback resource.
下面再对本公开实施例的执行主体进行说明。The execution body of the embodiment of the present disclosure will be described below.
本公开实施例的执行主体为客户端。客户端可以运行于智能手机、平板电脑、计算机、车载智能设备等能够联网的电子设备。The execution subject of the embodiment of the present disclosure is the client. The client can run on electronic devices that can be connected to the Internet, such as smart phones, tablet computers, computers, and in-vehicle smart devices.
以下对本公开的实施例提供的播放资源下载方法进行详细说明。The method for downloading playback resources provided by the embodiments of the present disclosure will be described in detail below.
参见图1,图1为本公开的实施例提供的一种播放资源下载方法的流程示意图,上述方法包括以下步骤S101-S104。Referring to FIG. 1, FIG. 1 is a schematic flowchart of a method for downloading playback resources according to an embodiment of the present disclosure. The above method includes the following steps S101-S104.
步骤S101:获得各播放资源的资源量以及加载时刻。Step S101: Obtain the resource amount and loading time of each playback resource.
播放资源的加载时刻表示:在视频播放过程中,针对播放资源的实际加载时刻或者可能加载时刻。The loading time of the playback resource indicates: during the video playback process, the actual loading time or the possible loading time of the playback resource.
视频播放过程中,客户端需要将播放资源下载到本地,在到达加载时刻后,客户端加载已下载到本地的播放资源,从而实现播放资源的显示或者播放。During the video playback process, the client needs to download the playback resources to the local, and after the loading time arrives, the client loads the playback resources that have been downloaded to the local, so as to realize the display or playback of the playback resources.
播放服务器中存储有与所播放视频相关的数据,所以,视频播放过程中,客户端与播放服务器进行数据交互,获得与所播放视频相关的数据。基于此,视频播放服务器可以存储有所播放视频的配置信息,其中,上述配置信息中包括:视频播放过程中需要加载的各个播放资源的资源量以及加载时刻。The playback server stores data related to the played video, so during the video playback process, the client interacts with the playback server to obtain data related to the played video. Based on this, the video playback server can store the configuration information of the played video, wherein the configuration information includes: the resource amount and loading time of each playback resource that needs to be loaded during the video playback process.
鉴于上述情况,一种实现方式中,客户端可以在视频播放开始之前,从播放服务器内存储的配置信息中,获得所有播放资源的资源量以及加载时刻。In view of the above situation, in an implementation manner, the client may obtain the resource amount and loading time of all playback resources from the configuration information stored in the playback server before video playback starts.
具体的,客户端可以拉取播放服务器中存储的配置信息,对配置信息进行解析,获得各播放资源的资源量以及加载时刻。Specifically, the client can pull the configuration information stored in the playback server, parse the configuration information, and obtain the resource amount and loading time of each playback resource.
步骤S102:根据各播放资源的资源量和网络速度,预测各播放资源的下载时长。Step S102: Predict the download duration of each playback resource according to the resource amount and network speed of each playback resource.
网络速度为:上述客户端所使用网络的网速。网速一般是指联网时单位时间内上传和下载数据的量。The network speed is: the network speed of the network used by the above client. Internet speed generally refers to the amount of data uploaded and downloaded per unit of time when connected to the Internet.
具体的,可以将上述网络当前时刻的网速直接确定为网络速度。Specifically, the network speed of the above-mentioned network at the current moment may be directly determined as the network speed.
还可以确定当前时刻开始向前预设时长的时间段,将上述时间段内网速的统计值作为上述网络速度。上述统计值可以是上述时间段内网速平均值、网速最大值、网速最小值、网速最大值与网速最小值的平均值等等。It is also possible to determine a time period that starts from the current moment and go forward by a preset time period, and use the statistical value of the network speed in the above-mentioned time period as the above-mentioned network speed. The above-mentioned statistical value may be the average value of the network speed, the maximum value of the network speed, the minimum value of the network speed, the average value of the maximum value of the network speed and the minimum value of the network speed in the above-mentioned time period, and so on.
各播放资源的下载时长可以是通过各播放资源的基准时长确定的时长,其中,基准时长等于播放资源的资源量和网络速度之间的比值。The download duration of each playback resource may be a duration determined by a reference duration of each playback resource, wherein the reference duration is equal to the ratio between the resource amount of the playback resource and the network speed.
一种实施方式中,针对每一播放资源,可以将该播放资源的基准时长直接确定为该播放资源的下载时长。In one embodiment, for each playback resource, the reference duration of the playback resource may be directly determined as the download duration of the playback resource.
例如:播放资源的资源量为60MB,网络速度为6MB/s,该播放资源的基准时长为:60/6=10s,将10s直接确定为该播放资源的下载时长。For example, the resource amount of the playback resource is 60MB, the network speed is 6MB/s, the reference duration of the playback resource is: 60/6=10s, and 10s is directly determined as the download duration of the playback resource.
另一种实施方式中,针对每一播放资源,还可以根据第一预设时长误差,调整该播放资源的基准时长,将调整后的基准时长确定为该播放资源的下载时长。In another embodiment, for each playback resource, the reference duration of the playback resource may be adjusted according to the first preset duration error, and the adjusted reference duration is determined as the download duration of the playback resource.
上述第一预设时长误差可以由工作人员根据经验设定,例如:第一预设时长误差可以为1s、2s、5s等。The above-mentioned first preset duration error may be set by staff according to experience, for example, the first preset duration error may be 1 s, 2 s, 5 s, or the like.
在调整基准时长时,可以计算基准时长与第一预设时长误差之间的差值,作为播放资源的下载时长;还可以计算基准时长与第一预设时长误差之间的和值,作为播放资源的下载时长;还可以从上述差值以及和值形成的时长范围中选择一时长,作为播放资源的下载时长。When adjusting the reference duration, the difference between the reference duration and the error of the first preset duration can be calculated as the download duration of the playback resource; the sum of the error between the reference duration and the first preset duration can also be calculated as the playback duration The download duration of the resource; a duration can also be selected from the duration range formed by the difference and the sum value as the download duration of the playback resource.
例如:基准时长为60s,第一预设时长误差为5s,计算得到基准时长与第一预设时长误差之间的差值为:60s-5s=55s,可以将55s作为播放资源的下载时长;计算得到基准时长与第一预设时长误差之间的和值为: 60s+5s=65s,可以将65s作为播放资源的下载时长;从差值与和值形成的时长范围[55s,65s]中随机选择一时长58s,作为播放资源的下载时长。For example: the reference duration is 60s, the error of the first preset duration is 5s, and the difference between the reference duration and the error of the first preset duration is calculated as: 60s-5s=55s, and 55s can be used as the download duration of the playback resource; Calculated and obtained the sum value between the reference duration and the first preset duration error: 60s+5s=65s, 65s can be used as the download duration of the playback resource; the duration range formed from the difference and the sum value is [55s, 65s] A duration of 58s is randomly selected as the download duration of the playback resource.
步骤S103:根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻。Step S103: According to the download duration of each play resource, before the loading time of each play resource, determine the start download time of each play resource.
播放资源的起始下载时刻是指:开始下载播放资源的时刻。播放资源的起始下载时刻位于播放资源的加载时刻之前。The starting download moment of the playback resource refers to the moment when the playback resource starts to be downloaded. The starting download moment of the playback resource is before the loading moment of the playback resource.
由于下载播放资源所需的时长受播放资源的资源量和网络速度影响,所以根据播放资源的资源量和网络速度进行下载时长预测,所得下载时长的准确度较高。在此基础上,依据上述下载时长,在各播放资源的加载时刻之前,确定得到起始下载时刻后,从起始下载时刻开始下载播放资源,能够有效保证在到达加载时刻时播放资源已下载到本地,从而减少在加载时刻仍在下载播放资源、阻塞视频播放的情况。Since the time required to download the playback resource is affected by the resource amount of the playback resource and the network speed, the download duration prediction is performed according to the resource amount and the network speed of the playback resource, and the obtained download duration is highly accurate. On this basis, according to the above download duration, after determining the starting download time before the loading time of each playback resource, start downloading the playback resources from the starting download time, which can effectively ensure that the playback resources have been downloaded when the loading time arrives. Local, thereby reducing the situation that the playback resources are still being downloaded and the video playback is blocked at the loading time.
本公开的一个实施例中,可以针对每一播放资源,将加载时刻之前、且与加载时刻间隔下载时长的时刻,确定为起始下载时刻。In an embodiment of the present disclosure, for each playback resource, a time before the loading time and separated from the loading time by the download duration may be determined as the starting download time.
例如:播放资源的加载时刻为01:00:00,下载时长为20s,01:00:00 之前、且与01:00:00间隔20s的时刻为:00:59:40,将00:59:40确定为起始下载时刻。For example: the loading time of the playback resource is 01:00:00, the download time is 20s, the time before 01:00:00 and 20s interval from 01:00:00 is: 00:59:40, and 00:59: 40 is determined as the starting download moment.
这样,由于起始下载时刻在加载时刻之前、且与加载时刻间隔下载时长,所以在加载时刻之前有较为充分的时间下载播放资源,从而有效保证在加载时刻之前将播放资源下载到本地,减少了视频播放过程中因等待播放资源下载而阻塞视频播放的情况。In this way, since the starting download time is before the loading time and the download duration is separated from the loading time, there is sufficient time to download the playback resources before the loading time, thereby effectively ensuring that the playback resources are downloaded to the local before the loading time, reducing the number of downloads. During the video playback process, the video playback is blocked due to waiting for the playback resources to be downloaded.
在确定起始下载时刻时,除了采用上述方式之外,本公开的一个实施例中,针对每一播放资源,还可以确定加载时刻之前、且与加载时刻间隔下载时长的目标时刻,对目标时刻进行调整,将调整后的目标时刻确定为起始下载时刻。When determining the starting download time, in addition to the above method, in an embodiment of the present disclosure, for each playback resource, a target time before the loading time and the download duration interval from the loading time can also be determined. Make adjustment, and determine the adjusted target time as the starting download time.
具体的,可以结合第二预设时长误差对目标时刻进行调整。例如:确定目标时刻之前、且与目标时刻间隔第二预设时长误差的时刻,作为调整后的时刻;或者确定目标时刻之后、且与目标时刻间隔第二预设时长误差的时刻,作为调整后的时刻。Specifically, the target time may be adjusted in combination with the second preset duration error. For example: determine the time before the target time and the second preset time interval from the target time as the adjusted time; or determine the time after the target time and the second preset time error from the target time, as the adjusted time moment.
步骤S104:在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。Step S104: During the video playing process, after reaching the starting download time of each playing resource, download each playing resource.
在视频播放过程中,可以开启多个线程,其中,一个线程用于执行视频播放任务,其他线程用于执行播放资源下载任务。在播放时间到达各播放资源的起始下载时刻后,触发其他线程开始下载播放资源,这样,通过多线程并行工作,实现一边播放视频、一边下载播放资源,从而实现在视频播放过程中,同步下载各播放资源。During the video playback process, multiple threads can be opened, wherein one thread is used to perform the video playback task, and the other threads are used to perform the playback resource download task. After the playback time reaches the starting download time of each playback resource, trigger other threads to start downloading the playback resources. In this way, through the parallel work of multiple threads, it is possible to play the video and download the playback resources at the same time, so as to realize the synchronous download during the video playback process. each playback resource.
具体的,其他线程可以执行多个播放资源的下载任务,也可以执行一个播放资源的下载任务。Specifically, other threads may perform downloading tasks of multiple playback resources, or may perform downloading tasks of one playback resource.
由于视频播放过程中是达到播放资源的起始下载时刻后,才开始下载各播放资源的,因此,播放资源下载的触发条件是:视频播放过程中到达了播放资源的起始下载时刻。Since each playback resource starts to be downloaded after the initial download time of the playback resource is reached during the video playback process, the trigger condition for downloading the playback resource is that the start download time of the playback resource is reached during the video playback process.
成功下载播放资源,并在满足播放资源加载的触发条件后,客户端加载播放资源,实现播放资源播放。The playback resource is downloaded successfully, and after the trigger condition for loading the playback resource is satisfied, the client loads the playback resource to realize the playback of the playback resource.
一种实现方式中,当播放资源是需要显示的信息时,如视频、图片、文字等,上述配置信息中还可以包括:播放资源的播放时长、播放区域等信息。基于此,客户端在加载播放资源时,可以依据上述配置信息,将播放资源加载至用户界面中的上述加载区域,并按照播放时长播放。In an implementation manner, when the playback resource is information that needs to be displayed, such as video, picture, text, etc., the above configuration information may further include: playback duration, playback area and other information of the playback resource. Based on this, when loading the playback resource, the client can load the playback resource into the aforementioned loading area in the user interface according to the above configuration information, and play it according to the playback duration.
由以上可见,应用本实施例提供的方案下载播放资源,是在视频播放过程中下载各播放资源,也就是,一边进行视频播放、一边下载播放资源,相较于现有技术,不需要在视频播放开始之前等待所有的播放资源下载完毕,然后才开始视频播放,提高了视频播放的时效性。It can be seen from the above that applying the solution provided by this embodiment to download playback resources is to download each playback resource during the video playback process, that is, while performing video playback, download playback resources at the same time. Before the playback starts, it waits for all the playback resources to be downloaded, and then starts the video playback, which improves the timeliness of the video playback.
另外,本实施例提供的方案中,下载各播放资源,具体是在视频播放过程中,到达各播放资源的起始下载时刻后启动的。其中,上述起始下载时刻位于播放资源的加载时刻之前、且根据播放资源的下载时长确定。上述下载时长表示在当前网络速度下、下载播放资源所需的时长,这样从起始下载时刻开始下载播放资源,能够有效保证在到达加载时刻时将播放资源下载到本地,从而在加载时刻时能够直接加载已下载到本地的播放资源,减少视频播放过程中等待播放资源下载的情况,进一步提高了视频播放的时效性。In addition, in the solution provided by this embodiment, the downloading of each playback resource is specifically started after reaching the initial download time of each playback resource during the video playback process. Wherein, the above-mentioned starting download time is located before the loading time of the playback resource, and is determined according to the download duration of the playback resource. The above download duration indicates the duration required to download the playback resources at the current network speed. In this way, the playback resources are downloaded from the initial download time, which can effectively ensure that the playback resources are downloaded to the local when the loading time is reached, so that the playback resources can be downloaded at the loading time. Directly load the playback resources that have been downloaded to the local, reduce the situation of waiting for the playback resources to be downloaded during the video playback process, and further improve the timeliness of video playback.
另外,由于是一边进行视频播放,一边下载播放资源,用户在视频播放中途结束观看视频播放的情况下,会停止播放资源下载,下载到本地的播放资源是播放视频的部分播放资源,相较于现有技术中将所有的播放资源提前下载到本地,节省了本地存储空间以及网络带宽。In addition, since the video playback is performed while the playback resources are downloaded, when the user finishes watching the video playback in the middle of the video playback, the playback resource download will be stopped. The playback resources downloaded to the local are part of the playback resources of the playback video. In the prior art, all playback resources are downloaded locally in advance, which saves local storage space and network bandwidth.
以下结合图2a、图2b对确定各播放资源的起始下载时刻的具体过程进行说明。The specific process of determining the starting download time of each playback resource will be described below with reference to FIG. 2a and FIG. 2b.
假设,视频播放过程中需要加载的播放资源包括:播放资源1、播放资源2、播放资源3和播放资源4,上述各播放资源的加载时刻分别为:播放资源1:00:00:40、播放资源2:00:01:10、播放资源3:00:01:50、播放资源4:00:02:40。Suppose, the playback resources that need to be loaded during the video playback process include: playback resource 1, playback resource 2, playback resource 3 and playback resource 4. The loading times of the above playback resources are: playback resource 1:00:00:40, playback resource 1:00:00:40, playback resource 1 Resource 2: 00:01:10, Play resource 3: 00:01:50, Play resource 4: 00:02:40.
经预测各播放资源的下载时长分别为:播放资源1:20s、播放资源2: 40s、播放资源3:30s、播放资源4:50s。以柱状图表示上述各个下载时长,如图2a所示。It is predicted that the download duration of each playback resource is: playback resource 1: 20s, playback resource 2: 40s, playback resource 3: 30s, playback resource 4: 50s. Each of the above download durations is represented by a bar chart, as shown in Figure 2a.
根据上述条件可知,播放资源1的起始下载时刻为:加载时刻00:00:40 之前的20s,即播放资源1的起始下载时刻为00:00:20;播放资源2的起始下载时刻为:加载时刻00:01:10之前的40s,即播放资源1的起始下载时刻为00:00:30;播放资源3的起始下载时刻为:加载时刻00:01:50之前的30s,即播放资源3的起始下载时刻为00:01:20;播放资源4的起始下载时刻为:加载时刻00:02:40之前的50s,即播放资源4的起始下载时刻为00:01:50。According to the above conditions, the starting download time of playback resource 1 is: 20s before the loading time 00:00:40, that is, the starting download time of playback resource 1 is 00:00:20; the starting download time of playback resource 2 is: 40s before the loading time 00:01:10, that is, the starting download time of playback resource 1 is 00:00:30; the starting download time of playback resource 3 is: 30s before the loading time 00:01:50, That is, the starting download time of playback resource 3 is 00:01:20; the starting download time of playback resource 4 is: 50s before the loading time 00:02:40, that is, the starting download time of playback resource 4 is 00:01 :50.
以时序图表示上述各个播放资源的起始下载时刻和加载时刻,如图2b 所示。图2b中各圆点所在位置表示各播放资源的加载时刻、各箭头所指向的位置表示各播放资源的起始下载时刻。The initial download time and loading time of each of the above-mentioned playback resources are represented by a sequence diagram, as shown in FIG. 2b. In FIG. 2b, the positions of the dots represent the loading time of each playback resource, and the positions pointed to by the arrows represent the initial download time of each playback resource.
在上述步骤S103确定各播放资源的起始下载时刻后,可以根据各播放资源的起始下载时刻和加载时刻,确定各播放资源的下载时间。具体的,对于一个播放资源而言,从起始下载时刻开始至加载时刻的时间段称为加载时间。After the initial download time of each play resource is determined in the above step S103, the download time of each play resource may be determined according to the initial download time and loading time of each play resource. Specifically, for a playback resource, the time period from the initial download moment to the loading moment is called the loading time.
各播放资源的下载时间之间可能会存在重叠时间段,这种情况下,用于下载播放资源的网络带宽,在重叠时间段内存在多播放资源共用的情况,从而出现单个播放资源下载缓慢的现象,严重时可能会导致到达加载时刻时,播放资源未完成下载。为了缓解上述现象,在步骤S103之后,还可以执行以下步骤A1-步骤A2。There may be overlapping time periods between the download times of each playback resource. In this case, the network bandwidth used for downloading playback resources is shared by multiple playback resources within the overlapping time period, resulting in slow download of a single playback resource. The phenomenon, in severe cases, may cause the playback resources to be incompletely downloaded when the loading time is reached. In order to alleviate the above phenomenon, after step S103, the following steps A1 to A2 may also be performed.
步骤A1:根据各播放资源的起始下载时刻和加载时刻,确定下载时间重叠的目标播放资源。Step A1: Determine the target playback resources with overlapping download times according to the initial download time and loading time of each playback resource.
下载时间是指:从起始下载时刻到加载时刻之间的时间段。例如:播放资源的起始下载时刻为:00:00:58,加载时刻为:00:01:00,播放资源的下载时间为:00:00:58-00:01:00。The download time refers to the time period from the initial download moment to the loading moment. For example, the starting download time of the playback resource is: 00:00:58, the loading time is: 00:01:00, and the download time of the playback resource is: 00:00:58-00:01:00.
下载时间重叠的目标播放资源是指:下载时间之间存在重叠时间段的播放资源。具体的,当下载时间之间满足相交关系、相等关系或者包含关系时,表示下载时间之间存在重叠时间段。将下载时间中存在重叠时间段的播放资源确定为目标播放资源。目标播放资源是成组出现的,不会单独存在。The target playback resources with overlapping download times refer to playback resources with overlapping time periods between download times. Specifically, when the download times satisfy an intersecting relationship, an equality relationship, or an inclusion relationship, it means that there is an overlapping time period between the download times. A playback resource with overlapping time periods in the download time is determined as the target playback resource. Target playback assets appear in groups and do not exist individually.
以表1为例,表1示出了各播放资源的下载时间。Taking Table 1 as an example, Table 1 shows the download time of each playback resource.
表1Table 1
由上述表1可以得到,播放资源Ls1的下载时间与播放资源Ls2的下载时间之间的关系满足相交关系,播放资源Ls1的下载时间与播放资源Ls2的下载时间之间的重叠时间段为00:00:25-00:00:30。Can be obtained from above-mentioned table 1, the relation between the download time of playback resource Ls1 and the download time of playback resource Ls2 satisfies the intersection relation, and the overlapping time period between the download time of playback resource Ls1 and the download time of playback resource Ls2 is 00: 00:25-00:00:30.
播放资源Ls1的下载时间与播放资源Ls3的下载时间之间的关系满足包含关系,播放资源Ls1的下载时间与播放资源Ls3的下载时间之间的重叠时间段为00:00:20-00:00:30。The relationship between the download time of the playback resource Ls1 and the download time of the playback resource Ls3 satisfies the inclusion relationship, and the overlapping time period between the download time of the playback resource Ls1 and the download time of the playback resource Ls3 is 00:00:20-00:00 :30.
播放资源Ls2的下载时间与播放资源Ls3的下载时间之间的关系满足包含关系,播放资源Ls2的下载时间与播放资源Ls3的下载时间之间的重叠时间段为00:00:25-00:00:35;The relationship between the download time of the playback resource Ls2 and the download time of the playback resource Ls3 satisfies the inclusion relationship, and the overlapping time period between the download time of the playback resource Ls2 and the download time of the playback resource Ls3 is 00:00:25-00:00 :35;
由于播放资源Ls1、播放资源Ls2与播放资源Ls3的下载时间之间均有重叠的时间段,播放资源Ls1、播放资源Ls2与播放资源Ls3为一组目标播放资源;类似的,播放资源Ls4、播放资源Ls5与播放资源Ls6的下载时间之间均有重叠的时间段,播放资源Ls4、播放资源Ls5与播放资源 Ls6为一组目标播放资源。Since the download times of playback resource Ls1, playback resource Ls2 and playback resource Ls3 all have overlapping time periods, playback resource Ls1, playback resource Ls2 and playback resource Ls3 are a group of target playback resources; similarly, playback resource Ls4, playback resource Ls4, playback resource Ls3 There are overlapping time periods between the download times of the resource Ls5 and the playback resource Ls6, and the playback resource Ls4, the playback resource Ls5 and the playback resource Ls6 are a group of target playback resources.
具体的,在确定下载时间是否重叠时,可以针对每一播放资源,在其他播放资源中,确定下载时间中包括该播放资源的起始下载时刻的第一播放资源,并确定下载时间中包括该播放资源的加载时刻的第二播放资源,将该播放资源、第一播放资源、第二播放资源作为目标播放资源,也就是,该播放资源、第一播放资源、第二播放资源为一组目标播放资源。Specifically, when determining whether the download time overlaps, for each playback resource, among other playback resources, determine that the download time includes the first playback resource at the start of the download time of the playback resource, and determine that the download time includes the first playback resource. The second playback resource at the loading time of the playback resource, the playback resource, the first playback resource, and the second playback resource are used as the target playback resource, that is, the playback resource, the first playback resource, and the second playback resource are a group of targets Play the resource.
以上述表1为例,对于播放资源Ls1,播放资源Ls3的下载时间 00:00:20-00:00:50包括播放资源Ls1的起始下载时刻00:00:20,播放资源 Ls3为第一播放资源;播放资源Ls2的下载时间00:00:25-00:00:35包含播放资源Ls1的加载时刻00:00:30,播放资源Ls3的下载时间 00:00:20-00:00:50包含播放资源Ls1的加载时刻00:00:30,播放资源Ls2、播放资源Ls3为第二播放资源,从而得到播放资源Ls1、播放资源Ls2与播放资源Ls3为一组目标播放资源。Taking the above Table 1 as an example, for the playback resource Ls1, the download time of the playback resource Ls3 from 00:00:20 to 00:00:50 includes the start download time of the playback resource Ls1 at 00:00:20, and the playback resource Ls3 is the first Play resource; the download time of play resource Ls2 00:00:25-00:00:35 includes the loading time of play resource Ls1 00:00:30, and the download time of play resource Ls3 00:00:20-00:00:50 Including the loading time 00:00:30 of the playback resource Ls1, the playback resource Ls2 and the playback resource Ls3 are the second playback resources, so that the playback resource Ls1, the playback resource Ls2 and the playback resource Ls3 are obtained as a group of target playback resources.
步骤A2:根据目标播放资源的数量和下载时间的重叠时长,向前调整各目标播放资源的起始下载时刻。Step A2: According to the number of target playback resources and the overlapping duration of the download time, the starting download time of each target playback resource is adjusted forward.
目标播放资源的数量是指:存在重叠时间段的播放资源的数量。The number of target playback resources refers to the number of playback resources with overlapping time periods.
以上述表1为例,播放资源Ls1、播放资源Ls2与播放资源Ls3的下载时间之间有重复的时间段,播放资源Ls1、播放资源Ls2与播放资源Ls3 为一组目标播放资源,在这组目标播放资源中,目标播放资源的数量为3。Taking the above Table 1 as an example, there are repeated time periods between the download times of the playback resource Ls1, the playback resource Ls2 and the playback resource Ls3, and the playback resource Ls1, the playback resource Ls2 and the playback resource Ls3 are a group of target playback resources. Among the target playback resources, the number of target playback resources is 3.
播放资源Ls4、播放资源Ls5与播放资源Ls6的下载时间之间有重复的时间段,播放资源Ls4、播放资源Ls5与播放资源Ls6为一组目标播放资源,在这组中目标播放资源,目标播放资源的数量为3。There is a repeated time period between the download times of the playback resource Ls4, the playback resource Ls5 and the playback resource Ls6. The playback resource Ls4, the playback resource Ls5 and the playback resource Ls6 are a group of target playback resources. In this group, the target playback resource, the target playback resource The number of resources is 3.
具体的,在目标播放资源的数量为2时,上述下载时间的重叠时长为:两个目标播放资源的下载时间的重叠时长。Specifically, when the number of target playback resources is 2, the above-mentioned overlapping duration of download times is: the overlapping duration of download times of two target playback resources.
在目标播放资源的数量大于2时,上述下载时间的重叠时长为:根据每两个目标播放资源的下载时间之间的重叠时长确定得到的时长,如从各重叠时长中确定最大时长、最小时长或者计算平均时长。When the number of target playback resources is greater than 2, the overlapping duration of the above download time is: the duration determined according to the overlapping duration between the download times of each two target playback resources, such as determining the maximum duration and the minimum duration from each overlapping duration Or calculate the average duration.
在发生下载时间重叠的情况下,向前调整目标播放资源的起始下载时刻,使得调整后的起始下载时刻与加载时刻之间的时长变长,也就是,用于下载目标播放资源的时长变长,从而能够有效保证在到达目标播放资源的加载时刻时目标播放资源已被下载到本地。In the case of overlapping download times, the initial download time of the target playback resource is adjusted forward, so that the time between the adjusted initial download time and the loading time becomes longer, that is, the time used to download the target playback resource It can effectively ensure that the target playback resource has been downloaded locally when the loading time of the target playback resource is reached.
另外,向前调整各目标播放资源的起始下载时刻时,不仅参考了下载时间的重叠时长,还参考了目标播放资源的数量,这样可以使得存在下载时间重叠的播放资源越多时,调整后下载时间的时长越长,从而能够更加有效保证在到达各个目标资源的加载时刻时目标播放资源已被下载至本地。In addition, when adjusting the starting download time of each target playback resource forward, not only the overlapping duration of the download time, but also the number of target playback resources is referenced, so that when there are more playback resources with overlapping download times, the adjusted download time The longer the time duration is, the more effectively it can be ensured that the target playback resource has been downloaded to the local when the loading time of each target resource is reached.
前述向前调整各目标播放资源的起始下载时刻时是指提前开始下载,例如,提前一个“延长时长”的时间开始下载。举个例子,假设起始下载时刻为00:01:10,向前的“延长时长”为10s,则向前调整上述起始下载时刻后得到的时刻为:00:01:00。The aforementioned adjustment of the starting download time of each target playback resource forward refers to starting the downloading in advance, for example, starting the downloading at a time of "extended duration" in advance. For example, assuming that the starting download time is 00:01:10 and the forward "extended duration" is 10s, the time obtained by adjusting the above starting download time forward is: 00:01:00.
“延长时长”可通过以下方式获得:"Extended Duration" can be obtained by:
本公开的一个获得“延长时长”的实施例中,可以计算目标播放资源的数量与下载时间的重叠时长的乘积,得到延时时长。In an embodiment of the present disclosure for obtaining the "extended duration", the product of the number of target playback resources and the overlapping duration of the download time may be calculated to obtain the delay duration.
例如:目标播放资源的数量为3,下载时间的重叠时长为:10s,计算得到延时时长为:3*10s=30s,各目标播放资源的起始下载时刻分别为: 00:00:30、00:00:35、00:00:40,将各目标播放资源的起始下载时刻向前调整延时时长30s,调整后的各目标播放资源的起始下载时刻分别为00:00:00、 00:00:05、00:00:10。For example: the number of target playback resources is 3, the overlapping duration of the download time is: 10s, the calculated delay time is: 3*10s=30s, the starting download time of each target playback resource is: 00:00:30, 00:00:35, 00:00:40, adjust the starting download time of each target playback resource forward by 30s, and the adjusted start download time of each target playback resource is 00:00:00, 00:00:05, 00:00:10.
以图2b为例,在图2b中播放资源1与播放资源2的下载时间重叠,播放资源1和播放资源2为目标播放资源,且目标播放资源的数量为2,重叠时长为10s,计算得到延时时长为2*10s=20s。播放资源1的起始下载时刻向前延长20s、并对播放资源2的起始下载时刻向前延长20s,调整后的播放资源1的起始下载时刻为00:00:00,调整后的播放资源2的起始下载时刻为:00:00:10,调整后的各播放资源的起始下载时刻如图2c所示。Taking Fig. 2b as an example, in Fig. 2b the download times of playback resource 1 and playback resource 2 overlap, playback resource 1 and playback resource 2 are target playback resources, and the number of target playback resources is 2, and the overlapping duration is 10s. Calculated The delay time is 2*10s=20s. The initial download time of playback resource 1 is extended forward by 20s, and the initial download time of playback resource 2 is extended forward by 20s. The adjusted start download time of playback resource 1 is 00:00:00, and the adjusted playback time The initial download time of resource 2 is: 00:00:10, and the adjusted initial download time of each playback resource is shown in Figure 2c.
这样,延时时长是通过计算目标播放资源的数量与下载时间的重叠时长的乘积得到的,延时时长较长;将各目标播放资源的起始下载时刻向前调整延时时长,使得调整后的起始下载时刻与加载时刻之间有充足的时间下载播放资源,进而有效保证在到达加载时刻时播放资源已下载到本地。In this way, the delay duration is obtained by calculating the product of the number of target playback resources and the overlapping duration of the download time, and the delay duration is relatively long; the delay duration is adjusted forward from the starting download time of each target playback resource, so that after the adjustment There is sufficient time to download the playback resources between the initial download time and the loading time, thereby effectively ensuring that the playback resources have been downloaded locally when the loading time is reached.
本公开的另一个获得“延长时长”的实施例中,还可以按照前述方式计算得到上述延时时长后,根据第三预设时长误差调整延时时长,作为最终的延时时长。In another embodiment of the present disclosure for obtaining the "extended duration", after the above-mentioned delay duration is calculated in the aforementioned manner, the delay duration may be adjusted according to the third preset duration error as the final delay duration.
上述第三预设时长误差可以由工作人员根据经验设定。例如:第三预设时长误差可以为:1s、2s等。The above-mentioned third preset duration error can be set by the staff according to experience. For example, the third preset duration error may be: 1s, 2s, etc.
在调整延时时长时,可以计算延时时长与第三预设时长误差之间的差值,作为最终的延时时长;还可以计算延时时长与第三预设时长误差之间的和值,作为最终的延时时长;还可以从上述差值以及和值形成的时长范围中选择一时长,作为最终的延时时长。When adjusting the delay duration, the difference between the delay duration and the error of the third preset duration can be calculated as the final delay duration; the sum of the delay duration and the error of the third preset duration can also be calculated , as the final delay duration; a duration can also be selected from the duration range formed by the difference and the sum value as the final delay duration.
例如:延时时长为30s,第三预设时长误差为2s,计算得到延时时长与第三预设时长误差之间的差值为:30s-2s=28s,可以将28s作为最终的延时时长;计算得到延时时长与第三预设时长误差之间的和值为: 30s+2s=32s,可以将32s作为最终的延时时长;从上述差值以及和值形成的时长范围[28s,32s]中随机选择一时长31s,作为最终的延时时长。For example: the delay duration is 30s, the error of the third preset duration is 2s, the difference between the delay duration and the error of the third preset duration is calculated as: 30s-2s=28s, 28s can be used as the final delay duration; the sum value between the calculated delay duration and the error of the third preset duration is: 30s+2s=32s, 32s can be used as the final delay duration; the duration range formed from the above difference and the sum value [28s , 32s], a duration of 31s is randomly selected as the final delay duration.
在上述步骤A2得到调整后的起始下载时刻后,可能下载时间产生新的重叠,即会产生新的目标播放资源,因此,可以再次执行步骤A1,以确定出新的目标播放资源。当确定出新的目标播放资源后,需要再次执行步骤A2,以对各目标播放资源的起始下载时刻进行调整。如此循环,直至不存在下载时间重叠的目标播放资源,得到最终调整后的各目标播放资源的起始下载时刻。After obtaining the adjusted starting download time in the above step A2, there may be a new overlap in the download time, that is, a new target playback resource will be generated. Therefore, step A1 can be performed again to determine the new target playback resource. After the new target playback resource is determined, step A2 needs to be performed again to adjust the starting download time of each target playback resource. This cycle is repeated until there is no target playback resource with overlapping download times, and the final adjusted start download time of each target playback resource is obtained.
另外,在上述步骤A2得到调整后的起始下载时刻后,上述步骤S104 中,在视频播放过程,到达调整后的各目标播放资源的起始下载时刻时,下载各目标播放资源。In addition, after obtaining the adjusted start download time in the above step A2, in the above step S104, in the video playback process, when the adjusted start download time of each target playback resource is reached, each target playback resource is downloaded.
为了使得播放资源的起始下载时刻能够适应网络速度的实时变化,本公开的一个实施例中,还可以监测网络速度,并计算网络速度的变化量;若变化量大于预设网速变化量阈值,根据未下载的播放资源的资源量和当前的网络速度,重新预测未下载的播放资源的下载时长,并根据重新预测的下载时长,调整未下载的播放资源的起始下载时刻。In order to make the initial download moment of the playback resource adapt to the real-time change of the network speed, in an embodiment of the present disclosure, the network speed can also be monitored, and the change amount of the network speed can be calculated; if the change amount is greater than the preset network speed change amount threshold , re-predict the download duration of the non-downloaded playback resources according to the resource amount of the non-downloaded playback resources and the current network speed, and adjust the starting download time of the non-downloaded playback resources according to the re-predicted download duration.
具体的,可以按照预设时间间隔监测网络速度。上述预设时间间隔可以为1s、2s、1min、2min等。Specifically, the network speed may be monitored according to preset time intervals. The above-mentioned preset time interval may be 1s, 2s, 1min, 2min, or the like.
网络速度的变化量是指:当前监测得到的网络速度与步骤S102中使用的网络速度之间的差异量。可以计算当前监测得到的网络速度与步骤 S102中使用的网络速度之间差值的绝对值,作为网络速度的变化量。The variation of the network speed refers to the difference between the network speed currently monitored and the network speed used in step S102. The absolute value of the difference between the currently monitored network speed and the network speed used in step S102 can be calculated as the change amount of the network speed.
上述预设网速变化量阈值可以由工作人员根据经验设定。The above-mentioned preset network speed change threshold can be set by the staff according to experience.
当上述变化量大于预设网速变化量阈值时,表示网络速度的变化量较大,也就是说,在当前的网络速度下,下载播放资源所需的时长可能远大于或者远小于步骤S102中预测得到的下载时长。在这种情况下,需要重新预测下载时长。When the above-mentioned change amount is greater than the preset network speed change amount threshold, it means that the change amount of the network speed is large, that is to say, under the current network speed, the time required to download the playback resource may be much longer or shorter than that in step S102 Predicted download time. In this case, the download duration needs to be re-predicted.
具体的,可以采用与步骤S102中类似的预测方式,根据未下载的播放资源的资源量以及当前的网络速度,重新预测未下载的播放资源的下载时长。Specifically, a prediction method similar to that in step S102 may be used to re-predict the download duration of the undownloaded playback resources according to the resource amount of the undownloaded playback resources and the current network speed.
一种实施方式中,针对每一未下载的播放资源,可以根据重新预测的下载时长与原下载时长之间的时长差调整起始下载时刻,当时长差大于0,将起始下载时刻向前调整上述时长差;当时长差小于0,将起始下载时刻向后调整上述时长差。In one embodiment, for each undownloaded playback resource, the start download time can be adjusted according to the time length difference between the re-predicted download time length and the original download time length, where the current length difference is greater than 0, the start download time is moved forward Adjust the above time length difference; if the time length difference is less than 0, adjust the above time length difference backward from the start download time.
例如:重新预测的下载时长为10s,原下载时长为5s,二者之间的时长差为:10s-5s=5s>0,将未下载的播放资源的起始下载时刻00;00:30向前调整5s,得到00:00:25。For example: the re-predicted download time is 10s, the original download time is 5s, and the time difference between the two is: 10s-5s=5s>0, the starting download time of the undownloaded playback resource is 00; 00:30 to Adjust 5s before and get 00:00:25.
重新预测的下载时长为5s,原下载时长为10s,二者之间的时长差为: 5s-10s=-5s<0,将未下载的播放资源的起始下载时刻00:00:30向后调整5s,得到00:00:35。The re-predicted download time is 5s, the original download time is 10s, and the time difference between the two is: 5s-10s=-5s<0, the starting download time of the undownloaded playback resource 00:00:30 is backward Adjust 5s to get 00:00:35.
另一种实施方式中,针对每一未下载的播放资源,可以按照步骤S103 相同的方式,根据重新预测的下载时长,在加载时刻之前,重新确定起始下载时刻。In another implementation manner, for each undownloaded playback resource, the starting download time may be re-determined before the loading time according to the re-predicted download duration in the same manner as in step S103.
这样,对网络速度的变化量进行监测,依据监测结果,重新预测未下载的播放资源的下载时长,使得下载时长与当前网络的网络速度相适应,进而在网络速度发生变化的情况下,依然能够有效保证在加载时刻之前完成播放资源的下载。In this way, the change in network speed is monitored, and according to the monitoring results, the download duration of the undownloaded playback resources is re-predicted, so that the download duration is adapted to the network speed of the current network. Effectively ensure that the download of playback resources is completed before the loading time.
本公开的一个实施例中,还可以在开始视频播放之前,确定预下载的播放资源,并下载预下载的播放资源。In an embodiment of the present disclosure, before starting video playback, pre-downloaded playback resources may be determined, and the pre-downloaded playback resources may be downloaded.
上述预下载的播放资源为:加载时刻与起始播放时刻间的时长不超过预设时长阈值的播放资源。The above-mentioned pre-downloaded playback resources are playback resources whose duration between the loading time and the starting playback time does not exceed a preset duration threshold.
起始播放时刻是指开始视频播放的时刻。The start playback moment refers to the moment when the video playback starts.
预设时长阈值可以由工作人员根据经验设定,例如:预设时长阈值可以为:10s、30s、1min。The preset duration threshold can be set by the staff according to experience, for example, the preset duration threshold can be: 10s, 30s, 1min.
在确定预下载的播放资源时,一种实施方式中,可以获得播放视频的各播放资源的加载时刻,计算各播放资源的加载时刻与起始播放时刻间的时长,将时长不超过预设时长阈值的播放资源确定为预下载的播放资源。When determining the pre-downloaded playback resources, in one embodiment, the loading time of each playback resource for playing the video can be obtained, and the duration between the loading time and the starting playback time of each playback resource is calculated, and the duration is set to be no more than the preset duration. The playback resource of the threshold value is determined as the pre-downloaded playback resource.
例如:播放视频的各播放资源的加载时刻分别为:00:00:02、00:00:04、 00:00:20:00、00:01:00,计算得到各播放资源的加载时刻与起始播放时刻的时长分别为:2s、4s、20s、60s,预设时长阈值为5s,由于2s、4s<5s, 20s、60s>5s,将加载时刻为00:00:02的播放资源、加载时刻为00:00:04 的播放资源确定为预下载的播放资源。For example, the loading time of each playback resource for playing the video is: 00:00:02, 00:00:04, 00:00:20:00, 00:01:00, and the loading time and starting time of each playback resource are calculated. The durations of the start playback time are: 2s, 4s, 20s, 60s, and the preset duration threshold is 5s. Since 2s, 4s<5s, 20s, 60s>5s, the playback resources and the loading time at 00:00:02 will be loaded. The playback resource whose time is 00:00:04 is determined as the pre-downloaded playback resource.
具体的,为了避免在视频播放开始前等待太久时间,可以对预下载的播放资源的数量进行限定,在确定预下载的播放资源时,将时长不超过预设时长阈值、且预设数量个播放资源确定为预下载的播放资源。上述预设数量可以为3个、5个。Specifically, in order to avoid waiting too long before video playback starts, the number of pre-downloaded playback resources can be limited. When determining the pre-downloaded playback resources, the duration does not exceed the preset duration threshold and the preset number of The playback resource is determined to be a pre-downloaded playback resource. The above preset number may be 3 or 5.
一种实施方式中,在上述步骤S101中提及的配置信息中还可以记录:各播放资源是否为预下载的播放资源的标识信息。鉴于此,客户端还可以根据上述配置信息记录的标识信息,确定预下载的播放资源。In an embodiment, the configuration information mentioned in the above step S101 may further record: identification information of whether each playback resource is a pre-downloaded playback resource. In view of this, the client can also determine the pre-downloaded playback resource according to the identification information recorded in the above configuration information.
这样,当加载时刻与起始播放时刻间的时长不超过预设时长阈值时,表示播放资源在开始视频播放之后较短的时间内开始加载。对于这类播放资源,很难保证在到达加载时刻时下载完毕。为了防止出现视频播放阻塞的情况,需要采用提前下载的方式将预下载的播放资源下载到本地,在视频播放过程中,到达预下载的播放资源的加载时刻时,可以直接加载上述播放资源,而不会出现视频播放阻塞的情况,提高了播放资源的时效性。In this way, when the duration between the loading time and the starting playback time does not exceed the preset duration threshold, it means that the playback resource starts to be loaded within a short time after the video playback starts. For such playback resources, it is difficult to guarantee that the download is complete when the loading time is reached. In order to prevent the blocking of video playback, it is necessary to download the pre-downloaded playback resources to the local by means of downloading in advance. During the video playback process, when the loading time of the pre-downloaded playback resources arrives, the above playback resources can be loaded directly. There will be no blocking of video playback, which improves the timeliness of playback resources.
由于各播放资源中存在下载时间重叠的目标播放资源,在下载各目标播放资源时,在同一时间段内会出现同时下载多个目标播放资源的情况,基于上述情况,本公开的一个实施例中,在上述步骤S104下载各目标资源时,可以按照各目标播放资源的加载时刻的先后顺序,确定用于下载各目标播放资源的网络带宽的带宽量,按照所确定的带宽量为各目标播放资源分配网络带宽,使用所分配的网络带宽同步下载各目标播放资源。Since there are target playback resources with overlapping download times in each playback resource, when downloading each target playback resource, multiple target playback resources may be downloaded simultaneously within the same time period. Based on the above situation, in an embodiment of the present disclosure , when downloading each target resource in the above step S104, the bandwidth amount of the network bandwidth used for downloading each target playback resource can be determined according to the order of loading time of each target playback resource, and the determined bandwidth amount is used for each target playback resource. Allocate network bandwidth, and use the allocated network bandwidth to download each target playback resource synchronously.
目标播放资源的加载时刻越靠前,需要带宽量越多的网络带宽,以有效保证在到达加载时刻时下载完毕该目标播放资源。因此,若一个目标播放资源的加载时刻早于其他目标播放资源的加载时刻,为该目标播放资源分配的网络带宽多于为其他目标播放资源分配的网络带宽。The earlier the loading time of the target playback resource is, the more network bandwidth is required, so as to effectively ensure that the target playback resource is downloaded when the loading time is reached. Therefore, if the loading time of one target playback resource is earlier than the loading time of other target playback resources, the network bandwidth allocated for the target playback resource is more than the network bandwidth allocated for other target playback resources.
具体的,可以按照各目标播放资源的加载时刻的先后顺序,确定各目标播放资源的权重,按照各目标播放资源的权重所占的比例,确定用于下载各目标播放资源的网络带宽的带宽量。Specifically, the weight of each target playback resource may be determined according to the sequence of the loading time of each target playback resource, and the amount of network bandwidth used for downloading each target playback resource may be determined according to the proportion of the weight of each target playback resource. .
例如:按照各目标播放资源的加载时刻的先后顺序,各目标播放资源的权重分别为5、4、3、2、1,各目标播放资源的权重所占的比例分别为 5/15、4/15、3/15、2/15、1/15,客户端可分配的总网络带宽为15M,可分配给各目标播放资源的网络带宽分别为:(5/15)*15M=5M、(4/15)*15M=4M、 (3/15)*15M=3M、(2/15)*15M=2M、(1/15)*15M=1M。For example: according to the order of loading time of each target playback resource, the weights of each target playback resource are 5, 4, 3, 2, and 1, respectively, and the proportion of the weight of each target playback resource is 5/15, 4/ 15, 3/15, 2/15, 1/15, the total network bandwidth that can be allocated by the client is 15M, and the network bandwidth that can be allocated to each target playback resource is: (5/15)*15M=5M, (4 /15)*15M=4M, (3/15)*15M=3M, (2/15)*15M=2M, (1/15)*15M=1M.
以下结合图3,对本公开实施例提供的播放资源下载方法应用于课程视频播放场景进行整体说明。In the following, with reference to FIG. 3 , an overall description will be given of the application of the playback resource downloading method provided by the embodiment of the present disclosure to a course video playback scenario.
假设在这一场景中,视频播放的模式为录播模式,播放资源包括:互动游戏资源1、互动游戏资源2、互动问答资源1、互动问答资源2。Assume that in this scenario, the video playback mode is the recording mode, and the playback resources include: interactive game resource 1, interactive game resource 2, interactive Q&A resource 1, and interactive Q&A resource 2.
上述方法包括以下步骤S301-步骤S309。The above method includes the following steps S301-S309.
步骤S301:获取视频播放所需的各播放资源的配置信息。Step S301: Obtain configuration information of each playback resource required for video playback.
步骤S302:遍历配置信息,获取各播放资源的资源量和加载时刻。Step S302: Traverse the configuration information to obtain the resource amount and loading time of each playback resource.
配置信息中记录了各播放资源的实际加载时刻。The actual loading time of each playback resource is recorded in the configuration information.
遍历配置信息,得到互动游戏资源1的资源量为10M、加载时刻为 00:01:05;互动问答资源1的资源量为20M、加载时刻为00:01:10;互动游戏资源2的资源量为10M、加载时刻为00:05:00;互动问答资源2的资源量为20M、加载时刻为00:10:00。Traversing the configuration information, it is found that the resource amount of interactive game resource 1 is 10M, and the loading time is 00:01:05; the resource amount of interactive Q&A resource 1 is 20M, and the loading time is 00:01:10; the resource amount of interactive game resource 2 is is 10M, and the loading time is 00:05:00; the resource volume of interactive Q&A resource 2 is 20M, and the loading time is 00:10:00.
步骤S303:计算网络的平均网速。Step S303: Calculate the average network speed of the network.
具体的,可以计算网络在最近5分钟内的最高网速和最低网速之和的平均值,作为上述平均网速。Specifically, the average value of the sum of the highest network speed and the lowest network speed of the network in the last 5 minutes may be calculated as the above-mentioned average network speed.
例如:网络在最近5分钟内的最高网速为3M/s,最低网速为1M/s,计算二者之和的平均值为:(3M/s+1M/s)/2=2M/s,得到平均网速为2M/s。For example: the maximum network speed of the network in the last 5 minutes is 3M/s, and the minimum network speed is 1M/s. The average value of the sum of the two is: (3M/s+1M/s)/2=2M/s , the average network speed is 2M/s.
步骤S304:根据平均网速和各播放资源的资源量,计算各播放资源的下载时长。Step S304: Calculate the download duration of each playback resource according to the average network speed and the resource amount of each playback resource.
具体的,计算各互动资源的资源量与平均网速之比,将比值作为各互动资源的下载时长。Specifically, the ratio of the resource amount of each interactive resource to the average network speed is calculated, and the ratio is used as the download time of each interactive resource.
例如:对于互动游戏资源1,资源量与平均网速之比为:10/2=5s,得到互动游戏资源1的下载时长为5s;For example: for interactive game resource 1, the ratio of resource amount to average network speed is: 10/2=5s, and the download time of interactive game resource 1 is 5s;
对于互动问答资源1,资源量与平均网速之比为:20/2=10s,得到互动问答资源1的下载时长为10s;For interactive Q&A resource 1, the ratio of resource volume to average network speed is: 20/2=10s, and the download time for interactive Q&A resource 1 is 10s;
对于互动游戏资源2,资源量与平均网速之比为:10/2=5s,得到互动游戏资源2的下载时长为5s;For interactive game resource 2, the ratio of resource amount to average network speed is: 10/2=5s, and the download time of interactive game resource 2 is 5s;
对于互动问答资源2,资源量与平均网速之比为:20/2=10s,得到互动问答资源2的下载时长为10s。For the interactive question and answer resource 2, the ratio of the resource amount to the average network speed is: 20/2=10s, and the download time of the interactive question and answer resource 2 is 10s.
步骤S305:确定各播放资源的加载时刻之前、且间隔下载时长的时刻,作为起始下载时刻。Step S305: Determine the time before the loading time of each playback resource and the interval of the download duration as the start download time.
具体的,可以将各播放资源的加载时刻之前、且间隔下载时长的时刻直接确定为起始下载时刻。Specifically, the time before the loading time of each playback resource and at the interval of the download duration may be directly determined as the starting download time.
例如:对于互动游戏资源1,加载时刻00:01:05之前、且间隔5s的时刻为00:01:00,得到互动游戏资源1的起始下载时刻为00:01:00;For example: for interactive game resource 1, the time before the loading time 00:01:05 and the interval of 5s is 00:01:00, and the starting download time of interactive game resource 1 is 00:01:00;
对于互动问答资源1,加载时刻00:01:10之前、且间隔10s的时刻为 00:01:00,得到互动问答资源1的起始下载时刻为00:01:00;For interactive Q&A resource 1, the time before the loading time of 00:01:10 and the interval of 10s is 00:01:00, and the starting download time of interactive Q&A resource 1 is 00:01:00;
对于互动游戏资源2,加载时刻00:05:00之前、且间隔5s的时刻为 00:04:55,得到互动游戏资源2的起始下载时刻为00:04:55;For interactive game resource 2, the time before the loading time 00:05:00 and the interval of 5s is 00:04:55, and the starting download time of interactive game resource 2 is 00:04:55;
对于互动问答资源2,加载时刻00:10:00之前、且间隔10s的时刻为 00:09:55,得到互动问答资源2的起始下载时刻为00:09:55。For the interactive Q&A resource 2, the time before the loading time 00:10:00 and the interval of 10s is 00:09:55, and the starting download time of the interactive Q&A resource 2 is 00:09:55.
步骤S306:判断各播放资源的下载时间是否存在重叠时间段。若为是,执行步骤S307;若为否,执行步骤S309。Step S306: Determine whether the download time of each playback resource has an overlapping time period. If yes, go to step S307; if no, go to step S309.
播放资源的下载时间为:从起始下载时刻到加载时刻之间的时间段。The download time of the playback resource is: the time period from the initial download time to the loading time.
例如:互动游戏资源1的下载时间为[00:01:00-00:01:05]、互动问答资源1的下载时间为[00:01:00-00:01:10]、互动游戏资源2的下载时间为[00:04:55-00:05:00]、互动问答资源2的下载时间为[00:09:55-00:10:00]。For example: the download time of interactive game resource 1 is [00:01:00-00:01:05], the download time of interactive Q&A resource 1 is [00:01:00-00:01:10], and the download time of interactive game resource 2 The download time is [00:04:55-00:05:00], and the download time of interactive Q&A resource 2 is [00:09:55-00:10:00].
其中,互动游戏资源1的下载时间[00:01:00-00:01:05]与互动问答资源 1的下载时间[00:01:00-00:01:10]存在重叠时间段[00:01:00-00:01:05]。Among them, the download time of interactive game resource 1 [00:01:00-00:01:05] and the download time of interactive Q&A resource 1 [00:01:00-00:01:10] have overlapping time periods [00: 01:00-00:01:05].
步骤S307:计算下载时间重叠的目标播放资源的数量和重叠时长的乘积,得到延长时长。Step S307: Calculate the product of the number of target playback resources with overlapping download times and the overlapping duration to obtain the extended duration.
下载时间重叠的目标播放资源为互动游戏资源1和互动问答资源1,其中,目标播放资源的数量为2,重叠时长为5s,计算得到延时时长为10s。The target playback resources with overlapping download times are interactive game resource 1 and interactive question-and-answer resource 1, wherein the number of target playback resources is 2, the overlapping duration is 5s, and the calculated delay duration is 10s.
步骤S308:通过延长时长,向前调整目标播放资源的起始下载时刻,得到调整后的起始下载时刻。Step S308 : by extending the duration, adjust the initial download time of the target playback resource forward to obtain the adjusted initial download time.
具体的,以目标播放资源的起始下载时刻之前延伸延时时长,得到调整后的起始下载时刻。Specifically, the adjusted start download time is obtained by extending the delay time before the start download time of the target playback resource.
例如:互动游戏资源1的起始下载时刻为00:01:00之前延伸5s,得到 00:00:55,也就是互动游戏资源1的调整后的起始下载时刻为00:00:55;互动问答资源1的起始下载时刻为00:01:00之前延伸5s,得到00:00:55,也就是互动问答资源1的调整后的起始下载时刻为00:00:55。For example: the initial download time of interactive game resource 1 is extended 5s before 00:01:00, and 00:00:55 is obtained, that is, the adjusted initial download time of interactive game resource 1 is 00:00:55; The initial download time of Q&A resource 1 is extended 5s before 00:01:00, and 00:00:55 is obtained, that is, the adjusted initial download time of interactive Q&A resource 1 is 00:00:55.
步骤S309:在视频播放过程中,到达各播放资源的起始下载时刻,下载播放资源。Step S309: During the video playing process, when the starting download time of each playing resource is reached, the playing resource is downloaded.
互动游戏资源1的调整后的起始下载时刻为00:00:55、互动问答资源 1的调整后的起始下载时刻为00:00:55、互动游戏资源2的起始下载时刻为00:04:55、互动问答资源2的起始下载时刻为00:09:55;The adjusted starting download time of interactive game resource 1 is 00:00:55, the adjusted starting download time of interactive Q&A resource 1 is 00:00:55, and the starting download time of interactive game resource 2 is 00: 04:55. The starting download time of interactive Q&A resource 2 is 00:09:55;
在视频播放过程中,到达00:00:55时,同步下载互动游戏资源1和互动问答资源1,并且在到达00:01:05时加载并显示互动游戏资源1,在到达00:01:10时加载并显示互动问答资源1;During the video playback, when it reaches 00:00:55, the interactive game resource 1 and the interactive Q&A resource 1 are downloaded synchronously, and the interactive game resource 1 is loaded and displayed when it reaches 00:01:05, and the interactive game resource 1 is loaded and displayed when it reaches 00:01:10 When loading and displaying interactive Q&A resource 1;
到达00:04:55时,同步下载互动游戏资源2,在到达00:05:00时加载并显示互动游戏资源2;到达00:09:55时,同步下载互动问答资源2,在到达00:10:00时加载并显示互动游戏资源2。When reaching 00:04:55, download interactive game resource 2 synchronously, and load and display interactive game resource 2 when reaching 00:05:00; when reaching 00:09:55, download interactive Q&A resource 2 synchronously, and when reaching 00:05:00: Interactive Game Asset 2 is loaded and displayed at 10:00.
与上述播放资源下载方法相对应,本公开的实施例还提供了一种播放资源下载装置。Corresponding to the above playback resource downloading method, an embodiment of the present disclosure further provides a playback resource downloading apparatus.
参见图4,图4为本公开的实施例提供的一种播放资源下载装置的结构示意图,上述装置包括以下模块401-404。Referring to FIG. 4 , FIG. 4 is a schematic structural diagram of a playback resource downloading apparatus according to an embodiment of the present disclosure. The foregoing apparatus includes the following modules 401 - 404 .
信息获得模块401,用于获得各播放资源的资源量以及加载时刻;The
时长预测模块402,用于根据各播放资源的资源量和网络速度,预测各播放资源的下载时长;A
时刻确定模块403,用于根据各播放资源的下载时长,在各播放资源的加载时刻之前,确定各播放资源的起始下载时刻;The
资源下载模块404,用于在视频播放过程中,到达各播放资源的起始下载时刻后,下载各播放资源。The
由以上可见,应用本实施例提供的方案下载播放资源,是在视频播放过程中下载各播放资源,也就是,一边进行视频播放、一边下载播放资源,相较于现有技术,不需要在视频播放开始之前等待所有的播放资源下载完毕,然后才开始视频播放,提高了视频播放的时效性。It can be seen from the above that applying the solution provided by this embodiment to download playback resources is to download each playback resource during the video playback process, that is, while performing video playback, download playback resources at the same time. Before the playback starts, it waits for all the playback resources to be downloaded, and then starts the video playback, which improves the timeliness of the video playback.
另外,本实施例提供的方案中,下载各播放资源,具体是在视频播放过程中,到达各播放资源的起始下载时刻后启动的。其中,上述起始下载时刻位于播放资源的加载时刻之前、且根据播放资源的下载时长确定。上述下载时长表示在当前网络速度下、下载播放资源所需的时长,这样从起始下载时刻开始下载播放资源,能够有效保证在到达加载时刻时将播放资源下载到本地,从而在加载时刻时能够直接加载已下载到本地的播放资源,减少视频播放过程中等待播放资源下载的情况,进一步提高了视频播放的时效性。In addition, in the solution provided by this embodiment, the downloading of each playback resource is specifically started after reaching the initial download time of each playback resource during the video playback process. Wherein, the above-mentioned starting download time is located before the loading time of the playback resource, and is determined according to the download duration of the playback resource. The above download duration indicates the duration required to download the playback resources at the current network speed. In this way, the playback resources are downloaded from the initial download time, which can effectively ensure that the playback resources are downloaded to the local when the loading time is reached, so that the playback resources can be downloaded at the loading time. Directly load the playback resources that have been downloaded to the local, reduce the situation of waiting for the playback resources to be downloaded during the video playback process, and further improve the timeliness of video playback.
本公开的一个实施例中,所述装置还包括:In an embodiment of the present disclosure, the apparatus further includes:
第一资源确定模块,用于在时刻确定模块之后,根据各播放资源的起始下载时刻和加载时刻,确定下载时间重叠的目标播放资源;The first resource determination module is used to determine the target playback resources with overlapping download times according to the initial download time and loading time of each playback resource after the time determination module;
第一时刻调整模块,用于根据目标播放资源的数量和下载时间的重叠时长,向前调整各目标播放资源的起始下载时刻。The first moment adjustment module is used for forwardly adjusting the starting download moment of each target playback resource according to the number of target playback resources and the overlapping duration of the download time.
在发生下载时间重叠的情况下,向前调整目标播放资源的起始下载时刻,使得调整后的起始下载时刻与加载时刻之间的时长变长,也就是,用于下载目标播放资源的时长变长,从而能够有效保证在到达目标播放资源的加载时刻时目标播放资源已被下载到本地。In the case of overlapping download times, the initial download time of the target playback resource is adjusted forward, so that the time between the adjusted initial download time and the loading time becomes longer, that is, the time used to download the target playback resource It can effectively ensure that the target playback resource has been downloaded locally when the loading time of the target playback resource is reached.
另外,向前调整各目标播放资源的起始下载时刻时,不仅参考了下载时间的重叠时长,还参考了目标播放资源的数量,这样可以使得存在下载时间重叠的播放资源越多时,调整后下载时间的时长越长,从而能够更加有效保证在到达各个目标资源的加载时刻时目标播放资源已被下载至本地。In addition, when adjusting the starting download time of each target playback resource forward, not only the overlapping duration of the download time, but also the number of target playback resources is referenced, so that when there are more playback resources with overlapping download times, the adjusted download time The longer the time duration is, the more effectively it can be ensured that the target playback resource has been downloaded to the local when the loading time of each target resource is reached.
本公开的一个实施例中,所述第一时刻调整模块,具体用于计算目标播放资源的数量与下载时间的重叠时长的乘积,得到延时时长;将各目标播放资源的起始下载时刻向前调整所述延时时长。In an embodiment of the present disclosure, the first time adjustment module is specifically used to calculate the product of the number of target playback resources and the overlapping duration of the download time to obtain the delay time; before adjusting the delay time.
这样,延时时长是通过计算目标播放资源的数量与下载时间的重叠时长的乘积得到的,延时时长较长;将各目标播放资源的起始下载时刻向前调整延时时长,使得调整后的起始下载时刻与加载时刻之间有充足的时间下载播放资源,进而有效保证在到达加载时刻时播放资源已下载到本地。In this way, the delay duration is obtained by calculating the product of the number of target playback resources and the overlapping duration of the download time, and the delay duration is relatively long; the delay duration is adjusted forward from the starting download time of each target playback resource, so that after the adjustment There is sufficient time to download the playback resources between the initial download time and the loading time, thereby effectively ensuring that the playback resources have been downloaded locally when the loading time is reached.
本公开的一个实施例中,所述时刻确定模块,具体用于针对每一播放资源,将加载时刻之前、且与加载时刻间隔下载时长的时刻,确定为起始下载时刻。In an embodiment of the present disclosure, the time determining module is specifically configured to, for each playback resource, determine the time before the loading time and the download time interval from the loading time as the starting download time.
这样,由于起始下载时刻在加载时刻之前、且与加载时刻间隔下载时长,所以在加载时刻之前有较为充分的时间下载播放资源,从而有效保证在加载时刻之前将播放资源下载到本地,减少了视频播放过程中因等待播放资源下载而阻塞视频播放的情况。In this way, since the starting download time is before the loading time and the download duration is separated from the loading time, there is sufficient time to download the playback resources before the loading time, thereby effectively ensuring that the playback resources are downloaded to the local before the loading time, reducing the number of downloads. During the video playback process, the video playback is blocked due to waiting for the playback resources to be downloaded.
本公开的一个实施例中,所述播放资源下载装置还包括:In an embodiment of the present disclosure, the apparatus for downloading playback resources further includes:
变化量检测模块,用于监测所述网络速度,并计算所述网络速度的变化量;a variation detection module, used to monitor the network speed and calculate the variation of the network speed;
第二时刻调整模块,用于若所述变化量大于预设网速变化量阈值,根据未下载的播放资源的资源量和当前的网络速度,重新预测未下载的播放资源的下载时长,并根据重新预测的下载时长,调整未下载的播放资源的起始下载时刻。The second moment adjustment module is configured to re-predict the download duration of the undownloaded playback resources according to the resource amount of the undownloaded playback resources and the current network speed if the variation is greater than the preset network speed variation threshold, and according to the Re-predicted download duration, adjust the starting download time of undownloaded playback resources.
这样,对网络速度的变化量进行监测,依据监测结果,重新预测未下载的播放资源的下载时长,使得下载时长与当前网络的网络速度相适应,进而在网络速度发生变化的情况下,依然能够有效保证在加载时刻之前完成播放资源的下载。In this way, the change in network speed is monitored, and according to the monitoring results, the download duration of the undownloaded playback resources is re-predicted, so that the download duration is adapted to the network speed of the current network. Effectively ensure that the download of playback resources is completed before the loading time.
本公开的一个实施例中,所述播放资源下载装置还包括:In an embodiment of the present disclosure, the apparatus for downloading playback resources further includes:
第二资源确定模块,用于在开始视频播放之前,确定预下载的播放资源,其中,所述预下载的播放资源为:加载时刻与起始播放时刻间的时长不超过预设时长阈值的播放资源;The second resource determination module is used to determine the pre-downloaded playback resources before starting the video playback, wherein the pre-downloaded playback resources are: playbacks whose duration between the loading time and the starting playback time does not exceed a preset duration threshold resource;
第二资源下载模块,用于下载所述预下载的播放资源。The second resource downloading module is configured to download the pre-downloaded playback resource.
这样,当加载时刻与起始播放时刻间的时长不超过预设时长阈值时,表示播放资源在开始视频播放之后较短的时间内开始加载。对于这类播放资源,很难保证在到达加载时刻时下载完毕。为了防止视频播放被打断的情况,需要采用提前下载的方式将预下载的播放资源下载到本地,在视频播放过程中,到达预下载的播放资源的加载时刻时,可以直接加载上述播放资源,而不会出现视频播放被打断的情况,提高了播放资源的时效性。In this way, when the duration between the loading time and the starting playback time does not exceed the preset duration threshold, it means that the playback resource starts to be loaded within a short time after the video playback starts. For such playback resources, it is difficult to guarantee that the download is complete when the loading time is reached. In order to prevent the video playback from being interrupted, it is necessary to download the pre-downloaded playback resources to the local by means of advance download. During the video playback process, when the loading time of the pre-downloaded playback resources is reached, the above playback resources can be loaded directly. There will be no interruption of video playback, which improves the timeliness of playback resources.
本公开的一个实施例中,所述播放资源包括:引导用户参与播放互动的互动资源。In an embodiment of the present disclosure, the playback resource includes: an interactive resource that guides the user to participate in the playback interaction.
这样,通过加载互动资源,能够增强视频播放的趣味性、提高用户参数播放互动的频率。In this way, by loading interactive resources, it is possible to enhance the interest of video playback and increase the frequency of user parameter playback interaction.
根据本公开的实施例,本公开还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
本公开的一个实施例中,提供了一种电子设备,包括:In one embodiment of the present disclosure, an electronic device is provided, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行前述方法实施例中任一播放资源下载方法。The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute any one of the playback resource downloading methods in the foregoing method embodiments .
本公开的一个实施例中,提供了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行前述方法实施例中任一播放资源下载方法。In an embodiment of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause the computer to execute any one of the playback resource downloading methods in the foregoing method embodiments.
本公开的一个实施例中,提供了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现前述方法实施例中任一播放资源下载方法。In one embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements any one of the playback resource downloading methods in the foregoing method embodiments.
图5示出了可以用来实施本公开的实施例的示例电子设备500的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本公开的实现。5 shows a schematic block diagram of an example
如图5所示,设备500包括计算单元501,其可以根据存储在只读存储器(ROM)502中的计算机程序或者从存储单元508加载到随机访问存储器(RAM)503中的计算机程序,来执行各种适当的动作和处理。在 RAM 503中,还可存储设备500操作所需的各种程序和数据。计算单元 501、ROM 502以及RAM 503通过总线504彼此相连。输入/输出(I/O) 接口505也连接至总线504。As shown in FIG. 5 , the
设备500中的多个部件连接至I/O接口505,包括:输入单元506,例如键盘、鼠标等;输出单元507,例如各种类型的显示器、扬声器等;存储单元508,例如磁盘、光盘等;以及通信单元509,例如网卡、调制解调器、无线通信收发机等。通信单元509允许设备500通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the
计算单元501可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元501的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元501执行上文所描述的各个方法和处理,例如播放资源下载方法。例如,在一些实施例中,播放资源下载方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元508。在一些实施例中,计算机程序的部分或者全部可以经由 ROM 502和/或通信单元509而被载入和/或安装到设备500上。当计算机程序加载到RAM 503并由计算单元501执行时,可以执行上文描述的播放资源下载的一个或多个步骤。备选地,在其他实施例中,计算单元501 可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行播放资源下载方法。
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、芯片上系统的系统(SOC)、负载可编程逻辑设备(CPLD)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/ 或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various implementations of the systems and techniques described herein above may be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips system (SOC), load programmable logic device (CPLD), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include being implemented in one or more computer programs executable and/or interpretable on a programmable system including at least one programmable processor The processor, which may be a special purpose or general-purpose programmable processor, may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device an output device.
用于实施本公开的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, performs the functions/functions specified in the flowcharts and/or block diagrams. Action is implemented. The program code may execute entirely on the machine, partly on the machine, partly on the machine and partly on a remote machine as a stand-alone software package or entirely on the remote machine or server.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with the instruction execution system, apparatus or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), fiber optics, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(阴极射线管)或者LCD(液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入) 来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein may be implemented on a computer having a display device (eg, a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user ); and a keyboard and pointing device (eg, a mouse or trackball) through which a user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (eg, visual feedback, auditory feedback, or tactile feedback); and can be in any form (including audio input, voice input, or tactile input) to receive input from the user.
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:局域网(LAN)、广域网(WAN)和互联网。The systems and techniques described herein may be implemented on a computing system that includes back-end components (eg, as a data server), or a computing system that includes middleware components (eg, an application server), or a computing system that includes front-end components (eg, a user's computer having a graphical user interface or web browser through which a user may interact with implementations of the systems and techniques described herein), or including such backend components, middleware components, Or any combination of front-end components in a computing system. The components of the system may be interconnected by any form or medium of digital data communication (eg, a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。A computer system can include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server arises by computer programs running on the respective computers and having a client-server relationship to each other.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本公开公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that steps may be reordered, added or deleted using the various forms of flow shown above. For example, the steps described in the present disclosure can be executed in parallel, sequentially, or in different orders. As long as the desired results of the technical solutions disclosed in the present disclosure can be achieved, there is no limitation herein.
上述具体实施方式,并不构成对本公开保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本公开的精神和原则之内所作的修改、等同替换和改进等,均应包含在本公开保护范围之内。The above-mentioned specific embodiments do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure should be included within the protection scope of the present disclosure.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110710762.0A CN113395549B (en) | 2021-06-25 | 2021-06-25 | Play resource downloading method, device, equipment and storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110710762.0A CN113395549B (en) | 2021-06-25 | 2021-06-25 | Play resource downloading method, device, equipment and storage medium |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN113395549A CN113395549A (en) | 2021-09-14 |
| CN113395549B true CN113395549B (en) | 2022-09-13 |
Family
ID=77623905
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110710762.0A Active CN113395549B (en) | 2021-06-25 | 2021-06-25 | Play resource downloading method, device, equipment and storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113395549B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113810773B (en) * | 2021-09-17 | 2024-03-01 | 北京百度网讯科技有限公司 | Video downloading method and device, electronic equipment and storage medium |
| CN114093338B (en) * | 2021-11-22 | 2025-08-19 | 腾讯音乐娱乐科技(深圳)有限公司 | Audio data loading method, electronic equipment and storage medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105451034A (en) * | 2015-12-04 | 2016-03-30 | 合一网络技术(北京)有限公司 | Advertisement playing control method and system |
Family Cites Families (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105933741A (en) * | 2016-05-16 | 2016-09-07 | 乐视控股(北京)有限公司 | Advertisement playing method and device, and advertisement putting method, device and system |
| CN106412631A (en) * | 2016-10-17 | 2017-02-15 | 合信息技术(北京)有限公司 | Video playing method and device |
| CN106792139A (en) * | 2017-02-24 | 2017-05-31 | 腾讯科技(深圳)有限公司 | A kind of data dispatching method and data dispatch equipment |
| CN110609743A (en) * | 2018-06-15 | 2019-12-24 | 伊姆西Ip控股有限责任公司 | Method, electronic device and computer program product for configuring resources |
| US11734020B2 (en) * | 2019-05-08 | 2023-08-22 | Sony Interactive Entertainment LLC | Accelerated application start using estimated play duration |
| CN110611829B (en) * | 2019-09-11 | 2022-01-21 | 北京达佳互联信息技术有限公司 | Video preloading method and device, electronic equipment and storage medium |
-
2021
- 2021-06-25 CN CN202110710762.0A patent/CN113395549B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105451034A (en) * | 2015-12-04 | 2016-03-30 | 合一网络技术(北京)有限公司 | Advertisement playing control method and system |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113395549A (en) | 2021-09-14 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN109300179B (en) | Animation production method, device, terminal and medium | |
| CN113395549B (en) | Play resource downloading method, device, equipment and storage medium | |
| CN112906081B (en) | A method and device for planning warehouse layout | |
| CN114979799B (en) | A panoramic video processing method, device, equipment and storage medium | |
| CN117651169B (en) | Audio and video data transmission method, device, equipment, medium and program product | |
| CN113230661A (en) | Data synchronization method and device, computer readable medium and electronic equipment | |
| CN110413413A (en) | A kind of method for writing data, device, equipment and storage medium | |
| CN117618890A (en) | Interactive methods, devices, electronic devices and computer-readable storage media | |
| CN118363508A (en) | Media content processing method, device, equipment, readable storage medium and product | |
| CN110516108A (en) | Method and system for browser to play audio | |
| CN118764682A (en) | Interaction method for video and processing method and device for video | |
| CN113810773B (en) | Video downloading method and device, electronic equipment and storage medium | |
| US20250384881A1 (en) | Communication method, electronic device, storage media, and products | |
| CN113490045B (en) | Special effect adding method, device, equipment and storage medium for live video | |
| CN119739835B (en) | Text-based question answer generation method, device, equipment and storage medium | |
| US12301905B2 (en) | Livestreaming data processing method, apparatus and device | |
| CN113012695B (en) | Intelligent control method, device, electronic device and computer-readable storage medium | |
| EP4344218A1 (en) | Special effect playback method and system for live broadcast room, and device | |
| CN115134254B (en) | Network simulation method, device, equipment and storage medium | |
| CN106598525B (en) | A kind of preloading method and device of combination resource | |
| CN114363704B (en) | Video playback method, device, equipment and storage medium | |
| CN113656645B (en) | Log consumption method and device | |
| CN115757120A (en) | Pressure testing method and device, electronic equipment and readable storage medium | |
| CN118196241A (en) | Animation rendering method, device, equipment and medium | |
| WO2023246275A1 (en) | Method and apparatus for playing speech message, and terminal and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |
