Content distribution network, back-to-source scheduling method, scheduling server and storage medium
By introducing a back-source scheduling method into the scheduling server of the CDN system, the problem of low cache hit rate when the relay node is unavailable is solved, and the effect of improving the overall cache hit rate and response speed of the CDN system is achieved.
Patent Information
- Application Number
- CN202311487742.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-08
- Publication Date
- 2025-05-09
AI Technical Summary
The existing CDN system causes a lower cache hit rate when the relay node is offline or unavailable in the relay node hash ring.
By introducing a back-source scheduling method into the scheduling server, there is a one-to-one correspondence between the edge node group and the corresponding back-source node group. When the relay node in the back-source node group corresponding to the edge node is unavailable, the scheduling server maps the target resource to the relay node in another back-source node group as the back-source target node.
It improves the overall cache hit rate and user request response speed of the CDN system, and reduces the impact of the unavailability of the relay node on the cache hit rate.
Smart Images

Figure CN119966990A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to a content distribution network, a back-to-source scheduling method, a scheduling server and a storage medium. Background Art
[0002] The Content Delivery Network (CDN) system relies on CDN nodes deployed in various places. Through load balancing, content distribution, scheduling and other functional modules, users can obtain the required content nearby, reduce network congestion and improve user access response speed. CDN nodes can be divided into two categories, one is edge nodes, and the other is relay nodes other than edge nodes (also called CDN parent nodes). The terminal user accesses an edge node and triggers a resource request to the edge node. If the edge node does not cache the corresponding resource locally, the edge node obtains the back-to-source information from the scheduling server to determine the upper-level relay node (i.e., the back-to-source target node) to which it needs to return, and pulls the above resources from the back-to-source target node. If the back-to-source target node still does not cache the resource, it continues to return to the source until it returns to the source station corresponding to the resource that needs to be requested (the source that provides the resource).
[0003] In the scenario where the edge node returns to the intermediate node, the existing CDN system usually adopts a consistent hashing return-to-source solution, which corresponds and fixes the hash ring of the edge node with the hash ring of the relay node. For a specific resource, based on the uniform resource identifier (URI) of the resource, all edge nodes in an edge node hash ring map resources with the same URI to the same relay node in the fixedly associated relay node hash ring, and map resources with different URIs to different relay nodes in the fixedly associated relay node hash ring according to the same consistent hashing rule. The consistent hashing rule ensures that resources with the same URI are fixed to the same relay node, so as to improve the cache hit rate of the relay node.
[0004] However, the consistent hashing back-to-origin solution of the existing CDN system has the following technical defects: when a relay node in the relay node hash ring is offline or unavailable, the URI originally mapped to the relay node will be mapped to other relay nodes in the same hash ring, but other relay nodes do not have cache information of the URI resource, which affects the cache hit rate of the CDN system. In particular, in the scenario where the stability of the relay nodes in the CDN system is not high, the overall cache hit rate of the CDN system is low. Summary of the invention
[0005] The present application provides a content distribution network, a back-to-source scheduling method, a scheduling server and a storage medium to solve the technical problem of low overall cache hit rate of a CDN system.
[0006] In a first aspect, the present application provides a content distribution network, including: a scheduling server, a plurality of edge node groups, and a back-to-source node group corresponding to each edge node group, wherein the edge node group includes a plurality of edge nodes, and the back-to-source node group includes a plurality of relay nodes between the corresponding edge node group and a source station;
[0007] The edge node is used to respond to the acquisition request for the target resource, and when it is determined that the target resource is not cached locally, send a request for back-to-source information of the target resource to the scheduling server;
[0008] The scheduling server is used to: in response to the edge node's request for the target resource's back-to-source information, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, use the relay node to which the target resource is mapped in another back-to-source node group as the back-to-source target node;
[0009] The edge node is further used to return the target resource to the return-to-source target node.
[0010] In a second aspect, the present application provides a back-to-source scheduling method, which is applied to a scheduling server in a content distribution network, wherein the content distribution network further includes a plurality of edge node groups and a back-to-source node group corresponding to each edge node group, wherein the edge node group includes a plurality of edge nodes, and the back-to-source node group includes a plurality of relay nodes between the corresponding edge node group and a source station, wherein the method includes:
[0011] receiving a back-to-source information request for the target resource from an edge node, wherein the back-to-source information request includes a resource identifier of the target resource;
[0012] According to the back-to-source strategy used by the edge node, when the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the relay node to which the target resource is mapped in another back-to-source node group is used as the back-to-source target node;
[0013] Return the access address of the back-to-source target node to the edge node.
[0014] In a third aspect, the present application provides a scheduling server, including:
[0015] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the scheduling server executes the method described in the second aspect.
[0016] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in the second aspect is implemented.
[0017] The present application provides a content distribution network, a back-to-source scheduling method, a scheduling server, and a storage medium. The content distribution network includes a scheduling server, a plurality of edge node groups, and a back-to-source node group corresponding to each edge node group. When the edge node back-sources a target resource, when the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the scheduling server does not select other relay nodes that do not cache the target resource in the same back-to-source node group, but selects the relay node to which the target resource is mapped in another back-to-source node group as the back-to-source target node. In actual applications, after a period of normal use, the relay nodes to which the target resource is mapped in each back-to-source node group all cache the target resource. Therefore, when the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the edge node back-sources to the relay node in another back-to-source node group that caches the target resource, and can hit the cache in the other back-to-source node group, thereby improving the cache hit rate of the relay node, thereby improving the overall cache hit rate of the content distribution network and the response speed to user requests. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0019] Figure 1 This is a schematic diagram showing the principle of the consistent hashing back-to-origin solution for the CDN system provided in this application;
[0020] Figure 2 An example diagram of the architecture of a CDN system provided for an exemplary embodiment of the present application;
[0021] Figure 3 An example diagram of an edge node back-to-source link in a CDN system provided by an exemplary embodiment of the present application;
[0022] Figure 4 An example diagram of an edge node back-to-source link when a single relay node in a single back-to-source node group in a CDN system is unavailable, provided by an exemplary embodiment of the present application;
[0023] Figure 5 An interactive flow chart of a back-to-source scheduling method provided by an exemplary embodiment of the present application;
[0024] Figure 6 A flowchart of a back-to-source scheduling method provided for an exemplary embodiment of the present application;
[0025] Figure 7 A schematic diagram of the structure of a scheduling server provided in an embodiment of the present application.
[0026] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0027] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0028] It should be noted that the user information (including but not limited to user device information, user attribute information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0029] First, the terms involved in this application are explained:
[0030] Content Delivery Network (CDN): CDN system is an intelligent virtual network built on the existing network. It relies on edge nodes deployed in various places and uses the load balancing, content distribution, scheduling and other functional modules of the central platform to enable users to obtain the required content nearby, reduce network congestion, and improve user access response speed and hit rate. The key technologies of CDN are content storage and distribution technology.
[0031] Origin site: also known as CDN origin site, which is the "source site", that is, the source server of the resources on the CDN. Each CDN acceleration domain name must have one or more origin sites so that when the CDN acceleration cache expires, it can go back to the source site to obtain content.
[0032] Edge node: also known as CDN edge node. In this embodiment, it specifically refers to the edge node in CDN, which is composed of a series of edge servers deployed in various places. It mainly provides functions such as local access and is usually deployed in the edge network closer to the user.
[0033] Relay node: also called CDN parent node, in this embodiment, refers to the back-to-source convergence node in CDN, which is usually located in the middle of the link between CDN edge node and source station. When CDN node content needs to be back-to-source, it usually accesses the parent node first to achieve the effect of request convergence / intermediate network acceleration. There can usually be multiple levels of CDN parent nodes.
[0034] Back to source: In this embodiment, it specifically refers to the behavior of re-requesting the parent node or source station to update the content cache when the resource does not exist on the CDN edge node (such as not cached, or the cached content has expired). Back to source can be the edge node back to the relay node, or the relay node back to the source station.
[0035] Uniform Resource Identifier (URI): is a string used to identify the name of an Internet resource. In the CDN field, a URI is usually identified as a specific resource content that needs to be accelerated.
[0036] Consistent hashing: is a special hashing algorithm that aims to solve the problem of distributed caching. When removing or adding a server, the mapping relationship between existing service requests and the servers that process the requests can be changed as little as possible. Consistent hashing solves the problems of dynamic scaling in the Distributed Hash Table (DHT) that exist in simple hashing algorithms.
[0037] Hash ring: The basic principle of the hash ring is to map all nodes and resources to a ring. Each node and data has a corresponding hash value on the ring. When a URI resource needs to be accessed, the hash value of the URI is mapped to the hash ring to determine the node to obtain the resource, which is also called mapping the URI to the node.
[0038] Cache hit rate: In this embodiment, it refers to the cache hit rate of the CDN system, mainly the byte cache hit rate, that is, the number of bytes of the response (Response) hit by the CDN cache divided by the total number of bytes of the response (Response) of all CDN requests. In the back-to-source scenario, the more requests from edge nodes to relay nodes are cached by the relay nodes, the higher the cache hit rate of the relay nodes.
[0039] Figure 1The principle example diagram of the consistent hashing back-to-source scheme of the CDN system provided in this application. In the scenario where the edge node returns to the intermediate node in the traditional CDN system, hash ring a is a hash ring of a group of edge nodes including edge nodes a1, a2...am, and hash ring A is a hash ring of a group of relay nodes including relay nodes A1, A2,..., AN, and the relay node hash ring A is fixedly associated with the edge node hash ring a. According to the existing consistent hashing back-to-source scheme, the edge nodes in hash ring a return different URI resources to the relay nodes A1, A2...AN to which each URI resource is mapped based on the consistent hashing rule. For a specific URI resource, based on the URI, all edge nodes in hash ring a use the same consistent hashing rule to return resources of the same URI to the same relay node in hash ring A, and return resources of different URIs to different relay nodes in hash ring A. The consistent hashing rule ensures that the same URI resource is fixed to the same relay node to improve the cache hit rate of the relay node. For example, assuming that based on the consistent hashing rule, URI1 is mapped to relay node A1 in hash ring A, and URI2 is mapped to relay node A2 in hash ring A, then all edge nodes (a1, a2...am) in hash ring a will source the URI1 resource back to relay node A1 when it is necessary to source the URI1 resource, and will source the URI2 resource back to relay node A2 when it is necessary to source the URI2 resource.
[0040] When relay node A1 is offline or abnormal, that is, when relay node A1 is unavailable, another relay node is found in the same hash ring A to replace relay node A1, and the URI1 resource originally returned to relay node A1 is returned to other relay nodes in the same hash ring A. Figure 1 In the figure, "×" indicates that the relay node A1 is unavailable, and the dotted lines between the edge nodes a1, a2...am and the relay node A1 indicate that under normal circumstances, the edge nodes a1, a2...am originally return the URI1 resource to the relay node A1. However, when the relay node A1 is unavailable, the URI1 is remapped to other relay nodes in the same hash ring A, and the URI1 resource is returned to the other relay nodes in the same hash ring A. However, except for the relay node A1, the URI1 resource is not cached on other relay nodes in the hash ring A, and the cache is not hit, which affects the cache hit rate of the relay node, thereby affecting the overall cache hit rate of the CDN system and the response speed to user access.
[0041] The present application provides a back-to-source scheduling scheme for a CDN system, wherein the CDN system includes a scheduling server, a plurality of edge node groups, and a back-to-source node group corresponding to each edge node group, wherein the edge node group includes a plurality of edge nodes, and the back-to-source node group includes a plurality of relay nodes between the corresponding edge node group and the CDN source station. There is a one-to-one correspondence between the edge node group and the back-to-source node group in the CDN system. Configure the back-to-source policy used by each edge node group, and configure the back-to-source node groups associated with different URIs in the back-to-source policy. By default, each URI in the back-to-source policy used by the edge node group is associated with the back-to-source node group corresponding to the edge node group. Under normal circumstances, when each edge node in the same edge node group performs back-to-source of a URI resource, based on the consistent hashing rule, the URI resource is back-to-sourced to the relay node to which the URI is mapped in the back-to-source node group corresponding to the edge node group. That is, under normal circumstances, the back-to-source policies of different edge node groups are relatively independent and do not interfere with each other, so each relay node group caches each URI resource.
[0042] When the relay node mapped to a certain URI in any back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the back-to-source node group is updated, and the URI is modified to be associated with another relay node group. When the edge node in the edge node group back-sources the URI resource, it will search for the relay node mapped to the URI in the relay node group currently associated with the URI based on the modified back-to-source policy and the consistent hashing rule, and back-source the URI resource to the relay node mapped to the URI in the relay node group currently associated with the URI. The relay node is likely to cache the URI resource during normal use.
[0043] The back-to-source scheduling solution of the present application can greatly reduce the impact of relay node unavailability on the cache hit rate, and can improve the overall cache hit rate of the CDN system and the response speed to user access.
[0044] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0045] Figure 2 An example diagram of the architecture of a CDN system provided by an exemplary embodiment of the present application is shown in FIG. Figure 2As shown, the CDN system provided in this embodiment includes: a scheduling server, multiple edge node groups b and c, and back-to-source node groups B and C corresponding to each edge node group. Among them, an edge node group includes multiple edge nodes, and a back-to-source node group includes multiple relay nodes between the corresponding edge node group and the source station. There is a one-to-one correspondence between the multiple edge node groups and the multiple back-to-source node groups in the CDN system. Figure 2 As shown in FIG, the edge node group b includes m1 edge nodes b1, b2, ..., b m1 , the edge node group c includes m2 edge nodes c1, c2…c m2 , the source node group B includes N relay nodes B1, B2…B N , the source node group C includes N relay nodes C1, C2…C N , edge node group b corresponds to back-to-source node group B, and edge node group c corresponds to back-to-source node group C.
[0046] In some embodiments, N is the number of types of URI resources transmitted through the CDN system, and different URIs identify different types of resources. Each source node group contains relay nodes to which all N types of URI resources are mapped, that is, each source node group has the ability to independently cache all N types of URI resources. Based on the consistent hashing rule, different URIs in each source node group are mapped to different relay nodes, and the same URI is mapped to the same relay node. Among them, the relay node to which the URI is mapped is used to cache the URI resource. The source node group corresponds to multiple different edge nodes in the edge node group, and different URI resources are sourced back to different relay nodes, and the same URI resource is sourced back to the same relay node. In this case, the number of relay nodes in different source node groups is the same as the number of types of URI resources. Figure 2 As shown in , both the back-to-source node group B and the back-to-source node group C contain N relay nodes. In the back-to-source node group B, there are N types of URIs (URI1, URI2…URI N ) are mapped to N relay nodes B1, B2…B N , in the back-to-source node group C, there are N URIs (URI1, URI2…URI N ) are mapped to N relay nodes C1, C2…C N .
[0047] In some other embodiments, the number of relay nodes in different back-to-source node groups may be different, such as back-to-source node group B includes N1 relay nodes, and back-to-source node group C includes N2 relay nodes, where N1≠N2. N ) is mapped to N1 relay nodes B1, B2…B N1, in the back-to-source node group C, there are N URIs (URI1, URI2…URI N ) are mapped to N2 relay nodes C1, C2…C N2 In this case, within a back-to-source node group, the same relay node can cover one or more URI resources, that is, different URI resources can be mapped to the same relay node, but the same URI resource is mapped to the same relay node.
[0048] It should be noted that Figure 2 Only two edge node groups and two corresponding back-to-source node groups are shown. In actual applications, the CDN system can build more edge node groups and corresponding back-to-source node groups. In this embodiment, the number of edge node groups and the number of back-to-source node groups in the CDN system are not specifically limited. In addition, the number of edge nodes included in the edge node groups in the CDN system may be the same or different, and can be deployed according to the needs of the actual application scenario.
[0049] The edge nodes and relay nodes in the CDN system are essentially data transmission and caching nodes. The CDN system also includes servers (i.e., source stations) that provide content services. For example, the content server can be a video server, a resource download server, etc. The edge nodes in the CDN system can constitute an access network, and the relay nodes constitute a core network. In practical applications, each edge node is known, that is, it is known that the on-demand CDN node is configured to be used as an edge node, and all CDN nodes except the edge nodes are used as relay nodes. Of course, in some embodiments, some edge nodes can also be used as relay nodes at the same time.
[0050] In actual applications, different edge node groups and back-to-source node groups can be deployed in different geographical areas to achieve CDN system coverage in a wider range. For end users in a certain geographical area, they can access an edge node nearby to obtain data resources provided by the source station through the CDN system. In actual applications, the edge node group and the corresponding back-to-source node group are usually located in the same or close geographical area.
[0051] In the CDN system, the edge node is used to receive the acquisition request for the target resource sent by the user terminal and determine whether the target resource is cached locally. If it is determined that the target resource is cached locally, the target resource is directly returned to the user terminal. If it is determined that the target resource is not cached locally, it is necessary to return to the source to the previous level relay node, and the edge node sends a request for the target resource to the scheduling server.
[0052] The back-to-source information request includes the URI of the target resource and the identification information of the edge node. The identification information of the edge node is used to determine the back-to-source strategy used by the edge node and the back-to-source node group corresponding to the edge node, and the URI of the target resource is used to determine the relay node to which the target resource is mapped.
[0053] In response to the received request for back-to-source information of the target resource from the edge node, the scheduling server uses the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped as the back-to-source target node if the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available. Further, the scheduling server returns the back-to-source information to the edge node, and the back-to-source information includes the access address of the back-to-source target node.
[0054] The back-to-source node group corresponding to the edge node is also the back-to-source node group corresponding to the edge node group where the edge node is located. Figure 2 The edge nodes b1, b2, ... b in the edge node group b shown in m1 , all correspond to the back-to-source node group B corresponding to the edge node group b, and the edge nodes c1, c2…c in the edge node group c. m2 , all correspond to the back-to-source node group C corresponding to the edge node group c.
[0055] Under normal circumstances, each edge node returns to the corresponding source node group of the edge node. When each edge node in the same edge node group returns the URI resource, based on the consistent hashing rule, the URI resource is returned to the relay node to which the URI is mapped in the source node group corresponding to the edge node group. That is, under normal circumstances, the return strategies of different edge node groups are relatively independent and do not interfere with each other. Therefore, the relay nodes in each source node group can cache URI resources. After the CDN system has been running for a period of time, the relay nodes in each source node group have cached URI resources.
[0056] For example, Figure 2 As shown by the solid arrows between the edge node group and the back-to-source node group, under normal circumstances, the relay nodes in each back-to-source node group are available, and each edge node in edge node group b will back-source the URI1 resource to the relay node B1 in the back-to-source node group B, and each edge node in edge node group b will back-source the URI2 resource to the relay node B2 in the back-to-source node group B, and so on. N The resource is returned to the relay node B in the source node group B. NSimilarly, each edge node in edge node group c will return URI1 resource to relay node C1 in source node group C, and each edge node in edge node group c will return URI2 resource to relay node C2 in source node group C, and so on. N The resource is returned to the relay node C in the source node group C. N Under normal circumstances, after a period of use, the relay nodes of each back-to-source node group cache the corresponding URI resources. For example, the relay nodes B1…C1 to which URI1 is mapped in each back-to-source node group cache the URI1 resource, and the relay nodes B2…C2 to which URI2 is mapped in each back-to-source node group cache the URI2 resource, and so on. N Mapped to relay node B N …C N URIs are cached N resource.
[0057] In the case that the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the relay node to which the target resource is mapped in another back-to-source node group is used as the back-to-source target node. That is, in the case that the relay node to which the target resource URI is mapped in the back-to-source node group corresponding to the edge node is abnormal, the back-to-source target node is not selected in the same back-to-source node group, but the relay node to which the target resource URI is mapped is selected in another back-to-source node group based on the consistent hashing rule as the back-to-source target node. Furthermore, the back-to-source information is returned to the edge node, and the back-to-source information may include the access address of the back-to-source target node.
[0058] For example, Figure 2 The dotted arrow between edge node group b and source node group C, which has no corresponding relationship, indicates that when a relay node mapped to a certain URI in source node group B is unavailable, each edge node in edge node group b will source the URI resource back to the relay node mapped to the URI in source node group C. Figure 2 Only the source node groups B and C are shown in the figure. In the figure, only in the abnormal case that the relay node of the source node group B is unavailable, the source node group C is used as its copy source node group. The URI that originally returned to the abnormal relay node in the source node group B is returned to the copy source node group. Of course, the copy source node group of the source node group B can also use other source node groups other than B and C in the CDN system as the source node group. This is only an exemplary explanation here, and there is no specific limitation on the selected copy source node group.
[0059] Similarly, when a relay node mapped to a certain URI in the back-to-source node group C is unavailable, each edge node in the edge node group c can back-source the URI resource to the relay node mapped to the URI in the back-to-source node group B (or other back-to-source node groups).
[0060] Further, the edge node returns the target resource to the target node according to the return-to-source information. The return-to-source information includes the access address of the return-to-source target node, and the edge node returns the target resource to the source according to the access address of the return-to-source target node. Specifically, the edge node sends a return-to-source request to the return-to-source target node according to the access address of the return-to-source target node. The return-to-source target node responds to the return-to-source request and returns the cached target resource to the edge node that sent the request. The edge node receives the target resource returned by the return-to-source target node and completes the return-to-source of the target resource.
[0061] In the solution of this embodiment, when the edge node performs back-to-source for the target resource, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, other relay nodes that do not cache the target resource are not selected in the same back-to-source node group, but the relay node to which the target resource is mapped is selected in another back-to-source node group as the back-to-source target node. In actual applications, after a period of normal use, the relay nodes to which the target resource is mapped in each back-to-source node group have all cached the target resource. Therefore, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the edge node is back-to-sourced to the relay node in another back-to-source node group that has cached the target resource, and the cache in the other back-to-source node group can be hit, thereby improving the cache hit rate of the relay node, thereby improving the overall cache hit rate of the CDN system and the response speed to user requests.
[0062] In an optional embodiment, taking the case where a CDN system includes two edge node groups b and c, and two corresponding back-to-source node groups B and C, and the two back-to-source node groups B and C serve as copies of each other as an example, the strategy of back-to-source of edge nodes to relay nodes in the CDN system is exemplarily described.
[0063] Under normal circumstances, the relay nodes in the two back-to-source node groups B and C are both available. In this case, the edge nodes in each edge node group will back-source each URI resource to the back-to-source node group corresponding to the edge node group based on the consistent hashing rule. Figure 3 As shown, each edge node b1, b2…b in edge node group b m1 The URI1 resource is sent back to the relay node B1 in the back-to-source node group B, and the URI2 resource is sent back to the relay node B2 in the back-to-source node group B, and so on. N The resource is returned to the relay node B in the source node group B. NSimilarly, each edge node c1, c2…c m2 The URI1 resource is returned to the relay node C1 in the return node group C, the URI2 resource is returned to the relay node C2 in the return node group C, and so on. N The resource is returned to the relay node C in the source node group C. N . Under normal circumstances, after a period of use, the relay nodes B1 and C1 to which URI1 is mapped in the two back-to-source node groups both cache URI1 resources, and the relay nodes B2 and C2 to which URI2 is mapped both cache URI2 resources, and so on. N Mapped to relay node B N and C N URIs are cached N resource.
[0064] like Figure 4 As shown, taking the case where the relay node B1 mapped to URI1 in the back-to-source node group B is unavailable as an example, since the relay node B1 mapped to URI1 in the back-to-source node group B is unavailable, the edge nodes b1, b2…b m1 All URI1 resources are returned to the source node C1 in the source node group C. For other URI2…URI N Resources, edge node group b still returns to the corresponding relay node B2…B in the return node group B N Moreover, it has no impact on the back-to-source links of each edge node in edge node group c, that is, each edge node c1, c2…c m2 Each URI resource is returned to the corresponding relay node in the source node group C. In this case, for the URI1 resource, when searching for the source target node, the scheduling server uses the source node group C as a copy of the source node group B, and searches for the relay node C1 mapped to URI1 in the source node group C based on the consistent hashing rule.
[0065] In an optional embodiment, in order to find the return target node in the return node group based on the consistent hash rule, the scheduling server creates a hash ring corresponding to each return node group, and selects the return target node on the hash ring corresponding to the return node group according to the hash value of the URI of the target resource to be returned. Based on the specific return node group for selecting the return target node determined based on the scheme of this embodiment, a corresponding hash ring is constructed based on multiple relay nodes in the specific return node group, and the upper-level relay node for returning the given URI resource to the source is selected in the hash ring based on the consistent hash rule. Specifically, any existing consistent hash algorithm can be used for implementation, and this embodiment is not specifically limited here.
[0066] In an optional embodiment, the scheduling server is also used to configure the back-to-source policy used by each edge node group. The back-to-source policy includes the back-to-source node group associated with each resource identifier (URI). Furthermore, when searching for the back-to-source target node, the scheduling server searches for the relay node to which the target resource is mapped in the back-to-source node group associated with the resource identifier of the target resource based on the consistent hashing rule according to the back-to-source policy used by the edge node, as the back-to-source target node. In the back-to-source policy, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the back-to-source node group associated with the resource identifier of the target resource is another back-to-source node group; if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is available, the back-to-source node group associated with the resource identifier of the target resource is the back-to-source node group corresponding to the edge node.
[0067] Specifically, by default, in the back-to-source policy configured for the edge node group, each URI is associated with the back-to-source node group corresponding to the edge node group. Under normal circumstances, when each edge node in the same edge node group performs back-to-source of a URI resource, based on the consistent hashing rule, the URI resource is back-to-sourced to the relay node to which the URI is mapped in the back-to-source node group corresponding to the edge node group. That is, under normal circumstances, the back-to-source policies of different edge node groups are relatively independent and do not interfere with each other, so that each relay node group caches each URI resource.
[0068] For example, based on Figure 3 In the example shown, the default back-to-origin policy P1 used by edge node group b is: URI1, URI2…URI N They are respectively associated with the back-to-origin node group B corresponding to the edge node group b. The back-to-origin strategy P2 used by the edge node group c is: URI1, URI2…URI N They are respectively associated with the back-to-source node group C corresponding to the edge node group c. In this way, in the back-to-source process, for the back-to-source information request for the target resource (taking URI1 as an example) of any edge node in the edge node group b, the scheduling server can determine that the resource identifier URI1 of the target resource is associated with the back-to-source node group B according to the back-to-source policy P1, and based on the consistent hashing rule, the resource identifier URI1 of the target resource is mapped to the relay node B1 in the back-to-source node group B as the back-to-source target node for this back-to-source, and the access address of the relay node B1 is included in the back-to-source information and returned to the edge node. The edge node back-sources the target resource (URI1) to the back-to-source target node (relay node B1). Similarly, for the back-to-source information request of any edge node in the edge node group c, the scheduling server back-sources the target resource to the corresponding relay node in the back-to-source node group C according to the back-to-source policy P2. After a period of use, the relay nodes B1 and C1 in each back-to-source node group have cached the URI1 resource.
[0069] The scheduling server can obtain the status information of the relay nodes in each back-to-source node group in real time, and based on the status information of the relay nodes, when it is determined that the relay nodes are offline or abnormal, it is determined that the relay nodes are unavailable. Among them, the method for the scheduling server to obtain the status information of each relay node can be implemented by monitoring the operating status information of any service node in the prior art, and this embodiment is not specifically limited here.
[0070] Further, when the scheduling server detects that the first node in the first back-to-source node group is unavailable, it updates the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group, wherein the first back-to-source node group is any back-to-source node group, and the second back-to-source node group is a back-to-source node group other than the first back-to-source node group. The first node is any relay node in the first back-to-source node group.
[0071] In this way, when the relay node mapped to a certain URI in any back-to-source node group is unavailable, the scheduling server updates the back-to-source policy used by the edge node group corresponding to the back-to-source node group, and modifies the URI to be associated with another relay node group. When the edge node in the edge node group back-sources the URI resource, it will search for the relay node mapped to the URI in the relay node group currently associated with the URI based on the modified back-to-source policy and the consistent hashing rule, and back-source the URI resource to the relay node mapped to the URI in the relay node group currently associated with the URI. The relay node is likely to cache the URI resource during normal use.
[0072] For example, based on Figure 4 In the example shown, when the relay node B1 mapped to URI1 in the back-to-source node group B is unavailable, the back-to-source policy P1 used by the edge node group b corresponding to the back-to-source node group B is updated, and the original URI1 in the back-to-source policy P1 is associated with the back-to-source node group B, and is modified to be associated with URI1 to the back-to-source node group C. In this way, for the back-to-source information request for the URI1 resource by any edge node (such as b1) in the edge node group b, the scheduling server maps URI1 to the relay node C1 in the back-to-source node group C based on the consistent hashing rule according to URI1, maps URI1 to the relay node C1 as the back-to-source target node, and returns the access address of the relay node C1 to the edge node b1. The edge node b1 sends a back-to-source request to the relay node C1. In response to the back-to-source request sent by the edge node b1, the relay node C1 returns the cached URI1 resource to the edge node b1.
[0073] Furthermore, when it is detected that the first node has returned to normal, the scheduling server again updates the return-to-source policy used by the edge node group corresponding to the first return-to-source node group, and re-associates the resource identifier mapped to the first node to the first return-to-source node group. In this way, for any edge node group, when each relay node in its corresponding return-to-source node group is available, priority is given to returning to its corresponding return-to-source node group. Since the edge node group and the corresponding return-to-source node group are usually located in the same or a close geographical area, each edge node group gives priority to returning to its corresponding return-to-source node group, and can give priority to returning to a closer relay node, which can increase the speed of resource return.
[0074] In an optional embodiment, in a scenario where the number of back-to-source node groups in the CDN system exceeds 2, when it is detected that the first node in the first back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the first back-to-source node group is updated, and the resource identifier mapped to the first node is associated with the second back-to-source node group. In an optional implementation, the scheduling server may randomly select one from multiple back-to-source node groups other than the first back-to-source node group in the CDN system as the second back-to-source node group, and associate the resource identifier mapped to the first node with the second back-to-source node group.
[0075] In another optional implementation, the back-to-source policy used by each edge node group also includes the priority of each back-to-source node group. Among them, the priorities of each back-to-source node group in the back-to-source policies used by different edge node groups are not completely consistent. When it is detected that the first node in the first back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the first back-to-source node group is updated, and the resource identifier mapped to the first node is associated with the second back-to-source node group. The scheduling server selects a back-to-source node group with a higher priority other than the first back-to-source node group as the second back-to-source node group based on the priority of each back-to-source node group in the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group.
[0076] Optionally, the back-to-source policy used by any edge node group can be automatically configured by the scheduling server. The scheduling server configures the back-to-source node group corresponding to the edge node group to have a higher priority than other back-to-source node groups by default. The priorities of multiple back-to-source node groups other than the back-to-source node group corresponding to the edge node group can be configured based on the distance between the geographical area where the other back-to-source node groups are located and the geographical area where the edge node group is located. The closer the distance to the geographical area where the edge node group is located, the higher the priority of the other back-to-source node groups.
[0077] For example, taking the CDN system including three edge node groups b, c and d, and corresponding back-to-source node groups B, C and D as an example, for the back-to-source strategy P1 used by edge node group b, the priority of back-to-source node group B corresponding to edge node group b is configured to be higher than the priority of other back-to-source node groups, and the priority of back-to-source node groups C and D other than back-to-source node group B can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group b is located. The closer the distance to the geographical area where the edge node group b is located, the higher the priority of the back-to-source node group. Similarly, for the back-to-source strategy P2 used by edge node group c, the priority of back-to-source node group C corresponding to edge node group c is configured to be higher than the priority of other back-to-source node groups, and the priority of back-to-source node groups B and D other than back-to-source node group C can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group c is located. The closer the distance to the geographical area where the edge node group c is located, the higher the priority of the back-to-source node group. Similarly, for the back-to-source policy P3 used by edge node group d, the priority of back-to-source node group D corresponding to edge node group d is configured to be higher than the priorities of other back-to-source node groups. The priorities of back-to-source node groups B and C other than back-to-source node group D can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group d is located. The closer the distance to the geographical area where the edge node group d is located, the higher the priority of the back-to-source node group.
[0078] Optionally, the priority of each back-to-source node group in the back-to-source strategy used by any edge node group can also be customized by relevant technical personnel through the front-end interface.
[0079] In an optional embodiment, the scheduling server provides a back-to-source policy configuration interface, which is used to configure the back-to-source policy used by each edge node group. When the relevant technical personnel want to configure the back-to-source policy, they send the back-to-source policy configuration instruction to the scheduling server. The source policy configuration instruction can be triggered by a command line, a front-end control, an executable script, etc., which is not specifically limited in this embodiment.
[0080] The scheduling server responds to the back-to-source policy configuration instruction and outputs the back-to-source policy configuration interface. The back-to-source policy configuration interface outputs the current configuration of the back-to-source policy used by each edge node group. Relevant technicians can edit the back-to-source policy used by any edge node group displayed in the back-to-source policy configuration interface. After the editing is completed, the back-to-source policy edited in the back-to-source policy configuration interface is submitted to the scheduling server by triggering the control in the interface. The scheduling server updates the back-to-source policy used by the edge node group according to the edited back-to-source policy.
[0081] Specifically, through the back-to-source policy configuration interface, relevant technicians can edit any configuration information in the back-to-source policy used by any edge node group, such as editing and modifying the back-to-source node groups associated with one or more URIs in the back-to-source policy used by any edge node group, or editing and modifying the priority of each back-to-source node group in the back-to-source policy.
[0082] The CDN system provided in this embodiment constructs multiple edge node groups and corresponding back-to-source node groups, and configures the back-to-source policies used by each edge node group, so that multiple back-to-source node groups can serve as cache copies of each other. A back-to-source node group can select other back-to-source node groups as cache copies, and can also serve as cache copies of other back-to-source node groups. In the case where a relay node in a back-to-source node group is unavailable, the URI resource originally mapped to this relay node abandons the method of reselecting a relay node in the current back-to-source node group, and instead maps the URI mapped to the relay node to the relay node in the replica back-to-source node group for back-to-source. Since the relay node in the replica back-to-source node group also has a cache of the URI resource, it ensures that the request for the URI resource can be cached in the relay node in the replica back-to-source node group. This improves the overall cache hit rate of the CDN system and the cache disaster recovery capability of consistent hash back-to-source.
[0083] Figure 5 An interactive flow chart of a back-to-source scheduling method provided by an exemplary embodiment of the present application, such as Figure 5 As shown, based on the CDN system provided by any of the above embodiments, the specific process of back-to-source scheduling is as follows:
[0084] Step S500: The edge node sends a back-to-source information request for a target resource to a scheduling server, where the back-to-source information request includes a resource identifier of the target resource.
[0085] In the CDN system, the edge node is used to receive the acquisition request for the target resource sent by the user terminal and determine whether the target resource is cached locally. If it is determined that the target resource is cached locally, the edge node directly returns the target resource to the user terminal. If it is determined that the target resource is not cached locally, it is necessary to return to the source to the upper-level relay node, and the edge node sends a request for the target resource to the scheduling server. The scheduling server receives the request for the target resource to be returned to the source sent by each edge node.
[0086] The back-to-source information request includes a resource identifier (URI) of a target resource, and the URI of the target resource is used to determine the relay node to which the target resource is mapped, that is, to determine the relay node used to cache the target resource, so as to obtain the target resource from the relay node.
[0087] In addition, the back-to-source information request also includes the identification information of the edge node. The identification information of the edge node is used to determine the back-to-source strategy used by the edge node and the back-to-source node group corresponding to the edge node, and the URI of the target resource is used to determine the relay node to which the target resource is mapped.
[0088] Step S501: The scheduling server responds to the back-to-source information request of the edge node for the target resource. According to the back-to-source policy used by the edge node, if the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is used as the back-to-source target node; if the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is not available, the relay node to which the target resource in another back-to-source node group is mapped is used as the back-to-source target node.
[0089] The same back-to-source policy is used by each edge node in the same edge node group. The back-to-source policy used by each edge node group configures the back-to-source node group associated with each URI during back-to-source.
[0090] By default, each URI in the back-to-source policy used by the edge node group is associated with the back-to-source node group corresponding to the edge node group. Under normal circumstances, when each edge node in the same edge node group performs back-to-source of URI resources, based on the consistent hashing rule, the URI resources are back-to-sourced to the relay node mapped to the URI in the back-to-source node group corresponding to the edge node group. That is, under normal circumstances, the back-to-source policies of different edge node groups are relatively independent and do not interfere with each other, so each relay node group caches each URI resource.
[0091] When the relay node mapped to a certain URI in any back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the back-to-source node group is updated, and the URI is modified to be associated with another relay node group. When the edge node in the edge node group back-sources the URI resource, it will search for the relay node mapped to the URI in the relay node group currently associated with the URI based on the modified back-to-source policy and the consistent hashing rule, and back-source the URI resource to the relay node mapped to the URI in the relay node group currently associated with the URI. The relay node is likely to cache the URI resource during normal use.
[0092] In this way, by configuring and updating the back-to-source policy used by each edge node group, the back-to-source node group associated with each URI can be controlled. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is unavailable, the scheduling server uses the back-to-source policy used by the edge node to map the target resource in another back-to-source node group to the relay node as the back-to-source target node.
[0093] When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the scheduling server uses the back-to-source policy used by the edge node to map the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped as the back-to-source target node.
[0094] Step S502: The scheduling server returns the access address of the source target node to the edge node.
[0095] After determining the return target node of this return, the scheduling server returns the access address of the return target node to the edge node. The edge node receives the access address of the return target node returned by the scheduling server.
[0096] Step S503: The edge node sends a back-to-source request to the back-to-source target node according to the access address of the back-to-source target node.
[0097] After receiving the access address of the back-to-source target node returned by the scheduling server, the edge node sends a back-to-source request to the back-to-source target node according to the access address of the back-to-source target node to perform back-to-source of the target resource.
[0098] Step S504: The back-to-source target node sends the locally cached target resources to the edge node in response to the back-to-source request sent by the edge node.
[0099] After receiving the back-to-source request sent by the edge node, the back-to-source target node will send the locally cached target resources to the edge node, thereby completing the back-to-source of the target resources.
[0100] This embodiment provides an interactive process of a back-to-source scheduling solution based on the aforementioned CDN system. Back-to-source scheduling is implemented based on the aforementioned CDN system. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is used as the back-to-source target node. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is unavailable, instead of searching for the back-to-source target node in the same back-to-source node group, the relay node to which the target resource in another back-to-source node group is mapped is used as the back-to-source target node, and the access address of the back-to-source target node is returned to the edge node, which can improve the overall cache hit rate of the CDN system and improve the cache disaster recovery capability of consistent hash back-to-source.
[0101] Figure 6 This is a flowchart of a back-to-source scheduling method provided by an exemplary embodiment of the present application. The execution subject of this embodiment is the scheduling server in the aforementioned CDN system. Figure 6 As shown, based on the CDN system provided by any of the above embodiments, the specific steps of the scheduling server performing back-to-source scheduling are as follows:
[0102] Step S601: Receive a back-to-source information request for a target resource from an edge node, where the back-to-source information request includes a resource identifier of the target resource.
[0103] In the CDN system, the edge node is used to receive the acquisition request for the target resource sent by the user terminal and determine whether the target resource is cached locally. If it is determined that the target resource is cached locally, the edge node directly returns the target resource to the user terminal. If it is determined that the target resource is not cached locally, it is necessary to return to the source to the upper-level relay node, and the edge node sends a request for the target resource to the scheduling server. The scheduling server receives the request for the target resource to be returned to the source sent by each edge node.
[0104] The back-to-source information request includes a resource identifier (URI) of a target resource, and the URI of the target resource is used to determine the relay node to which the target resource is mapped, that is, to determine the relay node used to cache the target resource, so as to obtain the target resource from the relay node.
[0105] In addition, the back-to-source information request also includes the identification information of the edge node. The identification information of the edge node is used to determine the back-to-source strategy used by the edge node and the back-to-source node group corresponding to the edge node, and the URI of the target resource is used to determine the relay node to which the target resource is mapped.
[0106] Step S602: According to the back-to-source strategy used by the edge node, when the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is used as the back-to-source target node; when the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is not available, the relay node to which the target resource in another back-to-source node group is mapped is used as the back-to-source target node.
[0107] The same back-to-source policy is used by each edge node in the same edge node group. The back-to-source policy used by each edge node group configures the back-to-source node group associated with each URI during back-to-source.
[0108] By default, each URI in the back-to-source policy used by the edge node group is associated with the back-to-source node group corresponding to the edge node group. Under normal circumstances, when each edge node in the same edge node group performs back-to-source of URI resources, based on the consistent hashing rule, the URI resources are back-to-sourced to the relay node mapped to the URI in the back-to-source node group corresponding to the edge node group. That is, under normal circumstances, the back-to-source policies of different edge node groups are relatively independent and do not interfere with each other, so each relay node group caches each URI resource.
[0109] When the relay node mapped to a certain URI in any back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the back-to-source node group is updated, and the URI is modified to be associated with another relay node group. When the edge node in the edge node group back-sources the URI resource, it will search for the relay node mapped to the URI in the relay node group currently associated with the URI based on the modified back-to-source policy and the consistent hashing rule, and back-source the URI resource to the relay node mapped to the URI in the relay node group currently associated with the URI. The relay node is likely to cache the URI resource during normal use.
[0110] In this way, by configuring and updating the back-to-source policies used by each edge node group, the back-to-source node group associated with each URI can be controlled. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is unavailable, the scheduling server uses the back-to-source policy used by the edge node to map the target resource in another back-to-source node group as the back-to-source target node. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the scheduling server uses the back-to-source policy used by the edge node to map the target resource in the back-to-source node group corresponding to the edge node as the back-to-source target node.
[0111] Step S603: Return the access address of the source target node to the edge node.
[0112] After determining the return target node for this return, the scheduling server returns the access address of the return target node to the edge node.
[0113] After receiving the access address of the back-to-source target node returned by the scheduling server, the edge node sends a back-to-source request to the back-to-source target node according to the access address of the back-to-source target node to perform back-to-source of the target resource. After receiving the back-to-source request sent by the edge node, the back-to-source target node sends the locally cached target resource to the edge node, thereby completing the back-to-source of the target resource.
[0114] The method of this embodiment implements back-to-source scheduling based on the aforementioned CDN system. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is available, the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is used as the back-to-source target node. When the relay node to which the target resource in the back-to-source node group corresponding to the edge node is mapped is unavailable, instead of searching for the back-to-source target node in the same back-to-source node group, the relay node to which the target resource in another back-to-source node group is mapped is used as the back-to-source target node, and the access address of the back-to-source target node is returned to the edge node, which can improve the overall cache hit rate of the CDN system and improve the cache disaster recovery capability of consistent hash back-to-source.
[0115] In an optional embodiment, in order to find the return target node in the return node group based on the consistent hash rule, the scheduling server can also create a hash ring corresponding to each return node group, and select the return target node on the hash ring corresponding to the return node group according to the hash value of the URI of the target resource to be returned. On the basis of determining the specific return node group for selecting the return target node based on the scheme of this embodiment, a corresponding hash ring is constructed based on multiple relay nodes in the specific return node group, and the upper-level relay node for returning the given URI resource to the source is selected in the hash ring based on the consistent hash rule. It can be implemented by any existing consistent hash algorithm, and this embodiment is not specifically limited here.
[0116] In an optional embodiment, before performing the back-to-source scheduling, the scheduling server configures the back-to-source policy used by each edge node group. The back-to-source policy includes the back-to-source node group associated with each resource identifier (URI). Further, in the aforementioned step S602, when the scheduling server searches for the back-to-source target node, it searches for the relay node mapped to the target resource in the back-to-source node group associated with the resource identifier of the target resource based on the consistent hashing rule, as the back-to-source target node.
[0117] Specifically, by default, in the back-to-source policy configured for the edge node group, each URI is associated with the back-to-source node group corresponding to the edge node group. Under normal circumstances, when each edge node in the same edge node group performs back-to-source of a URI resource, based on the consistent hashing rule, the URI resource is back-to-sourced to the relay node to which the URI is mapped in the back-to-source node group corresponding to the edge node group. That is, under normal circumstances, the back-to-source policies of different edge node groups are relatively independent and do not interfere with each other, so that each relay node group caches each URI resource.
[0118] For example, based on Figure 3 In the example shown, the default back-to-origin policy P1 used by edge node group b is: URI1, URI2…URI N They are respectively associated with the back-to-origin node group B corresponding to the edge node group b. The back-to-origin strategy P2 used by the edge node group c is: URI1, URI2…URI NThey are respectively associated with the back-to-source node group C corresponding to the edge node group c. In this way, in the back-to-source process, for the back-to-source information request for the target resource (taking URI1 as an example) of any edge node in the edge node group b, the scheduling server can determine that the resource identifier URI1 of the target resource is associated with the back-to-source node group B according to the back-to-source policy P1, and based on the consistent hashing rule, the resource identifier URI1 of the target resource is mapped to the relay node B1 in the back-to-source node group B as the back-to-source target node for this back-to-source, and the access address of the relay node B1 is included in the back-to-source information and returned to the edge node. The edge node back-sources the target resource (URI1) to the back-to-source target node (relay node B1). Similarly, for the back-to-source information request of any edge node in the edge node group c, the scheduling server back-sources the target resource to the corresponding relay node in the back-to-source node group C according to the back-to-source policy P2. After a period of use, the relay nodes B1 and C1 in each back-to-source node group have cached the URI1 resource.
[0119] In this embodiment, the scheduling server can obtain the status information of the relay nodes in each back-to-source node group in real time, and based on the status information of the relay nodes, when it is determined that the relay nodes are offline or abnormal, it is determined that the relay nodes are unavailable. Among them, the method for the scheduling server to obtain the status information of each relay node can be implemented by monitoring the operating status information of any service node in the prior art, and this embodiment is not specifically limited here.
[0120] Further, when the scheduling server detects that the first node in the first back-to-source node group is unavailable, it updates the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group, wherein the first back-to-source node group is any back-to-source node group, and the second back-to-source node group is a back-to-source node group other than the first back-to-source node group. The first node is any relay node in the first back-to-source node group.
[0121] In this way, when the relay node mapped to a certain URI in any back-to-source node group is unavailable, the scheduling server updates the back-to-source policy used by the edge node group corresponding to the back-to-source node group, and modifies the URI to be associated with another relay node group. When the edge node in the edge node group back-sources the URI resource, it will search for the relay node mapped to the URI in the relay node group currently associated with the URI based on the modified back-to-source policy and the consistent hashing rule, and back-source the URI resource to the relay node mapped to the URI in the relay node group currently associated with the URI. The relay node is likely to cache the URI resource during normal use.
[0122] For example, based on Figure 4In the example shown, when the relay node B1 mapped to URI1 in the back-to-source node group B is unavailable, the back-to-source policy P1 used by the edge node group b corresponding to the back-to-source node group B is updated, and the original URI1 in the back-to-source policy P1 is associated with the back-to-source node group B, and is modified to be associated with URI1 to the back-to-source node group C. In this way, for the back-to-source information request for the URI1 resource by any edge node (such as b1) in the edge node group b, the scheduling server maps URI1 to the relay node C1 in the back-to-source node group C based on the consistent hashing rule according to URI1, maps URI1 to the relay node C1 as the back-to-source target node, and returns the access address of the relay node C1 to the edge node b1. The edge node b1 sends a back-to-source request to the relay node C1. In response to the back-to-source request sent by the edge node b1, the relay node C1 returns the cached URI1 resource to the edge node b1.
[0123] Furthermore, when it is detected that the first node has returned to normal, the scheduling server again updates the return-to-source policy used by the edge node group corresponding to the first return-to-source node group, and re-associates the resource identifier mapped to the first node to the first return-to-source node group. In this way, for any edge node group, when each relay node in its corresponding return-to-source node group is available, priority is given to returning to its corresponding return-to-source node group. Since the edge node group and the corresponding return-to-source node group are usually located in the same or a close geographical area, each edge node group gives priority to returning to its corresponding return-to-source node group, and can give priority to returning to a closer relay node, which can increase the speed of resource return.
[0124] In an optional embodiment, in a scenario where the number of back-to-source node groups in the CDN system exceeds 2, when it is detected that the first node in the first back-to-source node group is unavailable, the scheduling server updates the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group. In an optional implementation, the scheduling server may randomly select one from multiple back-to-source node groups other than the first back-to-source node group in the CDN system as the second back-to-source node group, and associate the resource identifier mapped to the first node with the second back-to-source node group.
[0125] In another optional implementation, the back-to-source policy used by each edge node group also includes the priority of each back-to-source node group. Among them, the priorities of each back-to-source node group in the back-to-source policies used by different edge node groups are not completely consistent. When it is detected that the first node in the first back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the first back-to-source node group is updated, and the resource identifier mapped to the first node is associated with the second back-to-source node group. The scheduling server selects a back-to-source node group with a higher priority other than the first back-to-source node group as the second back-to-source node group based on the priority of each back-to-source node group in the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group.
[0126] Optionally, the back-to-source policy used by any edge node group can be automatically configured by the scheduling server. The scheduling server configures the back-to-source node group corresponding to the edge node group to have a higher priority than other back-to-source node groups by default. The priorities of multiple back-to-source node groups other than the back-to-source node group corresponding to the edge node group can be configured based on the distance between the geographical area where the other back-to-source node groups are located and the geographical area where the edge node group is located. The closer the distance to the geographical area where the edge node group is located, the higher the priority of the other back-to-source node groups.
[0127] For example, taking the CDN system including three edge node groups b, c and d, and corresponding back-to-source node groups B, C and D as an example, for the back-to-source strategy P1 used by edge node group b, the priority of back-to-source node group B corresponding to edge node group b is configured to be higher than the priority of other back-to-source node groups, and the priority of back-to-source node groups C and D other than back-to-source node group B can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group b is located. The closer the distance to the geographical area where the edge node group b is located, the higher the priority of the back-to-source node group. Similarly, for the back-to-source strategy P2 used by edge node group c, the priority of back-to-source node group C corresponding to edge node group c is configured to be higher than the priority of other back-to-source node groups, and the priority of back-to-source node groups B and D other than back-to-source node group C can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group c is located. The closer the distance to the geographical area where the edge node group c is located, the higher the priority of the back-to-source node group. Similarly, for the back-to-source policy P3 used by edge node group d, the priority of back-to-source node group D corresponding to edge node group d is configured to be higher than the priorities of other back-to-source node groups. The priorities of back-to-source node groups B and C other than back-to-source node group D can be configured according to the distance between the geographical area where the back-to-source node group is located and the geographical area where the edge node group d is located. The closer the distance to the geographical area where the edge node group d is located, the higher the priority of the back-to-source node group.
[0128] Optionally, the priority of each back-to-source node group in the back-to-source strategy used by any edge node group can also be customized by relevant technical personnel through the front-end interface.
[0129] In an optional embodiment, the scheduling server provides a back-to-source policy configuration interface, which is used to configure the back-to-source policy used by each edge node group. When the relevant technical personnel want to configure the back-to-source policy, they send the back-to-source policy configuration instruction to the scheduling server. The source policy configuration instruction can be triggered by a command line, a front-end control, an executable script, etc., which is not specifically limited in this embodiment.
[0130] The scheduling server responds to the back-to-source policy configuration instruction and outputs the back-to-source policy configuration interface. The back-to-source policy configuration interface outputs the current configuration of the back-to-source policy used by each edge node group. Relevant technicians can edit the back-to-source policy used by any edge node group displayed in the back-to-source policy configuration interface. After the editing is completed, the back-to-source policy edited in the back-to-source policy configuration interface is submitted to the scheduling server by triggering the control in the interface. The scheduling server updates the back-to-source policy used by the edge node group according to the edited back-to-source policy.
[0131] Specifically, through the back-to-source policy configuration interface, relevant technicians can edit any configuration information in the back-to-source policy used by any edge node group, such as editing and modifying the back-to-source node groups associated with one or more URIs in the back-to-source policy used by any edge node group, or editing and modifying the priority of each back-to-source node group in the back-to-source policy.
[0132] The back-to-source scheduling scheme based on the CDN system provided in this embodiment provides a given CDN system based on the aforementioned embodiment, by constructing multiple edge node groups and corresponding back-to-source node groups in the CDN system, and by configuring the back-to-source strategy used by each edge node group, multiple back-to-source node groups can serve as cache copies of each other, and one back-to-source node group can select other back-to-source node groups as cache copies, or serve as cache copies of other back-to-source node groups. In the case where a relay node in a back-to-source node group is unavailable, the URI resource originally mapped to this relay node abandons the method of reselecting a relay node in this back-to-source node group, and instead maps the URI mapped to the relay node to the relay node in the replica back-to-source node group for back-to-source. Since the relay node in the replica back-to-source node group also has a cache of the URI resource, it is ensured that the request for the URI resource can be cached in the relay node in the replica back-to-source node group. Hit, thereby improving the overall cache hit rate of the CDN system and improving the cache disaster recovery capability of consistent hash back-to-source.
[0133] Figure 7Schematic diagram of the structure of a scheduling server provided in an embodiment of the present application. The scheduling server provided in this embodiment is applied to the CDN system provided in any of the above embodiments. Figure 7 As shown, the scheduling server includes: a memory 701 and a processor 702. The memory 701 is used to store computer-executable instructions and can be configured to store various other data to support operations on the scheduling server. The processor 702 is connected to the memory 701 in communication and is used to execute the computer-executable instructions stored in the memory 701 to implement the back-to-source scheduling scheme provided by any of the above method embodiments. Its specific functions and technical effects that can be achieved are similar and will not be repeated here.
[0134] Optional, such as Figure 7 As shown, the scheduling server also includes: a firewall 703, a load balancer 704, a communication component 705, a power supply component 706 and other components. Figure 7 Only some components are shown schematically, which does not mean that the scheduling server only includes Figure 7 Components shown.
[0135] An embodiment of the present application also provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the method of any of the aforementioned embodiments is implemented. The specific functions and technical effects that can be achieved are not repeated here.
[0136] The embodiment of the present application also provides a computer program product, including a computer program, which implements the method of any of the above embodiments when executed by a processor. The computer program is stored in a readable storage medium, and at least one processor of the scheduling server can read the computer program from the readable storage medium. At least one processor executes the computer program so that the scheduling server executes the technical solution provided by any of the above method embodiments. The specific functions and technical effects that can be achieved are not repeated here.
[0137] The embodiment of the present application provides a chip, including: a processing module and a communication interface, the processing module can execute the technical solution of scheduling the server in the aforementioned method embodiment. Optionally, the chip also includes a storage module (such as a memory), the storage module is used to store instructions, the processing module is used to execute the instructions stored in the storage module, and the execution of the instructions stored in the storage module enables the processing module to execute the technical solution provided by any of the aforementioned method embodiments.
[0138] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0139] It should be understood that the above-mentioned processor can be a processing unit (Central Processing Unit, referred to as CPU), or other general-purpose processors, digital signal processors (Digital Signal Processor, referred to as DSP), application-specific integrated circuits (Application Specific Integrated Circuit, referred to as ASIC), etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and can also be a USB flash drive, a mobile hard disk, a read-only memory, a disk or an optical disk, etc.
[0140] The above storage may be an object storage service (OSS).
[0141] The above-mentioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0142] The above-mentioned communication component is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as a mobile hotspot (WiFi), a second-generation mobile communication system (2G), a third-generation mobile communication system (3G), a fourth-generation mobile communication system (4G) / long-term evolution (LTE), a fifth-generation mobile communication system (5G) and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (Near Field Communication, referred to as NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0143] The power supply assembly provides power to various components of the device where the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply assembly is located.
[0144] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0145] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic device or a main control device.
[0146] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0147] The order of the above-mentioned embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. In addition, in some of the processes described in the above-mentioned embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed or executed in parallel in the order in which they appear in this article, and are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or less operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. The meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods of each embodiment of the present application.
[0149] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application.
[0150] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A content distribution network, characterized in that: include: A scheduling server, a plurality of edge node groups, and a back-to-source node group corresponding to each edge node group, wherein the edge node group includes a plurality of edge nodes, and the back-to-source node group includes a plurality of relay nodes between the corresponding edge node group and the source station; The edge node is used to respond to the acquisition request for the target resource, and when it is determined that the target resource is not cached locally, send a request for back-to-source information of the target resource to the scheduling server; The scheduling server is used to: in response to the edge node's request for the target resource's back-to-source information, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, use the relay node to which the target resource is mapped in another back-to-source node group as the back-to-source target node; The edge node is further used to return the target resource to the return-to-source target node.
2. The content distribution network according to claim 1, characterized in that: The scheduling server is further used to: when the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is available, use the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node as the back-to-source target node.
3. The content distribution network according to claim 1 or 2, characterized in that: The scheduling server is further used to: return the access address of the back-to-source target node to the edge node; The edge node returns the target resource to the return-to-source target node, including: The edge node performs back-to-source operation for the target resource according to the access address of the back-to-source target node.
4. The content distribution network according to claim 2, characterized in that: The scheduling server is further used to: configure a back-to-source policy used by each edge node group, wherein the back-to-source policy includes a back-to-source node group associated with each resource identifier; When searching for a back-to-source target node, the scheduling server searches for a relay node to which the target resource is mapped in the back-to-source node group associated with the resource identifier of the target resource based on a consistent hashing rule according to the back-to-source policy used by the edge node, as the back-to-source target node.
5. The content distribution network according to claim 4, characterized in that: The scheduling server configures the back-to-source strategy used by each edge node group, including: The scheduling server configures the back-to-source policy used by each edge node group by default, and each resource identifier is associated with the back-to-source node group corresponding to the edge node group; When the scheduling server detects that the first node in the first back-to-source node group is unavailable, it updates the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node to the second back-to-source node group, wherein the first back-to-source node group is any back-to-source node group, and the second back-to-source node group is a back-to-source node group other than the first back-to-source node group.
6. The content distribution network according to claim 5, characterized in that: The scheduling server is further used to: when detecting that the first node has recovered to normal, update the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and re-associate the resource identifier mapped to the first node to the first back-to-source node group.
7. The content distribution network according to claim 5, characterized in that: The back-to-source strategy also includes the priority of each back-to-source node group. The priorities of each back-to-source node group in the back-to-source strategies used by different edge node groups are not completely consistent; The scheduling server updates the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group, including: The scheduling server selects a back-to-source node group other than the first back-to-source node group as the second back-to-source node group according to the priority of each back-to-source node group in the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associates the resource identifier mapped to the first node with the second back-to-source node group.
8. The content distribution network according to any one of claims 4 to 7, characterized in that: The scheduling server is further used to: respond to the back-to-source policy configuration instruction, output a back-to-source policy configuration interface, and the back-to-source policy configuration interface is used to configure the back-to-source policy used by each edge node group; In response to an edit operation on a back-to-origin policy used by any edge node group, the back-to-origin policy used by the edge node group is updated.
9. A back-to-source scheduling method, characterized in that: A scheduling server applied to a content distribution network, wherein the content distribution network further comprises a plurality of edge node groups and a back-to-source node group corresponding to each edge node group, wherein the edge node group comprises a plurality of edge nodes, and the back-to-source node group comprises a plurality of relay nodes between the corresponding edge node group and a source station, wherein the method comprises: Receiving a back-to-source information request for a target resource from an edge node, wherein the back-to-source information request includes a resource identifier of the target resource; According to the back-to-source strategy used by the edge node, when the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is unavailable, the relay node to which the target resource is mapped in another back-to-source node group is used as the back-to-source target node; Return the access address of the back-to-source target node to the edge node.
10. The method according to claim 9, characterized in that Also includes: According to the back-to-source strategy used by the edge node, if the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is available, the relay node to which the target resource is mapped in the back-to-source node group corresponding to the edge node is used as the back-to-source target node.
11. The method according to claim 10, characterized in that Also includes: Configure a back-to-source policy used by each edge node group, wherein the back-to-source policy includes a back-to-source node group associated with each resource identifier; When searching for a back-to-source target node, according to the back-to-source policy used by the edge node, in the back-to-source node group associated with the resource identifier of the target resource, based on the consistent hashing rule, the relay node to which the target resource is mapped is searched as the back-to-source target node.
12. The method according to claim 11, characterized in that The configuration of the back-to-origin strategy used by each edge node group includes: In the default configuration of the back-to-source policy used by each edge node group, each resource identifier is associated with the back-to-source node group corresponding to the edge node group; When it is detected that the first node in the first back-to-source node group is unavailable, the back-to-source policy used by the edge node group corresponding to the first back-to-source node group is updated, and the resource identifier mapped to the first node is associated with the second back-to-source node group, wherein the first back-to-source node group is any back-to-source node group, and the second back-to-source node group is a back-to-source node group other than the first back-to-source node group.
13. The method according to claim 12, characterized in that Also includes: When it is detected that the first node has recovered to normal, the back-to-source policy used by the edge node group corresponding to the first back-to-source node group is updated, and the resource identifier mapped to the first node is re-associated with the first back-to-source node group.
14. The method according to claim 12, characterized in that The back-to-source strategy also includes the priority of each back-to-source node group. The priorities of each back-to-source node group in the back-to-source strategies used by different edge node groups are not completely consistent. When detecting that the first node in the first back-to-source node group is unavailable, updating the back-to-source policy used by the edge node group corresponding to the first back-to-source node group, and associating the resource identifier mapped to the first node with the second back-to-source node group, includes: When it is detected that the first node in the first back-to-source node group is unavailable, selecting a back-to-source node group other than the first back-to-source node group as the second back-to-source node group according to the priority of each back-to-source node group in the back-to-source policy used by the edge node group corresponding to the first back-to-source node group; The resource identifier mapped to the first node is associated with the second back-to-source node group.
15. The method according to any one of claims 11 to 14, characterized in that The configuration of the back-to-origin strategy used by each edge node group includes: In response to the back-to-source policy configuration instruction, output a back-to-source policy configuration interface, where the back-to-source policy configuration interface is used to configure the back-to-source policy used by each edge node group; In response to a configuration operation on a back-to-source policy used by any edge node group, the back-to-source policy used by the edge node group is updated.
16. A scheduling server, characterized in that: include: at least one processor; as well as a memory communicatively coupled to the at least one processor; The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the scheduling server executes the method described in any one of claims 9-15.
17. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 9 to 15 is implemented.