CN112492341A - Live broadcast time shifting caching method, device and system and computer readable storage medium - Google Patents

Live broadcast time shifting caching method, device and system and computer readable storage medium Download PDF

Info

Publication number
CN112492341A
CN112492341A CN202011370371.0A CN202011370371A CN112492341A CN 112492341 A CN112492341 A CN 112492341A CN 202011370371 A CN202011370371 A CN 202011370371A CN 112492341 A CN112492341 A CN 112492341A
Authority
CN
China
Prior art keywords
cache
time
video
index
live
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.)
Granted
Application number
CN202011370371.0A
Other languages
Chinese (zh)
Other versions
CN112492341B (en
Inventor
李文
卢道和
谢波
陈朝亮
沈卫华
朱敏毅
杨春保
陈严
陈洁丹
谢守坦
叶双威
雷声伟
蔡志杰
孙丹丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011370371.0A priority Critical patent/CN112492341B/en
Publication of CN112492341A publication Critical patent/CN112492341A/en
Application granted granted Critical
Publication of CN112492341B publication Critical patent/CN112492341B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23106Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a live broadcast time shift caching method, which comprises the following steps: acquiring a live target time-shifted video, and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video; storing the target time-shifting video in a cache region of a cache server, and storing the video index in a cache region of an index server; the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted. The invention also discloses a live broadcast time shift caching device, a live broadcast time shift caching system and a computer readable storage medium. The time-shifting video and the video index are separately stored, so that the calculation pressure of a cache server is reduced; and the cache ratio of the latest cache region and the hottest cache region in each server is dynamically adjusted, so that the cache space of each server is maximally utilized, and the live broadcast time-shifting intelligent cache is realized.

Description

Live broadcast time shifting caching method, device and system and computer readable storage medium
Technical Field
The invention relates to the technical field of financial technology (Fintech), in particular to a live broadcast time-shifting caching method, a live broadcast time-shifting caching device, a live broadcast time-shifting caching system and a computer-readable storage medium.
Background
In recent years, with the development of financial technology (Fintech), particularly internet finance, live broadcast technology has been introduced into daily services of financial institutions such as banks. In the daily service process of financial institutions such as banks, sometimes for promoting products, video live broadcast is needed, and audiences watching the live broadcast are likely to pause watching in the live broadcast period in case of accident, and then return to watch; or want to review the previous live content; or the viewer can watch the latest live content by directly fast forwarding to the latest schedule, that is, the viewer has the demand of live time shifting, so how to realize live time shifting is a technical problem that financial institutions such as banks need to face.
In the prior art, to realize live broadcast time shifting, a live broadcast stream is generally divided into segments, and then the segments are distributed to a broadcast user terminal, wherein a broadcast file requested by a user contains constantly refreshed sub-addresses, namely video indexes; for conventional live broadcasting, the fragment address and the corresponding file are not stored persistently, so that live video content before the current time cannot be traced back; for live broadcasting with the time shifting function, the fragment address and the corresponding file (video data) are cached in the cache server, so that the backtracking of the video content from the live broadcasting start time to the current time becomes possible.
However, in the prior art, when the fragment address and the corresponding file are cached, the fragment address and the corresponding file are both stored in one cache server, so that the existing cache server needs to bear the functions of all fragment calculation and corresponding file distribution, once a large number of concurrent time-shifting requests are faced, a CPU of the cache server is occupied by a large number of fragment calculation, performance is reduced, the performance of video caching is affected, and the problem of low time-shifting playing efficiency is caused.
Disclosure of Invention
The invention mainly aims to provide a live broadcast time shifting caching method, a live broadcast time shifting caching device, a live broadcast time shifting caching system and a computer readable storage medium, and aims to realize intelligent caching of live broadcast time shifting.
In order to achieve the above object, the present invention provides a live broadcast time shift caching method, which includes the following steps:
acquiring a live target time-shifted video, and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
storing the target time-shifting video in a cache region of a cache server, and storing the video index in a cache region of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
Preferably, the step of dynamically adjusting the buffer ratio value includes:
determining the latest cache length corresponding to the live broadcast, and acquiring the online number corresponding to the latest cache length;
calculating a cache score of the live broadcast based on the recent cache length and the online number of people;
adjusting the cache ratio based on the cache score.
Preferably, the step of calculating the live cache score based on the recent cache length and the online population number comprises:
calculating a weight value of the online number of people based on the cache length;
and calculating the live cache score based on the online number of people and the weight value.
Preferably, the step of adjusting the cache ratio value based on the cache score comprises:
acquiring historical cache scores of the live broadcast, and calculating score difference values based on the historical cache scores and the cache scores;
and determining a variation value corresponding to the grading difference value, and adjusting the cache ratio value based on the variation value.
Preferably, the live time shift caching method further includes:
if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining a elimination strategy of the latest cache region or the hottest cache region based on a data writing rule of the latest cache region or the hottest cache region;
and determining the time-shifted video to be eliminated or the video index to be eliminated of the latest cache region or the hottest cache region corresponding to the cache server or the index server according to the elimination strategy, and deleting the time-shifted video to be eliminated or the video index to be eliminated.
Preferably, the step of acquiring a live target time-shifted video includes:
acquiring a pre-recorded historical time shifting request of the live broadcast;
determining a time-shifted video corresponding to the historical time-shifted request, and counting the request times of the time-shifted video;
and determining a target time-shifting video in the time-shifting videos based on the request times, and acquiring the target time-shifting video.
Preferably, after the step of storing the target time-shifted video in the cache region of the cache server and storing the video index in the cache region of the index server, the live time-shift caching method further includes:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request;
if the target video index exists, first video content corresponding to the target video index is obtained in the cache server, and the first video content is distributed to the client;
and if not, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
Preferably, if a time-shift request sent by a client based on the live broadcast is detected, the step of determining whether a target video index corresponding to the time-shift request exists in the index server based on a playing time corresponding to the time-shift request includes:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists locally at the client based on the playing time corresponding to the time shifting request;
and if the target video index does not exist, determining whether the target video index corresponding to the time shifting request exists in the index server or not based on the playing time corresponding to the time shifting request.
In addition, to achieve the above object, the present invention further provides a live broadcast time shift buffer device, where the live broadcast time shift buffer device includes:
the batch running module is used for acquiring a live target time-shifted video and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
the cache module is used for storing the target time-shifting video in a cache region of a cache server and storing the video index in a cache region of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
Preferably, the cache module is further configured to:
determining the latest cache length corresponding to the live broadcast, and acquiring the online number corresponding to the latest cache length;
calculating a cache score of the live broadcast based on the recent cache length and the online number of people;
adjusting the cache ratio based on the cache score.
Preferably, the cache module is further configured to:
calculating a weight value of the online number of people based on the cache length;
and calculating the live cache score based on the online number of people and the weight value.
Preferably, the cache module is further configured to:
acquiring historical cache scores of the live broadcast, and calculating a score difference value based on the historical cache scores and the cache scores, wherein the historical cache scores are the last cache scores of the live broadcast;
and determining a variation value corresponding to the grading difference value, and adjusting the cache ratio value based on the variation value.
Preferably, the cache module is further configured to:
if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining a elimination strategy of the latest cache region or the hottest cache region based on a data writing rule of the latest cache region or the hottest cache region;
and determining the time-shifted video to be eliminated or the video index to be eliminated of the latest cache region or the hottest cache region corresponding to the cache server or the index server according to the elimination strategy, and deleting the time-shifted video to be eliminated or the video index to be eliminated.
Preferably, the batching module is further configured to:
acquiring a pre-recorded historical time shifting request of the live broadcast;
determining a time-shifted video corresponding to the historical time-shifted request, and counting the request times of the time-shifted video;
and determining a target time-shifting video in the time-shifting videos based on the request times, and acquiring the target time-shifting video.
Preferably, the live time-shift caching apparatus further includes a request processing module, where the request processing module is configured to:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request;
if the target video index exists, first video content corresponding to the target video index is obtained in the cache server, and the first video content is distributed to the client;
and if not, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
Preferably, the request processing module is further configured to:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists locally at the client based on the playing time corresponding to the time shifting request;
and if the target video index does not exist, determining whether the target video index corresponding to the time shifting request exists in the index server or not based on the playing time corresponding to the time shifting request.
In addition, to achieve the above object, the present invention further provides a live broadcast time shift caching system, where the live broadcast time shift caching system includes: the system comprises a memory, a processor and a live time-shifting caching program which is stored on the memory and can run on the processor, wherein when the live time-shifting caching program is executed by the processor, the steps of the live time-shifting caching method are realized.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, having a live time-shift caching program stored thereon, where the live time-shift caching program, when executed by a processor, implements the steps of the live time-shift caching method as described above.
The live broadcast time-shifting caching method provided by the invention comprises the steps of acquiring a live broadcast target time-shifting video, and creating a video index corresponding to the target time-shifting video based on the playing time corresponding to the target time-shifting video; storing the target time-shifting video in a cache region of a cache server, and storing the video index in a cache region of an index server; the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted. According to the invention, the time-shifting video and the video index are separately stored, so that the calculation pressure of a cache server is reduced, and the response speed of a time-shifting request is improved; and the cache ratio of the latest cache region and the hottest cache region in each server is dynamically adjusted, so that the cache space of each server is maximally utilized, and the live broadcast time-shifting intelligent cache is realized.
Drawings
FIG. 1 is a system diagram of a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a live time shift caching method according to a first embodiment of the present invention;
FIG. 3 is a diagram illustrating a recent cache length and a corresponding online number of people in a first embodiment of a live time-shift caching method according to the present invention;
FIG. 4 is a diagram illustrating a cache system architecture in a third real-time example of a live time-shift caching method according to the present invention;
fig. 5 is a schematic diagram of a time-shifting scene in a third embodiment of a live time-shifting caching method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a system structural diagram of a hardware operating environment according to an embodiment of the present invention.
The system of the embodiment of the invention comprises the mobile terminal, the server equipment and the like.
As shown in fig. 1, the system may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the system architecture shown in FIG. 1 is not intended to be limiting of the system, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a live time-shift cache program.
The operating system is a program for managing and controlling the live broadcast time-shifting cache system and software resources, and supports the operation of a network communication module, a user interface module, a live broadcast time-shifting cache program and other programs or software; the network communication module is used for managing and controlling the network interface 1002; the user interface module is used to manage and control the user interface 1003.
In the live time-shift caching system shown in fig. 1, the live time-shift caching system calls, through the processor 1001, a live time-shift caching program stored in the memory 1005, and performs operations in various embodiments of the live time-shift caching method described below.
Based on the hardware structure, the embodiment of the live broadcast time-shifting caching method is provided.
Referring to fig. 2, fig. 2 is a schematic flowchart of a live time shift caching method according to a first embodiment of the present invention, where the method includes:
step S10, acquiring a live target time-shifted video, and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
step S20, storing the target time-shifting video in a cache area of a cache server, and storing the video index in a cache area of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
The live broadcast time shift caching method is applied to live broadcast time shift caching systems of financial institutions or banks and other financial institutions, and for convenience of description, the cache system of the live broadcast time shift caching system is referred to as a cache system for short. In this embodiment, the caching system includes a client, an index server, a caching server, a live broadcast end, and a batch server.
The client is used for playing live broadcast content for online audiences to watch, such as fixed terminals like computers and mobile terminals like mobile phones;
the index server is used for storing a timestamp index corresponding to the live video, namely a video index;
the cache server is used for storing time-shifted videos, wherein the time-shifted videos comprise a hottest time-shifted video and a latest time-shifted video, the hottest time-shifted video refers to a video picture which is frequently time-shifted and watched by a current live online audience, and the latest time-shifted video refers to a video picture which is a preset time range away from a current live time point;
the live broadcast end is used for acquiring video contents such as sound and action of a live broadcast object and pushing the video contents to a CDN (Content Delivery Network) distribution node so as to push the video contents to the client;
the running batch server is used for updating the video index and the corresponding time-shifted video in a quasi-real-time manner, specifically, when a live broadcast end is detected to start live broadcast in a regular running script manner, the running batch server regularly obtains the time-shifted video and creates a video index corresponding to the time-shifted video, and then the time-shifted video and the video index are correspondingly stored in the cache server and the index server so as to finish updating of the video index and the time-shifted video.
The cache system of this embodiment can quickly find the video cache after live broadcast time shift occurs by creating the video index of the time-shifted video, and separate and store the video index and the time-shifted video, so as to reduce the pressure of the cache server, and in addition, dynamically adjust the cache capacities of the nearest cache region and the hottest cache region of the index server and the cache server by dynamically adjusting the cache ratio, so that the index server and the cache server preferentially cache the video data most desired by the viewers, improve the cache hit rate without expanding the storage space, and finally realize the intelligent cache of live broadcast time shift, that is, to the condition of insufficient storage space, dynamically adjust the cache capacities of the nearest cache region and the hottest cache region by dynamically adjusting the cache ratio of the nearest cache region and the hottest cache region, so as to store the video data most likely to be time-shifted by the viewers in the limited storage space, without the need to store the entire video data.
The respective steps will be described in detail below:
step S10, acquiring a live target time-shifted video, and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video.
In this embodiment, after detecting that live broadcasting at a live broadcasting end starts, a caching system starts a batch running server to acquire a target time-shifted video of the current live broadcasting, where the target time-shifted video is video data to be cached, and then a video index corresponding to the target time-shifted video is created according to a playing time corresponding to the target time-shifted video, that is, an index of the target time-shifted video is constructed in a timestamp manner, so that when a subsequent time-shifting request is matched, the matching speed can be increased.
In one embodiment, the step of acquiring a live target time-shifted video includes:
step a1, obtaining a pre-recorded historical time shift request of the live broadcast;
in an embodiment, the target time-shifted video is the hottest time-shifted video, and to obtain the hottest time-shifted video, the cache system records the historical time-shifted requests of the current live broadcast, that is, each time-shifted request of the viewer, so as to perform subsequent analysis to confirm which time-point videos are the hottest time-shifted videos most likely to be requested by the viewer.
Step a2, determining a time-shifted video corresponding to the historical time-shifted request, and counting the request times of the time-shifted video;
then, the time-shifted video corresponding to the historical time-shifted request is determined, and the request times of the time-shifted video, that is, the requested watching times of the same time-shifted video are counted, so as to explain the possible degree that the audience wants to watch.
Step a3, based on the request times, determining a target time-shifted video in the time-shifted videos and obtaining the target time-shifted video.
Finally, determining a target time-shifted video in the time-shifted videos according to the request times, and acquiring the target time-shifted videos, specifically, comparing the request times of each time-shifted video with preset times, and determining the time-shifted videos larger than the preset times as the target time-shifted videos, wherein the preset times can be set according to actual conditions, such as 2 times and the like; or, determining a previous preset number of time-shifted videos with the largest request times as the target time-shifted video, wherein the previous preset number can be set according to actual situations, such as the previous 10.
That is, in an embodiment, the most likely time-shifted video of the viewer can be analyzed by determining the number of requests of the same time-shifted video, and the greater the number of time-shift requests, the more representative the corresponding time-shifted video is the most likely time-shifted video of the viewer, that is, the time-shifted video is the hot time-shifted object.
Further, in another embodiment, the step of obtaining a live target time-shifted video comprises:
step a4, determining the current live broadcast time of the live broadcast, and determining the nearest buffer range of the live broadcast based on the current live broadcast time;
in another embodiment, the target time-shifted video is a latest time-shifted video, and to obtain the latest time-shifted video, the caching system determines a current live broadcast time of a current live broadcast first, and then determines a latest caching range of the current live broadcast according to the current live broadcast time, where the latest caching range refers to a preset range close to the current live broadcast time, and it can be understood that, during live broadcast of the video, the time of occurrence of the time-shifted probability is larger as the video is closer to the current live broadcast time, and therefore, the latest caching range of the current live broadcast can be determined according to the current live broadcast time and the latest caching length, where the latest caching length can be set according to an actual size of a storage space of a caching server or a client: 600 seconds, 1200 seconds, etc., i.e., the latest buffer range is 600 seconds, 1200 seconds, etc. near the current live time.
And a5, acquiring the target time-shifted video corresponding to the latest cache range.
And then, according to the latest cache range, acquiring the latest time-shifted video corresponding to the current live broadcast, namely the target time-shifted video, and if acquiring the video which is 600 seconds close to the current live broadcast time, namely the target time-shifted video.
Step S20, storing the target time-shifting video in a cache area of a cache server, and storing the video index in a cache area of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
In this embodiment, the cache system stores the target time-shifted video obtained by the batch running server periodically and the video index created by the periodic batch running in the cache region of the cache server and the cache region of the index server respectively, so as to implement separate storage of the video index and the time-shifted video, reduce the pressure of the cache server, enable subsequent analysis to be performed in the index server when a time-shift request is detected, and improve the matching speed of the time-shift request.
It should be noted that the cache region of the cache server corresponds to the cache region of the index server, and both include the latest cache region and the hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted, that is, the cache region of the cache server includes a latest cache region M and a hottest cache region N, and the cache region of the index server correspondingly includes a latest cache region M and a hottest cache region N; the cache ratio P of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted, that is, M: n ═ P, or m: n ═ P, where P is dynamically adjusted, as M: n or m: n is originally equal to 50%, i.e. the nearest buffer: the hottest buffer is 1: 2, that is, assuming that the storage space of the index server or the cache server is 24G, the latest cache area is 1/3, 8G, the hottest cache area is 2/3, 16G, and after dynamic adjustment, M: n or m: n equals 60%, i.e., the most recent buffer: the hottest buffer is 3: 5, at this time, the latest buffer occupies 3/8G, and is 9G, and the hottest buffer occupies 5/8G, and is 15G.
Therefore, in an embodiment, the step of storing the target time-shifted video in a cache of a cache server and storing the video index in a cache of an index server comprises:
step b1, determining the time shift type of the target time shift video, wherein the time shift type comprises the latest time shift video and the hottest time shift video;
in an embodiment, the cache system first determines a time shift type of the target time shift video, where the time shift type of the target time shift video includes a latest time shift video and a hottest time shift video, and in a specific implementation, the time shift type of the target time shift video may be determined according to the obtaining manner of step S10, where the specific obtaining manner is referred to the above description and is not described herein again.
Step b2, according to the time shift type, storing the target time shift video in a cache region corresponding to a cache server, and storing the video index in a cache region corresponding to an index server, where the cache region of the cache server and the cache region of the index server both include a latest cache region and a hottest cache region, and are respectively used for storing the latest time shift video and the hottest time shift video, or storing the video index corresponding to the latest time shift video and the video index corresponding to the hottest time shift video.
And then, respectively storing the target time-shift video with the corresponding time-shift type and the corresponding video index in cache regions corresponding to the cache server and the index server, wherein the cache regions of the cache server and the index server comprise a latest cache region and a hottest cache region.
Specifically, if the target time-shifted video is the latest time-shifted video, storing the target time-shifted video in the latest cache region M of the cache server, and storing the video index corresponding to the target time-shifted video in the latest cache region M of the index server; and if the target time-shifted video is the hottest time-shifted video, storing the target time-shifted video in a hottest cache region N of the cache server, and storing a video index corresponding to the target time-shifted video in a hottest cache region N of the index server.
In particular, the data structure used in the batch server is as follows:
Figure BDA0002806492980000111
further, in an embodiment, the step of dynamically adjusting the buffer ratio value includes:
step b3, determining the latest cache length corresponding to the live broadcast, and acquiring the online number corresponding to the latest cache length;
in an embodiment, the caching system first determines a latest caching length corresponding to the current live broadcast, where the latest caching length may be set according to an actual situation, and if the requirement on the real-time performance is high, the latest caching length may be set to a second level, such as 10 seconds, and generally, 600 seconds may be set. Then, the online number corresponding to the latest cache length, namely the historical online number corresponding to each second in the latest cache length, is obtained, and if the latest cache length is 10 seconds, the online number in the last 10 seconds of the current live broadcast time and the online number in the last 9 seconds are respectively obtained. It will be appreciated that the number of online people is dynamically changing, and that the greater the number of online people, the more popular the corresponding live time point is.
Step b4, calculating the cache score of the live broadcast based on the recent cache length and the online number of people;
and then, calculating the live cache score according to the recent cache length and the online number. Specifically, the online number of people at each time point in the latest cache length can be accumulated to be used as the cache score of the current live broadcast, that is, the online number of people is used as the score standard for measuring the current live broadcast.
In addition, for the live broadcast scene, the closer to the current live broadcast time period, the greater the probability of time shift, therefore, the coverage and effective time of the latest video index need to be ensured in the cache, so as to increase the hit rate, that is, the closer to the current live broadcast time, the greater the weight, and the more the cache score should be considered when calculating the cache score.
Thus, in one embodiment, step b4 includes:
step b41, calculating the weight value of the online people number based on the cache length;
in an embodiment, the weight value of the number of online people may be a fixed value set in advance according to actual conditions, for example, the recent buffer length is halved, the half weight value far away from the current live broadcast time is 0.2, the half weight value close to the current live broadcast time is 0.8, and the like.
In another embodiment, in consideration of the fact that the online people closer to the current live time have higher weight in a real live scene, that is, the online people closer to the current live time have higher reference value, that is, the reference value of the online people decreases with the live time, in one embodiment, an arithmetic data manner can be adopted for calculation, and formula 1 is as follows:
Figure BDA0002806492980000121
wherein S isnIs a fixed empirical value of 100; a1 is an initial weight value and is set to be 1; n is the latest buffer length, and can be set according to practical situations, such as setting to 10.
According to the above formula 1, d can be obtained as the weight difference of each time point in the latest buffer length, and therefore, the weight value of each time point in the latest buffer length, that is, the numerical value of a2, a3, a4... an can be obtained according to a1 and d.
If n is 10, d is 2, and the weighting values corresponding to the time points of the latest buffer length are 1, 3, 5, 7, 9, 11, 13, 15, 17 and 19, that is, the time points respectively account for 1%, 3%, 5%, 7%, 9%, 11%, 13%, 15%, 17% and 19%.
And b42, calculating the cache score of the live broadcast based on the online number of people and the weight value.
Then, calculating a current live broadcast cache score according to the online number of people corresponding to each time point of the latest cache length and the calculated weight value, specifically, calculating the score in a weighting mode, wherein a specific formula 2 is as follows:
Scoren=n1*a1+n2*a2+…+nn*an
wherein, in formula 2, n (number) is a numerical value of the number of online persons, that is, the number of online persons per second; n isnNumber of online persons at current live time, nn-1The number of online people in the last second.
That is, the online number of people with the latest cache length is multiplied by the corresponding weight value in sequence, and the results are accumulated, so that the current live cache score is obtained.
As shown in fig. 3, if the latest buffer length one (length one) is 10 seconds from the 3 rd second to the 12 th second, that is, the latest buffer length n is 10, then according to the above formula 1, the weight value of the 3 rd second is calculated to be 1, and the weight value of the fourth second is calculated to be 3. Determining the online number 234 at the 3 rd second and the online number 331 at the 4 th second. Multiplying the online number of people corresponding to each of the 3 rd to 12 th seconds by the weight value, wherein the calculation result of the 3 rd second is 1 × 234 ═ 234, and the calculation result of the 4 th second is 3 × 331 ═ 993.. the calculation result of the 12 th second is 19 × 986 ═ 19734; and finally, accumulating the calculation results to obtain a cache score of 73625.
Step b5, based on the cache score, adjusting the cache ratio.
And finally, according to the cache scores, adjusting the cache ratio of the latest cache region and the hottest cache region of the cache server and the index server. Specifically, a mapping relationship between the cache score and the nearest cache region occupancy ratio or the hottest cache region occupancy ratio may be established in advance, and after the cache score is obtained, the occupancy ratio of the nearest cache region or the occupancy ratio of the hottest cache region may be obtained according to the mapping relationship.
Further, in one embodiment, step b5 includes:
b51, acquiring the history cache score of the live broadcast, and calculating a score difference value based on the history cache score and the cache score;
in an embodiment, after the cache score of the current live broadcast is obtained through calculation, a historical cache score of the current live broadcast is further obtained, and a variation value of a cache ratio is determined by comparing changes of the current cache score and the historical cache score, wherein the historical cache score is the last cache score of the current live broadcast or an average value of previous preset cache scores and the like.
It should be noted that the calculation time of the cache score may be triggered at regular time, for example, triggered every 10 minutes; the method may also be conditional triggering, for example, triggering when the buffer space of the latest buffer or the hottest buffer is full, that is, triggering when the buffer space of the latest buffer or the hottest buffer is zero and other data cannot be stored, so as to readjust the buffer ratio of the latest buffer and the hottest buffer, for example, when the buffer ratio of the latest buffer and the hottest buffer is 30%: 70%: 3/7% >, i.e., 3/7, after the latest buffer is full, the buffer ratio of the latest buffer and the hottest buffer is 60%: 40%: 3/2, so that the latest buffer can continue to buffer data, and the like, when the storage space of the index server or the cache server is 15G, the latest buffer initially occupies 4.5G, and the hottest buffer occupies 10.5G (4.5:10.5 ═ 3: 7); after the adjustment, the latest buffer area occupies 9G, the hottest buffer area occupies 6G (9:6 ═ 3:2), and the like.
For facilitating subsequent adjustment, the difference between the current cache score and the historical cache score and the ratio of the current cache score to the historical cache score can be used as the score difference, that is:
the current cache Score is Scoren=n1*a1+n2*a2+…+nn*an
Historical cache Score of Scoren-1=n0*a1+n1*a2+…+nn-1*an
Score difference k:
Figure BDA0002806492980000141
therefore, the change condition of the current live broadcast in the two cache scores can be analyzed visually, and subsequent adjustment is facilitated.
As shown in fig. 3, assuming that the current cache score is 38330 corresponding to length three and the historical cache score is the last cache score, which is 72055 corresponding to length two:
Figure BDA0002806492980000142
step b52, determining a variation value corresponding to the score difference, and adjusting the cache ratio value based on the variation value.
In one embodiment, the following rules are established in advance:
Figure BDA0002806492980000143
Figure BDA0002806492980000151
the cache system can determine the corresponding variation value y according to the rule and the score difference value obtained by calculation, and then adjust the cache ratio of the latest cache region and the hottest cache region according to the variation value.
In particular, the latest buffer ratio p1=p0+y
Wherein p is0The buffer capacity of the current nearest buffer zone is as follows: the buffer capacity of the current hottest buffer, that is, the latest buffer capacity: the hottest buffer capacity, i.e. the current buffer ratio, p0Defaults to 50%, and the value range can be set to min-max, such as 50% -90% and the like; if the final p1 is greater than max, then p1 is max; if p1 is less than min, p1 ═ min; y is a variation value and is valued according to the table rule.
It should be noted that min and max can be set according to actual situations. In practical application, more and more people watch the time-shift cache from live broadcasting, and gradually slide down after the time-shift cache reaches a peak, for the time-shift cache, the cache capacity of the nearest cache region needs to be ensured to be gradually increased in the early-middle period, and the time-shift cache is slowly adjusted to fall back in the later period, so that the time-shift data cached by the index server and the cache server is time-shift data wanted by audiences with high probability, and the time-shift hit rate is improved.
The embodiment acquires a live target time-shifted video, and creates a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video; storing the target time-shifting video in a cache region of a cache server, and storing the video index in a cache region of an index server; the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted. According to the invention, the time-shifting video and the video index are separately stored, so that the calculation pressure of a cache server is reduced, and the response speed of a time-shifting request is improved; and the cache ratio of the latest cache region and the hottest cache region in each server is dynamically adjusted, so that the cache space of each server is maximally utilized, and the live broadcast time-shifting intelligent cache is realized.
Further, based on the first embodiment of the live broadcast time-shifting caching method of the present invention, a second embodiment of the live broadcast time-shifting caching method of the present invention is provided.
The second embodiment of the live time-shift caching method is different from the first embodiment of the live time-shift caching method in that the live time-shift caching method further includes:
step c, if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining a elimination strategy of the latest cache region or the hottest cache region based on the data writing rule of the latest cache region or the hottest cache region;
and d, determining the time-shifted video to be eliminated or the video index to be eliminated of the nearest cache region or the hottest cache region according to the elimination strategy, and deleting the time-shifted video or the video index to be eliminated.
In this embodiment, when the cache capacity is insufficient, an elimination strategy is adopted, and the time-shifted video or the video index is selectively deleted, so that the cache pressure is reduced, and the cache intelligence is improved.
The respective steps will be described in detail below:
and c, if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining the elimination strategy of the latest cache region or the hottest cache region based on the data writing rule of the latest cache region or the hottest cache region.
In this embodiment, the latest buffer area and the hottest buffer area are both provided with elimination strategies, and when the latest buffer area or the hottest buffer area reaches the maximum buffer capacity, the elimination strategies of the latest buffer area or the hottest buffer area are determined according to the data writing rules of the latest buffer area or the hottest buffer area, wherein the data writing rules include script writing and real-time program writing, and in specific implementation, the data of the latest buffer area can be written by a batch script, which follows the first-in first-out (FIFO) algorithm rule, that is, the elimination strategy of the latest buffer area follows that the probability of the earlier-cached data being accessed is lower, that is, the earlier-cached data is eliminated; the data of the hottest cache area can be written by a real-time program, and the data of the hottest cache area follows the Least Recently used algorithm rule, namely, the elimination strategy of the hottest cache area follows the Least Recently used, namely, the cache data which is used Least Recently is eliminated.
It should be noted that if both the caches, that is, the latest cache region and the hottest cache region, do not perform cache elimination and continuously write into the caches.
In addition, if a subsequent time shift request actually requests the eliminated cache, the real-time program will construct the cache in the hottest cache region, that is, the video index and the time shift video, and then the same time shift request is followed, and then the hottest cache region is directly accessed.
And d, determining the time-shifted video to be eliminated or the video index to be eliminated of the nearest cache region or the hottest cache region according to the elimination strategy, and deleting the time-shifted video or the video index to be eliminated.
In this embodiment, according to the determined elimination strategy, the time-shifted video to be eliminated or the video index to be eliminated in the nearest cache region or the hottest cache region is determined, and the time-shifted video to be eliminated or the video index to be eliminated is deleted, so that the cache pressure is reduced on the premise of not expanding the storage space.
In the embodiment, under the condition of insufficient storage space, the elimination strategy of the nearest cache region or the hottest cache region is determined through the data write-in rule, the cache data of the nearest cache region or the hottest cache region are eliminated and deleted according to the elimination strategy, the cache pressure is reduced, the cache data which are more likely to be time-shifted by audiences are reserved according to the elimination strategy, and the hit rate of the time-shifting request is improved.
Further, based on the first and second embodiments of the live broadcast time-shift caching method of the present invention, a third embodiment of the live broadcast time-shift caching method of the present invention is provided.
The third embodiment of the live time shift caching method is different from the first and second embodiments of the live time shift caching method in that the live time shift caching method further includes:
step e, if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request;
step f, if the first video content exists, first video content corresponding to the target video index is obtained in the cache server, and the first video content is distributed to the client;
and g, if the target video index does not exist, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
In this embodiment, when it is detected that a client initiates a time shift request, it is first determined in an index server whether a target video index corresponding to the time shift request exists, so as to reduce the computational pressure of a cache server, and when the target video index is found in the index server, the cache server is moved to obtain corresponding first video content; when the target video index cannot be found in the index server, the corresponding video content does not need to be matched in the cache server, but the corresponding second video content is directly obtained from the original video source, so that the matching speed of the time shifting request is improved.
The respective steps will be described in detail below:
and e, if a time shifting request sent by the client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request.
In this embodiment, if a time shift request sent by the client based on the current live broadcast is detected, the playing time corresponding to the time shift request is determined first, that is, it is determined to which position the viewer pulls the progress bar of the player at the client, and the timestamp corresponding to the position is the playing time corresponding to the time shift request.
Then, according to the playing time, whether a target video index corresponding to the current time shift request exists is searched in the index server, and the playing time is specifically compared with the video indexes in the index server one by one, so that whether the target video index corresponding to the current time shift request exists in the index server is determined.
And f, if the target video index exists, acquiring the first video content corresponding to the target video index in the cache server, and distributing the first video content to the client.
In this embodiment, it can be understood that the video indexes stored by the index server correspond to the time-shifted videos stored by the cache server one to one, and therefore, if it is determined that the target video index corresponding to the current time-shift request exists in the index server, the cache server obtains the time-shifted video corresponding to the target video index, that is, the first video content, which is a video picture that the viewer wants to watch, and then distributes the first video content to the client, and the client player plays the first video content.
And g, if the target video index does not exist, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
In this embodiment, it can be understood that the video indexes stored by the index server correspond to the time-shifted videos stored by the cache server one to one, and therefore, if it is determined that there is no target video index corresponding to the current time-shifted request in the index server, the target video index does not need to be searched in the cache server, but directly searches in an original video source, where the original video source refers to a server that caches all video data currently live broadcast, that is, a server corresponding to a live broadcast end, and when there is no cache data corresponding to the current time-shifted request in the cache server, the original video source consumes performance such as computing power to obtain the corresponding time-shifted video, that is, the second video content, and finally, the second video content is distributed to the client player to be played.
As shown in the schematic structural diagram of the cache system shown in fig. 4, when a client generates a time shift request, the time shift request is first sent to an index server, a corresponding target video index is searched in the index server, a corresponding video content, that is, a time shift video, is searched in the cache server, and finally the corresponding video content is returned to the client; if the corresponding target video index is not found in the index server, the original video source is directly removed to obtain the corresponding video content, and finally the original video content is returned to the client.
Further, in one embodiment, step e includes:
step e1, if a time shift request sent by the client based on the live broadcast is detected, determining whether a target video index corresponding to the time shift request exists locally at the client based on the playing time corresponding to the time shift request;
in an embodiment, when the local storage space of the client is sufficient, the cache data of the current live broadcast may also be cached locally at the client, so that, if a time shift request initiated by the client based on the current live broadcast is detected, based on the play time corresponding to the time shift request, it is determined locally at the client whether a target video index corresponding to the time shift request exists or not.
And if so, directly reading the local cache of the client to obtain the corresponding video content, and delivering the video content to a player of the client for playing.
Step e2, if it is determined that the target video index does not exist, determining whether the target video index corresponding to the time shift request exists in the index server based on the playing time corresponding to the time shift request.
In an embodiment, if the target video index does not exist, the step of determining whether the target video index corresponding to the time shift request exists in the index server based on the playing time corresponding to the time shift request is performed, that is, the index server searches for the corresponding target video index.
As shown in fig. 5, in a time-shifting scene, a viewer pauses watching in a live broadcasting process, at this time, a client caches cache data with a certain length, that is, there are watched caches and unviewed caches, where watched caches mean that a client player plays from left to right, video content that has been played is cached, and if a local storage space of the client is insufficient, cache cleaning is performed, and a cleaning logic may be to clean the video content that is cached first from the front to the back; the cache is not watched, namely when the player of the client side is suspended, the client side continuously pulls the live video content for caching, and how long the video content is pulled can be defined according to the actual situation.
After a period of time, the audience continues to watch live broadcast, assuming that the current playing progress is TS, if the player progress bar is pulled to the position N1, namely the time shift deviation is N1, the time stamp corresponding to the position does not cache video content, so that a time shift request (TS-N1) needs to be sent to the index server for pulling;
if the player progress bar is pulled to the position N2, namely the time shift deviation is N2, and the timestamp corresponding to the position has the cached video content, the corresponding video content is directly pulled locally at the client to be played, and specifically the corresponding video content is pulled (TS-N2);
if the player progress bar is pulled to the position N3, namely the time shift deviation is N3, and the timestamp corresponding to the position has the cached video content, the corresponding video content is directly pulled locally at the client to be played, and specifically the corresponding video content is pulled (TS-N3);
if the player progress bar is pulled to the position N4, that is, the time shift deviation is N4, the timestamp corresponding to the position does not cache the video content, so a time shift request (TS + N4) needs to be sent to the index server for pulling. It can be understood that there is no progress bar for the live content beyond the current time, for example, the current live time is 9 o 'clock 50 minutes, the live start time is 9 o' clock, when the viewer watches the live content at the client, half press pause is performed at 9 o 'clock, it is assumed that the watched cache is 9 o' clock 20 o 'clock to 9 o' clock 30 o 'clock, the unviewed cache is 9 o' clock 30 o 'clock to 9 o' clock 40 o 'clock, the whole live progress bar is 9 o' clock to 9 o 'clock 50 o' clock, it is assumed that the position of N1 in fig. 5 is 9 o 'clock to 9 o' clock 10 o 'clock, the position of N4 is 9 o' clock 40 to 9 o 'clock 50 o' clock, there is no cache, both the live progress bar needs to be pulled to the index server, and the positions of N2 and N3 have caches, and can be directly played locally, and in addition, because the progress bar.
It should be noted that, when pulling the corresponding video content, the value of the deviation between the current playing schedule TS and the time shift is calculated, the latest timestamp index is taken as the final index, if the Timestamp corresponding to the current playing schedule TS is Timestamp _ index _2, the current playing progress Timestamp _ index _2 and the time shift offset N are calculated, and if N is N seconds, namely the viewer has moved by N seconds of progress, when the current playing progress Timestamp _ index _2 is between Timestamp _ index _5 and Timestamp _ index _6, the Timestamp at this time is Timestamp _ index _2+ n, which is assumed to be between Timestamp _ index _5 and Timestamp _ index _6, then since the last Timestamp index is 5, the final Timestamp is located as Timestamp _ index _5, which ensures that the location is complete, and the content between Timestamp _ index _2+ n and Timestamp _ index _6 is not skipped due to selecting Timestamp _ index _6, i.e. more complete video content is provided.
In the embodiment, the video index and the cache video are stored separately, when a client time shifting request is received, the index server can quickly locate the corresponding target video index only by matching, and the step of generating the index by calculation is not needed, so that the performance is very high, in addition, the cache data can be cached locally at the client, the network bandwidth is reduced, and the time shifting playing efficiency is improved.
It should be noted that, in another embodiment, the video index may be generated in real time in addition to the quasi-real-time generation of the video index by the batch running server, specifically, whether the index server has a corresponding video index may be determined according to the time shift request of the client, and if yes, the corresponding cache data may be directly returned; if not, the index server immediately generates a corresponding video index, finds corresponding cache data according to the generated video index and returns the cache data to the client. Compared with the above embodiment, although a large amount of CPU computing resources of the index server need to be consumed, the real-time generation can be realized, that is, in another embodiment, if the performance of the server is better, the performance of a part of the server can be sacrificed, so that the real-time generation of the video index can be realized.
The invention also provides a live broadcast time shift caching device. The live broadcast time shift caching device comprises:
the batch running module is used for acquiring a live target time-shifted video and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
the cache module is used for storing the target time-shifting video in a cache region of a cache server and storing the video index in a cache region of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
Preferably, the cache module is further configured to:
determining the latest cache length corresponding to the live broadcast, and acquiring the online number corresponding to the latest cache length;
calculating a cache score of the live broadcast based on the recent cache length and the online number of people;
adjusting the cache ratio based on the cache score.
Preferably, the cache module is further configured to:
calculating a weight value of the online number of people based on the cache length;
and calculating the live cache score based on the online number of people and the weight value.
Preferably, the cache module is further configured to:
acquiring historical cache scores of the live broadcast, and calculating score difference values based on the historical cache scores and the cache scores;
and determining a variation value corresponding to the grading difference value, and adjusting the cache ratio value based on the variation value.
Preferably, the cache module is further configured to:
if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining a elimination strategy of the latest cache region or the hottest cache region based on a data writing rule of the latest cache region or the hottest cache region;
and determining the time-shifted video to be eliminated or the video index to be eliminated of the nearest cache region or the hottest cache region according to the elimination strategy, and deleting the time-shifted video to be eliminated or the video index to be eliminated.
Preferably, the batching module is further configured to:
acquiring a pre-recorded historical time shifting request of the live broadcast;
determining a time-shifted video corresponding to the historical time-shifted request, and counting the request times of the time-shifted video;
and determining a target time-shifting video in the time-shifting videos based on the request times, and acquiring the target time-shifting video.
Preferably, the live time-shift caching apparatus further includes a request processing module, where the request processing module is configured to:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request;
if the target video index exists, first video content corresponding to the target video index is obtained in the cache server, and the first video content is distributed to the client;
and if not, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
Preferably, the request processing module is further configured to:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists locally at the client based on the playing time corresponding to the time shifting request;
and if the target video index does not exist, determining whether the target video index corresponding to the time shifting request exists in the index server or not based on the playing time corresponding to the time shifting request.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores a live time-shifting cache program, and when executed by a processor, the live time-shifting cache program implements the steps of the live time-shifting cache method as described above.
The method implemented when the live time-shift caching program running on the processor is executed may refer to various embodiments of the live time-shift caching method of the present invention, and details thereof are not described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A live broadcast time shift caching method is characterized by comprising the following steps:
acquiring a live target time-shifted video, and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
storing the target time-shifting video in a cache region of a cache server, and storing the video index in a cache region of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
2. The live time-shift buffering method as claimed in claim 1, wherein the step of dynamically adjusting the buffering ratio value comprises:
determining the latest cache length corresponding to the live broadcast, and acquiring the online number corresponding to the latest cache length;
calculating a cache score of the live broadcast based on the recent cache length and the online number of people;
adjusting the cache ratio based on the cache score.
3. The live time-shift caching method of claim 2, wherein the step of calculating the live caching score based on the recent caching length and the online population number comprises:
calculating a weight value of the online number of people based on the cache length;
and calculating the live cache score based on the online number of people and the weight value.
4. The live time-shift caching method of claim 2, wherein the step of adjusting the caching ratio value based on the caching score comprises:
acquiring historical cache scores of the live broadcast, and calculating score difference values based on the historical cache scores and the cache scores;
and determining a variation value corresponding to the grading difference value, and adjusting the cache ratio value based on the variation value.
5. The live time-shift caching method of claim 1, wherein the live time-shift caching method further comprises:
if the latest cache region or the hottest cache region reaches the maximum cache capacity, determining a elimination strategy of the latest cache region or the hottest cache region based on a data writing rule of the latest cache region or the hottest cache region;
and determining the time-shifted video to be eliminated or the video index to be eliminated of the latest cache region or the hottest cache region corresponding to the cache server or the index server according to the elimination strategy, and deleting the time-shifted video to be eliminated or the video index to be eliminated.
6. The live time-shift caching method of claim 1, wherein the step of obtaining the live target time-shifted video comprises:
acquiring a pre-recorded historical time shifting request of the live broadcast;
determining a time-shifted video corresponding to the historical time-shifted request, and counting the request times of the time-shifted video;
and determining a target time-shifting video in the time-shifting videos based on the request times, and acquiring the target time-shifting video.
7. The live time-shift caching method of any one of claims 1 to 6, wherein after the step of storing the target time-shifted video in a cache of a caching server and storing the video index in a cache of an index server, the live time-shift caching method further comprises:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists in the index server based on the playing time corresponding to the time shifting request;
if the target video index exists, first video content corresponding to the target video index is obtained in the cache server, and the first video content is distributed to the client;
and if not, acquiring second video content corresponding to the target video index from the original video source corresponding to the live broadcast, and distributing the second video content to the client.
8. The live time-shift caching method as claimed in claim 7, wherein the step of determining whether a target video index corresponding to the time-shift request exists in the index server based on a playing time corresponding to the time-shift request if a time-shift request sent by a client based on the live time is detected comprises:
if a time shifting request sent by a client based on the live broadcast is detected, determining whether a target video index corresponding to the time shifting request exists locally at the client based on the playing time corresponding to the time shifting request;
and if the target video index does not exist, determining whether the target video index corresponding to the time shifting request exists in the index server or not based on the playing time corresponding to the time shifting request.
9. A live time shift buffer device, the live time shift buffer device comprising:
the batch running module is used for acquiring a live target time-shifted video and creating a video index corresponding to the target time-shifted video based on the playing time corresponding to the target time-shifted video;
the cache module is used for storing the target time-shifting video in a cache region of a cache server and storing the video index in a cache region of an index server;
the cache region of the cache server corresponds to the cache region of the index server and comprises a latest cache region and a hottest cache region, and the cache ratio of the cache capacity of the latest cache region to the cache capacity of the hottest cache region is dynamically adjusted.
10. A live time-shift caching system, the live time-shift caching system comprising: memory, a processor and a live time-shift caching program stored on the memory and executable on the processor, the live time-shift caching program, when executed by the processor, implementing the steps of the live time-shift caching method as claimed in any one of claims 1 to 8.
11. A computer-readable storage medium, having stored thereon a live time-shift caching program, which when executed by a processor implements the steps of the live time-shift caching method as claimed in any one of claims 1 to 8.
CN202011370371.0A 2020-11-30 2020-11-30 Live broadcast time shift caching method, device and system and computer readable storage medium Active CN112492341B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011370371.0A CN112492341B (en) 2020-11-30 2020-11-30 Live broadcast time shift caching method, device and system and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011370371.0A CN112492341B (en) 2020-11-30 2020-11-30 Live broadcast time shift caching method, device and system and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN112492341A true CN112492341A (en) 2021-03-12
CN112492341B CN112492341B (en) 2024-02-23

Family

ID=74937071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011370371.0A Active CN112492341B (en) 2020-11-30 2020-11-30 Live broadcast time shift caching method, device and system and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112492341B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954445A (en) * 2021-03-16 2021-06-11 深圳市迅雷网络技术有限公司 Streaming media file playing method and device, computer equipment and storage medium
CN115361578A (en) * 2022-07-25 2022-11-18 海信视像科技股份有限公司 Playing method and device and electronic equipment
CN116132705A (en) * 2023-04-17 2023-05-16 北京盘腾科技有限公司 Live broadcast buffer volume adjusting method, device, equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102708903A (en) * 2012-06-14 2012-10-03 大连三通科技发展有限公司 Automatic video playback system
WO2013078620A1 (en) * 2011-11-29 2013-06-06 华为技术有限公司 Method, device and system for delivering live telecast content
CN106385619A (en) * 2016-09-14 2017-02-08 乐视控股(北京)有限公司 Replay method and device for live broadcast video stream
CN106454396A (en) * 2016-10-26 2017-02-22 山东浪潮商用系统有限公司 Method for improving concurrency of live broadcast time shifted TV
US20180020243A1 (en) * 2016-07-13 2018-01-18 Yahoo Holdings, Inc. Computerized system and method for automatic highlight detection from live streaming media and rendering within a specialized media player
CN107864382A (en) * 2017-10-24 2018-03-30 广东省南方数字电视无线传播有限公司 Video broadcasting method, device and system
US20180268435A1 (en) * 2013-09-05 2018-09-20 Google Inc. Presenting a Content Item Based on User Interaction Data
CN109561351A (en) * 2018-12-03 2019-04-02 网易(杭州)网络有限公司 Network direct broadcasting back method, device and storage medium
CN109819345A (en) * 2017-11-20 2019-05-28 网宿科技股份有限公司 Processing, time-shifting method, video process apparatus and the cloud storage system of live video

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013078620A1 (en) * 2011-11-29 2013-06-06 华为技术有限公司 Method, device and system for delivering live telecast content
CN102708903A (en) * 2012-06-14 2012-10-03 大连三通科技发展有限公司 Automatic video playback system
US20180268435A1 (en) * 2013-09-05 2018-09-20 Google Inc. Presenting a Content Item Based on User Interaction Data
US20180020243A1 (en) * 2016-07-13 2018-01-18 Yahoo Holdings, Inc. Computerized system and method for automatic highlight detection from live streaming media and rendering within a specialized media player
CN106385619A (en) * 2016-09-14 2017-02-08 乐视控股(北京)有限公司 Replay method and device for live broadcast video stream
CN106454396A (en) * 2016-10-26 2017-02-22 山东浪潮商用系统有限公司 Method for improving concurrency of live broadcast time shifted TV
CN107864382A (en) * 2017-10-24 2018-03-30 广东省南方数字电视无线传播有限公司 Video broadcasting method, device and system
CN109819345A (en) * 2017-11-20 2019-05-28 网宿科技股份有限公司 Processing, time-shifting method, video process apparatus and the cloud storage system of live video
CN109561351A (en) * 2018-12-03 2019-04-02 网易(杭州)网络有限公司 Network direct broadcasting back method, device and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954445A (en) * 2021-03-16 2021-06-11 深圳市迅雷网络技术有限公司 Streaming media file playing method and device, computer equipment and storage medium
CN115361578A (en) * 2022-07-25 2022-11-18 海信视像科技股份有限公司 Playing method and device and electronic equipment
CN115361578B (en) * 2022-07-25 2024-05-17 海信视像科技股份有限公司 Playing method and device and electronic equipment
CN116132705A (en) * 2023-04-17 2023-05-16 北京盘腾科技有限公司 Live broadcast buffer volume adjusting method, device, equipment and storage medium
CN116132705B (en) * 2023-04-17 2023-06-09 北京盘腾科技有限公司 Live broadcast buffer volume adjusting method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112492341B (en) 2024-02-23

Similar Documents

Publication Publication Date Title
US11303970B2 (en) Systems and methods for internet video delivery
US11336742B2 (en) Predictive content caching
CN112492341A (en) Live broadcast time shifting caching method, device and system and computer readable storage medium
Wu et al. Segmentation of multimedia streams for proxy caching
CN110495182B (en) Computer-implemented method and media client device
US11128730B2 (en) Predictive bitrate selection for 360 video streaming
US10540739B2 (en) Predictive application caching
WO2015085969A1 (en) Recommendation algorithm optimization method, device, and system
CN113254834B (en) Page content loading method and device, electronic equipment and readable storage medium
CN113055745B (en) Video playing processing method, device, equipment and storage medium
CN110740374B (en) Multimedia data processing method and device, computer equipment and storage medium
US20150271440A1 (en) Information processing apparatus, information processing method, program, and information processing system
CA3124540A1 (en) Systems and methods for storing and delivering content assets
JP7318123B2 (en) Method, system and medium for streaming video content using adaptive buffering
TWI802251B (en) Video cache management system, method and computer readable medium for content delivery network
Liu et al. Media browsing for mobile devices based on resolution adaptive recommendation
EP2420056B1 (en) A method of and a system for providing buffer management mechanism
Buchinger et al. Optimal server bandwidth for mobile video on demand
CN115174987A (en) Video playing method and device, computer equipment and storage medium
CN113468348A (en) Multimedia playing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant