WO2012089044A1 - 一种内容分发网络中缓存共享的方法及装置 - Google Patents

一种内容分发网络中缓存共享的方法及装置 Download PDF

Info

Publication number
WO2012089044A1
WO2012089044A1 PCT/CN2011/084276 CN2011084276W WO2012089044A1 WO 2012089044 A1 WO2012089044 A1 WO 2012089044A1 CN 2011084276 W CN2011084276 W CN 2011084276W WO 2012089044 A1 WO2012089044 A1 WO 2012089044A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
content
correspondence
cluster
block
Prior art date
Application number
PCT/CN2011/084276
Other languages
English (en)
French (fr)
Inventor
欧雄兵
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2012089044A1 publication Critical patent/WO2012089044A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/2885Hierarchically arranged intermediate devices, e.g. for hierarchical caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Definitions

  • the embodiments of the present invention relate to the field of network communication technologies, and in particular, to a method and an apparatus for buffer sharing in a content distribution network. Background technique
  • the CDN Content Delivery Network
  • the CDN distributes the content of the website to the "edge" of the network closest to the user terminal by adding a new layer of network architecture to the existing IP transmission network, so that the user terminal can obtain the nearest location.
  • the required content improves the response speed of the user terminal to access the network.
  • a CDN routing device In the existing CDN network architecture, a CDN routing device, an edge service node, a regional cache node, and a central storage service node are included.
  • the edge service node and the area cache node are usually deployed in a cluster manner, that is, an edge service node or a region cache node is a cluster composed of multiple caches.
  • a cache sharing strategy in a cluster is proposed in the prior art.
  • the cache when the cache does not save the content requested by the user device, called "miss", it sends a query message to other caches in the cluster where it is located to know whether other caches have the corresponding content, if any, then The content is obtained from the cache in which the corresponding content is saved. If the cache in the cluster does not save the corresponding content, the content is requested from the central storage service node.
  • cache sharing There are currently two techniques for implementing cache sharing.
  • One is to implement cache sharing based on the ICP (Internet Cache Protocol) protocol: After receiving a service request, the cache sends a query message to all other caches in the cluster if it finds that there is no local hit. When a cluster contains more caches, this implementation takes up too much communication resources. And the cache needs to wait for all other cache responses to make decisions, so the response delay is longer and the communication efficiency is lower.
  • the second is to implement cache sharing based on the Cache Digest protocol: The cache uses a Bloom filter to represent the saved content. Each cache is from the neighbor. The cache gets the Bloom filter.
  • a cache When a cache receives a service request, if it finds a local miss, it queries the summary of the neighbor cache to determine whether to obtain content from a neighbor cache. This implementation wastes storage space because the abstract takes up more space. In addition, the cache digest needs to be periodically maintained. If the period is set to a long time, the content saved by the neighbor cache cannot be accurately determined. If the period is set to be short, the system performance is degraded due to frequent refresh. Summary of the invention
  • Embodiments of the present invention provide a method and apparatus for cache sharing in a content distribution network to improve system performance.
  • a method for cache sharing in a content distribution network comprising:
  • the first cache server cache in the cluster cluster determines, if not, the content block to which the content requested by the service request belongs, wherein all content processed by the cluster is divided into different content blocks; Determining a second cache responsible for processing the content block;
  • the first cache sends a query message to the second cache to obtain content requested by the service request.
  • a method for cache sharing in a content distribution network comprising:
  • the content delivery network (CDN) routing device After receiving the service request, the content delivery network (CDN) routing device determines a cluster responsible for processing the content requested by the service request; and determines a content block to which the content requested by the service request belongs, where The content processed by the cluster is divided into different content blocks; the corresponding relationship is determined, and the first cache responsible for processing the content block is determined;
  • CDN content delivery network
  • the CDN routing device forwards the service request to the first cache.
  • a cache server for cache sharing in a content distribution network comprising: a hit determination unit, configured to determine whether the content requested by the service request is hit, and triggers the search determining unit to work when the miss occurs;
  • a search determining unit configured to determine a content block to which the content belongs, where all content processed by the cluster cluster where the cache server is located is divided into different content blocks; and according to the content block and the cache server cache in the cluster Corresponding relationship between the second cache responsible for processing the content block;
  • a message sending unit configured to send a query message to the second cache to obtain content requested by the service request.
  • a CDN routing device that caches sharing in a content distribution network, including:
  • a routing unit configured to determine, after receiving the service request, a content block that is required to process the service request and determine the content requested by the service request, where all content processed by the cluster is divided into different a content block; and determining, according to a correspondence between the pre-generated content block and the cache in the cluster, a first cache responsible for processing the content block;
  • a request sending unit configured to forward the service request to the first cache.
  • the method provided by the embodiment of the present invention sends a query message only to the cache responsible for processing the same content block, compared to the cache based on the ICP protocol.
  • the sharing method reduces the response delay and improves the processing speed of business requests.
  • by searching for the correspondence between the content block and the cache it is determined which caches are sent to the cache, and the storage space occupied by the content block and the cache is much smaller than the Bloom filter.
  • the embodiment of the present invention reduces memory overhead and search overhead.
  • FIG. 1 is a flowchart of a method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a CDN network according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a method according to Embodiment 1 of the present invention.
  • FIG. 4 is a schematic structural diagram of a device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of another apparatus according to an embodiment of the present invention. detailed description
  • An embodiment of the present invention provides an implementation manner of cache sharing in a content distribution network.
  • a CDN routing device is statically configured or dynamically generated, and all contents processed by a cluster are divided into multiple independent content blocks. (Different content blocks can be distinguished by numbering and can also be distinguished by other identifying information).
  • static configuration is used, the correspondence between the content and the content block that each cluster is responsible for is also saved.
  • the CDN routing device divides all the content that a cluster is responsible for into 128 independent content blocks, numbered from 1 to 128, and respectively assigns corresponding content to each content block, which can be determined according to the operator.
  • the input command is used to statically configure the correspondence between the content and the content block, and the correspondence between the content and the content block may be dynamically generated according to a preset algorithm.
  • the embodiment of the present invention provides a number of blocks in a CDN routing device.
  • the URL Universal Resource Locator
  • the domain name of each content handled by the cluster is respectively calculated as MD5 (Message Digest Algorithm). 5 version) value; each MD5 value calculated is modulo the number of content blocks, and the calculation result is the content block number to which each content belongs.
  • the CDN routing device After all the content that the cluster is responsible for is divided into multiple independent content blocks, the CDN routing device further creates a content block and statically or dynamically generated for each cluster.
  • the correspondence between the caches is specifically:
  • the CDN routing device specifies one or more content blocks for each cache in the cluster (correspondingly, the cache is responsible for processing the content corresponding to the content block specified by the cache).
  • the CDN routing device can also save the correspondence between the content block and the cache. Among them, one cache can correspond to multiple content blocks, and one content block can also correspond to multiple caches. If a cache is overloaded or fails, the CDN routing device can allocate the content block corresponding to the cache to other caches in the same cluster. It can be seen that the correspondence between the content block and the cache is dynamically adjusted.
  • the corresponding relationship segment is also recorded, which may be an absolute time or a relative time, and the effective time information specifically includes: the service duration of the current correspondence relationship , service duration and service end time corresponding to history.
  • the cache sharing method based on the correspondence between the content block and the cache provided by the embodiment of the present invention is as shown in FIG. 1 and includes the following operations:
  • the CDN routing device After receiving the service request, the CDN routing device determines a cluster responsible for processing the content requested by the service request.
  • the CDN routing device may select a cluster according to a preset routing rule.
  • the CDN routing device can then use the first cache according to a preset routing rule.
  • the least loaded load may be selected as the first cache.
  • the CDN routing device forwards the foregoing service request to the first cache.
  • the first cache After the first cache receives the service request, if the service fails, the content block to which the content requested by the service request belongs is determined; By way of example and not limitation, if the CDN routing device divides all the content that each cluster is responsible for processing into multiple content blocks by static configuration, the corresponding relationship between the content that each cluster is responsible for processing and the content block is sent to the corresponding each. Each cache of clusterp. Alternatively, the first cache can learn the correspondence between the content and the content block established by the CDN routing device for the cluster where the first cache is located by using the global configuration.
  • the cache can obtain the number of the content blocks corresponding to the cluster by using the global configuration manner, and then establish the content and the content block based on the MD5 value. Correspondence relationship. System, determining a cache (referred to as a second cache) responsible for processing the content block;
  • the foregoing cache sends a query message to the found cache.
  • the correspondence between the content and the content block, and the correspondence between the content block and the cache are defined.
  • the query message may be sent to other caches in the same cluster that are responsible for processing the same content block to query whether the content of the service request is saved in the cache or the cache, and the cache sharing is implemented.
  • the method provided by the embodiment of the present invention sends the query message only to the cache responsible for processing the same content block, compared with the cache sharing mode based on the ICP protocol, the response delay is reduced, and the service request processing speed is improved.
  • the embodiment of the present invention by searching for the correspondence between the content block and the cache, it is determined which caches are sent to the cache, and the storage space occupied by the content block and the cache is much smaller than the Bloom filter. Compared with the cache sharing method based on the cache digest protocol, the embodiment of the present invention reduces memory overhead and search overhead.
  • the corresponding relationship between the content block mentioned in the above S106 and the cache in the cluster is obtained in advance by the cache that receives the service request, and the obtaining manner may be not limited to the following two types:
  • the first cache obtains a relationship between the content block and the cache in the cluster from the CDN routing device.
  • the first cache may be, but is not limited to, the CDN path after the booting, and may be, but is not limited to, the CSN routing device sends the csche to the first csche after the first cache is activated.
  • the correspondence between the content block of the cluster and the csche Since the correspondence between the content block and the cache is dynamically adjusted, and the cache does not immediately cache the content that has just been processed, and does not immediately delete the content that is no longer responsible for processing, therefore, if the currently active content block and cache When the correspondence between the service durations is short, it may be considered to send a query message to the cache that was once responsible for processing the above content block, so as to improve the hit probability of the query.
  • the CDN routing device can send the corresponding relationship between the currently active content block and the cache to the cache; or send the saved correspondence between the content block and the cache to the cache; Determining whether the service duration of the correspondence between the currently active content block and the cache is greater than a preset threshold. If yes, only the correspondence between the currently active content block and the cache is sent. Otherwise, the content block and the cache are also sent.
  • the set threshold can be set according to parameters such as cache capacity and data flow.
  • the first cache obtains a correspondence between each cache and a content block from other caches in the cluster.
  • each cache in the cluster saves and maintains the correspondence between the cache and the content blocks in the cluster.
  • the cache not only stores the correspondence with the content block currently being processed, but also stores the correspondence relationship with the content block that was once responsible for processing (ie, the history information of the corresponding relationship).
  • the corresponding relationship between the locally saved content block and the cache when the corresponding relationship between the locally saved content block and the cache is sent to other caches, the corresponding relationship between the currently active content block and the cache may be sent; and the corresponding relationship between all the saved content blocks and the cache may also be sent; Determining whether the establishment time of the correspondence between the currently active content block and the cache is greater than a preset threshold, and if so, transmitting only the correspondence between the currently active content block and the cache; otherwise, sending the content block and the cache Correspondence history information, and the effective time information of each correspondence.
  • the cache may be, but not limited to, the other cache requests in the same cluster to obtain the correspondence between the cache and the content block after the startup; or the cache may be updated after the startup or the correspondence with the content block is updated.
  • Other caches in the same cluster send locally saved correspondences with content blocks.
  • the first cache searches for a specific implementation of the second cache that is responsible for processing the content block according to the correspondence between the content block of the cluster and the cache.
  • the method may be: searching for a cache that is currently responsible for processing the content block according to a correspondence between a content block and a cache that is currently in effect; if the service duration of the cache that is currently responsible for processing the content block is greater than a preset number a threshold (the probability of caching the content of the service request cached in the cache is large), determining that the cache found is the second cache; if the found service currently responsible for processing the content block is less than the pre-serving time Setting the first threshold, according to the correspondence between the content block and the cache in the cluster, searching for a cache that is responsible for processing the content block, and according to a service that is responsible for processing the cache of the content block The duration and the service end time, the second cache is determined from the cache that is found to be responsible for processing the content block (where the service duration is longer
  • each cache has a limited capacity, the cache does not cache all the content it is responsible for, but instead computes the heat of the content based on the heat replacement algorithm and caches the hotter content. Therefore, after the foregoing S107, the first cache obtains the content of the service request, determines the monitored load status of the second cache, and if the load status is less than a preset load threshold, decreases the cache of the content. Heat, to reduce the probability of caching the content, otherwise, increase the cache heat of the content to increase the probability of caching the content.
  • Each cache in the same cluster can monitor, but not limited to, the load condition of each other through load heartbeat calculation.
  • the heat replacement algorithm may be used, so that different caches respectively cache different contents of the same content block, and the hot content is in multiple caches.
  • the low-heat content is cached on a cache to improve the utilization of the cache capacity, and the probability of the cluster local hit is guaranteed, and the response time is reduced.
  • the cache that receives the service request obtains the content of the service request from the specified cache; performs a heat replacement calculation on the content; and determines the monitored load status of the specified cache, if the load status is less than the preset For a given load threshold, the weighting factor less than 1 is used to weight the calculation result, thereby delaying the time when the cache is fetched from other caches in the same cluster. Otherwise, the weighting factor greater than 1 is used to calculate the calculation result. Weighting process, speed up the time that the content obtained from the cache is cached, and distribute the load of the cache as soon as possible.
  • cluster A consists of four caches (cachel, cache2, cache3, and cache4); the upper node can be a regional cache node or a central node.
  • the first embodiment uses the CDN network architecture shown in FIG. 2 as an example to describe the cache sharing mode in detail.
  • the CDN routing device divides the content block based on the contents of the MD5 value that each of the connected clusters is responsible for processing.
  • the correspondence between the content block and the cache of each cluster connected thereto is maintained in the form of a table.
  • a correspondence carrying relative effective time information may be maintained for each content block. Table, the table is shown in Table 1:
  • cachel is responsible for processing the content of the content block corresponding to Table 1 (that is, the establishment time of the corresponding relationship between the currently active cachel and the content block is at least 12 hours)
  • Cache3 is responsible for processing the content of the above content block within 1 hour from the current time to 2 hours from the current time, but the cache3 is no longer responsible for processing the content of the content block (ie, the correspondence between cache3 and the content block is effective) At least 1 hour);
  • cache2 is responsible for processing the content of the content block within 1 hour from the current time (that is, the establishment time of the correspondence between the currently active cache2 and the content block is 1 hour).
  • the above-mentioned effective time is the relative time from the current time.
  • the CDN routing device maintains the correspondence history of the hourly time within 12 hours from the current time. You can also adjust the timing unit and the time interval as needed.
  • the effective time is the absolute time period.
  • the CDN routing device maintains the correspondence history record per hour in hours. You can also adjust the timing unit as needed.
  • each cache in the cluster also knows the correspondence between the content and the content block in the cluster.
  • the specific implementation manner of the cache sharing method provided by the first embodiment of the present invention is as shown in FIG. 3, and specifically includes the following operations:
  • the CDN routing device After receiving the service request of the terminal, the CDN routing device determines a cluster responsible for processing the content of the service request.
  • the CDN routing device may select a cluster according to a preset routing rule (in the first embodiment of the present invention, cluster A is selected).
  • the CDN routing device calculates an MD5 value for a URL or a domain name of the content of the service request, and determines, according to the MD5 value, a content block to which the content of the service request belongs;
  • the CDN routing device determines, according to the correspondence between the content block and the cache configured for the cluster A, and the pre-configured routing policy, the first cache that is responsible for processing the content of the content block.
  • the CDN routing device forwards the foregoing service request to the first cache.
  • the first cache determines whether to hit, if the hit, then execute S306, otherwise, execute S307;
  • the first cache provides the cached content to the terminal that sends the service request, and completes the service service.
  • the first cache calculates the MD5 value of the URL or domain name of the content of the service request, and searches for the content block to which the content of the service request belongs based on the MD5 value, and executes S308; Determining a second cache currently responsible for processing the content block, executing S309;
  • Table 1 is a correspondence table between the content block and the cache to which the content of the service request belongs. Then, if the service request is cachel, it finds that cache2 is currently responsible for processing the content block; if it receives cache2, it finds that cache1 is currently responsible for processing the content block.
  • the first cache determines whether the service duration of the correspondence between the currently active content block and the cache is greater than a preset threshold, and if yes, executing S310, otherwise executing S311;
  • the threshold is assumed to be 2 hours. Obviously, the service duration of cache2 for processing the above content block is less than 2 hours; the service duration of cachel for processing the above content block is greater than 2 hours.
  • the first cache sends a query message to the cache currently responsible for processing the content block, to obtain the content requested by the service request.
  • the cache that receives the query message finds a miss, the other caches may continue to be searched according to the processing of S305 ⁇ S310.
  • the first cache is responsible for processing the cache of the content block according to the historical information of the obtained correspondence between the content block and the cache, and according to the service duration and the service end time of the cache that was once responsible for processing the content block, Determining the second cache in the cache that was once responsible for processing the content block, executing S312;
  • the table 1 is taken as an example. If the service request is cachel, the service duration of the cache2 that is currently responsible for processing the content block is less than a preset threshold. The service end time of cache3 is the closest to the current time. Therefore, cache3 is selected to send the query message.
  • the first cache sends a query message to the selected cache in S311.
  • Embodiment 2
  • the second embodiment uses the CDN network architecture shown in FIG. 2 as an example to describe the cache sharing mode in detail.
  • the CDN routing device is responsible for processing each cluster connected thereto based on the MD5 value.
  • the content is divided into content blocks.
  • Each cache in the cluster saves and maintains the correspondence between the cache and the content blocks in the cluster.
  • the cache may maintain a correspondence table with various content blocks carrying relative effective time information, as shown in Table 3:
  • the cache is responsible for processing the contents of content block 0 and content block 1, but has never been responsible for processing the content of content block 127.
  • the above effective time is the relative time from the current time.
  • the cache is in hours and maintains the correspondence history every hour within 12 hours from the current time. You can also adjust the timing unit and the time interval as needed.
  • the cache may also maintain a correspondence table with each content block carrying absolute time information, as shown in Table 4:
  • the effective time is the absolute time period, and the cache maintains the hourly correspondence history in hours. You can also adjust the timing unit as needed.
  • the cache sends the locally saved correspondence with the content block to other caches in the same cluster.
  • the foregoing program may be stored in a computer readable storage medium, and when executed, the program includes the steps of the foregoing method embodiments;
  • the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
  • the embodiment of the present invention further provides a cache server for cache sharing in a content distribution network, and the structure thereof is as shown in FIG. 4, and the specific implementation structure is as follows:
  • the hit determining unit 401 is configured to determine whether the content requested by the service request is hit, and when the miss occurs, trigger the search determining unit 402 to work;
  • the determining unit 402 is configured to determine a content block to which the content belongs, where the cache corresponds to a correspondence between caches in the cluster, and determines a second cache that is responsible for processing the content block.
  • the message sending unit 403 uses Sending a query message to the second cache.
  • the cache server further includes a first correspondence relationship obtaining unit 404 or a second correspondence relationship acquiring unit 405.
  • the first correspondence relationship obtaining unit 404 obtains, from the first cache, a correspondence between the content block and the cache in the cluster from a content delivery network (CDN) routing device, and obtains a current correspondence relationship.
  • the service duration, the service duration and the service end time of the historical correspondence; the second correspondence obtaining unit 405 is configured to obtain the correspondence between each cache and the content block from other caches in the cluster, and obtain the current correspondence. Service duration time, service duration and service end time corresponding to history.
  • the foregoing determining determining unit 402 is specifically configured to: according to the content block and the cluster Corresponding relationship between the caches in the cache, searching for the cache currently responsible for processing the content block; if a threshold is checked, determining that the cache found is the second cache; if the cache that is currently responsible for processing the content block is found.
  • the service duration is less than a preset first threshold, and according to the correspondence between the content block and the cache in the cluster, the time when the content block was once processed is searched, and the previously processed device is searched for.
  • the second cache is determined in the cache of the content block.
  • the cache server provided by the embodiment of the present invention further includes a content cache unit 406: after obtaining the content of the service request, determining the monitored load status of the second cache, if the load condition is less than a preset load threshold The value reduces the cache heat of the content to reduce the probability of caching the content. Otherwise, the cache heat of the content is increased to increase the probability of caching the content.
  • An embodiment of the present invention further provides a CDN routing device that is cache-shared in a content distribution network, and the structure thereof is as shown in FIG. 5.
  • the specific implementation structure includes:
  • the routing unit 501 is configured to determine, after receiving the service request, a content block that is responsible for processing the service request, and determine a content block to which the content requested by the service request belongs, where all content processed by the cluster is divided into a different content block; and determining, according to a correspondence between the pre-generated content block and the cache in the cluster, a first cache responsible for processing the content block;
  • the request sending unit 502 is configured to forward the service request to the first cache.
  • the CDN routing device further includes a content block dividing unit 503, configured to predetermine the number of the content blocks, and calculate an MD5 value for each URL or domain name of the content processed by the cluster; each of the MD5 to be calculated The values are modulo the number of content blocks, respectively, with the result of the calculation as the number of each of the content blocks.
  • the CDN routing device further includes a correspondence relationship establishing unit 504 and a corresponding relationship sending unit.
  • the correspondence establishing unit 504 is configured to establish a correspondence between the content block and the cache for the cluster connected to the CDN routing device, and record the effective time information of each correspondence, where the effective time information includes: Corresponding relationship between service duration and historical correspondence Duration and service end time;
  • the corresponding relationship sending unit 505 is configured to send the correspondence between the created content block and the cache and the corresponding effective time information to each cache in the corresponding cluster.
  • the cache server and the CDN routing device provided by the embodiment of the present invention reduce the response delay and improve the processing speed of the service request because the query message is sent only to the cache that is responsible for processing the same content block, compared with the cache sharing method based on the ICP protocol.
  • the embodiment of the present invention by searching the correspondence between the content block and the cache, it is determined which caches are sent to the query message, and the storage space occupied by the content block and the cache is much smaller than the Bloom filter. Therefore, the embodiment of the present invention reduces memory overhead and search overhead compared to the cache sharing method based on the cache digest protocol.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Description

