CN112513830A - Back-source method and related device in content distribution network - Google Patents
Back-source method and related device in content distribution network Download PDFInfo
- Publication number
- CN112513830A CN112513830A CN201980008635.7A CN201980008635A CN112513830A CN 112513830 A CN112513830 A CN 112513830A CN 201980008635 A CN201980008635 A CN 201980008635A CN 112513830 A CN112513830 A CN 112513830A
- Authority
- CN
- China
- Prior art keywords
- resource
- url
- refreshed
- cache node
- cache
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the invention discloses a source returning method and a related device in a content distribution network, wherein the method comprises the following steps: the edge cache node receives a cache refreshing request sent by the control platform, the cache refreshing request carries a Uniform Resource Locator (URL) of the resource to be refreshed, the edge cache node sends a source returning request to the central cache node, and the source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed. The condition that the center cache node returns the old resource to the edge cache node can be avoided.
Description
The present application relates to the field of content distribution networks, and in particular, to a method and a related apparatus for returning to a source in a content distribution network.
The Content Delivery Network (CDN) includes a plurality of cache nodes, where the plurality of cache nodes includes a plurality of edge cache nodes and at least one central cache node, and the edge cache nodes obtain resources of a source station through the central cache node. When accessing a source station, a user can obtain required contents from edge cache nodes nearby by depending on the edge cache nodes deployed in various places, so that network congestion is reduced, and the access response speed and the hit rate of the user are improved.
After the resource of the source station is updated, the edge cache node and the central cache node of the CDN need to perform corresponding resource update. In the prior art, an edge cache node sends a source return request to a central cache node, and acquires an updated resource from the central cache node. If the central cache node stores the updated resource, the updated resource is directly returned to the edge cache node, and if the resource cached by the central cache node is an old resource before the resource is updated by the source station, the central cache node may return the old resource to the edge cache node, so that the client cannot acquire the updated resource from the edge cache node, and the user experience is poor.
Disclosure of Invention
In order to solve the problems in the prior art, embodiments of the present invention provide a method and a related apparatus for returning back a source in a content distribution network, which can avoid a situation where a central cache node returns an old resource to an edge cache node.
In a first aspect, an embodiment of the present invention provides a method for returning to a source in a content distribution network, where the method includes the following steps: the edge cache node receives a cache refreshing request sent by the control platform, the cache refreshing request carries a Uniform Resource Locator (URL) of the resource to be refreshed, the edge cache node sends a source returning request to the central cache node, and the source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed.
The back source request carries the refreshing time of the resource to be refreshed and the URL of the resource to be refreshed, and after the central cache node receives the back source request, under the condition that the URL of the resource to be refreshed hits the cache, whether the cached resource to be refreshed is an old resource before the resource is updated by the source station is determined according to the refreshing time of the resource to be refreshed, so that the condition that the central cache node directly sends the old resource to the edge cache node under the condition that the URL of the resource to be refreshed hits the cache can be avoided.
Optionally, the refresh time is carried in the cache refresh request, and the refresh time is set by the control platform.
Optionally, the control platform takes the time point when the user triggers the refresh command for the URL of the resource to be refreshed at the control platform as the refresh time of the resource to be refreshed.
The refreshing time is uniformly set by the control platform, and the edge cache node and the central cache node only need to judge according to the received refreshing time, so that the processing flow is simpler.
Optionally, the refresh time is a time point at which the edge cache node receives the cache refresh request.
Compared with the control platform which sets the refresh time, the time point of the edge cache node receiving the cache refresh request is used as the refresh time, the refresh time does not need to be sent to the edge cache node by the control platform, so the bandwidth can be saved, meanwhile, the refresh time set by the control platform needs to be transmitted by a network, so the time point of the edge cache node receiving the cache refresh request is later than the refresh time set by the control platform, and the refresh time of the resource to be refreshed at the edge cache node can be accurately reflected.
Optionally, before the edge cache node sends the back-source request to the central cache node, the back-source method in the content distribution network further includes the following steps: the edge cache node receives a first resource access request sent by the client, and correspondingly, the edge cache node sends a back-source request to the central cache node in response to the first resource access request.
In the CDN, charging is performed every time when returning to the source, so that a specific edge cache node sends a source return request after receiving a resource access request sent by a client, and all edge cache nodes do not need to send source return requests, which can reduce the number of times of returning to the source and save cost.
Optionally, the first resource access request carries a URL of a resource to be accessed, and the edge cache node sends a source return request to the central cache node in response to the resource access request, which specifically includes the following steps: and the edge cache node sends a source returning request to the central cache node under the condition that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed does not hit the cache.
The method comprises the steps that the edge cache node sends a source returning request carrying the URL of the resource to be refreshed and refreshing time to the central cache node only when the URL of the resource to be accessed is determined to be matched with the URL of the resource to be refreshed and the URL of the resource to be accessed does not hit the cache, so that the central cache node can judge whether to return the source to a source station node or not according to the refreshing time after the edge cache node obtains the cache refreshing request, and the condition that old resources are sent to the edge cache node can be avoided.
Optionally, the resource access request carries a URL of a resource to be accessed, and the edge cache node sends a source return request to the central cache node in response to the resource access request, further including the following steps: and the edge cache node sends a source returning request to the central cache node under the condition that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits the cache and the refreshing time is later than the cache time, wherein the cache time is the time point when the edge cache node caches the resource to be accessed.
The method comprises the steps that the edge cache node sends a source returning request carrying the URL of the resource to be refreshed and refreshing time to the central cache node under the condition that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits a cache and the refreshing time is later than the caching time, and therefore the central cache node can judge whether to return the source to a source station node according to the refreshing time after the edge cache node obtains the cache refreshing request, and the condition that old resources are sent to the edge cache node can be avoided.
Optionally, the edge cache node is provided with a refresh table, and after the edge cache node receives a cache refresh request sent by the control platform, the method further includes the following steps: and the edge cache node records the URL and the refreshing time of the resource to be refreshed in the refreshing table.
The URL and the refreshing time of the resource to be refreshed are recorded through the refreshing table, and the edge cache node can know whether the edge cache node receives the cache refreshing request sent by the control platform only by inquiring whether the refreshing table records the URL of the resource to be refreshed, so that the processing speed can be effectively improved.
Optionally, after the refresh table records the URL of the resource to be refreshed and the refresh time, the method further includes: and deleting the URL of the resource to be refreshed and the refreshing time recorded in the refreshing table by the edge cache node after the preset time.
The storage space and the memory resource of the edge cache node can be saved by the timing deletion mechanism because the refresh table occupies the storage space and the memory.
Optionally, after the edge cache node deletes the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time, the method further includes: the edge cache node receives a second resource access request sent by the client, the second resource access request carries the URL of the resource to be accessed, the edge cache node sends resource access request response information to the client under the condition that the URL of the resource to be accessed is determined not to be in a refresh list and the URL of the resource to be accessed hits the cache, and the resource access request response information carries the resource to be accessed.
Since the URL of the resource to be refreshed is not recorded in the refresh table, the edge cache node has not received the cache refresh request for the URL before determining, and at this time, the resource to be accessed may be directly returned to the client.
By deleting the URL and the refreshing time of the resource to be refreshed recorded in the refreshing table after the preset time, the refreshing record of the resource to be refreshed can be ensured to be deleted in time after the resource to be refreshed is refreshed in the CDN whole network, so that the next round of cache refreshing request aiming at the resource to be refreshed is prevented from being influenced.
Optionally, the edge cache node determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed when determining that the URL of the resource to be accessed is the same as the URL of the resource to be refreshed, or when determining that the URL of the resource to be refreshed is a prefix of the URL of the resource to be accessed.
In a second aspect, an embodiment of the present invention provides a back-source method in a content distribution network, including the following steps: the central cache node receives a first source returning request sent by the edge cache node, the first source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed, the central cache node compares the refreshing time with the caching time of the resource to be refreshed under the condition that the URL of the resource to be refreshed hits the cache, and sends a second source returning request to the source station node under the condition that the refreshing time is determined to be later than the caching time.
The back source request carries the refreshing time of the resource to be refreshed and the URL of the resource to be refreshed, and after the central cache node receives the back source request, under the condition that the URL of the resource to be refreshed hits the cache, whether the cached resource to be refreshed is an old resource before the resource is updated by the source station is determined according to the refreshing time of the resource to be refreshed, so that the condition that the central cache node directly sends the old resource to the edge cache node under the condition that the URL of the resource to be refreshed hits the cache can be avoided.
Optionally, the refresh time is carried in a cache refresh request received by the edge cache node from the control platform, and the refresh time is set by the control platform.
Optionally, the control platform takes the time point when the user triggers the refresh command for the URL of the resource to be refreshed at the control platform as the refresh time of the resource to be refreshed.
The refreshing time is uniformly set by the control platform, and the edge cache node and the central cache node only need to judge according to the received refreshing time, so that the processing flow is simpler.
Optionally, the refresh time is a time point when the edge cache node receives the first cache refresh request sent by the control platform.
Compared with the control platform which sets the refresh time, the time point of the edge cache node receiving the cache refresh request is used as the refresh time, the refresh time does not need to be sent to the edge cache node by the control platform, so the bandwidth can be saved, meanwhile, the refresh time set by the control platform needs to be transmitted by a network, so the time point of the edge cache node receiving the cache refresh request is later than the refresh time set by the control platform, and the refresh time of the resource to be refreshed at the edge cache node can be accurately reflected.
Optionally, before the central cache node sends the second back-to-source request to the source station node, the method further includes: and the central cache node receives a second cache refreshing request sent by the control platform, wherein the second cache refreshing request carries the URL of the resource to be refreshed, and the central cache node judges that the time point of receiving the second cache refreshing request is later than the cache time.
And the central cache node respectively confirms that the refreshing time is later than the caching time, and sends the second source returning request to the source station node under the condition that the central cache node judges that the time point of receiving the second cache refreshing request is later than the caching time, so that the source returning times can be effectively reduced.
Optionally, the central cache node is provided with a refresh table, and after the central cache node receives the first source return request sent by the edge cache node, the method further includes: and the central cache node records the URL and the refreshing time of the resource to be refreshed in the refreshing table.
The central cache node can know whether the central cache node receives the cache refreshing request sent by the control platform only by inquiring whether the refreshing table records the URL of the resource to be refreshed or not, and the processing speed can be effectively improved.
Optionally, after the central cache node records the URL of the resource to be refreshed and the refresh time in the refresh table, the method further includes: and the central cache node deletes the URL of the resource to be refreshed and the refreshing time recorded in the refreshing table after the preset time.
The storage space and the memory resource of the edge cache node can be saved by the timing deletion mechanism because the refresh table occupies the storage space and the memory.
Optionally, after the central cache node deletes the URL of the resource to be refreshed and the refresh time recorded in the refresh table after the predetermined time, the method further includes: the central cache node receives a third source returning request sent by the edge cache node, the third source returning request carries a URL of a resource to be refreshed, the central cache node sends resource access request response information to the edge cache node under the condition that the URL of the resource to be refreshed is not in a refresh table and the URL of the resource to be refreshed hits in the cache, and the resource access request response information carries the resource to be refreshed.
Since the URL of the resource to be refreshed is not recorded in the refresh table, the central cache node does not receive the cache refresh request for the URL before determining, and at this time, the resource to be accessed may be directly returned to the client.
By deleting the URL and the refreshing time of the resource to be refreshed recorded in the refreshing table after the preset time, the refreshing record of the resource to be refreshed can be ensured to be deleted in time after the resource to be refreshed is refreshed in the CDN whole network, so that the next round of cache refreshing request aiming at the resource to be refreshed is prevented from being influenced.
In a third aspect, an embodiment of the present invention provides an edge cache node, including: the system comprises a receiving module and a sending module, wherein the receiving module is used for receiving a cache refreshing request sent by a control platform, the cache refreshing request carries a Uniform Resource Locator (URL) of a resource to be refreshed, and the sending module is used for sending a source returning request to a central cache node, and the source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed.
Any implementation manner of the third aspect or the third aspect is an apparatus implementation manner corresponding to any implementation manner of the first aspect or the first aspect, and the description in any implementation manner of the first aspect or the first aspect is applicable to any implementation manner of the third aspect or the third aspect, and is not described herein again.
In a fourth aspect, an embodiment of the present invention provides a central cache node, including: the system comprises a receiving module, a judging module and a sending module, wherein the receiving module is used for receiving a first source returning request sent by an edge cache node, the first source returning request carries a URL of a resource to be refreshed and the refreshing time of the resource to be refreshed, the judging module is used for confirming that the URL of the resource to be refreshed hits a cache, and the refreshing time is later than the caching time of the resource to be refreshed, and the sending module is used for sending a second source returning request to a source station node under the condition that the judging module confirms that the URL of the resource to be refreshed hits the cache and the refreshing time is later than the caching.
Any one implementation manner of the fourth aspect or the fourth aspect is an apparatus implementation manner corresponding to any one implementation manner of the second aspect or the second aspect, and the description in any one implementation manner of the second aspect or the second aspect is applicable to any one implementation manner of the fourth aspect or the fourth aspect, and is not repeated here.
In a fifth aspect, an embodiment of the present invention provides a central cache node, including a memory and a processor, where the memory stores program instructions, and the processor executes the program instructions to perform the method in the first aspect or any implementation manner of the first aspect.
In a sixth aspect, an embodiment of the present invention provides an edge cache node, including a memory and a processor, where the memory stores program instructions, and the processor executes the program instructions to perform the method in the second aspect or any implementation manner of the second aspect.
In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to perform the first aspect or the method in any one implementation manner of the first aspect.
In an eighth aspect, the present invention provides a computer-readable storage medium, in which instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute the method in the second aspect or any one implementation manner of the second aspect.
FIG. 1 is a system block diagram of a CDN system according to an embodiment of the present invention;
FIG. 2 is a flow chart of a resource refresh method for a CDN in accordance with an embodiment of the present invention;
FIG. 3 is a schematic diagram of a CDN control interface provided by a control platform according to an embodiment of the present invention;
fig. 4 is another schematic diagram of a CDN control interface provided by the control platform according to an embodiment of the present invention;
fig. 5 is another schematic diagram of a CDN control interface provided by the control platform according to an embodiment of the present invention;
fig. 6 is a flowchart of a cache refresh method of a content distribution network according to an embodiment of the present invention;
FIG. 7 is a flow chart of a method of back sourcing in a CDN in accordance with an embodiment of the present invention;
FIG. 8 is another flow diagram of a method of back-sourcing in a CDN in accordance with an embodiment of the present invention;
fig. 9 is a data interaction diagram of a cache refresh method of a content distribution network according to an embodiment of the present invention;
fig. 10 is another data interaction diagram of a cache refresh method of a content distribution network according to an embodiment of the present invention;
fig. 11 is a schematic structural diagram of an apparatus of an edge cache node according to an embodiment of the present invention;
FIG. 12 is a schematic diagram of an apparatus structure of a central cache node according to an embodiment of the present invention;
FIG. 13 is a block diagram of another apparatus of an edge cache node according to an embodiment of the present invention;
fig. 14 is a schematic structural diagram of another apparatus of a central cache node according to an embodiment of the present invention.
First, terms related to embodiments of the present invention are explained as follows:
a source station node: the node provided with the source station may be, for example, a server providing a web browsing service, and the data cached by the cache node of the content distribution network is sourced from the source station node, where the data includes resources such as web pages, videos, audios, animations, and the like, the source station node is provided with a domain name, and a user may access the source station node or the cache node caching the resources of the source station according to the domain name, for example, the domain name set by the source station node is appdl.
Uniform resource locator URL: on the World Wide Web (WWW), each information resource has a uniform and unique address on the Web, called URL, which consists of three parts: the resource type, the host domain name for storing the resource, the resource file name, the URL and the resource of the source station have one-to-one correspondence.
The general syntax format of a URL is:
(optional with brackets [ ]):
protocol://hostname[:port]/path
description of the format:
protocol is a protocol, and is used to designate a used transmission protocol, such as HTTP protocol in the format of HTTP://, or HTTPs://, FTP protocol in the format of FTP://, MMS protocol in the format of MMS://, ed2k protocol in the format of ed2k://, where HTTP protocol is the most commonly used HTTP protocol, and HTTP protocol is also the most widely used protocol in WWW at present, and URL does not show protocol, which is denoted as HTTP protocol.
Hostname is a host name, which refers to a host name, an IP address, or a domain name of a server storing resources, and is, for example, a domain name: apdl.
The port is a port number, is an integer, is optional, and is a default port of a scheme used when omitted, and various transport protocols all have default port numbers, for example, the default port of http is 80. If the input is omitted, the default port number is used. Sometimes, for security or other reasons, the port may be redefined on the server, i.e. using a non-standard port number, in which case the port number entry cannot be omitted from the URL.
Path is a path, a string of characters separated by zero or more "/" symbols, typically used to represent a directory or file address on a host. For example TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node/1.txt, file 1.txt under directory TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node representing a host.
For example, a complete URL may be represented as follows:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/1.txt
file 1.txt under host directory TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node/representing appdl.
Alternatively, the URL may be TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node-
Host in-directory TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node ^ based on appdl
A client: the user accesses a terminal device used by the source station or CDN, such as a personal computer, a tablet computer, a mobile phone, and the like.
Content distribution network: the source station cache system comprises a plurality of cache nodes, wherein part or all resources of a source station are cached in the cache nodes, the cache nodes are specifically edge cache nodes and at least one central cache node, the edge cache nodes are distributed in different regions, a superior node of the edge cache nodes is a central cache node, and the superior node of the central cache node is the source station node.
Domain Name System (DNS) server: the client only knows the domain name of the source node, but in order to enable the client to access the resource of the source node nearby, when the client sends an access request for the domain name of the source node, the DNS server may convert the domain name of the source node into an IP address of an edge cache node closest to the client, and return the IP address to the client, and the client may directly access the edge cache node closest to the client according to the IP address to obtain the resource corresponding to the domain name to be accessed from the edge cache node.
Returning a source: as described above, when the edge cache node does not cache the resource corresponding to the URL or confirms that the cached resource is an old resource, the resource needs to be returned to the upper level central cache node, specifically, the edge cache node sends a source request back to the central cache node, the central cache node responds to the source return request, and the central cache node sends a source return response message to the edge cache node when the resource corresponding to the URL is cached, where the source return response message carries the resource corresponding to the URL, and the edge cache node caches the resource and returns the resource to the client.
Further, when the central cache node does not cache the resource corresponding to the URL or confirms that the cached resource is an old resource, the resource also needs to be returned to the upper level source station node, specifically, the central cache node sends another source return request to the upper level source station node, and the upper level source station node sends another source return response information to the central cache node in response to the source return request, where the source return response information carries the resource corresponding to the URL, and the central cache node caches the resource and returns the resource to the edge cache node,
a control platform: the control platform is used for managing the CDN, data connection is respectively established between the control platform and each cache node, a CDN control interface is provided, a user can log in the CDN control interface of the control platform after resources on a source station node are updated, a refreshing task is submitted to the control platform, so that the control platform sends cache refreshing requests aiming at specific URLs to all cache nodes of the CDN, and the cache refreshing requests are used for indicating all the cache nodes of the CDN to record that resources corresponding to the URLs are updated. The control platform may be configured on an independent server, or on any cache node, or on a virtual machine, which is not limited in the embodiments of the present invention.
In one possible implementation, the control platform may be, for example, a Content Management System (CMS) that is a web-interaction-mode-based Content Management and publication application System developed for information Management, information publication, and website maintenance. The CMS comprises the whole process of information acquisition, arrangement, classification, auditing, release and management, has perfect information management and release management functions, and can be used for a user to conveniently submit information to be released at any time without mastering complex technologies.
Caching: in the embodiment of the present invention, caching refers to storing all or part of resources of a source station into local memories of an edge cache node and a central cache node.
A cache table: the cache table records the URL of the resource cached to the local memory, the cache time and the storage address of the resource corresponding to the URL in the local memory, wherein the cache time is the time point when the cache node caches the resource to the local memory.
And (3) hit cache: the method refers to the condition that the URL is inquired in the cache table, the hit cache indicates that the resource corresponding to the URL is stored in the local memory, and when the cache is not hit, the resource corresponding to the URL is not stored in the local memory.
Refreshing the watch: the refresh table includes the URL of the resource to be refreshed and the refresh time of the resource to be refreshed.
Resource: including web pages, video, audio, animation, etc. data.
Referring to fig. 1, fig. 1 is a system structure diagram of a CDN system according to an embodiment of the present invention, and as shown in fig. 1, the CDN system includes a source node 10, a control platform 20, a content delivery network CDN, and a client 101 and 105.
The content delivery network CDN comprises central cache nodes 60-61 and edge cache nodes 70-74, and it is noted that in other embodiments, the number of the central cache nodes is not limited to 2, and may be other positive integers, and the number of the edge cache nodes is not limited to 5, and may be other positive integers.
The edge cache nodes are arranged in different regions, for example, the edge cache node 70 may be arranged in a south China region, the edge cache node 71 is arranged in a central China region, the edge cache node 72 is arranged in a west China region, the edge cache node 73 is arranged in a north China region, the edge cache node 74 is arranged in an east China region, a higher level node of the edge cache nodes 70-72 is the central cache node 60, a higher level node of the edge cache nodes 73-74 is the central cache node 61, and a higher level node of the central cache nodes 60-61 is the source station node 10.
For example, the client 101 is located in the south china area, so the distance between the client 101 and the edge cache node 70 is the closest, the client 102 is located in the central china area, so the client 102 and the edge cache node 71 are in the same area, the client 103 is located in the west china area, so the client 103 and the edge cache node 72 are in the same area, and the client 104 is located in the north china area, so the client 104 and the edge cache node 73 are in the same area, and the client 105 is located in the east china area, so the client 105 and the edge cache node 74 are in the same area.
It should be noted that the CDN system further includes a DNS node (not shown), where the DNS node records a correspondence between an IP address of the client and an IP address of an edge cache node closest to the client. For example, the client 101 sends a DNS request for a source station URL, the DNS node obtains an IP address of the edge cache node 70 from the above corresponding relationship according to a source IP address (i.e., an IP address of the client 101) carried in the DNS request, and returns the IP address to the client 101, the client 101 may send a resource access request carrying the URL of a resource to be accessed to the edge cache node 70, and when the edge cache node 70 caches the resource to be accessed, the edge cache node 70 returns the cached resource to be accessed to the client 101, thereby enabling the client to access the resource to be accessed nearby.
In the above example, if the edge cache node 70 does not cache the resource to be accessed, a source returning request is sent to the upper level central cache node 60, if the central cache node 60 caches the resource corresponding to the URL of the active station, the resource is returned to the edge cache node 70, and if the central cache node 60 does not cache the resource corresponding to the URL of the active station, the central cache node 60 sends another source returning request to the source station.
Based on the CDN system shown in fig. 1, when the source node 10 updates the resource corresponding to the specific URL of the source, for example, updates a picture of a specific web page, and after the source updates the resource corresponding to the specific URL, if the cache node of the CDN does not update the resource corresponding to the specific URL, the client may receive the old resource before updating from the edge cache node.
In order to solve the above technical problem, in a possible implementation manner, after a source station node 10 updates a resource corresponding to a specific URL of a source station, a user logs in a CDN control interface provided by a control platform 20 to input the URL and issue a refresh command for the URL, where the URL is a URL of a resource to be refreshed.
The control platform 20 firstly sends a cache refresh request to the central cache nodes 60 to 61, wherein the cache refresh request carries the URL of the resource to be refreshed, the URL of the resource to be refreshed is a specific URL of the source station corresponding to the updated resource, after the central cache nodes 60 to 61 respectively receive the cache refresh request, the central cache nodes record that the resource to be refreshed is refreshed at the source station node, and return cache update success information to the control platform 20.
After receiving the cache updating success information sent by the central cache nodes 70 to 74, the control platform 20 sends cache updating requests to the edge cache nodes 70 to 74, after receiving the cache updating requests, the edge cache nodes 60 to 61 record that the resources to be refreshed have been refreshed at the source station, and returns the cache updating success information to the control platform 20, after receiving the cache updating success information sent by the edge cache nodes 70 to 74, the control platform 20 confirms that the resources to be refreshed in all the cache nodes have been updated, and prompts the user that the resources to be refreshed in the CDN have been updated successfully.
In this possible implementation manner, after recording that the resource to be refreshed is refreshed at the source station, when receiving a resource access request for the URL of the resource to be refreshed, which is sent by the client, the edge cache node does not send the resource to the client, but sends a source return request to the central cache node, even if it caches the resource to be refreshed.
Similarly, after recording that the resource to be refreshed is refreshed at the source station, when receiving a resource access request for the URL of the resource to be refreshed, sent by the edge cache node, the central cache node does not send the resource to be refreshed to the edge cache node, but sends another resource returning request to the source station node, and the source station node sends the resource to be refreshed updated by the user to the central cache node according to the resource returning request, and the central cache node caches the resource to be refreshed, sends the resource to be refreshed to the edge cache node, and provides the resource to be refreshed to the client by the edge cache node.
The control platform sends the cache refreshing request to the central cache node, and then sends the cache refreshing request to the edge cache node after ensuring that the central cache node records that the resource to be refreshed is updated, so that the condition that the edge cache node receives the cache refreshing request first and receives the cache refreshing request later, which can cause the condition that the client terminal pulls the old resource from the central cache node, can be avoided.
Specifically, after the edge cache node receives a cache refresh request sent by the control platform, and records that a resource to be refreshed is refreshed at a source station, if a resource access request for a URL of the resource to be refreshed sent by a client is received at this time, even if the edge cache node caches the resource to be refreshed, the resource cannot be returned to the client because the resource is a resource before being updated, the edge cache node sends a back-source request for the URL of the resource to be refreshed to a central cache node at an upper level, if the central cache node at the upper level does not receive the cache refresh request sent by the control platform at this time and locally caches the resource to be refreshed before the source station is updated, the central cache node at the upper level returns the resource to be refreshed locally cached to the edge cache node according to the back-source request, however, the central cache node at the upper level does not receive the cache refresh request sent by the control platform, therefore, the resource to be refreshed cached locally is an old resource before the source station is updated, and the edge cache node returns the old resource to be refreshed to the client, so that the resource received by the client is not the latest resource after the source station is updated.
Therefore, the control platform sends the cache refreshing request to the central cache node, and then sends the cache refreshing request to the edge cache node after ensuring that the central cache node records that the resource to be refreshed is updated, so that the condition that the client pulls the old resource from the central cache node can be ensured not to occur. However, the control platform needs to wait for all the central cache nodes to return cache update success information before sending the cache refresh request to the edge cache nodes, and needs to wait for all the edge cache nodes to return cache update success information before confirming that the CDN is updated successfully, which takes a lot of time and is not good in user experience.
Another possible implementation manner of the embodiment of the present invention will be described below based on the CDN system shown in fig. 1, where in this implementation manner, whenever the control platform sends a cache refresh request to all the central cache nodes and edge cache nodes in the CDN, it can be ensured that the client does not pull old resources from the central cache nodes.
Referring to fig. 2, fig. 2 is a flowchart of a resource refreshing method for a CDN according to an embodiment of the present invention, where an execution subject of the method is a control platform 20, as shown in fig. 2, the method includes the following steps:
step 111: the control platform 20 obtains the URL of the resource to be refreshed.
For example, referring to fig. 3, fig. 3 is a schematic diagram of a CDN control interface provided by a control platform according to an embodiment of the present invention, as shown in fig. 3, the CDN control interface provides a refresh option, and a user may input a URL of a resource to be refreshed, for example, appdl.
Wherein,
and the directory TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node/1.txt of the source station appdl.hicoud.com represents 1.txt in the directory TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node/of the source station appdl.hicoud.com, and all subdirectories and files in the directory need to be refreshed.
It should be noted that the CDN control interface may further provide a back source message setting option, and the user may select to set a back source message header, at this time, the interface shown in fig. 4 is shown, fig. 4 is another schematic diagram of the CDN control interface provided by the control platform according to the embodiment of the present invention, as shown in fig. 4, a HyperText Transfer Protocol (HTTP header) message header may be set on the interface, and the user may select to add a refresh time to the message header of the back source request sent to the central cache node at the edge cache node, where the refresh time is a time point when the edge cache node receives the first cache refresh request (which will be described in detail below).
Step 112: after the user clicks the "click refresh" option, the control platform 20 may send a first cache refresh request carrying the URL of the resource to be refreshed to the edge cache nodes 70-75 and send a second cache refresh request carrying the URL of the resource to be refreshed to the central cache nodes 60-61 at the same time point.
Step 113: the control platform 20 prompts that the resource to be refreshed is successfully refreshed when receiving a first cache refresh success message returned by the edge cache node 70-75 according to the first cache refresh request and receiving a second cache refresh success message returned by the center cache node 60-61 according to the second cache refresh request.
For example, referring to fig. 5, fig. 5 is another schematic diagram of a CDN control interface provided by the control platform according to the embodiment of the present invention, and fig. 5 shows URLs of resources to be refreshed:
appd. complete. com/TIPSNG _ social/EMUI 3.14159/C00B050MNG/zh-cn/content/00_ node/refresh success in CDN.
In other examples, the function of setting the back-source message may be set in the edge cache nodes 70-75 by default, the user does not need to set the back-source message header on the CDN control interface, and the edge cache nodes 70-75 set the refresh time by default in the back-source request sent to the upper central member node.
The control platform 20 sends a first cache refresh request carrying the URL of the resource to be refreshed to the edge cache nodes 70 to 75, and when sending a second cache refresh request carrying the URL of the resource to be refreshed to the central cache nodes 60 to 61, it is not necessary to wait for a cache refresh success message of the edge cache nodes, so that the URL refresh rate of the CDN can be increased, thereby improving user experience.
In the above URL refresh mode, it is ensured that the edge cache node does not acquire the old resource from the upper level central cache node by adding refresh time to the header of the source return request sent from the edge cache node to the central cache node, and the principle of this URL refresh mode will be described in detail below.
Referring to fig. 6, fig. 6 is a flowchart of a cache refreshing method of a content delivery network according to an embodiment of the present invention, for clarity, an execution subject of the method is an edge cache node 70 in the CDN system shown in fig. 1, and it should be noted that other edge cache nodes in the CDN system shown in fig. 1 may also execute the method.
The method comprises the following steps:
step 201: the edge cache node 70 receives a first cache refresh request sent by the control platform 20, where the first cache refresh request carries a URL of a resource to be refreshed.
Bearing the above example, the URL of the resource to be refreshed may be, for example:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/。
wherein, the appdl.
TIPSNG _ DOMESTIC/EMUI3.14159/C00B050MNG/zh-cn/content/00_ node/is a directory of source station nodes.
Step 202: the edge cache node 70 records the URL of the resource to be refreshed carried by the first cache refresh request and the refresh time of the URL of the resource to be refreshed, and sends a first cache refresh success message to the control platform 20.
For example, the refresh time of the URL of the resource to be refreshed is the time point when the edge cache node 70 receives the first cache refresh request.
Specifically, the edge cache node 70 records the URL of the resource to be refreshed and the refresh time in the local refresh table.
The edge cache node 70 is provided with a refresh table, and after the edge cache node 70 receives the first cache refresh request sent by the control platform 20, the edge cache node 70 records the URL of the resource to be refreshed and the refresh time in the refresh table, specifically, the URL of the resource to be refreshed and the refresh time may be recorded in the refresh table as an entry.
In the embodiment of the present invention, the edge cache node 70 may delete the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time, for example, in a case where the resource to be refreshed is a directory, the entry recording the URL of the resource to be refreshed and the refresh time may be deleted after one month, and in a case where the resource to be refreshed is a file, the URL of the resource to be refreshed and the refresh time may be deleted in the refresh table after 10 seconds, and since the refresh table may occupy a storage space and a memory, the timing deletion mechanism may save the storage space and the memory resource of the edge cache node 70.
Further, in the case that the resource to be refreshed is a file, after the URL of the resource to be refreshed and the refresh time are recorded in the refresh table by the edge cache node 70, if the URL of the resource to be refreshed hits the cache, the edge cache node 70 deletes the resource to be refreshed in the local memory, and deletes the entry where the URL of the resource to be refreshed is located in the cache table.
Under the condition that the resource to be refreshed is the directory, after the URL of the resource to be refreshed and the refresh time are recorded in the refresh table by the edge cache node 70, if the URL of the resource to be refreshed hits the cache, because the directory may include a plurality of files, the edge cache node 70 does not delete the resource to be refreshed in the local memory, and does not delete the entry where the URL of the resource to be refreshed is located in the cache table.
Step 203: the edge cache node 70 receives a resource access request sent by the client 101, where the resource access request carries a URL of a resource to be accessed, and the resource access request is used to request the resource to be accessed.
The URL of the resource to be accessed may be, for example:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/1.txt
namely, the directory path of the source station node with the domain name of appdl.
Step 204: the edge cache node determines whether the URL of the resource to be accessed matches the URL of the resource to be refreshed, if so, step 205 is executed, and if not, step 210 is executed.
Specifically, the edge cache node 70 determines that the URL of the resource to be accessed matches the URL of the resource to be refreshed if it is determined that the URL of the resource to be accessed is the same as the URL of the resource to be refreshed, or if it is determined that the URL of the resource to be refreshed is a prefix of the URL of the resource to be accessed.
Bearing the above example, the URL of the resource to be accessed is:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/1.txt
the URL of the resource to be refreshed is:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/
the URL of the resource to be refreshed is the prefix of the URL of the resource to be accessed, and the URL of the resource to be accessed is matched with the URL of the resource to be refreshed.
In some other examples, if the URL of the resource to be accessed is:
appdl.hicloud.com/TIPSMNG_domestic/EMUI3.14159/C00B050MNG/zh-cn/content/00_node/
at this time, the URL of the resource to be accessed is the same as the URL of the resource to be refreshed, and the URL of the resource to be accessed is matched with the URL of the resource to be refreshed.
Step 205: the edge cache node 70 determines whether the URL of the resource to be accessed hits in the cache, if so, performs step 206, and if not, performs step 207.
For example, the edge cache node 70 determines whether the URL of the resource to be accessed is the same as the URL recorded in the local cache table, and if so, the cache is hit, and if not, the cache is not hit.
Step 206: the edge cache node 70 determines whether the first refresh time is later than the most recent cache time, and if so, performs step 207, and if not, performs step 212.
After the edge cache node 70 caches the same URL for multiple times, multiple cache times are recorded in the cache table corresponding to the same URL, so in step 206, the cache time closest to the current time among the multiple cache times corresponding to the same URL is selected as the cache time.
In this embodiment, the refresh time is a time point when the edge cache node 70 receives the first cache refresh request, and the cache time is a time point when the edge cache node 70 caches the resource to be accessed to the local memory, if the refresh time is later than the latest cache time, it indicates that the resource to be accessed cached to the edge cache node 70 is an old resource before the source station performs updating, at this time, step 207 needs to be executed to return the source to the upper-level central cache node 60, if the first refresh time is not later than the latest cache time, it indicates that the resource to be accessed cached to the edge cache node 70 is a new resource after the source station performs updating, the resource is a resource after the source station performs refreshing, at this time, step 212 is executed to return the resource to the client 101.
For example, the edge cache node 70 may obtain the refresh time by querying a local refresh table, and obtain the cache time by querying a local cache table.
Step 207: the edge cache node 70 sends a first feed-back request to the upper level central cache node 60, where the first feed-back request carries the refresh time and the URL of the resource to be refreshed.
For example, the first source-returning request is an HTTP message, a message header of the HTTP message is self-defined and provided with a refresh time type, and the refresh time may be embodied in a UNIX timestamp manner, for example: 1562280282, UNIX timestamp is the number of seconds elapsed since 1 month 1 day 1970.
The refresh time type is, for example, x-refresh-sendtime, and the HTTP packet header carries the following information:
x-refresh-sendtime:1562280282。
step 208: the edge cache node 70 receives the source return request response information sent by the central cache node 60, where the source return response information carries the URL of the resource to be refreshed and the resource to be refreshed.
The central cache node 60 generates a source return request response message according to the first source return request.
Step 209: the edge cache node 70 caches the URL of the resource to be refreshed and the resource to be refreshed, and records the caching time.
Specifically, the edge cache node 70 records the URL of the resource to be refreshed, the cache time, and the storage address of the resource to be refreshed in the local storage as an entry in the cache table, and it should be noted that a plurality of cache times may be recorded in the cache table corresponding to the same URL, so the cache time closest to the current time is selected as the cache time in step 206.
In an embodiment of the present invention, the edge cache node 70 periodically deletes entries in the cache table.
Step 210: when the edge cache node 70 determines that the URL of the resource to be accessed is not matched with the URL of the resource to be refreshed, which indicates that the resource to be accessed has not been refreshed, the edge cache node 70 executes step 210 to determine whether the URL of the resource to be accessed hits the cache, if so, executes step 212 to directly return the resource to be accessed to the client 101, and if not, executes step 211 to return the resource to the central cache node 60.
Step 211: the edge cache node 70 sends a second back-to-source request to the central cache node 60, where the second back-to-source request carries the URL of the resource to be refreshed.
In this step, since the URL of the resource to be accessed is not matched with the URL of the resource to be refreshed, it indicates that the edge cache node 70 does not receive the cache refresh request for the resource of the URL of the resource to be accessed, and therefore the second request to return to the source does not need to carry refresh time.
Step 212: the edge cache node 70 sends resource access request response information to the client 101, where the resource access request response information carries the URL of the resource to be accessed and the resource to be accessed.
In the embodiment of the present invention, the edge cache node 70 sends the first request for source return to the central cache node 60 in response to the resource access request, where the first request for source return carries the refresh time and the URL of the resource to be refreshed, and the refresh time is a time point when the edge cache node 70 receives the cache refresh request, and after the central cache node 60 receives the first request for source return, when the URL of the resource to be refreshed hits in the cache, it is determined whether the cached resource to be refreshed is an old resource according to the first refresh time, so as to avoid a situation that the central cache node 60 directly sends the old resource to the edge cache node 70 when the URL of the resource to be refreshed hits in the cache.
In the embodiment of the present invention, in step 202, after the edge cache node 70 deletes the URL of the resource to be refreshed and the refresh time in the refresh table after the predetermined time, if the client 101 sends another resource access request for the URL of the resource to be refreshed to the edge cache node 70, at this time, the edge cache node 70 does not query the URL of the resource to be refreshed in the refresh table, at this time, the edge cache node 70 sends the source return request response information to the central cache node 60 when confirming that the URL of the resource to be refreshed hits in the cache, and the source return request response information carries the URL of the resource to be refreshed and the cached resource to be refreshed.
In other embodiments of the present invention, the refresh time may also be uniformly set by the console 20 and carried in the first cache refresh request sent by the console 20 to the edge cache node 70. For example, the refresh time may be defined as the time point recorded by the control platform 20 when the user clicks the "click refresh" button on the CDN control interface in fig. 3.
Referring to fig. 7, fig. 7 is a flowchart of a method for back-sourcing in a CDN according to an embodiment of the present invention, and for clarity, the main execution of the method is a central cache node 60 in the CDN system shown in fig. 1, and it should be noted that other central cache nodes shown in fig. 1 may also execute the method.
The method comprises the following steps:
step 401: the central cache node 60 receives the back-source request sent by the edge cache node 70.
As an example, the back-source request may be the first back-source request carrying the first refresh time and the URL of the resource to be refreshed in step 207 shown in fig. 6, or may be the second back-source request carrying the URL of the resource to be refreshed without carrying the first refresh time in step 211.
Step 402: the central cache node 60 determines whether the back-to-source request carries the first refresh time, if so, performs step 403, and if not, performs step 408.
In the above example, when the source returning request is an HTTP message, it may be detected whether a header of the HTTP message is provided with the refresh time type x-refresh-sendtime, and if so, it is determined that the source returning request carries the refresh time.
Step 403: the central cache node 60 determines whether a second cache refresh request sent by the control platform 20 has been received, if yes, step 404 is executed, and if no, step 409 is executed.
Specifically, when receiving the second cache refresh request sent by the control platform 20, the central cache node 60 records the URL of the resource to be refreshed in the local refresh table and the time point when the central cache node 60 receives the second cache refresh request, otherwise, if the central cache node 60 receives the second cache refresh request sent by the control platform 20, the central cache node does not set the local refresh table, and at this time, the refresh table does not record the refresh URL and the time point when the central cache node 60 receives the second cache refresh request.
It should be noted that, in the embodiment of the present invention, when receiving the second cache refresh request sent by the control platform 20, after recording, in the local refresh table, the URL of the resource to be refreshed and the time point when the central cache node 60 receives the second cache refresh request, the central cache node 60 sends a cache refresh success message to the control platform 20 to notify the control platform 20 that the central cache node 60 has received the second cache refresh request, and records, in the refresh table of the central cache node 60, the URL of the resource to be refreshed and the time point when the central cache node 60 receives the second cache refresh request.
In the embodiment of the present invention, the central cache node 60 deletes the URL and the refresh time of the resource to be refreshed recorded in the local refresh table at regular time, for example, when the resource to be refreshed is a directory, the URL and the refresh time of the resource to be refreshed can be deleted after one month, and when the resource to be refreshed is a file, the URL and the refresh time of the resource to be refreshed can be deleted after 10 days.
Step 404: the central cache node 60 determines whether the URL of the resource to be refreshed carried by the request to return to the source hits in the cache, if yes, step 405 is executed, and if no, step 410 is executed.
Since it has been confirmed in step 402 that the back-source request carries the first refresh time, the back-source request is the first back-source request shown in fig. 6, where, when the URL of the resource to be refreshed carried by the back-source request hits the cache, at this time, when the URL of the resource to be refreshed carried by the first back-source request hits the cache, the central cache node 60 executes the branch of step 405 to confirm whether to return the cached resource to be refreshed to the edge cache node 70 according to the first refresh time.
In the case that it is determined that the URL of the resource to be refreshed carried by the first request for source return does not hit in the cache, the central cache node 60 executes step 410 to directly return the source to the source station node.
In the embodiment of the present invention, the central cache node 60 may delete the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time, for example, in a case where the resource to be refreshed is a directory, the entry recording the URL of the resource to be refreshed and the refresh time may be deleted after one month, and in a case where the resource to be refreshed is a file, the URL of the resource to be refreshed and the refresh time may be deleted in the refresh table after 10 seconds, and since the refresh table may occupy a storage space and a memory, the timing deletion mechanism may save the storage space and the memory resource of the central cache node 60.
Further, under the condition that the resource to be refreshed is a file, after the central cache node 60 records the URL of the resource to be refreshed and the refresh time in the refresh table, if the URL of the resource to be refreshed hits the cache, the central cache node 60 deletes the resource to be refreshed in the local memory, and deletes the entry where the URL of the resource to be refreshed is located in the cache table.
Under the condition that the resource to be refreshed is the directory, after the central cache node 60 records the URL of the resource to be refreshed and the refresh time in the refresh table, if the URL of the resource to be refreshed hits the cache, because the directory may include a plurality of files, the central cache node 60 may not delete the resource to be refreshed in the local memory, and may not delete the entry where the URL of the resource to be refreshed is located in the cache table.
Step 405: the central cache node 60 determines whether the latest refreshing time is later than the local caching time, where the latest refreshing time is the later of the refreshing time carried by the first cache request and the time point when the central cache node 60 receives the second cache refreshing request, if so, it indicates that the resource to be refreshed currently cached by the central cache node 60 is a resource before the resource is refreshed by the source station, that is, an old resource, at this time, the central cache node 60 executes step 410 to return the source to the source station node, if not, it indicates that the cached resource to be refreshed is a resource after the resource is refreshed by the source station, that is, a new resource, at this time, executes step 406 to directly return the resource to be refreshed that is hit in the cache to the edge cache node 70.
Step 406: the central cache node 60 sends a first request response message to the edge cache node 70, where the first request response message carries the URL of the resource to be refreshed and the resource to be refreshed.
Step 407: the central cache node 60 executes step 407 if it does not receive the second cache refresh request sent by the control platform 20, and in step 407, the central cache node 60 determines whether the URL of the resource to be refreshed carried by the first origin request hits the cache, if so, executes step 409, and if not, executes step 410.
In this step, the source returning request is the first source returning request shown in fig. 6, and when the central cache node 60 determines that the URL of the resource to be refreshed carried by the first source returning request hits in the cache, step 409 is executed, and it is determined whether to send the cached resource to be refreshed to the edge cache node 70 only according to the refreshing time carried by the first source returning request.
When the central cache node 60 determines that the URL of the resource to be refreshed carried by the first request for source return does not hit in the cache, step 410 is executed to directly return the source to the source station node.
Step 408: the central cache node 60 determines whether the refresh time carried by the first source-returning request is later than the local cache time, if so, determines that the cached resource to be refreshed is an old resource before the source station refreshes, executes step 412, returns the source directly to the source station node 10, if not, determines that the cached resource to be refreshed is a new resource after the source station refreshes, executes step 406, and returns the locally cached resource to be refreshed to the edge cache node 70.
Step 409: the central cache node 60 determines whether a second cache refresh request sent by the control platform 20 has been received, if yes, step 411 is executed, and if no, step 410 is executed.
It is noted that, in this step, the back-source request is the second back-source request shown in fig. 6.
Step 410: the central cache node 60 determines whether the URL of the resource to be refreshed carried by the second back-source request hits in the cache, if yes, step 406 is executed to return the resource to be refreshed to the edge cache node 70, and if no, step 412 is executed to return the resource to the source station node 20.
Step 411: the central cache node 60 determines whether the URL of the resource to be refreshed carried by the request to return to the source hits in the cache, if yes, step 406 is executed, and if no, step 412 is executed.
Step 412: the central cache node 60 sends another request to the source station node 20, where the request carries the URL of the resource to be refreshed.
Step 413: the central cache node 60 receives the source returning request response information sent by the source station node 20, where the source returning request response information carries the URL of the resource to be refreshed and the resource to be refreshed, and the central cache node 60 caches the resource to be refreshed in the local memory, and records the URL of the resource to be refreshed, the caching time, and the storage address of the resource in the cache table.
In the embodiment of the present invention, when the received back-source request carries a refresh time, even if the URL of the resource to be refreshed carried by the back-source request hits the local cache, the central cache node 60 further determines whether the resource to be refreshed cached by the central cache node 60 is the resource after the source station is updated according to the refresh time, and returns the resource to the edge cache node 70 after determining whether the resource to be refreshed by the central cache node 60 is the resource after the source station is updated, and returns the resource to the source station node 20 if determining whether the resource to be refreshed by the central cache node 60 is the resource before being refreshed, thereby ensuring that the client 101 does not obtain the old resource from the edge cache node 70.
It should be noted that in other embodiments of the present invention, the refresh time may also be set by the console 20, and carried in the first cache refresh request sent by the console 20 to the edge cache node 70 and the second cache refresh request sent by the console 20 to the central cache node 60. For example, the refresh time may be defined as the time point recorded by the control platform 20 when the user clicks the "click refresh" button on the CDN control interface in fig. 3.
At this time, the edge cache node 70 may perform processing according to the flow shown in fig. 8, where fig. 8 is a flow chart of a method for returning to a source in a CDN according to an embodiment of the present invention, as shown in fig. 8, the method includes the following steps:
step 1001: the central cache node 60 receives the back-source request sent by the edge cache node 70.
Step 1002: the central cache node 60 determines whether the back-source request carries a refresh time, if yes, step 1003 is executed, and if no, step 1006 is executed.
Step 1003: the central cache node 60 determines whether the URL of the resource to be refreshed carried by the request to return to the source hits in the cache, if yes, step 1004 is executed, and if no, step 1007 is executed.
Step 1004: the central cache node 60 determines whether the refresh time is later than the local cache time, if yes, step 1007 is executed, and if no, step 1005 is executed.
Step 1005: the central cache node 60 sends a first request response message to the edge cache node 70, where the first request response message carries the URL of the resource to be refreshed and the resource to be refreshed.
Step 1006: the central cache node 60 determines whether the URL of the resource to be refreshed carried by the request to return to the source hits in the cache, if yes, step 1005 is executed, and if no, step 1007 is executed.
Step 1007: the central cache node 60 sends another request to the source station node 20, where the request carries the URL of the resource to be refreshed.
Step 1008: the central cache node 60 receives the source return request response information sent by the source station node 20, where the source return request response information carries the URL of the resource to be refreshed and the resource to be refreshed, caches the resource to be refreshed in the local memory, and records the URL of the resource to be refreshed, the cache time, and the storage address of the resource in the cache table.
It is noted that other central cache nodes shown in fig. 1 may also perform the above-described method.
Since in the method shown in fig. 8, the refresh time is a time point uniformly set by the control platform 20, that is, the refresh time received by the central cache node 60 from the edge cache node 70 is the same as the refresh time received by the central cache node 60 from the control platform 20, in the method shown in fig. 8, the central cache node 60 does not need to determine whether to receive the second cache refresh request before, except that the steps shown in fig. 8 are similar to those shown in the related steps of fig. 7, and specific reference may be made to the related description of each step in fig. 7, which is not repeated herein.
Similarly, in the embodiment of the present invention, when the received back source request carries a refresh time, even if the URL of the resource to be refreshed carried by the back source request hits the local cache, the central cache node 60 further determines whether the resource to be refreshed cached by the central cache node 60 is the resource after being refreshed according to the refresh time, and returns the resource to the edge cache node 70 when determining whether the resource to be refreshed by the central cache node 60 is the resource after being refreshed, and returns the resource to the source station node 20 if determining whether the resource to be refreshed by the central cache node 60 is the resource before being refreshed, thereby ensuring that the client 101 does not obtain the old resource from the edge cache node 70.
To further explain the methods shown in fig. 2, 6 to 7, please refer to fig. 9, fig. 9 is a data interaction diagram of a cache refresh method of a content distribution network according to an embodiment of the present invention, and the method shown in fig. 9 includes the following steps:
step 801: the user logs in the source station node 10, and the resource corresponding to the specific URL of the source station is updated by the user.
Step 802: the user logs in the CDN control interface to input a refresh command for a specific URL, and the control platform 20 receives the refresh command input by the user.
Step 803: the control platform 20 sends multiple cache refresh requests to all cache nodes in the CDN at the same time.
Specifically, the control platform 20 sends a plurality of first cache refresh requests to all edge cache nodes in the CDN at the same time, and sends a plurality of second cache refresh requests to all center cache nodes in the CDN, where the first cache refresh requests and the second cache refresh requests carry URLs of resources to be refreshed.
Step 804: the edge cache node 70 records the URL of the resource to be refreshed and the first refresh time to the local refresh table when receiving the first cache refresh request.
Step 805: and when the central cache node 60 receives the cache refresh request, recording the URL of the resource to be refreshed and the second refresh time to the local refresh table.
Step 806: after the edge cache node 70 records the URL of the resource to be refreshed and the first refresh time to the local refresh table, sending the first cache refresh success information to the control platform 20, where the first refresh time is a time point when the edge cache node 70 receives the first cache refresh request.
Step 807: after the central cache node 60 records the URL of the resource to be refreshed and the second refresh time to the local refresh table, the second cache refresh success information is sent to the control platform 20, where the second refresh time is a time point when the central cache node 60 receives the second cache refresh request.
Step 808: under the condition that cache refreshing success information returned by all cache nodes in the CDN is received, the control platform 20 prompts the user that the resource to be refreshed has been refreshed in the CDN.
In the embodiment of the present invention, the control platform 20 does not need to send the first cache refresh request to the central cache node first, and sends the second cache refresh request to the edge cache node after confirming that all the central cache nodes return the cache refresh success information, and the first cache refresh request and the second cache refresh request can be sent simultaneously, which can greatly shorten the refresh time.
Step 809: the client 101 sends a resource access request carrying the URL of the resource to be accessed to the edge cache node 70.
Step 810: the edge cache node 70 generates a first back-source request when a predetermined condition is satisfied.
Wherein the preset conditions are as follows:
the edge cache node 70 determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed is not cached in a hit manner; or the edge cache node 70 determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits the cache, and the refresh time is later than the cache time of the resource to be refreshed.
Step 811: the edge cache node 70 sends a first back-source request to the central cache node 60.
Step 812: the central cache node 60 selects the later of the first refresh time and the second refresh time as the latest refresh time when the URL of the resource to be refreshed hits the cache, and generates a second request for returning to the source if the latest refresh time is later than the cache time of the URL of the resource to be refreshed at the central cache node 60.
Step 813: central cache node 60 sends a second back-to-source request to source site node 10.
Step 814: the source station node 10 sends a first reply request to the central cache node 60.
Wherein the first response request carries the resource to be refreshed.
Step 815: the central cache node 60 caches the resource to be refreshed in the local memory, and updates the cache table for recording the cache time 1 to the local.
For example, if the cache table is previously recorded with entry 1: if the URL of the resource to be refreshed, the cache time 0, and the storage address 1 are present, the central cache node 60 updates the cache time 0 in the entry 1, and modifies the cache time 0 to the cache time 1.
Optionally, the central cache node 60 may also add entry 2: URL of resource to be refreshed, cache time 1, memory address 1, and entry 1 is reserved. When the central cache node 60 searches the cache time corresponding to the URL of the resource to be refreshed, the entry 1 and the entry 2 are obtained in the cache table according to the URL of the resource to be refreshed, the cache times in the entry 1 and the entry 2 are compared, and the later cache time 2 is selected as the cache time of the URL of the resource to be refreshed.
Step 816: the central cache node 60 sends a second response request to the edge cache node 70.
Wherein the first response request carries the resource to be refreshed.
Step 817: the edge cache node 70 caches the received resource to be refreshed, and records the cache time 2, the URL of the resource to be refreshed and the storage address of the resource to the local cache table.
The operation of the edge cache node 70 for the local cache table is similar to that of the central cache node 60, and is not described herein again.
Step 818: the edge cache node 70 sends a third response request to the client 101.
Wherein the third response request carries the resource to be refreshed.
In summary, since the source return request sent by the edge cache node to the central cache node carries the refresh time, even if the central cache node hits the cache, the central cache node may determine whether the resource hit in the cache is a new resource according to the refresh time, based on this, the control platform 20 may send the cache refresh request to all cache nodes of the CDN at the same time, and does not need to worry about returning the old resource to the edge cache node by the central cache node, so the refresh rate of the CDN may be significantly accelerated, thereby improving user experience.
In some cases, for example, when the network between the central cache node 60 and the control platform 20 is in a bad condition, the central cache node 60 may receive the back-source request sent by the edge cache node 70 without receiving the second cache refresh request sent by the control platform 20, and the embodiment of the present invention may ensure that the central cache node 60 does not return the old resource to the edge cache node 70 in this case, which is described below with reference to fig. 10, where fig. 10 is another data interaction diagram of a cache refresh method of a content distribution network according to an embodiment of the present invention, and the method shown in fig. 10 includes the following steps:
step 901: the user logs in the source station node 10, and the resource corresponding to the specific URL of the source station is updated by the user.
Step 902: the user logs in the CDN control interface to input a refresh command for a specific URL, and the control platform 20 receives the refresh command input by the user.
Step 903: the control platform 20 sends multiple cache refresh requests to all cache nodes in the CDN at the same time.
Specifically, the control platform 20 sends a plurality of first cache refresh requests to all edge cache nodes in the CDN at the same time, and sends a plurality of second cache refresh requests to all center cache nodes in the CDN, where the first cache refresh requests and the second cache refresh requests carry URLs of resources to be refreshed.
Step 904: the edge cache node 70 records the URL of the resource to be refreshed and the first refresh time to the local refresh table when receiving the first cache refresh request.
Step 905: after the edge cache node 70 records the URL of the resource to be refreshed and the first refresh time to the local refresh table, sending the first cache refresh success information to the control platform 20, where the first refresh time is a time point when the edge cache node 70 receives the first cache refresh request.
Step 906: the client 101 sends a resource access request carrying the URL of the resource to be accessed to the edge cache node 70.
Step 907: the edge cache node 70 generates a first back-source request when a predetermined condition is satisfied.
Wherein the preset conditions are as follows:
the edge cache node 70 determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed is not cached in a hit manner; or the edge cache node 70 determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits the cache, and the refresh time is later than the cache time of the resource to be refreshed.
Step 908: the edge cache node 70 sends a first back-source request to the central cache node 60.
Step 909: when the URL of the resource to be refreshed hits in the cache, the central cache node 60 generates a second request to return to the source if it is determined that the first refresh time is later than the cache time of the URL of the resource to be refreshed in the central cache node 60.
Step 910: central cache node 60 sends a second back-to-source request to source site node 10.
Step 911: the source station node 10 sends a first reply request to the central cache node 60.
Wherein the first response request carries the resource to be refreshed.
Step 912: the central cache node 60 caches the resource to be refreshed in the local memory, and updates the cache table for recording the cache time 1 to the local.
For example, if the cache table is previously recorded with entry 1: if the URL of the resource to be refreshed, the cache time 0, and the storage address 1 are present, the central cache node 60 updates the cache time 0 in the entry 1, and modifies the cache time 0 to the cache time 1.
Optionally, the central cache node 60 may also add entry 2: URL of resource to be refreshed, cache time 1, memory address 1, and entry 1 is reserved. When the central cache node 60 searches the cache time corresponding to the URL of the resource to be refreshed, the entry 1 and the entry 2 are obtained in the cache table according to the URL of the resource to be refreshed, the cache times in the entry 1 and the entry 2 are compared, and the later cache time 2 is selected as the cache time of the URL of the resource to be refreshed.
Step 913: the central cache node 60 sends a second response request to the edge cache node 70.
Wherein the second response request carries the resource to be refreshed.
Step 914: the edge cache node 70 caches the received resource to be refreshed, and records the cache time 2, the URL of the resource to be refreshed and the storage address of the resource to the local cache table.
The operation of the edge cache node 70 for the local cache table is similar to that of the central cache node 60, and is not described herein again.
Step 915: the edge cache node 70 sends a third response request to the client 101.
Wherein the third response request carries the resource to be refreshed.
Step 916: and when the central cache node 60 receives the cache refresh request, recording the URL of the resource to be refreshed and the second refresh time to the local refresh table.
Step 917: after the central cache node 60 records the URL of the resource to be refreshed and the second refresh time to the local refresh table, the second cache refresh success information is sent to the control platform 20, where the second refresh time is a time point when the central cache node 60 receives the second cache refresh request.
Step 918: under the condition that cache refreshing success information returned by all cache nodes in the CDN is received, the control platform 20 prompts the user that the resource to be refreshed has been refreshed in the CDN.
In the embodiment of the present invention, the control platform 20 does not need to send the first cache refresh request to the central cache node first, and sends the second cache refresh request to the edge cache node after confirming that all the central cache nodes return the cache refresh success information, and the first cache refresh request and the second cache refresh request can be sent simultaneously, which can greatly shorten the refresh time.
In summary, since the source return request sent by the edge cache node to the central cache node carries the refresh time, even if the central cache node hits the cache and does not receive the second cache refresh request sent by the control platform, the central cache node determines whether the resource hit by the cache is a new resource according to the refresh time, based on this, the control platform 20 can simultaneously send the cache refresh request to all cache nodes of the CDN, and does not need to worry about that the central cache node returns an old resource to the edge cache node.
Referring to fig. 11, an embodiment of the present invention further provides an edge cache node 70, which includes a receiving module 701, a sending module 702, a determining module 703, a recording module 704, and a timing deleting module 704, where the modules are configured to execute related operations in the embodiment shown in fig. 6.
Referring to fig. 12, an embodiment of the present invention further provides a central cache node 60, which includes a receiving module 601, a sending module 602, a determining module 603, a recording module 604, and a timing deleting module 604, where the modules are configured to execute related operations in the embodiments shown in fig. 7 or fig. 8.
Fig. 13 is a schematic structural diagram of an edge cache node 70 according to an embodiment of the present disclosure. Edge cache node 70 includes a processing unit 7000 and a communication interface 7103, processing unit 7000 being configured to perform functions defined by various software programs, e.g., to implement the functions of edge cache node 70. The communication interface 7103 is used for communication interaction with other computing nodes, and other devices may be other physical servers, and in particular, the communication interface 7103 may be a network adapter card.
Optionally, the edge cache node 70 may further include an input/output interface 7101, where the input/output interface 7101 is connected to an input/output device, and is configured to receive input information and output an operation result. The input/output interface 7101 may be a mouse, a keyboard, a display, or an optical drive. Optionally, the edge cache node 70 may further include a secondary storage 7102, also commonly referred to as an external storage, and a storage medium of the secondary storage 7102 may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., an optical disk), a semiconductor medium (e.g., a solid state disk), or the like.
Optionally, the edge cache node 70 may also include a bus 7104. The processing unit 7000, the communication interface 7103, the input/output interface 7101, and the auxiliary memory 7102 may be connected via a bus 7104. The bus 7104 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 7104 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one line is shown in FIG. 13, but this does not represent only one bus or one type of bus.
The above and other operations and/or functions of each unit in the edge cache node 70 are respectively for implementing corresponding flows of the methods in fig. 6, fig. 9, and fig. 10, and are not described herein again for brevity.
Fig. 14 is a schematic structural diagram of a central cache node 60 according to an embodiment of the present disclosure. Central cache node 60 includes a processing unit 6000 and a communication interface 6103, processing unit 6000 being operative to perform functions defined by the various software programs, e.g., to implement the functions of central cache node 60. Communication interface 6103 is for communicative interaction with other computing nodes, and other devices may be other physical servers, and in particular communication interface 6103 may be a network adapter card.
Optionally, the central cache node 60 may further include an input/output interface 6101, where the input/output interface 6101 is connected to an input/output device for receiving input information and outputting an operation result. The input/output interface 6101 may be a mouse, keyboard, display, or optical drive, etc. Optionally, the central cache node 60 may further include a secondary storage 6102, also commonly referred to as an external storage, and a storage medium of the secondary storage 6102 may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., an optical disk), or a semiconductor medium (e.g., a solid state disk), and so on.
Optionally, central cache node 60 may also include a bus 6104. The processing unit 6000, the communication interface 6103, the input/output interface 6101, and the auxiliary memory 6102 may be connected via a bus 6104. The bus 6104 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 6104 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one line is shown in FIG. 14, but it is not intended that there be only one bus or one type of bus.
The above and other operations and/or functions of each unit in the central cache node 60 are respectively for implementing corresponding flows of the methods in fig. 7 to fig. 10, and are not described herein again for brevity.
It should be noted that the memory in the embodiment of the present application may include a volatile memory (such as a random-access memory (RAM); the memory may also include a non-volatile memory (ROM), such as a read-only memory (ROM), a flash memory (flash memory), a hard disk (HDD) or a solid-state drive (SSD); the memory may also comprise a combination of memories of the kind described above.
Based on the same inventive concept, the present application provides a computer-readable storage medium having stored therein instructions, which, when executed on a computer, cause the computer to perform the method described in any possible implementation of the above embodiments.
Based on the same inventive concept, the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method as described in any of the possible implementations of the embodiments described above.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product which is embodied on one or more computer-usable storage channels (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (38)
- A method of back-sourcing in a content distribution network, comprising:the method comprises the steps that an edge cache node receives a cache refreshing request sent by a control platform, wherein the cache refreshing request carries a Uniform Resource Locator (URL) of a resource to be refreshed;and the edge cache node sends a source returning request to a central cache node, wherein the source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed.
- The method of claim 1, wherein the refresh time is a point in time at which the edge cache node receives the cache refresh request.
- The method of claim 1, wherein the refresh time is carried in the cache refresh request and the refresh time is set by the control platform.
- The method according to any one of claims 1 to 3,before the edge cache node sends a back-source request to the central cache node, the method further includes:the edge cache node receives a first resource access request sent by a client;the sending, by the edge cache node, a source return request to the central cache node specifically includes:the edge cache node sends the back-to-source request to the central cache node in response to the first resource access request.
- The method according to claim 4, wherein the first resource access request carries a URL of a resource to be accessed, and the edge cache node sends the back source request to the central cache node in response to the resource access request, specifically including:and the edge cache node sends the source returning request to the central cache node under the condition that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed is not in cache.
- The method of claim 4, wherein the resource access request carries a URL of a resource to be accessed, and wherein the edge cache node sends the back-source request to the central cache node in response to the resource access request, further comprising:and the edge cache node sends the source returning request to the central cache node under the condition that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits and caches, and the refreshing time is later than the caching time, wherein the caching time is the time point when the edge cache node caches the resource to be accessed.
- The method according to any one of claims 1 to 6, wherein the edge cache node is provided with a refresh table, and after the edge cache node receives a cache refresh request sent by a control platform, the method further comprises:and the edge cache node records the URL of the resource to be refreshed and the refreshing time in the refreshing table.
- The method of claim 7, wherein after the refresh table records the URL of the resource to be refreshed and the refresh time, the edge cache node further comprises:and deleting the URL of the resource to be refreshed and the refreshing time recorded in the refreshing table by the edge cache node after a preset time.
- The method according to claim 7, wherein after the edge cache node deletes the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time, the method further comprises:the edge cache node receives a second resource access request sent by the client, wherein the second resource access request carries the URL of the resource to be accessed;and the edge cache node sends resource access request response information to the client under the condition that the URL of the resource to be accessed is determined not to be in the refresh table and the URL of the resource to be accessed hits the cache, wherein the resource access request response information carries the resource to be accessed.
- The method according to any one of claims 5 to 9, wherein the edge cache node determines that the URL of the resource to be accessed matches the URL of the resource to be refreshed if it is determined that the URL of the resource to be refreshed is the same as the URL of the resource to be refreshed or if it is determined that the URL of the resource to be refreshed is a prefix of the URL of the resource to be accessed.
- A method of back-sourcing in a content distribution network, comprising:a central cache node receives a first source returning request sent by an edge cache node, wherein the first source returning request carries a URL (uniform resource locator) of a resource to be refreshed and the refreshing time of the resource to be refreshed;and the central cache node compares the refreshing time with the cache time of the resource to be refreshed under the condition that the URL of the resource to be refreshed hits the cache, and sends the second source returning request to the source station node under the condition that the refreshing time is determined to be later than the cache time.
- The method of claim 11, wherein the refresh time is a point in time when the edge cache node receives a first cache refresh request sent by a control platform.
- The method of claim 11, wherein the refresh time is carried in a cache refresh request received by the edge cache node from a control platform, and wherein the refresh time is set by the control platform.
- The method of claim 11, wherein before the central cache node sends the second back-to-source request to the source station node, the method further comprises:the central cache node receives a second cache refreshing request sent by the control platform, wherein the second cache refreshing request carries the URL of the resource to be refreshed;and the central cache node judges that the time point of receiving the second cache refreshing request is later than the cache time.
- The method according to any one of claims 11 to 14, wherein the central cache node is provided with a refresh table, and after the central cache node receives the first back-source request sent by the edge cache node, the method further comprises:and the central cache node records the URL of the resource to be refreshed and the refreshing time in the refreshing table.
- The method of claim 15, wherein after the refresh table records the URL of the resource to be refreshed and the refresh time, the central cache node further comprises:and the central cache node deletes the URL of the resource to be refreshed and the refreshing time recorded in the refreshing table after a preset time.
- The method according to claim 16, wherein after the central cache node deletes the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time, the method further comprises:the central cache node receives a third source returning request sent by the edge cache node, wherein the third source returning request carries the URL of the resource to be refreshed;and the central cache node sends resource access request response information to the edge cache node under the condition that the URL of the resource to be refreshed is determined not to be in the refresh table and the URL of the resource to be refreshed hits the cache, wherein the resource access request response information carries the resource to be refreshed.
- An edge cache node, comprising:the system comprises a receiving module, a refreshing module and a refreshing module, wherein the receiving module is used for receiving a cache refreshing request sent by a control platform, and the cache refreshing request carries a Uniform Resource Locator (URL) of a resource to be refreshed;and the sending module is used for sending a source returning request to the central cache node, wherein the source returning request carries the URL of the resource to be refreshed and the refreshing time of the resource to be refreshed.
- The edge cache node of claim 18, wherein the refresh time is a point in time at which the edge cache node receives the cache refresh request.
- The edge cache node of claim 18, wherein the refresh time is carried in the cache refresh request and the refresh time is set by the control platform.
- The edge cache node of any of claims 18 to 20,the receiving module is further configured to receive a first resource access request sent by a client;the sending module is further configured to send the back-to-source request to the central cache node in response to the first resource access request.
- The edge cache node of claim 21, wherein the first resource access request carries a URL of a resource to be accessed, the edge cache node further comprising a determining module,the judging module is used for determining that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed is not in hit cache;the sending module is configured to send the source returning request to the central cache node when the determining module determines that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed and the URL of the resource to be accessed does not hit the cache.
- The edge cache node of claim 21, wherein the resource access request carries a URL of a resource to be accessed, the edge cache node further comprising a determining module,the judging module is used for determining that the URL of the resource to be accessed is matched with the URL of the resource to be refreshed, the URL of the resource to be accessed hits and is cached, and the refreshing time is later than the caching time;the sending module is configured to send the source returning request to the central cache node when the determining module determines that the URL of the resource to be accessed matches the URL of the resource to be refreshed, the URL of the resource to be accessed hits in the cache, and the refresh time is later than the cache time, where the cache time is a time point at which the edge cache node caches the resource to be accessed.
- The edge cache node according to any one of claims 18 to 23, wherein the edge cache node is provided with a refresh table, and the edge cache node further comprises a recording module, and the recording module is configured to record, in the refresh table, the URL of the resource to be refreshed and the refresh time after the receiving module receives a cache refresh request sent by a control platform.
- The edge cache node according to claim 24, further comprising a timed deletion module, configured to delete the URL of the resource to be refreshed and the refresh time recorded in the refresh table after a predetermined time after the refresh table records the URL of the resource to be refreshed and the refresh time by the recording module.
- The edge cache node of claim 24,the receiving module is configured to receive a second resource access request sent by the client, where the second resource access request carries the URL of the resource to be accessed;the judging module is used for determining that the URL of the resource to be accessed is not in the refresh table and the URL of the resource to be accessed hits the cache;the sending module is configured to send resource access request response information to the client when the determining module determines that the URL of the resource to be accessed is not in the refresh table and the URL of the resource to be accessed hits the cache, where the resource access request response information carries the resource to be accessed.
- The edge cache node according to any one of claims 22 to 26, wherein the determining module determines that the URL of the resource to be accessed matches the URL of the resource to be refreshed if it is determined that the URL of the resource to be accessed is the same as the URL of the resource to be refreshed or if it is determined that the URL of the resource to be refreshed is a prefix of the URL of the resource to be accessed.
- A central cache node, comprising:the system comprises a receiving module, a refreshing module and a refreshing module, wherein the receiving module is used for receiving a first source returning request sent by an edge cache node, and the first source returning request carries a URL (uniform resource locator) of a resource to be refreshed and refreshing time of the resource to be refreshed;the judging module is used for confirming that the URL of the resource to be refreshed hits the cache, and the refreshing time is later than the cache time of the resource to be refreshed;and the sending module is used for sending the second source returning request to the source station node under the condition that the judging module confirms that the URL of the resource to be refreshed hits the cache and the refreshing time is later than the cache time.
- The central cache node of claim 28, wherein the refresh time is a point in time when the edge cache node receives a first cache refresh request sent by a control platform.
- The central cache node of claim 28, wherein the refresh time is carried in a cache refresh request received by the edge cache node from a control platform, and wherein the refresh time is set by the control platform.
- The central caching node of claim 28,the receiving module is further configured to receive a second cache refresh request sent by the control platform, where the second cache refresh request carries the URL of the resource to be refreshed;the judging module is further configured to judge that the time point of receiving the second cache refresh request is later than the cache time.
- The central cache node according to any of claims 28 to 31, wherein the central cache node is provided with a refresh table, the central cache node further comprising a logging module,and the recording module is used for recording the URL of the resource to be refreshed and the refreshing time in the refreshing table.
- The central cache node of claim 32, wherein the central cache node further comprises a timed delete module,and the timing deleting module is used for deleting the URL of the resource to be refreshed and the refreshing time recorded in the refreshing table after a preset time.
- The central caching node of claim 32,the receiving module is further configured to receive a third source returning request sent by the edge cache node, where the third source returning request carries the URL of the resource to be refreshed;the judging module is further configured to determine that the URL of the resource to be refreshed is not in the refresh table and that the URL of the resource to be refreshed hits in the cache;the sending module is further configured to send resource access request response information to the edge cache node, where the resource access request response information carries the resource to be refreshed, when the judging module determines that the URL of the resource to be refreshed is not in the refresh table and the URL of the resource to be refreshed hits in the cache.
- A central cache node comprising a memory storing program instructions and a processor executing the program instructions to perform the method of any of claims 1 to 10.
- An edge cache node comprising a memory storing program instructions and a processor executing the program instructions to perform the method of any of claims 11 to 17.
- A computer-readable storage medium having stored therein instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 10.
- A computer readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the method of any of claims 11 to 17.
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/096028 WO2021007752A1 (en) | 2019-07-15 | 2019-07-15 | Return-to-source method and related device in content delivery network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112513830A true CN112513830A (en) | 2021-03-16 |
Family
ID=74209687
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201980008635.7A Pending CN112513830A (en) | 2019-07-15 | 2019-07-15 | Back-source method and related device in content distribution network |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN112513830A (en) |
WO (1) | WO2021007752A1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113691581A (en) * | 2021-07-08 | 2021-11-23 | 杭州又拍云科技有限公司 | Efficient CDN (content delivery network) fragment refreshing method |
CN114125060A (en) * | 2021-09-28 | 2022-03-01 | 北京知道创宇信息技术股份有限公司 | Resource caching method and device, electronic equipment and readable storage medium |
CN115022177A (en) * | 2022-06-08 | 2022-09-06 | 阿里巴巴(中国)有限公司 | CDN system, back-to-source method, CDN node and storage medium |
US20230022141A1 (en) * | 2019-11-27 | 2023-01-26 | Beijing Kingsoft Cloud Network Technology Co., Ltd | Url refreshing method, apparatus and device in cdn, and cdn node |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113271359A (en) * | 2021-05-19 | 2021-08-17 | 北京百度网讯科技有限公司 | Method and device for refreshing cache data, electronic equipment and storage medium |
CN114979025B (en) * | 2022-04-13 | 2023-10-24 | 网宿科技股份有限公司 | Resource refreshing method, device, equipment and readable storage medium |
CN115883659B (en) * | 2022-12-15 | 2023-10-03 | 江苏云工场信息技术有限公司 | Method and device for supporting batch refreshing of CDN caches |
CN117194827B (en) * | 2023-11-08 | 2024-02-27 | 联通在线信息科技有限公司 | CDN directory refreshing method and electronic equipment |
CN119211360A (en) * | 2024-11-26 | 2024-12-27 | 天翼云科技有限公司 | Data acquisition method, device, computer equipment, storage medium and computer program product |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104935680A (en) * | 2015-06-18 | 2015-09-23 | 中国互联网络信息中心 | A recursive domain name service system and method for multi-level shared cache |
CN106202112A (en) * | 2015-05-06 | 2016-12-07 | 阿里巴巴集团控股有限公司 | CACHE DIRECTORY method for refreshing and device |
CN107277561A (en) * | 2016-04-08 | 2017-10-20 | 北京优朋普乐科技有限公司 | Content distributing network |
CN107277092A (en) * | 2016-04-08 | 2017-10-20 | 北京优朋普乐科技有限公司 | Content distributing network and its data download method |
CN108416016A (en) * | 2018-03-05 | 2018-08-17 | 北京云端智度科技有限公司 | A kind of CDN is by prefix caching sweep-out method and system |
CN108696895A (en) * | 2017-04-07 | 2018-10-23 | 华为技术有限公司 | Resource acquiring method, apparatus and system |
CN109542613A (en) * | 2017-09-22 | 2019-03-29 | 中兴通讯股份有限公司 | Distribution method, device and the storage medium of service dispatch in a kind of CDN node |
CN109639801A (en) * | 2018-12-17 | 2019-04-16 | 深圳市网心科技有限公司 | Back end distribution and data capture method and system |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8539160B2 (en) * | 2009-09-10 | 2013-09-17 | Red Hat, Inc. | Asynchronous cache refresh for systems with a heavy load |
US10530888B2 (en) * | 2016-06-01 | 2020-01-07 | Home Box Office, Inc. | Cached data expiration and refresh |
CN107465707B (en) * | 2016-06-03 | 2021-02-02 | 阿里巴巴集团控股有限公司 | Content refreshing method and device for content distribution network |
CN106375471B (en) * | 2016-09-29 | 2019-12-13 | 北京奇艺世纪科技有限公司 | Edge node determination method and device |
-
2019
- 2019-07-15 WO PCT/CN2019/096028 patent/WO2021007752A1/en active Application Filing
- 2019-07-15 CN CN201980008635.7A patent/CN112513830A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106202112A (en) * | 2015-05-06 | 2016-12-07 | 阿里巴巴集团控股有限公司 | CACHE DIRECTORY method for refreshing and device |
CN104935680A (en) * | 2015-06-18 | 2015-09-23 | 中国互联网络信息中心 | A recursive domain name service system and method for multi-level shared cache |
CN107277561A (en) * | 2016-04-08 | 2017-10-20 | 北京优朋普乐科技有限公司 | Content distributing network |
CN107277092A (en) * | 2016-04-08 | 2017-10-20 | 北京优朋普乐科技有限公司 | Content distributing network and its data download method |
CN108696895A (en) * | 2017-04-07 | 2018-10-23 | 华为技术有限公司 | Resource acquiring method, apparatus and system |
CN109542613A (en) * | 2017-09-22 | 2019-03-29 | 中兴通讯股份有限公司 | Distribution method, device and the storage medium of service dispatch in a kind of CDN node |
CN108416016A (en) * | 2018-03-05 | 2018-08-17 | 北京云端智度科技有限公司 | A kind of CDN is by prefix caching sweep-out method and system |
CN109639801A (en) * | 2018-12-17 | 2019-04-16 | 深圳市网心科技有限公司 | Back end distribution and data capture method and system |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20230022141A1 (en) * | 2019-11-27 | 2023-01-26 | Beijing Kingsoft Cloud Network Technology Co., Ltd | Url refreshing method, apparatus and device in cdn, and cdn node |
US12067069B2 (en) * | 2019-11-27 | 2024-08-20 | Beijing Kingsoft Cloud Network Technology Co., Ltd. | URL refreshing method, apparatus and device in CDN, and CDN node |
CN113691581A (en) * | 2021-07-08 | 2021-11-23 | 杭州又拍云科技有限公司 | Efficient CDN (content delivery network) fragment refreshing method |
CN113691581B (en) * | 2021-07-08 | 2023-05-09 | 杭州又拍云科技有限公司 | Efficient CDN refreshing and slicing method |
CN114125060A (en) * | 2021-09-28 | 2022-03-01 | 北京知道创宇信息技术股份有限公司 | Resource caching method and device, electronic equipment and readable storage medium |
CN114125060B (en) * | 2021-09-28 | 2023-10-13 | 北京知道创宇信息技术股份有限公司 | Resource caching method and device, electronic equipment and readable storage medium |
CN115022177A (en) * | 2022-06-08 | 2022-09-06 | 阿里巴巴(中国)有限公司 | CDN system, back-to-source method, CDN node and storage medium |
CN115022177B (en) * | 2022-06-08 | 2023-10-24 | 阿里巴巴(中国)有限公司 | CDN system, source returning method, CDN node and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2021007752A1 (en) | 2021-01-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112513830A (en) | Back-source method and related device in content distribution network | |
US9148332B2 (en) | Content delivery network | |
US10489476B2 (en) | Methods and devices for preloading webpages | |
US11463753B2 (en) | Method and apparatus for downloading resources | |
US9906595B2 (en) | Content source discovery | |
US20150237113A1 (en) | Method and system for file transmission | |
EP2985705A2 (en) | Webpage access method and apparatus, and router | |
US9386099B2 (en) | Local caching device, system and method for providing content caching service | |
US20160323238A1 (en) | Ip management method, client and server | |
US10742754B2 (en) | Persistent edge state of end user devices at cache nodes | |
CN109167840B (en) | Task pushing method, node autonomous server and edge cache server | |
US11042357B2 (en) | Server and method for ranking data sources | |
US11206302B2 (en) | Method and device for feeding back a resource file | |
US20210176301A1 (en) | Method and apparatus for multi-vendor gtm fabric | |
WO2021104458A1 (en) | Domain name query method and related device | |
CN115080272A (en) | A business data processing method, electronic device and storage medium | |
CN113364887B (en) | File downloading method based on FTP, proxy server and system | |
CN104980311A (en) | Method, device and system for predicting network access | |
CN114979025B (en) | Resource refreshing method, device, equipment and readable storage medium | |
US20160344838A1 (en) | Caching of tracking elements in network content | |
CN110581883B (en) | Content distribution method, content distribution device, content request device, and routing node | |
CN105897832A (en) | Service data providing server, method and system | |
KR102412988B1 (en) | Method for controlling of contents transmition, apparatus thereof, computer-readable medium and program thereof | |
US10812612B2 (en) | Execution of per-user functions at cache nodes | |
WO2015165034A1 (en) | Webpage loading method and device |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220222 Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province Applicant after: Huawei Cloud Computing Technologies Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Applicant before: HUAWEI TECHNOLOGIES Co.,Ltd. |