Content heat decay method and device in CDN
By obtaining the access popularity value of the requested content in CDN, screening and grading it, and combining it with the carrying capacity of edge node devices, the problem of the content popularity decay method in CDN being highly dependent on manual labor is solved, and automatic balanced scheduling and efficient utilization of CDN resources are achieved.
Patent Information
- Application Number
- CN202310143403.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-21
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-02-21
AI Technical Summary
The existing content heat decay method in CDN uses hardware isolation, which results in a high reliance on manual labor to balance the overall different CP channels. This makes it difficult to effectively utilize CDN resources and cannot achieve automatic balanced resource scheduling.
By obtaining the access heat value of the requested content in the CDN within a unit time, the target hot content queue is screened out and uploaded to the heat calculation center for hierarchical processing. Combined with the carrying capacity of the edge node devices in the cluster where the main node device is located, the high-hot content is diffused or reduced to form a target hierarchical linked list, realizing the isolation of request content from different CP channels and automatic balanced scheduling of resources.
It realizes automatic balanced scheduling of CDN resources, avoids hardware isolation, improves the carrying capacity of the main node equipment, effectively utilizes CDN resources, and ensures non-interference and efficient storage management between multiple CP channels.
Smart Images

Figure CN116319999B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of content distribution networks, and in particular to a method and device for fading content popularity in a CDN. Background Art
[0002] Content Delivery Network (CDN) caching is crucial for CDN operations. A CDN stores a copy of a file initially delivered to a user and reuses it for subsequent requests. When users access resources that are too large or in high volumes, these resources can overwhelm the cache space on CDN nodes, rendering them inaccessible to popular resources. Therefore, it's necessary to degrade popular resources or content, balancing cache configurations across nodes and conserving storage space.
[0003] Currently, content decay in CDNs is primarily calculated using two methods: content age and expiration weighting. The content age calculation method uses the Active Directory Service (ATS) to determine the freshness (or expiration) of the requested content and then requests the origin server. If the content is expired, the requested content is updated or deleted, and the corresponding origin server is retrieved again. This decay method can easily tilt the weight of content from different channels or different CP channels on a CDN toward channels with high CPs, resulting in slow content service for channels with low CPs. These channels can only be physically isolated through hardware to prevent interference, making the overall CDN decay highly dependent on manual effort. The expiration weighting factor calculation method, on the other hand, is based on metrics such as the storage time of the requested content. This method combines multiple metrics, such as storage time, content priority, weighting factor, and current time, to calculate the current index. The method then calculates the ranking of each requested content within the overall content database. While addressing the CP skewness inherent in the content age calculation method, it still relies on hardware isolation to balance CP service.
[0004] Therefore, the existing technology isolates the content decay in CDN through hardware, resulting in a high reliance on manual labor to balance the overall different CP channels, making it difficult to effectively utilize CDN resources and unable to achieve automatic balanced scheduling of CDN resources. Summary of the Invention
[0005] The present invention provides a method and device for fading content heat in CDN, which are used to solve the defects of content heat decay processing in CDN in the prior art, realize dynamic and efficient utilization of CDN resources to provide services, and achieve automatic balanced scheduling of CDN resources.
[0006] The present invention provides a content heat decay method in a CDN, which is applied to a master node device. The method includes:
[0007] Obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content, and upload the target hot content queue to the heat calculation center;
[0008] Receiving a target classification linked list obtained after the popularity calculation center performs classification processing on the target request content in the target popularity content queue;
[0009] Based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high popularity in the current CP channel is expanded or reduced.
[0010] According to a method for fading content popularity in a CDN provided by the present invention, the target hierarchical linked list includes at least one linked list area, and the step of spreading or shrinking the target request content with high popularity in the current CP channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located includes:
[0011] According to the storage level of the linked list area, each linked list area in the target hierarchical linked list is traversed in turn, and the following steps are performed on the traversed linked list area:
[0012] Traversing each target request content in the current linked list area, and obtaining the real-time heat value of the traversed target request content;
[0013] Obtaining a bearing heat threshold of the edge node device of the cluster where the master node device is located for the traversed target request content;
[0014] The real-time heat value is compared with the load heat threshold, and whether to perform diffusion processing or contraction processing on the traversed target request content is determined according to the comparison result.
[0015] According to a content heat decay method in a CDN provided by the present invention, the step of comparing the real-time heat value with the load heat threshold and determining, based on the comparison result, whether to expand or shrink the traversed target request content includes:
[0016] If the real-time heat value is less than the bearer heat threshold, determining a first edge node device for caching the traversed target request content according to a preset local cache rule, so as to cache the target request content;
[0017] If the real-time heat value is greater than or equal to the load heat threshold, the quotient of the real-time heat value and the load heat threshold is calculated, and the traversed target request content is diffused to a number of second edge node devices corresponding to the quotient value, so that the target edge device can cache the traversed target request content.
[0018] According to a method for content heat decay in a CDN provided by the present invention, after the step of calculating a quotient of the real-time heat value and the load heat threshold if the real-time heat value is greater than or equal to the load heat threshold, the method further includes:
[0019] If the quotient value is less than the current diffusion number of the traversed target request content, the quotient value and the target edge device corresponding to the quotient value are updated to a local diffusion queue, where the local diffusion queue is determined by a diffusion strategy of historical target request content.
[0020] According to a content heat decay method in a CDN provided by the present invention, the request content includes meta data and media data, the meta data and the media data have a one-to-one correspondence, and the media data is used to feedback request information of the request content.
[0021] The step of obtaining the requested content in the CDN within a unit time and preliminarily screening the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content includes:
[0022] Based on the unit time, obtaining the meta data of the requested content in the CDN;
[0023] Based on the access popularity value corresponding to the meta data, the target popularity content queue corresponding to the current CP channel is preliminarily screened out.
[0024] According to a content popularity decay method in a CDN provided by the present invention, the step of preliminarily screening out a target popularity content queue corresponding to the current CP channel based on the access popularity value corresponding to the meta data includes:
[0025] determining, according to the amount of the meta data within the unit time, an initial heat decay strategy for preprocessing the meta data;
[0026] Calculating the access heat value corresponding to each meta data based on the initial heat decay strategy;
[0027] The access heat values are sorted by heat, and the meta data corresponding to the access heat values that meet the preset upload quantity threshold form a target heat content queue.
[0028] According to a method for fading content heat in a CDN provided by the present invention, the step of determining an initial heat decay strategy for pre-processing the meta data based on the amount of the meta data within the unit time includes:
[0029] Obtaining the amount of the meta data within the unit time;
[0030] Obtaining a preset preprocessing quantity threshold, where the preprocessing quantity threshold is determined based on a popularity difference discrimination parameter of requested content in the CDN;
[0031] The amount of the meta data is compared with the preprocessing amount threshold, and the initial heat decay strategy is determined according to the comparison result.
[0032] According to a content heat decay method in a CDN provided by the present invention, the initial heat decay strategy includes a Newton cooling law algorithm.
[0033] The step of comparing the amount of the meta data with the pre-processing amount threshold and determining the initial heat decay strategy according to the comparison result includes:
[0034] When the amount of the meta data is greater than or equal to the preprocessing amount threshold, the initial thermal decay strategy is determined to be a Newton's cooling law algorithm.
[0035] According to a content heat decay method in a CDN provided by the present invention, the initial heat decay strategy includes a conventional decay law algorithm.
[0036] The step of comparing the amount of the meta data with the pre-processing amount threshold and determining the initial heat decay strategy according to the comparison result includes:
[0037] When the amount of the meta data is less than the preprocessing amount threshold, the initial heat decay strategy is determined to be a conventional decay law algorithm.
[0038] According to a content popularity decay method in a CDN provided by the present invention, the step of uploading the target popularity content queue to a popularity calculation center includes:
[0039] Using a compression algorithm to compress the target popularity content queue;
[0040] The compressed target popularity content queue is uploaded to the popularity calculation center.
[0041] According to a content popularity decay method in a CDN provided by the present invention, the step of receiving a target ranking linked list obtained after the popularity calculation center performs ranking processing on the popular content in the target popular content queue includes:
[0042] receiving the target hierarchical linked list fed back by the popularity calculation center, wherein, upon receiving the target popularity content queue, the popularity calculation center performs popularity screening on each target request content in the target popularity content queue, hierarchically saves the screened target request content based on a preset basic hierarchical linked list, obtains a target hierarchical linked list, and feeds the target hierarchical linked list back to the master node device;
[0043] The basic hierarchical linked list is created according to the service capability of the cluster where the master node device is located for the requested content in the CDN.
[0044] The present invention provides a content popularity decay method in a CDN, which is applied to a popularity calculation center. The method comprises:
[0045] When the target popularity content queue is received, weighted processing is performed on the target request content in the target popularity content queue to obtain a real-time popularity value of each target request content;
[0046] Obtaining a basic hierarchical linked list, where the basic hierarchical linked list is created based on the service capability of the cluster where the master node device is located for the requested content in the CDN;
[0047] Based on the real-time heat value, the target request content is saved in the basic hierarchical linked list to form a target hierarchical linked list, and the target hierarchical linked list is fed back to the main node device so that the main node device can diffuse or shrink the high-heat target request content in the current CP channel through the cluster where the main node device is located according to the target hierarchical linked list.
[0048] According to a content heat decay method in CDN provided by the present invention,
[0049] The basic hierarchical linked list includes at least one storage level, and the at least one storage level is arranged according to the popularity of the stored data.
[0050] The step of saving the target request content into the basic hierarchical linked list based on the real-time heat value to form a target hierarchical linked list includes:
[0051] Traverse the linked list area corresponding to each storage level in the basic hierarchical linked list, and perform the following steps on the traversed linked list area:
[0052] Get the amount of storage content in the current linked list area;
[0053] According to the real-time popularity value of the target request content, select the target request content corresponding to the number of stored contents from high to low;
[0054] The selected target request content is saved in the current linked list area, and the target request content that has been saved in the basic hierarchical linked list in the target heat content queue is removed, and the step of traversing the linked list area corresponding to each storage level in the basic hierarchical linked list is continued until the target hierarchical linked list is formed.
[0055] The present invention also provides a content heat decay device in a CDN, comprising:
[0056] The content acquisition module is used to obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center;
[0057] A linked list receiving module is used to receive a target hierarchical linked list obtained after the popularity calculation center performs hierarchical processing on the target request content in the target popularity content queue;
[0058] The content decay processing module is used to diffuse or shrink the target request content with high popularity in the current CP channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the main node device is located.
[0059] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for fading content heat in a CDN as described above is implemented.
[0060] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for fading content heat in a CDN as described above is implemented.
[0061] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned methods for fading content heat in a CDN.
[0062] The content heat decay method and device in CDN provided by the present invention obtains the requested content in CDN within a unit time, and based on the access heat value of the requested content, preliminarily screens out the target heat content queue corresponding to the current CP channel, and uploads the target heat content queue to the heat calculation center; receives the target hierarchical linked list obtained after the heat calculation center performs hierarchical processing on the target request content in the target heat content queue; based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high heat in the current CP channel is diffused or reduced. That is, the master node device obtains the request content of different CP channels, and screens out the request content with high heat and uploads it to the heat calculation center. The heat calculation center performs heat grading on the request content of different CP channels of different master node devices and forms a target hierarchical linked list. The target hierarchical linked list realizes the isolation of the request content of different CP channels, so that multiple CP channels do not interfere with each other, avoiding the use of hardware isolation. At the same time, through the carrying capacity of the edge node device in the cluster where the main node device is located, combined with the target hierarchical linked list, the high-heat target request content in the current CP channel is diffused or reduced in size, thereby improving the carrying capacity of the main node device, effectively utilizing CDN resources, and achieving automatic balanced scheduling of CDN resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0064] Figure 1 This is one of the flow charts of the content heat decay method in CDN provided by the present invention;
[0065] Figure 2 This is a schematic diagram of the CDN model architecture in the content heat decay method in the CDN provided by the present invention;
[0066] Figure 3 This is a diagram showing the attenuation effect of Newton's cooling law in the content heat decay method in the CDN provided by the present invention;
[0067] Figure 4 This is a diagram showing the attenuation effect of a conventional attenuation algorithm in the content heat decay method in the CDN provided by the present invention;
[0068] Figure 5 This is the second flow chart of the content heat decay method in CDN provided by the present invention;
[0069] Figure 6 This is a diagram showing the attenuation effect of the weighted algorithm in the content heat decay method in the CDN provided by the present invention;
[0070] Figure 7 This is a flow chart of content heat decay processing in CDN provided by the present invention;
[0071] Figure 8 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0072] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0073] The following combination Figures 1-8 The content heat decay method in CDN of the present invention is described. The content heat decay method in CDN is applied to the master node device. Figure 1 , the method comprising:
[0074] Step S100: Obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center;
[0075] Step S200: receiving a target hierarchical linked list obtained by the popularity calculation center after hierarchically processing the target request content in the target popularity content queue, wherein the target hierarchical linked list includes each of the request contents and its corresponding real-time popularity value;
[0076] Step S300 : Based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high popularity in the current CP channel is diffused or reduced.
[0077] This embodiment aims to: perform heat classification on the requested content in the CDN, and automatically and evenly schedule CDN resources based on the carrying capacity of the edge node devices in the cluster where the master node device is located.
[0078] In this embodiment, the specific application scenarios are:
[0079] In a CDN (Content Delivery Network), when users access resources that are too large or in large numbers, these resources can take up cache space on CDN nodes, making it impossible to store popular resources. Therefore, it's necessary to decay popular resources or content to balance the cache configurations across nodes and conserve storage space.
[0080] Given the aforementioned reasons, current solutions primarily calculate the decline in popularity of CDN content through content age calculation and expiration weighting. However, these two methods isolate content decline in CDNs through hardware, resulting in a high reliance on manual effort to balance content across various CP channels. This hinders the effective utilization of CDN resources and prevents automated resource balancing.
[0081] As an example, the basic concept of a CDN (Content Delivery Network) is to minimize bottlenecks and links on the internet that can affect data transmission speed and stability, thereby ensuring faster and more stable content delivery. By placing node servers throughout the network, forming an intelligent virtual network built on top of the existing internet, the CDN system can redirect user requests to the nearest service node in real time based on comprehensive information such as network traffic, node connectivity, load status, distance to the user, and response time. The goal is to ensure that users can access the content they need closest to them, alleviate internet congestion, and improve the response time of website users.
[0082] As an example, see Figure 2 , Figure 2This is a diagram of the CDN model architecture. A CDN, or content delivery network, aims to minimize bottlenecks and links on the internet that could affect data transmission speed and stability, ensuring faster and more stable content delivery. The CDN network consists of a global server load balancer (GSLB), CDN central node devices, master node devices, edge node devices, and origin servers. When a user initiates a DNS request, it is forwarded to one of the CDN's DNS servers, which are part of the GSLB. GSLB provides load balancing, providing a high-level view of the entire CDN network and tracking all available resources and their performance. GSLB resolves the DNS request using the best-performing edge node device (typically located near the user). After DNS resolution is complete, the user initiates a request to the edge node device. When the edge node device receives the request, the GSLB server helps the edge server forward the request to the origin server (the origin server) using the optimal route. The edge server then retrieves the requested data, delivers it to the end user, and stores the data locally. All subsequent user requests are processed from the local dataset without re-querying the origin server. During this process, the master node device allocates the corresponding edge server for storage according to the popularity of the data.
[0083] As an example, a CP (Content Provider) channel refers to a provider channel in a CDN that receives and provides information corresponding to requested content. For example, different CP channels in a CDN include Alibaba Cloud, ChinaCache, Kingsoft Cloud, and other manufacturers.
[0084] It should be noted that different CP channels have different access popularity values for the same request content, but there is no distinction between large and small CP channels. The request content or data collected through CP channels do not affect each other, and the same quality of service is provided.
[0085] As an example, the request content in a CDN refers to the server resources corresponding to the user request, such as streaming media. Streaming media technology compresses a series of media data and transmits it in segments across the network in a streaming manner, enabling real-time transmission of audio and video for viewing. Therefore, when caching HLS-based streaming media files in a CDN, streaming media files of different bitrates have different corresponding popularity. Based on the different popularity, the corresponding streaming media files can be calculated for heat decay and cached.
[0086] The specific steps are as follows:
[0087] Step S100: Obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center;
[0088] As an example, the access popularity value refers to the number of times a certain requested content in the CDN is requested or accessed by a user.
[0089] It should be noted that the data related to the request content collected by each master node device in the CDN is independent of each other and is not interfered with by data collected by other master nodes. Therefore, for the request content collected by different master nodes, the request content is subjected to heat decay processing based on the access value of the request content in the current CP channel to improve the accuracy of the HLS protocol-based heat in the CDN and the balance of heat diffusion.
[0090] As an example, the unit time for each master node device in the CDN to obtain the requested content remains consistent, and the unit time is determined according to the service capability of the master node device. For example, the default granularity is 300 seconds.
[0091] As an example, the master node device in the CDN cluster obtains the request content in the current cp channel of the current master node device based on the unit time, and performs heat sorting according to the unit time, cp channel, request content, and the access heat value corresponding to the request content to form an initial sorting table. Based on the access heat value, the request content that will meet the upload requirements is screened out from the initial sorting table to form the target heat content queue of the current cp channel, and the target heat content queue is uploaded to the heat calculation center for the heat calculation center to perform graded processing on the uploaded request content, so as to facilitate the subsequent targeted heat decay of each request content.
[0092] As an example, the upload requirement can be a value configured locally on the master node device. For example, if the value is N, it can be understood that the top N data in the initial sorted table formed by sorting the access heat values from high to low can be uploaded. Thus, a target heat content queue is generated based on the unit time, the current CP channel dimension, and the requested content. That is, the target heat content queue maintains a URI of the CP channel heat content per unit time and the corresponding access heat value.
[0093] It should be noted that the request content obtained per unit time refers to valid request content, that is, it does not include request content in scenarios such as error retries and token expiration caused by lag when users visit a website, thereby reducing the number of processing per unit time and improving the accuracy of the request content popularity based on the HLS protocol in CDN.
[0094] For example, when the request content is streaming media, to improve the processing efficiency of the streaming media file, the collected request content can rely solely on meta data. Meta data is used to describe the request content and can be used to determine the corresponding video file or video clip in the streaming media file.
[0095] As an example, taking the CDN's cache master node device, CP channel and unit time as a joint unit, a collection script is used to collect or obtain meta top heat data once according to the access situation. The meta top data is used as the summary data of the target heat content queue for heat decay calculation, and the target request content corresponding to the meta data is expanded or reduced.
[0096] As an example, the step of uploading the target popularity content queue to the popularity calculation center includes:
[0097] Step S110, compressing the target popularity content queue using a compression algorithm;
[0098] Step S120: Upload the compressed target popularity content queue to the popularity calculation center.
[0099] As an example, a compression algorithm uses the Huffman coding algorithm. Its basic concept is to cyclically select the two nodes with the lowest frequency to generate a subtree until a tree is formed. Its compression rate typically ranges from 20% to 90%. The Huffman coding algorithm uses a table of character frequencies in a file to establish an optimal representation of each character using a string of 0s and 1s. By assigning shorter codes to frequently occurring characters and longer codes to less frequently occurring characters, the overall code length can be significantly reduced.
[0100] In this embodiment, due to the performance properties of the Huffman coding algorithm, it does not need to rely on the entire text for probability statistics, nor does it require a larger amount of computation. Therefore, using the Huffman coding algorithm to compress the target request content in the target content queue before uploading it to the popularity calculation center can reduce the comprehensive processing pressure of the popularity calculation center and improve the efficiency of popularity decay processing.
[0101] Step S200, receiving a target classification linked list obtained by the popularity calculation center after performing classification processing on the target request content in the target popularity content queue;
[0102] As an example, the target hierarchical linked list includes at least one linked list area. Different linked list areas have different storage levels. Linked list areas with higher storage levels have larger storage spaces and can store more request content. It can be understood that the target hierarchical linked list is divided into levels S1 to SN. The data or request content stored in the S1 linked list area is the most popular. N is determined by the service capacity of the server of the master node device.
[0103] In this embodiment, a target hierarchical linked list fed back by a hotspot computing center is received to determine the heat level of the target request content, so that the high-heat request content can be evenly distributed in combination with the carrying capacity of the master node device cluster, to ensure that the CDN cache master node device storage can be calculated at the minimum cost, and the disk space can be efficiently used to expand and shrink the hot content, thereby improving the node carrying capacity and saving storage space.
[0104] As an example, the step of receiving the target classification linked list obtained after the popularity calculation center performs classification processing on the hot contents in the target hot content queue includes:
[0105] Step S210: Upon receiving the target hot content queue, the popularity calculation center performs a heat screening on each target request content in the target hot content queue, hierarchically stores the screened target request content based on a preset basic hierarchical linked list, obtains a target hierarchical linked list, and feeds the target hierarchical linked list back to the master node device, wherein the basic hierarchical linked list is created based on the service capability of the cluster where the master node device is located for the requested content in the CDN;
[0106] Step S220: receiving the target hierarchical linked list fed back by the heat calculation center.
[0107] As an example, the basic hierarchical linked list is the same as the target hierarchical linked list. The basic hierarchical linked list serves as the initialized hierarchical linked list, and forms the target hierarchical linked list after storing the request content. Therefore, the basic hierarchical linked list also includes at least one linked list area. Different linked list areas have different storage levels. The larger the storage level, the larger the storage space of the linked list area, and the more request content can be stored. It can be understood that the basic hierarchical linked list is divided into levels S1 to SN. The data or request content stored in the S1 linked list area is the most popular, and N is determined by the service capacity of the server of the master node device.
[0108] Each linked list region has a weight range, with the head and tail representing the maximum and minimum weights at that level, respectively. The access popularity values of the target request content in the target popularity content queue are updated in real time to the hierarchical linked list, traversing from S1 to SN. If the current linked list region reaches its maximum, the tail value is placed at the head of the next set by default. This process continues downwards until the entire cycle is complete. If the overall target hierarchical linked list reaches its maximum, the target request content with the lowest score is eliminated.
[0109] It should be noted that each cp channel of each master node device has a target hierarchical linked list, and each linked list area of the target hierarchical linked list is isolated from each other to prevent data interference.
[0110] In this embodiment, a target hierarchical linked list fed back by the hotspot computing center is received to determine the heat level of the target request content, so that the high-heat request content can be evenly distributed in combination with the carrying capacity of the master node device cluster, so as to ensure that the CDN cache master node device storage can be calculated at the minimum cost, and the disk space can be efficiently used to expand and shrink the hot content, thereby improving the node carrying capacity and saving storage space. At the same time, multiple CP channels do not interfere with each other and use CDN resources more dynamically and efficiently to provide services.
[0111] Step S300 : Based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high popularity in the current CP channel is diffused or reduced.
[0112] As an example, the cluster where the master node device is located includes the current master node device and the edge node connected to the master node device. The edge node is used to cache the data of the target requested content so that when the user accesses the requested content here within the effective time, the data of the requested content is fed back from the edge node close to the user to improve the response efficiency of the CDN network.
[0113] As an example, the carrying capacity of an edge node refers to the capacity of the edge node to carry the requested content of the current CP channel. Different CP channels have different carrying capacities on different edge nodes.
[0114] In this embodiment, after the master node device receives the target hierarchical linked list, it combines the carrying capacity of the edge node device in the cluster where the master node device is located to diffuse or shrink the target request content with high popularity in the current CP channel, better balance the CDN cluster edge node resources, and more efficiently improve the cluster carrying capacity to achieve the effect of free and balanced resource scheduling.
[0115] As an example, the step of spreading or shrinking the hot target request content in the current CP channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located includes:
[0116] Step S310: traverse each linked list area in the target hierarchical linked list in turn according to the storage level of the linked list area, and perform the following steps on the traversed linked list area:
[0117] Step S311, traversing each target request content in the current linked list area, and obtaining the real-time popularity value of the traversed target request content;
[0118] Step S312: Obtain the bearer heat threshold of the edge node device of the cluster where the master node device is located for the traversed target request content;
[0119] Step S313 : comparing the real-time heat value with the load heat threshold, and determining whether to perform expansion processing or contraction processing on the traversed target request content according to the comparison result.
[0120] As an example, the target hierarchical linked list includes at least one linked list area, each linked list area has a different storage level, and the target request content in the linked list area with a higher storage level has a higher heat, and the target request content is preferentially subjected to heat decay processing. Therefore, according to the storage level of the linked list area in the target hierarchical linked list, traverse from high to low, and perform heat decay processing on each target request content in the traversed linked list area. It should be noted that the target request content in the linked list area of the same storage level also has different real-time heat values. Therefore, the target request content in the linked list area is subjected to heat decay processing in the order of the real-time heat values from large to small.
[0121] Specifically, the process of heat decay processing of the target request content is as follows:
[0122] Because clusters of different master node devices have different carrying capacities for target request content from different CP channels, the heat threshold for the current target request content is obtained from the edge node devices in the cluster where the master node device resides. The real-time heat value of the current target request content is compared with the heat threshold to determine whether the edge node device can carry the heat of the target request content. Based on the comparison results, a heat decay strategy for the current target request content is determined, such as diffusion processing or reduction processing.
[0123] As an example, if the real-time heat value is less than the carrying heat threshold, it is determined that the edge node device is capable of carrying the heat of the target request content. At this time, the target request content is subjected to heat decay processing according to the local caching rules preset in the master node device. The local caching rules include the first edge device for carrying the target request content. Therefore, the master node device allocates the target request content to the target edge device for caching by the target edge device, thereby achieving heat decay processing of the request content.
[0124] As an example, if the real-time heat value is greater than or equal to the carrying heat threshold, it means that the first edge node device in the local cache rule cannot carry the target request content. Therefore, the target request content needs to be diffused to the second edge node device outside the local cache rule. Specifically, the quotient of the real-time heat value and the carrying heat threshold is calculated, and the target request content is diffused to the number of copies corresponding to the quotient value. For example, when the real-time heat value of a target request content reaches X times the carrying heat threshold, the target request content will be diffused into X copies, where X<M, and M is the maximum number of edge nodes in the cluster where the current master node device is located.
[0125] Therefore, X second edge node devices for spreading the target request content are determined, and the target request content is cached by the X second edge node devices.
[0126] As an example, the target request content is updated to the second edge node device for caching in the local diffusion queue. It should be noted that the local diffusion queue is determined by the diffusion strategy of the historical target request content, that is, the local diffusion queue refers to the edge node device information set for caching data corresponding to the target request content in the local cache rule.
[0127] As an example, when it is determined that the X second edge node devices used for the diffusion of the target request content do not exist in the local diffusion queue, it is necessary to reduce the capacity of the target request content. That is, the diffusion node of the target request content is directly reduced to 1 (X=1), and only one edge node is needed to achieve the heat decay processing of the target request content.
[0128] As an example, if the quotient value is less than the current diffusion number of the traversed target request content, the quotient value and the second edge device corresponding to the quotient value are updated to the local diffusion queue to free up more CDN space in the master node device cluster.
[0129] In this embodiment, based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the main node device is located, the target request content with high popularity in the current CP channel is diffused or reduced in size to better balance the CDN cluster edge node resources and improve the cluster carrying capacity, so as to make full use of the CDN hardware resources and achieve automatic balanced scheduling of CDN resources.
[0130] The present invention provides a method and device for fading content heat in a CDN. Compared with the current heat fading process, which is difficult to effectively utilize CDN resources and cannot automatically balance CDN resources, the present invention obtains the requested content in the CDN within a unit time, and based on the access heat value of the requested content, preliminarily screens out the target heat content queue corresponding to the current CP channel, and uploads the target heat content queue to the heat calculation center; receives the target hierarchical linked list obtained after the heat calculation center performs hierarchical processing on the target request content in the target heat content queue; based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high heat in the current CP channel is diffused or reduced. That is, the master node device obtains the request content of different CP channels, screens out the request content with high heat and uploads it to the heat calculation center. The heat calculation center performs heat grading on the request content of different CP channels of different master node devices and forms a target hierarchical linked list. The target hierarchical linked list realizes the isolation of the request content of different CP channels, so that multiple CP channels do not interfere with each other, avoiding the use of hardware isolation. At the same time, through the carrying capacity of the edge node device in the cluster where the main node device is located, combined with the target hierarchical linked list, the high-heat target request content in the current CP channel is diffused or reduced in size, thereby improving the carrying capacity of the main node device, effectively utilizing CDN resources, and achieving automatic balanced scheduling of CDN resources.
[0131] Based on the first embodiment of the method for fading content popularity in a CDN, a second embodiment of the method for fading content popularity in a CDN is proposed.
[0132] The request content includes meta data and media data, and the meta data and the media data correspond one to one. The media data is used to feedback the request information of the request content.
[0133] Due to the huge amount of popular access data in CDN, in order to reduce the amount of data uploaded for requested content and control the pressure on the popularity calculation center, the HLS protocol can be used to aggregate and upload data for each requested content by only taking meta data. This also facilitates data statistics for the requested content at the TV or bitrate level.
[0134] It is understandable that since collecting media data and filtering out the top media hotness and coldness is not very meaningful, only meta data is collected. Specifically, ① media data is severely fragmented, and the TOP data in the media data tends to be concentrated in individual pieces (i.e., video files when the requested content is streaming media); ② Large-scale data collection will inevitably bring huge system load; ③ The function of media data is similar to the top N of meta data and is not very meaningful; ④ 1.ts in the media data cannot represent all user behaviors of the film. When the user initiates a resume or skips the beginning of the film, it is considered that the video will not be played from the first piece, which leads to inaccurate media data. Therefore, collecting data only relies on the meta hotness and coldness TOP, and does not rely on the media hotness and coldness TOP, which can avoid high system load.
[0135] As an example, the step of obtaining requested content in the CDN within a unit time and preliminarily screening a target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content includes:
[0136] Step A1: acquiring the meta data of the requested content in the CDN based on the unit time;
[0137] Step A2: Preliminarily filter out the target hot content queue corresponding to the current CP channel based on the access heat value corresponding to the meta data.
[0138] As an example, the master node device retrieves the metadata of the requested content from the CDN based on a unit time, and obtains the access popularity value corresponding to the metadata. It should be noted that the access popularity value of the metadata is consistent with the access popularity value of the requested content. Therefore, based on the metadata and the access popularity value corresponding to the metadata, the top N metadata are filtered out to form the target popular content queue for the current CP channel.
[0139] In this embodiment, by obtaining the meta data of the requested content and forming a target heat content queue for uploading to the heat calculation center based on the meta data, the amount of data uploaded can be reduced and the pressure on the heat calculation center can be controlled.
[0140] As an example, the step of preliminarily screening out a target hot content queue corresponding to the current CP channel based on the access popularity value corresponding to the meta data includes:
[0141] Step A21, determining an initial heat decay strategy for preprocessing the meta data according to the amount of the meta data within the unit time;
[0142] Step A22: Calculate the access popularity value corresponding to each meta data based on the initial popularity decay strategy;
[0143] In step A23, the access heat values are sorted by heat, and the meta data corresponding to the access heat values that meet the preset upload quantity threshold form a target heat content queue.
[0144] To improve the accuracy of meta data heat, the meta data is preprocessed. Specifically, the meta data obtained by the master node devices is sorted and retained from high to low according to the locally preset retention number, and the retained meta data is preprocessed. It should be noted that the server retention number corresponding to each master node device can be different, which is determined by the server configuration and the service capabilities provided by the server. The retention number is usually 1000.
[0145] As an example, after preprocessing and collecting meta data and obtaining retained meta data, the retained meta data is first calculated locally for heat. Based on the amount of meta data obtained and retained per unit time, the heat calculation strategy, that is, the initial heat decay strategy for preprocessing the meta data, is determined.
[0146] As an example, the initial heat decay strategy includes two algorithms: Newton's cooling law and conventional decay. Newton's cooling law serves as the primary algorithm, while conventional decay serves as a secondary algorithm, working together to filter out the latest local heat data. It can be understood that if the heat difference is large, the primary algorithm (Newton's cooling law) will be used for heat calculation; if the heat difference is small, the secondary algorithm (conventional decay) will be used for calculation.
[0147] Therefore, based on the initial heat decay strategy, the corresponding access heat value of the meta data is calculated in sequence according to the meta data retained in the initial sorting. Based on the access heat value, the pre-processed meta data is re-sorted by heat, and the meta data that meets the preset upload quantity threshold forms the target heat content queue.
[0148] It should be noted that the sorting of meta data is based on the pre-processed access popularity value of each CP channel per unit time, and is arranged from high to low according to access popularity value. If the upload quantity threshold is exceeded, only the meta data within the upload quantity threshold is retained. In other words, the access popularity value is filtered from high to low to select the amount of meta data corresponding to the upload quantity threshold, forming the target hot content queue.
[0149] As an example, the step of determining an initial heat decay strategy for preprocessing the meta data according to the amount of the meta data in the unit time includes:
[0150] Step A211, obtaining the amount of the meta data within the unit time;
[0151] Step A212: obtaining a preset pre-processing quantity threshold, where the pre-processing quantity threshold is determined based on a popularity difference discrimination parameter of the requested content in the CDN;
[0152] Step A213 : comparing the amount of the meta data with the pre-processing amount threshold, and determining the initial heat decay strategy based on the comparison result.
[0153] As an example, the amount of meta data per unit time refers to the amount of request content (ie, meta data) that can be covered in one acquisition time of the master node device.
[0154] As an example, the preset pre-processing quantity threshold refers to the processing quantity determined according to the service capacity provided by the server of the master node device, and is usually 1024 by default.
[0155] As an example, the amount of meta data collected per unit time is compared with a preprocessing threshold. The comparison results indicate the difference in meta data popularity within the unit time, which in turn determines the corresponding initial popularity decay strategy. If the difference is large, the primary algorithm (Newton's law of cooling) will be used for popularity calculation. If the difference is small, the secondary algorithm (conventional decay) will be used.
[0156] As an example, the step of comparing the amount of the meta data with the preprocessing amount threshold and determining the initial heat decay strategy according to the comparison result includes:
[0157] Step B1: When the amount of the meta data is greater than or equal to the pre-processing amount threshold, determining that the initial thermal decay strategy is a Newton's cooling law algorithm.
[0158] As an example, see Figure 3 , Figure 3 This is a diagram showing the attenuation effect of Newton's cooling law. When the number of meta data items that can be covered during the sequential collection time is greater than or equal to 1024, the Newton's cooling law algorithm is used to calculate the access popularity value of the meta data.
[0159] Specifically, Newton's law of cooling is as follows:
[0160] H(t)=H(t o )×e -k(to-t) +H(t o -t)
[0161] Where H is the access heat value, t is the current time, to is the unit time, and k is the cooling coefficient. To ensure the accuracy of the cooling algorithm, to can be defined as a fixed time period for the heat calculation center for each calculation. If the data integration unit time of the master node device corresponding to the server is greater than the fixed time period, the historical heat of the same meta data before to is calculated first, and then the current access heat value is calculated.
[0162] As an example, the step of comparing the amount of the meta data with the preprocessing amount threshold and determining the initial heat decay strategy according to the comparison result includes:
[0163] Step B2: When the amount of the meta data is less than the pre-processing amount threshold, determining that the initial heat decay strategy is a conventional decay law algorithm.
[0164] As an example, see Figure 4 , Figure 4 This is the decay effect diagram of the conventional decay algorithm. When the total amount of content in the channel is too small, that is, the number of content per unit time is less than 1024, the change of the Newton's cooling law algorithm is not drastic or obvious, and it is difficult to judge the difference in content popularity. Therefore, the conventional decay algorithm will be used. The formula is as follows:
[0165] H=[H(t o )*qt+H(t)]*10 5
[0166] Where H(to) is the historical popularity, t is the unit time, and q is the decay factor per unit time, with q < 1. This algorithm is automatically implemented by switching to the cache master node cluster, without requiring excessive human intervention. Time weighting can clearly divide the content popularity distribution range.
[0167] Based on the first embodiment or the second embodiment of the method for fading content popularity in a CDN, a third embodiment of the method for fading content popularity in a CDN is proposed.
[0168] The following combination Figure 5-Figure 6 The content heat decay method in CDN of the present invention is described. The content heat decay method in CDN is applied to the heat calculation center. Figure 5 , the method comprising:
[0169] Step S400: upon receiving the target popularity content queue, weighting the target request content in the target popularity content queue to obtain a real-time popularity value of each target request content;
[0170] Step S500: Obtain a basic hierarchical linked list, where the basic hierarchical linked list is created based on the service capability of the cluster where the master node device is located for the requested content in the CDN.
[0171] In step S600, the target request content is saved into the basic hierarchical linked list based on the real-time heat value to form a target hierarchical linked list, and the target hierarchical linked list is fed back to the master node device so that the master node device can diffuse or shrink the target request content with high heat in the current CP channel through the cluster where the master node device is located according to the target hierarchical linked list.
[0172] As an example, in order to improve the stability of the heat value of each target request content of each cp channel uploaded by each master node device, the heat calculation center collects the target heat content queue uploaded by each master node device according to the time granularity, and performs weighted calculation on each target request content in the target heat content queue.
[0173] As an example, the weighted algorithm is an improved algorithm based on the Hacker News voting ranking algorithm, which makes the weighted algorithm more adaptable to the heat decay processing mechanism of streaming media based on the HLS protocol.
[0174] Specifically, refer to Figure 6 , Figure 6 The figure below shows the attenuation effect of the weighted algorithm. The real-time popularity value of the current target request content is calculated using the gravity pull-down model of the weighted algorithm combined with the time granularity t, the popularity value St, and the decay factor g. The formula is as follows:
[0175] S=[(S t / (t+2)g)+h]*10 5
[0176] Among them, S is the popularity value, St is the past popularity value, t is the time granularity, g is the gravity factor, and h is the current popularity value. The time is added with 2 to prevent the denominator from being too small due to the latest film (the specific choice of 2 is based on the two time units of the original algorithm as the content release time), multiplied by 10 5 This is because the CDN access volume is very small and it is difficult to clearly distinguish between hot and cold content, so it is appropriately amplified.
[0177] It should be noted that the larger the g value, the steeper the curve and the faster the ranking decline, which means the ranking is updated more quickly. Acker News defines the specific g value based on actual business observations. For example, 1.5, 1.8, and 2.0 are divided into three decline levels. These three decline levels have the same effect. The popularity of the target request content corresponding to a decline level of 1.5 declines more slowly than the popularity of the target request content corresponding to a decline level of 2.0 declines.
[0178] As an example, the weighted data is stored in a hash data model of a channel, where the key in the hash data model is the target request content and the value is the real-time heat value summary or average of the current master node device.
[0179] As an example, a basic hierarchical linked list is obtained. The basic hierarchical linked list is created based on the service capabilities of the cluster in which the master node device resides for the requested content in the CDN. The basic hierarchical linked list includes at least one linked list area. Different linked list areas have different storage levels. Linked list areas with higher storage levels have greater storage space and can store more requested content. It is understood that the target hierarchical linked list is divided into levels S1 to SN, with the S1 linked list area storing the most popular data or requested content. N is determined by the service capabilities of the master node device's server.
[0180] Based on the real-time heat value of each target request content in the target heat content queue, the target request content is saved in a basic hierarchical linked list to form a target hierarchical linked list, and the target hierarchical linked list is fed back to the main node device so that the main node device can diffuse or shrink the high-heat target request content in the current CP channel through the cluster where the main node device is located according to the target hierarchical linked list.
[0181] Each linked list region has a weight range, with the head and tail representing the maximum and minimum weights at that level, respectively. The access popularity values of the target request content in the target popularity content queue are updated in real time to the hierarchical linked list, traversing from S1 to SN. If the current linked list region reaches its maximum, the tail value is placed at the head of the next set by default. This process continues downwards until the entire cycle is complete. If the overall target hierarchical linked list reaches its maximum, the target request content with the lowest score is eliminated.
[0182] As an example, the step of saving the target request content into the basic hierarchical linked list based on the real-time popularity value to form a target hierarchical linked list includes:
[0183] Step S610: traverse the linked list area corresponding to each storage level in the basic hierarchical linked list, and perform the following steps on the traversed linked list area:
[0184] Step S620, obtaining the amount of storage content in the current linked list area;
[0185] Step S630, selecting target request content corresponding to the number of stored contents from high to low according to the real-time popularity value of the target request content;
[0186] Step S640, save the selected target request content in the current linked list area, and remove the target request content in the target hot content queue that has been saved to the basic hierarchical linked list, and continue to execute the step of traversing the linked list area corresponding to each storage level in the basic hierarchical linked list until the target hierarchical linked list is formed.
[0187] As an example, the basic hierarchical linked list includes at least one storage level, and the at least one storage level is arranged according to the popularity of the stored data and is divided into levels S1 to SN.
[0188] Traverse the gradient from S1 to SN step by step, and perform the following process on the traversed SN:
[0189] Get the number of storage contents in the linked list area corresponding to the SN level. The number of storage contents refers to the number of storage spaces in the current linked list area. For example, if S1 has 10 spaces and one space stores one request content, then 10 request contents will be stored in S1.
[0190] According to the real-time heat value of the target request content in the target heat content queue, the target request content is sorted in descending order, and the target request content corresponding to the storage content quantity of the current linked list area is selected from at least one target request content in turn, and the selected target request content is saved in the current linked list area. After the storage of the current linked list area is saturated, the storage operation is performed on the linked list area of the next storage level, and the remaining target request content is stored in the linked list area of the next storage level in order according to the real-time heat value. This process ends when all the target request content that needs to be saved has been saved to the basic hierarchical linked list or the storage of all linked list areas in the basic hierarchical linked list is saturated, thus forming a target hierarchical linked list.
[0191] As an example, if S1 has 10 spaces, each storing one request content, then S1 will store 10 request contents. The top 10 target request contents are selected from the target request contents sorted from high to low based on real-time popularity values, and these 10 target request contents are stored in S1, completing the ranking of the basic ranking list S1 and the popularity ranking of the 10 target request contents.
[0192] When S1 is full, the next level S2 continues to store the requested content. The specific implementation of storing the requested content in S2 is basically the same as that in S1 and will not be repeated here. The process ends when the target hierarchical linked list is full or all the requested content that needs to be stored is stored. That is, the target hierarchical linked list is formed.
[0193] As an example, if the number of request contents that need to be stored is less than or equal to the number of storage contents of the target hierarchical linked list, the storage ends when all the request contents that need to be stored are stored; if the number of request contents that need to be stored is greater than the number of storage contents of the target hierarchical linked list, that is, when a storage conflict occurs, the request contents in the target heat queue are stored in order of their heat, and the original data or data with a heat lower than the heat of the current request content will be downgraded or eliminated.
[0194] It can be understood that if the target hierarchical linked list can store 10,000 resources or request contents, the number of resources or request contents provided to users is 100,000, and the number of resources or request contents received by the heat calculation center is 20,000, then the resources or request contents that need to be stored exceed the maximum storage capacity of the target hierarchical linked list. Therefore, according to the heat of the request contents, the most heat-sensitive request contents are first stored in the high-storage-level linked list area (such as S1). When the target hierarchical linked list is saturated, the remaining request contents that need to be stored are eliminated and not stored.
[0195] What is more noteworthy is that if the target hierarchical linked list storage is saturated, there is currently a request content that needs to be stored, and based on the access heat value of the request content, it is determined that it can be stored in the S2 level. At this time, the request content is stored in the S2-level linked list area, and the request content at the end of the original S2-level linked list area will be downgraded and saved in S3. At the same time, the heat level of the request content at the end of the original S2-level linked list area is also downgraded from S2 to S3, so that when the subsequent main node device diffuses or shrinks the high-heat target request content in the current CP channel according to the target hierarchical linked list and the carrying capacity of the cluster where the main node device is located, the CDN resources can be used dynamically and efficiently to provide services, so as to achieve automatic balanced scheduling according to the heat of the target request content.
[0196] In this embodiment, when the target heat content queue is received, the target request content in the target heat content queue is weighted to obtain the real-time heat value of each target request content; a basic hierarchical linked list is obtained, and the basic hierarchical linked list is created according to the service capability of the cluster where the master node device is located for the requested content in the CDN; based on the real-time heat value, the target request content is saved in the basic hierarchical linked list to form a target hierarchical linked list, and the target hierarchical linked list is fed back to the master node device, so that the master node device can perform diffusion or reduction processing on the target request content with high heat in the current cp channel through the cluster where the master node device is located according to the target hierarchical linked list. That is, in the present invention, the heat calculation center calculates the real-time heat value of the target request content through the improved weighted algorithm, which ensures the stability of the heat value of each target request content and improves the accuracy of the CDN content heat based on the HLS protocol. By performing hierarchical processing on the target request content based on the target request content, the real-time heat value of the target request content and the basic hierarchical linked list, a target hierarchical linked list is obtained. When the main node device processes the heat decay of the request content, the target hierarchical linked list selects different diffusion or shrinking strategies according to the target request content of different levels to ensure the heat decay processing speed and achieve automatic balanced scheduling of CDN resources.
[0197] As an example, see Figure 7 In some scenarios, the content popularity decay process in CDN is as follows:
[0198] Step 1: Using the CDN master node device, CP channel, and unit time as a combined unit, use the collection script to collect meta data based on the access situation;
[0199] Step 2: Sort by the access popularity value of the meta data to obtain the local top list;
[0200] Step 3: Perform decay preprocessing on the meta data in the local TOP list. The decay preprocessing algorithm includes a main algorithm (Newton's cooling law algorithm) and an auxiliary algorithm (conventional decay algorithm). The meta data after decay preprocessing is re-sorted and filtered to obtain the target popularity content queue;
[0201] Step 4: The master node device compresses the target hot content queue using the Huffman coding algorithm and uploads it to the hot calculation center;
[0202] Step 5: The popularity calculation center collects the target hot content queue uploaded by each master node device based on time granularity, and uniformly weights the target request content in the target hot content queue using a weighted algorithm improved from the Hacker News voting ranking algorithm to obtain the real-time popularity value of the target request content;
[0203] Step 6: Based on the real-time heat value of the target request content, the target request content is graded and saved in the basic graded linked list, thereby achieving heat grading of the target request content and forming a target graded linked list;
[0204] Step 7: The heat calculation center returns the target hierarchical linked list to the master node device;
[0205] Step 8: The master node device calculates the heat decay mode of each target request content, such as diffusion or shrinkage, based on the heat rating of the target request content in the target rating chain and the carrying capacity of the edge node devices in the cluster where the master node device is located.
[0206] Step 9: When the master node device receives the instruction for diffusion or shrinking processing, it controls the edge node devices of the cluster where the master node device is located to execute the diffusion or shrinking strategy calculated in step 8 to complete the heat decay processing of the target request content.
[0207] The following describes a device for fading content heat in a CDN provided by the present invention. The device for fading content heat in a CDN described below and the method for fading content heat in a CDN described above can refer to each other.
[0208] The present invention also provides a content heat decay device in a CDN, which is applied to a master node device, and the device includes:
[0209] The content acquisition module is used to obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current CP channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center;
[0210] A linked list receiving module is used to receive a target hierarchical linked list obtained after the popularity calculation center performs hierarchical processing on the target request content in the target popularity content queue;
[0211] The content decay processing module is used to diffuse or shrink the target request content with high popularity in the current CP channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the main node device is located.
[0212] And / or, the content decay processing module further includes:
[0213] The first traversal submodule is configured to traverse each linked list area in the target hierarchical linked list in sequence according to the storage level of the linked list area, and perform the following steps on the traversed linked list area:
[0214] The second traversal submodule is used to traverse each target request content in the current linked list area and obtain the real-time heat value of the traversed target request content;
[0215] A first acquisition submodule is configured to acquire a bearing heat threshold of the edge node device of the cluster where the master node device is located for the traversed target request content;
[0216] a comparison submodule, configured to compare the real-time heat value with the load heat threshold, and determine whether to perform expansion processing or contraction processing on the traversed target request content according to the comparison result;
[0217] The target hierarchical linked list includes at least one linked list area.
[0218] And / or, the comparison submodule further includes:
[0219] A first result unit is configured to determine, if the real-time heat value is less than the bearer heat threshold, a first edge node device for caching the traversed target request content according to a preset local cache rule, so as to cache the target request content;
[0220] The second result unit is used to calculate the quotient of the real-time heat value and the carrying heat threshold if the real-time heat value is greater than or equal to the carrying heat threshold, and diffuse the traversed target request content to a number of second edge node devices corresponding to the quotient value, so that the target edge device can cache the traversed target request content.
[0221] And / or, the comparison submodule further includes:
[0222] The third result unit is used to update the quotient value and the target edge device corresponding to the quotient value to the local diffusion queue if the quotient value is less than the current diffusion number of the traversed target request content. The local diffusion queue is determined by the diffusion strategy of the historical target request content.
[0223] And / or, the content acquisition module further includes:
[0224] A second acquisition submodule, configured to acquire the meta data of the requested content in the CDN based on the unit time;
[0225] The first screening submodule is used to preliminarily screen out a target hot content queue corresponding to the current CP channel based on the access popularity value corresponding to the meta data;
[0226] The request content includes meta data and media data, the meta data corresponds to the media data one-to-one, and the media data is used to feed back request information of the request content.
[0227] And / or, the first screening submodule further includes:
[0228] a strategy determination unit, configured to determine an initial heat decay strategy for preprocessing the meta data according to the amount of the meta data within the unit time;
[0229] a heat calculation unit, configured to calculate an access heat value corresponding to each of the meta data based on the initial heat decay strategy;
[0230] The screening unit is used to perform heat sorting on the access heat values, and the meta data corresponding to the access heat values that meet the preset upload quantity threshold constitute a target heat content queue.
[0231] And / or, the strategy determination unit further includes:
[0232] A first acquiring subunit, configured to acquire the amount of the meta data within the unit time;
[0233] A second acquisition subunit is configured to acquire a preset pre-processing quantity threshold, where the pre-processing quantity threshold is determined based on a popularity difference discrimination parameter of requested content in the CDN;
[0234] The comparison subunit is used to compare the amount of the meta data with the preprocessing amount threshold, and determine the initial heat decay strategy according to the comparison result.
[0235] And / or, the comparison subunit is further used for:
[0236] The initial heat decay strategy includes a Newton's law of cooling algorithm. When the amount of the meta data is greater than or equal to the preprocessing amount threshold, the initial heat decay strategy is determined to be the Newton's law of cooling algorithm.
[0237] And / or, the comparison subunit is further used for:
[0238] The initial heat decay strategy includes a conventional decay law algorithm. When the amount of the meta data is less than the preprocessing amount threshold, the initial heat decay strategy is determined to be the conventional decay law algorithm.
[0239] And / or, the content acquisition module further includes:
[0240] A compression submodule, configured to compress the target popularity content queue using a compression algorithm;
[0241] The upload submodule is used to upload the compressed target hot content queue to the hot calculation center.
[0242] And / or, the linked list receiving module further includes:
[0243] a linked list receiving submodule, configured to receive the target hierarchical linked list fed back by the popularity calculation center, wherein upon receiving the target popularity content queue, the popularity calculation center performs a popularity screening on each target request content in the target popularity content queue, hierarchically stores the screened target request content based on a preset basic hierarchical linked list, obtains a target hierarchical linked list, and feeds the target hierarchical linked list back to the master node device;
[0244] The basic hierarchical linked list is created according to the service capability of the cluster where the master node device is located for the requested content in the CDN.
[0245] The present invention also provides a content popularity decay device in a CDN, which is applied to a popularity calculation center. The device includes:
[0246] a content receiving module configured to perform weighted processing on target request contents in the target popularity content queue upon receiving the target popularity content queue, so as to obtain a real-time popularity value of each target request content;
[0247] A linked list acquisition module, configured to acquire a basic hierarchical linked list, wherein the basic hierarchical linked list is created based on the service capability of the cluster where the master node device is located for the requested content in the CDN;
[0248] A linked list creation module is used to save the target request content into the basic hierarchical linked list based on the real-time heat value to form a target hierarchical linked list, and feed the target hierarchical linked list back to the main node device so that the main node device can diffuse or shrink the high-heat target request content in the current CP channel through the cluster where the main node device is located according to the target hierarchical linked list.
[0249] And / or, the linked list creation module further includes:
[0250] The third traversal submodule is configured to traverse the linked list area corresponding to each storage level in the basic hierarchical linked list, and perform the following steps on the traversed linked list area:
[0251] The third acquisition submodule is used to obtain the amount of storage content in the current linked list area;
[0252] A second screening submodule is configured to select target request contents corresponding to the number of stored contents from high to low according to the real-time popularity value of the target request contents;
[0253] a linked list creation submodule, configured to save the selected target request content in the current linked list area, remove the target request content in the target popularity content queue that has been saved in the basic hierarchical linked list, and continue to execute the step of traversing the linked list area corresponding to each storage level in the basic hierarchical linked list until the target hierarchical linked list is formed;
[0254] The basic hierarchical linked list includes at least one storage level, and the at least one storage level is arranged according to the popularity of the stored data.
[0255] Figure 8 An example of a physical structure diagram of an electronic device is shown below. Figure 8 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840. The processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 may call logic instructions in the memory 830 to execute the steps of the content heat decay method in the CDN.
[0256] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0257] The specific implementation of the content heat decay device in the CDN of the present application is basically the same as the embodiments of the content heat decay method in the CDN described above, and will not be repeated here.
[0258] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the steps of the content heat decay method in the CDN provided by the above methods.
[0259] The specific implementation of the computer program product of the present application is basically the same as the embodiments of the content heat decay method in the above-mentioned CDN, and will not be repeated here.
[0260] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the steps of the content heat decay method in the CDN provided by the above methods.
[0261] The specific implementation of the storage medium of the present application is basically the same as the embodiments of the content heat decay method in the above-mentioned CDN, and will not be repeated here.
[0262] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0263] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0264] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for fading content popularity in a CDN, characterized in that: Applied to a master node device, the content heat decay method in the CDN includes: Obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current supplier channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center; Receiving a target classification linked list obtained after the popularity calculation center performs classification processing on the target request content in the target popularity content queue; Based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located, the target request content with high popularity in the current supplier channel is expanded or reduced; The method comprises: When the target popularity content queue is received, weighted processing is performed on the target request content in the target popularity content queue to obtain a real-time popularity value of each target request content; Obtaining a basic hierarchical linked list, where the basic hierarchical linked list is created based on the service capability of the cluster where the master node device resides for the requested content in the CDN, and includes at least one linked list area, where different linked list areas have different storage levels, and where a linked list area with a higher storage level has a larger storage space and can store more requested content; Based on the real-time heat value, the target request content is saved in the basic hierarchical linked list to form a target hierarchical linked list, and the target hierarchical linked list is fed back to the master node device, so that the master node device can perform diffusion or reduction processing on the high-heat target request content in the current supplier channel through the cluster where the master node device is located according to the target hierarchical linked list; each linked list area has a weight value range, where the head and tail represent the maximum weight and the minimum weight of the level respectively, and the access heat value of the target request content in the target heat content queue is updated to the hierarchical linked list in real time. If the number stored in the current linked list area reaches the maximum, the tail value is placed in the head of the next level by default; then it goes down in sequence until all the cycles are completed. If the number stored in the overall target hierarchical linked list reaches the maximum, the target request content with the lowest score is eliminated; The basic hierarchical linked list includes at least one storage level, and the at least one storage level is arranged according to the popularity of the stored data. The step of saving the target request content into the basic hierarchical linked list based on the real-time heat value to form a target hierarchical linked list includes: Traverse the linked list area corresponding to each storage level in the basic hierarchical linked list, and perform the following steps on the traversed linked list area: Get the amount of storage content in the current linked list area; According to the real-time popularity value of the target request content, select the target request content corresponding to the number of stored contents from high to low; The selected target request content is saved in the current linked list area, and the target request content that has been saved in the basic hierarchical linked list in the target heat content queue is removed, and the step of traversing the linked list area corresponding to each storage level in the basic hierarchical linked list is continued until the target hierarchical linked list is formed.
2. The method for fading content popularity in CDN according to claim 1, characterized in that: The target hierarchical linked list includes at least one linked list area, The step of spreading or shrinking the hot target request content in the current supplier channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located includes: According to the storage level of the linked list area, each linked list area in the target hierarchical linked list is traversed in turn, and the following steps are performed on the traversed linked list area: Traversing each target request content in the current linked list area, and obtaining the real-time heat value of the traversed target request content; Obtaining a bearing heat threshold of the edge node device of the cluster where the master node device is located for the traversed target request content; The real-time heat value is compared with the load heat threshold, and whether to perform diffusion processing or contraction processing on the traversed target request content is determined according to the comparison result.
3. The method for fading content popularity in a CDN according to claim 2, characterized in that: The step of comparing the real-time heat value with the load heat threshold and determining, based on the comparison result, whether to perform expansion or contraction processing on the traversed target request content includes: If the real-time heat value is less than the bearer heat threshold, determining a first edge node device for caching the traversed target request content according to a preset local cache rule, so as to cache the target request content; If the real-time heat value is greater than or equal to the load heat threshold, the quotient of the real-time heat value and the load heat threshold is calculated, and the traversed target request content is diffused to a number of second edge node devices corresponding to the quotient value, so that the target edge device caches the traversed target request content; If the quotient value is less than the current diffusion number of the traversed target request content, the quotient value and the target edge device corresponding to the quotient value are updated to a local diffusion queue, where the local diffusion queue is determined by a diffusion strategy of historical target request content.
4. The method for fading content popularity in a CDN according to claim 1, wherein: The request content includes meta data and media data, the meta data corresponds to the media data one-to-one, and the media data is used to feedback the request information of the request content. The step of obtaining the requested content in the CDN within a unit time and preliminarily screening out a target hot content queue corresponding to the current supplier channel based on the access popularity value of the requested content includes: Based on the unit time, obtaining the meta data of the requested content in the CDN; Based on the access popularity value corresponding to the meta data, a target popularity content queue corresponding to the current supplier channel is preliminarily screened out.
5. The method for fading content popularity in CDN according to claim 4, characterized in that: The step of preliminarily screening out a target hot content queue corresponding to the current supplier channel based on the access popularity value corresponding to the meta data includes: determining, according to the amount of the meta data within the unit time, an initial heat decay strategy for preprocessing the meta data; Calculating the access heat value corresponding to each meta data based on the initial heat decay strategy; The access heat values are sorted by heat, and the meta data corresponding to the access heat values that meet the preset upload quantity threshold form a target heat content queue.
6. The method for fading content popularity in CDN according to claim 5, characterized in that: The step of determining an initial heat decay strategy for preprocessing the meta data according to the amount of the meta data within the unit time includes: Obtaining the amount of the meta data within the unit time; Obtaining a preset preprocessing quantity threshold, where the preprocessing quantity threshold is determined based on a popularity difference discrimination parameter of requested content in the CDN; The amount of the meta data is compared with the preprocessing amount threshold, and the initial heat decay strategy is determined according to the comparison result.
7. The method for fading content popularity in a CDN according to claim 1, wherein: The step of receiving a target grading linked list obtained after the popularity calculation center grading the popularity content in the target popularity content queue comprises: receiving the target hierarchical linked list fed back by the popularity calculation center, wherein, upon receiving the target popularity content queue, the popularity calculation center performs popularity screening on each target request content in the target popularity content queue, hierarchically saves the screened target request content based on a preset basic hierarchical linked list, obtains a target hierarchical linked list, and feeds the target hierarchical linked list back to the master node device; The basic hierarchical linked list is created according to the service capability of the cluster where the master node device is located for the requested content in the CDN.
8. A content popularity decay device in a CDN, characterized by: The content heat decay device in the CDN includes: The content acquisition module is used to obtain the requested content in the CDN within a unit time, preliminarily screen out the target hot content queue corresponding to the current supplier channel based on the access popularity value of the requested content, and upload the target hot content queue to the popularity calculation center; A linked list receiving module is used to receive a target hierarchical linked list obtained after the popularity calculation center performs hierarchical processing on the target request content in the target popularity content queue; A content decay processing module, configured to perform diffusion or reduction processing on the target request content with high popularity in the current supplier channel based on the target hierarchical linked list and the carrying capacity of the edge node device of the cluster where the master node device is located; The device further comprises: a content receiving module configured to perform weighted processing on target request contents in the target popularity content queue upon receiving the target popularity content queue, so as to obtain a real-time popularity value of each target request content; a linked list acquisition module, configured to acquire a basic hierarchical linked list, wherein the basic hierarchical linked list is created based on the service capability of the cluster in which the master node device resides for the requested content in the CDN, and includes at least one linked list area, wherein different linked list areas have different storage levels, and linked list areas with higher storage levels have larger storage space and can store more requested content; A linked list creation module is used to save the target request content into the basic hierarchical linked list based on the real-time heat value to form a target hierarchical linked list, and feed the target hierarchical linked list back to the master node device, so that the master node device can perform diffusion or reduction processing on the high-heat target request content in the current supplier channel through the cluster where the master node device is located according to the target hierarchical linked list; each linked list area has a weight value range, in which the head and tail represent the maximum weight and minimum weight of the level respectively, and the access heat value of the target request content in the target heat content queue is updated to the hierarchical linked list in real time. If the number stored in the current linked list area reaches the maximum, the tail value is placed in the head of the next level by default; then it goes down in sequence until all the cycles are completed. If the number stored in the overall target hierarchical linked list reaches the maximum, the target request content with the lowest score is eliminated; The basic hierarchical linked list includes at least one storage level, and the at least one storage level is arranged according to the popularity of the stored data. The linked list creation module further includes: The third traversal submodule is configured to traverse the linked list area corresponding to each storage level in the basic hierarchical linked list, and perform the following steps on the traversed linked list area: The third acquisition submodule is used to obtain the amount of storage content in the current linked list area; A second screening submodule is configured to select target request contents corresponding to the number of stored contents from high to low according to the real-time popularity value of the target request contents; The linked list creation submodule is used to save the selected target request content in the current linked list area, and to remove the target request content in the target hot content queue that has been saved to the basic hierarchical linked list, and continue to execute the step of traversing the linked list area corresponding to each storage level in the basic hierarchical linked list until the target hierarchical linked list is formed.
Citation Information
Patent Citations
CDN (Content Delivery Network) and content distribution and scheduling method
CN102891869A
Heat management method based on cached data, server, and storage medium
CN109471875A
Method and system for real-time elastic increase and decrease of CDN hotspot content
CN112689166A