Cache control method, device, electronic device and storage medium
By obtaining predicted bandwidth and retention information and dynamically adjusting the video cache duration, the contradiction between video caching and playback is resolved, and the rational use of cache resources and the guarantee of video smoothness are achieved.
Patent Information
- Application Number
- CN202310114385.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-29
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2043-01-29
AI Technical Summary
In the prior art, the contradiction between video caching and video playback leads to cache waste and video freeze, which are difficult to solve effectively, especially in an unstable network environment.
By obtaining predicted bandwidth information and predicted retention information, the cache duration of the target video is dynamically adjusted to control cache downloads. Combined with network conditions and user retention information, reasonable cache management is achieved.
It effectively avoids cache waste, ensures smooth video viewing, adapts to viewing needs in various network environments, and saves bandwidth resources.
Smart Images

Figure CN116248766B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a cache control method, device, electronic device, and storage medium. Background Art
[0002] With the increasing use of interactive video applications, such as short video interactions, videos are being cached in advance to provide a smooth video browsing experience and avoid black screens when users scroll. However, caching video content that may be viewed in the future conflicts with continuing to download the content of the current video. While caching new videos reduces lag during video scrolling, it may prevent the current video from playing smoothly, and vice versa. Furthermore, caching too much data that users haven't viewed can result in significant data waste, significantly increasing the operating costs of content service providers. Summary of the Invention
[0003] The present disclosure provides a cache control method, device, electronic device, and storage medium to at least solve the problem of how to avoid cache waste while ensuring smooth video viewing in related technologies. The technical solutions of the present disclosure are as follows:
[0004] According to a first aspect of an embodiment of the present disclosure, a cache control method is provided, including:
[0005] In response to a cache download event of a to-be-cached video segment of a target video, obtaining predicted bandwidth information and predicted retention information of a target object to the to-be-cached video segment; the target object is an object browsing the target video or browsing a video sequence to which the target video belongs;
[0006] Determining a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information; wherein the target cache duration is negatively correlated with the predicted bandwidth information and positively correlated with the predicted retention information;
[0007] Based on the target cache duration and the current cache duration of the target video under the target object, the cache download of the to-be-cached video segment is controlled.
[0008] In a possible implementation, controlling the downloading of the to-be-cached video segment based on the target cache duration and the current cache duration of the target video under the target object includes:
[0009] If the current cache duration is less than the target cache duration, downloading the video segment to be cached;
[0010] When the current cache duration is greater than or equal to the target cache duration, the video segment to be cached is controlled to be in a paused download state.
[0011] In a possible implementation, obtaining predicted retention information of the target object in the to-be-cached video segment includes:
[0012] Obtaining first preset retention information corresponding to a first progress of the target video and second preset retention information corresponding to a second progress of the target video; the first progress is the progress of the target video that the target subject has watched, and the second progress is the progress of the video clip to be cached in the target video;
[0013] According to the first preset retention information and the second preset retention information, a probability that the target object is retained to the second progress of the target video is determined as the predicted retention information.
[0014] In one possible implementation, determining, based on the first preset retention information and the second preset retention information, a probability that the target object is retained at the second progress of the target video as the predicted retention information includes:
[0015] The ratio of the second preset retention information to the first preset retention information is used as the predicted retention information.
[0016] In a possible implementation, obtaining the predicted bandwidth information includes:
[0017] Obtaining historical download bandwidth information corresponding to the target object;
[0018] Performing statistical processing on the historical download bandwidth information to obtain historical bandwidth statistical information;
[0019] The predicted bandwidth information is determined according to the historical bandwidth statistical information.
[0020] In a possible implementation, determining the predicted bandwidth information according to the historical bandwidth statistical information includes:
[0021] Obtaining historical predicted bandwidth information corresponding to the target object;
[0022] Determining bandwidth prediction error information based on the historical predicted bandwidth information and the historical download bandwidth information;
[0023] The historical bandwidth statistical information is adjusted based on the bandwidth prediction error information to obtain the predicted bandwidth information; the predicted bandwidth information is negatively correlated with the bandwidth prediction error information.
[0024] In a possible implementation, determining a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information includes:
[0025] Obtaining a target data volume of the video clip to be cached;
[0026] Obtaining a first cache duration according to the target data volume and the predicted bandwidth information;
[0027] The target cache duration is determined according to the first cache duration and the predicted retention information.
[0028] In a possible implementation, determining the target cache duration according to the first cache duration and the predicted retention information includes:
[0029] Obtaining a second cache duration according to the first cache duration and the predicted retention information;
[0030] Get the cache duration lower limit information;
[0031] The larger one of the cache duration lower limit information and the second cache duration is used as the target cache duration.
[0032] In a possible implementation, the target video is any video in a video sequence; and obtaining the cache duration lower limit information includes:
[0033] Obtaining a currently watched video of the target object, where the currently watched video is any video in the video sequence;
[0034] Determining a position distance between a first position of the target video in the video sequence and a second position of the currently viewed video in the video sequence;
[0035] The cache duration lower limit information is acquired according to the location distance and the predicted bandwidth information; the cache duration lower limit information is negatively correlated with the location distance; and the cache duration lower limit information is also negatively correlated with the predicted bandwidth information.
[0036] According to a second aspect of an embodiment of the present disclosure, a cache control device is provided, including:
[0037] an acquisition module configured to execute a cache download event in response to a to-be-cached video segment of a target video, and acquire predicted bandwidth information and predicted retention information of a target object to the to-be-cached video segment; the target object being an object browsing the target video or browsing a video sequence to which the target video belongs;
[0038] a target cache duration determination module configured to determine a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information; the target cache duration is negatively correlated with the predicted bandwidth information and positively correlated with the predicted retention information;
[0039] The cache download control module is configured to control the cache download of the to-be-cached video segment based on the target cache duration and the current cache duration of the target video under the target object.
[0040] In a possible implementation, the cache download control module includes:
[0041] A first cache download control unit is configured to download the video segment to be cached when the current cache duration is less than the target cache duration;
[0042] The second cache download control unit is configured to control the to-be-cached video segment to be in a paused download state when the current cache duration is greater than or equal to the target cache duration.
[0043] In a possible implementation, the acquisition module includes:
[0044] The preset retention acquisition unit is configured to acquire first preset retention information corresponding to a first progress of the target video and second preset retention information corresponding to a second progress of the target video; the first progress is the progress of the target video that the target subject has watched, and the second progress is the progress of the video clip to be cached in the target video;
[0045] The predicted retention information determining unit is configured to determine, based on the first preset retention information and the second preset retention information, a probability that the target object is retained to the second progress of the target video, as the predicted retention information.
[0046] In a possible implementation, the predicted retention information determining unit includes:
[0047] The predicted retention information determining subunit is configured to use the ratio information of the second preset retention information to the first preset retention information as the predicted retention information.
[0048] In a possible implementation, the acquisition module includes:
[0049] A historical download bandwidth information acquiring unit is configured to acquire historical download bandwidth information corresponding to the target object;
[0050] a historical bandwidth statistics unit, configured to perform statistical processing on the historical download bandwidth information to obtain historical bandwidth statistics information;
[0051] The bandwidth prediction unit is configured to determine the predicted bandwidth information according to the historical bandwidth statistical information.
[0052] In a possible implementation, the bandwidth prediction unit includes:
[0053] The historical predicted bandwidth information acquisition subunit is configured to acquire historical predicted bandwidth information within a historical period;
[0054] a bandwidth prediction error determining subunit, configured to determine bandwidth prediction error information based on the historical predicted bandwidth information and the historical download bandwidth information;
[0055] The predicted bandwidth information acquisition subunit is configured to adjust the historical bandwidth statistical information based on the bandwidth prediction error information to obtain the predicted bandwidth information; the predicted bandwidth information is negatively correlated with the bandwidth prediction error information.
[0056] In a possible implementation, the target cache duration determination module includes:
[0057] a data volume obtaining unit, configured to obtain a target data volume of the video segment to be cached;
[0058] A first cache duration obtaining unit is configured to obtain a first cache duration according to the target data volume and the predicted bandwidth information;
[0059] The target cache duration determining unit is configured to determine the target cache duration according to the first cache duration and the predicted retention information.
[0060] In a possible implementation, the target cache duration determining unit includes:
[0061] A second cache duration acquisition subunit is configured to obtain a second cache duration according to the first cache duration and the predicted retention information;
[0062] The cache duration lower limit obtaining subunit is configured to obtain cache duration lower limit information;
[0063] The duration determination subunit is configured to use the larger one of the cache duration lower limit information and the second cache duration as the target cache duration.
[0064] In a possible implementation, the target video is any video in a video sequence; and the cache duration lower limit obtaining subunit includes:
[0065] a currently watched video acquisition subunit, configured to acquire a currently watched video of the target object, where the currently watched video is any video in the video sequence;
[0066] a position distance determining subunit, configured to determine a position distance between a first position of the target video in the video sequence and a second position of the currently viewed video in the video sequence;
[0067] The cache duration lower limit information acquisition subunit is configured to execute, based on the location distance and the predicted bandwidth information, acquisition of the cache duration lower limit information; the cache duration lower limit information is negatively correlated with the location distance; the cache duration lower limit information is also negatively correlated with the predicted bandwidth information.
[0068] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement a method as described in any one of the first aspects above.
[0069] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is capable of executing any method described in the first aspect of the embodiment of the present disclosure.
[0070] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which, when executed by a processor, enable a computer to execute any one of the methods according to the first aspect of the embodiment of the present disclosure.
[0071] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
[0072] By responding to cache download events, the system obtains predicted bandwidth information and predicted retention information of the target object in the video segment to be cached. Based on the predicted retention information and predicted bandwidth information, the target cache duration corresponding to the target video can be determined to control cache downloads. This more reasonable and flexible target cache duration, determined by combining network conditions and the user's retention information for the video, is used to control the cache download of the video segment to be cached. This dynamically balances cache waste and video lag, avoiding cache waste while ensuring smooth video viewing. It can adapt to viewing flow requirements in various network environments and conserve bandwidth resources.
[0073] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0075] Figure 1 It is a schematic diagram showing an application environment according to an exemplary embodiment.
[0076] Figure 2 The figure is a flowchart showing a cache control method according to an exemplary embodiment.
[0077] Figure 3 The diagram is a schematic diagram showing an architecture of cache control according to an exemplary embodiment.
[0078] Figure 4 The present invention is a flowchart of a method for obtaining predicted retention information of a target object in a video segment to be cached according to an exemplary embodiment.
[0079] Figure 5 The figure is a flow chart of a method for obtaining predicted bandwidth information according to an exemplary embodiment.
[0080] Figure 6 The figure is a block diagram of a cache control device according to an exemplary embodiment.
[0081] Figure 7 The present invention is a block diagram of an electronic device for cache control according to an exemplary embodiment.
[0082] Figure 8 is a block diagram of another electronic device for cache control according to an exemplary embodiment. DETAILED DESCRIPTION
[0083] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
[0084] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.
[0085] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0086] In recent years, with the research and progress of artificial intelligence technology, artificial intelligence technology has been widely used in many fields. The solutions provided in the embodiments of this application involve technologies such as machine learning and deep learning, which are specifically described through the following embodiments:
[0087] See also Figure 1 , Figure 1 is a schematic diagram showing an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a server 01 and a terminal 02 .
[0088] In an optional embodiment, server 01 can be used to provide target video data and preset retention information. Specifically, server 01 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0089] In an optional embodiment, terminal 02 can be used for cache control processing. Specifically, terminal 02 may include, but is not limited to, electronic devices such as smartphones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android, iOS, Linux, Windows, and the like.
[0090] In addition, it should be noted that Figure 1 The example shown is only one application environment of the cache control method provided by the present disclosure. Optionally, the server can also perform cache control processing, thereby sending the result of whether to cache the download to the terminal side, which is not limited by the present disclosure.
[0091] In the embodiments of this specification, the server 01 and the terminal 02 may be connected directly or indirectly via wired or wireless communication, and this application does not impose any limitation thereto.
[0092] It should be noted that the following figure shows a possible order of steps, which is not actually limited to this order. Some steps can be executed in parallel without relying on each other. The user information (including but not limited to user device information, user personal information, user behavior information, etc.) and data (including but not limited to data for display, data for training, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0093] Figure 2 FIG. 1 is a flow chart showing a cache control method according to an exemplary embodiment. Figure 2 As shown, the following steps may be included.
[0094] In step S201 , in response to a cache download event of a to-be-cached video segment of a target video, predicted bandwidth information and predicted retention information of a target object to the to-be-cached video segment are obtained.
[0095] In the embodiments of this specification, the target object can be an object browsing the target video or browsing the video sequence to which the target video belongs, that is, the target object can be an object browsing the target video, or can be an object browsing any video in the video sequence to which the target video belongs. The target object can refer to the user account corresponding to the target terminal. The target video can be any video in the video platform, for example, the target video can refer to the video currently being watched by the target object, or can refer to any video in the video sequence. As an example, the target video can be a short video or a long video, which is not limited in this disclosure.
[0096] The video segment to be cached of the target video may refer to the video segment to be cached and downloaded, that is, it may be the video segment corresponding to the second progress of the target video. For example, the progress at which the target video has been displayed (played) may be referred to as the first progress. In actual applications, the current cache length of the target video under the target object may be 0 seconds, or may be greater than 0 seconds, that is, there may be a cache of a certain length. Based on this, the video segment to be cached may be the video segment between the third progress and the second progress, wherein the third progress may refer to the termination progress corresponding to the current cache length, such as Figure 3 As shown in n. Figure 3 As shown, in the progress t direction, the video segments between n and m can be regarded as video segments to be cached, and m can represent the second progress.
[0097] It should be noted that the above-mentioned progress, displayed, etc. are all relative to the target object.
[0098] The predicted bandwidth information may refer to the predicted bandwidth information for downloading the video clip to be cached, i.e., the predicted bandwidth information corresponding to the second progress. The predicted retention information may refer to the predicted retention information of the target object until the video clip to be cached, i.e., the predicted retention information of the second progress at which the target object can watch the target video, such as retention probability information.
[0099] In the embodiments of this specification, a cache download event can be triggered each time a to-be-cached video segment needs to be downloaded. Accordingly, in response to the cache download event for the to-be-cached video segment of the target video, predicted bandwidth information and predicted retention information of the target object for the to-be-cached video segment can be obtained. As an example, the cache download event can be triggered periodically, which is not limited in this disclosure.
[0100] In one example, the current download bandwidth information can be used as the predicted bandwidth information. Alternatively, the actual bandwidth information recorded in a historical period and the current bandwidth information can be statistically processed to obtain the predicted bandwidth information. The historical period can be pre-set, which is not limited in this disclosure. For example, the end time of the historical period can be the current time, and the duration of the historical period can be a preset duration, such as 5 seconds, which is not limited in this disclosure. The statistical processing can be averaging, selecting the smaller value, etc., which is not limited in this disclosure.
[0101] In another example, object feature information of the target object and video feature information of the target video can be obtained. This object feature information and video feature information can then be input into a retention prediction model for retention prediction processing to obtain predicted retention information. The object feature information can represent attribute information and / or interest information of the target object, and the attribute information of the target object can include, for example, the target object's account number. The video feature information can represent attribute information of the video, such as the video content type. This disclosure is not limited to these.
[0102] The retention prediction model may be obtained by pre-training a preset neural network model based on sample object information, sample video feature information, and label information of the sample object. The label information may be retention information, such as retention probability, retention duration, etc., which is not limited in this disclosure.
[0103] In step S203, a target cache duration corresponding to the target video is determined based on the predicted retention information and the predicted bandwidth information.
[0104] The target cache duration may be negatively correlated with the predicted bandwidth information, and the target cache duration may be positively correlated with the predicted retention information.
[0105] In one possible implementation, a target data volume of the video clip to be cached can be obtained; and a first cache duration can be obtained based on the target data volume and the predicted bandwidth information. For example, the first cache duration can be obtained by dividing the target data volume by the predicted bandwidth information. The target data volume can be information about the bytes occupied by the video clip to be cached. For example, the first cache duration can be obtained using the following formula (1).
[0106]
[0107] Among them, T i,m is the first cache duration; C i,m The target data size of the video clip to be cached. is the predicted bandwidth information. In the case where the target video belongs to a video sequence, the video segment to be cached may refer to the video segment corresponding to the mth second of the i-th video in the video sequence, then T i,m is the first cache duration corresponding to the i-th video; if the video sequence includes N videos, i can be an integer greater than or equal to 1 and less than or equal to N, and N can be an integer greater than or equal to 1. m refers to the second progress of the target video, for example, the mth second.
[0108] Furthermore, the target cache duration can be determined based on the first cache duration and the predicted retention information. For example, the target cache duration can be obtained by the following formula (2).
[0109] b i,m =P i,m (m c )×T i,m (2)
[0110] Among them, b i,m Target cache duration; P i,m (m c ) is m c Predicted retention information under progress, such as target retention probability; m c Refers to the first progress. i,m is the first cache duration. In the case where the target video belongs to a video sequence, the video segment to be cached may refer to the video segment corresponding to the mth second of the i-th video in the video sequence, then b i,m is the target cache duration corresponding to the i-th video. If the video sequence includes N videos, i can be an integer greater than or equal to 1 and less than or equal to N, and N can be an integer greater than or equal to 1. m refers to the second progress of the target video, that is, the m-th second.
[0111] Optionally, considering that when the predicted bandwidth information approaches infinity, the download time will approach zero, causing the target cache duration obtained according to the above formula (3) to approach zero, which cannot effectively cope with sudden network jitter. Based on this, as an example, the second cache duration can be obtained based on the first cache duration and the predicted retention information; and the cache duration lower limit information can be obtained; so that the larger of the cache duration lower limit information and the second cache duration can be used as the target cache duration. For example, the following formula (3) can be selected to determine the target cache duration:
[0112]
[0113] Among them, b i,m Target cache duration; P i,m (m c ) is the predicted retention information, such as the target retention probability; m c Refers to the first progress. i,m (m c )×T i,m is the second cache duration; Refers to the lower limit of the cache duration, which can be pre-set, for example, based on statistics, and is not limited in this disclosure. When the target video is part of a video sequence, the video segment to be cached can refer to the video segment corresponding to the mth second of the i-th video in the video sequence. If the video sequence includes N videos, i can be an integer greater than or equal to 1 and less than or equal to N, and N can be an integer greater than or equal to 1. m refers to the second progress of the target video, that is, the mth second.
[0114] By combining predicted retention information and predicted bandwidth information to determine the target cache duration corresponding to the target video, not only can the dynamic flexibility of determining the target cache duration be improved, but a certain amount of cache can also be guaranteed based on the lower limit of the cache duration information. This can effectively cope with network jitter and effectively adapt to the retention of the target object to avoid cache waste.
[0115] It should be noted that, in the case where the target video is any video in a video sequence, as an optional real-time method, obtaining the cache duration lower limit information may include: obtaining the currently viewed video of the target object, which may be any video in the video sequence; and determining the position distance between the first position of the target video in the video sequence and the second position of the currently viewed video in the video sequence. Furthermore, the cache duration lower limit information may be obtained based on the position distance and the predicted bandwidth information. In one example, the cache duration lower limit information may be negatively correlated with the position distance. That is, the greater the position distance between the target video and the currently viewed video, the lower the cache duration lower limit information. This is more in line with the viewing habits of video sequences and avoids cache waste.
[0116] That is, considering that different videos have different positions in the video sequence, the earlier the video is, the easier it is for the user to watch it, and the higher the bandwidth, the smaller the amount of data cached locally should be. Therefore, the present disclosure considers applying different video numbers and different bandwidths to the acquisition of the lower limit information of the cache duration, that is, the position distance and predicted bandwidth information can be applied to the acquisition of the lower limit information of the cache duration. As an example, assuming that the number of the currently watched video is i c , then for target video i, where i≥i c , the cache duration lower limit information can be expressed as the following formula (4):
[0117]
[0118] in, Refers to the lower limit of cache duration; To predict bandwidth information; (ii c ) refers to the distance between locations, e.g. Figure 3 As shown, i c Refers to video 1, i can be 1 to N; for example, when i is 3, the position distance can be 3-1=2. λ1 and λ2 can be preset constant parameters, and λ1 and λ2 can be greater than or equal to 0.
[0119] In step S205 , the cache download of the video segment to be cached is controlled based on the target cache duration and the current cache duration of the target video under the target object.
[0120] In the embodiments of this specification, the target cache duration (predicted cache area) and the current cache duration (current cache area) can be compared, so that the cache download of the cached video segment can be controlled based on the comparison result, such as whether to continue the cache download. Specifically, for example, if the current cache duration is less than the target cache duration, the download of the cached video segment can continue. If the current cache duration is not less than the target cache duration, no restriction is imposed.
[0121] In one example, if the current cache duration is less than the target cache duration, the video clip to be cached can be downloaded. If the current cache duration is greater than or equal to the target cache duration, the video clip to be cached can be placed in a paused download state. For example, the download can be paused for a predetermined period of time, waiting for the current cache duration to decrease before resuming. This disclosure does not limit the predetermined period; for example, it can be 1 second. By pausing or resuming the download, the cache download can be precisely controlled dynamically, achieving precise management of the buffer.
[0122] By responding to cache download events, the system obtains predicted bandwidth information and predicted retention information of the target object in the video segment to be cached. Based on the predicted retention information and predicted bandwidth information, the target cache duration corresponding to the target video can be determined to control cache downloads. This more reasonable and flexible target cache duration, determined by combining network conditions and the user's retention information for the video, is used to control the cache download of the video segment to be cached. This dynamically balances cache waste and video lag, avoiding cache waste while ensuring smooth video viewing. It can adapt to viewing flow requirements in various network environments and conserve bandwidth resources.
[0123] Furthermore, when the target video is any video in a video sequence, in any network environment, smooth playback can be guaranteed during the switching process of multiple short videos in the video sequence, and cache resources can be saved. 8.6%, 10.8% and 37.5% of bandwidth resources can be saved in three network environments: weak network, medium network and strong network, respectively; and the cache resources and playback requirements of each short video are effectively and dynamically balanced.
[0124] Figure 4 FIG. 1 is a flow chart of a method for obtaining predicted retention information of a target object in a video segment to be cached according to an exemplary embodiment. In a possible implementation, as shown in FIG. Figure 4 As shown, obtaining the predicted retention information of the target object in the video segment to be cached in the above step S201 may include:
[0125] In step S401, first preset retention information corresponding to the target video at a first progress and second preset retention information corresponding to the target video at a second progress are obtained; the first progress may be the progress at which the target object has watched the target video, and the second progress may be the progress at which the video clip to be cached is in the target video.
[0126] In one possible implementation, the preset retention information of each video at different progress can be counted in advance, so that each video has corresponding multiple preset retention information, and the multiple preset retention information refers to the preset retention information corresponding to multiple preset progress. For example, the video can be divided into 20 parts, that is, 20 preset progresses. Taking a short video of 30 seconds as an example, the 20 preset progresses can be: 1.5 seconds, 3 seconds, ... 28.5 seconds, 30 seconds; or, the 20 preset progresses can be progress ranges, for example, can be: 0~1.5 seconds, 1.5~3 seconds, ... 27~28.5 seconds, 28.5~30 seconds. This disclosure is not limited to this. The preset retention information corresponding to the multiple preset progress of each video counted in advance can be stored as the first preset retention configuration information for subsequent use.
[0127] In practical applications, the first preset retention configuration information can be obtained, and thus the first preset retention information corresponding to the first progress of the target video and the second preset retention information corresponding to the second progress of the target video can be obtained from the first preset retention configuration information. For example, if the first progress is 1 second, the first preset retention information corresponding to the first progress can be determined to be the preset retention information corresponding to 0 to 1.5 seconds. If the second progress is 3 seconds, the second preset retention information corresponding to the second progress can be determined to be the preset retention information corresponding to 1.5 to 3 seconds.
[0128] It should be noted that, if the preset progress is not a progress range, and if the first and second progress are not endpoints of the preset progress, the first preset retention information corresponding to the first progress may be the preset retention information corresponding to the preset progress closest to the first progress; alternatively, the first preset retention information corresponding to the first progress may be the preset retention information corresponding to the subsequent adjacent preset progress, where "subsequently adjacent" may mean located after the first progress and adjacent to the first progress. For example, if the first progress is 1 second, the first preset retention information corresponding to the first progress may be determined to be the preset retention information corresponding to 1.5 seconds.
[0129] Accordingly, the second preset retention information corresponding to the second progress may be the preset retention information corresponding to the preset progress closest to the second progress; or, the second preset retention information corresponding to the second progress may be the preset retention information corresponding to the subsequent adjacent preset progress.
[0130] In one possible implementation, the preset retention information for each video type at different preset progress rates can be pre-collected. Specifically, the retention information corresponding to different preset progress rates can be collected by video type. This allows the preset retention information for multiple preset progress rates corresponding to different video types to be stored as second preset retention configuration information for later use. As an example, the second preset retention configuration information may include a correspondence between video type, multiple preset progress rates, and the preset retention information for each preset progress rate. For example, for video type 1, preset progress rate 1 / 0.2, preset progress rate 2 / 0.1, ..., preset progress rate 20 / 0.8; ...; for video type M, preset progress rate 1 / 0.3, preset progress rate 2 / 0.4, ..., preset progress rate 20 / 0.9. The division of progress rates here can be referenced above and will not be further elaborated here. M can refer to the number of video types and can be an integer greater than 0. For video type 1, for example, the multiple preset progress rates are preset progress rates 1 through 20, and the preset retention information corresponding to each of these preset progress rates is, in order: 0.2, 0.1, ..., 0.8.
[0131] In practical applications, the target video type of the target video can be determined. Based on the target video type, the second preset retention configuration information can be searched to obtain multiple preset progresses corresponding to the matching video type and the preset retention information corresponding to the multiple preset progresses. Furthermore, the first preset retention information corresponding to the first progress of the target video and the second preset retention information corresponding to the second progress of the target video can be obtained.
[0132] As an example, the preset retention information may refer to a preset retention rate, and the preset retention rate corresponding to each preset progress may refer to the proportion of objects that have watched the video from the start time to each preset progress, that is, the proportion of users.
[0133] In step S403, the probability of the target object being retained to the second progress of the target video is determined according to the first preset retention information and the second preset retention information, as predicted retention information.
[0134] In one example, current actual retention information corresponding to the first progress can be obtained, and then the current actual retention information can be divided by the first preset retention information to obtain retention ratio information. The retention ratio information can then be used to adjust the second preset retention information. For example, the product of the retention ratio information and the second preset retention information can be used as the predicted retention information.
[0135] In another example, the ratio of the second preset retention information to the first preset retention information can be used as the predicted retention information. For example, the retention information can be predicted using the following formula (5).
[0136]
[0137] Among them, p i,m (m c ) is the predicted retention information, which may refer to the first progress m c The retained information of the second progress m predicted in this case. i,m Retain information for the second preset; The first preset retention information. c In this case, since the video has been watched to the mth second, the predicted retention information can be determined to be 1.
[0138] Optionally, the second preset retention information may be directly used as the predicted retention information.
[0139] It should be noted that for the videos that have not been watched (i.e., videos that have not been shown to the target object), it can be considered that m c =0.
[0140] By setting the preset retention information, the predicted retention information of the second progress can be predicted based on the preset retention information, so that the predicted retention information is more accurate, thereby improving the accuracy of cache control.
[0141] Figure 5 FIG. 1 is a flow chart of a method for obtaining predicted bandwidth information according to an exemplary embodiment. In a possible implementation, Figure 5 As shown, obtaining the predicted bandwidth information in the above step S201 may include:
[0142] In step S501, historical download bandwidth information corresponding to the target object is obtained.
[0143] In the embodiments of this specification, actual bandwidth information corresponding to multiple historical downloads within a historical period can be obtained; thus, multiple actual bandwidth information can be used as historical download bandwidth information. Alternatively, at least one actual bandwidth information closest to the first progress can be obtained as historical download bandwidth information.
[0144] In step S503, historical download bandwidth information is statistically processed to obtain historical bandwidth statistical information;
[0145] In step S505, predicted bandwidth information is determined based on historical bandwidth statistics information.
[0146] In the embodiments of this specification, bandwidth prediction is performed to achieve network adaptability and a dynamic balance between cache waste and video playback lag. Furthermore, given the high volatility of networks, to enhance the robustness of prediction, historical download bandwidth information can be statistically processed to obtain historical bandwidth statistics. This historical bandwidth statistics can then be used to determine predicted bandwidth information. For example, historical bandwidth statistics can be used as predicted bandwidth information.
[0147] Statistical processing may include arithmetic mean, harmonic mean, and other statistical processing methods, which are not limited in this disclosure. Taking harmonic mean as an example, the harmonic mean of multiple actual bandwidth information in historical download bandwidth information can be used to predict the bandwidth at the next moment, such as the following formula (6).
[0148]
[0149] in, B is the historical bandwidth statistics; t-n It is the actual bandwidth information of the nth download in the historical download bandwidth information; N here may refer to the number of multiple historical downloads.
[0150] Optionally, considering that there may be errors in the speed measurement of actual bandwidth information, and the larger the historical error, the more conservative the bandwidth should be predicted to resist network jitter, based on this, the predicted bandwidth information can also be determined in combination with the historical predicted bandwidth information. For example, the historical predicted bandwidth information within the historical period can be obtained, for example, the predicted bandwidth information recorded multiple times within the historical period can be obtained as the historical predicted bandwidth information within the historical period. Thus, the bandwidth prediction error information can be determined based on the historical predicted bandwidth information and the historical download bandwidth information; and the historical bandwidth statistical information can be adjusted based on the bandwidth prediction error information to obtain the predicted bandwidth information; the predicted bandwidth information is negatively correlated with the bandwidth prediction error information. As an example, the predicted bandwidth information can be calculated using the following formula (7):
[0151]
[0152] in, To predict bandwidth information; B is the historical bandwidth statistics; t-n The nth actual bandwidth information in the historical download bandwidth information; The nth predicted bandwidth information in the historical predicted bandwidth information may correspond to n pieces of actual bandwidth information, because each download may have predicted bandwidth information and actual bandwidth information. It refers to the bandwidth prediction error information corresponding to the nth time.
[0153] Figure 6 FIG. 1 is a block diagram of a cache control device according to an exemplary embodiment. Figure 6 , the apparatus may include:
[0154] The acquisition module 601 is configured to execute a cache download event in response to a target video segment to be cached, and acquire predicted bandwidth information and predicted retention information of a target object to be retained in the target video segment to be cached; the target object is an object browsing the target video or browsing a video sequence to which the target video belongs;
[0155] The target cache duration determining module 603 is configured to determine a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information; the target cache duration is negatively correlated with the predicted bandwidth information and positively correlated with the predicted retention information;
[0156] The cache download control module 605 is configured to control the cache download of the to-be-cached video segment based on the target cache duration and the current cache duration of the target video under the target object.
[0157] In a possible implementation, the cache download control module 605 may include:
[0158] A first cache download control unit is configured to download the video segment to be cached when the current cache duration is less than the target cache duration;
[0159] The second cache download control unit is configured to control the to-be-cached video segment to be in a paused download state when the current cache duration is greater than or equal to the target cache duration.
[0160] In a possible implementation, the obtaining module 601 may include:
[0161] The preset retention acquisition unit is configured to acquire first preset retention information corresponding to a first progress of the target video and second preset retention information corresponding to a second progress of the target video; the first progress is the progress of the target video that the target subject has watched, and the second progress is the progress of the video clip to be cached in the target video;
[0162] The predicted retention information determining unit is configured to determine, based on the first preset retention information and the second preset retention information, a probability that the target object is retained to the second progress of the target video, as the predicted retention information.
[0163] In a possible implementation, the predicted retention information determining unit may include:
[0164] The predicted retention information determining subunit is configured to use the ratio information of the second preset retention information to the first preset retention information as the predicted retention information.
[0165] In a possible implementation, the obtaining module 601 may include:
[0166] A historical download bandwidth information acquiring unit is configured to acquire historical download bandwidth information corresponding to the target object;
[0167] a historical bandwidth statistics unit, configured to perform statistical processing on the historical download bandwidth information to obtain historical bandwidth statistics information;
[0168] The bandwidth prediction unit is configured to determine the predicted bandwidth information according to the historical bandwidth statistical information.
[0169] In a possible implementation, the bandwidth prediction unit may include:
[0170] The historical predicted bandwidth information acquisition subunit is configured to acquire historical predicted bandwidth information within a historical period;
[0171] a bandwidth prediction error determining subunit, configured to determine bandwidth prediction error information based on the historical predicted bandwidth information and the historical download bandwidth information;
[0172] The predicted bandwidth information acquisition subunit is configured to adjust the historical bandwidth statistical information based on the bandwidth prediction error information to obtain the predicted bandwidth information; the predicted bandwidth information is negatively correlated with the bandwidth prediction error information.
[0173] In a possible implementation, the target cache duration determination module 603 may include:
[0174] a data volume obtaining unit, configured to obtain a target data volume of the video segment to be cached;
[0175] A first cache duration obtaining unit is configured to obtain a first cache duration according to the target data volume and the predicted bandwidth information;
[0176] The target cache duration determining unit is configured to determine the target cache duration according to the first cache duration and the predicted retention information.
[0177] In a possible implementation, the target cache duration determining unit may include:
[0178] A second cache duration acquisition subunit is configured to obtain a second cache duration according to the first cache duration and the predicted retention information;
[0179] The cache duration lower limit obtaining subunit is configured to obtain cache duration lower limit information;
[0180] The duration determination subunit is configured to use the larger one of the cache duration lower limit information and the second cache duration as the target cache duration.
[0181] In a possible implementation, the target video is any video in a video sequence; and the cache duration lower limit obtaining subunit may include:
[0182] a currently watched video acquisition subunit, configured to acquire a currently watched video of the target object, where the currently watched video is any video in the video sequence;
[0183] a position distance determining subunit, configured to determine a position distance between a first position of the target video in the video sequence and a second position of the currently viewed video in the video sequence;
[0184] The cache duration lower limit information acquisition subunit is configured to execute, based on the location distance and the predicted bandwidth information, acquisition of the cache duration lower limit information; the cache duration lower limit information is negatively correlated with the location distance; the cache duration lower limit information is also negatively correlated with the predicted bandwidth information.
[0185] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0186] Figure 7 is a block diagram of an electronic device for cache control according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a cache control method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0187] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0188] Figure 8 FIG. 1 is a block diagram of another electronic device for cache control according to an exemplary embodiment. The electronic device may be a server, and its internal structure may be as shown in FIG. Figure 8As shown. The electronic device includes a processor, a memory, and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a cache control method is implemented.
[0189] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0190] In an exemplary embodiment, an electronic device is further provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the cache control method in the embodiment of the present disclosure.
[0191] In an exemplary embodiment, a computer-readable storage medium is also provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the cache control method of the embodiment of the present disclosure. The computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, or the like.
[0192] In an exemplary embodiment, a computer program product containing instructions is also provided. When the computer program product is executed on a computer, the computer is caused to execute the cache control method in the embodiment of the present disclosure.
[0193] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, which can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0194] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0195] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A cache control method, characterized in that: include: In response to a cache download event of a to-be-cached video segment of a target video, obtaining predicted bandwidth information and first preset retention information corresponding to a first progress of the target video, and second preset retention information corresponding to a second progress of the target video; the first progress being the progress at which the target subject has watched the target video, and the second progress being the progress of the to-be-cached video segment within the target video; Determining, based on the first preset retention information and the second preset retention information, a probability that the target object is retained to the second progress of the target video as predicted retention information; The target object is an object browsing the target video or browsing the video sequence to which the target video belongs; Determining a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information; The target cache duration is negatively correlated with the predicted bandwidth information and positively correlated with the predicted retention information; Based on the target cache duration and the current cache duration of the target video under the target object, the cache download of the to-be-cached video segment is controlled.
2. The method according to claim 1, characterized in that The controlling the downloading of the video segment to be cached based on the target cache duration and the current cache duration of the target video under the target object includes: If the current cache duration is less than the target cache duration, downloading the video segment to be cached; When the current cache duration is greater than or equal to the target cache duration, the video segment to be cached is controlled to be in a paused download state.
3. The method according to claim 1, characterized in that The determining, based on the first preset retention information and the second preset retention information, a probability that the target object is retained at the second progress of the target video as the predicted retention information includes: The ratio of the second preset retention information to the first preset retention information is used as the predicted retention information.
4. The method according to claim 1 or 2, characterized in that The obtaining of predicted bandwidth information includes: Obtaining historical download bandwidth information corresponding to the target object; Performing statistical processing on the historical download bandwidth information to obtain historical bandwidth statistical information; The predicted bandwidth information is determined according to the historical bandwidth statistical information.
5. The method according to claim 4, characterized in that The determining the predicted bandwidth information according to the historical bandwidth statistical information includes: Obtaining historical predicted bandwidth information corresponding to the target object; Determining bandwidth prediction error information based on the historical predicted bandwidth information and the historical download bandwidth information; The historical bandwidth statistical information is adjusted based on the bandwidth prediction error information to obtain the predicted bandwidth information; the predicted bandwidth information is negatively correlated with the bandwidth prediction error information.
6. The method according to any one of claims 1-2, 3, and 5, characterized in that: The determining, based on the predicted retention information and the predicted bandwidth information, a target cache duration corresponding to the target video includes: Obtaining a target data volume of the video clip to be cached; Obtaining a first cache duration according to the target data volume and the predicted bandwidth information; The target cache duration is determined according to the first cache duration and the predicted retention information.
7. The method according to claim 6, characterized in that The determining the target cache duration according to the first cache duration and the predicted retention information includes: Obtaining a second cache duration according to the first cache duration and the predicted retention information; Get the cache duration lower limit information; The larger one of the cache duration lower limit information and the second cache duration is used as the target cache duration.
8. The method according to claim 7, characterized in that The target video is any video in a video sequence; and obtaining the cache duration lower limit information includes: Obtaining a currently watched video of the target object, where the currently watched video is any video in the video sequence; Determining a position distance between a first position of the target video in the video sequence and a second position of the currently viewed video in the video sequence; The cache duration lower limit information is acquired according to the location distance and the predicted bandwidth information; the cache duration lower limit information is negatively correlated with the location distance; and the cache duration lower limit information is also negatively correlated with the predicted bandwidth information.
9. A cache control device, characterized in that: include: an acquisition module configured to execute a cache download event in response to a to-be-cached video segment of a target video, and acquire predicted bandwidth information and first preset retention information corresponding to a first progress of the target video, and second preset retention information corresponding to a second progress of the target video; wherein the first progress is the progress at which the target subject has watched the target video, and the second progress is the progress at which the to-be-cached video segment is in the target video; a predicted retention information determining unit, configured to determine, based on the first preset retention information and the second preset retention information, a probability that the target object is retained at the second progress of the target video, as the predicted retention information; The target object is an object browsing the target video or browsing the video sequence to which the target video belongs; a target cache duration determination module, configured to determine a target cache duration corresponding to the target video based on the predicted retention information and the predicted bandwidth information; The target cache duration is negatively correlated with the predicted bandwidth information and positively correlated with the predicted retention information; The cache download control module is configured to control the cache download of the to-be-cached video segment based on the target cache duration and the current cache duration of the target video under the target object.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the cache control method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the cache control method according to any one of claims 1 to 8.
12. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by a processor, the cache control method according to any one of claims 1 to 8 is implemented.