CN116233252A - A CDN back-to-source method and device - Google Patents
A CDN back-to-source method and device Download PDFInfo
- Publication number
- CN116233252A CN116233252A CN202211679010.3A CN202211679010A CN116233252A CN 116233252 A CN116233252 A CN 116233252A CN 202211679010 A CN202211679010 A CN 202211679010A CN 116233252 A CN116233252 A CN 116233252A
- Authority
- CN
- China
- Prior art keywords
- source
- node device
- origin
- returning
- cdn
- 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.)
- Pending
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供一种CDN回源方法及装置,涉及CDN回源领域,该方法包括:内容分发网络CDN边缘节点设备接收到用户请求后,在所述CDN边缘节点设备的本地缓存中未查找到所述用户请求相应的缓存数据的情况下,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备;在判定所述回源节点设备具备回源条件的情况下,所述CDN边缘节点设备将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。采用对回源节点设备设置回源条件,具备回源条件才能进行回源,不影响其他业务,降低了故障概率。
The embodiment of the present invention provides a CDN back-to-source method and device, which relate to the field of CDN back-to-source, and the method includes: after a content distribution network CDN edge node device receives a user request, it does not search in the local cache of the CDN edge node device When the user requests the corresponding cached data, use the upper-level node device of the CDN edge node device as the source-returning node device for back-to-source; In the case of , the CDN edge node device forwards the user request to the back-to-origin node device, obtains the cached data corresponding to the user request from the local cache of the back-to-source node device, and returns it to the user. The back-to-source conditions are set for the back-to-source node equipment, and only the back-to-source conditions can be used to perform back-to-source, without affecting other services and reducing the probability of failure.
Description
技术领域technical field
本发明涉及CDN回源领域,具体涉及一种CDN回源方法及装置。The present invention relates to the field of CDN back-to-source, in particular to a CDN back-to-source method and device.
背景技术Background technique
CDN回源是一个动作。这个动作包括常见的如CDN边缘节点设备如果没有可返回给用户的资源,那么需要回源到二级节点设备拿资源,同理二级节点设备如果也没有这个资源,那么需要回源三级节点设备,以此类推,直到回源到真正的源站拿到资源,即每一次去取资源的这个动作就是CDN回源。CDN当前回源逻辑分为两种:一种是回源正常的情况,一种是回源异常的情况。回源正常的访问流程是指:当用户访问某一个资源的时候,首先到达CDN的边缘节点设备,边缘节点设备如果恰好有这个资源,那么直接返回给用户;如果没有这个资源,CDN边缘节点设备会回源到CDN二级节点设备去下载资源,如果CDN二级节点设备恰好有这个资源,那么CDN二级节点设备将资源返回给边缘节点设备,CDN边缘节点设备将此资源返回给用户,同时落一份资源到自己存储上,下一次用户访问就可以直接返回给用户;那么如果CDN的边缘节点设备、二级节点设备都没有这个资源的话,会回真正的源站存储去拉资源,依次类推,最终将资源返回给用户,同时CDN的边缘节点设备、二级节点设备上也都会将此资源缓存下来。回源异常的访问流程是指:前面的流程如回源正常的访问流程,不同的是最后一步,当二级节点设备回源到真正的源站存储去拉资源的时候,源站由于某种异常,导致回源特别的慢,最终因为回源超时触发了CDN回源重试逻辑,然后多个CDN二级节点设备都去重试源站,最后有可能会重试成功,也有可能会重试失败,重试成功后自然最好,重试失败后会继续重试。CDN back-to-source is an action. This action includes common such as CDN edge node equipment, if there is no resource that can be returned to the user, then it needs to go back to the source to the second-level node device to get the resource. Similarly, if the second-level node device does not have this resource, then it needs to go back to the source of the third-level node. Devices, and so on, until the source is returned to the real source site to obtain resources, that is, every time the action of fetching resources is CDN return to the source. CDN currently has two back-to-origin logics: one is when back-to-origin is normal, and the other is when back-to-origin is abnormal. The normal access process of back-to-source refers to: when a user accesses a certain resource, it first arrives at the edge node device of the CDN. If the edge node device happens to have this resource, it will directly return it to the user; It will go back to the CDN secondary node device to download resources. If the CDN secondary node device happens to have this resource, then the CDN secondary node device will return the resource to the edge node device, and the CDN edge node device will return the resource to the user. Save a resource to your own storage, and the next time the user visits, it can be returned directly to the user; then if neither the edge node device nor the secondary node device of the CDN has this resource, it will go back to the real source site to store the resource, and then By analogy, the resource is finally returned to the user, and at the same time, the edge node device and the secondary node device of the CDN will also cache the resource. The abnormal access process of returning to the source refers to: the previous process is like the normal access process of returning to the source, but the difference is the last step. Abnormal, resulting in very slow back-to-origin, and finally because the back-to-origin timeout triggers the CDN back-to-origin retry logic, and then multiple CDN secondary node devices retry the origin site, and finally the retry may succeed, or it may retry If the retry fails, it is naturally best if the retry succeeds, and it will continue to retry after the retry fails.
现有技术的缺点如下:由于在源站发生故障的时候,会大大增加CDN的故障风险,一个原因是源站存储返回资源很慢导致占用CDN二级节点设备的连接数,一个原因是如果源站给的资源很慢达到了CDN二级节点设备设置的超时时间,此时会将此连接断开而重试,如此多个CDN二级节点设备均会出现连接数堆积、CPU满载等问题,最终导致CDN二级节点设备不可用,影响CDN服务的其他业务,拖垮CDN二级节点设备,造成雪崩的情况。即一个业务源站异常,影响了整个CDN,进而影响了其他业务,导致CDN服务不可用。The disadvantages of the existing technology are as follows: when the source site fails, the risk of CDN failure will be greatly increased. One reason is that the source site stores and returns resources very slowly, which occupies the number of connections of the CDN secondary node equipment. One reason is that if the source site The resources provided by the site are too slow to reach the timeout period set by the CDN secondary node device. At this time, the connection will be disconnected and retried. Such multiple CDN secondary node devices will have problems such as accumulation of connections and full CPU load. Eventually, the CDN secondary node equipment is unavailable, affecting other services served by the CDN, dragging down the CDN secondary node equipment, and causing an avalanche. That is, a service source site is abnormal, which affects the entire CDN, which in turn affects other services, resulting in the unavailability of CDN services.
发明内容Contents of the invention
本发明实施例提供一种CDN回源方法及装置,能够解决现有技术中CDN回源所带来的技术问题。Embodiments of the present invention provide a CDN back-to-source method and device, which can solve technical problems caused by CDN back-to-source in the prior art.
为达上述目的,一方面,本发明实施例提供一种CDN回源方法,包括:In order to achieve the above purpose, on the one hand, an embodiment of the present invention provides a CDN back-to-source method, including:
内容分发网络CDN边缘节点设备接收到用户请求后,在所述CDN边缘节点设备的本地缓存中未查找到所述用户请求相应的缓存数据的情况下,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备;After receiving the user request, the content distribution network CDN edge node device sends the upper level of the CDN edge node device to the The node device is used as the back-to-source node device for back-to-source;
在判定所述回源节点设备具备回源条件的情况下,所述CDN边缘节点设备将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。When it is determined that the origin-returning node device has the origin-returning node device, the CDN edge node device forwards the user request to the origin-returning node device, and obtains the The user requests corresponding cached data to be returned to the user.
另一方面,本发明实施例提供一种CDN回源装置,包括设于内容分发网络CDN边缘节点设备内的回源启动模块和回源模块,其中:On the other hand, an embodiment of the present invention provides a CDN back-to-source device, including a back-to-source startup module and a back-to-source module disposed in a CDN edge node device of a content distribution network, wherein:
所述回源启动模块,用于在所述CDN边缘节点设备接收到用户请求后,在所述CDN边缘节点设备的本地缓存中未查找到所述用户请求相应的缓存数据的情况下,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备;The back-to-source starting module is configured to, after the CDN edge node device receives the user request, if the corresponding cached data requested by the user is not found in the local cache of the CDN edge node device, The upper-level node device of the above-mentioned CDN edge node device is used as the back-to-source node device for back-to-source;
所述回源模块,用于在判定所述回源节点设备具备回源条件的情况下,将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。The origin-returning module is configured to forward the user request to the origin-returning node device when it is determined that the origin-returning node device meets the origin-returning node device, and obtain the request from the local cache of the origin-returning node device The user requests corresponding cached data to be returned to the user.
上述技术方案具有如下有益效果:采用对回源节点设备设置回源条件,具备回源条件才能进行回源,不具备回源条件的则终止回源,不会无条件进行回源,实现了回源业务的隔离,而不影响CDN内的其他业务,大大降低了CDN得故障概率;并且回源采用自动化方式处理,运维成本较低。The above technical solution has the following beneficial effects: by setting the back-to-source conditions for the back-to-source node equipment, the back-to-source conditions can only be performed, and if the back-to-source conditions are not met, the back-to-source will be terminated, and the back-to-source will not be performed unconditionally, realizing the back-to-source The isolation of services without affecting other services in the CDN greatly reduces the failure probability of the CDN; and the back-to-source is processed automatically, and the operation and maintenance cost is low.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the 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 These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1是本发明实施例的一种CDN回源方法的流程图;Fig. 1 is a flowchart of a CDN back-to-source method according to an embodiment of the present invention;
图2是本发明实施例的一种CDN回源装置的结构图;FIG. 2 is a structural diagram of a CDN back-to-source device according to an embodiment of the present invention;
图3是本发明实施例的另一CDN回源方法的流程图;Fig. 3 is a flowchart of another CDN back-to-source method according to an embodiment of the present invention;
图4是本发明实施例的采用回源装置进行CDN回源的系统架构图。Fig. 4 is a system architecture diagram of CDN back-to-source using a back-to-source device according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。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 only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
如图1所示,结合本发明的实施例,提供一种CDN回源方法,包括:As shown in Figure 1, in combination with the embodiment of the present invention, a CDN back-to-source method is provided, including:
S101:内容分发网络CDN边缘节点设备接收到用户请求后,在所述CDN边缘节点设备的本地缓存中未查找到所述用户请求相应的缓存数据的情况下,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备;S101: After the CDN edge node device of the content distribution network receives the user request, if the corresponding cached data requested by the user is not found in the local cache of the CDN edge node device, the CDN edge node device uploads the The first-level node device is used as the back-to-source node device for back-to-source;
S102:在判定所述回源节点设备具备回源条件的情况下,所述CDN边缘节点设备将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。S102: When it is determined that the origin-returning node device has the origin-returning node device, the CDN edge node device forwards the user request to the origin-returning node device, and obtains the request from the local cache of the origin-returning node device The user requests corresponding cached data to be returned to the user.
其中,可以通过回源节点设备判断自身是否具备回源条件并将判断结果通知CDN边缘节点设备,回源节点设备是指CDN边缘节点设备相邻的上一级节点设备或者源站设备。也可以通过CDN边缘节点设备判断当前的回源节点设备是否具备回源条件。Wherein, the origin-returning node device can judge whether it has the origin-returning condition and notify the CDN edge node device of the judgment result. The origin-returning node device refers to the upper-level node device or origin station device adjacent to the CDN edge node device. It is also possible to judge whether the current back-to-source node device meets the back-to-source conditions through the CDN edge node device.
优选地,CDN回源方法,还包括:Preferably, the CDN back-to-source method further includes:
S103:在所述回源节点设备不具备回源条件的情况下,停止自所述回源节点设备进行回源。S103: When the origin-returning node device does not meet the origin-returning condition, stop performing origin-returning from the origin-returning node device.
优选地,在所述CDN边缘节点设备与源站设备之间设有至少一个级别的节点设备的情况下,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备之后,还包括:Preferably, when there is at least one level of node device between the CDN edge node device and the source station device, the upper-level node device of the CDN edge node device is used as the source for returning to the source After the node device, also include:
S104:在所述回源节点设备不具备回源条件的情况下,将当前的回源节点设备的上一级节点设备更新为回源节点设备,并基于更新后的回源节点设备是否具备回源条件判断是否需要更新回源节点设备,直至更新后的回源节点设备具备回源条件或者将源站设备更新为回源节点设备。S104: In the case that the back-to-source node device does not have the back-to-source condition, update the upper-level node device of the current back-to-source node device to the back-to-source node device, and based on whether the updated back-to-source node device has the back-to-source node device, The source condition determines whether to update the source node device until the updated source node device meets the source condition or the source station device is updated to the source node device.
优选地,CDN回源方法,还包括:Preferably, the CDN back-to-source method further includes:
S105:判断所述回源节点设备是否具备回源条件,具体可以包括:S105: Determine whether the back-to-source node device meets the back-to-source conditions, which may specifically include:
S1051:获取所述用户请求对应的业务域名,获取在所述回源节点设备内为所述业务域名配置的至少一个回源IP;S1051: Obtain the service domain name corresponding to the user request, and acquire at least one source-returning IP configured for the service domain name in the source-returning node device;
S1052:针对配置的每个回源IP,判断向每个所述回源IP发送的并行总请求数是否大于第一请求数阈值,确认向每个所述回源IP发送的并行总请求数均大于第一请求数阈值时,判定所述回源节点设备不具备回源条件;S1052: For each source-backing IP configured, determine whether the total number of parallel requests sent to each source-backing IP is greater than the first request number threshold, and confirm that the total number of parallel requests sent to each source-backing IP is When it is greater than the first request number threshold, it is determined that the back-to-source node device does not meet the back-to-source conditions;
S1053:在向其中任一所述回源IP发送的并行总请求数不大于第一请求数阈值的情况下,进一步判断通过所述业务域名向所配置的所有回源IP发送的并行总请求数是否大于第二请求数阈值;S1053: If the total number of parallel requests sent to any one of the back-source IPs is not greater than the first request number threshold, further determine the total number of parallel requests sent to all configured back-source IPs through the business domain name Whether it is greater than the second request number threshold;
S1054:确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数大于第二请求数阈值时,判定所述回源节点设备不具备回源条件;S1054: When confirming that the total number of parallel requests sent to all the configured origin-returning IPs through the service domain name is greater than the second request number threshold, determine that the origin-returning node device does not meet the origin-returning condition;
S1055:确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数不大于第二请求数阈值时,判定所述回源节点设备具备回源条件。S1055: When it is confirmed that the total number of parallel requests sent to all the configured origin-returning IPs through the service domain name is not greater than the second request number threshold, determine that the origin-returning node device meets the origin-returning condition.
优选地,CDN回源方法,还包括:Preferably, the CDN back-to-source method further includes:
S106:在所述回源节点设备通过某个回源IP进行回源的同时,更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数;S106: When the origin-returning node device performs origin-returning through a certain origin-returning IP, update the total number of parallel requests sent to the origin-returning IP, and update all the configured origin-returning requests through the service domain name The total number of parallel requests sent by the IP;
S107:通过所述回源IP将所述用户请求相应的缓存数据返回给所述CDN边缘节点设备之后,标记与所述用户请求相应的回源被响应;更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数。S107: After returning the cached data corresponding to the user request to the CDN edge node device through the origin-returning IP, mark that the origin-returning corresponding to the user request is responded; update the parallel data sent to the origin-returning IP The total number of requests, and update the total number of parallel requests sent to all configured back-to-source IPs through the business domain name.
优选地,所述CDN回源方法,还包括:Preferably, the CDN back-to-source method further includes:
S108:在所述回源节点设备具备回源条件、且是源站设备的情况下,所述CDN边缘节点设备自源站设备的本地缓存获取所述用户请求相应的缓存数据后,保存相应的缓存数据在本地缓存;S108: In the case that the origin-returning node device has the origin-returning condition and is an origin station device, the CDN edge node device obtains the cached data corresponding to the user request from the local cache of the origin station device, and saves the corresponding Cache data is cached locally;
S109:在所述回源节点设备具备回源条件、且所述CDN边缘节点设备所述回源节点设备之间具有至少一个不具备回源条件的节点设备的情况下,将所述回源节点设备返回的所述缓存数据依次返回给各所述不具备回源条件的节点设备,直至返回到所述CDN边缘节点设备,各所述不具备回源条件的节点设备以及所述CDN边缘节点设备将所述缓存数据保存在各自的本地缓存。S109: In the case that the origin-returning node device has the origin-returning condition, and there is at least one node device that does not meet the origin-returning condition between the CDN edge node device and the origin-returning node device, set the origin-returning node The cache data returned by the device is returned to each of the node devices that do not have the back-to-source condition in turn, until it is returned to the CDN edge node device, each of the node devices that do not have the back-to-source condition and the CDN edge node device Save the cached data in their respective local caches.
如图2所示,结合本发明的实施例,提供一种CDN回源装置,包括设于CDN(内容分发网络)边缘节点设备内的回源启动模块和回源模块,其中:As shown in Figure 2, in combination with the embodiments of the present invention, a CDN back-to-source device is provided, including a back-to-source startup module and a back-to-source module disposed in CDN (Content Distribution Network) edge node devices, wherein:
回源启动模块21,用于在所述CDN边缘节点设备接收到用户请求后,在所述CDNThe back-to-
边缘节点设备的本地缓存中未查找到所述用户请求相应的缓存数据的情况下,将所述CDN5边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备;When the corresponding cached data requested by the user is not found in the local cache of the edge node device, the upper-level node device of the CDN5 edge node device is used as the back-to-source node device for back-to-source;
回源模块22,用于在判定所述回源节点设备具备回源条件的情况下,所述CDN边缘节点设备将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。The origin-returning
优选地,所述回源模块22,还用于:Preferably, the back-to-
0在所述回源节点设备不具备回源条件的情况下,停止自所述回源节点设备进行回源。0 If the origin-returning node device does not meet the origin-returning condition, stop performing origin-returning from the origin-returning node device.
优选地,所述回源模块22,还用于:Preferably, the back-to-
将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备之后,在所述回源节点设备不具备回源条件、在所述CDN边缘节点设备与源站设备之间设有至After the upper-level node device of the CDN edge node device is used as the origin-returning node device, if the origin-returning node device does not have the origin-returning condition, the CDN edge node device and the origin station device between
少一个级别的节点设备的情况下,将当前的回源节点设备的上一级节点设备更新为回源节5点设备,并基于更新后的回源节点设备是否具备回源条件判断是否需要更新回源节点设备,If one level of node equipment is missing, update the upper-level node equipment of the current back-to-source node device to the back-to-source node 5-point device, and judge whether it needs to be updated based on whether the updated back-to-source node device meets the back-to-source conditions Back to the source node device,
直至更新后的回源节点设备具备回源条件或者将源站设备更新为回源节点设备。Until the updated back-to-source node device meets the back-to-source conditions or the source station device is updated to the back-to-source node device.
优选地,所述装置还包括设于回源节点设备或所述CDN边缘节点设备内的回源判断模块,所述回源判断模块包括:Preferably, the device further includes a back-to-origin judging module set in the back-to-origin node device or the CDN edge node device, and the back-to-origin judging module includes:
条件获取子模块,用于获取所述用户请求对应的业务域名,获取在所述回源节点设备0内为所述业务域名配置的至少一个回源IP;A condition acquisition submodule, configured to acquire the service domain name corresponding to the user request, and acquire at least one source-returning IP configured for the service domain name in the source-returning node device 0;
第一判断子模块,用于针对配置的每个回源IP,判断向每个所述回源IP发送的并行总请求数是否大于第一请求数阈值,确认向每个所述回源IP发送的并行总请求数均大于第一请求数阈值时,判定所述回源节点设备不具备回源条件;The first judging submodule is used to determine whether the total number of parallel requests sent to each of the source-backing IPs is greater than the first request number threshold for each configured source-backing IP, and to confirm that the request is sent to each of the source-backing IPs. When the total number of parallel requests is greater than the first request number threshold, it is determined that the back-to-source node device does not meet the back-to-source conditions;
第二判断子模块,用于在向其中任一所述回源IP发送的并行总请求数不大于第一请求5数阈值的情况下,进一步判断通过所述业务域名向所配置的所有回源IP发送的并行总请求The second judging sub-module is used to further judge all back-to-source configured through the service domain name when the total number of parallel requests sent to any one of the back-to-source IPs is not greater than the threshold of the first request number Total parallel requests sent by IP
数是否大于第二请求数阈值;Whether the number is greater than the second request number threshold;
确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数大于第二请求数阈值时,判定所述回源节点设备不具备回源条件;When confirming that the total number of parallel requests sent to all the configured back-to-source IPs through the service domain name is greater than the second request number threshold, it is determined that the back-to-source node device does not meet the back-to-source conditions;
确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数不大于第二请求0数阈值时,判定所述回源节点设备具备回源条件。When it is confirmed that the total number of parallel requests sent to all the configured back-to-source IPs through the service domain name is not greater than the second request zero threshold, it is determined that the back-to-source node device meets the back-to-source conditions.
优选地,所述CDN回源装置,还包括设于回源节点设备内的第一更新模块,和/或,设于CDN边缘节点设备、以及各不具备回源条件的节点设备内的第二更新模块,其中:Preferably, the CDN back-to-source device further includes a first update module set in the back-to-source node device, and/or a second update module set in the CDN edge node device and each node device that does not have the back-to-source condition Update the module, where:
所述第一更新模块,用于在所述回源节点设备通过某个回源IP进行回源的同时,更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数;通过所述回源IP将所述用户请求相应的缓存数据返回给所述CDN边缘节点设备之后,标记与所述用户请求相应的回源被响应;更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数;The first update module is configured to update the total number of parallel requests sent to the origin-returning IP while the origin-returning node device performs the origin-returning through a certain origin-returning IP, and update the number of requests passed through the service domain name The total number of parallel requests sent to all configured back-to-source IPs; after returning the cached data corresponding to the user request to the CDN edge node device through the back-to-source IP, mark the back-to-source corresponding to the user request Responded; update the total number of parallel requests sent to the source IP, and update the total number of parallel requests sent to all configured source IPs through the business domain name;
设于CDN边缘节点设备内的第二更新模块,用于在所述回源节点设备具备回源条件的情况下,自所述回源节点设备的本地缓存获取所述用户请求相应的缓存数据后,保存相应的缓存数据在本地缓存;The second update module installed in the CDN edge node device is used to obtain the corresponding cached data requested by the user from the local cache of the origin-returning node device when the origin-returning node device meets the origin-returning condition , save the corresponding cached data in the local cache;
设于各不具备回源条件的节点设备内的第二更新模块,在所述回源节点设备具备回源条件、且所述CDN边缘节点设备与所述回源节点设备之间具有至少一个不具备回源条件的节点设备的情况下,将所述回源节点设备返回的所述缓存数据保存在各自的本地缓存。The second update module installed in each node device that does not have the back-to-source condition, where the back-to-source node device has the back-to-source condition, and there is at least one non-returning node device between the CDN edge node device and the back-to-source node device. In the case of a node device having the back-to-source condition, the cached data returned by the back-to-source node device is stored in respective local caches.
本发明实施例所取得的有益技术效果如下:The beneficial technical effect that the embodiment of the present invention obtains is as follows:
(1)CDN回源装置直接附加在CDN缓存软件上,配置(即开关)可直接开启或者关闭,无需对线上原有环境进行二次开发,在需要此CDN回源装置时,只需要通过配置开启此模块即可,实现了低耦合。在不需要此CDN回源装置时,只需要通过配置关闭即可。易扩展,易维护,且本身的程序逻辑及配置也较为简单,虽然看起来较为简单的功能,但是在回源的时候起到了重要作用。完全自动化处理,故障后无需人工干预来恢复故障,不仅减少了运维成本,同时大大降低了故障概率。(1) The CDN back-to-source device is directly attached to the CDN cache software, and the configuration (that is, the switch) can be directly turned on or off without secondary development of the original online environment. When the CDN back-to-source device is needed, it only needs to be configured Just turn on this module to achieve low coupling. When this CDN back-to-origin device is not needed, it only needs to be turned off through configuration. It is easy to expand and maintain, and its own program logic and configuration are relatively simple. Although it seems to be a relatively simple function, it plays an important role in returning to the source. Completely automated processing, no manual intervention is required to restore the fault after the fault, which not only reduces the operation and maintenance cost, but also greatly reduces the probability of failure.
(2)CDN回源装置通过限制回源的“并行请求数”来达到回源限流的功能,使得各个业务域名之间相互独立回源,互不影响,不会影响其它无关业务,起到了重要的业务隔离性,从而保护了CDN本身及源站存储,大大减少了故障风险。(2) The CDN back-to-origin device achieves the function of back-to-source and current-limiting by limiting the "parallel request number" of back-to-source, so that each business domain name is back to the source independently of each other, without affecting each other, and will not affect other irrelevant services, which plays a role Important business isolation, thus protecting the CDN itself and the source site storage, greatly reducing the risk of failure.
(3)采用双重限制:严格限制了域名+回源IP的组合回源并行请求数,又宽松限制了整体的回源并行请求数,从而降低回源压力、缩减源站恢复时间;回源连接数被限制后,相应的也会减少源站的压力,给了源站足够的恢复时间,不至于在恢复的过程中被重新打垮。(3) Double restrictions are adopted: the combination of domain name + back-to-source IP is strictly limited to the number of back-to-source parallel requests, and the overall number of back-to-source parallel requests is loosely limited, thereby reducing the back-to-source pressure and shortening the recovery time of the source station; back-to-source connection After the number is limited, the pressure on the source site will be correspondingly reduced, giving the source site enough recovery time so that it will not be knocked down again during the recovery process.
(4)单机部署,只需要部署到每台服务器(即节点设备)上,每台服务器上的程序相互独立工作,互不影响。(4) Stand-alone deployment only needs to be deployed on each server (ie, node device), and the programs on each server work independently of each other without affecting each other.
下面结合具体的应用实例对本发明实施例上述技术方案进行详细说明,实施过程中没有介绍到的技术细节,可以参考前文的相关描述。The above technical solutions of the embodiments of the present invention will be described in detail below in conjunction with specific application examples. For technical details not introduced in the implementation process, refer to the relevant descriptions above.
本发明实施例一种内容分发网络CDN的回源方法,能够使得回源业务隔离,业务隔离是指在回源时,各个业务相互独立,不互相干扰。针对CDN承载业务多、其访问资源不同所需回源的源站也不一样的特性,从而CDN上去区分不同业务,各自的业务拥有独立的运行环境,那么即使一个业务故障,也只是影响业务本身,而不会影响到其它业务。An embodiment of the present invention provides a back-to-origin method for a content distribution network CDN, which can isolate back-to-origin services. Service isolation means that each service is independent of each other and does not interfere with each other during back-to-origin. In view of the fact that the CDN carries many services and the source sites required to return to the source are different for different access resources, the CDN distinguishes different services, and each service has an independent operating environment, so even if a service fails, it only affects the service itself , without affecting other businesses.
一种内容分发网络CDN的回源方法采用业务隔离模块实现,工作流程图如图3所示。工作流程步骤包括:A back-to-source method of a content distribution network CDN is realized by a service isolation module, and the work flow chart is shown in FIG. 3 . Workflow steps include:
一、用户发起访问资源请求。1. The user initiates a resource access request.
二、CDN边缘节点设备收到用户求,即进入回源启动模块:CDN边缘节点设备查找本地缓存,如果本地有缓存,直接将资源返回给用户;如果本地没有缓存,将所述CDN边缘节点设备的上一级节点设备作为用于进行回源的回源节点设备。2. When the CDN edge node device receives the user request, it enters the back-to-source startup module: the CDN edge node device searches for the local cache, and if there is a cache locally, it directly returns the resource to the user; if there is no cache locally, the CDN edge node device The upper-level node device of the server is used as the source-back node device for back-to-source.
三、通过设于回源节点设备或者CDN边缘节点设备内的回源判断模块的各子模块进行判定。3. Judgment is made by each sub-module of the origin-return judgment module set in the origin-returning node device or the CDN edge node device.
在系统上已经设定好回源的规则,针对某个业务域名,当需要回源时,只能到指定好的相应的回源IP请求资源来回源。获取所述用户请求对应的业务域名,获取在所述回源节点设备内为所述业务域名配置的至少一个回源IP;即在回源之前,从访问资源中拿到业务域名(即host),同时根据设定的规则拿到回源的IP,采用域名+回源IP的方式,匹配出在所要回源的二级节点设备的当前回源IP内当前业务域名的并行请求数A。The back-to-source rules have been set on the system. For a certain business domain name, when it is necessary to go back to the source, you can only go to the corresponding designated back-to-source IP to request resources to go back to the source. Obtain the service domain name corresponding to the user request, and obtain at least one source-returning IP configured for the service domain name in the source-returning node device; that is, obtain the service domain name (ie host) from the access resource before returning to the source , at the same time get the back-to-source IP according to the set rules, use the method of domain name + back-to-source IP to match the number of parallel requests A of the current business domain name in the current back-to-source IP of the secondary node device to be back to the source.
条件获取子模块,用于获取所述用户请求对应的业务域名,获取在所述回源节点设备内为所述业务域名配置的至少一个回源IP;A condition acquisition submodule, configured to acquire the service domain name corresponding to the user request, and acquire at least one source-returning IP configured for the service domain name in the source-returning node device;
第一判断子模块,用于针对配置的每个回源IP,判断向每个所述回源IP发送的并行总请求数是否大于第一请求数阈值,确认向每个所述回源IP发送的并行总请求数均大于第一请求数阈值时,判定所述回源节点设备不具备回源条件;比如判断当前的并行请求数A是否大于A1,如果A大于A1话,将触发业务隔离,拒绝回源,结束。The first judging submodule is used to determine whether the total number of parallel requests sent to each of the source-backing IPs is greater than the first request number threshold for each configured source-backing IP, and to confirm that the request is sent to each of the source-backing IPs. When the total number of parallel requests is greater than the first request number threshold, it is determined that the back-to-source node device does not have the back-to-source condition; for example, it is judged whether the current number of parallel requests A is greater than A1, and if A is greater than A1, business isolation will be triggered. Refuse to return to the source, end.
每个业务域名都会有回源IP,且回源IP为一个或者多个,假如尝试回源IP1失败,则会依次尝试回源IP2、IP3等,那么一个业务域名就会有n次域名+IP的组合方式。这种组合方式生成的并行请求数的和即为总体的并行请求数B。Each business domain name will have a back-to-source IP, and there are one or more back-to-source IPs. If the attempt to go back to the source IP1 fails, it will try to go back to the source IP2, IP3, etc., then a business domain name will have n domain name + IP combination. The sum of the number of parallel requests generated by this combination is the overall number of parallel requests B.
第二判断子模块,用于在向其中任一所述回源IP发送的并行总请求数不大于第一请求数阈值的情况下,进一步判断通过所述业务域名向所配置的所有回源IP发送的并行总请求数是否大于第二请求数阈值;The second judging submodule is used to further judge all the configured back-to-source IPs through the service domain name when the total number of parallel requests sent to any one of the back-to-source IPs is not greater than the first request number threshold Whether the total number of parallel requests sent is greater than the second request number threshold;
确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数大于第二请求数阈值时,判定所述回源节点设备不具备回源条件;When confirming that the total number of parallel requests sent to all the configured back-to-source IPs through the service domain name is greater than the second request number threshold, it is determined that the back-to-source node device does not meet the back-to-source conditions;
确认通过所述业务域名向所配置的所有回源IP发送的并行总请求数不大于第二请求数阈值时,判定所述回源节点设备具备回源条件。When it is confirmed that the total number of parallel requests sent to all configured origin-returning IPs through the service domain name is not greater than the second request threshold, it is determined that the origin-returning node device meets the origin-returning condition.
也就是,如果存在其中一个回源IP,当前并行请求数A是不大于A1,则判断当前业务域名的总体的并行请求数B是否大于B1,如果是的话,拒绝回源,也就是CDN边缘节点设备不将用户请求发送到二级节点设备,结束。如果具备回源条件,CDN边缘节点设备发起请求,携带用户请求,将用户请求发送到二级节点设备;回源由CDN边缘节点设备去做,CDN边缘节点设备取回来资源之后将资源返回给用户。That is, if there is one back-to-source IP, and the current number of parallel requests A is not greater than A1, then judge whether the total number of parallel requests B of the current business domain name is greater than B1, and if so, refuse to go back to the source, that is, the CDN edge node The device does not send the user request to the secondary node device, end. If the back-to-source conditions are met, the CDN edge node device initiates a request, carries the user request, and sends the user request to the secondary node device; the back-to-source is done by the CDN edge node device, and the CDN edge node device retrieves the resources and returns the resources to the user .
在所述回源节点设备不具备回源条件、且所述CDN边缘节点设备与源站设备之间设有至少一个级别的节点设备的情况下,将当前的回源节点设备的上一级节点设备更新为回源节点设备,并基于更新后的回源节点设备是否具备回源条件判断是否需要更新回源节点设备,直至更新后的回源节点设备具备回源条件或者将源站设备更新为回源节点设备。In the case that the origin-returning node device does not have the origin-returning condition, and there is at least one level of node device between the CDN edge node device and the origin station device, the upper-level node of the current origin-returning node device The device is updated as a back-to-source node device, and based on whether the updated back-to-source node device meets the back-to-source conditions, it is judged whether it is necessary to update the back-to-source node device until the updated back-to-source node device meets the back-to-source conditions or the source station device is updated to Back to the source node device.
四、回源模块,在判定所述回源节点设备具备回源条件的情况下,所述CDN边缘节点设备将所述用户请求转发给所述回源节点设备,自所述回源节点设备的本地缓存中获取所述用户请求相应的缓存数据,以返回给所述用户。在所述回源节点设备不具备回源条件的情况下,停止自所述回源节点设备进行回源。4. The origin-returning module, when it is determined that the origin-returning node device has the origin-returning node device, the CDN edge node device forwards the user request to the origin-returning node device, and from the origin-returning node device The cached data corresponding to the user request is obtained from the local cache to return to the user. In the case that the origin-returning node device does not meet the origin-returning condition, the origin-returning from the origin-returning node device is stopped.
五、在所述回源节点设备通过某个回源IP进行回源的同时,通过设于回源节点设备内的第一更新模块更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数。即:将并行请求数A来加1进行更新,形成更新后的并请求数A;以及将并行请求数B来加1进行更新,形成更新后的并请求数B。并给该请求加上标记,然后处理请求。5. While the origin-returning node device is returning to the source through a certain origin-returning IP, update the total number of parallel requests sent to the origin-returning IP through the first update module installed in the origin-returning node device, and, Update the total number of parallel requests sent to all configured back-to-source IPs through the business domain name. That is: add 1 to the number of parallel requests A for update to form an updated number of parallel requests A; and add 1 to the number of parallel requests B for update to form an updated number of parallel requests B. And mark the request, and then process the request.
通过所述回源IP将所述用户请求相应的缓存数据返回给所述CDN边缘节点设备之后,通过设于回源节点设备内的第一更新模块标记与所述用户请求相应的回源被响应;更新向所述回源IP发送的并行总请求数,以及,更新通过所述业务域名向所配置的所有回源IP发送的并行总请求数。即:请求处理结束后,查看该请求,看是否有标记被执行,如果有标记被执行,将并行请求数A来减1进行更新,形成更新后的并请求数A,以及将并行请求数B来减1进行更新,形成更新后的并请求数B,结束。After the cached data corresponding to the user request is returned to the CDN edge node device through the back-to-source IP, the first update module installed in the back-to-source node device marks that the back-to-source corresponding to the user request is responded ; Updating the total number of parallel requests sent to the origin-returning IP, and updating the total number of parallel requests sent to all configured origin-returning IPs through the business domain name. That is: after the request processing is completed, check the request to see if there is a mark to be executed. If there is a mark to be executed, the number of parallel requests A is updated by subtracting 1 to form the updated number of parallel requests A and the number of parallel requests B Subtract 1 to update, form the updated merge request number B, and end.
四、在所述回源节点设备具备回源条件、且是源站设备的情况下,通过设于CDN边缘节点设备内的第二更新模块,在所述回源节点设备具备回源条件的情况下,自所述回源节点设备的本地缓存获取所述用户请求相应的缓存数据后,保存相应的缓存数据在本地缓存。4. In the case that the back-to-source node device has the back-to-source condition and is an origin site device, through the second update module installed in the CDN edge node device, in the case that the back-to-source node device has the back-to-source condition Next, after obtaining the cached data corresponding to the user request from the local cache of the back-to-source node device, the corresponding cached data is saved in the local cache.
在所述回源节点设备具备回源条件、且所述CDN边缘节点设备与所述回源节点设备之间具有至少一个不具备回源条件的节点设备的情况下,通过设于各不具备回源条件的节点设备内的第二更新模块,将所述回源节点设备返回的所述缓存数据保存在各自的本地缓存。In the case that the origin-returning node device has the origin-returning condition, and there is at least one node device that does not meet the origin-returning condition between the CDN edge node device and the origin-returning node device, by setting The second update module in the source-condition node device saves the cached data returned by the source-returning node device in their respective local caches.
通过CDN隔离装置进行CDN回源的系统架构图如图4所示,CDN隔离装置(CDN回源装置)通过多个模块(也称为业务隔离模块)构成,分别集成在已有的CDN边缘设备(边缘节点设备)、处于边缘节点设备与源站设备之间的节点设备、源站设备的缓存软件中。配置CDN隔离装置是否开启或者关闭,通过直接开启或者关闭实现是否采用隔离装置,无需对线上原有环境进行二次开发,在需要此业务隔离模块时,只需要通过配置开启此模块即可,实现了低耦合。在不需要此业务隔离模块时,只需要通过配置关闭通此模块即可。业务隔离模块主要是通过限制各业务的回源请求数来保障CDN整个系统的稳定运行,主要运行逻辑是:限制单个业务域名的“并行请求数”,每个业务只能有规定数量的回源请求被并行处理,超过则返回错误,停止回源。以用户访问资源为例来详细说明一下模块的运作流程,如下:The system architecture diagram of CDN back-to-source through CDN isolation device is shown in Figure 4. The CDN isolation device (CDN back-to-source device) is composed of multiple modules (also called business isolation modules), which are respectively integrated in existing CDN edge devices (edge node device), the node device between the edge node device and the source station device, and the cache software of the source station device. Configure whether the CDN isolation device is turned on or off, and whether to use the isolation device by directly turning it on or off does not require secondary development of the original online environment. When this business isolation module is needed, it only needs to be enabled through configuration to realize low coupling. When the business isolation module is not needed, it only needs to be disabled through configuration. The business isolation module mainly ensures the stable operation of the entire CDN system by limiting the number of back-to-source requests for each business. The main operating logic is: limit the "parallel request number" of a single business domain name, and each business can only have a specified number of back-to-source requests Requests are processed in parallel, and an error will be returned if the request is exceeded, stopping the return to the source. Take user access to resources as an example to describe the operation process of the module in detail, as follows:
某用户打开网站访问一个图片资源,请求直接到了CDN上,CDN收到请求,就会去边缘节点设备上查找此资源,看是否有缓存。如果有缓存就直接将此资源返回给用户,假如边缘节点设备查看本地并没有缓存,那么通过CDN回源装置就回源到CDN上一级节点设备去拿资源,在回源的时候,首先会检查出CDN上一级节点设备内,该域名(来自host头)与回源IP组合的当前并行请求数A是否大于A1,如果是则直接拒绝回源;如果不是,会检查出该域名(来自host头)当前的并行请求数B是否大于B1,如果是,则直接拒绝回源;如果不是,那么通过CDN边缘节点设备检查,将CDN上一级节点设备作为回源节点设备。同样的道理,作为回源节点设备的CDN上一级设备也是先查本地是否有缓存,如果本地有缓存,将资源返回给CDN边缘节点设备,CDN边缘节点设备将资源返回给用户后同时在本地落一份缓存;如果CDN上一级设备本地也没有缓存,那么此时需要回源到源站去拿资源。A user opens a website to access an image resource, and the request goes directly to the CDN. When the CDN receives the request, it will search for the resource on the edge node device to see if there is a cache. If there is a cache, the resource will be directly returned to the user. If the edge node device checks that there is no cache locally, then through the CDN back-to-source device, it will go back to the CDN upper-level node device to get the resource. When returning to the source, it will first Check whether the current parallel request number A of the combination of the domain name (from the host header) and the back-to-source IP in the CDN upper-level node device is greater than A1, and if so, directly reject the back-to-source; if not, it will check out the domain name (from host header) Whether the current number of parallel requests B is greater than B1, if yes, directly refuse to return to the source; if not, check the CDN edge node device, and use the upper-level node device of the CDN as the source node device. In the same way, as the back-to-source node device, the CDN upper-level device first checks whether there is a local cache. If there is a local cache, the resource is returned to the CDN edge node device, and the CDN edge node device returns the resource to the user. Save a copy of the cache; if the CDN upper-level device does not have a local cache, then you need to go back to the source site to get the resources at this time.
也就是缓存命中率低的时候,在CDN边缘节点设备与源站设备间设置CDN二级节点设备、CDN三级节点设备、CDN四级节点设备,目的在于尽量在节点设备的缓存内命中,而少回源站设备。本地缓存与源站之间设有多级节点设备时,如果本级节点设备的本地内存没有缓存资源,依次向下一级节点设备去找,直至最后到源站。其中,每一节点设备的A1可以相同、也可以不同;每一节点设备的B1可以相同、也可以不同。所设置的A1和B1均在CDN的缓存配置中进行设置的。That is, when the cache hit rate is low, set up CDN level-2 node devices, CDN level-3 node devices, and CDN level-4 node devices between the CDN edge node device and the source station device, in order to hit as much as possible in the cache of the node device, while Do not go back to the source station equipment. When there is a multi-level node device between the local cache and the source station, if there is no cache resource in the local memory of the node device at the current level, it will search for the next-level node device in turn until the source station is finally reached. Wherein, A1 of each node device may be the same or different; B1 of each node device may be the same or different. The set A1 and B1 are set in the cache configuration of the CDN.
本发明实施例所取得的有益技术效果如下:The beneficial technical effect that the embodiment of the present invention obtains is as follows:
(1)CDN回源装置直接附加在CDN缓存软件上,配置(即开关)可直接开启或者关闭,无需对线上原有环境进行二次开发,在需要此CDN回源装置时,只需要通过配置开启此模块即可,实现了低耦合。在不需要此CDN回源装置时,只需要通过配置关闭即可。易扩展,易维护,且本身的程序逻辑及配置也较为简单,虽然看起来较为简单的功能,但是在回源的时候起到了重要作用。完全自动化处理,故障后无需人工干预来恢复故障,不仅减少了运维成本,同时大大降低了故障概率。避免技术问题“假如源站不可用,但是正在慢慢的恢复当中,此时由于CDN二级一直重试的逻辑,将会有一波连接打到源站上,正在恢复的源站由于较大的连接压力冲击,很有可能再次故障,最终导致源站一次又一次的故障”以及“由于CDN二级的连接数堆积,CPU负载飙升,重试源站压力过大最终导致CDN系统及源站系统均处于瘫痪的状态,此时如果想恢复正常,需要人为介入,将CDN二级服务器全部重启缓存软件,这时连接数就会释放,同时源站也需要恢复到可正常服务的状态,这样整个的CDN访问才能恢复正常。此系列操作需要人为操作,需要操作线上多台服务器,将大大增加了故障时长,同时增加了运维成本”。(1) The CDN back-to-source device is directly attached to the CDN cache software, and the configuration (that is, the switch) can be directly turned on or off without secondary development of the original online environment. When the CDN back-to-source device is needed, it only needs to be configured Just turn on this module to achieve low coupling. When this CDN back-to-origin device is not needed, it only needs to be turned off through configuration. It is easy to expand and maintain, and its own program logic and configuration are relatively simple. Although it seems to be a relatively simple function, it plays an important role in returning to the source. Completely automated processing, no manual intervention is required to restore the fault after the fault, which not only reduces the operation and maintenance cost, but also greatly reduces the probability of failure. Avoid technical problems "If the origin site is unavailable, but it is slowly recovering, at this time, due to the logic of CDN secondary retrying, there will be a wave of connections to the origin site. The connection pressure is impacted, and it is very likely to fail again, which will eventually lead to the failure of the origin station again and again" and "due to the accumulation of CDN secondary connections, the CPU load soars, and the excessive pressure of retrying the origin station will eventually cause the CDN system and the origin station system to fail. They are all in a paralyzed state. At this time, if you want to return to normal, you need human intervention to restart all the CDN secondary servers and cache software. At this time, the number of connections will be released. The CDN access can be restored to normal. This series of operations requires manual operation and multiple online servers, which will greatly increase the length of the failure and increase the operation and maintenance cost.”
(2)CDN回源装置通过限制回源的“并行请求数”来达到回源限流的功能,使得各个业务域名之间相互独立回源,互不影响,不会影响其它无关业务,起到了重要的业务隔离性,从而保护了CDN本身及源站存储,大大减少了故障风险。避免了技术问题“CDN二级节点设备也服务于其它业务,由于某一个业务源站故障而导致整个CDN二级不可用,势必会影响到其它无关业务,扩大了故障范围”。(2) The CDN back-to-origin device achieves the function of back-to-source and current-limiting by limiting the "parallel request number" of back-to-source, so that each business domain name is back to the source independently of each other, without affecting each other, and will not affect other irrelevant services, which plays a role Important business isolation, thus protecting the CDN itself and the source site storage, greatly reducing the risk of failure. Avoid technical problems "CDN secondary node equipment also serves other services, and the entire secondary CDN is unavailable due to a failure of a certain service source site, which will inevitably affect other irrelevant services and expand the scope of failure."
(3)假如只单纯限制了域名+回源IP的组合回源并行请求数,那么会导致如下问题:“例如回源源站1异常导致连接数堆满,然后重试源站2,本来源站2是好的,但是因为连接数被占满了,导致拒绝回源”。(3) If you simply limit the number of concurrent back-to-origin requests for the combination of domain name + back-to-origin IP, it will lead to the following problem: "For example, the number of connections is full due to the exception of the back-to-origin source site 1, and then retry the source site 2, this source site 2 is good, but because the number of connections is full, it refuses to return to the source."
本发明采用双重限制:严格限制了域名+回源IP的组合回源并行请求数,又宽松限制了整体的回源并行请求数,从而降低回源压力、缩减源站恢复时间;回源连接数被限制后,相应的也会减少源站的压力,给了源站足够的恢复时间,不至于在恢复的过程中被重新打垮。The present invention adopts double restrictions: it strictly limits the number of concurrent back-to-source requests combined by domain name + back-to-source IP, and loosely limits the overall number of back-to-source parallel requests, thereby reducing the back-to-source pressure and shortening the recovery time of the source station; the number of back-to-source connections After being restricted, the pressure on the source site will be correspondingly reduced, giving the source site enough recovery time so that it will not be knocked down again during the recovery process.
(4)单机部署,只需要部署到每台服务器(即节点设备)上,每台服务器上的程序相互独立工作,互不影响。(4) Stand-alone deployment only needs to be deployed on each server (ie, node device), and the programs on each server work independently of each other without affecting each other.
应该明白,公开的过程中的步骤的特定顺序或层次是示例性方法的实例。基于设计偏好,应该理解,过程中的步骤的特定顺序或层次可以在不脱离本公开的保护范围的情况下得到重新安排。所附的方法权利要求以示例性的顺序给出了各种步骤的要素,并且不是要限于所述的特定顺序或层次。It is understood that the specific order or hierarchy of steps in the processes disclosed is an example of exemplary approaches. Based upon design preferences, it is understood that the specific order or hierarchy of steps in the processes may be rearranged without departing from the scope of the present disclosure. The accompanying method claims present elements of the various steps in a sample order, and are not meant to be limited to the specific order or hierarchy described.
在上述的详细描述中,各种特征一起组合在单个的实施方案中,以简化本公开。不应该将这种公开方法解释为反映了这样的意图,即,所要求保护的主题的实施方案需要比清楚地在每个权利要求中所陈述的特征更多的特征。相反,如所附的权利要求书所反映的那样,本发明处于比所公开的单个实施方案的全部特征少的状态。因此,所附的权利要求书特此清楚地被并入详细描述中,其中每项权利要求独自作为本发明单独的优选实施方案。In the foregoing Detailed Description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure is not to be interpreted as reflecting an intention that the claimed embodiments of the subject matter require more features than are expressly recited in each claim. Rather, as the following claims reflect, the invention lies in less than all features of a single disclosed embodiment. Thus the following claims are hereby expressly incorporated into the Detailed Description, with each claim standing on its own as a separate preferred embodiment of this invention.
为使本领域内的任何技术人员能够实现或者使用本发明,上面对所公开实施例进行了描述。对于本领域技术人员来说;这些实施例的各种修改方式都是显而易见的,并且本文定义的一般原理也可以在不脱离本公开的精神和保护范围的基础上适用于其它实施例。因此,本公开并不限于本文给出的实施例,而是与本申请公开的原理和新颖性特征的最广范围相一致。The foregoing description of the disclosed embodiments was provided to enable any person skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments without departing from the spirit and scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments presented herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
上文的描述包括一个或多个实施例的举例。当然,为了描述上述实施例而描述部件或方法的所有可能的结合是不可能的,但是本领域普通技术人员应该认识到,各个实施例可以做进一步的组合和排列。因此,本文中描述的实施例旨在涵盖落入所附权利要求书的保护范围内的所有这样的改变、修改和变型。此外,就说明书或权利要求书中使用的术语“包含”,该词的涵盖方式类似于术语“包括”,就如同“包括,”在权利要求中用作衔接词所解释的那样。此外,使用在权利要求书的说明书中的任何一个术语“或者”是要表示“非排它性的或者”。The foregoing description includes illustrations of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods to describe the above-mentioned embodiments, but those skilled in the art should recognize that various embodiments can be further combined and permuted. Accordingly, the embodiments described herein are intended to embrace all such alterations, modifications and variations that fall within the scope of the appended claims. Furthermore, to the extent that the term "comprises" is used in the specification or claims, the word is encompassed in a manner similar to the term "comprises" as interpreted when "comprises" is used as a link in the claims. Furthermore, any use of the term "or" in the specification of the claims is intended to mean a "non-exclusive or".
本领域技术人员还可以了解到本发明实施例列出的各种说明性逻辑块(illustrative logical block),单元,和步骤可以通过电子硬件、电脑软件,或两者的结合进行实现。为清楚展示硬件和软件的可替换性(interchangeability),上述的各种说明性部件(illustrative components),单元和步骤已经通用地描述了它们的功能。这样的功能是通过硬件还是软件来实现取决于特定的应用和整个系统的设计要求。本领域技术人员可以对于每种特定的应用,可以使用各种方法实现所述的功能,但这种实现不应被理解为超出本发明实施例保护的范围。Those skilled in the art can also understand that various illustrative logical blocks, units, and steps listed in the embodiments of the present invention can be implemented by electronic hardware, computer software, or a combination of both. To clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units and steps above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and overall system design requirements. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the protection scope of the embodiments of the present invention.
本发明实施例中所描述的各种说明性的逻辑块,或单元都可以通过通用处理器,数字信号处理器,专用集成电路(ASIC),现场可编程门阵列或其它可编程逻辑装置,离散门或晶体管逻辑,离散硬件部件,或上述任何组合的设计来实现或操作所描述的功能。通用处理器可以为微处理器,可选地,该通用处理器也可以为任何传统的处理器、控制器、微控制器或状态机。处理器也可以通过计算装置的组合来实现,例如数字信号处理器和微处理器,多个微处理器,一个或多个微处理器联合一个数字信号处理器核,或任何其它类似的配置来实现。Various illustrative logic blocks or units described in the embodiments of the present invention can be discretely processed by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices. Gate or transistor logic, discrete hardware components, or any combination of the above designed to implement or operate the described functions. The general-purpose processor may be a microprocessor, and optionally, the general-purpose processor may also be any conventional processor, controller, microcontroller or state machine. A processor may also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, multiple microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration to accomplish.
本发明实施例中所描述的方法或算法的步骤可以直接嵌入硬件、处理器执行的软件模块、或者这两者的结合。软件模块可以存储于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、可移动磁盘、CD-ROM或本领域中其它任意形式的存储媒介中。示例性地,存储媒介可以与处理器连接,以使得处理器可以从存储媒介中读取信息,并可以向存储媒介存写信息。可选地,存储媒介还可以集成到处理器中。处理器和存储媒介可以设置于ASIC中,ASIC可以设置于用户终端中。可选地,处理器和存储媒介也可以设置于用户终端中的不同的部件中。The steps of the method or algorithm described in the embodiments of the present invention may be directly embedded in hardware, a software module executed by a processor, or a combination of both. The software modules may be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, removable disk, CD-ROM or any other storage medium in the art. Exemplarily, the storage medium can be connected to the processor, so that the processor can read information from the storage medium, and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be set in the ASIC, and the ASIC can be set in the user terminal. Optionally, the processor and the storage medium may also be set in different components in the user terminal.
在一个或多个示例性的设计中,本发明实施例所描述的上述功能可以在硬件、软件、固件或这三者的任意组合来实现。如果在软件中实现,这些功能可以存储与电脑可读的媒介上,或以一个或多个指令或代码形式传输于电脑可读的媒介上。电脑可读媒介包括电脑存储媒介和便于使得让电脑程序从一个地方转移到其它地方的通信媒介。存储媒介可以是任何通用或特殊电脑可以接入访问的可用媒体。例如,这样的电脑可读媒体可以包括但不限于RAM、ROM、EEPROM、CD-ROM或其它光盘存储、磁盘存储或其它磁性存储装置,或其它任何可以用于承载或存储以指令或数据结构和其它可被通用或特殊电脑、或通用或特殊处理器读取形式的程序代码的媒介。此外,任何连接都可以被适当地定义为电脑可读媒介,例如,如果软件是从一个网站站点、服务器或其它远程资源通过一个同轴电缆、光纤电缆、双绞线、数字用户线(DSL)或以例如红外、无线和微波等无线方式传输的也被包含在所定义的电脑可读媒介中。所述的碟片(disk)和磁盘(disc)包括压缩磁盘、镭射盘、光盘、DVD、软盘和蓝光光盘,磁盘通常以磁性复制数据,而碟片通常以激光进行光学复制数据。上述的组合也可以包含在电脑可读媒介中。In one or more exemplary designs, the above functions described in the embodiments of the present invention may be implemented in hardware, software, firmware or any combination of the three. If implemented in software, the functions can be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes computer storage media and communication media that facilitate transfer of a computer program from one place to another. Storage media may be any available media that can be accessed by a general purpose or special computer. For example, such computer-readable media may include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other device that can be used to carry or store instructions or data structures and Other medium of program code in a form readable by a general-purpose or special-purpose computer, or a general-purpose or special-purpose processor. In addition, any connection is properly defined as a computer-readable medium, for example, if the software is transmitted from a website site, server, or other remote source via a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) Or transmitted by wireless means such as infrared, wireless and microwave are also included in the definition of computer readable media. Disks and discs include compact discs, laser discs, optical discs, DVDs, floppy discs, and Blu-ray discs. Disks usually reproduce data magnetically, while discs usually reproduce data optically with lasers. Combinations of the above can also be contained on a computer readable medium.
以上所述的具体实施方式,对本发明的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本发明的具体实施方式而已,并不用于限定本发明的保护范围,凡在本发明的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The specific embodiments described above have further described the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above descriptions are only specific embodiments of the present invention and are not intended to limit the scope of the present invention. Protection scope, within the spirit and principles of the present invention, any modification, equivalent replacement, improvement, etc., shall be included in the protection scope of the present invention.
Claims (11)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211679010.3A CN116233252A (en) | 2022-12-26 | 2022-12-26 | A CDN back-to-source method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211679010.3A CN116233252A (en) | 2022-12-26 | 2022-12-26 | A CDN back-to-source method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN116233252A true CN116233252A (en) | 2023-06-06 |
Family
ID=86586343
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211679010.3A Pending CN116233252A (en) | 2022-12-26 | 2022-12-26 | A CDN back-to-source method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116233252A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119620943A (en) * | 2024-11-27 | 2025-03-14 | 联通在线信息科技有限公司 | A method and device for reducing extra return to source of disk cache content |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050188108A1 (en) * | 2002-10-31 | 2005-08-25 | Volera, Inc. | Enriched tree for a content distribution network |
| CN103560937A (en) * | 2013-11-01 | 2014-02-05 | 北京蓝汛通信技术有限责任公司 | Data accessing method and entry server |
| CN108366020A (en) * | 2018-02-02 | 2018-08-03 | 网宿科技股份有限公司 | A kind of method and system of the acquisition request of transmission data resource |
| CN111181849A (en) * | 2018-11-09 | 2020-05-19 | 北京嘀嘀无限科技发展有限公司 | Return source path determining method, determining device, computer equipment and storage medium |
| CN114006943A (en) * | 2022-01-04 | 2022-02-01 | 北京金山云网络技术有限公司 | Data source returning method, device, equipment and storage medium |
| CN114501073A (en) * | 2022-02-16 | 2022-05-13 | 上海哔哩哔哩科技有限公司 | Live broadcast source returning method and device |
-
2022
- 2022-12-26 CN CN202211679010.3A patent/CN116233252A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20050188108A1 (en) * | 2002-10-31 | 2005-08-25 | Volera, Inc. | Enriched tree for a content distribution network |
| CN103560937A (en) * | 2013-11-01 | 2014-02-05 | 北京蓝汛通信技术有限责任公司 | Data accessing method and entry server |
| CN108366020A (en) * | 2018-02-02 | 2018-08-03 | 网宿科技股份有限公司 | A kind of method and system of the acquisition request of transmission data resource |
| CN111181849A (en) * | 2018-11-09 | 2020-05-19 | 北京嘀嘀无限科技发展有限公司 | Return source path determining method, determining device, computer equipment and storage medium |
| CN114006943A (en) * | 2022-01-04 | 2022-02-01 | 北京金山云网络技术有限公司 | Data source returning method, device, equipment and storage medium |
| CN114501073A (en) * | 2022-02-16 | 2022-05-13 | 上海哔哩哔哩科技有限公司 | Live broadcast source returning method and device |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119620943A (en) * | 2024-11-27 | 2025-03-14 | 联通在线信息科技有限公司 | A method and device for reducing extra return to source of disk cache content |
| CN119620943B (en) * | 2024-11-27 | 2025-10-03 | 联通在线信息科技有限公司 | A method and device for reducing extra back-to-source of disk cache content |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103514173B (en) | The method and node device of data processing | |
| EP2532137B1 (en) | Method and node entity for enhancing content delivery network | |
| CN110795395B (en) | File deployment system and file deployment method | |
| US20170242761A1 (en) | Fault tolerant listener registration in the presence of node crashes in a data grid | |
| CN110045912A (en) | Data processing method and device | |
| US7293194B2 (en) | Method and device for switching database access part from for-standby to currently in use | |
| JP2004334574A (en) | Storage operation management program, operation management method, and management computer | |
| CN100547556C (en) | A storage server system and its data protection method | |
| CN118312103A (en) | Distributed cluster data reconstruction method, device and program product | |
| CN116233252A (en) | A CDN back-to-source method and device | |
| CN109039723A (en) | Network maintenance method and system based on data-base cluster | |
| CN114518848A (en) | Hierarchical storage system, and method, apparatus, device, and medium for processing storage data | |
| CN101714064B (en) | Data access method and server | |
| CN112929402A (en) | Mobile ad hoc network device for realizing trusted data storage | |
| WO2023123872A1 (en) | Data reading method and apparatus and related device | |
| US12418452B2 (en) | Method and apparatus for processing service alarm based on CDN, device, and medium | |
| JP2004348174A (en) | Storage system | |
| CN110333968A (en) | Data management method, device and computer equipment applied to database | |
| CN111309515A (en) | Disaster recovery control method, device and system | |
| CN101202671A (en) | Port configuration method and device | |
| CN111324632A (en) | Transparent database session recovery with client-side caching | |
| CN104735097A (en) | Information collecting method and system | |
| CN111884919A (en) | Method, device, equipment and readable medium for clearing invalid virtual IP | |
| CN115373604B (en) | A method, device and storage medium for cleaning up residual NAS storage resources | |
| CN120909971B (en) | Interface card management methods, computer equipment, storage media and software products |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |
