CN113472852A - CDN node back-source method, device and equipment - Google Patents

CDN node back-source method, device and equipment Download PDF

Info

Publication number
CN113472852A
CN113472852A CN202110612873.8A CN202110612873A CN113472852A CN 113472852 A CN113472852 A CN 113472852A CN 202110612873 A CN202110612873 A CN 202110612873A CN 113472852 A CN113472852 A CN 113472852A
Authority
CN
China
Prior art keywords
cache server
node
cdn
resource request
cdn node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110612873.8A
Other languages
Chinese (zh)
Other versions
CN113472852B (en
Inventor
孙国良
于潜江
王红光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Letv Cloud Network Technology Beijing Co ltd
Original Assignee
LeCloud Computing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by LeCloud Computing Co Ltd filed Critical LeCloud Computing Co Ltd
Priority to CN202110612873.8A priority Critical patent/CN113472852B/en
Publication of CN113472852A publication Critical patent/CN113472852A/en
Application granted granted Critical
Publication of CN113472852B publication Critical patent/CN113472852B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a method, a device and equipment for returning a CDN node to a source. Responding to a resource request, and acquiring a URI requested in the resource request and an IP list of a cache server in a CDN node; calculating through a consistent Hash algorithm to obtain a target IP, and forwarding the resource request to a cache server corresponding to the target IP; the cache server corresponding to the target IP judges whether the content requested in the resource request is cached, if so, the content is cached to the CDN node and returned to the lower node of the CDN node until the client corresponding to the resource request is returned; otherwise, sending a source returning request to an upper node of the CDN node. In this way, each CDN node can only return to the source once aiming at the user request with the same content, so that the source return rate is reduced, the upper-layer bandwidth is saved, the effective throughput is improved, the access pressure of a source site server is reduced, and the user experience is improved.

Description

CDN node back-source method, device and equipment
Technical Field
Embodiments of the present invention generally relate to the field of back-source technologies, and in particular, to a back-source method, an apparatus, and a device for a CDN node.
Background
The CDN is called a Content Delivery Network, i.e., a Content Delivery Network. The method aims to distribute the content of the website to the edge of the network closest to the user by adding a new network architecture in the existing Internet, so that the user can obtain the required content nearby, the congestion condition of the Internet network is solved, and the speed of the user for accessing the website is improved.
When a user requests a certain content, the CDN system directs the user to an edge node closest to the CDN system through a scheduling, i.e., Global Load Balance (GSLB) policy, and the node is responsible for processing the user's request. If the content requested by the user is cached and valid on the node, the cached content is sent to the user, otherwise, the node can proxy the user to send a source returning request to other nodes or a source station server, obtain the content requested by the user according to a source returning path and then forward the content to the user, and the processing of the request is completed.
However, a user request randomly arrives at any one of the cache servers in one CDN node, and if there is no corresponding cache content, a back-to-source process is performed to cache the content requested by the user in the cache server, and if the next user request for the same content randomly arrives at another cache server in the CDN node, since another cache server in the CDN node does not have corresponding cache content, then a back-to-source process still needs to be performed; therefore, the same content is returned to the upper layer for multiple times, so that the outlet bandwidth of the upper layer is increased, and the effective throughput is reduced.
Disclosure of Invention
According to the embodiment of the invention, a back-source scheme of a CDN node is provided.
In a first aspect of the present invention, a method for returning a CDN node to a source is provided. The method comprises the following steps:
responding to a resource request by any one of a plurality of cache servers in a CDN node, and acquiring a URI requested in the resource request and an IP list of the cache servers in the CDN node;
the cache server obtains a target IP through a consistent hash algorithm according to the URI requested in the resource request and an IP list of the cache server in the CDN node, and forwards the resource request to the cache server corresponding to the target IP;
the cache server corresponding to the target IP judges whether the content requested in the resource request is cached, if so, the CDN node returns to a lower node of the CDN node until returning to the client corresponding to the resource request; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
Further, the CDN node is an edge node or a sink node.
Further, the resource request is a user request sent by the client to the cache server in the edge node, a source returning request sent by the cache server in the edge node to the cache server in the sink node, or a source returning request sent by the cache server in the sink node to the source station layer.
Further, obtaining an IP list of the CDN node includes:
the cache server sends an HTTP request with the ID of the CDN node to a CDN scheduling center, receives IP list information returned by the CDN scheduling center, and updates an IP list of the cache server in the CDN node according to the IP list information; the IP list information is the IP list information of all the cache servers in the CDN node where the cache server is located.
Further, still include:
detecting a cache server, if the cache server is abnormal, forbidding the cache server and deleting the IP information of the abnormal cache server from an IP list; and if the cache server in the forbidden state is recovered to be normal, the cache server is forbidden, and the IP information of the forbidden cache server is added in an IP list of the cache server of the CDN node where the cache server is located.
Further, the probing the cache server includes:
reporting a heartbeat message to a CDN (content delivery network) scheduling center every other first time by a cache server to be detected, wherein if the CDN scheduling center does not receive the heartbeat message of the cache server to be detected in the first time, the cache server to be detected is abnormal; and/or
The CDN dispatching center sends a detection message to a cache server to be detected, and if a response message returned by the cache server to be detected is not received within a second time, the cache server to be detected is abnormal; and/or
The cache server receiving the resource request forwards the resource request to a cache server corresponding to the target IP, and if the client corresponding to the resource request does not receive the feedback information of the cache server corresponding to the target IP within a third time, the cache server corresponding to the target IP is abnormal; wherein the feedback information comprises the content requested in the resource request and the message that the content requested in the resource request does not exist.
Further, when the cache server executes the consistent hashing algorithm, if the added and/or deleted IP information exists in the IP list, the cache server remaps the added and/or deleted IP information.
In a second aspect of the present invention, a back-source device of a CDN node is provided. The device includes:
the system comprises an acquisition module, a cache module and a processing module, wherein the acquisition module is arranged in any cache server in a plurality of cache servers contained in a CDN node and used for responding to a resource request and acquiring a URI requested in the resource request and an IP list of the cache servers in the CDN node;
the computing module is arranged in the cache server and used for computing a target IP through a consistent hash algorithm according to the URI requested in the resource request and the IP list of the cache server in the CDN node, and forwarding the resource request to the cache server corresponding to the target IP;
the judging module is arranged in a cache server corresponding to the target IP and used for judging whether the content requested in the resource request is cached or not, if so, the CDN node returns to a lower-layer node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
In a third aspect of the invention, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor implementing the method as described above when executing the program.
In a fourth aspect of the invention, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the method as according to the first aspect of the invention.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of any embodiment of the invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
The invention can make each CDN node return to the source once for the user request with the same content, thereby reducing the return rate, saving the upper layer bandwidth, improving the effective throughput, reducing the access pressure of the source site server and improving the user experience.
Drawings
The above and other features, advantages and aspects of various embodiments of the present invention will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, like or similar reference characters designate like or similar elements, and wherein:
fig. 1 shows a schematic diagram of a back-source method of a CDN node according to an embodiment of the invention;
FIG. 2 shows a flow diagram of a method of back-sourcing a CDN node according to an embodiment of the invention;
FIG. 3 shows a block diagram of a back-to-source device of a CDN node according to an embodiment of the invention;
FIG. 4 shows a block diagram of a back-to-source device of a CDN node according to another embodiment of the present invention;
FIG. 5 illustrates a block diagram of an exemplary electronic device capable of implementing embodiments of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Fig. 1 shows a schematic diagram of a back-source method of a CDN node according to an embodiment of the present invention.
The CDN network architecture comprises two levels, namely an edge layer and a convergence layer; the convergence layer is arranged on the upper layer of the edge layer, and the edge layer is arranged on the lower layer of the convergence layer. The lower layer of the edge layer is a user layer; the user layer comprises a client, and the client is responsible for receiving instructions of a user, generating a user request and sending the user request to the edge layer. The upper layer of the convergence layer is a source station layer, and the source station layer is responsible for receiving a source returning request sent by the convergence layer and returning the content requested in the user request to the cache server of the corresponding node of the convergence layer according to the source returning request. The source site layer includes a source site server.
The edge layer is responsible for receiving a user request sent by a client, randomly allocating any cache server in an edge node in the edge layer to perform cache query, and sending a source return request to the convergence layer when the cache server does not query the content requested in the user request; the edge layer is also responsible for receiving content files requested in the user request returned by the convergence layer and returning the content files to the client. The edge layer comprises a plurality of edge nodes, a plurality of cache servers are arranged in each edge layer node, and corresponding IP is distributed to each cache server; cache data is stored in each cache server.
The aggregation layer is responsible for receiving the source returning request of the edge layer, randomly allocating any cache server in one aggregation node in the aggregation layer to perform cache query, and sending the source returning request to the source station layer when the cache server does not query the content requested in the source returning request; the convergence layer is also responsible for receiving content files requested in the source returning request returned by the source station layer and returning the content files to the corresponding cache servers of the corresponding edge nodes of the edge layer. The aggregation layer comprises a plurality of aggregation nodes, each aggregation node is internally provided with a plurality of cache servers, and corresponding IP is distributed to each cache server; cache data is stored in each cache server. The number of edge nodes in the edge layer is much greater than the number of aggregation nodes in the aggregation layer.
In the embodiment of the prior art, when a user requests to open a page or download a file through client equipment, the user request randomly reaches any cache server in an edge node, and if a content file requested in the user request is cached in the cache server, the content file is directly returned to the client; if the cache server does not have the file requested in the user request, the cache server sends a source request back to the upper layer, namely the convergence layer. The back source request also randomly reaches any cache server in the sink node of a sink layer, if the cache server caches the content file requested in the back source request, the content file is directly returned to the cache server of the corresponding edge node of the edge layer and returned to the client; if the cache server does not have the content file requested in the back source request, the back source request is sent to the upper layer, namely the source station layer; and the source station layer server returns the content files requested in the source returning request to the client step by step according to the source returning request.
However, in this process, since there are several cache servers in each CDN node, and a request of a user only accesses one of the cache servers, if the cache server does not request content, even if there is content requested by the user in other cache servers of the CDN node, the content still needs to be returned to the upper layer, so that a request of the same content (with the same URI) is returned to the upper layer multiple times, the egress bandwidth of the upper layer is increased, and the effective throughput is reduced.
In the invention, each CDN node can only return to the source once aiming at the user request with the same content, thereby saving the upper layer bandwidth, improving the effective throughput and improving the return to the source speed and efficiency.
Fig. 2 shows a flowchart of a back-to-source method of a CDN node according to an embodiment of the present invention.
The method comprises the following steps:
s201, any cache server in a plurality of cache servers in a CDN node responds to a resource request, and a URI requested in the resource request and an IP list of the cache servers in the CDN node are obtained;
the resource request is a user request sent by a client to a cache server in an edge node, a source returning request sent by the cache server in the edge node to a cache server in a sink node or a source returning request sent by the cache server in the sink node to a source station layer. The CDN node is an edge node or a sink node. The content routers in the CDN network architecture are responsible for dispatching the user's requests onto the appropriate devices (cache servers). Content routing is usually realized through a load balancing system, load distribution of each content caching site is dynamically balanced, an optimal access site is selected for a user request, and meanwhile, the usability of a website is improved.
When a CDN node receives a Resource request sent by a lower layer, a cache server in the CDN node responds to the Resource request and randomly reaches one cache server in the current CDN node according to the Resource request, cache processing software of the cache server acquires a Uniform Resource Identifier (URI) in the Resource request, and then acquires IP lists of all cache servers of the current CDN node.
As an embodiment of the present invention, acquiring an IP list of a CDN node includes:
the cache server sends an HTTP request with the ID of the CDN node to a CDN scheduling center, receives IP list information returned by the CDN scheduling center, and updates an IP list of the cache server in the CDN node according to the IP list information; the IP list information is IP list information of all cache servers in the CDN node where the cache server is located, as shown in table 1:
serial number Name (R) IP information
1 Cache server 1 103.56.3.24
2 Cache server 2 103.56.3.26
3 Cache server 3 103.56.3.39
…… …… ……
10 Cache server 10 103.56.3.89
TABLE 1
The CDN node ID can uniquely identify the CDN node.
As an embodiment of the present invention, when a user requests to open a page or download a file through a client device, the user request is sent to an edge layer, the user request reaches any one of cache servers in an edge node in the edge layer, a URI requested in the user request is obtained through cache processing software in the cache server, and an IP list of all the cache servers in the edge node is obtained. And acquiring IP lists of all cache servers in the aggregation node, wherein the steps of sending an HTTP request with the ID of the edge node to a CDN (content delivery network) scheduling center by the cache servers, receiving IP list information returned by the CDN scheduling center, and updating the IP lists of the cache servers in the edge node by the IP list information are included.
As an embodiment of the present invention, when a cache server in an edge node in an edge layer sends a back-source request to a sink layer, the back-source request reaches any one cache server in a certain sink node of the sink layer, and a URI requested in the back-source request is obtained through cache processing software in the cache servers, and an IP list of all the cache servers in the sink node is obtained. And acquiring IP lists of all cache servers in the aggregation node, wherein the steps of sending an HTTP request with the ID of the aggregation node to a CDN (content delivery network) scheduling center by the cache servers, receiving IP list information returned by the CDN scheduling center, and updating the IP lists of the cache servers in the aggregation node by the IP list information are included.
S202, the cache server calculates a target IP through a consistent hash algorithm according to the URI requested in the resource request and the IP list of the cache server in the CDN node, and forwards the resource request to the cache server corresponding to the target IP.
Inserting an IP list consisting of the IPs of all cache servers in the current CDN node into a hash data structure through a consistent hash algorithm; the URI requested in the resource request is taken as an input of the consistent hashing algorithm, that is: and obtaining a fixed IP in the current CDN node, namely the fixed IP is the target IP. And forwarding the resource request to a cache server corresponding to the target IP.
Since the consistent hash algorithm has consistency, the IP list in a node is mostly fixed, so that in most cases, one URI corresponds to one IP fixedly. Most of the cases are cases where no additions and/or deletions have occurred in the IP list. Just because a fixed target IP can be calculated through a fixed URI and an IP list, a back-source request can be carried out to an upper layer based on a cache server corresponding to the target IP, the content requested in the back-source request is cached in the cache of the cache server corresponding to the target IP, when a node receives a request with the same content again, namely a resource request with the same URI, the cache server corresponding to the target IP can still be found through the URI and the IP list, the content file requested in the resource request can be obtained by inquiring the cache of the cache server, and the back-source request is not required again, so that the upper-layer bandwidth is saved, and the effective throughput is improved.
As an embodiment of the present invention, when the process in the cache server executes the consistent hash algorithm, if there is added and/or deleted IP information in the IP list, the cache server remaps the added and/or deleted IP information. The remapping is to map only the changed IP information and does not need global remapping. The mapping is to associate the URI requested in the resource request with the information in the IP list. And after the IP list is changed, balancing the IP information corresponding to the URI requested in the resource request again. Because the consistent Hash algorithm does not need global remapping, the method can reduce the number of return sources under the condition that equipment in the node is increased or decreased.
S203, the cache server corresponding to the target IP judges whether the content requested in the resource request is cached, if so, the CDN node returns to a lower node of the CDN node until returning to the client corresponding to the resource request; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
When the CDN node sends a back-source request to an upper node of the CDN node, the back-source request is dispatched to a proper device (a cache server) in the upper node of the CDN node through a content router in a CDN network architecture. Content routing is usually realized through a load balancing system, load distribution of each content caching site is dynamically balanced, an optimal access site is selected for a user request, and meanwhile, the usability of a website is improved.
As an embodiment of the present invention, after sending a source return request to an upper node of the CDN nodes, the CDN nodes wait to receive content requested in the resource request returned by the upper node; and after receiving the content requested in the resource request, caching the content requested in the resource request.
As an embodiment of the present invention, the method further includes detecting a cache server, and if the cache server is abnormal, disabling the cache server and deleting the IP information of the abnormal cache server from an IP list; and if the cache server in the forbidden state is recovered to be normal, the cache server is forbidden, and the IP information of the forbidden cache server is added in an IP list of the cache server of the CDN node where the cache server is located.
In an embodiment of the present invention, the probing of the cache server may be implemented in one or more of the following three ways:
the first method is as follows:
the method comprises the steps that a cache server to be detected reports heartbeat messages to a CDN (content delivery network) scheduling center at intervals of first time, if the CDN scheduling center does not receive the heartbeat messages of the cache server to be detected in the first time, the cache server to be detected is abnormal, services on the IP are unavailable, each cache server configured in a node is issued, the abnormal cache server losing the heartbeat is forbidden, and the IP information of the forbidden cache server is deleted from an IP list.
And when the CDN dispatching center receives the heartbeat of the forbidden cache server again, the service is considered to be recovered, the forbidden cache server is forbidden, and the forbidden IP information of the cache server is added in an IP list of the cache server of the CDN node where the cache server is located. The first time is the time interval between two adjacent heartbeat messages and can be set artificially.
The second method comprises the following steps:
the CDN dispatching center sends a detection message to a cache server to be detected, and if a response message returned by the cache server to be detected is not received within a second time, the cache server to be detected is abnormal; for example, the CDN scheduling center sends a probe HTTP request to each cache server in the node, and under a normal condition, the cache server that receives the probe HTTP request will respond to the HTTP200 status code, and the CDN scheduling center will also receive the status code within a certain time, that is, indicate a successful response. If the response of a certain cache server is not received within the specified second time or the response is not the HTTP200 status code although the response is received within the specified second time, namely the response is failed, the cache server is considered to be abnormal, the abnormal cache server losing the heartbeat is disabled, and the IP information of the abnormal cache server is deleted from the IP list. The second time is the longest time from the detection message sent by the CDN scheduling center to the state code reception, and may be specified manually.
When the cache server responds to the HTTP detection request sent by the CDN scheduling center again and receives the HTTP200 state code, the service is considered to be recovered, the cache server is forbidden, and the forbidden IP information of the cache server is added in an IP list of the cache server of the CDN node where the cache server is located.
The third method comprises the following steps:
and the cache server receiving the resource request forwards the resource request to the cache server corresponding to the target IP, and if the client corresponding to the resource request does not receive the feedback information of the cache server corresponding to the target IP within a third time, the cache server corresponding to the target IP is abnormal.
The third time is the longest time from the sending of the user request to the receiving of the feedback content by the client, and can be set artificially. The feedback information comprises the content requested in the resource request and the message that the content requested in the resource request does not exist. Whether the cache server in the CDN system finds the content requested in the user request or not, information is fed back to the client, and whether the corresponding cache server is abnormal or not can be determined by whether the information is fed back within a prescribed time.
The detection modes of the three modes are combined, so that the state of the cache server can be judged more comprehensively and accurately, and the judgment efficiency and accuracy are improved.
The following describes the methods of S201 to S203 with two specific examples.
Example 1:
in this embodiment 1, the resource request is a user request for opening a page or downloading a file, which is sent by a user through a client.
When a user requests to open a page or download a file through client equipment, the user sends a user request to an edge layer through the client, the user request reaches any cache server in an edge node in the edge layer, and the cache server obtains a URI (Uniform resource identifier) requested in the user request through cache processing software in the cache server and obtains IP lists of all cache servers in the edge node.
And taking the URI requested in the user request and the IP lists of all cache servers in the edge node as input, calculating by the cache servers according to a consistent hash algorithm to obtain a target IP, and forwarding the user request to the cache server corresponding to the target IP.
Judging whether a cache server corresponding to the target IP caches the content file requested in the user request, and if so, returning the content file to a client corresponding to the resource request; otherwise, the cache server of the edge node sends a source returning request to the aggregation node of the aggregation layer.
And any cache server in the sink node of the sink layer acquires the URI requested in the back source request through cache processing software in the cache server and acquires IP lists of all the cache servers in the sink node. And taking the URI requested in the source returning request and the IP lists of all cache servers in the aggregation node as input, calculating by the cache servers according to a consistent hash algorithm to obtain a target IP, and forwarding the source returning request to the cache server corresponding to the target IP. And judging whether the content file requested in the source returning request is cached in a cache server corresponding to the target IP, if so, caching the content file to a cache server of an edge node sending the source returning request, and returning the requested content file to a client corresponding to the source returning request through the cache server. And if the cache server in the sink node does not find the content file requested in the source returning request through searching, continuing to send the source returning request to the source station layer. After receiving the back-source request, the source site server of the source site layer returns the content file requested in the back-source request to the cache server of the sink node according to the back-source path, caches the content file in the cache server, continues to return the content file requested in the back-source request to the cache server of the edge node, caches the content file in the cache server, and continues to return the content file requested in the back-source request to the client corresponding to the back-source request.
It can be seen that, according to the above-described embodiment, through the back-to-source process, the requested content is cached in the cache server corresponding to the target IP, and when the node of each layer in the CDN network architecture receives a content request that has been back-to-source before, the target IP can be found according to the fixed URI and IP list, and the corresponding content is found from the cache server of the target IP and directly returned to the user, without going back to the upper layer again, thereby saving the upper layer bandwidth, improving the effective throughput, reducing the access pressure of the server of the source site, and reducing the back-to-source rate.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that the acts and modules illustrated are not necessarily required to practice the invention.
The above is a description of method embodiments, and the embodiments of the present invention are further described below by way of apparatus embodiments.
As shown in fig. 3, the apparatus 300 includes:
an obtaining module 310, configured to, in response to a resource request, obtain a URI requested in the resource request and an IP list of a cache server in the CDN node. The CDN node is an edge node or a sink node. The resource request is a user request sent by a client to a cache server in an edge node, a source returning request sent by the cache server in the edge node to a cache server in a sink node or a source returning request sent by the cache server in the sink node to a source station layer.
Further, when acquiring the IP list of the CDN node, the acquiring module 310 sends an HTTP request with an ID of the CDN node to a CDN scheduling center, receives IP list information returned by the CDN scheduling center, and updates the IP list of the cache server in the CDN node with the IP list information; the IP list information is the IP list information of all the cache servers in the CDN node where the cache server is located.
And the calculating module 320 is configured to calculate a target IP through a consistent hash algorithm according to the URI requested in the resource request and the IP list of the cache server in the CDN node, and forward the resource request to the cache server corresponding to the target IP.
The judging module 330 is configured to judge whether content requested in the resource request is cached, and if so, cache the content to the CDN node, and return the content to a lower node of the CDN node by the CDN node until a client corresponding to the resource request is returned; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
As an embodiment of the present invention, as shown in fig. 4, the apparatus 300 further includes a mapping module 340;
the mapping module 340 is configured to, when the cache server executes the consistent hashing algorithm, if the added and/or deleted IP information exists in the IP list, remap the added and/or deleted IP information by the cache server.
As an embodiment of the present invention, as shown in fig. 4, the apparatus 300 further includes a detection module 350;
the detection module 350 further includes a first detection module 351, a second detection module 352 and a third detection module 353; wherein
The first detection module 351 is configured to report a heartbeat message to a CDN scheduling center every other first time, and if the CDN scheduling center does not receive the heartbeat message of the cache server to be detected within the first time, the cache server to be detected is abnormal.
The second detection module 352 is configured to send a detection message to the cache server to be detected, and if a response message returned by the cache server to be detected is not received within a second time, the cache server to be detected is abnormal.
The third detection module 353 is configured to forward the resource request to the cache server corresponding to the target IP, and if the client corresponding to the resource request does not receive the feedback information of the cache server corresponding to the target IP within a third time, the cache server corresponding to the target IP is abnormal; wherein the feedback information comprises the content requested in the resource request and the message that the content requested in the resource request does not exist.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
As shown in fig. 5, the device includes a Central Processing Unit (CPU) that can perform various appropriate actions and processes according to computer program instructions stored in a Read Only Memory (ROM) or computer program instructions loaded from a storage unit into a Random Access Memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The CPU, ROM, and RAM are connected to each other via a bus. An input/output (I/O) interface is also connected to the bus.
A plurality of components in the device are connected to the I/O interface, including: an input unit such as a keyboard, a mouse, etc.; an output unit such as various types of displays, speakers, and the like; storage units such as magnetic disks, optical disks, and the like; and a communication unit such as a network card, modem, wireless communication transceiver, etc. The communication unit allows the device to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processing unit executes the respective methods and processes described above, for example, methods S201 to S203. For example, in some embodiments, methods S201-S203 may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device via ROM and/or the communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more of the steps of methods S201-S203 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to perform methods S201-S203 by any other suitable means (e.g., by way of firmware).
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a load programmable logic device (CPLD), and the like.
Program code for implementing the methods of the present invention may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Further, while operations are depicted in a particular order, this should be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the invention. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single implementation. Conversely, various features that are described in the context of a single implementation can also be implemented in multiple implementations separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A method for returning a source of a CDN node is characterized by comprising the following steps:
responding to a resource request by any one of a plurality of cache servers in a CDN node, and acquiring a URI requested in the resource request and an IP list of the cache servers in the CDN node;
the cache server obtains a target IP through a consistent hash algorithm according to the URI requested in the resource request and an IP list of the cache server in the CDN node, and forwards the resource request to the cache server corresponding to the target IP;
the cache server corresponding to the target IP judges whether the content requested in the resource request is cached, if so, the CDN node returns to a lower node of the CDN node until returning to the client corresponding to the resource request; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
2. The method of claim 1, wherein the CDN node is an edge node or a sink node.
3. The method of claim 1, wherein the resource request is a user request sent by a client to a cache server in an edge node, an origin returning request sent by a cache server in an edge node to a cache server in a sink node, or an origin returning request sent by a cache server in a sink node to a source station layer.
4. The method of claim 1, wherein obtaining the IP list of CDN nodes comprises:
the cache server sends an HTTP request with the ID of the CDN node to a CDN scheduling center, receives IP list information returned by the CDN scheduling center, and updates an IP list of the cache server in the CDN node according to the IP list information; the IP list information is the IP list information of all the cache servers in the CDN node where the cache server is located.
5. The method of claim 1, further comprising:
detecting a cache server, if the cache server is abnormal, forbidding the cache server and deleting the IP information of the abnormal cache server from an IP list; and if the cache server in the forbidden state is recovered to be normal, the cache server is forbidden, and the IP information of the forbidden cache server is added in an IP list of the cache server of the CDN node where the cache server is located.
6. The method of claim 5, wherein probing the cache server comprises:
reporting a heartbeat message to a CDN (content delivery network) scheduling center every other first time by a cache server to be detected, wherein if the CDN scheduling center does not receive the heartbeat message of the cache server to be detected in the first time, the cache server to be detected is abnormal; and/or
The CDN dispatching center sends a detection message to a cache server to be detected, and if a response message returned by the cache server to be detected is not received within a second time, the cache server to be detected is abnormal; and/or
The cache server receiving the resource request forwards the resource request to a cache server corresponding to the target IP, and if the client corresponding to the resource request does not receive the feedback information of the cache server corresponding to the target IP within a third time, the cache server corresponding to the target IP is abnormal; wherein the feedback information comprises the content requested in the resource request and the message that the content requested in the resource request does not exist.
7. The method according to claim 4 or 5, wherein when the cache server executes the consistent hashing algorithm, if there is added and/or deleted IP information in the IP list, the cache server remaps the added and/or deleted IP information.
8. A back source device of a CDN node is characterized by comprising:
the system comprises an acquisition module, a cache module and a processing module, wherein the acquisition module is arranged in any cache server in a plurality of cache servers contained in a CDN node and used for responding to a resource request and acquiring a URI requested in the resource request and an IP list of the cache servers in the CDN node;
the computing module is arranged in the cache server and used for computing a target IP through a consistent hash algorithm according to the URI requested in the resource request and the IP list of the cache server in the CDN node, and forwarding the resource request to the cache server corresponding to the target IP;
the judging module is arranged in a cache server corresponding to the target IP and used for judging whether the content requested in the resource request is cached or not, if so, the CDN node returns to a lower-layer node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a source returning request to an upper node of the CDN node.
9. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program, wherein the processor, when executing the program, implements the method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202110612873.8A 2021-06-02 2021-06-02 Method, device and equipment for returning source of CDN node and storage medium Active CN113472852B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110612873.8A CN113472852B (en) 2021-06-02 2021-06-02 Method, device and equipment for returning source of CDN node and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110612873.8A CN113472852B (en) 2021-06-02 2021-06-02 Method, device and equipment for returning source of CDN node and storage medium

Publications (2)

Publication Number Publication Date
CN113472852A true CN113472852A (en) 2021-10-01
CN113472852B CN113472852B (en) 2023-07-25

Family

ID=77872160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110612873.8A Active CN113472852B (en) 2021-06-02 2021-06-02 Method, device and equipment for returning source of CDN node and storage medium

Country Status (1)

Country Link
CN (1) CN113472852B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992760A (en) * 2021-10-22 2022-01-28 北京百度网讯科技有限公司 Back source flow scheduling method, device, equipment and storage medium
CN114006943A (en) * 2022-01-04 2022-02-01 北京金山云网络技术有限公司 Data source returning method, device, equipment and storage medium
CN114338726A (en) * 2021-12-30 2022-04-12 江苏云工场信息技术有限公司 Content pushing method and device based on CDN node
CN114338686A (en) * 2021-12-21 2022-04-12 江苏云工场信息技术有限公司 Source returning method and device of CDN node server
CN114449044A (en) * 2021-12-27 2022-05-06 天翼云科技有限公司 CDN cache verification method and device and electronic equipment
CN114501073A (en) * 2022-02-16 2022-05-13 上海哔哩哔哩科技有限公司 Live broadcast source returning method and device
CN114615237A (en) * 2022-03-22 2022-06-10 阿里巴巴(中国)有限公司 Streaming media communication method, system, device and storage medium
WO2024174694A1 (en) * 2023-02-24 2024-08-29 天翼云科技有限公司 Cache node scheduling method and apparatus, and device and medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198043A1 (en) * 2011-01-12 2012-08-02 Level 3 Communications, Llc Customized domain names in a content delivery network (cdn)
WO2017012475A1 (en) * 2015-07-17 2017-01-26 阿里巴巴集团控股有限公司 Data acquisition method and device
CN109413163A (en) * 2018-10-09 2019-03-01 网宿科技股份有限公司 A kind of method and device of service access
CN109542613A (en) * 2017-09-22 2019-03-29 中兴通讯股份有限公司 Distribution method, device and the storage medium of service dispatch in a kind of CDN node
CN112153160A (en) * 2020-09-30 2020-12-29 北京金山云网络技术有限公司 Access request processing method and device and electronic equipment
CN112422702A (en) * 2020-08-10 2021-02-26 上海哔哩哔哩科技有限公司 CDN back-to-source method, system and computer equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120198043A1 (en) * 2011-01-12 2012-08-02 Level 3 Communications, Llc Customized domain names in a content delivery network (cdn)
WO2017012475A1 (en) * 2015-07-17 2017-01-26 阿里巴巴集团控股有限公司 Data acquisition method and device
CN109542613A (en) * 2017-09-22 2019-03-29 中兴通讯股份有限公司 Distribution method, device and the storage medium of service dispatch in a kind of CDN node
CN109413163A (en) * 2018-10-09 2019-03-01 网宿科技股份有限公司 A kind of method and device of service access
CN112422702A (en) * 2020-08-10 2021-02-26 上海哔哩哔哩科技有限公司 CDN back-to-source method, system and computer equipment
CN112153160A (en) * 2020-09-30 2020-12-29 北京金山云网络技术有限公司 Access request processing method and device and electronic equipment

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992760B (en) * 2021-10-22 2024-03-01 北京百度网讯科技有限公司 Method, device, equipment and storage medium for scheduling back source traffic
CN113992760A (en) * 2021-10-22 2022-01-28 北京百度网讯科技有限公司 Back source flow scheduling method, device, equipment and storage medium
CN114338686A (en) * 2021-12-21 2022-04-12 江苏云工场信息技术有限公司 Source returning method and device of CDN node server
WO2023115592A1 (en) * 2021-12-21 2023-06-29 江苏云工场信息技术有限公司 Back-to-source method and apparatus of cdn node server
CN114449044B (en) * 2021-12-27 2023-10-10 天翼云科技有限公司 CDN cache verification method and device and electronic equipment
CN114449044A (en) * 2021-12-27 2022-05-06 天翼云科技有限公司 CDN cache verification method and device and electronic equipment
CN114338726A (en) * 2021-12-30 2022-04-12 江苏云工场信息技术有限公司 Content pushing method and device based on CDN node
CN114006943A (en) * 2022-01-04 2022-02-01 北京金山云网络技术有限公司 Data source returning method, device, equipment and storage medium
CN114501073B (en) * 2022-02-16 2023-10-20 上海哔哩哔哩科技有限公司 Live broadcast source returning method and device
CN114501073A (en) * 2022-02-16 2022-05-13 上海哔哩哔哩科技有限公司 Live broadcast source returning method and device
CN114615237A (en) * 2022-03-22 2022-06-10 阿里巴巴(中国)有限公司 Streaming media communication method, system, device and storage medium
CN114615237B (en) * 2022-03-22 2024-03-29 阿里巴巴(中国)有限公司 Streaming media communication method, system, equipment and storage medium
WO2024174694A1 (en) * 2023-02-24 2024-08-29 天翼云科技有限公司 Cache node scheduling method and apparatus, and device and medium

Also Published As

Publication number Publication date
CN113472852B (en) 2023-07-25

Similar Documents

Publication Publication Date Title
CN113472852B (en) Method, device and equipment for returning source of CDN node and storage medium
US11811657B2 (en) Updating routing information based on client location
US10404790B2 (en) HTTP scheduling system and method of content delivery network
US9172632B2 (en) Optimized content distribution based on metrics derived from the end user
CN112153160A (en) Access request processing method and device and electronic equipment
EP2356577B1 (en) Request routing and updating routing information utilizing client location information
CN107528862B (en) Domain name resolution method and device
CN107317879B (en) A kind of distribution method and system of user's request
CN108737470B (en) Access request source returning method and device
CN109660607A (en) A kind of service request distribution method, method of reseptance, device and server cluster
CN104092650B (en) A kind of method and apparatus for distributing service request
US20120054266A1 (en) Optimized Content Distribution Based on Metrics Derived from the End User
EP3108644A1 (en) Content delivery network architecture with edge proxy
US11044205B2 (en) Bandwidth adjustment method and apparatus, electronic device, and computer-readable storage medium
CN104980478A (en) Cache sharing method, devices and system in content delivery network
CN109873855B (en) Resource acquisition method and system based on block chain network
CN110222034A (en) A kind of database maintenance method and device
US11042357B2 (en) Server and method for ranking data sources
US20150095496A1 (en) System, method and medium for information processing
CN110460487A (en) The monitoring method and system of service node, service node
CN114006764B (en) Deployment method and device of safety network element based on super fusion system
US20230103201A1 (en) Method and apparatus for content caching of contents store in ndn
WO2022237670A1 (en) 5g-based edge node scheduling method and apparatus, and medium and device
US20210211381A1 (en) Communication method and related device
CN109672900B (en) Method and device for generating hot content list

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information

Inventor after: Sun Guoliang

Inventor after: Yu Qianjiang

Inventor after: Ren Shuzhao

Inventor before: Sun Guoliang

Inventor before: Yu Qianjiang

Inventor before: Wang Hongguang

CB03 Change of inventor or designer information
TA01 Transfer of patent application right

Effective date of registration: 20230511

Address after: Room 07, Room 42301, 23rd Floor (23), Building 4, Yard 7, Qingnian Road, Chaoyang District, Beijing, 100123

Applicant after: LeTV Cloud Network Technology (Beijing) Co.,Ltd.

Address before: 100025 1508, 12 / F, building 3, 105 yaojiayuan Road, Chaoyang District, Beijing

Applicant before: LECLOUD COMPUTING Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant