CN113472852B - Method, device and equipment for returning source of CDN node and storage medium - Google Patents

Method, device and equipment for returning source of CDN node and storage medium Download PDF

Info

Publication number
CN113472852B
CN113472852B CN202110612873.8A CN202110612873A CN113472852B CN 113472852 B CN113472852 B CN 113472852B CN 202110612873 A CN202110612873 A CN 202110612873A CN 113472852 B CN113472852 B CN 113472852B
Authority
CN
China
Prior art keywords
cache server
node
cdn
resource request
request
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110612873.8A
Other languages
Chinese (zh)
Other versions
CN113472852A (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
Letv Cloud Network Technology Beijing 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 Letv Cloud Network Technology Beijing Co ltd filed Critical Letv Cloud Network Technology Beijing 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

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 source returning of CDN nodes. Responding to a resource request, and acquiring a URI (uniform resource identifier) requested in the resource request and an IP (Internet protocol) list of a cache server in a CDN node; a target IP is obtained through calculation of a consistent hash algorithm, and a resource request is forwarded 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 request back to an upper node of the CDN node. In this way, each CDN node can only return to the source for the user request of the same content, so that the source return rate is reduced, the upper bandwidth is saved, the effective throughput is improved, the access pressure of the source site server is reduced, and the user experience is improved.

Description

Method, device and equipment for returning source of CDN node and storage medium
Technical Field
The embodiment of the invention relates to the technical field of back source, in particular to a method, a device and equipment for back source of CDN nodes.
Background
The full name of CDN is Content Delivery Network, the content delivery network. The aim is to add a new network architecture in the existing Internet to release the content of the website to the network 'edge' closest to the user, so that the user can obtain the required content nearby, solve the congestion condition of the Internet network and improve the speed of the user accessing the website.
When a user requests a content, the CDN system directs the user to an edge node closest to it, which is responsible for handling the user's request, through a scheduling, i.e., global load balancing (Global Server Load Balance, GSLB) policy. 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 initiate a source return request to other nodes or a source station server, acquire the content requested by the user according to the source return path and then forward the content to the user, and the processing of the request is completed.
However, the request of the user randomly arrives at any cache server in a CDN node, and under the condition that no corresponding cache content exists, a source returning process is executed, the content requested by the user is cached in the cache server, and if the request of the user for the same content arrives at other cache servers in the CDN node at the next time randomly, because the other cache servers in the CDN node do not have corresponding cache content, a source returning process is still needed to be executed at the moment; this results in multiple source returns to the upper layer for the same content, increasing the egress bandwidth of the upper layer and reducing the effective throughput.
Disclosure of Invention
According to the embodiment of the invention, a source-returning scheme of CDN nodes is provided.
In a first aspect of the present invention, a method for back-sourcing CDN nodes is provided. The method comprises the following steps:
any one cache server of a plurality of cache servers in a CDN node responds to a resource request, and a URI (uniform resource identifier) requested in the resource request and an IP (Internet protocol) list of the cache server in the CDN node are obtained;
the cache server calculates 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 a client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back to an upper node of the CDN node.
Further, the CDN node is an edge node or an aggregation node.
Further, the resource request is a user request sent by the client to a cache server in the edge node, a source return request sent by the cache server in the edge node to a cache server in the sink node, or a source return request sent by the cache server in the sink node to the source station layer.
Further, obtaining the IP list of the CDN node includes:
the cache server sends an HTTP request with the ID of the CDN node to a CDN dispatching center, receives IP list information returned by the CDN dispatching center, and updates an IP list of the cache server in the CDN node by the IP list information; the IP list information is the IP list information of all cache servers in CDN nodes where the cache servers are located.
Further, the method further comprises the following steps:
detecting a cache server, 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 disabled state is recovered to be normal, the cache server is disabled, and the IP information of the disabled cache server is added in the IP list of the cache server of the CDN node where the cache server is located.
Further, the detecting the cache server includes:
reporting a heartbeat message to a CDN dispatching center by a cache server to be detected at intervals of a first time, and if the heartbeat message of the cache server to be detected is not received by the CDN dispatching center within the first time, the cache server to be detected is abnormal; and/or
The CDN dispatching center sends a detection message to a to-be-detected cache server, and if a response message returned by the to-be-detected cache server is not received within a second time, the to-be-detected cache server is abnormal; and/or
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 in a third time, the cache server corresponding to the target IP is abnormal; wherein the feedback information includes the content requested in the resource request, and the absence of the message requesting the content in the resource request.
Further, when the cache server executes the consistent hashing algorithm, if 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 source-back device for a CDN node is provided. The device comprises:
the acquisition module is arranged at any one cache server of a plurality of cache servers contained in the CDN node and is used for responding to the resource request and acquiring the URI requested in the resource request and the IP list of the cache server in the CDN node;
the calculation module is arranged in the cache server and used for calculating 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 the cache server corresponding to the target IP and is used for judging whether the content requested in the resource request is cached or not, if so, the CDN node returns to the lower node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back 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 and a processor, the memory having stored thereon a computer program, the processor implementing the method as described above when executing the program.
In a fourth aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor implements a method as according to the first aspect of the invention.
It should be understood that the description in this summary is not intended to limit the critical or essential features of the embodiments of the invention, nor is it intended to limit the scope of the invention. Other features of the present invention will become apparent from the description that follows.
The invention can enable each CDN node to return to the source only once aiming at the user request of the same content, thereby reducing the source return rate, saving the upper 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 embodiments of the present invention will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. In the drawings, wherein like or similar reference numerals denote like or similar elements, in which:
FIG. 1 is a schematic diagram of a source-back method of CDN nodes according to an embodiment of the present invention;
FIG. 2 shows a flow chart of a method of back source of CDN nodes according to an embodiment of the invention;
FIG. 3 shows a block diagram of a source-back device of a CDN node according to an embodiment of the present invention;
FIG. 4 shows a block diagram of a source-back device of a CDN node according to another embodiment of the present invention;
fig. 5 shows a block diagram of an exemplary electronic device capable of implementing embodiments of the invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Fig. 1 is a schematic diagram of a source-back method of a CDN node according to an embodiment of the present invention.
The CDN architecture comprises two layers, 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 a user instruction, 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 return request sent by the convergence layer and returning the content requested in the user request to a cache server of a node corresponding to the convergence layer according to the source return request. The source site layer includes a source site server.
The edge layer is in charge of receiving a user request sent by a client, randomly distributing any cache server in one edge node in the edge layer to perform cache inquiry, and sending a source request back to the convergence layer when the cache server does not inquire the content requested in the user request; the edge layer is also responsible for receiving the content file requested in the user request returned by the convergence layer and returning the content file 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; in each cache server, cache data is stored.
The aggregation layer is in charge of receiving the source return request of the edge layer, randomly distributing any cache server in one aggregation node in the aggregation layer to perform cache inquiry, and sending the source return request to the source station layer when the content requested in the source return request is not inquired in the cache server; and the convergence layer is also responsible for receiving the content file requested in the source returning request returned by the source station layer and returning the content file to the corresponding cache server of the corresponding edge node of the edge layer. The aggregation layer comprises a plurality of aggregation nodes, a plurality of cache servers are arranged in each aggregation node, and corresponding IP is distributed to each cache server; in each cache server, cache data is stored. The number of edge nodes in the edge layer is much greater than the number of sink nodes in the sink layer.
In the embodiment of the prior art, when a user requests to open a page or download a file through a client device, the user request randomly reaches any cache server in an edge node, and if the cache server caches the content file requested in the user request, the content file is directly returned to the client; if the cache server does not have the file requested in the user request, the source request is sent back to the upper layer, namely the convergence layer. The source-returning request also randomly reaches any cache server in the sink node of one sink layer, if the cache server caches the content file requested in the source-returning 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 source return request, the source return request is sent to the upper layer, namely the source station layer; and the source station layer server returns the content file requested in the source return request to the client side step by step according to the source return path.
However, in this process, since there are several cache servers in each CDN node, and the user's request only accesses one of the cache servers, if the cache server has no request for content, even if there is content requested by the user in the other cache servers of the CDN node, the request of the same content (URI is the same) needs to be returned to the upper layer, so that the request of the same content (URI is the same) will be returned to the upper layer multiple times, so that the output bandwidth of the upper layer is increased, and the effective throughput is reduced.
According to the invention, each CDN node can only return to the source for the user request of the same content, so that the upper bandwidth is saved, the effective throughput is improved, and the source return speed and efficiency are improved.
Fig. 2 shows a flowchart of a method for backsourcing CDN nodes 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 (uniform resource identifier) requested in the resource request and an IP (Internet protocol) list of the cache server 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 an aggregation node. The content router in the CDN network architecture is responsible for scheduling the user's requests to the appropriate devices (cache servers). Content routing is generally achieved through a load balancing system, load distribution of each content caching site is dynamically balanced, an optimal access site is selected for a user's request, and meanwhile 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 a cache server in the current CDN node according to the resource request, cache processing software of the cache server obtains a uniform resource identifier URI (Uniform Resource Identifier) in the resource request, and then obtains IP lists of all cache servers of the current CDN node.
As an embodiment of the present invention, obtaining an IP list of CDN nodes includes:
the cache server sends an HTTP request with the ID of the CDN node to a CDN dispatching center, receives IP list information returned by the CDN dispatching center, and updates an IP list of the cache server in the CDN node by the IP list information; the IP list information is the IP list information of all cache servers in the CDN node where the cache server is located, as shown in table 1:
sequence number Name of the name 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.
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 cache server in an edge node in the edge layer, the 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. The method comprises the steps that IP lists of all cache servers in an aggregation node are obtained, the cache servers send HTTP requests with the ID of the located edge node to a CDN dispatching center, IP list information returned by the CDN dispatching center is received, and the IP lists of the cache servers in the edge node are updated according to the IP list information.
When a cache server in an edge node in an edge layer sends a source return request to a convergence layer, the source return request reaches any cache server in a certain convergence node in the convergence layer, a URI (uniform resource identifier) requested in the source return request is obtained through cache processing software in the cache server, and an IP (Internet protocol) list of all the cache servers in the convergence node is obtained. The method comprises the steps that IP lists of all cache servers in an aggregation node are obtained, the cache servers send HTTP requests with the ID of the aggregation node to a CDN dispatching center, IP list information returned by the CDN dispatching center is received, and the IP lists of the cache servers in the aggregation node are updated through the IP list information.
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 formed by the IP 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 used as the input of a consistent hash algorithm, namely: ip=ip=con_hash (URI), and one fixed IP in the current CDN node is obtained, that is, the target IP. And forwarding the resource request to a cache server corresponding to the target IP.
Since the consistent hashing algorithm has consistency, the IP list in a node is fixed in most cases, so in most cases, a URI will fix a corresponding IP. The majority of cases are cases where no additions and/or deletions occur in the IP list. Because a fixed target IP can be calculated through the fixed URI and the IP list, a source returning request can be carried out to an upper layer based on a cache server corresponding to the target IP, and the content requested in the returned source returning request is cached to the cache of the cache server corresponding to the target IP.
As an embodiment of the present invention, when a process in the cache server executes the consistent hashing algorithm, if added and/or deleted IP information exists in the IP list, the cache server remaps the added and/or deleted IP information. The remapping is such that only the changed IP information is mapped and global remapping is not required. The mapping refers to associating the URI requested in the resource request with information in the IP list. After the IP list changes, the IP information corresponding to the URI requested in the resource request is also rebalanced. Because the consistent hash algorithm does not need global remapping, the method can also realize less source return under the condition that the 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 the lower node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back to an upper node of the CDN node.
When the CDN node sends a source return request to an upper node of the CDN node, the source return request is dispatched to appropriate equipment (cache server) in the upper node of the CDN node through a content router in a CDN network architecture. Content routing is generally achieved through a load balancing system, load distribution of each content caching site is dynamically balanced, an optimal access site is selected for a user's request, and meanwhile usability of a website is improved.
As an embodiment of the present invention, after sending a source request back to an upper node of the CDN node, the CDN node waits for receiving a content requested in the resource request returned by the upper node; 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, if the cache server is abnormal, disabling the cache server and deleting the IP information of the abnormal cache server from the IP list; and if the cache server in the disabled state is recovered to be normal, the cache server is disabled, and the IP information of the disabled cache server is added in the IP list of the cache server of the CDN node where the cache server is located.
In an embodiment of the present invention, the detection of the cache server may be implemented in one or more of the following three ways:
mode one:
and reporting heartbeat messages to a CDN dispatching center every first time by the to-be-detected cache server, if the heartbeat messages of the to-be-detected cache server are not received by the CDN dispatching center within the first time, the to-be-detected cache server is abnormal, service on the IP is unavailable, each cache server configured in the 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 forbidden cache server is added in the IP list of the cache server of the CDN node where the cache server is located. The first time is the time between two adjacent heartbeat messages and can be set manually.
Mode two:
the CDN dispatching center sends a detection message to a to-be-detected cache server, and if a response message returned by the to-be-detected cache server is not received within a second time, the to-be-detected cache server is abnormal; for example, the CDN dispatch center sends a probe HTTP request to each cache server in the node, and the cache server that receives the probe HTTP request normally responds to the HTTP200 status code, and the CDN dispatch center also receives the status code within a certain time, that is, indicates a successful response. If a response of a certain cache server is not received within a specified second time or the response is received within the specified second time but the response is not an HTTP200 status code, namely the response fails, the cache server is considered to be abnormal, an abnormal cache server losing the heartbeat is forbidden, and the IP information of the abnormal cache server is deleted from an IP list. The second time is the longest time from sending the detection message from the CDN scheduling center to receiving the status code, and may be manually specified.
And when the cache server responds to the HTTP detection request sent by the CDN dispatching 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 the IP list of the cache server of the CDN node where the cache server is located.
Mode three:
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 in 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 manually. The feedback information includes the content requested in the resource request, and the absence of a message requesting the content in the resource request. Whether the cache server in the CDN system searches 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 judged by feeding back the information or not in a specified 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 judging efficiency and accuracy are improved.
The following describes the method of S201 to S203 by two specific examples.
Example 1:
in this embodiment 1, the resource request is a user request sent by the user through the client to open a page or download a file.
When a user requests to open a page or download a file through a client device, 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, the cache server obtains the URI requested in the user request through cache processing software in the cache server, and obtains IP lists of all the cache servers in the edge node.
And taking the URI requested in the user request and the IP list of all cache servers in the edge node as inputs, calculating a target IP by the cache servers according to a consistent hash algorithm, and forwarding the user request to the cache server corresponding to the target IP.
Judging whether a content file requested in the user request is cached in a cache server corresponding to the target IP, 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 request back to the sink node of the sink layer.
Any cache server in the sink node of the sink layer obtains the URI requested in the retrieval source request through cache processing software in the cache server, and obtains the IP list of all the cache servers in the sink node. And taking the URI requested in the source return request and the IP list of all cache servers in the sink node as inputs, calculating by the cache servers according to a consistent hash algorithm to obtain a target IP, and forwarding the source return request to the cache server corresponding to the target IP. Judging whether the cache server corresponding to the target IP caches the content file requested in the back source request, if so, caching the content file to the cache server of the edge node sending the back source request, and returning the requested content file to the client corresponding to the back source request through the cache server. And if the cache server in the sink node is searched and the content file requested in the source returning request is not found, continuing to send the source returning request to the source station layer. After the source station server of the source station layer receives the source return request, the content file requested in the source return request is returned to the cache server of the sink node according to the source return path and is cached in the cache server, the content file requested in the source return request is continuously returned to the cache server of the edge node and is cached in the cache server, and the content file requested in the source return request is continuously returned to the client corresponding to the source return request.
It can be seen that, according to the above embodiment, through the source return 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 the content request that has been previously returned, the target IP can be found according to the fixed URI and the IP list, and the corresponding content is found from the cache server of the target IP, and is directly returned to the user, without returning 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 station, and reducing the source return rate.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are alternative embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
The above description of the method embodiments further describes the solution of the present invention by means of device embodiments.
As shown in fig. 3, the apparatus 300 includes:
and the acquiring module 310 is configured to respond to the resource request, and acquire the URI requested in the resource request and the IP list of the cache server in the CDN node. The CDN node is an edge node or an aggregation 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, the obtaining module 310 sends an HTTP request with an ID of the CDN node to a CDN dispatch center when obtaining the IP list of the CDN node, receives IP list information returned by the CDN dispatch center, and updates an IP list of a cache server in the CDN node with the IP list information; the IP list information is the IP list information of all cache servers in CDN nodes where the cache servers are located.
And the calculating module 320 is configured to calculate, according to the URI requested in the resource request and the IP list of the cache server in the CDN node, a target IP through a consistent hash algorithm, and forward the resource request to the cache server corresponding to the target IP.
A judging module 330, configured to judge whether a content requested in the resource request is cached, if yes, cache the content to the CDN node, and return the content from the CDN node to a lower node of the CDN node until a client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back 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, remap the added and/or deleted IP information if the added and/or deleted IP information exists in the IP list.
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 method comprises the steps of
The first detection module 351 is configured to report a heartbeat message to a CDN scheduling center at intervals of a 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 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.
A third detection module 353, configured to forward the resource request to a cache server corresponding to the target IP, and if the client corresponding to the resource request does not receive 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 includes the content requested in the resource request, and the absence of the message requesting the content in the resource request.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the described modules may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again.
As shown in fig. 5, the apparatus includes a Central Processing Unit (CPU) that can perform various suitable 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 by a bus. An input/output (I/O) interface is also connected to the bus.
A plurality of components in a device are connected to an I/O interface, comprising: an input unit such as a keyboard, a mouse, etc.; an output unit such as various types of displays, speakers, and the like; a storage unit such as a magnetic disk, an optical disk, or the like; and communication units such as network cards, modems, wireless communication transceivers, and the like. 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 performs the respective methods and processes described above, for example, the methods S201 to S203. For example, in some embodiments, methods S201-S203 may be implemented as a computer software program tangibly embodied on 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 the ROM and/or the communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the methods S201 to 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 means of firmware).
The functions described above herein 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), etc.
Program code for carrying out methods of the present invention may be written in any combination of one or more programming languages. These program code 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 code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. 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. The 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.
Moreover, although 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. In 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 limiting 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 example forms of implementing the claims.