一种内容分发网络中緩存共享的方法及装置
技术领域
本发明实施例涉及网络通信技术领域,尤其涉及一种内容分发网络中緩存 共享的方法及装置。 背景技术
CDN ( Content Delivery Network, 内容分发网络)通过在现有的 IP传输 网络中增加一层新的网络架构, 将网站的内容发布到最接近用户终端的网络 "边缘" , 使得用户终端可以就近取得所需的内容, 提高用户终端访问网络的 响应速度。
在现有的 CDN网络架构中, 包括 CDN路由设备、 边缘服务节点、 区域緩 存节点以及中心存储服务节点。 为了提高网络的可靠性和存储容量,通常按照 cluster (集群)的方式部署边缘服务节点和区域緩存节点, 即一个边缘服务节 点或者区域緩存节点是由多个 cache (緩存服务器)构成的 cluster。 现有技术 中提出了一种 cluster中 cache共享策略。 当用户终端的业务请求通过 CDN路由 设备路由到合适的边缘服务节点中的某个 cache上, 当该 cache保存有用户设 备请求的内容时, 称为 "命中" , 直接为用户设备提供相应的业务服务; 当该 cache没有保存用户设备请求的内容时,称为 "未命中",则向其所在的 cluster 中的其他 cache发送查询消息, 以获知其他 cache是否保存有相应的内容, 如 果有,则从保存有相应内容的 cache中获取内容,如果所在的 cluster中的 cache 均没有保存相应的内容, 再向中心存储服务节点请求内容。
目前有两种实现 cache共享的技术。 其一是基于 ICP ( Internet Cache Protocol,互联网緩存协议)协议实现 cache共享: cache在接收到业务请求后, 如果发现本地没有命中,则向其所在的 cluster中所有其他 cache发送查询消息。 当一个 cluster中包含较多的 cache时, 这种实现方式占用过多的通信资源。 且 cache需要等待所有其他 cache响应后进行决策, 因此, 响应时延较长, 通信 效率较低。 其二是基于 Cache Digest (緩存摘要)协议实现 cache共享: cache 用一个 Bloom filter (布隆过滤器) 来表现保存的内容, 每个 cache都从邻居 cache获得 Bloom filter。 当某个 cache收到业务请求后, 如果发现本地未命中, 则通过查询邻居 cache的摘要来决定是否从某个邻居 cache获取内容。 由于摘 要占用空间较多, 因此这种实现方式浪费存储空间。 另外, cache摘要需要周 期性维护, 如果该周期设定较长, 则无法准确判断邻居 cache保存的内容, 如 果该周期设定较短, 则由于频繁刷新造成系统性能下降。 发明内容
本发明的实施例提供了一种内容分发网络中緩存共享的方法及装置,从而 提高系统性能。
本发明的目的是通过以下技术方案实现的:
一种内容分发网络中緩存共享的方法, 包括:
集群 cluster中的第一緩存服务器 cache接收到业务请求后, 如果未命中, 确定业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的所有内容 被划分为不同的内容块; 应关系, 确定负责处理所述内容块的第二 cache;
所述第一 cache向所述第二 cache发送查询消息, 以获得所述业务请求所 请求的内容。
一种内容分发网络中緩存共享的方法, 包括:
内容分发网络 ( Content Delivery Network, CDN )路由设备收到业务请 求后, 确定负责处理所述业务请求所请求的内容的 cluster; 应关系, 确定所述业务请求所请求的内容所属的内容块, 其中, 所述 cluster 处理的所有内容被划分为不同的内容块; 的对应关系, 确定负责处理所述内容块的第一 cache;
所述 CDN路由设备向所述第一 cache转发所述业务请求。
一种内容分发网络中緩存共享的緩存服务器, 包括: 命中判断单元,用于判断业务请求所请求的内容是否命中,并在未命中时, 触发查找确定单元工作;
查找确定单元, 用于判断所述内容所属的内容块, 其中, 所述緩存服务器 所在的集群 cluster处理的所有内容被划分为不同的内容块;并根据内容块与所 述 cluster中的緩存服务器 cache之间的对应关系, 确定负责处理所述内容块的 第二 cache;
消息发送单元, 用于向所述第二 cache发送查询消息, 以获得所述业务请 求所请求的内容。
一种内容分发网络中緩存共享的 CDN路由设备, 包括:
路由单元, 用于在收到业务请求后,确定负责处理所述业务请求所请求的 确定所述业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的所有 内容被划分为不同的内容块; 并根据预先生成的内容块与所述 cluster中的 cache之间的对应关系, 确定负责处理所述内容块的第一 cache;
请求发送单元, 用于向所述第一 cache转发所述业务请求。
由上述本发明的实施例提供的技术方案可以看出, 本发明实施例中, 由于 本发明实施例提供的方法, 仅向负责处理相同内容块的 cache发送查询消息, 较之基于 ICP协议的 cache共享方式, 降低了响应时延, 提高了业务请求处理 速度。 另外, 由于本发明实施例提供的方法中, 通过查找内容块与 cache的对 应关系判断向哪些 cache发送 查询消息, 内容块与 cache的对应关系所占的存 储空间较之 Bloom filter要小很多, 因此, 本发明实施例较之基于 cache digest 协议的 cache共享方式, 降低了内存开销和查找开销。 附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所 需要使用的附图作一简单地介绍,显而易见地, 下面描述中的附图仅仅是本发 明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前 提下, 还可以根据这些附图获得其他的附图。 图 1为本发明实施例提供的方法流程图;
图 2为本发明实施例提供的 CDN网络架构示意图;
图 3为本发明实施例一提供的方法流程图;
图 4为本发明实施例提供的装置结构示意图;
图 5为本发明实施例提供的另一种装置结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
本发明实施例提供一种内容分发网络中緩存共享的实现方式,在该实现方 式中, CDN路由设备通过静态配置或动态生成,并将一个 cluster负责处理的所 有内容划分为多个独立的内容块(不同的内容块可以通过编号加以区分,还可 以通过其他标识信息加以区分)。当釆用静态配置的方式时,还保存每个 cluster 负责处理的内容与内容块之间的对应关系。 作为举例而非限定, CDN路由设 备将一个 cluster负责处理的所有内容划分为 128个独立的内容块, 编号分别为 1 ~ 128, 并分别为每个内容块指定对应的内容, 具体可以根据操作人员输入 的指令来静态配置内容与内容块的对应关系,也可以根据预先设定的算法动态 生成内容与内容块的对应关系。 本发明实施例提供一种 CDN路由设备将一个 块的数量; 对 cluster负责处理的每个内容的 URL ( Universal Resource Locator , 统一资源定位符) 或者域名分别计算 MD5 ( Message Digest Algorithm, 消息摘要算法第 5版)值; 将计算得到的每个 MD5值分别对内容块 的数量求模, 其计算结果就是每个内容所属的内容块编号。通过上述过程对内 容进行划分, 也通过上述过程查找内容所属的内容块编号。
当将 cluster负责处理的所有内容划分为多个独立的内容块后, CDN路由设 备针对每个 cluster进一步通过静态配置或者动态生成的方式建立内容块与 cache之间的对应关系, 具体是: CDN路由设备为 cluster中的每个 cache指定 一个或多个内容块(相应的, cache负责处理为其指定的内容块对应的内容)。 CDN路由设备还可以保存内容块与 cache之间的对应关系。 其中, 一个 cache 可对应多个内容块, 一个内容块也可对应多个 cache。 如果某个 cache出现过 载或者出现故障等情况时, CDN路由设备可将该 cache对应的内容块分配给同 一 cluster中的其他 cache。 可见, 内容块与 cache的对应关系是动态调整的。 相应的, CDN在保存内容块与 cache之间的对应关系时, 还记录每条对应关系 段, 可以是绝对时间, 也可以是相对时间, 该生效时间信息具体包括: 当前对 应关系的服务持续时间, 和历史对应关系的服务持续时间和服务结束时间。
本发明实施例提供的基于上述内容块与 cache之间的对应关系的 cache共 享方法如图 1所示, 包括如下操作:
在 CDN路由设备侧
S101、 CDN路由设备收到业务请求后, 确定负责处理业务请求所请求的 内容的 cluster;
其中, 如果有不止一个 cluster负责处理上述业务请求所请求的内容, 则 CDN路由设备可以根据预先设定的路由规则从中选定一个 cluster。 对应关系, 确定业务请求所请求的内容所属的内容块; 间的对应关系,确定负责处理上述内容块的 cache (称该 cache为第一 cache ); 其中, 如果有不止一个 cache负责处理上述内容块, 则 CDN路由设备可以 根据预先设定的路由规则从中第一 cache。 作为举例而非限定, 可以从中选择 负载最轻的作为第一 cache。
5104、 CDN路由设备向上述第一 cache转发上述业务请求;
在 cache侧
5105、 上述第一 cache接收到上述业务请求后, 如果未命中, 确定业务请 求所请求的内容所属的内容块; 作为举例而非限定,如果 CDN路由设备通过静态配置将每个 cluster负责处 理的所有内容划分为多个内容块,则将每个 cluster负责处理的内容与内容块的 对应关系下发给相应的各个 clusterp的每个 cache。 或者, 第一 cache可以通 过全局配置的方式获知 CDN路由设备为第一 cache所在的 cluster建立的内容 与内容块的对应关系。 或者, 当 CDN路由设备基于 MD5值为每个 cluster配置 内容与内容块的对应关系, 则 cache可通过全局配置的方式获知所在的 cluster 对应的内容块数量, 进而基于 MD5值建立内容与内容块的对应关系。 系, 确定负责处理所述内容块的 cache (称为第二 cache ) ;
S107、 上述 cache向查找到的 cache发送查询消息。
上述本发明实施例提供的方法中, 定义了内容与内容块的对应关系、 内容 块与 cache的对应关系。 当 CDN路由设备选中的 cache未命中时, 可向同一 cluster中负责处理相同内容块其他 cache发送查询消息, 来查询这个或这些 cache中是否保存有业务请求的内容, 实现了 cache共享。 且由于本发明实施 例提供的方法,仅向负责处理相同内容块的 cache发送查询消息,较之基于 ICP 协议的 cache共享方式, 降低了响应时延, 提高了业务请求处理速度。 另外, 由于本发明实施例提供的方法中, 通过查找内容块与 cache的对应关系判断向 哪些 cache发送 查询消息, 内容块与 cache的对应关系所占的存储空间较之 Bloom filter要小很多, 因此,本发明实施例较之基于 cache digest协议的 cache 共享方式, 降低了内存开销和查找开销。
在上述 S106中提到的内容块与 cluster中 cache之间的对应关系为上述接 收到业务请求的 cache预先获取的, 获取方式可以但不仅限于如下两种:
(一 )上述第一 cache从 CDN路由设备获得上述内容块与上述 cluster中的 cache之间的^应关系。
在第 (一)种实现方式中, 第一 cache可以但不仅限于在启动后向 CDN路 或者, 还可以但不仅限于由 CDN路由设备在感知第一 cache启动后, 向第一 csche下发该 csche所在的 cluster的内容块与 csche之间的对应关系。 由于内容块与 cache之间的对应关系是动态调整的, 且 cache并不会立即 緩存刚刚处理过的内容, 也不会立即删除不再负责处理的内容, 因此, 如果当 前生效的内容块与 cache之间的对应关系服务持续时间较短时, 可考虑向曾经 负责处理上述内容块的 cache发送查询消息,以提高查询的命中概率。相应的, 根据保存的生效时间信息, CDN路由设备可以将当前生效的内容块与 cache的 对应关系下发给 cache; 也可以将保存的所有内容块与 cache的对应关系发送 给 cache; 还可以先判断当前生效的内容块与 cache的对应关系的服务持续时 间是否大于预先设定的阈值, 如果是, 则仅发送当前生效的内容块与 cache之 间的对应关系, 否则, 还发送内容块与 cache的对应关系历史信息, 以及每条 对应关系的生效时间信息。 该设定的阈值可根据 cache容量、 数据流量等参数 进行设定。
(二)上述第一 cache从上述 cluster中的其他 cache获得各个 cache与内容 块的对应关系。
在第 (二 )种实现方式中, cluster中的每个 cache保存并维护该 cache与 cluster中内容块之间的对应关系。 其中, cache不仅保存与当前负责处理的内 容块之间的对应关系,还保存与曾经负责处理的内容块之间的对应关系(即对 应关系的历史信息)。相应的,在向其他 cache发送本地保存的内容块与 cache 的对应关系时, 可以发送当前生效的内容块与 cache的对应关系; 也可以发送 保存的所有内容块与 cache的对应关系; 还可以先判断当前生效的内容块与 cache的对应关系的建立时间是否大于预先设定的阈值, 如果是, 则仅发送当 前生效的内容块与 cache之间的对应关系, 否则, 还发送内容块与 cache的对 应关系历史信息, 以及每条对应关系的生效时间信息。
另外, cache可以但不仅限于在启动后, 向同一 cluster中的其他 cache请 求获得各个 cache保存的与内容块的对应关系; 也可以是, cache在启动后或 者与内容块的对应关系更新后, 向同一 cluster中的其他 cache发送本地保存的 与内容块的对应关系。
基于上述两种实现方式, S106中, 第一 cache根据所在的 cluster的内容块 与 cache之间的对应关系, 查找负责处理所述内容块的第二 cache的具体实现 方式可以是: 根据当前生效的内容块与 cache的对应关系, 查找当前负责处理 所述内容块的 cache; 如果查找到的当前负责处理所述内容块的 cache的服务 持续时间大于预先设定的第一阈值(则查找到的 cache中緩存有业务请求的内 容的概率较大) , 确定查找到的 cache为第二 cache; 如果查找到的当前负责 处理所述内容块的 cache的服务持续时间小于预先设定的第一阈值, 则根据所 述内容块与所述 cluster中的 cache之间的对应关系, 查找曾经负责处理所述内 容块的 cache, 并根据曾经负责处理所述内容块的 cache的服务持续时间和服 务结束时间, 从查找到的曾经负责处理所述内容块的 cache中确定第二 cache (其中, 服务持续时间较长、 服务结束时间距离当前时间较短的 cache中緩存 有业务请求所请求的内容的概率较大) 。
由于每台 cache的容量有限, cache并不会緩存所有由其负责处理的内容, 而是根据热度替换算法计算内容的热度, 并将热度较高的内容緩存。 因此, 在 上述 S107后, 上述第一 cache获得业务请求的内容, 判断监测到的上述第二 cache的负载状况, 如果该负载状况小于预先设定的负载门限值, 则降低所述 内容的緩存热度, 以降低緩存所述内容的概率, 否则, 增大所述内容的緩存热 度, 以增大緩存所述内容的概率。 其中, 同一 cluster中的各个 cache可以但不 仅限于两两之间通过负载心跳计算的方式相互监测负载情况。
在本发明实施例中, 如果有两个以上 cache负责处理同一内容块的不同内 容, 则可以基于热度替换算法, 使得不同 cache分别緩存同一内容块的不同内 容, 且热度高的内容在多台 cache上緩存, 热度低的内容在一台 cache上緩存, 以提高 cache容量的利用率, 且保证了 cluster本地命中的概率, 减少了响应时 间。 其具体实现方式如下:
在上述 S107之后, 上述接收到业务请求的 cache从上述指定的 cache获得 业务请求的内容; 对该内容进行热度替换计算; 判断监测到的上述指定的 cache的负载状况, 如果该负载状况小于预先设定的负载门限值, 则使用小于 1的加权因子对计算结果进行加权处理, 从而延緩了緩存从同 cluster内的其它 cache获取的内容的时间, 否则, 使用大于 1的加权因子对计算结果进行加权 处理, 加快从该 cache获取的内容进緩存的时间, 尽快分摊该 cache的负载。 在图 2所示的 CDN网络架构中, cluster A由四个 cache(分别是: cachel、 cache2、 cache3, 和 cache4 )组成; 上级节点可以是区域緩存节点, 也可以 是中心节点。
实施例一
实施例一以图 2所示的 CDN网络架构为例, 对 cache共享方式进行详细说 明。 其中, CDN路由设备基于 MD5值为每个与其连接的 cluster负责处理的内 容划分内容块。 以表格的形式维护与其连接的每个 cluster的内容块与 cache之 间的对应关系, 作为举例而非限定, 基于每个 cluster, 可以针对每个内容块维 护一张携带相对生效时间信息的对应关系表, 该表如表 1所示:
Figure imgf000011_0002
Figure imgf000011_0001
根据表 1可以看出, 在距离当前时间的 12小时内, cachel—直负责处理表 1对应的内容块的内容(即当前生效的 cachel与该内容块的对应关系的建立时 间为至少 12小时) ; 在距离当前时间 1小时〜距离当前时间 2小时内, cache3 负责处理上述内容块的内容, 但该 cache3当前不再负责处理上述内容块的内 容(即 cache3与该内容块的对应关系生效时间为至少 1小时); cache2在距离 当前时间 1小时内负责处理该内容块的内容(即当前生效的 cache2与该内容块 的对应关系的建立时间为 1小时) 。
上述生效时间为距当前时间的相对时间, CDN路由设备以小时为单位, 维护距当前时间 12小时内, 每小时的对应关系历史记录。还可以根据需要, 调 整计时单位, 以及计时区间。
作为举例而非限定,基于每个 cluster,还可以针对每个内容块维护一张携 带绝对生效时间信息的对应关系表, 该表如表 2所示:
Figure imgf000012_0002
Figure imgf000012_0001
其中, 生效时间为绝对时间段, CDN路由设备以小时为单位, 维护每小 时的对应关系历史记录。 还可以根据需要, 调整计时单位。
在本发明实施例一中, 通过全局配置的方式, cluster中的每个 cache也 获知了所在的 cluster中内容与内容块的对应关系。 则本发明实施例一提供的 cache共享方法的具体实现方式如图 3所示, 具体包括如下操作:
5301、 CDN路由设备收到终端的业务请求后, 确定负责处理业务请求的 内容的 cluster;
其中,如果有不止一个 cluster负责处理上述业务请求的内容,则 CDN路由 设备可以根据预先设定的路由规则从中选定一个 cluster (在本发明实施例一 中, 选定 cluster A ) 。
5302、 CDN路由设备对业务请求的内容的 URL或域名计算 MD5值, 并基 于 MD5值确定业务请求的内容所属的内容块;
5303、 CDN路由设备根据为 cluster A配置的内容块与 cache的对应关系, 以及预先配置的路由策略, 确定负责处理上述内容块的内容的第一 cache;
5304、 CDN路由设备向第一 cache转发上述业务请求;
5305、 第一 cache判断是否命中, 如果命中, 则执行 S306, 否则, 执行 S307;
5306、第一 cache将緩存的内容提供给发送业务请求的终端, 完成本次业 务服务;
5307、 第一 cache对业务请求的内容的 URL或域名计算 MD5值, 并基于 MD5值查找业务请求的内容所属的内容块, 执行 S308; 确定当前负责处理所述内容块的第二 cache , 执行 S309;
其中, 以表 1为例, 假设表 1是业务请求的内容所属的内容块与 cache之间 的对应关系表。 则, 如果接收到业务请求的是 cachel , 则其查找到当前负责 处理所述内容块的是 cache2; 如果接收到业务请求的是 cache2, 则其查找到 当前负责处理所述内容块的是 cachel。
5309、 第一 cache判断当前生效的内容块与 cache的对应关系的服务持续 时间是否大于预先设定的阈值, 如果是, 执行 S310, 否则执行 S311 ;
其中, 仍以表 1为例, 假设阈值为 2小时, 显然, cache2负责处理上述内 容块的服务持续时间小于 2小时; cachel负责处理上述内容块的服务持续时 间大于 2小时。
5310、 第一 cache向当前负责处理所述内容块的 cache发送查询消息, 以 获得业务请求所请求的内容;
其中,如果接收到查询消息的 cache发现未命中, 则仍可按照上述 S305 ~ S310的处理过程继续查找其他 cache。
5311、 第一 cache根据获得的内容块与 cache的对应关系的历史信息, 曾 经负责处理所述内容块的 cache, 并根据曾经负责处理所述内容块的 cache的 服务持续时间和服务结束时间, 从查找到的曾经负责处理所述内容块的 cache 中确定第二 cache, 执行 S312;
其中, 仍以表 1为例, 如果接收到业务请求的是 cachel , 由于当前负责处 理所述内容块的 cache2的服务持续时间小于预先设定的阈值, 因此 cachel查 找对应关系的历史信息, 其中, cache3的服务结束时间距离当前时间最近, 因此, 选定 cache3发送查询消息。
5312、 第一 cache向 S311中选定的 cache发送查询消息。 实施例二
实施例二以图 2所示的 CDN网络架构为例,对 cache共享方式进行详细 说明。 其中, CDN路由设备基于 MD5值为每个与其连接的 cluster负责处理 的内容划分内容块。
cluster中的每个 cache以表格的形式保存并维护该 cache与 cluster中内容 块的对应关系。 作为举例而非限定, cache可以维护一张携带相对生效时间信 息的与各个内容块的对应关系表, 该表如表 3所示:
Figure imgf000014_0002
Figure imgf000014_0001
根据表 3可以看出, 在距离当前时间的 12小时内, 该 cache—直负责处理 内容块 0和内容块 1的内容, 但从未负责处理过内容块 127的内容。
上述生效时间为距当前时间的相对时间, cache以小时为单位, 维护距当 前时间 12小时内,每小时的对应关系历史记录。还可以根据需要, 调整计时单 位, 以及计时区间。
作为举例而非限定, cache还可以维护一张携带绝对生效时间信息的与各 个内容块的对应关系表, 该表如表 4所示:
Figure imgf000014_0003
127 N N • , . N
Figure imgf000015_0001
其中, 生效时间为绝对时间段, cache以小时为单位, 维护每小时的对应 关系历史记录。 还可以根据需要, 调整计时单位。
在本发明实施例二中, cache向同一 cluster中的其他 cache发送本地保 存的与内容块的对应关系。
发明实施例二提供的 cache共享方法的具体实现方式与实施例一相同, 这 里不再赘述。
实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来 完成, 前述的程序可以存储于一计算机可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储介质包括: ROM、 RAM, 磁 碟或者光盘等各种可以存储程序代码的介质。
本发明实施例还提供了一种内容分发网络中緩存共享的緩存服务器,其结 构如图 4所示, 具体实现结构如下:
命中判断单元 401 , 用于判断业务请求所请求的内容是否命中, 并在未命 中时, 触发查找确定单元 402工作;
查找确定单元 402, 用于判断上述内容所属的内容块, 其中, 所述緩存服 述 cluster中的 cache之间的对应关系, 确定负责处理所述内容块的第二 cache; 消息发送单元 403, 用于向上述第二 cache发送查询消息。
上述緩存服务器还包括第一对应关系获取单元 404或第二对应关系获取 单元 405。 其中, 第一对应关系获取单元 404从第一 cache从内容分发网络 ( Content Delivery Network, CDN )路由设备获得所述内容块与所述 cluster 中的 cache之间的对应关系, 并获得当前对应关系的服务持续时间, 和历史对 应关系的服务持续时间和服务结束时间; 第二对应关系获取单元 405用于从所 述 cluster中的其他 cache获得各个 cache与内容块的对应关系, 并获得当前对 应关系的服务持续时间时间, 和历史对应关系的服务持续时间和服务结束时 间。 相应的, 上述查找确定单元 402具体用于: 根据所述内容块与所述 cluster 中的 cache之间的对应关系, 查找当前负责处理所述内容块的 cache; 如果查 一阈值, 则确定查找到的 cache为第二 cache; 如果查找到的当前负责处理所 述内容块的 cache的服务持续时间小于预先设定的第一阈值, 则根据所述内容 块与所述 cluster中的 cache之间的对应关系, 查找曾经负责处理所述内容块的 时间, 从查找到的曾经负责处理所述内容块的 cache中确定第二 cache。
本发明实施例提供的緩存服务器还包括内容緩存单元 406: 用于获得业务 请求的内容后, 判断监测到的所述第二 cache的负载状况, 如果所述负载状况 小于预先设定的负载门限值, 则降低所述内容的緩存热度, 以降低緩存所述内 容的概率, 否则, 增大所述内容的緩存热度, 以增大緩存所述内容的概率。
本发明实施例还提供一种内容分发网络中緩存共享的 CDN路由设备, 其 结构如图 5所示, 具体实现结构包括:
路由单元 501 , 用于在收到业务请求后, 确定负责处理所述业务请求所请 系, 确定所述业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的 所有内容被划分为不同的内容块;并根据预先生成的内容块与所述 cluster中的 cache之间的对应关系, 确定负责处理所述内容块的第一 cache;
请求发送单元 502, 用于向上述第一 cache转发所述业务请求。
上述 CDN路由设备还包括内容块划分单元 503,用于预先确定所述内容块 的数量;对所述 cluster处理的每个内容的 URL或者域名分别计算 MD5值;将计 算得到的每个所述 MD5值分别对内容块的数量求模,以所计算的结果作为每个 所述内容块的编号。
上述 CDN路由设备还包括对应关系建立单元 504和对应关系发送单元
505:
所述对应关系建立单元 504用于针对与所述 CDN路由设备连接的 cluster, 建立内容块与 cache之间的对应关系, 并记录每条对应关系的生效时间信息, 所述生效时间信息包括: 当前对应关系的服务持续时间, 和历史对应关系的服 务持续时间和服务结束时间;
所述对应关系发送单元 505用于将所述建立的内容块与 cache之间的对应 关系和对应的生效时间信息发送给对应的 cluster中的每个 cache
本发明实施例提供的緩存服务器及 CDN路由设备, 由于仅向负责处理相 同内容块的 cache发送查询消息,较之基于 ICP协议的 cache共享方式, 降低了 响应时延,提高了业务请求处理速度。另夕卜, 由于本发明实施例提供的方法中, 通过查找内容块与 cache的对应关系判断向哪些 cache发送 查询消息, 内容块 与 cache的对应关系所占的存储空间较之 Bloom filter要小很多, 因此, 本发明 实施例较之基于 cache digest协议的 cache共享方式, 降低了内存开销和查找 开销。
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局 限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内, 可轻易 想到的变化或替换, 都应涵盖在本发明的保护范围之内。 因此, 本发明的保护 范围应该以权利要求的保护范围为准。

