Content delivery network based resource pre-warming method, system, device and medium
By constructing IP acquisition and access requests in the content delivery network, the problem of resource preheating failure is solved, and higher preheating accuracy and resource access speed are achieved, thus determining whether edge nodes have cached resources.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING VOLCANO ENGINE TECH CO LTD
- Filing Date
- 2023-07-26
- Publication Date
- 2026-05-12
AI Technical Summary
In existing technologies, content delivery networks (CDNs) suffer from the problem of some edge nodes failing to warm up resources, resulting in insufficient accuracy in resource warming.
By constructing an IP acquisition request, the IP address of the edge node that the client needs to connect to is obtained. An access request is sent to determine whether the edge node has cached the resource. If it is not cached, the resource is preheated to ensure that the edge node successfully caches the resource.
This improved the accuracy of resource preheating, ensuring that all edge nodes successfully cached resources in the preheating area, reducing the pressure on the origin server and improving resource access speed.
Smart Images

Figure CN116846868B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Internet technology, specifically to a resource preheating method, system, device, and medium based on a content delivery network. Background Technology
[0002] Content Delivery Networks (CDNs) improve resource access response speed by deploying edge nodes in various regions, allowing users to access resources from the nearest edge node. Specifically, when a user requests a target resource through a client, if the edge node has cached the target resource, it directly returns the locally cached resource to the client. If the edge node has not cached the target resource, it retrieves the target resource from the origin server, returns it to the client, and caches it locally. This way, the next time the client requests the target resource, the edge node can directly retrieve it from its local cache without having to retrieve it from the origin server again. Resource pre-warming involves pushing resources from the origin server to edge nodes for caching in advance. This allows edge nodes to directly retrieve resources from their local cache when a client requests them, improving resource access response speed and alleviating pressure on the origin server.
[0003] Currently, there is an issue where some edge nodes fail to warm up during resource preheating. Simply put, resources that need to be preheated are not cached on some edge nodes, and the accuracy of resource preheating needs improvement. Summary of the Invention
[0004] In view of this, the present disclosure provides a resource preheating method, a resource preheating system, an electronic device, and a computer-readable storage medium, which can improve the accuracy of resource preheating.
[0005] This disclosure provides a resource preheating method based on a content delivery network, wherein the content delivery network includes multiple edge nodes for resource caching; the method includes:
[0006] Based on the domain name that needs to be preheated and the client's first IP address in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node that the client needs to connect to;
[0007] Based on the second IP address, an access request is sent to the first edge node to determine whether the first edge node has cached the resources under the domain name;
[0008] If the first edge node does not cache the resources under the domain name, the resources under the domain name are preheated at the first edge node.
[0009] This disclosure also provides a resource preheating system based on a content delivery network, the content delivery network including multiple edge nodes for resource caching; the system includes:
[0010] The construction module is used to construct an IP acquisition request based on the domain name that needs to be preheated and the client's first IP address in the preheating area, so as to obtain the second IP address of the first edge node that the client needs to connect to;
[0011] The access module is used to send an access request to the first edge node based on the second IP address to determine whether the first edge node has cached the resources under the domain name;
[0012] The preheating module is used to preheat the resources under the domain name at the first edge node if the first edge node does not cache the resources under the domain name.
[0013] In another aspect, this disclosure provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the method described above.
[0014] In another aspect, this disclosure provides an electronic device including a processor and a memory, the memory being used to store a computer program that, when executed by the processor, implements the method described above.
[0015] In some embodiments of this application, based on the domain name requiring resource preheating and the client's first IP address in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node the client needs to connect to. Based on the second IP address, an access request is sent to the first edge node to determine whether the first edge node has cached the resources under the domain name. If not, the resources under the domain name are re-preheated at the first edge node. This allows for checking the preheating result of the first edge node and, in the event of preheating failure, re-preheating the resources to ensure that the first edge node can successfully cache the resources under the domain name, thereby improving the accuracy of resource preheating. Attached Figure Description
[0016] The features and advantages of this disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the scope of this disclosure in any way.
[0017] Figure 1 A schematic diagram of the architecture of a content delivery network provided in one embodiment of this application is shown;
[0018] Figure 2A schematic flowchart of a resource preheating method provided in one embodiment of this application is shown;
[0019] Figure 3 A schematic diagram of a resource preheating system provided in one embodiment of this application is shown;
[0020] Figure 4 A schematic diagram of an electronic device provided in one embodiment of this application is shown. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of them. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0022] Please see Figure 1 This is a schematic diagram of the architecture of a content delivery network 100 provided in one embodiment of this application. Figure 1 In this context, the content delivery network 100 includes an origin server 11, a caching system 12, and a management platform 13 for managing the content delivery network 100. Wherein:
[0023] Source station 11 can be a server device that provides resources. Resources can refer to information content that is recorded in digital form, stored in computer storage media, and allowed to be transmitted through computer network communication, such as images, sounds, and text.
[0024] The caching system 12 can cache at least a portion of the resources in the origin server 11. In this embodiment, the caching system 12 includes multiple edge nodes 122 for resource caching and secondary cache nodes 121 connected to the edge nodes 122. The edge nodes 122 are communicatively connected to the origin server 11 through the secondary cache nodes 121. One or more edge nodes 122 can be connected to the same secondary cache node 121, and the same edge node 122 can be connected to different secondary cache nodes 121. In some other embodiments, the caching system 12 may include other levels of cache nodes besides the edge nodes 122 and the secondary cache nodes 121. For example, the caching system 12 may also include tertiary cache nodes between the secondary cache nodes 121 and the origin server 11.
[0025] Different edge nodes 122 can be deployed in different geographical regions. Clients in each geographical region can access resources in the origin server 11 by accessing the edge node 122 in their geographical region or an adjacent geographical region.
[0026] Specifically, the management platform 13 may include a domain name resolution system 131. When a client accesses resources based on a domain name, it can establish a connection with the domain name resolution system 131. The domain name resolution system 131 determines the geographical region where the client is located based on the client's IP address and resolves the domain name, resolving the target edge node 122 (e.g., the one closest to the client) to the target edge node 122 (e.g., the one closest to the client). Figure 1 The IP address of edge node 122 is returned to the client. Based on the IP address returned by the domain name resolution system 131, the client initiates a resource access request to the target edge node 122. In response to the client's resource access request, the target edge node 122 checks whether the resource to be accessed by the client is already cached locally. If it is cached, it directly returns the cached resource to the client; if not, it checks whether the resource to be accessed by the client is cached in the connected secondary cache node 121. If the secondary cache node 121 has cached the resource to be accessed by the client, the target edge node 122 retrieves the resource from the secondary cache node 121 and returns the retrieved resource, along with the resource retrieved locally, to the client. In this way, when the client initiates another access request for the same resource, the target edge node 122 can directly retrieve the resource from its local cache, improving the response speed of resource access.
[0027] When neither the target edge node 122 nor the secondary cache node 121 connected to the target edge node 122 has cached the resource to be accessed by the client, the target edge node 122 can obtain the resource from the origin server 11 and return the obtained resource to the client, as well as cache the obtained resource locally. This process is also known as "back-to-origin".
[0028] Resource preheating refers to pushing resources from origin server 11 to edge node 122 for caching in advance. This alleviates the pressure on origin server 11. For example, after preheating resources for a certain domain on edge node 122, when a client accesses resources under that domain, edge node 122 does not need to retrieve resources from origin server 11, thus relieving the pressure on origin server 11. Specifically, users can set the resources that need to be preheated and the target geographical area for resource preheating in the management platform 13. The management platform 13, through scheduling management, pushes the resources that need to be preheated from origin server 11 to edge node 122 in the target geographical area for caching.
[0029] Currently, when the content delivery network 100 is preheating resources, some edge nodes 122 that need to be preheated may be missed, and the accuracy of resource preheating needs to be improved.
[0030] Therefore, this application provides a resource preheating method based on a content delivery network (CDN), which can improve the accuracy of resource preheating. The resource preheating method can be applied to the management platform of a CDN. For ease of understanding, before detailing the method of this application, the relevant concepts and overall approach will be explained.
[0031] In this application's method, for domains requiring resource preheating, the resources under these domains need to be pushed to edge nodes for caching. The preheating region represents the geographical area where resource preheating takes place. For example, assuming the domain requiring resource preheating is www.abc.com and the preheating region is region A, then the resources under the domain www.abc.com are pushed to edge nodes in region A for caching. In some embodiments, pushing the resources under a domain to edge nodes in the preheating region for caching can include the following two methods:
[0032] 1) Push resources under the domain name to the upper-level cache node connected to the edge node for caching. The upper-level cache node can be a cache node located between the edge node and the origin server, such as a second-level cache node or a third-level cache node.
[0033] 2) Push the resources from the origin server to the edge node for local caching.
[0034] In the specific implementation process, resources can be preheated based on one of the above methods.
[0035] To ensure successful preheating of resources under a domain name on edge nodes, the management platform can send access requests to edge nodes based on their IP addresses within the preheating zone to check if the edge nodes have cached the resources. If the edge node has cached the resources, the preheating of the resources under the domain name has been successful; if the edge node has not cached the resources, the preheating of the resources under the domain name has failed. This check can identify edge nodes that have failed to preheat, and the resources under the domain name can be re-preheated on those edge nodes, ensuring that the resources under the domain name are successfully preheated on all edge nodes within the preheating zone. This improves the accuracy of preheating.
[0036] Based on the above description, please refer to Figure 2 This is a schematic flowchart of a resource preheating method provided in one embodiment of this application. Figure 2 In this context, the resource preheating method includes the following steps:
[0037] Step S21: Based on the domain name that needs to be preheated and the client's first IP address in the preheating area, construct an IP acquisition request to obtain the second IP address of the first edge node that the client needs to connect to.
[0038] In simple terms, step S21 is the process of obtaining the IP addresses of the edge nodes. Combined with... Figure 1 The description explains that when a client retrieves resources under a domain name, it first obtains the IP address of the edge node it needs to connect to, and then connects to the corresponding edge node to access the resource. Therefore, based on the principle of the client obtaining the edge node's IP address, the client can be simulated to obtain the edge node's IP address. Specifically, an IP retrieval request can be constructed based on the EDNS (Extension Mechanisms for DNS) protocol, carrying the domain name that needs to be warmed up and the client's first IP address in the warm-up zone in the IP retrieval request. The domain name resolution system, based on the IP retrieval request, returns the second IP address of the first edge node the client needs to connect to (i.e., the IP address of the edge node in the warm-up zone has been obtained).
[0039] Specifically, the format of an IP address retrieval request can be:
[0040] https: / / edns.xxx.com / q?host=aaa.bbb.com&ip=1.1.1.1
[0041] Here, edns.xxx.com can represent the domain name of the domain name resolution system;
[0042] aaa.bbb.com can represent a domain name that needs to be preheated with resources;
[0043] 1.1.1.1 can represent the client's first IP address in the warm-up zone.
[0044] Step S22: Send an access request to the first edge node based on the second IP address to determine whether the first edge node has cached the resources under the domain name.
[0045] In some embodiments, the first edge node has cached resources under the domain name, which may include the following two cases:
[0046] 1) The first edge node has already cached the resources under the domain name locally;
[0047] 2) The parent cache node connected to the first edge node has already cached resources under the domain name.
[0048] If any of the above conditions are met, it can be determined that the resources under the cached domain name of the first edge node are valid.
[0049] It is understandable that if the first edge node has cached resources under the domain name, these resources can come from two sources: one source is that the first edge node obtains and caches the resources from the origin server through a back-to-origin method based on resource access requests initiated by the client; the other source is that the resources are obtained and cached through a pre-warming method. In this application, when determining whether the first edge node caches resources under the domain name, the main focus is on determining whether the first edge node pre-caches the resources under the domain name through a pre-warming method.
[0050] To identify whether a first edge node possesses resources for a domain that are cached in a pre-warming manner, an access request can be sent to the first edge node based on a specified resource for that domain that has not been retrieved from the first edge node. The access request requests access to that specified resource. Since the client has not retrieved the specified resource from the first edge node, it can be guaranteed that the specified resource has not yet been cached to the first edge node via origin pull. Under this premise, based on the response returned by the first edge node, it can be determined whether the specified resource exists in the first edge node and its connected parent cache nodes. If neither the first edge node nor its connected parent cache nodes contain the specified resource, it can be determined that the first edge node has not cached the resource for that domain, and therefore, the pre-warming of the resource for that domain on the first edge node has failed. If the first edge node or its connected parent cache nodes contain the specified resource, it can be determined that the first edge node has cached the resource for that domain, and therefore, the pre-warming of the resource for that domain on the first edge node has been successful.
[0051] The following explains how to determine whether the specified resource exists in the first edge node and its connected parent cache node based on the response returned by the first edge node. For example, suppose the domain name is aaa.bbb.com, and the URL of the specified resource is http: / / aaa.bbb.com / new.txt. After sending an access request to the first edge node for the specified resource, the response returned by the first edge node may look like the following:
[0052] <X-Cache:TCP_MISS from
[0053] a23-200-24-95.deploy.akamaitechnologies.com
[0054] (AkamaiGHost / 11.1.0-48603064)(-)
[0055] <X-Cache-Remote:TCP_MISS from
[0056] a23-50-232-195.deploy.akamaitechnologies.com
[0057] (AkamaiGHost / 11.1.0-48603064)(-)
[0058] Among them, X-Cache:TCP_MISS from a23-200-24-95 indicates that the IP address of the first edge node is 23.200.24.95, and the hit status of the first edge node for the specified resource is "TCP_MISS", that is, the first edge node did not hit (cache) the specified resource.
[0059] X-Cache-Remote:TCP_MISS from a23-50-232-195: This indicates that the IP address of the secondary cache node connected to the first edge node is 23.50.232.195, and the hit status of the secondary cache node for the specified resource is "TCP_MISS", meaning that the secondary cache node did not hit (cache) the specified resource.
[0060] Based on the above response, it can be determined that the first edge node did not cache the specified resource, that is, the resource under the domain name failed to be warmed up on the first edge node.
[0061] However, if the response returned by the first edge node shows that the hit status of the first edge node or the upper-level cache node (such as the second-level cache node) connected to the first edge node for the specified resource is not "TCP_MISS", it means that the first edge node or the upper-level cache node connected to the first edge node has hit (cached) the specified resource, and the resource under the domain name has been successfully warmed up by the first edge node.
[0062] For example, in the following response:
[0063] <X-Cache:TCP_MISS from
[0064] a23-200-24-95.deploy.akamaitechnologies.com
[0065] (AkamaiGHost / 11.1.0-48603064)(-)
[0066] <X-Cache-Remote:TCP_HIT from
[0067] a23-50-232-195.deploy.akamaitechnologies.com
[0068] (AkamaiGHost / 11.1.0-48603064)(-)
[0069] <Server-Timing:cdn-cache;desc=MISS,edge;dur=189
[0070] The first edge node has a hit status of "TCP_MISS" for the specified resource, and the second-level cache node connected to the first edge node has a hit status of "TCP_HIT" for the specified resource. Since the second-level cache node connected to the first edge node has cached the specified resource, it can be determined that the resource under the domain name has been successfully warmed up at the first edge node.
[0071] At this point, it can be determined whether the resources under the domain name have been successfully cached on the first edge node.
[0072] Step S23: If the first edge node does not cache the resources under the domain name, the first edge node preheats the resources under the domain name.
[0073] Specifically, resources under a domain name can be cached on the first edge node or the upper-level cache node connected to the first edge node. Resource preheating is a standard technique in this field and will not be elaborated upon here.
[0074] In summary, in the technical solutions of some embodiments of this application, based on the domain name that needs resource preheating and the client's first IP address in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node that the client needs to connect to. Based on the second IP address, an access request is sent to the first edge node to determine whether the first edge node caches the resources under the domain name. If not, the resources under the domain name are re-preheated on the first edge node. In this way, the preheating result of the first edge node can be checked, and in the case of preheating failure, resource preheating can be re-performed to ensure that the first edge node can successfully cache the resources under the domain name, thereby improving the accuracy of resource preheating.
[0075] Furthermore, since the preheating area may contain a large number of edge nodes, the following describes how to perform batch checks and preheating of edge nodes in the preheating area.
[0076] Since edge nodes in the preheating area are typically located in different geographical locations, and clients access edge nodes from the nearest available node, the second IP addresses of edge nodes in different geographical locations can be obtained based on the first IP address of clients in each network area within the preheating area. A network area refers to a geographically defined region divided according to IP network segments. Those skilled in the art will understand that different cities have corresponding IP network segments. Further subdividing the IP network segments of each city can allow different regions within the same city to correspond to different network segments. These regions with different IP network segments can be considered network areas. Obtaining the IP addresses of clients in different IP network segments within the preheating area is equivalent to obtaining the first IP addresses of clients in each network area within the preheating area. For example, the client IP addresses in different IP network segments can be obtained from the Geo IP database.
[0077] In summary, based on the domain name requiring resource preheating and the client's first IP address in the preheating zone, an IP acquisition request can be constructed, which may include:
[0078] Obtain the first IP address of clients in different IP network segments within the preheating area;
[0079] Based on the domain name and the first IP address of each client, an IP acquisition request is constructed to obtain the second IP address of the first edge node that each client needs to connect to.
[0080] Furthermore, since different clients within the same network area typically connect to the same first edge node, meaning that the second IP address of the first edge node is the same for different clients within the same network area, only one preheating result check or resource preheating is needed for the same first edge node. Therefore, when obtaining the first IP address of clients in different IP network segments within the preheating area, the first IP address of one client can be obtained from each IP network segment within the preheating area. This reduces data processing volume and avoids performing multiple preheating result checks or resource preheating for the same first edge node.
[0081] After the client, based on different IP network segments, obtains the second IP addresses of each first edge node from its first IP address, a first correspondence is formed between the client's first IP address and the second IP address of the first edge node to which the client needs to connect. Based on this first correspondence, the warm-up results of each first edge node can be checked. Table 1 lists the first correspondence as an example:
[0082] Table 1 First Correspondence
[0083] The client's first IP address The second IP address of the first edge node 1.1.1.1 11.11.11.11 2.2.2.2 22.22.22.22 3.3.3.3 22.22.22.22 4.4.4.4 44.44.44.41 5.5.5.5 44.44.44.42
[0084] As shown in Table 1, in the first correspondence, different clients' first IP addresses may correspond to the same second IP address of the same first edge node. This occurs because clients in two network areas may connect to the same first edge node (e.g., 22.22.22.22) when retrieving resources under a domain name. For example, clients in city A and city B may both connect to the first edge node of city A when retrieving resources. In this case, if the first edge node is checked based on the first correspondence in Table 1, the same first edge node may be checked repeatedly. To avoid this, a deduplication operation can be performed on the first correspondence. That is, if multiple first IP addresses correspond to the same second IP address, among these multiple first IP addresses, retain one of the correspondences and delete the others. For example, in Table 1, the correspondence between 2.2.2.2 and 22.22.22.22 can be retained, while the correspondence between 3.3.3.3 and 22.22.22.22 can be deleted. Thus, when checking the preheating results of the first edge node 22.22.22.22, only one operation needs to be performed.
[0085] Furthermore, in some embodiments, for first edge nodes belonging to the same IP network segment, these two first edge nodes can be considered to belong to the same data center, and only one first edge node needs to be checked for the warm-up results. Therefore, the first correspondence can be further deduplicated. That is, if multiple second IP addresses have the same IP network segment, among these multiple second IP addresses, the correspondence between one second IP address and the first IP address is retained, and the correspondences between the other second IP addresses and the first IP address are deleted. For example, in Table 1, among the second IP addresses of the first edge nodes, 44.44.44.41 and 44.44.44.42 have the same IP network segment, so the correspondence between 44.44.44.41 and 4.4.4.4 can be retained, and the correspondence between 44.44.44.41 and 5.5.5.5 can be deleted.
[0086] At this point, after performing the deduplication operation on the first correspondence in Table 1, we can obtain the result shown in Table 2.
[0087] Table 2 First correspondence after deduplication
[0088] The client's first IP address The second IP address of the first edge node 1.1.1.1 11.11.11.11 2.2.2.2 22.22.22.22 4.4.4.4 44.44.44.41
[0089] Furthermore, when sending access requests to the first edge node based on the second IP address, the access requests can be sent to the first edge node separately based on the second IP address in the first mapping after deduplication, to determine whether each first edge node has cached the resources under the domain name. This reduces data processing volume and prevents duplicate access requests from being sent to the same first edge node or the first edge node in the same data center.
[0090] It is understandable that, based on the second IP address in the first correspondence after the deduplication operation, after sending access requests to the first edge nodes respectively, the first edge nodes that have not cached domain name resources can be selected according to the responses of each first edge node, and then the resources under the domain name can be re-warmed on these first edge nodes.
[0091] In some embodiments, preheating resources under a domain name at the first edge node may include:
[0092] For any first edge node, if the first edge node does not cache resources under the domain name, the first edge node is designated as an edge node to be warmed up.
[0093] Establish a preheating coverage map, which represents the second correspondence between the domain name, the second IP address of the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated.
[0094] Based on the preheating coverage map, resources under the domain name are preheated at the edge nodes to be preheated.
[0095] In some embodiments, if the content delivery network includes an upper-level cache node connected to the edge node to be preheated, the preheating coverage map is also used to characterize a third correspondence between the domain name, the third IP address of the upper-level cache node connected to the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated.
[0096] Preheating resources under a domain name on edge nodes to be preheated includes:
[0097] Based on the preheating coverage map, the resources under the domain name are preheated on the upper-level cache nodes connected to the edge nodes to be preheated.
[0098] By establishing a preheating coverage map, it is suitable for batch preheating of resources on edge nodes in the preheating area, which is highly efficient. Simply put, when sending access requests to the first edge nodes based on the second IP address in the first mapping after deduplication, if a first edge node is found to have no cached domain name resources, it is not necessary to immediately preheat the resources. Instead, the preheating coverage map can be used to record these failed first edge nodes. After sending access requests to all first edge nodes, the failed first edge nodes can then be uniformly preheated based on the preheating coverage map, resulting in high efficiency.
[0099] The above-described scheme obtains the second IP addresses of each first edge node based on the client's first IP address in the preheating area, and checks the preheating results of each first edge node. However, in some cases, it may be impossible to obtain the client's first IP address. The following describes the implementation scheme for this specific situation.
[0100] In some embodiments, if the client's first IP address in the preheating area is not obtained, a request can be sent to the network device in the preheating area to enable the network device to send a resource access request to access the resources under the domain name. Then, based on the resource access response received by the network device, it can be determined whether the second edge node connected to the network device when accessing the resources under the domain name has cached the resources under the domain name.
[0101] Specifically, the management platform can communicate and connect with network devices. These network devices can send resource access requests based on domain names (i.e., the conventional way clients access resources). Similar to the above access requests, resource access requests can request access to unaccessed resources under a domain name. This prevents resources from being cached on edge nodes via origin requests.
[0102] The resource access response received by the network device can be similar to the following:
[0103] <X-Cache:TCP_MISS from a23-200-24-95.deploy.akamaitechnologies.com
[0104] (AkamaiGHost / 11.1.0-48603064)(-)
[0105] <X-Cache-Remote:TCP_MISS from a23-50-232-195.deploy.akamaitechnologies.com
[0106] (AkamaiGHost / 11.1.0-48603064)(-)
[0107] Similar to the description in step S22 above, based on the resource access response, it can be determined whether the fourth IP address of the second edge node to which the network device is connected, the fifth IP address of the upper-level cache node to which the second edge node is connected, and whether the second edge node and the upper-level cache node to which the second edge node are connected have hit the accessed resource. For example, in the above resource access response, it indicates that the fourth IP address of the second edge node to which the network device is connected is 23.200.24.95, the third IP address of the upper-level cache node to which the second edge node is connected is 23.50.232.195, and neither the second edge node nor the upper-level cache node to which the second edge node is connected has hit the resource under the domain name. In this case, it can be considered that the second edge node 23.200.24.95 failed to warm up the resource under the domain name and needs to re-warm up the resource. That is, if it is determined from the resource access response received by the network device that the edge node of the content delivery network has not cached the resource under the domain name, the resource under the domain name is warmed up at the second edge node based on the fourth IP address; or the resource under the domain name is warmed up at the upper-level cache node to which the second edge node is connected based on the fifth IP address.
[0108] In this way, even without obtaining the client's first IP address in the preheating area, the resource preheating status of each edge node can still be checked, making the solution more reliable.
[0109] Please see Figure 3 This is a schematic diagram of a resource preheating system based on a content delivery network, provided as an embodiment of this application. The resource preheating system includes:
[0110] The module is used to construct an IP acquisition request based on the domain name that needs to be preheated and the client's first IP address in the preheating area, so as to obtain the second IP address of the first edge node that the client needs to connect to.
[0111] The access module is used to send an access request to the first edge node based on the second IP address to determine whether the first edge node has cached the resources under the domain name;
[0112] The preheating module is used to preheat the resources under the domain name on the first edge node if the first edge node does not cache the resources under the domain name.
[0113] In some embodiments, the construction module is specifically used for:
[0114] Obtain the first IP address of clients in different IP network segments within the preheating area;
[0115] Based on the domain name and the first IP address of each client, an IP acquisition request is constructed to obtain the second IP address of the first edge node that each client needs to connect to.
[0116] In some embodiments, the construction module is specifically used for:
[0117] Obtain the first IP address of one client from each IP network segment in the preheating area.
[0118] In some embodiments, the client's first IP address and the second IP address of the first edge node to which the client needs to connect form a first correspondence; the access module is specifically used for:
[0119] Perform a deduplication operation on the first correspondence;
[0120] Based on the second IP address in the first correspondence after deduplication, access requests are sent to the first edge nodes to determine whether each first edge node has cached the resources under the domain name.
[0121] In some embodiments, the access module is specifically used for:
[0122] If multiple first IP addresses correspond to the same second IP address, among the multiple first IP addresses, retain the correspondence between one first IP address and the second IP address, and delete the correspondences between the other first IP addresses and the second IP address; and / or
[0123] If multiple second IP addresses share the same IP network segment, among these multiple second IP addresses, retain the mapping between one second IP address and the first IP address, and delete the mappings between the other second IP addresses and the first IP address.
[0124] In some embodiments, the preheating module is specifically used for:
[0125] For any first edge node, if the first edge node does not cache resources under the domain name, the first edge node is designated as an edge node to be warmed up.
[0126] Establish a preheating coverage map, which represents the second correspondence between the domain name, the second IP address of the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated.
[0127] Based on the preheating coverage map, resources under the domain name are preheated at the edge nodes to be preheated.
[0128] In some embodiments, the content delivery network further includes an upper-level cache node connected to the edge node to be preheated, and the preheating coverage map is further used to represent a third correspondence between the domain name, the third IP address of the upper-level cache node connected to the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated; the preheating module is specifically used for:
[0129] Based on the preheating coverage map, the resources under the domain name are preheated on the upper-level cache nodes connected to the edge nodes to be preheated.
[0130] In some embodiments, the content delivery network further includes an upper-level cache node connected to the first edge node; the access module is specifically used for:
[0131] Send an access request to the first edge node based on the specified resource under the domain name that has not been obtained from the first edge node;
[0132] If neither the first edge node nor the parent cache node connected to the first edge node has the specified resource, it is determined that the first edge node does not cache the resource under the domain name.
[0133] In some embodiments, if the client's first IP address in the preheating area is not obtained, the access module is specifically used for:
[0134] Send a request to the network devices in the preheating area so that the network devices can send resource access requests to access resources under the domain name;
[0135] Based on the resource access response received by the network device, determine whether the second edge node connected to the network device has cached the resource under the domain name when accessing the resource under the domain name.
[0136] In some embodiments, the resource access response further includes a fourth IP address of the second edge node and a fifth IP address of the upstream cache node connected to the second edge node; the preheating module is specifically used for:
[0137] If, based on the resource access response received by the network device, it is determined that the second edge node has not cached the resources under the domain name, then, based on the fourth IP address, the resources under the domain name are preheated at the second edge node.
[0138] Alternatively, based on the fifth IP address, the upper-level cache node connected to the second edge node can preheat the resources under the domain name.
[0139] Please see Figure 4 The diagram below illustrates an electronic device according to an embodiment of this application. The electronic device includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the method described above.
[0140] The processor can be a central processing unit (CPU). It can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or combinations thereof.
[0141] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods in the above-described embodiments.
[0142] The memory may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0143] One embodiment of this application also provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the above-described method.
[0144] Although embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A resource preheating method based on a content delivery network, characterized in that, The content delivery network includes multiple edge nodes for resource caching; the method includes: Based on the domain name that needs to be preheated and the client's first IP address in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node that the client needs to connect to; Based on the second IP address, an access request is sent to the first edge node to determine whether the first edge node has cached the resources under the domain name; If the first edge node does not cache the resources under the domain name, the resources under the domain name are preheated at the first edge node.
2. The method as described in claim 1, characterized in that, The process of constructing an IP acquisition request based on the domain name requiring resource preheating and the client's first IP address in the preheating area includes: Obtain the first IP address of clients in different IP network segments within the preheating area; Based on the domain name and the first IP address of each client, an IP acquisition request is constructed to obtain the second IP address of the first edge node that each client needs to connect to.
3. The method as described in claim 2, characterized in that, The step of obtaining the first IP address of clients in different IP network segments in the preheating area includes: Obtain the first IP address of one of the clients under each IP network segment in the preheating area.
4. The method as described in claim 2, characterized in that, The first IP address of the client and the second IP address of the first edge node to which the client needs to connect form a first correspondence; Sending an access request to the first edge node based on the second IP address includes: Perform a deduplication operation on the first correspondence; Based on the second IP address in the first correspondence after deduplication, access requests are sent to the first edge nodes to determine whether each first edge node has cached the resources under the domain name.
5. The method as described in claim 4, characterized in that, The step of performing a deduplication operation on the first correspondence includes: If multiple first IP addresses correspond to the same second IP address, among the multiple first IP addresses, retain one of the correspondences and delete the others; and / or If multiple second IP addresses share the same IP network segment, among these multiple second IP addresses, retain the correspondence between one second IP address and the first IP address, and delete the correspondences between the other second IP addresses and the first IP address.
6. The method as described in claim 4, characterized in that, The preheating of resources under the domain name at the first edge node includes: For any of the first edge nodes, if the first edge node does not cache resources under the domain name, the first edge node is designated as an edge node to be warmed up. A preheating coverage map is established, which represents a second correspondence between the domain name, the second IP address of the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated; Based on the preheating coverage map, resources under the domain name are preheated at the edge nodes to be preheated.
7. The method as described in claim 6, characterized in that, The content delivery network also includes an upper-level cache node connected to the edge node to be preheated, and the preheating coverage map is also used to characterize the third correspondence between the domain name, the third IP address of the upper-level cache node connected to the edge node to be preheated, and the first IP address of the client connected to the edge node to be preheated; The preheating of resources under the domain name at the edge node to be preheated includes: Based on the preheating coverage map, the resources under the domain name are preheated on the upper-level cache node connected to the edge node to be preheated.
8. The method as described in claim 1, characterized in that, The content delivery network also includes an upper-level cache node connected to the first edge node; Sending an access request to the first edge node to determine whether the first edge node has cached resources under the domain name includes: Based on the specified resources under the domain name that have not been obtained from the first edge node, send an access request to the first edge node; If neither the first edge node nor the parent cache node connected to the first edge node has the specified resource, it is determined that the first edge node does not cache the resource under the domain name.
9. The method as described in claim 1, characterized in that, If the client's first IP address in the preheating area is not obtained, the method further includes: Send a request to the network devices in the preheating area to cause the network devices to send resource access requests to access resources under the domain name; Based on the resource access response received by the network device, it is determined whether the second edge node connected to the network device when accessing resources under the domain name has cached the resources under the domain name.
10. The method as described in claim 9, characterized in that, The resource access response also includes the fourth IP address of the second edge node and the fifth IP address of the upper-level cache node connected to the second edge node; If, based on the resource access response received by the network device, it is determined that the second edge node has not cached the resources under the domain name, the resources under the domain name are preheated at the second edge node based on the fourth IP address; Alternatively, based on the fifth IP address, the resources under the domain name can be preheated by the upper-level cache node connected to the second edge node.
11. A resource preheating system based on a content delivery network, characterized in that, The content delivery network includes multiple edge nodes for resource caching; the system includes: The construction module is used to construct an IP acquisition request based on the domain name that needs to be preheated and the client's first IP address in the preheating area, so as to obtain the second IP address of the first edge node that the client needs to connect to; The access module is used to send an access request to the first edge node based on the second IP address to determine whether the first edge node has cached the resources under the domain name; The preheating module is used to preheat the resources under the domain name at the first edge node if the first edge node does not cache the resources under the domain name.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 10.
13. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory being used to store a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 10.