Claims (10)

1. The source returning method of the CDN node is characterized by comprising the following steps:
any one cache server of a plurality of cache servers in a CDN node responds to a resource request, and a URI (uniform resource identifier) requested in the resource request and an IP (Internet protocol) list of the cache server in the CDN node are obtained;
the cache server calculates 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 a client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back to an upper node of the CDN node.
2. The method of claim 1, wherein the CDN node is an edge node or an aggregation 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, a back-source request sent by a cache server in an edge node to a cache server in a sink node, or a back-source request sent by a cache server in a sink node to a source 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 dispatching center, receives IP list information returned by the CDN dispatching center, and updates an IP list of the cache server in the CDN node by the IP list information; the IP list information is the IP list information of all cache servers in CDN nodes where the cache servers are located.
5. The method as recited in claim 1, further comprising:
detecting a cache server, 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 disabled state is recovered to be normal, the cache server is disabled, and the IP information of the disabled cache server is added in the IP list of the cache server of the CDN node where the cache server is located.
6. The method of claim 5, wherein the probing the cache server comprises:
reporting a heartbeat message to a CDN dispatching center by a cache server to be detected at intervals of a first time, and if the heartbeat message of the cache server to be detected is not received by the CDN dispatching center within the first time, the cache server to be detected is abnormal; and/or
The CDN dispatching center sends a detection message to a to-be-detected cache server, and if a response message returned by the to-be-detected cache server is not received within a second time, the to-be-detected cache server is abnormal; and/or
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 in a third time, the cache server corresponding to the target IP is abnormal; wherein the feedback information includes the content requested in the resource request, and the absence of the message requesting the content in the resource request.
7. The method according to claim 4 or 5, wherein when the cache server performs the consistent hashing algorithm, if added and/or deleted IP information is present in the IP list, the cache server remaps the added and/or deleted IP information.
8. The source returning device of the CDN node is characterized by comprising the following components:
the acquisition module is arranged at any one cache server of a plurality of cache servers contained in the CDN node and is used for responding to the resource request and acquiring the URI requested in the resource request and the IP list of the cache server in the CDN node;
the calculation module is arranged in the cache server and used for calculating 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 the cache server corresponding to the target IP and is used for judging whether the content requested in the resource request is cached or not, if so, the CDN node returns to the lower node of the CDN node until the client corresponding to the resource request is returned; otherwise, the CDN node sends a source request back 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, characterized in that 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, characterized in that the program, when being executed by a processor, implements the method according to any one of claims 1-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 CN113472852A (en) 2021-10-01
CN113472852B true 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)

Families Citing this family (7)

* 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
CN114338686A (en) * 2021-12-21 2022-04-12 江苏云工场信息技术有限公司 Source returning method and device of CDN node server
CN114449044B (en) * 2021-12-27 2023-10-10 天翼云科技有限公司 CDN cache verification method and device and electronic equipment
CN114338726B (en) * 2021-12-30 2022-08-02 江苏云工场信息技术有限公司 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
CN114615237B (en) * 2022-03-22 2024-03-29 阿里巴巴(中国)有限公司 Streaming media communication method, system, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012097030A1 (en) * 2011-01-12 2012-07-19 Level 3 Communications, Llc Customized domain names in a content delivery network (cdn)

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN113472852A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN113472852B (en) Method, device and equipment for returning source of CDN node and storage medium
US10778801B2 (en) Content delivery network architecture with edge proxy
US11811657B2 (en) Updating routing information based on client location
CN107317879B (en) A kind of distribution method and system of user's request
CN109660607B (en) Service request distribution method, service request receiving method, service request distribution device, service request receiving device and server cluster
EP2356577B1 (en) Request routing and updating routing information utilizing client location information
CN111464649B (en) Access request source returning method and device
CN112153160A (en) Access request processing method and device and electronic equipment
CN104980478A (en) Cache sharing method, devices and system in content delivery network
WO2021253889A1 (en) Load balancing method and apparatus, proxy device, cache device and serving node
CN107707631B (en) Data acquisition method and device
CN109873855B (en) Resource acquisition method and system based on block chain network
CN112104752A (en) Hot spot balancing method and system for cache nodes of content distribution network
US20150156259A1 (en) Load balancing apparatus, information processing system, method and medium
US20150095496A1 (en) System, method and medium for information processing
CN105025042B (en) A kind of method and system of determining data information, proxy server
CN110581873B (en) Cross-cluster redirection method and monitoring server
CN110247847B (en) Method and device for back source routing between nodes
CN112968975B (en) Service request processing method and device
CN109088913A (en) The method and load-balanced server of request data
US20150100685A1 (en) Apparatus and method for supporting intra-cloud and inter-cloud expansion of service
US20210211381A1 (en) Communication method and related device
WO2022237670A1 (en) 5g-based edge node scheduling method and apparatus, and medium and device
CN116668446A (en) Cluster node shunting method and device, computing equipment and storage medium
CN117560421A (en) Local caching method and system based on consistency hash

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