Claims

权利要求书
1、 一种内容分发网络中緩存共享的方法, 其特征在于, 包括:
集群 cluster中的第一緩存服务器 cache接收到业务请求后, 如果未命中, 确定业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的所有内容 被划分为不同的内容块; 应关系, 确定负责处理所述内容块的第二 cache;
所述第一 cache向所述第二 cache发送查询消息, 以获得所述业务请求所 请求的内容。
2、根据权利要求 1所述的方法, 其特征在于, 所述 cluster处理的所有内容 被划分为不同的内容块包括:
预先确定所述内容块的数量;
对所述 cluster处理的每个内容的统一资源定位符 (Universal Resource Locator, URL ) 或者域名分别计算消息摘要算法第 5版 ( Message Digest Algorithm, MD5 )值;
将计算得到的每个所述 MD5值分别对内容块的数量求模,以所计算的结果 作为每个所述内容块的编号。
3、 根据权利要求 1或 2所述的方法, 其特征在于, 所述确定业务请求所请 求的内容所属的内容块包括:
对所述业务请求所请求的内容的 URL或域名计算 MD5值, 并基于 MD5值 确定所述业务请求所请求的内容所属的内容块。
4、根据权利要求 1 ~ 3任意一项所述的方法, 其特征在于, 该方法还包括: 所述第一 cache从内容分发网络(Content Delivery Network, CDN )路 对应关系的服务持续时间, 和历史对应关系的服务持续时间和服务结束时间; 或者,
所述第一 cache从所述 cluster中的其他 cache获得各个 cache与内容块的 对应关系, 并获得当前对应关系的服务持续时间, 和历史对应关系的服务持续 时间和服务结束时间。
5、 根据权利要求 1-4任意一项所述的方法, 其特征在于, 所述根据内容块 与所述 cluster中的 cache的对应关系, 确定负责处理所述内容块的第二 cache 包括: 处理所述内容块的 cache; 先设定的第一阈值, 则确定查找到的 cache为第二 cache;
如果查找到的当前负责处理所述内容块的 cache的服务持续时间小于预 系, 查找曾经负责处理所述内容块的 cache, 并根据曾经负责处理所述内容块 的 cache的服务持续时间和服务结束时间, 从查找到的曾经负责处理所述内容 块的 each e中确定第二 each e。
6、根据权利要求 1 ~ 3任意一项所述的方法, 其特征在于, 该方法还包括: 所述第一 cache获得业务请求的内容后, 判断监测到的所述第二 cache的 负载状况,如果所述负载状况小于预先设定的负载门限值, 则降低所述内容的 緩存热度, 以降低緩存所述内容的概率, 否则, 增大所述内容的緩存热度, 以 增大緩存所述内容的概率。
7、 一种内容分发网络中緩存共享的方法, 其特征在于, 包括:
内容分发网络 ( Content Delivery Network, CDN )路由设备收到业务请 求后, 确定负责处理所述业务请求所请求的内容的 cluster;
所述 CDN路由设备根据预先为所述 cluster配置的内容与内容块的对应关 系, 确定所述业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的 所有内容被划分为不同的内容块; 的对应关系, 确定负责处理所述内容块的第一 cache;
所述 CDN路由设备向所述第一 cache转发所述业务请求。
8、根据权利要求 7所述的方法, 其特征在于, 所述 cluster处理的所有内容 被划分为不同的内容块包括:
预先确定所述内容块的数量;
对所述 cluster处理的每个内容的统一资源定位符 (Universal Resource Locator, URL ) 或者域名分别计算消息摘要算法第 5版 ( Message Digest Algorithm, MD5 )值;
将计算得到的每个所述 MD5值分别对内容块的数量求模,以所计算的结果 作为每个所述内容块的编号。
9、 根据权利要求 7或 8所述的方法, 其特征在于, 该方法还包括: 所述 CDN路由设备针对与所述 CDN路由设备连接的 cluster, 建立内容块 与 cache之间的对应关系, 并记录每条对应关系的生效时间信息, 所述生效时 间信息包括: 当前对应关系的服务持续时间, 和历史对应关系的服务持续时间 和服务结束时间。
10、 一种内容分发网络中緩存共享的緩存服务器, 其特征在于, 包括: 命中判断单元,用于判断业务请求所请求的内容是否命中,并在未命中时, 触发查找确定单元工作;
查找确定单元, 用于判断所述内容所属的内容块, 其中, 所述緩存服务器 所在的集群 cluster处理的所有内容被划分为不同的内容块;并根据预先生成的 内容块与所述 cluster中的緩存服务器 cache之间的对应关系, 确定负责处理所 述内容块的第二 cache;
消息发送单元, 用于向所述第二 cache发送查询消息, 以获得所述业务请 求所请求的内容。
11、 根据权利要求 10所述的緩存服务器, 其特征在于, 所述緩存服务器 还包括第一对应关系获取单元, 或第二对应关系获取单元:
所述第一对应关系获取单元,用于从第一 cache从内容分发网络( Content Delivery Network, CDN )路由设备获得所述内容块与所述 cluster中的 cache 之间的对应关系, 并获得当前对应关系的服务持续时间, 和历史对应关系的服 务持续时间和服务结束时间; 所述第二对应关系获取单元, 用于从所述 cluster中的其他 cache获得各个 cache与内容块的对应关系, 并获得当前对应关系的服务持续时间时间, 和历 史对应关系的服务持续时间和服务结束时间。
12、 根据权利要求 10或 1 1所述的緩存服务器, 其特征在于, 所述查找确 查找当前负责处理所述内容块的 cache; 如果查找到的当前负责处理所述内容 块的 cache的服务持续时间大于预先设定的第一阈值, 则确定查找到的 cache 为第二 cache; 如果查找到的当前负责处理所述内容块的 cache的服务持续时 间小于预先设定的第一阈值, 则根据所述内容块与所述 cluster中的 cache之间 的对应关系, 查找曾经负责处理所述内容块的 cache, 并根据曾经负责处理所 述内容块的 cache的服务持续时间和服务结束时间, 从查找到的曾经负责处理 所述内容块的 cache中确定第二 cache。
13、 根据权利要求 10或 1 1所述的緩存服务器, 其特征在于, 所述緩存服 务器还包括内容緩存单元: 用于获得业务请求的内容后, 判断监测到的所述第 二 cache的负载状况, 如果所述负载状况小于预先设定的负载门限值, 则降低 所述内容的緩存热度, 以降低緩存所述内容的概率, 否则, 增大所述内容的緩 存热度, 以增大緩存所述内容的概率。
14、 一种内容分发网络中緩存共享的 CDN路由设备, 其特征在于, 包括: 路由单元, 用于在收到业务请求后,确定负责处理所述业务请求所请求的 确定所述业务请求所请求的内容所属的内容块, 其中, 所述 cluster处理的所有 内容被划分为不同的内容块; 并根据预先生成的内容块与所述 cluster中的 cache之间的对应关系, 确定负责处理所述内容块的第一 cache;
请求发送单元, 用于向所述第一 cache转发所述业务请求。
15、 根据权利要求 14所述的 CDN路由设备, 其特征在于, 所述 CDN路由 设备还包括内容块划分单元, 用于预先确定所述内容块的数量; 对所述 cluster 处理的每个内容的统一资源定位符(Universal Resource Locator, URL )或 者域名分别计算消息摘要算法第 5版( Message Digest Algorithm, MD5 )值; 将计算得到的每个所述 MD5值分别对内容块的数量求模,以所计算的结果作为 每个所述内容块的编号。
16、 根据权利要求 14或 15所述的 CDN路由设备, 其特征在于, 所述 CDN 路由设备还包括对应关系建立单元和对应关系发送单元:
所述对应关系建立单元用于针对与所述 CDN路由设备连接的 cluster,建立 内容块与 cache之间的对应关系, 并记录每条对应关系的生效时间信息, 所述 生效时间信息包括: 当前对应关系的服务持续时间, 和历史对应关系的服务持 续时间和服务结束时间;
所述对应关系发送单元用于将所述建立的内容块与 cache之间的对应关 系和对应的生效时间信息发送给对应的 cluster中的每个 cache。
PCT/CN2011/084276 2010-12-31 2011-12-20 一种内容分发网络中缓存共享的方法及装置 WO2012089044A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010624897.7 2010-12-31
CN201010624897.7A CN102143212B (zh) 2010-12-31 2010-12-31 一种内容分发网络中缓存共享的方法及装置

