CN108900570B - A Cache Replacement Method Based on Content Value - Google Patents
A Cache Replacement Method Based on Content Value Download PDFInfo
- Publication number
- CN108900570B CN108900570B CN201810538215.7A CN201810538215A CN108900570B CN 108900570 B CN108900570 B CN 108900570B CN 201810538215 A CN201810538215 A CN 201810538215A CN 108900570 B CN108900570 B CN 108900570B
- Authority
- CN
- China
- Prior art keywords
- content
- value
- popularity
- cost
- time
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000005540 biological transmission Effects 0.000 claims abstract description 18
- 238000004364 calculation method Methods 0.000 claims abstract description 15
- 235000008694 Humulus lupulus Nutrition 0.000 claims description 9
- 238000013461 design Methods 0.000 description 6
- 230000007423 decrease Effects 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
- H04L67/5682—Policies or rules for updating, deleting or replacing the stored data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明揭示了一种基于内容价值的缓存替换方法,包括统计内容的流行度、计算每个内容的缓存代价、计算内容最近一次被访问的时间和当前时间的时间间隔、及计算缓存空间中每个内容的价值并替换价值的最小值。本发明不仅能够将高流行度的内容提前缓存下来,而且对高缓存代价的内容也有很好的响应,从而有效地提高了节点数据替换的准确性,有利于提高内容中心网络的数据传输效率,改善用户的上网体验。
The invention discloses a cache replacement method based on content value, which includes statistics of the popularity of the content, calculation of the cache cost of each content, calculation of the time interval between the time when the content was last accessed and the current time, and the calculation of each content in the cache space. the value of each content and replace the minimum value of the value. The invention can not only cache the content with high popularity in advance, but also have a good response to the content with high cache cost, thereby effectively improving the accuracy of node data replacement, and helping to improve the data transmission efficiency of the content center network. Improve the user's online experience.
Description
技术领域technical field
本发明涉及一种缓存替换方法,尤其涉及一种基于内容价值的缓存替换方法,属于通信技术领域。The invention relates to a cache replacement method, in particular to a content value-based cache replacement method, and belongs to the technical field of communications.
背景技术Background technique
随着互联网技术的高速发展,网络信息和用户上网接入设备数量剧增,导致网络流量呈指数级增长,这种爆炸式的流量增长给基于端到端的网络之间互连的协议(Internet Protocol,IP)网络体系结构带来了巨大的挑战和压力。为了解决移动网络中巨大的数据流量带来的冲击,研究者们提出了以内容为中心的全新网络架构——内容中心网络(Content-Centric Networking,CCN)。在内容中心网络中,每一个节点都具有缓存功能,通过将流行内容长时间缓存在距离用户较近的节点上,可以有效的缓解回传链路带宽的压力,降低网络时延从而改善用户的体验质量。With the rapid development of Internet technology, the number of network information and users accessing the Internet has increased dramatically, resulting in an exponential increase in network traffic. , IP) network architecture brings great challenges and pressures. In order to solve the impact of huge data traffic in mobile networks, researchers have proposed a new content-centric network architecture—Content-Centric Networking (CCN). In the content-centric network, each node has a caching function. By caching popular content on nodes closer to the user for a long time, it can effectively relieve the pressure on the bandwidth of the backhaul link, reduce the network delay and improve the user experience. quality of experience.
然而,每个节点的缓存容量是有限的,当缓存空间被占满后,必须根据一定的替换策略将缓存中价值较小的内容清理出来,存放新的有意义的数据,以提高缓存空间的请求命中率,由此可见,合理地对缓存内容进行管理和置换是影响网络整体性能的关键。However, the cache capacity of each node is limited. When the cache space is full, the less valuable content in the cache must be cleaned up according to a certain replacement strategy, and new meaningful data must be stored to improve the cache space. Request hit rate, it can be seen that reasonable management and replacement of cached content is the key to affecting the overall performance of the network.
传统的缓存替换算法有先进先出算法(first in first out,FIFO)、最近最少使用替换算法(least frequently used,LFU)、最近最久未使用替换算法(least recentlyused,LRU)以及内容大小替换算法(SIZE)等。其中,FIFO根据队列先进先出的规则,将最先进入缓存空间的数据置换出去,这种算法复杂度低,容易实现,但请求命中率较低。LRU算法总是将最久未被访问的资源替换出缓存,认为最近被访问的数据在不久的将来被访问的概率也比较高,该算法仅从最近的请求时间上来考虑置换数据,当内容流行分布发生变化时,适应性能下降。通过统计缓存内容在过去一段时间内的访问频率,LFU替换策略认为频率高的资源其使用价值就越高,因此当缓存空间不足时,总是替换访问频率最低的内容,该算法也存在缓存污染问题,即过去访问频率高的内容即使现在不再被访问依然占据缓存空间,致使缓存空间的利用率降低。SIZE算法根据内容的大小置换数据,优先将字节数大的数据替换出去,但这种算法没有考虑访问时间间隔、缓存命中次数等因素,可能会使价值不高的小字节对象长时间保留在缓存空间中,从而降低命中率。Traditional cache replacement algorithms include first in first out (FIFO), least recently used (LFU), least recently used (LRU), and content size replacement ( SIZE) etc. Among them, FIFO replaces the data that first enters the cache space according to the first-in-first-out rule of the queue. This algorithm has low complexity and is easy to implement, but the request hit rate is low. The LRU algorithm always replaces the resources that have not been accessed for the longest time out of the cache, and considers that the recently accessed data has a higher probability of being accessed in the near future. The algorithm only considers the replacement data from the latest request time. When the content is popular and distributed When changes occur, adaptive performance decreases. By counting the access frequency of the cached content in the past period of time, the LFU replacement strategy considers that the resource with high frequency has a higher use value. Therefore, when the cache space is insufficient, the content with the lowest access frequency is always replaced. This algorithm also has cache pollution. The problem is that the content with high access frequency in the past still occupies the cache space even if it is no longer accessed now, resulting in a decrease in the utilization of the cache space. The SIZE algorithm replaces data according to the size of the content, and preferentially replaces data with a large number of bytes. However, this algorithm does not consider factors such as the access time interval and the number of cache hits, which may keep low-value small-byte objects for a long time. in the cache space, thereby reducing the hit rate.
以上算法的设计略显片面,均采用单一目标函数来确定缓存替换对象已经不能满足多样化的网络数据需求。最近最少使用最久未使用替换算法(least frequentlyrecently used,LFRU)将LRU和LFU算法结合,该算法综合考虑了内容的请求频率和最近访问的时间,但是未考虑内容的全局流行度。基于大小的贪婪对偶算法(Greedy-Dual Size,GDS)综合考虑了对象大小、缓存代价以及内容的年龄因子,给缓存空间的每个文件设置权重,每次替换权重最小的对象,但是该算法未考虑缓存对象过去被访问的次数。MaT等人提出了一种改进的基于大小频率的加权贪婪对偶算法(Weighted Greedy Dual SizeFrequency,WGDSF)缓存替换策略,该策略在GDS算法的基础上加入了基于时间的加权频率参数和加权文件类型参数,虽然性能有所提升,但是也极大地增加了算法复杂度。基于蚁群算法的缓存替换算法(Ant Colony Algorithm based Cache Replacement Algorithm,ACACRA)算法则是用数据对象大小表示背包重量,对象平均被请求的次数表示存储价值,借鉴0/1求解背包问题的蚁群算法来确定替换内容,但是该算法复杂度高,适用于计算机的应用层。The design of the above algorithms is slightly one-sided, and a single objective function is used to determine that the cache replacement object can no longer meet the diverse network data requirements. The LRU and LFU algorithms are combined with the least recently used and longest unused replacement algorithm (least frequently recently used, LFRU), which comprehensively considers the request frequency of the content and the time of recent access, but does not consider the global popularity of the content. The size-based Greedy-Dual Size (GDS) algorithm comprehensively considers the object size, the cache cost and the age factor of the content, sets a weight for each file in the cache space, and replaces the object with the smallest weight each time. Consider the number of times the cached object has been accessed in the past. MaT et al. proposed an improved weighted greedy dual size frequency (WGDSF) cache replacement strategy based on size frequency, which adds time-based weighted frequency parameters and weighted file type parameters to the GDS algorithm. , although the performance is improved, it also greatly increases the algorithm complexity. The Ant Colony Algorithm based Cache Replacement Algorithm (ACACRA) algorithm uses the size of the data object to represent the weight of the backpack, and the average number of times the object is requested to represent the storage value. Algorithm to determine the replacement content, but the algorithm has high complexity and is suitable for the application layer of the computer.
综上所述,如何在缓存空间的有限的情况下,合理地对缓存内容进行置换就本领域技术人员亟待解决的问题。To sum up, how to reasonably replace the cached content under the condition of limited cache space is an urgent problem to be solved by those skilled in the art.
发明内容SUMMARY OF THE INVENTION
本发明的目的是为了解决现有技术的上述缺陷,提供了一种基于内容价值的缓存替换方法,该算法综合考虑了内容的动态流行度、缓存代价以及缓存内容最近被请求的时间来确定缓存对象的存储价值,当缓存空间不足时,将价值最小的数据置换出去。该方案能够有效地提高缓存命中率,减少用户获取数据的平均跳数。The purpose of the present invention is to solve the above-mentioned defects of the prior art, and provide a cache replacement method based on content value. The storage value of the object, when the cache space is insufficient, the data with the least value is replaced. This solution can effectively improve the cache hit rate and reduce the average number of hops for users to obtain data.
本发明的技术解决方案是:The technical solution of the present invention is:
一种基于内容价值的缓存替换方法,其特征在于,包括如下步骤:A content value-based cache replacement method, characterized in that it comprises the following steps:
S1:统计更新每个周期内容的流行度,根据上个周期内容的流行度以及该周期内内容的命中率来计算当前周期内的内容流行度;S1: Statistically update the popularity of the content in each cycle, and calculate the popularity of the content in the current cycle according to the popularity of the content in the previous cycle and the hit rate of the content in this cycle;
S2:根据节点计算每个内容的缓存代价,所述缓存代价包括传输成本与缓存成本,内容的传输成本大于缓存成本;所述缓存代价的计算公式为: S2: Calculate the cache cost of each content according to the node, the cache cost includes the transmission cost and the cache cost, and the content transmission cost is greater than the cache cost; the calculation formula of the cache cost is:
其中,Hopr表示内容r距离源服务器的跳数,表示内容r单跳的传输成本,表示内容r的缓存成本;Among them, Hop r represents the number of hops of content r from the origin server, represents the single-hop transmission cost of content r, represents the caching cost of content r;
S3:在缓存空间中设计一个时间标签,并用时间标签记录内容最近一次被访问的时间,然后计算出内容最近一次被访问的时间和当前时间的时间间隔;S3: Design a time label in the cache space, and use the time label to record the time when the content was last accessed, and then calculate the time interval between the time when the content was last accessed and the current time;
S4:根据步骤S1中的流行度,步骤S2中的缓存代价及步骤S3中的最近访问时间间隔,计算缓存空间中每个内容的价值,当缓存空间不足时,节点将替换掉价值的最小值。S4: Calculate the value of each content in the cache space according to the popularity in step S1, the cache cost in step S2 and the latest access time interval in step S3, when the cache space is insufficient, the node will replace the minimum value of the value .
优选地,所述步骤S1中的流行度的计算公式为:Preferably, the calculation formula of the popularity in the step S1 is:
pr(t)=αpr(t-1)+(1-α)hr(t)p r (t)= αpr (t-1)+(1-α)h r (t)
其中,r为缓存空间中内容的编号,pr(t)表示内容r在当前周期内的流行度,pr(t-1)表示内容r在上一个周期内的流行度,α是衰减因子,为上一个周期的流行度在当前周期所占的比例,0<α<1,hr(t)表示内容r在当前周期内的命中率,Nr(t)表示当前周期内内容r被命中的次数,NQ(t)表示当前周期内节点收到的总请求数。Among them, r is the number of the content in the cache space, pr (t) represents the popularity of the content r in the current cycle, pr (t-1) represents the popularity of the content r in the previous cycle, and α is the decay factor , is the proportion of the popularity of the previous cycle in the current cycle, 0<α<1, h r (t) represents the hit rate of the content r in the current cycle, N r (t) represents the content r in the current cycle The number of hits, N Q (t) represents the total number of requests received by the node in the current cycle.
优选地,所述步骤S3中的时间间隔的计算公式为:Preferably, the calculation formula of the time interval in the step S3 is:
tinter=tcur-told t inter =t cur -t old
其中,tinter表示内容最近一次被访问的时间和当前时间的时间间隔,tcur表示当前时间,told表示内容最近一次被请求的时间。Among them, t inter represents the time interval between the time when the content was last accessed and the current time, t cur represents the current time, and t old represents the time when the content was last requested.
优选地,所述步骤S4中的价值的计算公式为:Preferably, the calculation formula of the value in the step S4 is:
其中valuer(t)为价值。 where value r (t) is the value.
优选地,所述步骤S1、所述步骤S2、所述步骤S3及所述步骤S4中的内容的数据包类型包括兴趣包和数据包。Preferably, the data packet types of the content in the step S1, the step S2, the step S3 and the step S4 include an interest packet and a data packet.
优选地,所述兴趣包包括请求内容的名字,由请求客户发出,被传输到有请求资源的邻近节点或源服务器,并产生相对应的数据包;Preferably, the interest packet includes the name of the requested content, is sent by the requesting client, is transmitted to an adjacent node or source server with the requested resource, and generates a corresponding data packet;
所述数据包包括数据对象、内容名字以及发布者的签名信息,并沿着兴趣包的反向路径传送给用户。The data packet includes the data object, the content name and the publisher's signature information, and is transmitted to the user along the reverse path of the interest packet.
优选地,所述步骤S2、步骤S4中的节点包括内容存储器、转发信息库及未决请求表。Preferably, the nodes in step S2 and step S4 include a content storage, a forwarding information base and a pending request table.
优选地,所述内容存储器存储到达节点上的数据,缓存下来的内容满足未来对该数据的请求;转发信息库目标字段为内容名称的前缀;未决请求表记录正在传输的路由状态信息。Preferably, the content storage stores data on the arriving node, and the cached content satisfies future requests for the data; the target field of the forwarding information base is the prefix of the content name; the pending request table records the routing state information being transmitted.
本发明提供了一种基于内容价值的缓存替换方法,该方法可以根据用户的访问行为,动态更新内容的流行度,利用内容的请求时间间隔实时调整内容的流行度和缓存代价在价值函数中所占的比重,不仅能够将高流行度的内容提前缓存下来,而且对高缓存代价的内容也有很好的响应,从而有效地提高了节点数据替换的准确性,有利于提高内容中心网络的数据传输效率,改善用户的上网体验。The invention provides a cache replacement method based on content value, which can dynamically update the popularity of content according to the user's access behavior, and adjust the popularity of the content and the cache cost in real time by using the content request time interval in the value function. It can not only cache high-popularity content in advance, but also respond well to content with high cache cost, which effectively improves the accuracy of node data replacement and is conducive to improving the data transmission of content-centric networks. efficiency and improve the user's online experience.
以下便结合实施例附图,对本发明的具体实施方式作进一步的详述,以使本发明技术方案更易于理解、掌握。The specific embodiments of the present invention will be further described in detail below in conjunction with the accompanying drawings of the embodiments, so as to make the technical solutions of the present invention easier to understand and grasp.
附图说明Description of drawings
图1是本发明中实施例的流程图;1 is a flowchart of an embodiment of the present invention;
图2是本发明中兴趣包的处理流程图;Fig. 2 is the processing flow chart of interest packet in the present invention;
图3是本发明中数据包的处理流程图。FIG. 3 is a flow chart of the processing of data packets in the present invention.
具体实施方式Detailed ways
一种基于内容价值的缓存替换方法,包括如下步骤:A cache replacement method based on content value, comprising the following steps:
S1:统计更新每个周期内容的流行度,根据上个周期内容的流行度以及该周期内缓存内容的命中率来计算当前周期内的内容流行度;S1: Statistically update the popularity of the content in each cycle, and calculate the popularity of the content in the current cycle according to the popularity of the content in the previous cycle and the hit rate of the cached content in this cycle;
所述流行度的计算公式为:pr(t)=αpr(t-1)+(1-α)hr(t)The calculation formula of the popularity is: pr (t)= αpr (t-1)+(1-α)h r ( t )
其中,r为缓存空间中内容的编号,pr(t)为内容r在当前周期内的流行度,pr(t-1)为内容r在上一个周期内的流行度,α是衰减因子,为上一个周期的流行度在当前周期所占的比例,0<α<1,hr(t)表示内容r在当前周期内的命中率,Nr(t)表示当前周期内内容r被命中的次数,NQ(t)表示当前周期内节点收到的总请求数。Among them, r is the number of the content in the cache space, pr (t) is the popularity of the content r in the current cycle, pr (t-1) is the popularity of the content r in the previous cycle, and α is the decay factor , is the proportion of the popularity of the previous cycle in the current cycle, 0<α<1, h r (t) represents the hit rate of the content r in the current cycle, N r (t) represents the content r in the current cycle The number of hits, N Q (t) represents the total number of requests received by the node in the current cycle.
S2:根据节点计算每个内容的缓存代价;缓存代价包括传输成本与缓存成本,内容的传输成本大于缓存成本;所述缓存代价的计算公式为:S2: Calculate the cache cost of each content according to the node; the cache cost includes the transmission cost and the cache cost, and the content transmission cost is greater than the cache cost; the calculation formula of the cache cost is:
其中,Hopr表示内容r距离源服务器的跳数,Hopr越大,传输成本越高,内容的存储价值就越大,表示内容r单跳的传输成本,表示内容r的缓存成本。Among them, Hop r represents the number of hops from the content r to the source server. The larger the Hop r , the higher the transmission cost and the greater the storage value of the content. represents the single-hop transmission cost of content r, represents the caching cost of content r.
S3:在缓存空间中设计一个时间标签,并用时间标签记录内容最近一次被访问的时间,然后计算出内容最近一次被访问的时间和当前时间的时间间隔;所述时间间隔的计算公式为:tinter=tcur-told,其中,tinter表示内容最近一次被访问的时间和当前时间的时间间隔,tcur表示当前时间,told表示内容最近一次被请求的时间。S3: Design a time label in the cache space, and use the time label to record the time when the content was last accessed, and then calculate the time interval between the time when the content was last accessed and the current time; the calculation formula of the time interval is: t inter = t cur - t old , where t inter represents the time interval between the time when the content was last accessed and the current time, t cur represents the current time, and t old represents the time when the content was last requested.
S4:根据步骤S1中的流行度,步骤S2中的缓存代价及步骤S3中的最近访问时间间隔,计算缓存空间中每个内容的价值,当缓存空间不足时,节点将替换掉价值的最小值。价值的计算公式为:S4: Calculate the value of each content in the cache space according to the popularity in step S1, the cache cost in step S2 and the latest access time interval in step S3, when the cache space is insufficient, the node will replace the minimum value of the value . The formula for calculating the value is:
其中valuer(t)为价值。 where value r (t) is the value.
在本发明的技术方案中,所述步骤S1、所述步骤S2、所述步骤S3及所述步骤S4中的内容的数据包类型包括兴趣包(interest packet)和数据包(data packet),兴趣包包括请求内容的名字,由请求客户发出,被传输到有请求资源的邻近节点或源服务器,并产生相对应的数据包;所述数据包包括数据对象、内容名字以及发布者的签名信息,并沿着兴趣包的反向路径传送给用户。In the technical solution of the present invention, the data packet types of the content in the step S1, the step S2, the step S3 and the step S4 include an interest packet (interest packet) and a data packet (data packet). The package includes the name of the requested content, is sent by the requesting client, is transmitted to the adjacent node or source server with the requested resource, and generates a corresponding data package; the data package includes the data object, the content name and the publisher's signature information, And along the reverse path of the Interest packet to the user.
所述步骤S2、步骤S4中的节点包括内容存储器(Content Store,CS)、转发信息库(Forwarding Information Base,FIB)和未决请求表(Pending Interest Table,PIT),所述内容存储器存储到达节点上的数据,缓存下来的内容满足未来对该数据的请求;转发信息库目标字段为内容名称的前缀;未决请求表记录正在传输的路由状态信息。The nodes in the step S2 and step S4 include a content store (Content Store, CS), a forwarding information base (Forwarding Information Base, FIB) and a pending request table (Pending Interest Table, PIT), and the content store stores the arrival node. The cached content satisfies future requests for the data; the target field of the forwarding information base is the prefix of the content name; the pending request table records the routing state information being transmitted.
为了更好的说明本发明的技术方案,下面结合附图对本发明的具体实施方式进行详细描述。In order to better illustrate the technical solutions of the present invention, the specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
CCN不再关心内容存放的位置,而只关注数据本身,该结构中的数据报文以内容名称作为标识而不是传统的IP地址,CCN包括两种数据包类型:兴趣包和数据包。兴趣包由请求客户发出,其中携带请求内容的名字,但不包含目的地址,兴趣包被路由到有请求资源的邻近节点或源服务器后,产生相对应的数据包,数据包中携带数据对象、内容名字以及发布者的签名信息,它会沿着兴趣包的反向路径传送给用户。CCN no longer cares where the content is stored, but only the data itself. The data packets in this structure are identified by the content name instead of the traditional IP address. CCN includes two types of data packets: interest packets and data packets. The interest packet is sent by the requesting client, which carries the name of the requested content, but does not include the destination address. After the interest packet is routed to the adjacent node or source server with the requested resource, a corresponding data packet is generated. The data packet carries the data object, The content name and the publisher's signature information, which is sent to the user along the reverse path of the Interest.
CCN的节点包括CS、FIB和PIT。CS存储到达节点上的数据对象,缓存下来的内容可以用来满足未来对该数据的请求,从而减少内容的重复传输。FIB类似传统的传输控制协议/因特网互联协议(Transmission Control Protocol/Internet Protocol,TCP/IP)网络架构中的IP路由表,但目标字段是内容名称的前缀。PIT记录正在传输的路由状态信息。如图1所示,当节点上有兴趣包到达时,首先会查询CS中是否存储了该兴趣包对应的内容,如果有就将内容沿着兴趣包的到达路径直接发送给请求者,同时丢弃该兴趣包。如果缓存中没有该内容,节点会继续查询PIT中是否有与内容名对应的条目,如果存在就将请求接口添加到对应的接口列表中,然后将该请求兴趣包丢弃,否则创建一条新的PIT条目并查询FIB,将兴趣包按照匹配的端口转发到邻近的CCN节点,若FIB中没有匹配的条目,则将兴趣包丢弃或转发到默认的端口。The nodes of CCN include CS, FIB and PIT. The CS stores the data objects that arrive at the node, and the cached content can be used to satisfy future requests for the data, thereby reducing the repeated transmission of content. The FIB is similar to the IP routing table in the traditional Transmission Control Protocol/Internet Protocol (TCP/IP) network architecture, but the target field is the prefix of the content name. PIT records routing state information that is being transmitted. As shown in Figure 1, when an interest packet arrives on the node, it will first check whether the content corresponding to the interest packet is stored in the CS. If so, the content will be sent directly to the requester along the arrival path of the interest packet, and discarded at the same time. the interest package. If there is no such content in the cache, the node will continue to check whether there is an entry corresponding to the content name in the PIT, if there is, add the request interface to the corresponding interface list, and then discard the request interest packet, otherwise create a new PIT Enter the entry and query the FIB, and forward the Interest packet to the adjacent CCN node according to the matching port. If there is no matching entry in the FIB, the Interest packet is discarded or forwarded to the default port.
如图2所示,当数据包到达时,节点会查询PIT中是否存在与该内容对应的条目,若存在则将数据内容从条目的接口列表中转发出去,并删除对应的PIT表项,然后根据相应的缓存替换策略将该数据存储在CS中。As shown in Figure 2, when a data packet arrives, the node will query whether there is an entry corresponding to the content in the PIT, and if so, forward the data content from the interface list of the entry, delete the corresponding PIT entry, and then This data is stored in the CS according to the corresponding cache replacement policy.
在CCN中,内容的流行度能够很好的反应用户对内容的需求情况。由于用户对数据请求的时变性,网络中文件内容的流行度总是不停地发生变化,例如缓存中的某些内容在当前时间段内受到用户的高度关注,流行度很高,但是随着时间的流逝,这部分内容很可能变成用户较少访问的对象,流行度下降。因此,受用户访问行为的影响,网内节点上存储的内容的流行度是动态变化的,即需要在每个周期内对内容的流行度进行统计更新。为了准确预测其变化,本文在每个路由器节点中,为缓存空间中的每项内容设计一个计数器,用来统计每个周期内该内容被命中的次数,同时设计一个总计数器来统计节点收到的总请求数。然后基于指数加权移动平均算法(EWMA),根据上个周期内容的流行度以及当前周期内该内容的命中率来计算当前周期内容的流行度,流行度的计算公式为:pr(t)=αpr(t-1)+(1-α)hr(t)In CCN, the popularity of content can well reflect the user's demand for content. Due to the time-varying data requests of users, the popularity of file content in the network always changes constantly. Over time, this part of the content is likely to become an object less visited by users, and its popularity declines. Therefore, affected by the user's access behavior, the popularity of the content stored on the nodes in the network changes dynamically, that is, the popularity of the content needs to be statistically updated in each cycle. In order to accurately predict its changes, this paper designs a counter for each content in the cache space in each router node to count the number of times the content is hit in each cycle, and design a total counter to count the number of nodes received of total requests. Then, based on the exponentially weighted moving average algorithm (EWMA), the popularity of the content in the current cycle is calculated according to the popularity of the content in the previous cycle and the hit rate of the content in the current cycle. The formula for calculating the popularity is: p r (t)= αp r (t-1)+(1-α)h r (t)
其中,r为缓存空间中内容的编号,pr(t)表示内容r在当前周期内的流行度,pr(t-1)表示内容r在上一个周期内的流行度,α是衰减因子,0<α<1,表示上一个周期的流行度在当前周期所占的比例,hr(t)表示内容r在当前周期内的命中率,Nr(t)表示当前周期内内容r被命中的次数,NQ(t)表示当前周期内节点收到的总请求数。Among them, r is the number of the content in the cache space, pr (t) represents the popularity of the content r in the current cycle, pr (t-1) represents the popularity of the content r in the previous cycle, and α is the decay factor , 0<α<1, it represents the proportion of the popularity of the previous cycle in the current cycle, hr (t) represents the hit rate of the content r in the current cycle, N r (t) represents the content r in the current cycle The number of hits, N Q (t) represents the total number of requests received by the node in the current cycle.
内容所在节点距离内容源服务器的跳数越大,越能降低用户获取内容的请求跳数,因此在缓存替换过程中尽量避免将距源服务器较远的内容替换掉。缓存代价主要由传输成本和缓存成本两部分组成,计算公式为:The greater the number of hops between the node where the content is located and the content source server, the lower the number of hops for users to obtain the content. Therefore, during the cache replacement process, try to avoid replacing the content that is far away from the source server. The cache cost is mainly composed of two parts, the transmission cost and the cache cost. The calculation formula is:
其中,Hopr表示内容r距离源服务器的跳数,Hopr越大,传输成本越高,内容的存储价值就越大,表示内容r单跳的传输成本,表示内容r的缓存成本,内容的传输成本远远大于其缓存成本。Among them, Hop r represents the number of hops from the content r to the source server. The larger the Hop r , the higher the transmission cost and the greater the storage value of the content. represents the single-hop transmission cost of content r, Represents the caching cost of the content r, and the transmission cost of the content is much greater than its caching cost.
本发明在最近最久未使用替换算法的基础上为节点中的每项内容设计了一个时间标签,用来记录该内容最近一次被访问的时间,假设当前时间为tcur,内容最近一次请求的时间为told,则:tinter=tcur-told,时间间隔tinter越短,说明该内容在当前时间段内被请求的频率越高,内容的存储价值主要取决于内容的流行度,而当间隔tinter越长时,影响内容价值的主要因素就是内容的缓存代价,内容的流行度作为次要因素。基于以上分析,内容的价值公式为: The present invention designs a time label for each content in the node on the basis of the most recently unused replacement algorithm, which is used to record the time when the content was accessed most recently. Assuming that the current time is t cur , the time when the content was last requested is t old , then: t inter =t cur -t old , the shorter the time interval t inter , the higher the frequency of the content being requested in the current time period, the storage value of the content mainly depends on the popularity of the content, and When the interval t inter is longer, the main factor that affects the value of content is the cache cost of the content, and the popularity of the content is a secondary factor. Based on the above analysis, the value formula of content is:
由内容的价值公式可以看出如果短时间内该数据被频繁请求,那么时间间隔tinter很小,用户对该内容的关注度很高,说明此时该数据对象的流行度很高,应将其作为影响缓存内容价值的主要因素,反之当间隔tinter很大时,说明该内容最近被请求的次数较少,内容的流行度下降,此时应将内容的缓存代价作为影响价值函数的主要因素,将内容流行度作为次要影响因素。该缓存替换方法利用内容被请求的时间间隔作为权重因子,可以实时调整数据的流行度和缓存代价在价值函数中所占的比重,从而不仅能将高流行度的内容缓存在节点中,而且对高请求代价的数据也有很好的响应,使网络中存储的数据更加合理。From the value formula of the content, it can be seen that if the data is frequently requested in a short period of time, then the time interval t inter is very small, and the user's attention to the content is very high, indicating that the popularity of the data object is very high at this time. It is the main factor affecting the value of cached content. On the contrary, when the interval t inter is large, it means that the content has been requested less recently and the popularity of the content has decreased. At this time, the cache cost of the content should be used as the main factor affecting the value function. factor, with content popularity as a secondary influencing factor. The cache replacement method uses the time interval when content is requested as a weight factor, and can adjust the proportion of data popularity and cache cost in the value function in real time, so that not only high popularity content can be cached in nodes, but also Data with high request cost also has a good response, making the data stored in the network more reasonable.
图3给出了本发明中的具体算法流程,当节点收到用户的请求后首先判断请求对象是否在CS中,如果在内容存储器就将该内容的命中次数和节点的总请求数都加1,更新内容的请求时间,然后将内容直接发送给用户。若节点上未缓存该内容,则转发兴趣包,从邻近的节点或源服务器中获取内容,将内容发送给用户。判断该节点上是否有足够的空间缓存该数据对象,如果有就将内容存储在CS中,并初始化该内容的命中次数、请求时间,记录数据包到达本节点经过的跳数。若缓存空间不足,则根据当前周期内的内容的流行度、缓存代价以及内容的请求时间间隔计算出每个内容的价值,按价值从小到大进行替换,直到有足够的空间存放新的内容。Figure 3 shows the specific algorithm flow in the present invention. When the node receives the user's request, it first determines whether the request object is in the CS. If it is in the content storage, the number of hits of the content and the total number of requests of the node are increased by 1. , update the request time of the content, and then send the content directly to the user. If the content is not cached on the node, the interest packet is forwarded, the content is obtained from the adjacent node or the origin server, and the content is sent to the user. Determine whether there is enough space on the node to cache the data object, if so, store the content in the CS, initialize the number of hits and request time of the content, and record the number of hops that the data packet takes to reach the node. If the cache space is insufficient, the value of each content is calculated according to the popularity of the content in the current cycle, the cache cost and the content request time interval, and the value is replaced from small to large until there is enough space to store the new content.
本发明提供的一种基于内容价值的缓存替换方法,该方法综合考虑了内容的动态流行度、缓存代价以及最近被请求的时间,构建了更实际的内容价值函数,并依据该内容价值函数,设计了有效的内容存储与置换方案。具体地,当更新的缓存内容与已有内容不匹配时,对已有缓存内容按照价值从小到大进行置换。这种方法与传统算法相比,有效地提升了网络节点的缓存内容命中率,降低了用户获取内容的平均跳数。The invention provides a content value-based cache replacement method, which comprehensively considers the dynamic popularity of the content, the cache cost and the time recently requested, and constructs a more practical content value function, and according to the content value function, An effective content storage and replacement scheme is designed. Specifically, when the updated cached content does not match the existing content, the existing cached content is replaced according to the value from small to large. Compared with traditional algorithms, this method effectively improves the cache content hit rate of network nodes and reduces the average number of hops for users to obtain content.
应该注意的是,上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。It should be noted that the above-described embodiments illustrate rather than limit the invention, and that alternative embodiments may be devised by those skilled in the art without departing from the scope of the appended claims.
Claims (8)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810538215.7A CN108900570B (en) | 2018-05-30 | 2018-05-30 | A Cache Replacement Method Based on Content Value |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810538215.7A CN108900570B (en) | 2018-05-30 | 2018-05-30 | A Cache Replacement Method Based on Content Value |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108900570A CN108900570A (en) | 2018-11-27 |
| CN108900570B true CN108900570B (en) | 2020-11-03 |
Family
ID=64343514
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201810538215.7A Active CN108900570B (en) | 2018-05-30 | 2018-05-30 | A Cache Replacement Method Based on Content Value |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108900570B (en) |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110022579A (en) * | 2019-04-23 | 2019-07-16 | 重庆邮电大学 | Content caching management method based on base station collaboration |
| CN110266804B (en) * | 2019-06-28 | 2020-08-14 | 郑州轻工业学院 | Content-centric network caching method based on node context degree |
| CN110413579A (en) * | 2019-07-23 | 2019-11-05 | 中南民族大学 | Image cache method, equipment, storage medium and device based on caching value |
| CN110519394B (en) * | 2019-09-12 | 2022-02-15 | 广东工业大学 | A kind of information cache replacement method, device, terminal and storage medium |
| CN111124298B (en) * | 2019-12-17 | 2021-05-11 | 河海大学 | A Value Function-Based Cache Replacement Method for Fog Computing Network Content |
| CN111083236A (en) * | 2019-12-31 | 2020-04-28 | 扬州大学 | Cache replacement method based on popularity measurement |
| CN113138851B (en) | 2020-01-16 | 2023-07-14 | 华为技术有限公司 | A data management method, related device and system |
| CN114356247A (en) * | 2022-03-18 | 2022-04-15 | 闪捷信息科技有限公司 | Hierarchical storage scheduling method, device, equipment and storage medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106060009A (en) * | 2016-05-12 | 2016-10-26 | 桂林电子科技大学 | Peer-to-peer network video-on-demand streaming node request transfer and cache replacement method |
| CN106131182A (en) * | 2016-07-12 | 2016-11-16 | 重庆邮电大学 | A kind of cooperation caching method based on Popularity prediction in name data network |
| CN106899692A (en) * | 2017-03-17 | 2017-06-27 | 重庆邮电大学 | A kind of content center network node data buffer replacing method and device |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20130215756A1 (en) * | 2012-02-17 | 2013-08-22 | Electronics And Telecommunications Research Institute | Apparatus and method for managing contents cache considering network cost |
| US11057446B2 (en) * | 2015-05-14 | 2021-07-06 | Bright Data Ltd. | System and method for streaming content from multiple servers |
-
2018
- 2018-05-30 CN CN201810538215.7A patent/CN108900570B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106060009A (en) * | 2016-05-12 | 2016-10-26 | 桂林电子科技大学 | Peer-to-peer network video-on-demand streaming node request transfer and cache replacement method |
| CN106131182A (en) * | 2016-07-12 | 2016-11-16 | 重庆邮电大学 | A kind of cooperation caching method based on Popularity prediction in name data network |
| CN106899692A (en) * | 2017-03-17 | 2017-06-27 | 重庆邮电大学 | A kind of content center network node data buffer replacing method and device |
Non-Patent Citations (2)
| Title |
|---|
| 《Cache Management for Adpative Scalable Video Streaming in Vehicular Content-Centric Network》;Yiran Wei ET.AL;《IEEE》;20160912;全文 * |
| 《基于预测模型和缓存替换策略的网络资源访问研究》;程龙泉;《科技通报》;20171031;全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108900570A (en) | 2018-11-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108900570B (en) | A Cache Replacement Method Based on Content Value | |
| CN109905480B (en) | Probabilistic cache content placement method based on content centrality | |
| CN106131182A (en) | A kind of cooperation caching method based on Popularity prediction in name data network | |
| CN111314224B (en) | A Named Data Web Cache Method | |
| An et al. | An in-network caching scheme based on energy efficiency for content-centric networks | |
| CN111107000B (en) | A Content Cache Method in Named Data Network Based on Network Coding | |
| CN108965479B (en) | Domain collaborative caching method and device based on content-centric network | |
| CN106899692A (en) | A kind of content center network node data buffer replacing method and device | |
| CN113783779B (en) | Hierarchical random caching method in named data network | |
| CN112399485A (en) | CCN-based new node value and content popularity caching method in 6G | |
| CN111294394B (en) | Self-adaptive caching strategy method based on complex network junction | |
| CN110365801A (en) | Partition-Based Cooperative Caching Method in Information Center Network | |
| CN109195180A (en) | A kind of solution for reducing content in mobile content central site network and obtaining time delay | |
| Mishra et al. | An efficient content replacement policy to retain essential content in information-centric networking based internet of things network | |
| JP2003085032A (en) | Self-organizing cache method and cache server capable of utilizing the method | |
| CN110012071B (en) | Caching method and device for Internet of things | |
| CN108173903B (en) | Application method of autonomous system cooperative caching strategy in CCN | |
| CN108093056B (en) | Node cache replacement method in information center wireless network virtualization network | |
| Alahmadi | A new efficient cache replacement strategy for named data networking | |
| CN112822275B (en) | Lightweight caching strategy based on TOPSIS entropy weight method | |
| CN116963184A (en) | Energy-saving caching system and method based on named data network and edge calculation | |
| CN112688880B (en) | Method for reducing redundant data packet transmission in named data network | |
| CN111625565B (en) | Multi-attribute cooperative caching method for information center network cache privacy protection | |
| CN111262785B (en) | Multi-attribute probability caching method in named data network | |
| CN116962515A (en) | Caching decision methods, systems and network devices |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB02 | Change of applicant information | ||
| CB02 | Change of applicant information |
Address after: Room 201, building 2, phase II, No.1 Kechuang Road, Yaohua street, Qixia District, Nanjing City, Jiangsu Province Applicant after: NANJING University OF POSTS AND TELECOMMUNICATIONS Address before: 210003 Gulou District, Jiangsu, Nanjing new model road, No. 66 Applicant before: NANJING University OF POSTS AND TELECOMMUNICATIONS |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |