CN113727172B - Video cache playback method, device, electronic device and storage medium - Google Patents
Video cache playback method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN113727172B CN113727172B CN202111020673.XA CN202111020673A CN113727172B CN 113727172 B CN113727172 B CN 113727172B CN 202111020673 A CN202111020673 A CN 202111020673A CN 113727172 B CN113727172 B CN 113727172B
- Authority
- CN
- China
- Prior art keywords
- video
- sliding
- sliding operation
- cache
- caching
- 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/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/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
-
- 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/431—Generation of visual interfaces for content selection or interaction; Content or additional data rendering
-
- 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/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
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)
Abstract
Description
技术领域technical field
本公开实施例涉及多媒体技术领域,尤其涉及一种视频缓存播放方法、装置、电子设备及存储介质。Embodiments of the present disclosure relate to the field of multimedia technologies, and in particular, to a video cache playback method, device, electronic equipment, and storage medium.
背景技术Background technique
当前,在视频类应用(Application,APP)中,常会采用滑动操作等方式来实现视频的切换。例如通过上下滑动屏幕,来切换智能手机上运行的视频类APP内当前播放的视频。现有技术中,视频类APP中的视频切换操作,通常是基于Feed流场景的,在该场景下,用户在切换视频的过程中,客户端可以基于Feed流,提前对当前视频的后续视频进行缓存,从而使提前缓存的后续视频被切换至当前视频时,能够流畅加载和播放。Currently, in a video application (Application, APP), a sliding operation or the like is often used to switch videos. For example, by sliding the screen up and down, the currently playing video in the video APP running on the smart phone is switched. In the prior art, the video switching operation in the video APP is usually based on the feed flow scenario. In this scenario, when the user is switching videos, the client can advance the follow-up video of the current video based on the feed flow. Caching, so that when the subsequent video cached in advance is switched to the current video, it can be loaded and played smoothly.
然而,在非Feed流场景下,当用户切换视频时,视频里APP无法基于Feed流对当前视频的后续视频进行提前缓存,因此会导致视频切换后的后续视频加载延迟、播放卡顿等问题。However, in a non-feed stream scenario, when the user switches videos, the APP in the video cannot cache the subsequent videos of the current video in advance based on the feed stream, which will cause problems such as loading delays and playback freezes of subsequent videos after video switching.
发明内容Contents of the invention
本公开实施例提供一种视频缓存播放方法、装置、电子设备及存储介质,以克服现有技术中在非Feed流场景下,无法对后续视频进行提前缓存的问题。Embodiments of the present disclosure provide a video cache playback method, device, electronic device, and storage medium to overcome the problem in the prior art that subsequent videos cannot be cached in advance in a non-feed stream scenario.
第一方面,本公开实施例提供一种视频缓存播放方法,包括:In a first aspect, an embodiment of the present disclosure provides a video cache playback method, including:
播放视频资源序列中的第一视频;当检测到针对所述第一视频的第一滑动操作时,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向;其中,所述第一滑动操作用于将所述第一视频切换为所述视频资源序列中与所述第一视频相邻的第二视频进行播放,所述视频缓存方向表征所述视频资源序列中视频资源的播放方向;根据所述视频缓存方向,确定第三视频,并对所述第三视频进行缓存,生成缓存视频,所述第三视频为所述视频资源序列中与所述第二视频沿视频缓存方向相邻的视频;响应于针对所述第二视频的第二滑动操作,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则播放所述缓存视频。Play the first video in the video resource sequence; when detecting the first sliding operation for the first video, determine the video cache direction according to the sliding direction corresponding to the first sliding operation; wherein, the first sliding The operation is used to switch the first video to play a second video adjacent to the first video in the video resource sequence, and the video buffer direction represents the playback direction of video resources in the video resource sequence; According to the video cache direction, determine a third video, and cache the third video to generate a cache video, the third video is adjacent to the second video in the video resource sequence along the video cache direction video; in response to the second sliding operation on the second video, if the playing direction corresponding to the second sliding operation is the same as the playing direction corresponding to the video cache direction, then play the cached video.
第二方面,本公开实施例提供一种视频缓存播放装置,包括:In a second aspect, an embodiment of the present disclosure provides a video cache playback device, including:
播放模块,用于播放视频资源序列中的第一视频;A playback module, configured to play the first video in the video resource sequence;
确定模块,用于当检测到针对所述第一视频的第一滑动操作时,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向;其中,所述第一滑动操作用于将所述第一视频切换为所述视频资源序列中与所述第一视频相邻的第二视频进行播放,所述视频缓存方向表征所述视频资源序列中视频资源的播放方向;The determination module is configured to determine the video cache direction according to the sliding direction corresponding to the first sliding operation when the first sliding operation for the first video is detected; wherein the first sliding operation is used to The first video is switched to play a second video adjacent to the first video in the video resource sequence, and the video buffer direction represents the playback direction of the video resource in the video resource sequence;
缓存模块,用于根据所述视频缓存方向,确定第三视频,并对所述第三视频进行缓存,生成缓存视频,所述第三视频为所述视频资源序列中与所述第二视频沿视频缓存方向相邻的视频;A caching module, configured to determine a third video according to the video caching direction, and cache the third video to generate a cached video, the third video being in the video resource sequence along with the second video Adjacent videos in the video cache direction;
判断模块,用于响应于针对所述第二视频的第二滑动操作,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则播放所述缓存视频。A judging module, configured to, in response to a second sliding operation on the second video, play the cached video if the playback direction corresponding to the second sliding operation is the same as the playback direction corresponding to the video cache direction.
第三方面,本公开实施例提供一种电子设备,包括:至少一个处理器和存储器;In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the video cache playback method described in the above first aspect and various possible designs of the first aspect.
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the above first aspect and the first Various possible designs of the described video buffer playback method.
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the video cache playback method described in the above first aspect and various possible designs of the first aspect is implemented.
本实施例提供的视频缓存播放方法、装置、电子设备及存储介质,通过播放视频资源序列中的第一视频;当检测到针对所述第一视频的第一滑动操作时,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向;其中,所述第一滑动操作用于将所述第一视频切换为所述视频资源序列中与所述第一视频相邻的第二视频进行播放,所述视频缓存方向表征所述视频资源序列中视频资源的播放方向;根据所述视频缓存方向,确定第三视频,并对所述第三视频进行缓存,生成缓存视频,所述第三视频为所述视频资源序列中与所述第二视频沿视频缓存方向相邻的视频;响应于针对所述第二视频的第二滑动操作,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则播放所述缓存视频。本实施例提供的方法通过检测用户的第一滑动操作,对后续的第二滑动操作对应的滑动方向进行预判,并确定对应的视频缓存方向,以该视频缓存方向对视频资源序列中的视频进行缓存,从而生成缓存视频,在用户进行第二滑动操作时,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则直接加载播放该缓存视频,提高视频加载速度,避免出现视频播放卡顿的问题。The video cache playback method, device, electronic device, and storage medium provided in this embodiment play the first video in the video resource sequence; when the first sliding operation on the first video is detected, according to the first The sliding direction corresponding to the sliding operation determines the video cache direction; wherein, the first sliding operation is used to switch the first video to a second video adjacent to the first video in the video resource sequence for playing , the video cache direction represents the play direction of video resources in the video resource sequence; according to the video cache direction, determine a third video, and cache the third video to generate a cache video, the third video It is a video adjacent to the second video along the video cache direction in the video resource sequence; in response to the second sliding operation for the second video, if the playback direction corresponding to the second sliding operation is the same as the If the playback direction corresponding to the video cache direction is the same, the cached video is played. The method provided in this embodiment predicts the sliding direction corresponding to the subsequent second sliding operation by detecting the user's first sliding operation, and determines the corresponding video cache direction, and uses the video cache direction to process the video in the video resource sequence. Caching is performed to generate a cached video. When the user performs a second sliding operation, if the playback direction corresponding to the second sliding operation is the same as the playback direction corresponding to the video cache direction, the cached video is directly loaded and played, improving the video quality. Loading speed, to avoid the problem of video playback freeze.
附图说明Description of drawings
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present disclosure. Those skilled in the art can also obtain other drawings based on these drawings without any creative effort.
图1为本公开实施例提供的视频缓存播放方法的一种应用场景图;FIG. 1 is an application scenario diagram of a video cache playback method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的视频缓存播放方法的流程示意图一;FIG. 2 is a first schematic flow diagram of a video cache playback method provided by an embodiment of the present disclosure;
图3为本公开实施例提供的一种第二视频与第一视频的位置关系示意图;FIG. 3 is a schematic diagram of a positional relationship between a second video and a first video provided by an embodiment of the present disclosure;
图4A为本公开实施例提供的一种滑动操作与播放方向的对应关系示意图;FIG. 4A is a schematic diagram of a corresponding relationship between a sliding operation and a playback direction provided by an embodiment of the present disclosure;
图4B为本公开实施例提供的另一种滑动操作与播放方向的对应关系示意图FIG. 4B is a schematic diagram of another corresponding relationship between a sliding operation and a playback direction provided by an embodiment of the present disclosure
图5为本公开实施例提供的视频缓存播放方法的流程示意图二;FIG. 5 is a second schematic flow diagram of a video cache playback method provided by an embodiment of the present disclosure;
图6为图5所示实施例中步骤S207的一种实现方式的流程图;FIG. 6 is a flowchart of an implementation of step S207 in the embodiment shown in FIG. 5;
图7为本公开实施例提供的一种第二滑动操作对应的滑动方向的置信值与视频缓存量的对应关系的示意图;FIG. 7 is a schematic diagram of a corresponding relationship between a confidence value of a sliding direction corresponding to a second sliding operation and a video cache amount provided by an embodiment of the present disclosure;
图8为本公开实施例提供的视频缓存播放装置的结构框图;FIG. 8 is a structural block diagram of a video cache playback device provided by an embodiment of the present disclosure;
图9为本公开实施例提供的一种电子设备的结构示意图FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure
图10为本公开实施例提供的电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments It is a part of the embodiments of the present disclosure, but not all of them. Based on the embodiments in the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present disclosure.
下面对本公开实施例的应用场景进行解释:The application scenarios of the embodiments of the present disclosure are explained below:
图1为本公开实施例提供的视频缓存播放方法的一种应用场景图,本公开实施例提供的视频缓存播放方法,可以应用于视频类应用客户端的非Feed流视频资源访问的场景下。本实施例提供的方法的执行主体可以为终端设备11,例如智能手机,更具体地,如图1所示,终端设备11与服务器12连接,用户通过终端设备11内运行的视频类应用客户端(以下简称客户端),访问指定类别、条目、标识的视频分区内的视频资源,例如访问X工作室发布的所有视频资源(图1中示为video1至video6)所在的视频页(视频分区),并点击其中任一视频资源后,播放该视频资源。之后,基于用户的滑动操作,可以将当前播放的视频切换至该视频页内的其他视频资源进行播放。FIG. 1 is an application scenario diagram of the video buffer playback method provided by the embodiment of the present disclosure. The video buffer playback method provided by the embodiment of the present disclosure can be applied to a scenario where a video application client accesses non-feed stream video resources. The execution subject of the method provided in this embodiment may be a
现有技术中,视频类APP中的视频切换操作,通常是基于Feed流场景的,在该场景下,用户在切换视频的过程中,客户端可以基于Feed流,提前对当前视频的后续视频进行缓存,从而使提前缓存的后续视频被切换至当前视频时,能够流畅加载和播放,然而,在非Feed流场景下,APP客户端无法基于Feed流对当前视频的后续视频进行提前缓存。例如在用户进入特定用户的视频页中点选视频进行播放时,选择的视频通常是随机的,之后当用户通过滑动操作切换视频时,滑动方向也是随机的,导致将当前视频切换至前一个视频或后一个视频,因此,无法确定缓存当前视频两侧(前一个或后一个)哪一个方向的视频资源,进而导致视频切换后的后续视频加载延迟、播放卡顿等问题。同时,若将当前视频两侧的视频资源都进行加载,则由于带宽限制,尤其是移动网络接入的条件下,会导致视频资源的缓存时间增加,一方面导致了用户流量和带宽的浪费,另一方面仍会导致后续视频播放的卡顿问题。而本公开实施例提供一种视频缓存播放方法以解决上述问题。In the prior art, the video switching operation in the video APP is usually based on the feed flow scenario. In this scenario, when the user is switching videos, the client can advance the follow-up video of the current video based on the feed flow. Caching, so that when the subsequent video that is cached in advance is switched to the current video, it can be loaded and played smoothly. However, in the non-feed streaming scenario, the APP client cannot pre-cache the subsequent video of the current video based on the feed stream. For example, when a user enters a specific user's video page and clicks on a video to play, the selected video is usually random, and then when the user switches videos through a sliding operation, the sliding direction is also random, resulting in switching the current video to the previous video Or the next video. Therefore, it is impossible to determine which direction the video resources on both sides of the current video (the previous or the next) are cached, which will lead to problems such as delays in loading subsequent videos after video switching, and playback freezes. At the same time, if the video resources on both sides of the current video are loaded, due to the bandwidth limitation, especially under the condition of mobile network access, the cache time of the video resources will increase. On the one hand, it will lead to a waste of user traffic and bandwidth. On the other hand, it will still cause the freeze problem of subsequent video playback. However, the embodiments of the present disclosure provide a video cache playback method to solve the above problems.
参考图2,图2为本公开实施例提供的视频缓存播放方法的流程示意图一。本实施例的方法可以应用于终端设备,该视频缓存播放方法包括:Referring to FIG. 2 , FIG. 2 is a first schematic flowchart of a video cache playback method provided by an embodiment of the present disclosure. The method of this embodiment can be applied to a terminal device, and the video cache playback method includes:
步骤S101,播放视频资源序列中的第一视频。Step S101, playing the first video in the video resource sequence.
示例性地,视频资源序列中包括多个视频,具体地,在一种可能的实现方式中,视频资源序列可以为一个播放列表,播放列表对应多个视频资源服务器内的视频播放地址,其中包括第一视频对应的视频播放地址,通过访问视频资源服务器内第一视频对应的播放地址,可以获取第一视频对应的视频数据,并将该第一视频对应的视频数据下载至终端设备本地,进行加载、转码等过程后,进行播放。在另一种可能的实现方式中,视频资源序列为一种描述信息,用于表征一个或多个视频的集合,视频资源序列可以为一个访问地址,例如“www.video.example.com/user_001”该地址下包含有多个视频文件,例如“video1”、“video2”、“video3”等。其中,示例性地,“video2”可以为视频资源序列中的第一视频。通过在视频资源序列对应的访问地址后增加视频文件的文件名,即可获得对应的视频资源。Exemplarily, the video resource sequence includes multiple videos. Specifically, in a possible implementation manner, the video resource sequence can be a playlist, and the playlist corresponds to video playback addresses in multiple video resource servers, including The video playback address corresponding to the first video, by accessing the playback address corresponding to the first video in the video resource server, the video data corresponding to the first video can be obtained, and the video data corresponding to the first video can be downloaded to the local terminal device for After loading, transcoding, etc., play it. In another possible implementation, the video resource sequence is a kind of description information used to represent a collection of one or more videos, and the video resource sequence can be an access address, such as "www.video.example.com/user_001 "This address contains multiple video files, such as "video1", "video2", "video3" and so on. Wherein, for example, "video2" may be the first video in the sequence of video resources. By adding the file name of the video file after the access address corresponding to the video resource sequence, the corresponding video resource can be obtained.
具体地,终端设备内运行有视频类应用的客户端,基于用户的操作,终端设备通过客户端界面显示的视频资源连接,可以确定视频资源序列,并播放视频资源列表中的第一视频,客户端响应用户的点选操作,播放视频的过程为本领域技术人员知晓的现有技术,此处不再赘述。Specifically, the terminal device runs a client of a video application. Based on the user's operation, the terminal device can determine the video resource sequence through the video resource connection displayed on the client interface, and play the first video in the video resource list. The process in which the terminal responds to the user's click operation and plays the video is a prior art known to those skilled in the art, and will not be repeated here.
步骤S102,当检测到针对第一视频的第一滑动操作时,根据第一滑动操作对应的滑动方向,确定视频缓存方向;其中,第一滑动操作用于将第一视频切换为视频资源序列中与第一视频相邻的第二视频进行播放,视频缓存方向表征视频资源序列中视频资源的播放方向。Step S102, when the first sliding operation for the first video is detected, determine the video cache direction according to the sliding direction corresponding to the first sliding operation; wherein, the first sliding operation is used to switch the first video to the video resource sequence The second video adjacent to the first video is played, and the video buffering direction represents the playing direction of the video resource in the video resource sequence.
示例性地,终端设备设置有用于人机交互的触摸屏,终端设备通过触摸屏检测用户对终端设备的操作行为。具体地,终端设备在通过客户端播放第一视频的过程中,当检测到第一滑动操作时,根据客户端预设的操作规则,对该滑动操作进行响应,将当前播放的第一视频切换为第二视频。其中,第一滑动操作是指在触摸屏的可操作性区域,沿屏幕的横向或纵向滑动,以切换当前播放的视频的操作,例如,向上滑动,切换至前一视频;向下滑动,切换至后一视频;或者,向左滑动,切换至前一视频;向右滑动,切换至后一视频。Exemplarily, the terminal device is provided with a touch screen for human-computer interaction, and the terminal device detects the user's operation behavior on the terminal device through the touch screen. Specifically, when the terminal device detects the first sliding operation during the process of playing the first video through the client, it responds to the sliding operation according to the operation rules preset by the client, and switches the currently playing first video to for the second video. Wherein, the first sliding operation refers to the operation of sliding horizontally or vertically along the screen in the operability area of the touch screen to switch the currently playing video, for example, sliding up to switch to the previous video; sliding down to switch to next video; or, swipe left to switch to previous video; swipe right to switch to next video.
其中,第二视频为视频资源序列中的视频,第二视频可以为与第一视频相邻的前一视频或后一视频;图3为本公开实施例提供的一种第二视频与第一视频的位置关系示意图,如图3所示,例如,视频资源序列中包括“video1”、“video2”、“video3”、“video4”、“video5”。第一视频为“video2”,则基于第一滑动操作对应的滑动方向,第二视频可以为“video3”或“video1”。其中,“video3”可以看作是“video2”的后一视频;“video1”可以看作是“video2”的前一视频。Wherein, the second video is a video in the video resource sequence, and the second video can be the previous video or the next video adjacent to the first video; FIG. A schematic diagram of the positional relationship of videos is shown in FIG. 3 . For example, the sequence of video resources includes "video1", "video2", "video3", "video4", and "video5". The first video is "video2", and based on the sliding direction corresponding to the first sliding operation, the second video can be "video3" or "video1". Among them, "video3" can be regarded as the next video of "video2"; "video1" can be regarded as the previous video of "video2".
进一步地,视频缓存方向是基于用户使用习惯而确定的缓存视频资源序列中的视频的方向。示例性地,视频缓存方向可以包括前向和后向,其中,前项是由当前播放的视频指向当前播放的视频的前一视频的方向,即图3所示实施例中,视频资源序列中“video1”、“video2”、“video3”、“video4”、“video5”、“video1”、……的循环方向;后项是由当前播放的视频指向当前播放的视频的后一视频的方向,即图3所示实施例中,视频资源序列中“video5”、“video4”、“video3”、“video2”、“video1”、“video5”、……的循环方向。Further, the video caching direction is the direction of caching videos in the video resource sequence determined based on user usage habits. Exemplarily, the video cache direction may include forward and backward, wherein the previous item is the direction from the currently played video to the previous video of the currently played video, that is, in the embodiment shown in FIG. 3 , in the video resource sequence The loop direction of "video1", "video2", "video3", "video4", "video5", "video1", ...; the latter item is the direction from the currently playing video to the next video of the currently playing video, That is, in the embodiment shown in FIG. 3 , the circular direction of "video5", "video4", "video3", "video2", "video1", "video5", ... in the video resource sequence.
其中,视频缓存方向是通过第一滑动操作对应的滑动方向,以及预设的判断规则确定的,在一种可能的实现方式中,根据第一滑动操作对应的滑动方向,确定视频缓存方向,包括:获取预设的历史滑动信息,历史滑动信息用于表征在第一滑动操作前检测到的至少一个第三滑动操作所对应的滑动方向;根据历史滑动信息和第一滑动操作对应的滑动方向,确定视频缓存方向。具体地,若第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向均与第一滑动操作对应的滑动相同,则将第一滑动操作对应的滑动方向确定为视频缓存方向。例如,用户在实施第一滑动操作之前,还实施了两次第三滑动操作,第一滑动操作与两次第三滑动操作对应的滑动方向相同,即用户连续三次向一个方向实施滑动操作切换视频(即判断规则);则将该滑动方向对应的视频播放方向,确定为视频缓存方向。其中,历史滑动信息是预设在终端设备内的,在每次检测到用户实施的滑动操作后,根据滑动操作的滑动方向,更新该历史滑动信息。Wherein, the video cache direction is determined by the slide direction corresponding to the first slide operation and the preset judgment rule. In a possible implementation, the video cache direction is determined according to the slide direction corresponding to the first slide operation, including : Obtain preset historical sliding information, which is used to characterize the sliding direction corresponding to at least one third sliding operation detected before the first sliding operation; according to the historical sliding information and the sliding direction corresponding to the first sliding operation, Determines the video cache orientation. Specifically, if the sliding directions corresponding to the third sliding operations that are preset consecutive times before the first sliding operation are all the same as the sliding directions corresponding to the first sliding operation, then the sliding direction corresponding to the first sliding operation is determined as the video buffering direction. For example, before the first sliding operation, the user also performs the third sliding operation twice, and the sliding direction corresponding to the first sliding operation is the same as that of the two third sliding operations, that is, the user performs three consecutive sliding operations in one direction to switch videos. (i.e. the judging rule); then the video playback direction corresponding to the sliding direction is determined as the video cache direction. Wherein, the historical sliding information is preset in the terminal device, and after each detection of a sliding operation performed by the user, the historical sliding information is updated according to the sliding direction of the sliding operation.
示例性地,视频缓存方向还包括待定方向;即通过第一滑动操作对应的滑动方向,以及预设的判断规则,不能视频缓存方向是前向或后向时,则确定视频缓存方向为待定方向。Exemplarily, the video cache direction also includes a pending direction; that is, through the sliding direction corresponding to the first sliding operation and the preset judgment rule, if the video caching direction cannot be forward or backward, then determine the video caching direction as the pending direction .
步骤S103,根据视频缓存方向,确定第三视频,并对第三视频进行缓存,生成缓存视频,第三视频为视频资源序列中与第二视频沿视频缓存方向相邻的视频。Step S103, determine a third video according to the video buffering direction, and buffer the third video to generate a buffered video, where the third video is a video adjacent to the second video along the video buffering direction in the video resource sequence.
示例性地,当检测到针对第一视频的第一滑动操作时,终端设备通过运行的客户端,播放第二视频。在确定视频缓存方向后,即可根据视频缓存方向,预测后续播放的视频,即第三视频。第三视频可以为第二视频的前一视频或后一视频。Exemplarily, when detecting the first sliding operation on the first video, the terminal device plays the second video through the running client. After the video cache direction is determined, the subsequent video to be played, that is, the third video, can be predicted according to the video cache direction. The third video may be a previous video or a subsequent video of the second video.
进一步地,对第三视频进行缓存,生成存储于本地的缓存视频,该缓存视频包括一个或多个视频数据,当缓存视频包括多个视频数据时,每一视频数据用于存储第三视频的一个视频片段。从而实现对全部或部分第三视频的缓存。其中,第三视频可以包括一个或多个视频,第三视频中的各视频可以对应一个或多个缓存视频,此处不对缓存视频的具体形式进行具体限定。Further, the third video is cached to generate a locally stored cached video, the cached video includes one or more video data, and when the cached video includes multiple video data, each video data is used to store the third video A video clip. In this way, all or part of the third video can be cached. Wherein, the third video may include one or more videos, and each video in the third video may correspond to one or more cached videos, and the specific form of the cached videos is not specifically limited here.
步骤S104,响应于针对第二视频的第二滑动操作,若第二滑动操作对应的滑动方向与视频缓存方向,播放缓存视频。Step S104 , in response to the second sliding operation on the second video, if the sliding direction corresponding to the second sliding operation corresponds to the video buffering direction, play the buffered video.
示例性地,在终端设备通过运行的客户端,播放第二视频的过程中,当用户继续切换视频时,会对终端设备实施第二滑动操作,其中,与第一滑动操作类似,第二滑动操作用于将第二视频切换为视频资源序列中与第二视频相邻的视频进行播放。图4A为本公开实施例提供的一种滑动操作与播放方向的对应关系示意图,如图4A所示,终端设备检测到第二滑动操作后,会响应第二滑动操作,对第二视频进行切换,基于第二滑动操作的滑动方向,播放第二视频的前一视频或后一视频。而基于第二滑动操作(滑动操作a)向下滑动屏幕时,播放第二视频(video2)的前一视频(video1),对应一种播放方向(播放方向A)。图4B为本公开实施例提供的一种滑动操作与播放方向的对应关系示意图,如图4B所示,基于第二滑动操作(滑动操作b)向上滑动屏幕时,播放第二视频的后一视频(video3),对应另一种播放方向(播放方向B)。据此,可以确定第二滑动操作与播放方向之间的对应关系。Exemplarily, when the terminal device is playing the second video through the running client, when the user continues to switch videos, a second sliding operation will be performed on the terminal device, wherein, similar to the first sliding operation, the second sliding The operation is used to switch the second video to a video adjacent to the second video in the video resource sequence for playing. FIG. 4A is a schematic diagram of a corresponding relationship between a sliding operation and a playback direction provided by an embodiment of the present disclosure. As shown in FIG. 4A , after the terminal device detects the second sliding operation, it will respond to the second sliding operation and switch the second video , based on the sliding direction of the second sliding operation, play the previous video or the next video of the second video. When the screen is slid down based on the second sliding operation (sliding operation a), the previous video (video1) of the second video (video2) is played, corresponding to a playing direction (playing direction A). FIG. 4B is a schematic diagram of a corresponding relationship between a sliding operation and a playback direction provided by an embodiment of the present disclosure. As shown in FIG. 4B , when the screen is slid upwards based on the second sliding operation (sliding operation b), the next video of the second video is played (video3), corresponding to another play direction (play direction B). Accordingly, the corresponding relationship between the second sliding operation and the playing direction can be determined.
当基于第二滑动操作对应的播放方向与视频缓存方向对应的播放方向一致时,说明预测的视频缓存方向正确,此时播放缓存的缓存视频。而在另一种可能的实现方式中,若用户实施的第二滑动操作对应的播放方向与视频缓存方向不同,或者视频缓存方向为待定方向,则不播放缓存视频,按照常规的视频加载方式进行视频的下载和播放。When the play direction corresponding to the second sliding operation is consistent with the play direction corresponding to the video cache direction, it means that the predicted video cache direction is correct, and the cached cached video is played at this time. In another possible implementation, if the playback direction corresponding to the second sliding operation performed by the user is different from the video cache direction, or the video cache direction is a direction to be determined, the cached video will not be played, and the conventional video loading method will be used. Video download and playback.
在本实施例中,通过播放视频资源序列中的第一视频;当检测到针对第一视频的第一滑动操作时,根据第一滑动操作对应的滑动方向,确定视频缓存方向;其中,第一滑动操作用于将第一视频切换为视频资源序列中与第一视频相邻的第二视频进行播放,视频缓存方向表征视频资源序列中视频资源的播放方向;根据视频缓存方向,确定第三视频,并对第三视频进行缓存,生成缓存视频,第三视频为视频资源序列中与第二视频沿视频缓存方向相邻的视频;响应于针对第二视频的第二滑动操作,若第二滑动操作对应的播放方向与视频缓存方向对应的播放方向相同,则播放缓存视频。本实施例提供的方法通过检测用户的第一滑动操作,对后续的第二滑动操作对应的滑动方向进行预判,并确定对应的视频缓存方向,以该视频缓存方向对视频资源序列中的视频进行缓存,从而生成缓存视频,在用户进行第二滑动操作时,若第二滑动操作对应的播放方向与视频缓存方向对应的播放方向相同,则直接加载播放该缓存视频,提高视频加载速度,避免出现视频播放卡顿的问题。In this embodiment, by playing the first video in the video resource sequence; when the first sliding operation for the first video is detected, the video cache direction is determined according to the sliding direction corresponding to the first sliding operation; wherein, the first The slide operation is used to switch the first video to play the second video adjacent to the first video in the video resource sequence, and the video cache direction represents the playback direction of the video resource in the video resource sequence; determine the third video according to the video cache direction , and cache the third video to generate a cached video. The third video is a video adjacent to the second video along the video cache direction in the video resource sequence; in response to the second sliding operation on the second video, if the second sliding If the playback direction corresponding to the operation is the same as the playback direction corresponding to the video cache direction, the cached video will be played. The method provided in this embodiment predicts the sliding direction corresponding to the subsequent second sliding operation by detecting the user's first sliding operation, and determines the corresponding video cache direction, and uses the video cache direction to process the video in the video resource sequence. Caching is performed to generate a cached video. When the user performs a second sliding operation, if the playback direction corresponding to the second sliding operation is the same as the playback direction corresponding to the video cache direction, the cached video is directly loaded and played to increase the video loading speed and avoid There is a problem of video playback freezing.
参考图5,图5为本公开实施例提供的视频缓存播放方法的流程示意图二。本实施例中对步骤S102和S103进一步细化,该视频缓存播放方法包括:Referring to FIG. 5 , FIG. 5 is a second schematic flowchart of a video cache playback method provided by an embodiment of the present disclosure. Steps S102 and S103 are further refined in this embodiment, and the video cache playback method includes:
步骤S201,播放视频资源序列中的第一视频。Step S201, playing the first video in the video resource sequence.
步骤S202,当检测到针对第一视频的第一滑动操作时,获取预设的滑动预测模型,滑动预测模型为用于预测第一滑动操作之后的第二滑动操作对应的滑动方向的预训练模型。Step S202, when the first sliding operation for the first video is detected, obtain a preset sliding prediction model, which is a pre-trained model used to predict the sliding direction corresponding to the second sliding operation after the first sliding operation .
步骤S203,根据滑动预测模型,确定第一滑动操作之后的第二滑动操作对应的滑动方向的置信值。Step S203, according to the sliding prediction model, determine the confidence value of the sliding direction corresponding to the second sliding operation after the first sliding operation.
步骤S204,若置信值大于预设值,则将滑动预测模型输出的第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向。Step S204, if the confidence value is greater than the preset value, then determine the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model as the video buffering direction.
示例性地,滑动预测模型是预训练的预测模型,用于预测用户在执行完第一滑动操作后,所执行的第二滑动操作的滑动方向。该预测模型可以基于用户的第一滑动操作的滑动方向,以及终端设备显示的第一视频、第二视频的内容、时长等信息,对用户之后将要实施的第二滑动操作的滑动方向进行预测。在一种可能的实现方式中,滑动预测模型直接输出预测的滑动方向,并将该滑动方向对应的视频资源序列中各视频的播放方向确定为视频缓存方向。在另一种可能的实现方式中,滑动预测模型直接输出预测的滑动方向的置信值。例如,前向为0.8,后向为0.2。进一步地,根据置信值,当置信值大于预设值,例如0.7时,则将滑动预测模型输出的第一滑动操作之后的第二滑动操作对应的播放方向确定为视频缓存方向。Exemplarily, the sliding prediction model is a pre-trained prediction model, which is used to predict the sliding direction of the second sliding operation performed by the user after performing the first sliding operation. The prediction model can predict the sliding direction of the second sliding operation to be performed by the user based on the sliding direction of the user's first sliding operation and information such as the content and duration of the first video and the second video displayed on the terminal device. In a possible implementation manner, the sliding prediction model directly outputs the predicted sliding direction, and determines the playing direction of each video in the video resource sequence corresponding to the sliding direction as the video buffering direction. In another possible implementation manner, the sliding prediction model directly outputs the confidence value of the predicted sliding direction. For example, 0.8 for forward and 0.2 for backward. Further, according to the confidence value, when the confidence value is greater than a preset value, such as 0.7, the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model is determined as the video buffering direction.
步骤S205,根据视频资源序列,确定视频排序信息,视频排序信息用于表征视频资源序列中的各视频的位置排序。Step S205, according to the sequence of video resources, determine video sorting information, which is used to represent the positional sorting of each video in the video resource sequence.
步骤S206,根据视频排序信息,确定第二视频在视频资源序列中的位置排序。Step S206, according to the video ranking information, determine the position ranking of the second video in the video resource sequence.
步骤S207,根据第二视频在视频资源序列中的位置排序,以及视频缓存方向,确定第三视频。Step S207: Determine the third video according to the ordering of the second video in the video resource sequence and the direction of video buffering.
视频排序信息是用于表征视频资源序列中各视频的位置排序的信息,在播放视频资源序列中各视频时,按照视频排序信息对应的播放顺序播放各视频。其中,示例性地,视频排序信息中可以包括视频资源序列中各视频的用于排序的标识,根据视频排序信息和第二视频的标识,可以确定第二视频在视频资源序列中的位置排序。进一步地,在确定第二视频的位置排序的基础上,基于视频缓存方向,确定视频缓存方向上与第二视频的标识相邻的标识,进而确定该标识对应的视频,即第三视频。The video sorting information is used to represent the positional sorting of each video in the video resource sequence. When playing each video in the video resource sequence, each video is played according to the playing order corresponding to the video sorting information. Wherein, for example, the video ranking information may include identifiers for sorting of each video in the video resource sequence, and according to the video ranking information and the identifier of the second video, the position ranking of the second video in the video resource sequence may be determined. Further, on the basis of determining the position order of the second video, based on the video cache direction, determine the logo adjacent to the logo of the second video in the video cache direction, and then determine the video corresponding to the logo, that is, the third video.
可选地,第三视频包括视频资源序列中的多个连续的视频,如图6所示,步骤S207包括步骤S2071、S2072两个具体的实现步骤:Optionally, the third video includes multiple continuous videos in the video resource sequence, as shown in Figure 6, step S207 includes two specific implementation steps of steps S2071 and S2072:
步骤S2071,获取预设的缓存参数,缓存参数用于表征第三视频所包括的视频的数量。In step S2071, a preset cache parameter is obtained, and the cache parameter is used to represent the number of videos included in the third video.
步骤S2072,根据缓存参数,将第二视频沿视频缓存方向相邻的预设数量的视频,确定为第三视频。Step S2072, according to the cache parameters, determine a preset number of videos adjacent to the second video along the video cache direction as the third video.
示例性地,缓存参数是预设在终端设备内的信息,可以通过用户配置或者客户端安装、更新时配置在终端设备内。通过缓存参数例如包括“缓存数量=4”,即将第二视频沿述视频缓存方向的4个视频,确定为第三视频,并在后续过程中对该4个视频进行缓存,通过本实施例中的步骤,确定多个视频为第三视频,并进行缓存,可以在用户频繁实施滑动操作切换视频时,仍保证终端设备本地缓存有视频数据,从而进一步的避免出现播放卡顿问题。Exemplarily, the cache parameter is information preset in the terminal device, and may be configured in the terminal device through user configuration or during client installation or update. For example, the cache parameter includes "buffer quantity = 4", that is, the 4 videos along the video cache direction of the second video are determined as the third video, and the 4 videos are cached in the subsequent process, through this embodiment The step of determining multiple videos as the third video and caching them can ensure that the terminal device still has video data locally cached when the user frequently performs sliding operations to switch videos, thereby further avoiding the problem of playback freeze.
步骤S208,获取视频缓存量,并基于视频缓存量,对第三视频进行缓存,生成缓存视频。Step S208, acquire the video cache amount, and based on the video cache amount, cache the third video to generate a cached video.
示例性地,视频缓存量是用于表征缓存第三视频的数据量的信息,例如,视频缓存量可以是百分比数值,例如50%;也可以是具体地数据大小,例如2048kB(千字节)。通过设置视频缓存量,在对第三视频进行缓存时,仅缓存第三视频中的部分流数据,可以实现第三视频的初步缓存,之后,在确定播放第三视频时,再继续对剩余的第三视频的流数据进行缓存,即避免了视频的卡顿,又避免缓存全部第三视频造成的流量浪费。Exemplarily, the video cache amount is information used to characterize the amount of data for caching the third video, for example, the video cache amount can be a percentage value, such as 50%; it can also be a specific data size, such as 2048kB (kilobytes) . By setting the amount of video buffering, when caching the third video, only part of the stream data in the third video can be buffered, which can realize the preliminary buffering of the third video, and then continue to process the remaining data when the third video is determined to be played. The stream data of the third video is cached, which not only avoids video freeze, but also avoids traffic waste caused by caching all the third videos.
在一种可能的实现方式中,获取视频缓存量,包括:In a possible implementation manner, obtaining the video cache amount includes:
获取第一视频的内容信息,内容信息表征第一视频的视频内容类别;根据第一视频的内容信息和第一视频的播放时长,确定视频缓存量。The content information of the first video is obtained, and the content information represents the video content category of the first video; and the video cache amount is determined according to the content information of the first video and the playing duration of the first video.
示例性地,内容信息是用于表征第一视频的视频内容类别的信息,例如:搞笑视频、电影视频、学习视频等。内容视频可以通过第一视频的分类标签、视频名称、视频作者标识等描述信息确定。由于用户对于不同的视频内容,感兴趣度不同。对于用户所感兴趣的视频,用户会长时间观看,而对于用户不感兴趣的视频,用户会快速切换为下一视频。因此,对于缓存的第三视频,若用户对即将播放的第三视频不感兴趣,则可能用户会很快将第三视频切换为下一视频,因此。根据第一视频的内容信息和第一视频的播放时长,确定视频缓存量,根据视频缓存量对第三视频进行少量缓存,可以节省网络带宽和流量。Exemplarily, the content information is information used to characterize the video content category of the first video, for example: funny videos, movie videos, learning videos, and so on. The content video may be determined by descriptive information such as the classification label of the first video, the video name, and the identification of the video author. Because users have different degrees of interest in different video contents. For the videos that the user is interested in, the user will watch for a long time, but for the video that the user is not interested in, the user will quickly switch to the next video. Therefore, for the cached third video, if the user is not interested in the third video to be played, the user may quickly switch the third video to the next video, therefore. According to the content information of the first video and the playing duration of the first video, the video cache amount is determined, and a small amount of cache is performed on the third video according to the video cache amount, which can save network bandwidth and traffic.
在另一种可能的实现方式中,获取视频缓存量,包括:根据第一滑动操作之后的第二滑动操作对应的滑动方向的置信值,确定视频缓存量。In another possible implementation manner, acquiring the video cache amount includes: determining the video cache amount according to a confidence value of a sliding direction corresponding to a second slide operation after the first slide operation.
示例性地,第二滑动操作对应的滑动方向与第二滑动操作对应的播放方向具有固定的映射关系,通过滑动预测模型预测的第二滑动操作对应的滑动方向的置信值越大,则说明视频缓存方向与第二滑动操作对应的播放方向相同的可能性越大,反之,则视频缓存方向与第二滑动操作对应的播放方向相同的可能性越小。根据滑动预测模型预测的滑动方向的置信值,确定对应的视频缓存量,使视频缓存量与视频缓存方向与第二滑动操作对应的播放方向相同的可能性相匹配,在视频缓存方向与第二滑动操作对应的播放方向相同的可能性较小时,以较小的视频缓存量缓存第三视频;反之,则以较大的视频缓存量缓存第三视频,从而进一步的提高带宽利用率,节约流量。图7为本公开实施例提供的一种第二滑动操作对应的滑动方向的置信值与视频缓存量的对应关系的示意图,如图7所示,当滑动预测模型预测的第二滑动操作对应的滑动方向的置信值为0.8时,对第三视频进行视频缓存的数据量为2048kB,生成大小为2048kB的缓存文件;当滑动预测模型预测的第二滑动操作对应的滑动方向的置信值为0.9时,对第三视频进行视频缓存的数据量为4096kB,生成大小为4096kB的缓存文件。Exemplarily, the sliding direction corresponding to the second sliding operation has a fixed mapping relationship with the playing direction corresponding to the second sliding operation, and the greater the confidence value of the sliding direction corresponding to the second sliding operation predicted by the sliding prediction model, the more the video The higher the probability that the cache direction is the same as the playback direction corresponding to the second sliding operation, on the contrary, the lower the possibility that the video buffering direction is the same as the playback direction corresponding to the second sliding operation. According to the confidence value of the sliding direction predicted by the sliding prediction model, determine the corresponding video buffer size, so that the video buffer size matches the possibility that the video buffer direction is the same as the playback direction corresponding to the second sliding operation, and the video buffer direction is the same as the second sliding operation. When it is less likely that the playback direction corresponding to the sliding operation is the same, the third video is cached with a smaller video cache; otherwise, the third video is cached with a larger video cache, thereby further improving bandwidth utilization and saving traffic . 7 is a schematic diagram of the corresponding relationship between the confidence value of the sliding direction corresponding to the second sliding operation and the amount of video cache provided by an embodiment of the present disclosure. As shown in FIG. 7 , when the sliding prediction model predicts that the second sliding operation corresponds to When the confidence value of the sliding direction is 0.8, the amount of video cache data for the third video is 2048kB, and a cache file with a size of 2048kB is generated; when the confidence value of the sliding direction corresponding to the second sliding operation predicted by the sliding prediction model is 0.9 , the amount of video cache data for the third video is 4096kB, and a cache file with a size of 4096kB is generated.
步骤S209,响应于针对第二视频的第二滑动操作,若第二滑动操作对应的播放方向与视频缓存方向对应的播放方向相同,则播放缓存视频。Step S209, in response to the second sliding operation on the second video, if the playing direction corresponding to the second sliding operation is the same as the playing direction corresponding to the video buffering direction, play the buffered video.
本实施例中,步骤S201、步骤S209的实现方式与本公开图2所示实施例中的步骤S101、步骤S104的实现方式相同,在此不再一一赘述。In this embodiment, the implementation manners of step S201 and step S209 are the same as the implementation manners of step S101 and step S104 in the embodiment shown in FIG. 2 of the present disclosure, and will not be repeated here.
对应于上文实施例的视频缓存播放方法,图8为本公开实施例提供的视频缓存播放装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参照图8,视频缓存播放装置3,包括:Corresponding to the video cache playback method in the above embodiments, FIG. 8 is a structural block diagram of a video cache playback device provided by an embodiment of the present disclosure. For ease of description, only the parts related to the embodiments of the present disclosure are shown. Referring to Fig. 8, the video
播放模块31,用于播放视频资源序列中的第一视频;The playing
确定模块32,用于当检测到针对第一视频的第一滑动操作时,根据第一滑动操作对应的滑动方向,确定视频缓存方向;其中,第一滑动操作用于将第一视频切换为视频资源序列中与第一视频相邻的第二视频进行播放,视频缓存方向表征视频资源序列中视频资源的播放方向;The
缓存模块33,用于根据视频缓存方向,确定第三视频,并对第三视频进行缓存,生成缓存视频,第三视频为视频资源序列中与第二视频沿视频缓存方向相邻的视频;The
判断模块34,用于响应于针对第二视频的第二滑动操作,若第二滑动操作对应的播放方向与视频缓存方向对应的播放方向相同,则播放缓存视频。The judging
在本公开的一个实施例中,确定模块32在根据第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:获取预设的历史滑动信息,历史滑动信息用于表征在第一滑动操作前检测到的至少一个第三滑动操作所对应的滑动方向;根据历史滑动信息和第一滑动操作对应的滑动方向,确定视频缓存方向。In one embodiment of the present disclosure, when the
在本公开的一个实施例中,历史滑动信息包括第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向;确定模块32在根据历史滑动信息和第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:若第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向均与第一滑动操作对应的滑动相同,则将第一滑动操作对应的滑动方向确定为视频缓存方向。In an embodiment of the present disclosure, the historical sliding information includes the sliding direction corresponding to the third sliding operation that is consecutively preset times before the first sliding operation; the
在本公开的一个实施例中,确定模块32在根据第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:获取预设的滑动预测模型,滑动预测模型为用于预测第一滑动操作之后的第二滑动操作对应的滑动方向的预训练模型;根据滑动预测模型,确定第一滑动操作之后的第二滑动操作对应的滑动方向的置信值;若置信值大于预设值,则将滑动预测模型输出的第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向。In one embodiment of the present disclosure, when the determining
在本公开的一个实施例中,确定模块32在在将滑动预测模型输出的第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向之后,还用于:根据第一滑动操作之后的第二滑动操作对应的滑动方向的置信值,确定视频缓存量;In one embodiment of the present disclosure, after determining the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model as the video cache direction, the determining
在本公开的一个实施例中,缓存模块33在对第三视频进行缓存时,具体用于:根据视频缓存量,对第三视频进行缓存。In an embodiment of the present disclosure, when caching the third video, the
在本公开的一个实施例中,缓存模块33在根据视频缓存方向,确定第三视频时,具体用于:根据视频资源序列,确定视频排序信息,视频排序信息用于表征视频资源序列中的各视频的位置排序;根据视频排序信息,确定第二视频在视频资源序列中的位置排序;根据第二视频在视频资源序列中的位置排序,以及视频缓存方向,确定第三视频。In one embodiment of the present disclosure, when the
在本公开的一个实施例中,第三视频包括视频资源序列中的多个连续的视频;缓存模块33在根据第二视频在视频资源序列中的位置排序,以及视频缓存方向,确定第三视频时,具体用于:获取预设的缓存参数,缓存参数用于表征第三视频所包括的视频的数量;根据缓存参数,将第二视频沿视频缓存方向相邻的预设数量的视频,确定为第三视频。In one embodiment of the present disclosure, the third video includes a plurality of continuous videos in the video resource sequence; the
在本公开的一个实施例中,缓存模块33还用于:获取第一视频的内容信息,内容信息表征第一视频的视频内容类别;根据第一视频的内容信息和第一视频的播放时长,确定视频缓存量;In an embodiment of the present disclosure, the
在本公开的一个实施例中,缓存模块33在对第三视频进行缓存时,具体用于:根据视频缓存量,对第三视频进行缓存。In an embodiment of the present disclosure, when caching the third video, the
其中,播放模块31、确定模块32、缓存模块33和判断模块34依次连接。本实施例提供的视频缓存播放装置3可以执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。Wherein, the playing
本实施例提供的设备,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。The device provided in this embodiment can be used to implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.
图9为本公开实施例提供的一种电子设备的结构示意图,如图9所示,该电子设备4包括至少一个处理器41和存储器42;FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG. 9 , the
存储器42存储计算机执行指令;
至少一个处理器41执行存储器42存储的计算机执行指令,使得至少一个处理器41执行如图2-图7所示实施例中的视频缓存播放方法。At least one
其中,处理器41和存储器42通过总线43连接。Wherein, the
相关说明可以对应参见图2-图7所对应的实施例中的步骤所对应的相关描述和效果进行理解,此处不做过多赘述。Relevant descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to FIG. 2 to FIG. 7 , and details are not repeated here.
参考图10,其示出了适于用来实现本公开实施例的电子设备900的结构示意图,该电子设备900可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable MediaPlayer,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图10示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to FIG. 10 , it shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. Wherein, the terminal equipment may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable MediaPlayer (PMP for short), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG. 10 is only an example, and should not limit the functions and application scope of the embodiments of the present disclosure.
如图10所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(Read Only Memory,简称ROM)902中的程序或者从存储装置908加载到随机访问存储器(Random Access Memory,简称RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。As shown in FIG. 10, an electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may be stored in a program in a read-only memory (Read Only Memory, ROM for short) 902 or from a storage device. 908 programs loaded into the Random Access Memory (RAM for short) 903 to execute various appropriate actions and processes. In the
通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(Liquid CrystalDisplay,简称LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图10示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Generally, the following devices can be connected to the I/O interface 905: an
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装,或者从ROM902被安装。在该计算机程序被处理装置901执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 909 , or from storage means 908 , or from
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the methods shown in the above-mentioned embodiments.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LocalArea Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (e.g. using an Internet Service Provider to connect via the Internet).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), System on Chips (SOCs), Complex Programmable Logical device (CPLD) and so on.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(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 conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, 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 discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
第一方面,根据本公开的一个或多个实施例,提供了一种视频缓存播放方法,包括:In a first aspect, according to one or more embodiments of the present disclosure, there is provided a video cache playback method, including:
播放视频资源序列中的第一视频;当检测到针对所述第一视频的第一滑动操作时,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向;其中,所述第一滑动操作用于将所述第一视频切换为所述视频资源序列中与所述第一视频相邻的第二视频进行播放,所述视频缓存方向表征所述视频资源序列中视频资源的播放方向;根据所述视频缓存方向,确定第三视频,并对所述第三视频进行缓存,生成缓存视频,所述第三视频为所述视频资源序列中与所述第二视频沿视频缓存方向相邻的视频;响应于针对所述第二视频的第二滑动操作,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则播放所述缓存视频。Play the first video in the video resource sequence; when detecting the first sliding operation for the first video, determine the video cache direction according to the sliding direction corresponding to the first sliding operation; wherein, the first sliding The operation is used to switch the first video to play a second video adjacent to the first video in the video resource sequence, and the video buffer direction represents the playback direction of video resources in the video resource sequence; According to the video cache direction, determine a third video, and cache the third video to generate a cache video, the third video is adjacent to the second video in the video resource sequence along the video cache direction video; in response to the second sliding operation on the second video, if the playing direction corresponding to the second sliding operation is the same as the playing direction corresponding to the video cache direction, then play the cached video.
根据本公开的一个或多个实施例,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向,包括:获取预设的历史滑动信息,所述历史滑动信息用于表征在所述第一滑动操作前检测到的至少一个第三滑动操作所对应的滑动方向;根据所述历史滑动信息和所述第一滑动操作对应的滑动方向,确定视频缓存方向。According to one or more embodiments of the present disclosure, determining the video cache direction according to the sliding direction corresponding to the first sliding operation includes: acquiring preset historical sliding information, and the historical sliding information is used to represent the A sliding direction corresponding to at least one third sliding operation detected before the sliding operation; determining a video buffering direction according to the historical sliding information and the sliding direction corresponding to the first sliding operation.
根据本公开的一个或多个实施例,所述历史滑动信息包括第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向;根据所述历史滑动信息和所述第一滑动操作对应的滑动方向,确定视频缓存方向,包括:若所述第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向均与所述第一滑动操作对应的滑动相同,则将所述第一滑动操作对应的滑动方向确定为视频缓存方向。According to one or more embodiments of the present disclosure, the historical sliding information includes the sliding direction corresponding to the third sliding operation that is a preset number of consecutive times before the first sliding operation; according to the historical sliding information corresponding to the first sliding operation determine the direction of the video cache, including: if the sliding directions corresponding to the third sliding operations that are consecutively preset times before the first sliding operation are the same as the sliding directions corresponding to the first sliding operation, then A sliding direction corresponding to a sliding operation is determined as a video buffering direction.
根据本公开的一个或多个实施例,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向,包括:获取预设的滑动预测模型,所述滑动预测模型为用于预测第一滑动操作之后的第二滑动操作对应的滑动方向的预训练模型;根据所述滑动预测模型,确定所述第一滑动操作之后的第二滑动操作对应的滑动方向的置信值;若所述置信值大于预设值,则将所述滑动预测模型输出的所述第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向。According to one or more embodiments of the present disclosure, determining the video cache direction according to the sliding direction corresponding to the first sliding operation includes: obtaining a preset sliding prediction model, the sliding prediction model is used to predict the first sliding A pre-trained model of the sliding direction corresponding to the second sliding operation after the operation; according to the sliding prediction model, determine the confidence value of the sliding direction corresponding to the second sliding operation after the first sliding operation; if the confidence value is greater than preset value, the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model is determined as the video buffering direction.
根据本公开的一个或多个实施例,在将所述滑动预测模型输出的所述第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向之后,所述方法还包括:根据所述第一滑动操作之后的第二滑动操作对应的滑动方向的置信值,确定视频缓存量;对所述第三视频进行缓存,包括:根据所述视频缓存量,对所述第三视频进行缓存。According to one or more embodiments of the present disclosure, after the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model is determined as the video cache direction, the method further includes: According to the confidence value of the sliding direction corresponding to the second sliding operation after the first sliding operation, determine the video buffering amount; caching the third video includes: according to the video buffering amount, storing the third video for caching.
根据本公开的一个或多个实施例,根据所述视频缓存方向,确定第三视频,包括:根据所述视频资源序列,确定视频排序信息,所述视频排序信息用于表征所述视频资源序列中的各视频的位置排序;根据所述视频排序信息,确定所述第二视频在所述视频资源序列中的位置排序;根据所述第二视频在所述视频资源序列中的位置排序,以及所述视频缓存方向,确定第三视频。According to one or more embodiments of the present disclosure, determining the third video according to the video cache direction includes: determining video sorting information according to the video resource sequence, and the video sorting information is used to characterize the video resource sequence The position ordering of each video in the video; according to the video ordering information, determine the positional ordering of the second video in the video resource sequence; according to the positional ordering of the second video in the video resource sequence, and The video cache direction determines the third video.
根据本公开的一个或多个实施例,所述第三视频包括所述视频资源序列中的多个连续的视频;根据所述第二视频在所述视频资源序列中的位置排序,以及所述视频缓存方向,确定第三视频,包括:获取预设的缓存参数,所述缓存参数用于表征所述第三视频所包括的视频的数量;根据所述缓存参数,将所述第二视频沿所述视频缓存方向相邻的预设数量的视频,确定为第三视频。According to one or more embodiments of the present disclosure, the third video includes a plurality of consecutive videos in the video resource sequence; sorted according to the position of the second video in the video resource sequence, and the The direction of video caching is to determine the third video, including: obtaining a preset buffer parameter, which is used to characterize the number of videos included in the third video; according to the buffer parameter, the second video along A preset number of videos adjacent to the video cache direction are determined as the third video.
根据本公开的一个或多个实施例,所述方法还包括:获取所述第一视频的内容信息,所述内容信息表征所述第一视频的视频内容类别;根据所述第一视频的内容信息和所述第一视频的播放时长,确定视频缓存量;对所述第三视频进行缓存,包括:根据所述视频缓存量,对所述第三视频进行缓存。According to one or more embodiments of the present disclosure, the method further includes: acquiring content information of the first video, the content information characterizing the video content category of the first video; according to the content of the first video Information and the playing duration of the first video to determine a video cache amount; caching the third video includes: buffering the third video according to the video cache amount.
根据本公开的一个或多个实施例,根据所述第一视频的内容信息和所述第一视频的播放时长,确定视频缓存量,包括:获取所述第三视频的内容信息;根据所述第三视频的内容信息和所述第二视频的内容信息,确定预测播放时长;根据所述预测播放时长,确定视频缓存量。According to one or more embodiments of the present disclosure, determining the video cache amount according to the content information of the first video and the playing duration of the first video includes: acquiring the content information of the third video; according to the The content information of the third video and the content information of the second video determine the predicted playback duration; and determine the video cache amount according to the predicted playback duration.
第二方面,根据本公开的一个或多个实施例,提供了一种视频缓存播放装置,包括:In a second aspect, according to one or more embodiments of the present disclosure, a video cache playback device is provided, including:
播放模块,用于播放视频资源序列中的第一视频;A playback module, configured to play the first video in the video resource sequence;
确定模块,用于当检测到针对所述第一视频的第一滑动操作时,根据所述第一滑动操作对应的滑动方向,确定视频缓存方向;其中,所述第一滑动操作用于将所述第一视频切换为所述视频资源序列中与所述第一视频相邻的第二视频进行播放,所述视频缓存方向表征所述视频资源序列中视频资源的播放方向;The determination module is configured to determine the video cache direction according to the sliding direction corresponding to the first sliding operation when the first sliding operation for the first video is detected; wherein the first sliding operation is used to The first video is switched to play a second video adjacent to the first video in the video resource sequence, and the video buffer direction represents the playback direction of the video resource in the video resource sequence;
缓存模块,用于根据所述视频缓存方向,确定第三视频,并对所述第三视频进行缓存,生成缓存视频,所述第三视频为所述视频资源序列中与所述第二视频沿视频缓存方向相邻的视频;A caching module, configured to determine a third video according to the video caching direction, and cache the third video to generate a cached video, the third video being in the video resource sequence along with the second video Adjacent videos in the video cache direction;
判断模块,用于响应于针对所述第二视频的第二滑动操作,若所述第二滑动操作对应的播放方向与所述视频缓存方向对应的播放方向相同,则播放所述缓存视频。A judging module, configured to, in response to a second sliding operation on the second video, play the cached video if the playback direction corresponding to the second sliding operation is the same as the playback direction corresponding to the video cache direction.
根据本公开的一个或多个实施例,所述确定模块在根据所述第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:获取预设的历史滑动信息,所述历史滑动信息用于表征在所述第一滑动操作前检测到的至少一个第三滑动操作所对应的滑动方向;根据所述历史滑动信息和所述第一滑动操作对应的滑动方向,确定视频缓存方向。According to one or more embodiments of the present disclosure, when the determining module determines the video cache direction according to the sliding direction corresponding to the first sliding operation, it is specifically configured to: acquire preset historical sliding information, the historical sliding The information is used to represent a sliding direction corresponding to at least one third sliding operation detected before the first sliding operation; and the video buffering direction is determined according to the historical sliding information and the sliding direction corresponding to the first sliding operation.
根据本公开的一个或多个实施例,所述历史滑动信息包括第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向;所述确定模块在根据所述历史滑动信息和所述第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:若所述第一滑动操作前连续预设次数的第三滑动操作对应的滑动方向均与所述第一滑动操作对应的滑动相同,则将所述第一滑动操作对应的滑动方向确定为视频缓存方向。According to one or more embodiments of the present disclosure, the historical sliding information includes the sliding direction corresponding to the third sliding operation that is a preset number of consecutive times before the first sliding operation; the determination module is based on the historical sliding information and the The sliding direction corresponding to the first sliding operation, when determining the direction of the video cache, is specifically used for: if the sliding directions corresponding to the third sliding operations that are consecutively preset times before the first sliding operation are all corresponding to the first sliding operation If the slides are the same, the slide direction corresponding to the first slide operation is determined as the video cache direction.
根据本公开的一个或多个实施例,所述确定模块在根据所述第一滑动操作对应的滑动方向,确定视频缓存方向时,具体用于:获取预设的滑动预测模型,所述滑动预测模型为用于预测第一滑动操作之后的第二滑动操作对应的滑动方向的预训练模型;根据所述滑动预测模型,确定所述第一滑动操作之后的第二滑动操作对应的滑动方向的置信值;若所述置信值大于预设值,则将所述滑动预测模型输出的所述第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向。According to one or more embodiments of the present disclosure, when the determining module determines the direction of the video cache according to the sliding direction corresponding to the first sliding operation, it is specifically configured to: obtain a preset sliding prediction model, the sliding prediction The model is a pre-training model used to predict the sliding direction corresponding to the second sliding operation after the first sliding operation; according to the sliding prediction model, determine the confidence of the sliding direction corresponding to the second sliding operation after the first sliding operation value; if the confidence value is greater than a preset value, the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model is determined as the video buffering direction.
根据本公开的一个或多个实施例,所述确定模块在在将所述滑动预测模型输出的所述第一滑动操作之后的第二滑动操作对应的播放方向,确定为视频缓存方向之后,还用于:根据所述第一滑动操作之后的第二滑动操作对应的滑动方向的置信值,确定视频缓存量;According to one or more embodiments of the present disclosure, after the determination module determines the playback direction corresponding to the second sliding operation after the first sliding operation output by the sliding prediction model as the video cache direction, further It is used for: determining the video cache amount according to the confidence value of the sliding direction corresponding to the second sliding operation after the first sliding operation;
根据本公开的一个或多个实施例,所述缓存模块在对所述第三视频进行缓存时,具体用于:根据所述视频缓存量,对所述第三视频进行缓存。According to one or more embodiments of the present disclosure, when the cache module caches the third video, it is specifically configured to: cache the third video according to the video cache amount.
根据本公开的一个或多个实施例,所述缓存模块在根据所述视频缓存方向,确定第三视频时,具体用于:根据所述视频资源序列,确定视频排序信息,所述视频排序信息用于表征所述视频资源序列中的各视频的位置排序;根据所述视频排序信息,确定所述第二视频在所述视频资源序列中的位置排序;根据所述第二视频在所述视频资源序列中的位置排序,以及所述视频缓存方向,确定第三视频。According to one or more embodiments of the present disclosure, when the caching module determines the third video according to the video caching direction, it is specifically configured to: determine video sorting information according to the video resource sequence, and the video sorting information It is used to characterize the position order of each video in the video resource sequence; according to the video order information, determine the position order of the second video in the video resource sequence; according to the position order of the second video in the video The sequence of positions in the resource sequence, and the direction of the video cache, determine the third video.
根据本公开的一个或多个实施例,所述第三视频包括所述视频资源序列中的多个连续的视频;所述缓存模块在根据所述第二视频在所述视频资源序列中的位置排序,以及所述视频缓存方向,确定第三视频时,具体用于:获取预设的缓存参数,所述缓存参数用于表征所述第三视频所包括的视频的数量;根据所述缓存参数,将所述第二视频沿所述视频缓存方向相邻的预设数量的视频,确定为第三视频。According to one or more embodiments of the present disclosure, the third video includes a plurality of consecutive videos in the video resource sequence; the cache module is configured according to the position of the second video in the video resource sequence Sorting, and the video cache direction, when determining the third video, are specifically used to: acquire a preset cache parameter, the cache parameter is used to characterize the number of videos included in the third video; according to the cache parameter , determining a preset number of videos adjacent to the second video along the video buffer direction as the third video.
根据本公开的一个或多个实施例,所述缓存模块还用于:获取所述第一视频的内容信息,所述内容信息表征所述第一视频的视频内容类别;根据所述第一视频的内容信息和所述第一视频的播放时长,确定视频缓存量;According to one or more embodiments of the present disclosure, the cache module is further configured to: obtain content information of the first video, the content information characterizes the video content category of the first video; The content information of the content information and the playing duration of the first video, determine the video cache amount;
根据本公开的一个或多个实施例,所述缓存模块在对所述第三视频进行缓存时,具体用于:根据所述视频缓存量,对所述第三视频进行缓存。According to one or more embodiments of the present disclosure, when the cache module caches the third video, it is specifically configured to: cache the third video according to the video cache amount.
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器和存储器;所述存储器存储计算机执行指令;所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, including: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the memory stored A computer executes instructions, so that the at least one processor executes the video cache playback method described in the first aspect and various possible designs of the first aspect.
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, Realize the video cache playback method described in the above first aspect and various possible designs of the first aspect.
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的视频缓存播放方法。In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the video cache playback method described in the above first aspect and various possible designs of the first aspect is implemented.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims (11)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111020673.XA CN113727172B (en) | 2021-09-01 | 2021-09-01 | Video cache playback method, device, electronic device and storage medium |
PCT/CN2022/108054 WO2023029821A1 (en) | 2021-09-01 | 2022-07-26 | Video buffer playing method and apparatus, and electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111020673.XA CN113727172B (en) | 2021-09-01 | 2021-09-01 | Video cache playback method, device, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113727172A CN113727172A (en) | 2021-11-30 |
CN113727172B true CN113727172B (en) | 2023-02-28 |
Family
ID=78680550
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111020673.XA Active CN113727172B (en) | 2021-09-01 | 2021-09-01 | Video cache playback method, device, electronic device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN113727172B (en) |
WO (1) | WO2023029821A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113727172B (en) * | 2021-09-01 | 2023-02-28 | 北京字跳网络技术有限公司 | Video cache playback method, device, electronic device and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8776158B1 (en) * | 2009-09-30 | 2014-07-08 | Emc Corporation | Asynchronous shifting windows caching for forward and backward video streaming |
CN107888981A (en) * | 2017-11-16 | 2018-04-06 | 北京小米移动软件有限公司 | Audio frequency and video preload method, apparatus, equipment and storage medium |
CN108965907A (en) * | 2018-07-11 | 2018-12-07 | 北京字节跳动网络技术有限公司 | For playing the methods, devices and systems of video |
CN110996134A (en) * | 2019-12-23 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Video playing method, device and storage medium |
WO2021052085A1 (en) * | 2019-09-20 | 2021-03-25 | 北京字节跳动网络技术有限公司 | Video recommendation method and apparatus, electronic device and computer-readable medium |
CN112738633A (en) * | 2020-12-25 | 2021-04-30 | 广州繁星互娱信息科技有限公司 | Video playing method, device, equipment and readable storage medium |
CN112887797A (en) * | 2019-11-29 | 2021-06-01 | 腾讯科技(深圳)有限公司 | Method for controlling video playing and related equipment |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9100618B2 (en) * | 2013-06-17 | 2015-08-04 | Spotify Ab | System and method for allocating bandwidth between media streams |
US11166080B2 (en) * | 2017-12-21 | 2021-11-02 | Facebook, Inc. | Systems and methods for presenting content |
CN110809168A (en) * | 2018-08-06 | 2020-02-18 | 中兴通讯股份有限公司 | Video live broadcast processing method and device, terminal and storage medium |
CN110012339B (en) * | 2019-04-11 | 2021-02-12 | 北京字节跳动网络技术有限公司 | Video playing and displaying method, device, equipment and storage medium |
CN113727172B (en) * | 2021-09-01 | 2023-02-28 | 北京字跳网络技术有限公司 | Video cache playback method, device, electronic device and storage medium |
-
2021
- 2021-09-01 CN CN202111020673.XA patent/CN113727172B/en active Active
-
2022
- 2022-07-26 WO PCT/CN2022/108054 patent/WO2023029821A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8776158B1 (en) * | 2009-09-30 | 2014-07-08 | Emc Corporation | Asynchronous shifting windows caching for forward and backward video streaming |
CN107888981A (en) * | 2017-11-16 | 2018-04-06 | 北京小米移动软件有限公司 | Audio frequency and video preload method, apparatus, equipment and storage medium |
CN108965907A (en) * | 2018-07-11 | 2018-12-07 | 北京字节跳动网络技术有限公司 | For playing the methods, devices and systems of video |
WO2021052085A1 (en) * | 2019-09-20 | 2021-03-25 | 北京字节跳动网络技术有限公司 | Video recommendation method and apparatus, electronic device and computer-readable medium |
CN112887797A (en) * | 2019-11-29 | 2021-06-01 | 腾讯科技(深圳)有限公司 | Method for controlling video playing and related equipment |
CN110996134A (en) * | 2019-12-23 | 2020-04-10 | 腾讯科技(深圳)有限公司 | Video playing method, device and storage medium |
CN112738633A (en) * | 2020-12-25 | 2021-04-30 | 广州繁星互娱信息科技有限公司 | Video playing method, device, equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2023029821A1 (en) | 2023-03-09 |
CN113727172A (en) | 2021-11-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111510760B (en) | Video information display method and device, storage medium and electronic equipment | |
US9380093B2 (en) | Mobile device application streaming | |
CN111666497B (en) | Application program loading method, device, electronic device and readable storage medium | |
WO2020133377A1 (en) | Method and device for video previewing, electronic equipment, and computer-readable storage medium | |
CN112135169B (en) | Media content loading method, device, equipment and medium | |
CN111488185B (en) | Page data processing method, device, electronic equipment and readable medium | |
JP7735591B2 (en) | Media content display method, device, equipment, storage medium, and program | |
CN111258736B (en) | Information processing methods, devices and electronic equipment | |
CN111400625A (en) | Page processing method and device, electronic equipment and computer readable storage medium | |
WO2023134559A1 (en) | Comment prompting method and apparatus, and electronic device, storage medium and program product | |
WO2022134997A1 (en) | Video jump playback method and apparatus, terminal device, and storage medium | |
JP2024545639A (en) | VIDEO PROCESSING METHOD, APPARATUS, ELECTRONIC DEVICE, AND STORAGE MEDIUM | |
US20250287025A1 (en) | Method, apparatus, device and storage medium for video transcoding | |
CN112578897B (en) | Control method, device, terminal and storage medium of electronic device | |
JP2025522503A (en) | Multimedia information presentation method, device and electronic device | |
CN113727172B (en) | Video cache playback method, device, electronic device and storage medium | |
WO2022188618A1 (en) | Resource preloading method, apparatus and device, and storage medium | |
CN116319932A (en) | Training method, device, equipment and storage medium of content push model | |
CN115802104A (en) | Video skip playing method and device, electronic equipment and storage medium | |
CN114630157A (en) | Live broadcast start method, equipment and program product | |
US20230276079A1 (en) | Live streaming room page jump method and apparatus, live streaming room page return method and apparatus, and electronic device | |
US20250165263A1 (en) | Application start method, apparatus, electronic device, storage medium and program product | |
WO2024140126A1 (en) | Online video editing method and apparatus, and electronic device and storage medium | |
CN113986849B (en) | Music caching method, device, electronic device and storage medium | |
WO2023138671A1 (en) | Comment processing method, and device |
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 |