Publications (1)

Publication Number Publication Date
WO2012089044A1 true WO2012089044A1 (zh) 2012-07-05

Family

ID=44410432

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/084276 WO2012089044A1 (zh) 2010-12-31 2011-12-20 一种内容分发网络中缓存共享的方法及装置

Country Status (2)

Country Link
CN (1) CN102143212B (zh)
WO (1) WO2012089044A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105025105A (zh) * 2015-07-27 2015-11-04 广州华多网络科技有限公司 请求处理方法和装置

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102143212B (zh) * 2010-12-31 2014-02-26 华为技术有限公司 一种内容分发网络中缓存共享的方法及装置
CN102668518B (zh) 2011-12-02 2013-10-02 华为技术有限公司 一种内容分发网络路由方法、系统和用户终端
CN102857547B (zh) * 2012-04-12 2016-03-30 华为技术有限公司 分布式缓存的方法及设备
CN103491003B (zh) * 2012-06-14 2016-12-21 华为技术有限公司 一种内容路由器及其处理报文的方法
CN102984223B (zh) * 2012-11-14 2016-03-02 华为技术有限公司 一种消息发送方法、网络设备及系统
CN103888999B (zh) * 2012-12-19 2018-06-05 中国移动通信集团公司 一种WebCache服务和CDN服务的融合方法和设备
WO2015021591A1 (zh) * 2013-08-13 2015-02-19 华为技术有限公司 互联网内容存储方法和设备
EP3089435B1 (en) * 2014-01-20 2023-08-30 Huawei Technologies Co., Ltd. Service processing method and network device
CN104253851B (zh) * 2014-03-11 2017-12-19 哈尔滨工程大学 一种移动ccn中数据缓存的节点分组方法
CN105357281B (zh) * 2015-10-19 2019-06-21 中国科学院信息工程研究所 一种移动接入网分布式内容缓存访问控制方法及系统
CN105897832A (zh) * 2015-12-01 2016-08-24 乐视网信息技术(北京)股份有限公司 用于提供服务数据的服务器、方法及系统
CN105893468A (zh) * 2016-03-28 2016-08-24 乐视控股(北京)有限公司 用于cdn系统的缓存数据同步方法和系统
CN106681830B (zh) * 2016-12-21 2019-11-29 深圳先进技术研究院 一种任务缓存空间监测方法和装置
CN107645386B (zh) * 2017-09-25 2021-06-22 网宿科技股份有限公司 一种获取数据资源的方法和装置
CN108418882A (zh) * 2018-03-05 2018-08-17 北京云端智度科技有限公司 一种cdn网络内容分发系统及方法
CN115696444B (zh) * 2022-09-23 2023-09-12 中兴通讯股份有限公司 时延检测方法、装置、数据分析平台及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595905A (zh) * 2004-07-04 2005-03-16 华中科技大学 基于集群的流媒体缓存代理服务器系统
CN101064729A (zh) * 2006-04-27 2007-10-31 中国电信股份有限公司 通过cdn网络实现ftp下载服务的系统和方法
WO2010058790A1 (ja) * 2008-11-21 2010-05-27 日本電気株式会社 コンテンツ配信装置、コンテンツ配信制御方法、コンテンツ配信制御プログラム、キャッシュ制御装置
CN102143212A (zh) * 2010-12-31 2011-08-03 华为技术有限公司 一种内容分发网络中缓存共享的方法及装置

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7346684B2 (en) * 2003-01-31 2008-03-18 Utstarcom, Inc. System and method for control of packet data serving node selection in a mobile internet protocol network
CN100474808C (zh) * 2006-01-19 2009-04-01 思华科技(上海)有限公司 集群式缓存服务系统及其实现方法
CN101540775B (zh) * 2009-04-30 2012-05-23 华为技术有限公司 内容分发方法、装置与内容分发网络系统
CN101741643B (zh) * 2009-12-24 2011-09-28 北京云快线软件服务有限公司 内容分发网络节点检测方法及系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1595905A (zh) * 2004-07-04 2005-03-16 华中科技大学 基于集群的流媒体缓存代理服务器系统
CN101064729A (zh) * 2006-04-27 2007-10-31 中国电信股份有限公司 通过cdn网络实现ftp下载服务的系统和方法
WO2010058790A1 (ja) * 2008-11-21 2010-05-27 日本電気株式会社 コンテンツ配信装置、コンテンツ配信制御方法、コンテンツ配信制御プログラム、キャッシュ制御装置
CN102143212A (zh) * 2010-12-31 2011-08-03 华为技术有限公司 一种内容分发网络中缓存共享的方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105025105A (zh) * 2015-07-27 2015-11-04 广州华多网络科技有限公司 请求处理方法和装置
CN105025105B (zh) * 2015-07-27 2018-10-30 广州华多网络科技有限公司 请求处理方法和装置

