CN103416027B - The system of the method, buffer and cache optimization of cache optimization - Google Patents
The system of the method, buffer and cache optimization of cache optimization Download PDFInfo
- Publication number
- CN103416027B CN103416027B CN201280000262.7A CN201280000262A CN103416027B CN 103416027 B CN103416027 B CN 103416027B CN 201280000262 A CN201280000262 A CN 201280000262A CN 103416027 B CN103416027 B CN 103416027B
- Authority
- CN
- China
- Prior art keywords
- content
- url
- response message
- cache
- caching
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明提供了缓存优化的方法、缓存器和缓存优化的系统。其中,缓存优化的方法包括:缓存节点接收终端对第一统一资源定位符URL的多个业务请求,并基于该多个业务请求从内容源分别接收多个第一响应消息,当该多个第一响应消息中均不携带缓存控制头域或者携带的缓存控制头域指示不缓存,分别确定多个第一响应消息中包含的内容的第一签名值;缓存节点比较多个第一签名值,如果相同,则缓存第一响应消息中包含的内容以及第一URL,如果不相同,不缓存第一响应消息中包含的内容。本发明的缓存优化的方法、缓存器和缓存优化的系统可以基于请求的业务内容的签名值确定缓存在本地缓存设备中的缓存内容,从而降低带宽,提升终端业务体验。
The invention provides a cache optimization method, a cache and a cache optimization system. Wherein, the cache optimization method includes: the cache node receives multiple service requests from the terminal for the first uniform resource locator URL, and respectively receives multiple first response messages from the content source based on the multiple service requests. A response message does not carry a cache control header field or the cache control header field carried indicates no caching, respectively determine the first signature values of the content contained in the multiple first response messages; the cache node compares the multiple first signature values, If they are the same, the content contained in the first response message and the first URL are cached; if not, the content contained in the first response message is not cached. The cache optimization method, cache and cache optimization system of the present invention can determine the cache content cached in the local cache device based on the signature value of the requested service content, thereby reducing bandwidth and improving terminal service experience.
Description
技术领域technical field
本发明实施例涉及通信领域,并且更具体地,涉及缓存优化的方法、缓存器和缓存优化的系统。Embodiments of the present invention relate to the communication field, and more specifically, relate to a cache optimization method, a cache, and a cache optimization system.
背景技术Background technique
近年来互联网的发展对社会和人们的生活产生了巨大的影响,互联网用户数、互联网应用种类、网络带宽等都呈现出爆炸式的增长。这些应用给客户带来丰富的互联网体验,但是也导致了网络流量激增。网络的运营者和管理者为了满足不断增长的用户需求,主要采用扩容带宽、控制流量、引入网络缓存(web cache)、引入内容源等方法。相比于扩容带宽、流量控制、引入网络缓存、引入内容源带来的有限改善,电信运营商还可以选择在网络中部署缓存节点对热门的内容进行缓存,从而以降低带宽的方式实现低成本运营并提升服务质量,即运营商主动在其网络中部署OTT(over the top)缓存节点。In recent years, the development of the Internet has had a huge impact on society and people's lives. The number of Internet users, types of Internet applications, and network bandwidth have all shown explosive growth. These applications bring customers a rich Internet experience, but also lead to a surge in network traffic. In order to meet the ever-increasing user needs, network operators and managers mainly adopt methods such as expanding bandwidth, controlling traffic, introducing web cache (web cache), and introducing content sources. Compared with the limited improvements brought about by bandwidth expansion, flow control, introduction of network cache, and introduction of content sources, telecom operators can also choose to deploy cache nodes in the network to cache popular content, thereby reducing bandwidth to achieve low-cost To operate and improve service quality, that is, operators actively deploy OTT (over the top) cache nodes in their networks.
通常,将OTT缓存节点部署在网络的互联网出口旁边,在路由器上部署策略路由,将超级文本传送协议(HTTP,Hyper Text Transport Protocol)业务路由到缓存节点上,如果缓存节点上缓存有终端所请求的内容,则由缓存节点直接提供服务,如果缓存节点上没有缓存终端所请求的内容,则由缓存节点代理终端向内容源请求内容后再交付给终端。Usually, the OTT cache node is deployed next to the Internet exit of the network, policy routing is deployed on the router, and the Hyper Text Transfer Protocol (HTTP, Hyper Text Transport Protocol) service is routed to the cache node. If the content requested by the terminal is not cached on the cache node, the cache node will proxy the terminal to request the content from the content source and then deliver it to the terminal.
OTT缓存节点在通过HTTP协议从内容源获取到内容后,如果发现内容源返回的HTTP响应消息中携带的缓存控制头域表明内容可以缓存,则根据缓存控制头域来缓存内容;如果发现内容源返回的HTTP响应消息中没有携带缓存控制头域或者携带的缓存控制头域指示不缓存,则默认对内容不做缓存。After the OTT cache node obtains the content from the content source through the HTTP protocol, if it finds that the cache control header field carried in the HTTP response message returned by the content source indicates that the content can be cached, it will cache the content according to the cache control header field; if it finds that the content source If the returned HTTP response message does not carry the cache control header field or the cache control header field carried indicates no caching, the content will not be cached by default.
一般而言,业务提供商/内容提供商(SP/CP,service provider/contentprovider)出于保护自己业务和内容的考虑,不倾向让运营商的网络对自己的内容进行缓存,因此在响应消息中经常默认不携带缓存控制头域或者携带缓存控制头域指示不缓存。那么,OTT缓存节点如果总是按照缓存控制头域来决定内容的缓存和刷新将会导致缓存的效果差,大量的业务请求仍然需要上到内容源,起不到降低带宽以及提升终端业务体验的效果。Generally speaking, service provider/content provider (SP/CP, service provider/contentprovider) is not inclined to let the operator's network cache its own content for the sake of protecting its own business and content, so in the response message It often does not carry the cache control header field by default or carries the cache control header field to indicate not to cache. Then, if the OTT cache node always decides to cache and refresh the content according to the cache control header field, the caching effect will be poor, and a large number of service requests still need to go to the content source, which will not reduce the bandwidth and improve the terminal service experience. Effect.
或者,运营商对SP/CP提供的流量比较大的内容离线进行是否可以缓存的分析,再将分析结果作为策略配置到OTT缓存节点上。但是,配置策略的刷新不够灵活及时,因此不能快速跟踪业务的变化,一旦内容源修改规则,则可能影响其服务质量。Or, the operator analyzes whether the content provided by the SP/CP with relatively large traffic can be cached offline, and then configures the analysis result as a policy on the OTT cache node. However, the refresh of the configuration policy is not flexible and timely enough, so it cannot quickly track business changes. Once the content source modifies the rules, its service quality may be affected.
发明内容Contents of the invention
本发明实施例提供了缓存优化的方法、缓存器和缓存优化的系统,能够避免完全根据HTTP响应头中的缓存控制头域来决定是否缓存而影响服务质量的问题。The embodiment of the present invention provides a cache optimization method, a cache and a cache optimization system, which can avoid the problem of affecting service quality by deciding whether to cache completely according to the cache control header field in the HTTP response header.
一方面,提供了一种缓存优化的方法,包括:接收终端对第一统一资源定位符(URL,Uniform Resource Locator)的多个业务请求,并基于所述多个业务请求从内容源分别接收多个第一响应消息,当所述多个第一响应消息中均不携带缓存控制头域或者携带的缓存控制头域指示不缓存,分别确定所述多个第一响应消息中包含的内容的第一签名值;比较多个所述第一签名值,如果相同,则缓存所述第一响应消息中包含的内容以及所述第一URL,如果不相同,不缓存所述第一响应消息中包含的内容。In one aspect, a cache optimization method is provided, including: receiving multiple service requests from a terminal for a first Uniform Resource Locator (URL, Uniform Resource Locator), and respectively receiving multiple service requests from a content source based on the multiple service requests. A first response message, when none of the plurality of first response messages carries a cache control header field or the carried cache control header field indicates no caching, respectively determine the first of the content contained in the plurality of first response messages A signature value; compare multiple first signature values, if they are the same, cache the content contained in the first response message and the first URL, if not, do not cache the content contained in the first response message Content.
另一方面,提供了一种缓存器,包括:处理单元,用于接收终端对第一URL的多个业务请求,并基于所述多个业务请求从内容源分别接收多个第一响应消息,当所述多个第一响应消息中均不携带缓存控制头域或者携带的缓存控制头域指示不缓存,分别确定所述多个第一响应消息中包含的内容的第一签名值;比较单元,用于比较多个所述第一签名值,如果相同,则所述缓存器缓存所述第一响应消息中包含的内容以及所述第一URL,如果不相同,所述缓存器不缓存所述第一响应消息中包含的内容。In another aspect, a cache is provided, including: a processing unit, configured to receive multiple service requests from a terminal for a first URL, and respectively receive multiple first response messages from a content source based on the multiple service requests, When the plurality of first response messages do not carry a cache control header field or the carried cache control header field indicates no caching, respectively determine the first signature value of the content contained in the plurality of first response messages; the comparison unit , for comparing multiple first signature values, if they are the same, the cache caches the content contained in the first response message and the first URL, if not, the cache does not cache the The content contained in the above-mentioned first response message.
又一方面,提供了一种缓存优化的系统,包括:多个缓存器;业务管理装置;可扩展消息处理现场协议XMPP服务器,用于获取所述业务管理装置发布的缓存规则以及每个所述缓存器发布的对URL是否可以缓存的分析结果,以便所述业务管理装置通过所述XMPP服务器获知每个所述缓存器发布的对统一资源定位符URL是否可以缓存的分析结果,以及每个所述缓存器通过所述XMPP服务器获知所述业务管理装置发布的缓存规则和其他缓存器发布的对所述URL是否可以缓存的分析结果。In yet another aspect, a cache optimization system is provided, including: multiple caches; a service management device; an Extensible Message Processing Presence Protocol XMPP server, used to obtain the cache rules issued by the service management device and each of the The analysis result issued by the cache on whether the URL can be cached, so that the service management device can obtain the analysis result on whether the URL of the uniform resource locator issued by each cache can be cached through the XMPP server, and each The cache obtains the caching rules issued by the service management device and the analysis results of whether the URL can be cached issued by other caches through the XMPP server.
本发明实施例的缓存优化的方法、缓存器和缓存优化的系统可以基于请求的业务内容的签名值确定缓存在本地缓存设备中的缓存内容,从而降低带宽,提升终端业务体验。The cache optimization method, cache, and cache optimization system of the embodiments of the present invention can determine the cache content cached in the local cache device based on the signature value of the requested service content, thereby reducing bandwidth and improving terminal service experience.
附图说明Description of drawings
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是根据本发明实施例的缓存优化的方法的流程图。Fig. 1 is a flowchart of a cache optimization method according to an embodiment of the present invention.
图2是根据本发明实施例的缓存器的结构示意图。FIG. 2 is a schematic structural diagram of a buffer according to an embodiment of the present invention.
图3是根据本发明另一实施例的缓存器的结构示意图。FIG. 3 is a schematic structural diagram of a buffer according to another embodiment of the present invention.
图4是根据本发明又一实施例的缓存器的结构示意图。FIG. 4 is a schematic structural diagram of a buffer according to yet another embodiment of the present invention.
图5是根据本发明再一实施例的缓存器的结构示意图。FIG. 5 is a schematic structural diagram of a register according to yet another embodiment of the present invention.
图6是根据本发明又一实施例的缓存器的结构示意图。FIG. 6 is a schematic structural diagram of a buffer according to yet another embodiment of the present invention.
图7是根据本发明实施例的缓存优化的系统的结构示意图。FIG. 7 is a schematic structural diagram of a cache optimization system according to an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some of the embodiments of the present invention, but not all of them. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
本发明实施例提供一种缓存优化的方法,即一种对内容主动缓存的方法,实现简单,且对终端、内容源和运营商透明。通过本发明实施例的方法可以自动对热门的统一资源定位符(URL,Uniform Resource Locator)进行自动分析,通过分析对应URL的多次请求的响应消息来判断内容是否可以缓存。此外,还可以根据实际内容的签名值来识别缓存的内容,因此即使在URL变化时也可以提升缓存内容的比率,让热度相对较高的实际可以缓存的内容在缓存节点上缓存下来,从而起到降低带宽,提升终端业务体验的效果。并且本发明的方案可以快速跟踪业务的变化,让热门的内容尽快终结在本地。The embodiment of the present invention provides a caching optimization method, that is, a method for actively caching content, which is simple to implement and transparent to terminals, content sources, and operators. The method of the embodiment of the present invention can automatically analyze the popular uniform resource locator (URL, Uniform Resource Locator), and judge whether the content can be cached by analyzing the response messages of multiple requests corresponding to the URL. In addition, the cached content can be identified according to the signature value of the actual content, so even when the URL changes, the ratio of the cached content can be increased, and the relatively hot content that can be cached can be cached on the cache node, thereby promoting To reduce bandwidth and improve terminal service experience. Moreover, the solution of the present invention can quickly track service changes, so that popular content can be terminated locally as soon as possible.
以下将结合图1具体描述根据本发明实施例的缓存优化的方法。The cache optimization method according to the embodiment of the present invention will be specifically described below with reference to FIG. 1 .
通过在路由器上配置策略路由(PBR,Policy-Based Routing)将用户访问外网服务器的流量通过PBR转向缓存节点,从而将HTTP流量从路由器引流到缓存节点,然后再由缓存节点代理用户去外网服务器下载内容后提供给用户。也就是,用户的HTTP访问请求通过PBR牵引到缓存节点;如果缓存节点本地没有缓存用户所请求的内容,则代理用户向外网服务器发起HTTP访问请求;外网服务器依据HTTP访问请求返回响应消息给缓存节点;缓存节点再将响应消息返回给用户。By configuring Policy-Based Routing (PBR, Policy-Based Routing) on the router, the traffic of the user accessing the external network server is diverted to the cache node through PBR, so that the HTTP traffic is diverted from the router to the cache node, and then the cache node acts as the agent for the user to go to the external network The server downloads the content and provides it to the user. That is, the user's HTTP access request is drawn to the cache node through PBR; if the cache node does not cache the content requested by the user locally, the proxy user initiates an HTTP access request to the external network server; the external network server returns a response message to the external network server according to the HTTP access request. Cache node; the cache node returns the response message to the user.
在缓存节点为用户提供内容交付的过程中,对于收到的每个HTTP请求,如果本地没有缓存对应的内容,则需要向SP/CP的内容源服务器请求内容。对于从内容源服务器收到的响应消息,缓存节点需要检查其缓存控制头域,如果缓存控制头域携带可以缓存的头域,则可以直接缓存在缓存节点本地,对于响应消息不携带缓存控制头域或者携带的缓存控制头域指示不缓存时,则缓存节点对热门的URL进行分析来判断响应消息包含的内容是否可以缓存。When the cache node provides content delivery for users, for each received HTTP request, if the corresponding content is not cached locally, it needs to request the content from the content source server of the SP/CP. For the response message received from the content source server, the cache node needs to check its cache control header field. If the cache control header field carries a header field that can be cached, it can be directly cached locally on the cache node. The response message does not carry the cache control header field. domain or the cache control header field carried indicates not to cache, the cache node analyzes popular URLs to determine whether the content contained in the response message can be cached.
在图1中,缓存优化的方法包括以下步骤:In Figure 1, the cache optimization method includes the following steps:
11,缓存节点接收终端对第一统一资源定位符URL的多个业务请求,并基于该多个业务请求从内容源(例如,内容源服务器)分别接收多个第一响应消息,如果该多个第一响应消息中均不携带缓存控制头域或者携带的缓存控制头域指示不缓存,分别确定该多个第一响应消息中包含的内容的第一签名值。11. The caching node receives multiple service requests from the terminal for the first uniform resource locator URL, and respectively receives multiple first response messages from the content source (for example, the content source server) based on the multiple service requests, if the multiple None of the first response messages carries a cache control header field or the carried cache control header field indicates no caching, and first signature values of the contents contained in the multiple first response messages are respectively determined.
也就是说,当终端向缓存节点发起对第一URL的业务请求,缓存节点从内容源分别接收第一响应消息,如果该第一响应消息中不携带缓存控制头域或者携带的缓存控制头域指示不缓存,则缓存节点确定该第一响应消息中包含的内容的第一签名值。可以理解,第一签名值可以针对第一响应消息中包含的内容的全部内容或者部分内容而确定。此时,缓存节点中并不保存该第一URL及其对应的内容。如果终端之后还多次向缓存节点发起对第一URL的业务请求,缓存节点依然按照对应的内容计算多个第一签名值。此时,缓存节点仍然不保存该第一URL及其对应的内容。That is to say, when the terminal initiates a service request for the first URL to the cache node, and the cache node receives the first response message from the content source, if the first response message does not carry the cache control header field or the cache control header field carried If no caching is indicated, the caching node determines the first signature value of the content contained in the first response message. It can be understood that the first signature value may be determined for all or part of the content contained in the first response message. At this time, the cache node does not store the first URL and its corresponding content. If the terminal then initiates multiple service requests for the first URL to the cache node, the cache node still calculates multiple first signature values according to the corresponding content. At this point, the cache node still does not save the first URL and its corresponding content.
通常,由于终端向缓存节点发起的业务请求很多,因此涉及的URL也很多。优选地,可以在缓存节点接收终端对第一URL的多个业务请求之前,首先统计该第一URL的热度,如果该第一URL的热度没有达到阈值,则缓存节点无需考虑保存该第一URL及其对应的业务内容,只有当该第一URL的热度超出阈值,并且确定该第一URL未被静态配置以及未在黑名单中,才进行上述计算第一签名值的操作。这样,缓存节点主动对访问热度高的URL进行分析,比较多次请求的结果,如果一致则强制本地缓存,如果不一致则不缓存并且令该URL进入不缓存黑名单,就可以避免重复分析。Usually, since the terminal initiates many service requests to the cache node, many URLs are involved. Preferably, before the caching node receives multiple service requests from the terminal for the first URL, it can first count the popularity of the first URL, and if the popularity of the first URL does not reach the threshold, the caching node does not need to consider saving the first URL For its corresponding business content, only when the popularity of the first URL exceeds the threshold and it is determined that the first URL is not statically configured and not in the blacklist, the above operation of calculating the first signature value is performed. In this way, the cache node actively analyzes the URLs with high access popularity, compares the results of multiple requests, and forces local caching if they are consistent.
由上可知,当缓存节点确定了多个第一签名值时,可以针对同一个第一URL的多个第一签名值确定是否缓存该第一URL及其对应的内容。It can be seen from the above that when the caching node determines multiple first signature values, it may determine whether to cache the first URL and its corresponding content with respect to the multiple first signature values of the same first URL.
12,缓存节点比较多个所述第一签名值,如果相同,则缓存第一响应消息中包含的内容以及该第一URL,否则,不缓存第一响应消息中包含的内容。12. The cache node compares the multiple first signature values, and if they are the same, caches the content contained in the first response message and the first URL; otherwise, does not cache the content contained in the first response message.
一旦缓存节点确定对应于第一URL的内容可以被缓存,则将该第一URL以及对应于第一URL的内容缓存在本地。当终端再次发起对该第一URL的业务请求时,就无需等待SP/CP的内容源服务器反馈有关内容了,而只需直接从本地缓存设备中获取所需内容。也就是说,本发明实施例的缓存优化的方法可以基于请求的业务内容的签名值确定缓存在本地缓存设备中的缓存内容,从而降低带宽,提升终端业务体验。Once the caching node determines that the content corresponding to the first URL can be cached, the first URL and the content corresponding to the first URL are cached locally. When the terminal initiates a service request for the first URL again, it does not need to wait for the content source server of the SP/CP to feed back relevant content, but only needs to obtain the required content directly from the local cache device. That is to say, the caching optimization method of the embodiment of the present invention can determine the caching content cached in the local caching device based on the signature value of the requested service content, thereby reducing bandwidth and improving terminal service experience.
具体而言,对于某个URL(例如,第一URL)访问请求,如果内容源服务器返回的响应消息中不携带缓存控制头域或者携带的缓存控制头域指示不缓存,则缓存节点不缓存从内容源服务器获得的响应消息携带的内容,但是缓存节点基于访问次数实时统计该第一URL的热度。当第一URL的热度到达设定的阈值(threshold)后,检查针对该第一URL是否有静态配置的缓存策略可以匹配上,如果有则可以按照对应的静态策略来处理。所谓静态配置是指,如果明确地知道有些URL是属于动态URL而不能缓存,就可以针对这些URL配置静态的缓存策略明确对这些URL不缓存。当缓存节点确定该第一URL没有静态配置的缓存策略,则检查该第一URL是否在不缓存的黑名单中,如果在黑名单中则不进行后续处理,否则继续进行如下处理:Specifically, for a certain URL (for example, the first URL) access request, if the response message returned by the content source server does not carry the cache control header field or the cache control header field carried indicates not to cache, the cache node will not cache the content from the URL. The content carried in the response message obtained by the content source server, but the caching node counts the popularity of the first URL in real time based on the number of visits. When the popularity of the first URL reaches the set threshold (threshold), check whether there is a statically configured caching policy for the first URL that can match, and if so, it can be processed according to the corresponding static policy. The so-called static configuration means that if you clearly know that some URLs are dynamic URLs and cannot be cached, you can configure a static cache policy for these URLs to explicitly not cache these URLs. When the caching node determines that the first URL does not have a statically configured caching strategy, it checks whether the first URL is in the blacklist that does not cache, and if it is in the blacklist, it does not carry out subsequent processing, otherwise it continues to process as follows:
当缓存节点又收到对应该第一URL的业务请求后,由于本地没有缓存对应的内容,缓存节点仍然需要从内容源服务器获取内容。在从内容源服务器获取内容的过程中,针对本次获取到的内容生成签名值,生成签名值的算法可以有多种选择,如消息摘要算法第五版(MD5,Message Digest Algorithm5)或者是安全散列算法(SHA,Secure HashAlgorithm)。计算签名值时可以针对内容源服务器返回的整个内容进行计算而生成单个签名值,也可以为了减少计算量对内容进行抽样生成单个或者多个签名值,例如只是使用返回内容的前16KB(Kbyte)的内容计算签名值,或者对前16KB和最后的16KB都分别计算签名值。计算得到的签名值作为从内容源服务器获取的内容属性缓存下来,这时从内容源服务器获取的内容仍然先不用保存在本地。之后,当缓存节点又收到对应该第一URL的业务请求后,由于本地没有缓存对应的内容,缓存节点仍然需要从内容源服务器获取内容。在从内容源服务器获取内容的过程中采用上述算法计算签名值,并将本次计算的签名值和之前计算的签名值进行比较。如果连续多次(例如,2次或3次)从内容源服务器下载的内容的签名值的比较结果都一致时,则认为对应该第一URL的内容可以缓存,即这时从内容源服务器获取的内容可以保存在本地,后续再收到针对该第一URL的业务请求就可以利用缓存在本地的内容直接提供服务。如果出现签名值结果不一致,例如连续两次计算的签名值不一致,说明每次从内容源服务器获取的内容存在差异,因此对该第一URL的内容不能在本地缓存,则该第一URL需要进入到不缓存的黑名单中或者降低该第一URL的热度统计值,避免进行后续的是否可以缓存的判断处理。When the cache node receives the service request corresponding to the first URL, the cache node still needs to obtain the content from the content source server because the corresponding content is not cached locally. In the process of obtaining content from the content source server, a signature value is generated for the content obtained this time. There are many options for generating the signature value algorithm, such as the fifth version of the message digest algorithm (MD5, Message Digest Algorithm5) or security Hash algorithm (SHA, Secure HashAlgorithm). When calculating the signature value, you can calculate the entire content returned by the content source server to generate a single signature value, or you can sample the content to generate a single or multiple signature values in order to reduce the amount of calculation, for example, only use the first 16KB (Kbyte) of the returned content The signature value is calculated for the content, or the signature value is calculated separately for the first 16KB and the last 16KB. The calculated signature value is cached as a content attribute obtained from the content source server. At this time, the content obtained from the content source server still does not need to be saved locally. Later, when the cache node receives a service request corresponding to the first URL, the cache node still needs to obtain the content from the content source server because the corresponding content is not cached locally. In the process of obtaining content from the content source server, the above-mentioned algorithm is used to calculate the signature value, and the signature value calculated this time is compared with the previously calculated signature value. If the comparison results of the signature values of the content downloaded from the content source server for multiple consecutive times (for example, 2 or 3 times) are consistent, it is considered that the content corresponding to the first URL can be cached, that is, the content obtained from the content source server at this time The content of the first URL can be stored locally, and the service can be provided directly by using the content cached locally when a service request for the first URL is received later. If the signature value results are inconsistent, for example, the signature values calculated twice in a row are inconsistent, indicating that there are differences in the content obtained from the content source server each time, so the content of the first URL cannot be cached locally, and the first URL needs to enter Add it to the blacklist that does not cache or reduce the popularity statistics value of the first URL, so as to avoid subsequent judgment processing whether it can be cached.
为了进一步优化上述的缓存方法,可以为所缓存的第一响应消息中包含的内容设置生存时间TTL(Time To Live),以便当所述TTL超时时,强制删除所缓存的第一响应消息中包含的内容。具体而言,对于本地缓存下来的内容设置不同的TTL值。当TTL超时时,强制删除本地缓存的内容,当收到新的业务请求时重新从内容源服务器请求内容。这样,可以避免实际内容发生小的变化而根据部分内容技术的签名值仍然一致的低概率事件,从而确保缓存的内容与内容源服务器上的内容相一致。In order to further optimize the above caching method, a TTL (Time To Live) can be set for the content contained in the cached first response message, so that when the TTL expires, the content contained in the cached first response message will be forcibly deleted. Content. Specifically, different TTL values are set for locally cached content. When the TTL expires, the content in the local cache is forcibly deleted, and when a new service request is received, the content is requested from the content source server again. In this way, the low-probability event that the signature value based on partial content technology is still consistent with a small change in the actual content can be avoided, thereby ensuring that the cached content is consistent with the content on the content source server.
其中,设置TTL可以基于如下的原则。根据不同的域名设置:例如对于主要提供视频内容的域名,其内容的变化频度低,因此可以设置较长的TTL;对于主要提供资讯的域名,其内容的变化频度较高,因此设置的TTL相对要短一些。根据所请求内容的扩展名来设置:不同的扩展名实际对应不同的内容类型,因此可以设置不同的TTL。当然可以将域名和扩展名结合起来设置:即针对不同的域名,相同扩展名的内容可以设置不同的TTL值。Wherein, setting the TTL may be based on the following principles. According to different domain names: For example, for domain names that mainly provide video content, the frequency of content changes is low, so a longer TTL can be set; for domain names that mainly provide information, the frequency of content changes is high, so set TTL is relatively short. Set according to the extension of the requested content: different extensions actually correspond to different content types, so different TTLs can be set. Of course, the domain name and extension can be set together: that is, for different domain names, different TTL values can be set for the content of the same extension.
在用本地强制缓存的内容提供服务时,继续向内容源服务器发送携带“如果被修改(If-Modified-Since)”头域或者“如果不匹配(If-None-Match)”头域的请求,让内容源服务器能记录用户访问日志,同时有利于保证内容的及时刷新。When using locally cached content to provide services, continue to send requests carrying the "If-Modified-Since" header field or "If-None-Match" header field to the content source server, Allow the content source server to record user access logs, and at the same time help to ensure timely refresh of content.
因为在有些场景下,SP/CP需要看到原始用户的请求从而收集用户的访问日志,这时缓存节点可以模拟终端向内容源服务器发起业务请求,以便内容源服务器根据业务请求中携带的被请求变量的实体值信息来检查缓存中的内容是否发生了变化。Because in some scenarios, the SP/CP needs to see the original user's request to collect the user's access log. At this time, the cache node can simulate the terminal to initiate a service request to the content source server, so that the content source server can use the requested Variable entity value information to check whether the content in the cache has changed.
例如,在If-Modified-Since头域携带缓存的内容生成的时间信息,内容源服务器可以根据该信息判断缓存的内容是否刷新过;或者If-None-Match头域携带缓存的内容生成的实体值(Etag)签名信息,内容源服务器可以根据该签名信息判断缓存的内容是否刷新过。For example, the If-Modified-Since header field carries the time information of the cached content generation, and the content source server can judge whether the cached content has been refreshed based on this information; or the If-None-Match header field carries the entity value generated by the cached content (Etag) signature information, the content source server can judge whether the cached content has been refreshed according to the signature information.
具体而言,在缓存节点发送的HTTP下载(HTTP Get)请求消息中携带If-Modified-Since头域或者If-None-Match头域,内容源服务器可以直接根据If-Modified-Since头域携带的时间信息或者If-None-Match头域携带的被请求变量的Etag签名信息来检查内容是否发生了变化。如果没有发生变化,可以直接回复“304:not modified(没有修改)”响应消息,在响应消息中不用携带实际的数据,因此同样可以降低带宽。Specifically, if the HTTP download (HTTP Get) request message sent by the cache node carries the If-Modified-Since header field or If-None-Match header field, the content source server can directly Time information or the Etag signature information of the requested variable carried in the If-None-Match header field to check whether the content has changed. If there is no change, you can directly reply with a "304: not modified (not modified)" response message, and the response message does not need to carry actual data, so the bandwidth can also be reduced.
根据如图1所示的缓存优化的方法,一旦缓存节点确定对应于第一URL的内容可以被缓存,则将该第一URL以及对应于第一URL的内容缓存在本地。当终端再次发起对该第一URL的业务请求时,就无需等待SP/CP的内容源服务器反馈有关内容了,而只需直接从本地缓存设备中获取所需内容。According to the cache optimization method shown in FIG. 1 , once the cache node determines that the content corresponding to the first URL can be cached, the first URL and the content corresponding to the first URL are cached locally. When the terminal initiates a service request for the first URL again, it does not need to wait for the content source server of the SP/CP to feed back relevant content, but only needs to obtain the required content directly from the local cache device.
然而,在部署实际业务时,SP/CP出于保护自己业务和内容的考虑,除了在响应消息中默认不携带缓存控制头域或者携带缓存控制头域指示不缓存外,还会变换针对同一个内容的URL,即SP/CP针对同一个内容向不同的用户发布不同的URL。从缓存节点收到的请求来看,每个请求的URL都不一样,如果只是根据URL去查找缓存的内容则基本都是本地不命中。However, when deploying actual services, in order to protect their own services and content, the SP/CP will not carry the cache control header field in the response message by default or carry the cache control header field to indicate no caching. The URL of the content, that is, the SP/CP publishes different URLs to different users for the same content. Judging from the requests received by the cache nodes, the URLs of each request are different. If you only look up the cached content based on the URL, it is basically a local miss.
针对上述情况,仍然可以利用签名值来实现主动缓存,从而降低带宽,提升终端业务体验,详细实现流程如下。In view of the above situation, the signature value can still be used to implement active caching, thereby reducing bandwidth and improving terminal service experience. The detailed implementation process is as follows.
首先,缓存节点从内容源服务器获取到内容后同时计算部分内容的签名值,例如计算前16KB内容的签名值和后16KB内容的签名值,计算得到的签名值和内容都保存在本地,同时建立前16KB内容的签名值与内容的对应关系,即除了可以根据URL索引到缓存的内容之外,也可以根据签名值索引到缓存的内容。First, after the cache node obtains the content from the content source server, it calculates the signature value of some content at the same time, for example, calculates the signature value of the first 16KB content and the signature value of the last 16KB content, and the calculated signature value and content are stored locally. The corresponding relationship between the signature value of the first 16KB content and the content, that is, not only the cached content can be indexed according to the URL, but also the cached content can be indexed according to the signature value.
当缓存节点收到对应第二URL的新的访问请求时,将根据第二URL查找本地是否缓存有与请求的第二URL对应的内容,如果有则可以基于缓存的内容提供服务。如果没有则先向内容源服务器请求前16KB的内容,请求前16KB的内容可以通过在HTTP Get请求消息中携带范围(Range)头域指示请求范围来实现,例如:Range:bytes=0-16383。When the cache node receives a new access request corresponding to the second URL, it will check whether there is locally cached content corresponding to the requested second URL according to the second URL, and if so, it can provide services based on the cached content. If not, first request the first 16KB of content from the content source server. The request for the first 16KB of content can be achieved by carrying the Range (Range) header field in the HTTP Get request message to indicate the request range, for example: Range:bytes=0-16383.
在缓存节点收到前16KB的内容后,对这16KB的内容计算签名值,将计算出来的签名值作为索引查找本地缓存的内容,如果没有找到匹配的结果则说明本地没有缓存所请求的内容,因此需要从内容源服务器继续请求剩下的内容交付给终端,请求剩下的内容可以通过在HTTP Get请求消息中携带Range头域指示请求范围来实现,例如:Range:bytes=16384-。在从内容源服务器请求内容的过程中再计算后16KB内容的签名值并将请求的内容和对应的签名值缓存在本地。After the cache node receives the first 16KB of content, it calculates the signature value for the 16KB of content, and uses the calculated signature value as an index to search for the content of the local cache. If no matching result is found, it means that the requested content is not cached locally. Therefore, it is necessary to continue to request the remaining content from the content source server and deliver it to the terminal. The request for the remaining content can be realized by carrying the Range header field in the HTTP Get request message to indicate the request range, for example: Range:bytes=16384-. In the process of requesting content from the content source server, the signature value of the last 16KB content is calculated and the requested content and corresponding signature value are cached locally.
如果找到有本地缓存的内容的签名值和本次计算出来的前16KB的内容的签名值一样,则说明本地缓存的内容可能就是本次业务请求的内容。为了确认可以做进一步的校验和核实,缓存节点再向内容源服务器请求最后16KB的内容,这也可以通过在HTTP Get请求消息中携带Range头域指示请求范围来实现,例如:Range:bytes=-16384。在缓存节点收到后16KB的内容后,对后16KB的内容也计算签名值,将计算出来的签名值和之前根据前16KB内容的签名值索引到的本地缓存内容的后16KB内容的签名值进行比较。如果一致,则说明可以利用本地缓存的内容来为终端用户提供服务,如果不一致,则说明本地没有缓存所请求的内容,因此需要从内容源服务器继续请求剩下的内容交付给终端,请求剩下的内容可以通过在HTTP Get请求消息中携带Range头域指示请求范围来实现,例如:Range:bytes=16384-。If the signature value of the locally cached content is found to be the same as the signature value of the first 16KB content calculated this time, it means that the locally cached content may be the content of this service request. In order to confirm that further verification and verification can be done, the cache node requests the last 16KB of content from the content source server. This can also be achieved by carrying the Range header field in the HTTP Get request message to indicate the request range, for example: Range:bytes= -16384. After the cache node receives the content of the last 16KB, the signature value is also calculated for the content of the last 16KB, and the calculated signature value is compared with the signature value of the last 16KB of the local cache content previously indexed based on the signature value of the first 16KB content. Compare. If they are consistent, it means that the content in the local cache can be used to provide services for end users. If not, it means that the requested content is not cached locally, so it is necessary to continue to request the remaining content from the content source server and deliver it to the terminal. The content of can be realized by carrying the Range header field in the HTTP Get request message to indicate the request range, for example: Range:bytes=16384-.
通过上面的描述可以看出,除了可以根据原始请求的URL来标示缓存的内容之外,还可以根据内容的签名值来标示内容。按照这种方案处理时,对于热点内容,即使请求的URL不同,在根据签名值识别出来内容之后还是可以利用本地缓存的内容来提供服务。It can be seen from the above description that in addition to marking the cached content according to the URL of the original request, the content can also be marked according to the signature value of the content. When processing according to this solution, for hot content, even if the requested URL is different, after the content is identified according to the signature value, the locally cached content can still be used to provide services.
在实际应用中,如果为了提升性能,后16KB内容对应的签名值的生成和校验也可以省略,即只是根据前面16KB内容的签名值来识别内容。当然,实际中用来计算签名值的内容可以有多种变化方式,例如将原始文件分片,从每片中抽取部分字节组合到一起再计算签名值。In practical applications, in order to improve performance, the generation and verification of the signature value corresponding to the last 16KB content can also be omitted, that is, the content is only identified according to the signature value of the previous 16KB content. Of course, the actual content used to calculate the signature value can be changed in many ways, such as dividing the original file into pieces, extracting some bytes from each piece and combining them together to calculate the signature value.
综上所述,可选地,除了缓存第一响应消息中包含的内容以及第一URL外,缓存节点建立并缓存所缓存的第一响应消息中包含的内容与第一签名值之间的对应关系。因此,当缓存节点接收到终端对第二ULR的业务请求时,如果该第二URL与所缓存的第一URL相同,则向终端发送对应于该第一URL的所缓存的第一响应消息中包含的内容,否则基于对第二URL的业务请求以及所缓存的第一响应消息中包含的内容与第一签名值之间的对应关系从所述内容源(服务器)接收第二响应消息,并确定该第二响应消息中包含的内容的第二签名值。缓存节点比较第二签名值与第一签名值,如果相同,则将所缓存的第一响应消息中包含的内容发送给终端,否则将从内容源(服务器)接收的第二响应消息中包含的内容的全部内容发送给终端。To sum up, optionally, in addition to caching the content contained in the first response message and the first URL, the caching node establishes and caches the correspondence between the content contained in the cached first response message and the first signature value relation. Therefore, when the caching node receives the terminal's service request for the second ULR, if the second URL is the same as the cached first URL, it sends the cached first URL corresponding to the first URL to the terminal. otherwise, receive a second response message from the content source (server) based on the service request for the second URL and the correspondence between the content contained in the cached first response message and the first signature value, and A second signature value of the content contained in the second response message is determined. The cache node compares the second signature value with the first signature value, and if they are the same, sends the content contained in the cached first response message to the terminal, otherwise sends the content contained in the second response message received from the content source (server) The entire content of the content is sent to the terminal.
图2中示出了根据本发明实施例的缓存器。在图2中,缓存器20包括处理单元21和比较单元22。其中,处理单元21用于接收终端对第一URL的多个业务请求,并基于所述多个业务请求从内容源分别接收多个第一响应消息,当所述多个第一响应消息中均不携带缓存控制头域或者携带的缓存控制头域指示不缓存,分别确定所述多个第一响应消息中包含的内容的第一签名值。例如,处理单元21可以依据所述第一响应消息中包含的内容的部分内容确定第一签名值;或者可以依据所述第一响应消息中包含的内容的全部内容确定第一签名值。比较单元22用于比较多个所述第一签名值,如果相同,则所述缓存器缓存所述第一响应消息中包含的内容以及所述第一URL,否则所述缓存器不缓存所述第一响应消息中包含的内容。A buffer according to an embodiment of the present invention is shown in FIG. 2 . In FIG. 2 , the buffer 20 includes a processing unit 21 and a comparing unit 22 . Wherein, the processing unit 21 is configured to receive multiple service requests from the terminal for the first URL, and respectively receive multiple first response messages from the content source based on the multiple service requests, and when all of the multiple first response messages are The first signature values of the content contained in the plurality of first response messages are respectively determined by not carrying the cache control header field or carrying the cache control header field indicating no caching. For example, the processing unit 21 may determine the first signature value according to part of the content contained in the first response message; or may determine the first signature value according to all the content contained in the first response message. The comparison unit 22 is used to compare multiple first signature values, if they are the same, the cache caches the content contained in the first response message and the first URL, otherwise the cache does not cache the Content contained in the first response message.
因此,本发明实施例的缓存器可以基于请求的业务内容的签名值确定缓存在本地缓存设备中的缓存内容,从而降低带宽,提升终端业务体验。Therefore, the cache in the embodiment of the present invention can determine the cache content cached in the local cache device based on the signature value of the requested service content, thereby reducing bandwidth and improving terminal service experience.
图3中示出了根据本发明另一实施例的缓存器。在图3中,除了处理单元21和比较单元22,缓存器30还包括统计单元23和确定单元24。其中,统计单元23用于统计所述URL的热度。确定单元24用于当所述URL的热度超出阈值时,确定所述URL未被静态配置以及未在黑名单中。A buffer according to another embodiment of the present invention is shown in FIG. 3 . In FIG. 3 , in addition to the processing unit 21 and the comparison unit 22 , the buffer 30 also includes a statistics unit 23 and a determination unit 24 . Wherein, the statistical unit 23 is used for counting popularity of the URL. The determining unit 24 is configured to determine that the URL is not statically configured and is not in the blacklist when the popularity of the URL exceeds a threshold.
图4中示出了根据本发明又一实施例的缓存器。在图4中,除了处理单元21、比较单元22、统计单元23和确定单元24,缓存器40还包括设置单元25。该设置单元25用于为所缓存的第一响应消息中包含的内容设置生存时间TTL,以便当所述TTL超时时,强制删除所缓存的第一响应消息中包含的内容。A buffer according to yet another embodiment of the present invention is shown in FIG. 4 . In FIG. 4 , besides the processing unit 21 , the comparison unit 22 , the statistics unit 23 and the determination unit 24 , the buffer 40 also includes a setting unit 25 . The setting unit 25 is configured to set a time-to-live TTL for the content contained in the cached first response message, so that when the TTL expires, the content contained in the cached first response message is forcibly deleted.
图5中示出了根据本发明再一实施例的缓存器。在图5中,除了处理单元21、比较单元22、统计单元23、确定单元24和设置单元25,缓存器50还包括模拟单元26。该模拟单元26用于模拟终端向所述内容源发起业务请求,以便所述内容源根据所述业务请求中携带的被请求变量的实体值信息来检查内容是否发生了变化。A buffer according to yet another embodiment of the present invention is shown in FIG. 5 . In FIG. 5 , besides the processing unit 21 , the comparing unit 22 , the statistical unit 23 , the determining unit 24 and the setting unit 25 , the buffer 50 also includes an analog unit 26 . The simulation unit 26 is used to simulate a terminal to initiate a service request to the content source, so that the content source can check whether the content has changed according to the entity value information of the requested variable carried in the service request.
图6中示出了根据本发明又一实施例的缓存器。在图6中,除了处理单元21、比较单元22、统计单元23、确定单元24、设置单元25和模拟单元26,缓存器60还包括建立单元27,该建立单元27用于建立所缓存的第一响应消息中包含的内容及所述第一签名值之间的对应关系。由此,处理单元21进一步用于接收终端对第二ULR的业务请求,如果所述第二URL与所缓存的第一URL相同,则向终端发送对应于所述第一URL的所缓存的第一响应消息中包含的内容,否则基于对第二URL的业务请求以及所述对应关系从所述内容源接收第二响应消息,确定所述第二响应消息中包含的内容的第二签名值。比较单元22进一步用于比较所述第二签名值与所述第一签名值,如果相同,则所述缓存器将所缓存的第一响应消息中包含的内容发送给所述终端,否则所述缓存器将从所述内容源接收的第二响应消息中包含的内容的全部内容发送给终端。A buffer according to yet another embodiment of the present invention is shown in FIG. 6 . In Fig. 6, in addition to the processing unit 21, the comparison unit 22, the statistics unit 23, the determination unit 24, the setting unit 25 and the simulation unit 26, the buffer 60 also includes the establishment unit 27, which is used to establish the cached first A correspondence between content contained in a response message and the first signature value. Therefore, the processing unit 21 is further configured to receive a service request from the terminal for the second ULR, and if the second URL is the same as the cached first URL, send the cached first URL corresponding to the first URL to the terminal. A content contained in a response message, otherwise, receiving a second response message from the content source based on the service request for the second URL and the corresponding relationship, and determining a second signature value of the content contained in the second response message. The comparison unit 22 is further configured to compare the second signature value with the first signature value, and if they are the same, the buffer sends the content contained in the cached first response message to the terminal, otherwise the The cache sends all the content contained in the second response message received from the content source to the terminal.
综上所述,本发明实施例的缓存器可以实时跟踪内容的热度变化,将热度高并且实际可以缓存的内容尽可能本地缓存下来,从而起到降低带宽,提升终端业务体验的效果。此外,本发明实施例的缓存器在用本地强制缓存的内容提供服务时,根据需要继续向内容源服务器发送携带If-Modified-Since头域或者If-None-Match头域的请求,内容源服务器可以继续保持对用户访问日志的记录,但是不需要实际返回内容,因此也提升了内容源服务器的性能。To sum up, the cache in the embodiment of the present invention can track changes in popularity of content in real time, and cache content that is hot and can actually be cached locally as much as possible, thereby reducing bandwidth and improving terminal service experience. In addition, when the cache in this embodiment of the present invention provides services with locally cached content, it continues to send requests carrying If-Modified-Since header fields or If-None-Match header fields to the content source server as needed, and the content source server You can continue to keep records of user access logs, but you don't need to actually return the content, so the performance of the content source server is also improved.
图7示出了根据本发明实施例的缓存优化的系统。在多个缓存节点之间实时共享对URL是否可以缓存的分析结果,即整个网络中能共享缓存策略,从而避免多个缓存节点的重复计算,让能缓存的内容尽快缓存到本地,进而提升整个缓存系统的性能。FIG. 7 shows a cache optimization system according to an embodiment of the present invention. The analysis results of whether the URL can be cached are shared in real time among multiple cache nodes, that is, the cache policy can be shared across the entire network, thereby avoiding repeated calculations of multiple cache nodes, allowing cacheable content to be cached locally as soon as possible, thereby improving the overall The performance of the caching system.
例如,如图7所示,根据本发明实施例的缓存优化的系统70包括多个缓存器71、业务管理装置72和可扩展消息处理现场协议(XMPP,The Extensible Messaging andPresence Protocol)服务器73。其中,多个缓存器71可以是如图2至图6所示的缓存器。XMPP服务器73,可以获取业务管理装置72发布的缓存规则以及每个缓存器71发布的对URL是否可以缓存的分析结果,以便业务管理装置72通过XMPP服务器73获知每个缓存器71发布的对URL是否可以缓存的分析结果,以及每个缓存器71通过XMPP服务器73获知业务管理装置72发布的缓存规则和其他缓存器发布的对该URL是否可以缓存的分析结果。因此,本发明实施例的缓存优化的系统可以基于请求的业务内容的签名值确定缓存在本地缓存设备中的缓存内容,从而降低带宽,提升终端业务体验。For example, as shown in FIG. 7 , a cache optimization system 70 according to an embodiment of the present invention includes multiple caches 71 , a service management device 72 and an Extensible Messaging and Presence Protocol (XMPP, The Extensible Messaging and Presence Protocol) server 73 . Wherein, the plurality of registers 71 may be registers as shown in FIG. 2 to FIG. 6 . The XMPP server 73 can obtain the caching rules issued by the service management device 72 and the analysis result of whether the URL issued by each cache 71 can be cached, so that the service management device 72 can learn the URL issued by each cache 71 through the XMPP server 73 The analysis result of whether the URL can be cached, and each cache 71 obtains the caching rules issued by the service management device 72 and the analysis results of whether the URL can be cached issued by other caches through the XMPP server 73 . Therefore, the caching optimization system in the embodiment of the present invention can determine the caching content cached in the local caching device based on the signature value of the requested service content, thereby reducing bandwidth and improving terminal service experience.
在实际中,可以通过共享各个缓存节点(例如,缓存器71)的分析结果,从而优化整体缓存性能。例如,基于XMPP协议的发布/订阅模型来实现缓存分析结果的发布和共享。具体而言,业务管理装置72可以作为发布者,可以根据配置向XMPP服务器73发布已知的缓存规则;每个缓存节点(例如,缓存器71)也可以作为发布者,向XMPP服务器73实时发布该缓存节点对URL是否可以缓存的分析结果;业务管理装置72同时也作为订阅者,向XMPP服务器73订阅其它缓存节点实时发布的对URL是否可以缓存的分析结果,这些结果可以帮助运营商进行更深层次的分析和归纳,最终可以形成静态规则而配置到所有的缓存节点上;每个缓存节点(例如,缓存器71)同时也都是作为订阅者,向XMPP服务器73订阅业务管理装置72下发的缓存规则,同时也订阅其它缓存节点发布的对URL是否可以缓存的分析结果。例如,如果一个缓存节点(例如,缓存器71)从其它缓存节点收到某个URL可以缓存而本地目前是作为不能缓存处理的,则在热度达到阈值后可以直接缓存在本地而不用计算校验是否一致;如果一个缓存节点(例如,缓存器71)从其它缓存节点收到某个URL不可以缓存则直接将该URL放到不能缓存的黑名单中。通过这种多个缓存节点之间共享分析结果,可以减少整个网络内校验比较的操作,从而提升了整个系统的性能。In practice, the overall cache performance can be optimized by sharing the analysis results of each cache node (eg cache 71 ). For example, publishing and sharing of cached analysis results is implemented based on the publish/subscribe model of the XMPP protocol. Specifically, the service management device 72 can act as a publisher and publish known cache rules to the XMPP server 73 according to the configuration; each cache node (for example, cache 71) can also serve as a publisher and publish the known cache rules to the XMPP server 73 in real time. The caching node analyzes the results of whether the URL can be cached; the service management device 72 also serves as a subscriber, and subscribes to the XMPP server 73 to analyze the results of whether the URL can be cached in real time issued by other caching nodes. Hierarchical analysis and induction can finally form static rules and configure them on all cache nodes; each cache node (for example, cache 71) also acts as a subscriber, and sends the subscription service management device 72 to the XMPP server 73 It also subscribes to the analysis results published by other cache nodes on whether the URL can be cached. For example, if a cache node (for example, cache 71) receives a certain URL from other cache nodes that can be cached and the local site is currently not cacheable, it can be directly cached locally after the heat reaches the threshold without calculating the checksum. whether it is consistent; if a cache node (for example, cache 71) receives from other cache nodes that a certain URL cannot be cached, then directly put the URL into the blacklist that cannot be cached. By sharing the analysis results among multiple cache nodes, the operation of checking and comparing in the entire network can be reduced, thereby improving the performance of the entire system.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can appreciate that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present invention.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or May be integrated into another system, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the functions described above are realized in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and other media that can store program codes. .
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (13)
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2012/070791 WO2013113150A1 (en) | 2012-01-31 | 2012-01-31 | Cache optimization method, cache and cache optimization system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103416027A CN103416027A (en) | 2013-11-27 |
CN103416027B true CN103416027B (en) | 2017-06-20 |
Family
ID=48904361
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201280000262.7A Active CN103416027B (en) | 2012-01-31 | 2012-01-31 | The system of the method, buffer and cache optimization of cache optimization |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103416027B (en) |
WO (1) | WO2013113150A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106789857B (en) * | 2015-11-25 | 2020-08-14 | 中国移动通信集团公司 | An information interaction method, device and cache system |
CN105959361A (en) * | 2016-04-25 | 2016-09-21 | 乐视控股(北京)有限公司 | Task distribution method, task distribution device, and task distribution system |
CN108471355A (en) * | 2018-02-28 | 2018-08-31 | 哈尔滨工程大学 | A kind of Internet of Things Information Interoperability method based on extra large cloud computing framework |
CN109788047B (en) * | 2018-12-29 | 2021-07-06 | 山东省计算中心(国家超级计算济南中心) | A cache optimization method and a storage medium |
CN110555184A (en) * | 2019-09-06 | 2019-12-10 | 深圳市珍爱捷云信息技术有限公司 | resource caching method and device, computer equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101473590A (en) * | 2006-05-05 | 2009-07-01 | 奥多比公司 | System and method for caching WEB files |
CN101888349A (en) * | 2009-05-13 | 2010-11-17 | 上海即略网络信息科技有限公司 | Interworking gateway of MSN and XMPP |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100316288B1 (en) * | 1999-08-28 | 2001-12-20 | 서평원 | Wireless Internet Service Method In Gateway System |
US20040010543A1 (en) * | 2002-07-15 | 2004-01-15 | Steven Grobman | Cached resource validation without source server contact during validation |
CN101706827B (en) * | 2009-08-28 | 2011-09-21 | 四川虹微技术有限公司 | Method for caching file of embedded browser |
CN102096712A (en) * | 2011-01-28 | 2011-06-15 | 深圳市五巨科技有限公司 | Method and device for cache-control of mobile terminal |
-
2012
- 2012-01-31 CN CN201280000262.7A patent/CN103416027B/en active Active
- 2012-01-31 WO PCT/CN2012/070791 patent/WO2013113150A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101473590A (en) * | 2006-05-05 | 2009-07-01 | 奥多比公司 | System and method for caching WEB files |
CN101888349A (en) * | 2009-05-13 | 2010-11-17 | 上海即略网络信息科技有限公司 | Interworking gateway of MSN and XMPP |
Also Published As
Publication number | Publication date |
---|---|
WO2013113150A1 (en) | 2013-08-08 |
CN103416027A (en) | 2013-11-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10873451B2 (en) | Content delivery network processing method, content delivery network, device, and storage medium | |
CN103329113B (en) | Configuration is accelerated and custom object and relevant method for proxy server and the Dynamic Website of hierarchical cache | |
US10491657B2 (en) | Network acceleration method, apparatus and device based on router device | |
US6917960B1 (en) | Intelligent content precaching | |
US10587544B2 (en) | Message processing method, processing server, terminal, and storage medium | |
CN107025234B (en) | Information pushing method and cache server | |
US9866655B2 (en) | Server initiated multipath content delivery | |
CN103124263B (en) | A kind of advertisement push system and advertisement pushing equipment, Advertisement Server | |
CN102891807B (en) | A kind of network traffic cache method and system based on positive guide | |
TW201824047A (en) | Attack request determination method, apparatus and server | |
US20120096116A1 (en) | Content distribution network using a web browser and locally stored content to directly exchange content between users | |
US20100115613A1 (en) | Cacheable Mesh Browsers | |
Hefeeda et al. | Design and evaluation of a proxy cache for peer-to-peer traffic | |
CN103001964B (en) | Buffer memory accelerated method under a kind of LAN environment | |
CN110830564A (en) | CDN scheduling method, apparatus, system, and computer-readable storage medium | |
WO2017025052A1 (en) | Resource caching method and device | |
WO2013060210A1 (en) | Sharing control system and method for network resources download information | |
CN103416027B (en) | The system of the method, buffer and cache optimization of cache optimization | |
CN104506637A (en) | Caching method and caching system for solving problem of network congestion and URL (uniform resource locator) forwarding server | |
CN115883657A (en) | Method and system for accelerated scheduling of cloud disk services | |
CN106856456B (en) | Processing method and system for cache cluster service | |
US9350822B2 (en) | Distributed web object identification for web caching | |
CN102857547A (en) | Distributed caching method and device | |
US9729650B2 (en) | Providing data to a network terminal | |
Sehati et al. | Network assisted latency reduction for mobile web browsing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220209 Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province Patentee after: Huawei Cloud Computing Technologies Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |