CN111131856A - Cache expiration time adjusting method and device, electronic equipment and storage medium - Google Patents

Cache expiration time adjusting method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111131856A
CN111131856A CN201911413466.3A CN201911413466A CN111131856A CN 111131856 A CN111131856 A CN 111131856A CN 201911413466 A CN201911413466 A CN 201911413466A CN 111131856 A CN111131856 A CN 111131856A
Authority
CN
China
Prior art keywords
expiration time
cache
time period
frequency
hot
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
CN201911413466.3A
Other languages
Chinese (zh)
Other versions
CN111131856B (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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911413466.3A priority Critical patent/CN111131856B/en
Publication of CN111131856A publication Critical patent/CN111131856A/en
Application granted granted Critical
Publication of CN111131856B publication Critical patent/CN111131856B/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/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • H04N21/23406Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs involving management of server-side video buffer
    • 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/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • 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/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2407Monitoring of transmitted content, e.g. distribution time, number of downloads

Abstract

The invention relates to a method and a device for adjusting cache expiration time, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining access frequency of cache content corresponding to a hotspot video in a cache, determining a frequency interval where the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relation, calculating target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set during cache updating data, and adjusting original expiration time of the cache content to the target expiration time. According to the embodiment of the invention, the cache expiration time can be dynamically adjusted according to the access frequency of the hotspot video, the cache function is fully exerted, meanwhile, the pressure of persistent storage is reduced, the system stability is improved, and the condition that the cache content is expired in the hot broadcasting time period of the hotspot video due to the fact that the default expiration time which is kept static all the time is unchanged is avoided, so that great pressure is brought to persistent storage resources, and the performance of the whole system is influenced.

Description

Cache expiration time adjusting method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for adjusting a cache expiration time, an electronic device, and a storage medium.
Background
The app background system often uses a caching technology in order to improve system concurrency and reduce interface response time. The caching technology is designed based on a server, and the resources of the server are precious. The conventional setting is to set a relative cache expiration time, i.e., how many s (seconds) after the current time of the system expires. This is a common setting method, and in practical systems, this method is mostly used to set the cache expiration time.
The circle module in the video playing area displays different circle list data aiming at different videos, and because the playing amount is high, the query rate qps per second of the interface for acquiring the part of data is as high as 2w +. When the interface is realized, a cache technology is used. The initial version, the expiration time of the buffer, uses the first way, the circled list data associated with different videos is set to a fixed value (e.g., 300s) when updating the data to the buffer.
In this way, for the video data of the hot spot, the advantage of caching the data cannot be fully exerted. Such as: when a certain television is broadcasted hot, the time for updating the video is up to night, and a large number of users are crowded to watch the video. The request amount of the background interface is suddenly increased, the cache data is inevitably overdue in the process of watching a video by a user, once the cache data is overdue, resources can only be acquired from persistent storage (such as a mysql database or a hbase database) of a server side, the access amount of the persistent storage resources is suddenly increased, and the huge pressure is brought to the persistent storage resources, so that the performance of the whole system is influenced.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present application provides a cache expiration time adjusting method, an apparatus, an electronic device, and a storage medium.
In a first aspect, the present application provides a method for adjusting a cache expiration time, including:
acquiring the access frequency of cache content corresponding to the hot video in the cache;
determining a frequency interval in which the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relationship;
calculating a target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set when the data is cached and updated;
and adjusting the original expiration time of the cache content to the target expiration time.
Optionally, acquiring a hot playing time period of the hot video;
judging whether the current moment is within the hot broadcast time period;
if the current moment is within the hot broadcast time period, acquiring an additional time period corresponding to the hot broadcast time period;
calculating a target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set when the data is cached and updated, including:
and determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during the caching of the updated data as the target expiration time of the cached content.
Optionally, before the target expiration time of the hotspot video is reached, if an advance update notification is received, the cache content corresponding to the hotspot video in the cache is updated.
Optionally, the step of obtaining the access frequency of the cache content corresponding to the hotspot video currently in the cache includes:
and acquiring the access frequency of the cache content corresponding to the hot video in the cache at preset time intervals.
In a second aspect, the present application provides a buffer expiration time adjusting apparatus, including:
the first acquisition module is used for acquiring the access frequency of cache content corresponding to the hotspot video in the cache;
the determining module is used for determining a frequency interval where the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relation;
the calculating module is used for calculating the target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period which are set when the data are cached and updated;
and the adjusting module is used for adjusting the original expiration time of the cache content to the target expiration time.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring a hot broadcast time period of the hot video;
the judging module is used for judging whether the current moment is within the hot broadcast time period;
a third obtaining module, configured to obtain an additional time period corresponding to the hot-air time period if the current time is within the hot-air time period;
the calculation module comprises:
and the first calculating unit is used for determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during caching of updated data as the target expiration time of the cached content.
Optionally, the apparatus further comprises:
and the early updating module is used for updating the cache content corresponding to the hotspot video in the cache if an early updating notice is received before the target expiration time of the hotspot video is reached.
Optionally, the first obtaining module is further configured to:
and acquiring the access frequency of the cache content corresponding to the hot video in the cache at preset time intervals.
In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
a processor, configured to implement the method for adjusting cache expiration time according to any one of the first aspect when executing a program stored in a memory.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a program of a cache expiration time adjusting method is stored, where the program of the cache expiration time adjusting method, when executed by a processor, implements the steps of the cache expiration time adjusting method according to any one of the first aspect.
Compared with the prior art, the technical scheme provided by the embodiment of the application has the following advantages:
according to the embodiment of the invention, the access frequency of the cache content corresponding to the hot spot video in the cache is obtained, the frequency interval where the access frequency is located and the frequency expiration time period corresponding to the frequency interval are determined in the preset frequency time period corresponding relation, the target expiration time of the cache content is calculated based on the fixed basic expiration time period and the frequency expiration time period which are set during cache updating data, and the original expiration time of the cache content can be adjusted to the target expiration time.
According to the embodiment of the invention, the target expiration time of the cache content can be automatically calculated according to the access frequency, and then the original expiration time of the cache content is adjusted to the target expiration time, so that the cache expiration time can be dynamically adjusted according to the access frequency of the hotspot video, the cache function is fully exerted, the pressure of persistent storage is reduced, the system stability is improved, and the condition that the cache content is expired in the hot broadcasting time period of the hotspot video due to the fact that the static default expiration time is kept unchanged all the time is avoided, and great pressure is brought to persistent storage resources, thereby affecting the performance of the whole system.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a flowchart of a method for adjusting cache expiration time according to an embodiment of the present disclosure;
fig. 2 is a structural diagram of a buffer expiration time adjusting apparatus according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the prior art, for example: when a certain television is broadcasted hot, the time for updating the video is up to night, and a large number of users are crowded to watch the video. The request amount of the background interface is soaring, the cache data can inevitably expire in the process of watching a video by a user, once the cache data expires, resources can only be obtained from the server, and great pressure is brought to persistent storage resources, so that the performance of the whole system is influenced. The method comprises the following steps:
step S101, acquiring the access frequency of cache content corresponding to the hot video in the cache;
in the embodiment of the present invention, a hot video may refer to a video with a heat value exceeding a preset threshold, where the heat value is a key indicator for determining whether the video is a hot video.
Exemplary, the heat value is scored specifically: the heat value includes a viewing behavior index, an interaction behavior index, and a sharing behavior index, and the weight of the data is distinguished according to the time period. Taking the content popularity as an example, in the calculation, the website refers to the values of two time periods: one is near 24 hours of viewing, interacting, sharing data; one is viewing, interacting, sharing data for nearly 30 days, and weighting higher with multidimensional data for nearly 24 hours. The watching data is not simply accumulated in playing amount, but is obtained by integrating data such as the number of users on the basis of calculating the integral time length and the completion degree of watching the video by the users, and even the positive film watching data and the film flower watching data need to be weighted and calculated, so that the watching data can reflect the watching quality better. As for the interactive behavior and the sharing behavior, the comprehensive calculation of the interactive behaviors such as user comments, praise, forward, barrage and the like is carried out, and the objectivity and the anti-cheating capability of the judgment are increased through an algorithm.
Before the step, a heat value of the video can be calculated firstly, and if the heat value exceeds a preset threshold, the video can be determined as a hot video; and a certain video can be manually set as a hot video according to the actual situation.
In this step, a predetermined hotspot video may be acquired, and the access frequency of the cache content corresponding to the hotspot video may be acquired in the cache, where the cache content may refer to a key (key) of the hotspot video; it may also refer to the name of the hotspot video, such as: "journey to the West"; but also the video content of the hotspot video, etc.
In practical application, the numerical value of the access frequency can be maintained by a server corresponding to the task center, and each time a certain video in the cache of the server corresponding to the service system receives access, a notification can be sent to the server corresponding to the task center, so that the server corresponding to the task center counts the access frequency of the cache content corresponding to the video.
In practical applications, in order to continuously extend the expiration time of the cached content, the step S101 may be executed again at intervals of a preset time period, where the preset time period may be set to 1 minute or 5 minutes, and so on according to actual requirements.
Step S102, determining a frequency interval where the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relation;
in the embodiment of the invention, because the number of times of requests of the hotspot videos with different access frequencies to the interface cache is different, the access frequency can be used as a basis for determining the target expiration time.
In the embodiment of the present invention, different frequency intervals may be divided in advance according to the access frequency of the cache content, where the different frequency intervals correspond to different frequency expiration time periods, for example, as shown in table 1 below:
TABLE 1
Frequency interval Frequency overdue time period (unit: s)
Over 1000 1200
500-1000 600
Within 500 300
In this step, the time interval in which the access frequency is located may be searched in table 1, for example, if the access frequency of a certain tv show is 1200 times in the hot-air time period, the time interval in which the 1200 times are located is 500-.
Step S103, calculating the target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set during caching of the update data;
step S104, adjusting the original expiration time of the cache content to the target expiration time.
In the embodiment of the present invention, the target expiration time should be greater than the original expiration time, and since the expiration time of the cache content is adjusted from the shorter original expiration time to the larger target expiration time, the expiration time of the cache content is extended, so that the cache content corresponding to the hotspot video can be obtained from the cache in a longer time period (longer than the original expiration time) before the target expiration time, thereby reducing access to the persistent storage resource at the server end, and avoiding a sudden increase in access to the persistent storage resource at the server end due to expiration of the cache content in a shorter time.
In this step, the server corresponding to the task center may update the cache expiration time, that is, adjust the default expiration time of the cache content to the target expiration time.
According to the embodiment of the invention, the access frequency of the cache content corresponding to the hot spot video in the cache is obtained, the frequency interval where the access frequency is located and the frequency expiration time period corresponding to the frequency interval are determined in the preset frequency time period corresponding relation, the target expiration time of the cache content is calculated based on the fixed basic expiration time period and the frequency expiration time period which are set during cache updating data, and the original expiration time of the cache content can be adjusted to the target expiration time.
According to the embodiment of the invention, the target expiration time of the cache content can be automatically calculated according to the access frequency, and then the original expiration time of the cache content is adjusted to the target expiration time, so that the cache expiration time can be dynamically adjusted according to the access frequency of the hotspot video, the cache function is fully exerted, the pressure of persistent storage is reduced, the system stability is improved, and the condition that the cache content is expired in the hot broadcasting time period of the hotspot video due to the fact that the static default expiration time is kept unchanged all the time is avoided, and great pressure is brought to persistent storage resources, thereby affecting the performance of the whole system.
In a further embodiment of the present invention, before step S103, the method further comprises:
acquiring a hot playing time period of the hot video;
in the embodiment of the present invention, the hot-playing time period of the hot video may be calculated with reference to the video update time, for example: the update time period of "journey to the west" is 20: 00, each set is 1 hour long, the playing time period 20 of the video can be set as follows: 00-21: 00 is determined as a hot-cast period.
Because the access quantity of the hotspot video in the hot broadcast time period is greatly different from that of the hotspot video in the non-hot broadcast time period, the number of times of the hotspot video requesting the interface cache in the hot broadcast time period is greatly increased, and the number of times of the hotspot video requesting the interface cache in the non-hot broadcast time period is possibly in a normal range, the sum of the hot broadcast time periods can be used as a basis for determining the target expiration time.
Judging whether the current moment is within the hot broadcast time period;
in practical applications, it may be determined whether the current time is within the hot-air time period every 0.5 second, 5 seconds, 10 seconds, or 1 minute, and the like, and the interval may be slightly longer in order to save resources, but should be smaller than the interval between the target expiration time and the default expiration time.
In this step, the current time may be compared with the smaller boundary and the larger boundary of the hot-cast time period, respectively, and if the current time is greater than the smaller boundary and less than the larger boundary, it may be determined that the current time is within the hot-cast time period, and if the current time is less than the smaller boundary or greater than the larger boundary, it may be determined that the current time is outside the hot-cast time period.
If the current moment is within the hot broadcast time period, acquiring an additional time period corresponding to the hot broadcast time period;
in the embodiment of the present invention, an additional time period may be preset, for example: an additional period of 300s (seconds), and so on.
Based on the foregoing, the step S103 includes:
and determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during the caching of the updated data as the target expiration time of the cached content.
In the embodiment of the present invention, a fixed basic expiration time period set when the updated data is cached may be preset, for example: the base expiration period is 300s (seconds), etc.
In this step, 300+300+1200 may be determined as the target expiration time, that is, the cache content may expire at 1800s (seconds) from the current time.
According to the embodiment of the invention, when the current time is within the hot broadcast time period, the target expiration time can be calculated according to the sum of the basic expiration time period, the additional time period and the frequency expiration time period, the variable of the relation between the current time and the hot broadcast time period is introduced, and when the current time is within the hot broadcast time period, the influence of the calculation process is considered, and the hot broadcast expiration additional time period is added after the sum of the basic expiration time period and the frequency expiration time period is calculated, so that the target expiration time obtained by final calculation is more accurate and appropriate.
Based on the foregoing embodiment, in another embodiment of the present invention, step S103 may further include the following steps:
if the current time is outside the hot broadcast time period, determining the sum of the basic expiration time period and the frequency expiration time period as the target expiration time;
in this step, it may be determined that 300+1200 is 1500s (seconds) as the target expiration time, that is, the cache content expires at 1500s (seconds) from the current time.
According to the embodiment of the invention, when the current time is outside the hot broadcast time period, the target expiration time can be calculated according to the basic expiration time period and the sum of the frequency expiration time periods, the influence of the calculation process is not considered when the current time is outside the hot broadcast time period by introducing the variable of the relation between the current time and the hot broadcast time period, and after the sum of the basic expiration time period and the frequency expiration time period is calculated, an additional time period is not added, so that the target expiration time obtained by final calculation is more accurate and appropriate.
Since the foregoing embodiment adjusts the original expiration time to the target expiration time, the expiration time of the cache contents has been extended, but in practical applications, there may be some special cache contents, such as: in another embodiment of the present invention, the method further includes that the method includes:
and before the target expiration time of the hotspot video is reached, if an advance updating notice is received, updating the cache content corresponding to the hotspot video in the cache.
In the embodiment of the present invention, the advance update notification may include the update content, or the update content may be sent to the server corresponding to the task center in another manner, and the server corresponding to the task center may update the cache content according to the update content when receiving the advance update notification, that is: and updating the original cache content in the cache into the updated content.
The embodiment of the invention can inform the server of updating the cache content in time in an asynchronous informing mode so as to be convenient for some scenes needing to update the cache content as soon as possible to use.
In another embodiment of the present invention, there is also provided a buffer expiration time adjusting apparatus, as shown in fig. 2, the apparatus including:
the first obtaining module 11 is configured to obtain access frequency of cache content corresponding to a hotspot video currently in a cache;
a determining module 12, configured to determine, in a preset frequency-time period correspondence relationship, a frequency interval in which the access frequency is located and a frequency expiration time period corresponding to the frequency interval;
a calculating module 13, configured to calculate a target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set when the update data is cached;
and an adjusting module 14, configured to adjust the original expiration time of the cached content to the target expiration time.
In yet another embodiment of the present invention, the apparatus further comprises:
the second acquisition module is used for acquiring a hot broadcast time period of the hot video;
the judging module is used for judging whether the current moment is within the hot broadcast time period;
a third obtaining module, configured to obtain an additional time period corresponding to the hot-air time period if the current time is within the hot-air time period;
the calculation module comprises:
and the first calculating unit is used for determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during caching of updated data as the target expiration time of the cached content.
In yet another embodiment of the present invention, the apparatus further comprises:
and the early updating module is used for updating the cache content corresponding to the hotspot video in the cache if an early updating notice is received before the target expiration time of the hotspot video is reached.
In another embodiment of the present invention, the first obtaining module is further configured to:
and acquiring the access frequency of the cache content corresponding to the hot video in the cache at preset time intervals.
In another embodiment of the present invention, an electronic device is further provided, which includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
the processor is configured to implement the method for adjusting cache expiration time according to the foregoing method embodiment when executing the program stored in the memory.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, on which a program of a cache expiration time adjusting method is stored, and when executed by a processor, the program of the cache expiration time adjusting method implements the steps of the cache expiration time adjusting method according to the foregoing method embodiment.
In the electronic device provided by the embodiment of the invention, the processor executes the program stored in the memory to realize that the access frequency of the cache content corresponding to the hot video in the cache is acquired, the frequency interval where the access frequency is located and the frequency expiration time period corresponding to the frequency interval are determined in the preset frequency time period corresponding relation, the target expiration time of the cache content is calculated based on the fixed basic expiration time period and the frequency expiration time period which are set when the data is updated in the cache, and the original expiration time of the cache content can be adjusted to the target expiration time. The target expiration time of the cache content is automatically calculated according to the access frequency, the original expiration time of the cache content is adjusted to the target expiration time, the cache expiration time is dynamically adjusted according to the access frequency of the hot video, the cache function is fully exerted, meanwhile, the pressure of persistent storage is relieved, the stability of the system is improved, and the condition that the cache content is expired in the hot broadcast time period of the hot video due to the fact that the default expiration time which is kept static all the time is unchanged is avoided, and huge pressure is brought to persistent storage resources, so that the performance of the whole system is influenced.
The communication bus 1140 mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 1140 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
The communication interface 1120 is used for communication between the electronic device and other devices.
The memory 1130 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The processor 1110 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present invention, which enable those skilled in the art to understand or practice the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A cache expiration time adjustment method is applied to a server, and comprises the following steps:
acquiring the access frequency of cache content corresponding to the hot video in the cache;
determining a frequency interval in which the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relationship;
calculating a target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set when the data is cached and updated;
and adjusting the original expiration time of the cache content to the target expiration time.
2. The method of adjusting cache expiration time according to claim 1, further comprising:
acquiring a hot playing time period of the hot video;
judging whether the current moment is within the hot broadcast time period;
if the current moment is within the hot broadcast time period, acquiring an additional time period corresponding to the hot broadcast time period;
calculating a target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period set when the data is cached and updated, including:
and determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during the caching of the updated data as the target expiration time of the cached content.
3. The method of adjusting cache expiration time according to claim 1, further comprising:
and before the target expiration time of the hotspot video is reached, if an advance updating notice is received, updating the cache content corresponding to the hotspot video in the cache.
4. The method for adjusting cache expiration time according to claim 1, wherein the step of obtaining access frequency of cache contents corresponding to the hot video currently in the cache comprises:
and executing the step of obtaining the access frequency of the cache content corresponding to the hot video in the cache at preset time intervals.
5. A cache expiration time adjusting apparatus, comprising:
the first acquisition module is used for acquiring the access frequency of cache content corresponding to the hotspot video in the cache;
the determining module is used for determining a frequency interval where the access frequency is located and a frequency expiration time period corresponding to the frequency interval in a preset frequency time period corresponding relation;
the calculating module is used for calculating the target expiration time of the cache content based on a fixed basic expiration time period and the frequency expiration time period which are set when the data are cached and updated;
and the adjusting module is used for adjusting the original expiration time of the cache content to the target expiration time.
6. The buffer expiration time adjustment apparatus according to claim 5, wherein the apparatus further comprises:
the second acquisition module is used for acquiring a hot broadcast time period of the hot video;
the judging module is used for judging whether the current moment is within the hot broadcast time period;
a third obtaining module, configured to obtain an additional time period corresponding to the hot-air time period if the current time is within the hot-air time period;
the calculation module comprises:
and the first calculating unit is used for determining the sum of the additional time period, the frequency expiration time period and a fixed basic expiration time period set during caching of updated data as the target expiration time of the cached content.
7. The cache expiration time adjustment apparatus of claim 6, wherein the apparatus further comprises:
and the early updating module is used for updating the cache content corresponding to the hotspot video in the cache if an early updating notice is received before the target expiration time of the hotspot video is reached.
8. The buffer expiration time adjustment apparatus according to claim 5, wherein the first obtaining module is further configured to:
and acquiring the access frequency of the cache content corresponding to the hot video in the cache at preset time intervals.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method of adjusting cache expiration time according to any one of claims 1 to 4 when executing a program stored in a memory.
10. A computer-readable storage medium, on which a program of a cache expiration time adjustment method is stored, the program of the cache expiration time adjustment method, when executed by a processor, implementing the steps of a cache expiration time adjustment method according to any one of claims 1 to 4.
CN201911413466.3A 2019-12-31 2019-12-31 Cache expiration time adjusting method and device, electronic equipment and storage medium Active CN111131856B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911413466.3A CN111131856B (en) 2019-12-31 2019-12-31 Cache expiration time adjusting method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911413466.3A CN111131856B (en) 2019-12-31 2019-12-31 Cache expiration time adjusting method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111131856A true CN111131856A (en) 2020-05-08
CN111131856B CN111131856B (en) 2022-03-11

Family

ID=70506552

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911413466.3A Active CN111131856B (en) 2019-12-31 2019-12-31 Cache expiration time adjusting method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111131856B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625566A (en) * 2020-05-29 2020-09-04 北京字节跳动网络技术有限公司 Data caching method, device, medium and equipment
CN111813715A (en) * 2020-06-29 2020-10-23 湖南快乐阳光互动娱乐传媒有限公司 Data caching method and device based on accessed times
CN112307069A (en) * 2020-11-12 2021-02-02 京东数字科技控股股份有限公司 Data query method, system, device and storage medium
CN112631963A (en) * 2020-12-25 2021-04-09 北京奇艺世纪科技有限公司 Cache data management method, device, equipment and storage medium
CN113727128A (en) * 2021-08-31 2021-11-30 上海哔哩哔哩科技有限公司 Hot spot traffic processing method and system
CN113946591A (en) * 2021-12-20 2022-01-18 北京力控元通科技有限公司 Hot data caching method and system and electronic equipment
CN114827159A (en) * 2022-03-31 2022-07-29 北京百度网讯科技有限公司 Network request path optimization method, device, equipment and storage medium
WO2022206487A1 (en) * 2021-03-30 2022-10-06 贵州白山云科技股份有限公司 Cache object updating method and apparatus, device, and storage medium

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020103975A1 (en) * 2001-01-26 2002-08-01 Dawkins William Price System and method for time weighted access frequency based caching for memory controllers
US20100121940A1 (en) * 2008-11-13 2010-05-13 At&T Corp. System and Method for Selectively Caching Hot Content in a Content Delivery System
US20120137336A1 (en) * 2010-11-29 2012-05-31 At&T Intellectual Property I, L.P. Content Placement
CN103945278A (en) * 2013-01-21 2014-07-23 中国科学院声学研究所 Video content and content source crawling method
CN104133880A (en) * 2014-07-25 2014-11-05 广东睿江科技有限公司 Method and device for setting file cache time
CN104391862A (en) * 2014-10-23 2015-03-04 北京锐安科技有限公司 Method and device for updating cache data
CN104917829A (en) * 2015-05-27 2015-09-16 努比亚技术有限公司 Background data management method and device
US20150356021A1 (en) * 2012-08-28 2015-12-10 Vantrix Corporation Method and system for self-tuning cache management
CN105824902A (en) * 2016-03-14 2016-08-03 乐视网信息技术(北京)股份有限公司 Data caching method and device
CN109190070A (en) * 2018-08-01 2019-01-11 北京奇艺世纪科技有限公司 A kind of data processing method, device, system and application server
CN109299144A (en) * 2018-08-22 2019-02-01 北京奇艺世纪科技有限公司 A kind of data processing method, device, system and application server
CN110046175A (en) * 2019-03-18 2019-07-23 阿里巴巴集团控股有限公司 A kind of buffer update, data return method and device
CN110263010A (en) * 2019-05-31 2019-09-20 广东睿江云计算股份有限公司 A kind of cache file automatic update method and device
CN110489063A (en) * 2019-08-27 2019-11-22 北京奇艺世纪科技有限公司 Cache setting method, device, electronic equipment and the storage medium of expired time

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020103975A1 (en) * 2001-01-26 2002-08-01 Dawkins William Price System and method for time weighted access frequency based caching for memory controllers
US20100121940A1 (en) * 2008-11-13 2010-05-13 At&T Corp. System and Method for Selectively Caching Hot Content in a Content Delivery System
US20120137336A1 (en) * 2010-11-29 2012-05-31 At&T Intellectual Property I, L.P. Content Placement
US20150356021A1 (en) * 2012-08-28 2015-12-10 Vantrix Corporation Method and system for self-tuning cache management
CN103945278A (en) * 2013-01-21 2014-07-23 中国科学院声学研究所 Video content and content source crawling method
CN104133880A (en) * 2014-07-25 2014-11-05 广东睿江科技有限公司 Method and device for setting file cache time
CN104391862A (en) * 2014-10-23 2015-03-04 北京锐安科技有限公司 Method and device for updating cache data
CN104917829A (en) * 2015-05-27 2015-09-16 努比亚技术有限公司 Background data management method and device
CN105824902A (en) * 2016-03-14 2016-08-03 乐视网信息技术(北京)股份有限公司 Data caching method and device
CN109190070A (en) * 2018-08-01 2019-01-11 北京奇艺世纪科技有限公司 A kind of data processing method, device, system and application server
CN109299144A (en) * 2018-08-22 2019-02-01 北京奇艺世纪科技有限公司 A kind of data processing method, device, system and application server
CN110046175A (en) * 2019-03-18 2019-07-23 阿里巴巴集团控股有限公司 A kind of buffer update, data return method and device
CN110263010A (en) * 2019-05-31 2019-09-20 广东睿江云计算股份有限公司 A kind of cache file automatic update method and device
CN110489063A (en) * 2019-08-27 2019-11-22 北京奇艺世纪科技有限公司 Cache setting method, device, electronic equipment and the storage medium of expired time

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
JIE GAO等: ""The Study of Dynamic Caching via State Transition Field—the Case of Time-Varying Popularity"", 《 IEEE TRANSACTIONS ON WIRELESS COMMUNICATIONS》 *
韩兵: ""面向Web系统热点数据预测及缓存管理的研究"", 《信息技术与信息化》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625566A (en) * 2020-05-29 2020-09-04 北京字节跳动网络技术有限公司 Data caching method, device, medium and equipment
CN111813715A (en) * 2020-06-29 2020-10-23 湖南快乐阳光互动娱乐传媒有限公司 Data caching method and device based on accessed times
CN112307069A (en) * 2020-11-12 2021-02-02 京东数字科技控股股份有限公司 Data query method, system, device and storage medium
CN112631963A (en) * 2020-12-25 2021-04-09 北京奇艺世纪科技有限公司 Cache data management method, device, equipment and storage medium
CN112631963B (en) * 2020-12-25 2023-09-01 北京奇艺世纪科技有限公司 Cache data management method, device, equipment and storage medium
WO2022206487A1 (en) * 2021-03-30 2022-10-06 贵州白山云科技股份有限公司 Cache object updating method and apparatus, device, and storage medium
CN113727128A (en) * 2021-08-31 2021-11-30 上海哔哩哔哩科技有限公司 Hot spot traffic processing method and system
CN113946591A (en) * 2021-12-20 2022-01-18 北京力控元通科技有限公司 Hot data caching method and system and electronic equipment
CN114827159A (en) * 2022-03-31 2022-07-29 北京百度网讯科技有限公司 Network request path optimization method, device, equipment and storage medium
CN114827159B (en) * 2022-03-31 2023-11-21 北京百度网讯科技有限公司 Network request path optimization method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111131856B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
CN111131856B (en) Cache expiration time adjusting method and device, electronic equipment and storage medium
CN109190070B (en) Data processing method, device and system and application server
CN108337563B (en) Video evaluation method, device, equipment and storage medium
CN109299144B (en) Data processing method, device and system and application server
CN108574685B (en) Streaming media pushing method, device and system
KR101782810B1 (en) Method, apparatus, and system for determining a location of a terminal
CN111767429B (en) Video recommendation method and device and electronic equipment
CN110661879B (en) Node scheduling method, device and system, scheduling server and terminal equipment
CN112929676A (en) Live data stream acquisition method, device, node and system
CN110830565B (en) Resource downloading method, device, system, electronic equipment and storage medium
CN108647240B (en) Method and device for counting access amount, electronic equipment and storage medium
CN111782692B (en) Frequency control method and device
US20090198653A1 (en) System And Method For Device Profiling Using Cascaded Databases
EP2782014A1 (en) Method and apparatus for managing cache memory in communication system
CN110620828A (en) File pushing method, system, device, electronic equipment and medium
CN111124952B (en) Data management method and device, electronic equipment and readable storage medium
CN111107438A (en) Video loading method and device and electronic equipment
CN111597213A (en) Caching method, software server and storage medium
CN110677684B (en) Video processing method, video access method, distributed storage method and distributed video access system
CN112631963B (en) Cache data management method, device, equipment and storage medium
CN109729314B (en) Video processing method and device, electronic equipment and storage medium
CN111291252A (en) Method and device for adjusting query rate per second, electronic equipment and storage medium
CN112069386A (en) Request processing method, device, system, terminal and server
CN113918776B (en) Data caching method and device, electronic equipment and data query method
CN114676074A (en) Access request processing 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