Also Published As

Publication number Publication date
CN102143212A (zh) 2011-08-03
CN102143212B (zh) 2014-02-26

Similar Documents

Publication Publication Date Title
WO2012089044A1 (zh) 一种内容分发网络中缓存共享的方法及装置
US11194719B2 (en) Cache optimization
JP5086473B2 (ja) エッジデータストレージを使用する移動体ネットワーク環境においてデータを先読みするための方法及び装置
US7565450B2 (en) System and method for using a mapping between client addresses and addresses of caches to support content delivery
US6370620B1 (en) Web object caching and apparatus for performing the same
US20020133537A1 (en) Server cluster and server-side cooperative caching method for use with same
CN106790324B (zh) 内容分发方法、虚拟服务器管理方法、云平台和系统
JP6352290B2 (ja) コンテンツ中心ネットワークにおけるコンテンツ所有者及びノードのパケット送信方法
US7908337B2 (en) System and method for using network layer uniform resource locator routing to locate the closest server carrying specific content
JP2007066161A (ja) キャッシュシステム
US20130041982A1 (en) Method and node for acquiring content and content network
US20020016860A1 (en) System and method for resolving network layer anycast addresses to network layer unicast addresses
WO2013078875A1 (zh) 内容的管理方法的方法、装置和系统
WO2003026220A1 (en) Parallel information delivery method based on peer-to-peer enabled distributed computing technology and the system thereof
JP2006501535A (ja) 複数のキャッシュサーバによる共有ストレージの使用を管理するデバイスおよび方法
JP2000137641A (ja) 分散クライアントベ―スのデ―タキャッシングシステム
WO2017025052A1 (zh) 资源缓存方法及装置
WO2009079948A1 (fr) Procédé de mise en tampon et d'interrogation de contenu, et système de transmission multimédia point à point
CN105357246A (zh) 基于信息中心网络的缓存方法和系统
WO2012072045A1 (zh) 一种cdn网络中的数据传输方法、网络节点及系统
JP2002525749A (ja) インターネットキャッシングシステム、方法およびそのシステムの構成
JP2003085032A (ja) 自己組織化キャッシュ方法およびその方法を利用可能なキャッシュサーバ
WO2022127319A1 (zh) 数据刷新的方法、装置、电子设备及计算机可读存储介质
KR20130033252A (ko) 서비스 오버레이 네트워크에서 종단간 QoS 보장형 콘텐츠 전달 방법 및 그 시스템
CN109644160B (zh) 通过分类在icn中进行名称解析和制作者选择的混合方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11852652

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11852652

Country of ref document: EP

Kind code of ref document: A1