Resource prefetching method and system based on content delivery network, device, and medium
By constructing IP requests and sending access requests to determine whether the edge node caches resources, and preheating when caching, the problem of insufficient preheating resource heating is solved, and the load balance of the resource access speed and the source station.
Patent Information
- Application Number
- PCT/CN2024/105089
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-26
- Filing Date
- 2024-07-12
- Publication Date
- 2025-01-30
AI Technical Summary
When preheating resources, some edge nodes fail to preheat, resulting in insufficient accuracy of resource preheating.
By constructing IP requests, obtain the IP address of the edge node that the client needs to connect, and send an access request to determine whether the edge node has cached the resources under the cache domain name. If it is not cached, the resource is preheated at the edge node.
It improves the accuracy of the preheating resource, ensuring that the resources under the field name are successfully preheated at the edge nodes, reducing the pressure of the source station and improving the response speed of resource access.
Smart Images

Figure CN2024105089_30012025_PF_FP_ABST
Abstract
Description
Resource preheating method, system, device and medium based on content distribution network
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese Patent Application No. 202310926857.5, filed on July 26, 2023, entitled “Resource Preheating Method, System, Device and Medium Based on Content Distribution Network,” the disclosure of which is incorporated herein by reference in its entirety. Technical Field
[0003] The present disclosure relates to the field of Internet technology, and in particular to a resource preheating method, system, device, and medium based on a content distribution network. Background Art
[0004] The Content Delivery Network (CDN) deploys edge nodes in various regions, allowing users to access resources from the nearest edge node, thereby improving the response speed of resource access. Specifically, when a user requests access to a target resource through a client, if the edge node has cached the target resource, the edge node directly returns the locally cached target resource to the client; if the edge node does not cache the target resource, the edge node obtains the target resource from the source station, then returns the obtained target resource to the client, and caches the target resource locally. In this way, the next time the client requests access to the target resource, the edge node can directly obtain the target resource from the local cache, without having to obtain the target resource from the source station. Resource preheating is to push resources from the source station to the edge node in advance for caching. In this way, when the client requests access to a resource, the edge node can directly obtain the resource from the local cache, without having to obtain the resource from the source station, which improves the response speed of resource access and relieves the pressure on the source station.
[0005] Currently, some edge nodes fail to preheat resources. Simply put, the resources that need to be preheated are not cached on some edge nodes, and the accuracy of resource preheating needs to be improved.
[0006] Summary of the Invention
[0007] In view of this, embodiments of the present disclosure provide 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.
[0008] In one aspect, the present disclosure provides a resource preheating method based on a content distribution network, wherein the content distribution network includes a plurality of edge nodes for resource caching; the method includes:
[0009] Based on the domain name that needs to be preheated and the first IP address of the client in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node to which the client needs to connect;
[0010] Sending an access request to the first edge node according to the second IP address to determine whether the first edge node has cached resources under the domain name;
[0011] 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.
[0012] Another aspect of the present disclosure provides a resource preheating system based on a content distribution network, wherein the content distribution network includes a plurality of edge nodes for resource caching; the system includes:
[0013] A construction module is used to construct an IP acquisition request based on the domain name that needs to be preheated and the first IP address of the client in the preheating area to obtain the second IP address of the first edge node to which the client needs to connect;
[0014] an access module, configured to send an access request to the first edge node according to the second IP address, so as to determine whether the first edge node has cached resources under the domain name;
[0015] The preheating module is configured to preheat the resources under the domain name at the first edge node if the first edge node has not cached the resources under the domain name.
[0016] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0017] On the other hand, the present disclosure further provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.
[0018] In the technical solutions of some embodiments of the present application, based on the domain name requiring resource preheating and the client's first IP address in the preheating zone, an IP acquisition request is constructed to obtain the second IP address of the first edge node to which the client is to connect. 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 preheated again at the first edge node. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0020] FIG1 shows a schematic diagram of the architecture of a content distribution network provided by some embodiments of the present application;
[0021] FIG2 is a schematic diagram showing a flow chart of a resource preheating method provided in some embodiments of the present application;
[0022] FIG3 shows a module schematic diagram of a resource preheating system provided in some embodiments of the present application;
[0023] FIG4 shows a schematic diagram of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0024] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0025] Please refer to Figure 1, which is a schematic diagram of the architecture of a content distribution network 100 provided in some embodiments of the present application. In Figure 1, the content distribution network 100 includes an origin station 11, a cache system 12, and a management platform 13 for managing the content distribution network 100.
[0026] The source station 11 may be a server device that provides resources. Resources may refer to information content such as images, sounds, and text that is recorded in digital form, stored in computer storage media, and allowed to be transmitted through computer network communication.
[0027] The cache system 12 can cache at least part of the resources in the source station 11. In this embodiment, the cache system 12 includes a plurality of edge nodes 122 for resource caching and a secondary cache node 121 connected to the edge node 122. The edge node 122 is communicatively connected to the source station 11 through the secondary cache node 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 cache system 12 may include cache nodes at other levels in addition to the edge node 122 and the secondary cache node 121. For example, between the secondary cache node 121 and the source station 11, the cache system 12 may also include a third-level cache node.
[0028] Different edge nodes 122 may be deployed in different geographical areas. Clients in each geographical area can access resources in the source station 11 by accessing the nearest edge node 122 in the geographical area or an adjacent geographical area.
[0029] Specifically, the management platform 13 may include a domain name resolution system 131. When a client accesses a resource based on a domain name, it may establish a connection with the domain name resolution system 131. The domain name resolution system 131 determines the client's geographic region based on the client's Internet Protocol (IP) address, resolves the domain name, and returns the IP address of a target edge node 122 (e.g., edge node 1 in FIG1 ) that is closer to the client 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 resource access request initiated by the client, the target edge node 122 checks whether the resource to be accessed by the client is already cached locally. If so, it directly returns the locally cached resource to the client. If not, it checks whether the resource to be accessed by the client is already cached in the connected secondary cache node 121. If the resource to be accessed by the client is already cached in the secondary cache node 121, the target edge node 122 obtains the resource from the secondary cache node 121 and returns the obtained resource to the client, while also locally caching the obtained resource. In this way, the next time the client initiates an access request for the same resource, the target edge node 122 can directly obtain the resource from the local cache, thereby improving the response speed of resource access.
[0030] When neither the target edge node 122 nor the secondary cache node 121 connected to the target edge node 122 caches the resource to be accessed by the client, the target edge node 122 can obtain the resource from the origin site 11, return the obtained resource to the client, and cache the obtained resource locally. This process is also called "return to the source."
[0031] The so-called resource preheating is to push the resources of the source station 11 to the edge node 122 for caching in advance. In this way, the pressure on the source station 11 can be relieved. For example, after the resources under a certain domain name are preheated on the edge node 122, when the client accesses the resources under the domain name, the edge node 122 no longer needs to obtain resources from the source station 11, thereby alleviating the pressure on the source station 11. Specifically, the user can set the resources that need to be preheated and the target geographical area where the resources need to be preheated on the management platform 13. Through scheduling management, the management platform 13 pushes the resources that need to be preheated from the source station 11 to the edge node 122 in the target geographical area for caching.
[0032] Currently, when the content distribution network 100 performs resource preheating, some edge nodes 122 that need to be preheated may be missed, and the accuracy of resource preheating needs to be improved.
[0033] In light of this, this application provides a resource preheating method based on a content distribution network (CDN), which can improve the accuracy of resource preheating. This resource preheating method can be applied to a content distribution network management platform. To facilitate understanding, before specifically elaborating on the method of this application, we first explain the relevant concepts and overall principles of this method.
[0034] In the method of this application, for domain names that need to be preheated, the resources under these domain names need to be pushed to the edge nodes for caching. The preheating area is used to represent the geographical area where the resources are preheated. For example, assuming that the domain name that needs to be preheated is www.abc.com and the preheating area is area A, then the resources under the domain name www.abc.com are pushed to the edge nodes in area A for caching. In some embodiments, pushing the resources under the domain name to the edge nodes in the preheating area for caching can include the following two methods:
[0035] 1) Push the resources under the domain name to the upper cache node connected to the edge node for caching. The upper 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.
[0036] 2) Push the resources of the source station to the edge node for local caching.
[0037] During the specific implementation process, resources can be preheated based on one of the above methods.
[0038] In order to ensure that the resources under the domain name are preheated successfully at the edge node, the management platform can send an access request to the edge node based on the IP address of the edge node in the preheating area to check whether the edge node has cached the resources under the domain name. If the edge node has cached the resources under the domain name, it means that the resources under the domain name have been preheated successfully at the edge node; if the edge node has not cached the resources under the domain name, it means that the resources under the domain name have failed to be preheated at the edge node. Through the above checks, the edge nodes that have failed to preheat can be screened out, and the resources under the domain name can be re-preheated at the edge nodes that have failed to preheat, to ensure that the resources under the domain name can be preheated successfully at each edge node in the preheating area. In this way, the purpose of improving the accuracy of preheating is achieved.
[0039] Based on the above description, please refer to Figure 2, which is a flow chart of a resource preheating method provided in some embodiments of the present application. In Figure 2, the resource preheating method includes the following steps:
[0040] Step S21: Based on the domain name requiring resource preheating and the first IP address of the client in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node to which the client needs to connect.
[0041] In simple terms, step S21 is the process of obtaining the IP address of the edge node. In combination with the description of Figure 1, when the client obtains resources under the domain name, it first obtains the IP address of the edge node to be connected, and then connects to the corresponding edge node to access the resources. Therefore, based on the principle that the client obtains the IP address of the edge node, the IP address of the edge node can be obtained by simulating the client. Specifically, an IP acquisition request can be constructed based on the DNS extension protocol (Extension Mechanisms for DNS, EDNS) protocol, and the domain name that needs to be preheated for resources and the first IP address of the client in the preheating area are carried in the IP acquisition request. The domain name resolution system returns the second IP address of the first edge node to which the client needs to connect based on the IP acquisition request (that is, the IP address of the edge node in the preheating area is obtained).
[0042] Specifically, the format of the IP acquisition request can be: https: / / edns.xxx.com / q?host=aaa.bbb.com&ip=1.1.1.1
[0043] Among them, edns.xxx.com can represent the domain name of the domain name resolution system;
[0044] aaa.bbb.com can represent a domain name that needs to be preheated.
[0045] 1.1.1.1 may represent the first IP address of the client in the preheating area.
[0046] Step S22: Send an access request to the first edge node according to the second IP address to determine whether the first edge node has cached the resources under the domain name.
[0047] In some embodiments, the first edge node has cached resources under the domain name, which may include the following two situations:
[0048] 1) The first edge node has already cached the resources under the domain name locally;
[0049] 2) The upper-level cache node connected to the first edge node has already cached the resources under the domain name.
[0050] As long as any of the above conditions is met, it can be determined that the first edge node has cached the resources under the domain name.
[0051] It is understandable that if the first edge node has cached resources under a domain name, these resources can come from two sources: one is that the first edge node obtains and caches the resources from the origin server through a back-to-source method based on a resource access request initiated by a client; the other is that the resources are obtained and cached through a pre-cache method. In this application, when determining whether the first edge node has cached resources under a domain name, the main focus is on determining whether the first edge node has pre-cache the resources under the domain name through a pre-cache method.
[0052] In order to identify whether the first edge node has resources under the domain name cached in a preheating manner, an access request can be sent to the first edge node based on the specified resource under the domain name that has not been obtained from the first edge node. The access request is used to request access to the specified resource. Since the client has not obtained the specified resource at the first edge node, it can be guaranteed that the specified resource has not been cached to the first edge node by returning to the source. Under the above premise, based on the response returned by the first edge node, it can be determined whether the first edge node and the upper cache node connected to the first edge node have the specified resource. If the first edge node and the upper cache node connected to the first edge node do not have the specified resource, it can be determined that the first edge node has not cached the resource under the domain name, and further, it can be determined that the resource under the domain name has failed to be preheated at the first edge node; if the first edge node or the upper cache node connected to the first edge node has the specified resource, it can be determined that the first edge node has cached the resource under the domain name, and further, it can be determined that the resource under the domain name has been preheated successfully at the first edge node.
[0053] The following describes how to determine whether the first edge node and the upper-level cache node connected to the first edge node have the specified resource to be accessed based on the response returned by the first edge node. For example, assume the domain name is aaa.bbb.com, and the Uniform Resource Locator (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 be similar to the following: <X-Cache:TCP_MISS from a23-200-24-95.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-) <X-Cache-Remote:TCP_MISS from a23-50-232-195.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-)
[0054] 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 does not hit (cache) the specified resource.
[0055] X-Cache-Remote:TCP_MISS from a23-50-232-195: Indicates that the IP address of the L2 cache node connected to the first edge node is 23.50.232.195, and the L2 cache node's hit status for the specified resource is "TCP_MISS." That is, the L2 cache node does not hit (cache) the specified resource.
[0056] Based on the above response, it can be determined that the first edge node does not cache the specified resource, that is, the resource under the domain name fails to be preheated on the first edge node.
[0057] However, if in the response returned by the first edge node, 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 hits (has cached) the specified resource, and the resource under the domain name is successfully preheated at the first edge node.
[0058] For example, in the following response: <X-Cache:TCP_MISS from a23-200-24-95.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-) <X-Cache-Remote:TCP_HIT from a23-50-232-195.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-)<Server-Timing:cdn-cache;desc=MISS,edge;dur=189
[0059] The hit status of the first edge node for the specified resource is "TCP_MISS", and the hit status of the secondary cache node connected to the first edge node for the specified resource is "TCP_HIT". Since the secondary cache node connected to the first edge node has cached the specified resource, it can be determined that the resource under the domain name is preheated successfully on the first edge node.
[0060] At this point, it can be determined whether the resources under the domain name have been successfully cached in the first edge node.
[0061] 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.
[0062] Specifically, the resources under the domain name can be cached to the first edge node or the upper cache node connected to the first edge node. As for resource preheating, it is a conventional technical means in this field and will not be described in detail here.
[0063] In summary, in the technical solutions of some embodiments of the present application, based on the domain name that needs to be preheated for resources and the first IP address of the client in the preheating area, the second IP address of the first edge node to which the client needs to connect is obtained by constructing an IP acquisition request, and 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 preheated again at the first edge node. In this way, the preheating result of the first edge node can be checked, and if the preheating fails, the resources can be preheated again to ensure that the first edge node can successfully cache the resources under the domain name, thereby improving the accuracy of resource preheating.
[0064] Furthermore, since the preheating area may include a large number of edge nodes, the following describes how to perform batch inspection and preheating on the edge nodes in the preheating area.
[0065] Since the edge nodes in the preheating area are usually located in different geographical locations, and the client accesses the edge node nearby, the second IP address of the edge node in the different geographical locations can be obtained based on the first IP address of the client in each network area in the preheating area. Network area refers to an area in a geographical location divided according to an IP network segment. It can be understood by those skilled in the art that different cities have corresponding IP network segments. Further division of the IP network segment of each city can make different areas under the same city correspond to different network segments. These areas with different IP network segments can be considered as network areas. Obtaining the IP address of the client in different IP network segments under the preheating area is equivalent to obtaining the first IP address of the client in each network area in the preheating area. Exemplarily, the IP addresses of the clients in different IP network segments can be obtained by querying from the geo IP database.
[0066] In summary, based on the domain name that needs to be preheated and the first IP address of the client in the preheating area, constructing an IP acquisition request may include:
[0067] Obtain the first IP address of the client in different IP segments in the preheating area;
[0068] An IP acquisition request is constructed based on the domain name and the first IP address of each client to obtain the second IP address of the first edge node to which each client needs to connect.
[0069] Furthermore, since different clients in the same network area are generally connected to the same first edge node, that is, in the same network area, the second IP address of the first edge node obtained based on the first IP addresses of different clients is the same. For the same first edge node, only one preheating result check or resource preheating is required. Therefore, when obtaining the first IP addresses of clients in different IP segments in the preheating area, the first IP address of one of the clients can be obtained under each IP segment in the preheating area. In this way, the amount of data processing is reduced, and at the same time, multiple preheating result checks or resource preheating are avoided for the same first edge node.
[0070] After obtaining the second IP address of each first edge node based on the first IP address of the client in different IP network segments, the first IP address of the client and the second IP address of the first edge node to which the client is to connect form a first correspondence. 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:
[0071] Table 1 First correspondence
[0072] As can be seen from Table 1, in the first correspondence, the first IP addresses of different clients may correspond to the second IP address of the same first edge node. This situation arises because clients in two network areas connect to the same first edge node (e.g., 22.22.22.22) when accessing resources under a domain name. For example, clients in City A and City B both connect to City A's first edge node when accessing 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 multiple times. To avoid this, the first correspondence can be deduplicated. That is, if multiple first IP addresses correspond to the same second IP address, the correspondence between one of the multiple first IP addresses and the second IP address is retained, and the correspondences between the other first IP addresses and the second IP address are deleted. 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. In this way, when checking the warm-up result of the first edge node 22.22.22.22, only one operation needs to be performed.
[0073] Furthermore, in some embodiments, for the first edge nodes belonging to the same IP network segment, it can be considered that the two first edge nodes belong to the same computer room, and the preheating result can be checked for only one of the first edge nodes. In view of this, the first correspondence can be further deduplicated. That is: if there are multiple second IP addresses with the same IP network segment, among the multiple second IP addresses, the correspondence between one of the second IP addresses and the first IP address is retained, and the correspondence between the other second IP addresses and the first IP address is deleted. For example, in Table 1, in the second IP address of the first edge node, the IP network segments of 44.44.44.41 and 44.44.44.42 are the same, 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.
[0074] At this point, after performing the deduplication operation on the first correspondence in Table 1, the result shown in Table 2 can be obtained.
[0075] Table 2 The first correspondence after deduplication
[0076] Furthermore, when sending an access request to a first edge node based on the second IP address, the access request can be sent to each first edge node based on the second IP address in the first correspondence after deduplication, to determine whether each first edge node has cached the resource under the domain name. This reduces data processing and prevents repeated access requests to the same first edge node or first edge nodes in the same data center.
[0077] It can be understood that, based on the second IP address in the first corresponding relationship after the deduplication operation is completed, after sending access requests to the first edge nodes respectively, the first edge nodes that have not cached domain name resources can be screened out according to the responses of each first edge node, and then the resources under the domain name can be reheated at these first edge nodes.
[0078] In some embodiments, preheating resources under a domain name at the first edge node may include:
[0079] For any first edge node, if the first edge node does not cache resources under the domain name, the first edge node is used as an edge node to be preheated;
[0080] Establishing a preheating coverage map, where the preheating coverage map 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;
[0081] Based on the preheating coverage map, preheat the resources under the domain name at the edge node to be preheated.
[0082] In some embodiments, if the content distribution network includes an upper-level cache node connected to the edge node to be preheated, 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 to which the edge node to be preheated is connected, and the first IP address of the client to which the edge node to be preheated is connected;
[0083] Preheat the resources under the domain name on the edge node to be preheated, including:
[0084] Based on the preheating coverage map, the resources under the domain name are preheated at the upper-level cache node connected to the edge node to be preheated.
[0085] By establishing a preheating coverage map, it is suitable for batch preheating of resources for edge nodes to be preheated in the preheating area, which is more efficient. Simply put, when sending access requests to the first edge nodes based on the second IP address in the first corresponding relationship after the deduplication operation is completed, if a first edge node that has not cached the domain name resource is found, there is no need to preheat the resources immediately. Instead, the first edge nodes that failed to preheat the resources can be recorded through the preheating coverage map. After sending access requests to all first edge nodes, the first edge nodes that failed to preheat the resources can be uniformly preheated based on the preheating coverage map, which is more efficient.
[0086] In the solution described above, the second IP address of each first edge node is obtained based on the client's first IP address in the preheating area, and the preheating results of each first edge node are checked. However, in some cases, it may be impossible to obtain the client's first IP address. The following describes the implementation plan for this characteristic situation.
[0087] In some embodiments, if the first IP address of the client 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, and then determine whether the second edge node to which the network device is connected when accessing the resources under the domain name has cached the resources under the domain name based on the resource access response received by the network device.
[0088] Specifically, the management platform can communicate with network devices. Network devices can send resource access requests based on domain names (i.e., the conventional client access method). Similar to the access request described above, resource access requests can request access to previously unaccessed resources under a domain name. This prevents resources from being cached to edge nodes through back-to-source caching.
[0089] The resource access response received by the network device may be similar to the following: <X-Cache:TCP_MISS from a23-200-24-95.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-) <X-Cache-Remote:TCP_MISS from a23-50-232-195.deploy.akamaitechnologies.com (AkamaiGHost / 11.1.0-48603064)(-)
[0090] Similar to the relevant description in the above step S22, 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 cache node to which the second edge node is connected, and the upper cache node to which the second edge node and the second edge node are connected hit the accessed resource. For example, in the above resource access response, it is indicated 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 cache node to which the second edge node is connected is 23.50.232.195, and neither the second edge node nor the upper cache node to which the second edge node is connected hits the resource under the domain name. In this case, it can be considered that the second edge node 23.200.24.95 failed in preheating the resource under the domain name and needs to preheat the resource again, that is, if it is determined based on the resource access response received by the network device that the edge node of the content distribution network has not cached the resource under the domain name, based on the fourth IP address, the resource under the domain name is preheated at the second edge node; or based on the fifth IP address, the resource under the domain name is preheated at the upper cache node connected to the second edge node.
[0091] In this way, when the first IP address of the client in the preheating area is not obtained, the resource preheating status of each edge node can still be checked, and the reliability of the solution is stronger.
[0092] Please refer to Figure 3, which is a module diagram of a resource preheating system based on a content distribution network provided in some embodiments of the present application. The resource preheating system includes:
[0093] A construction module is used to construct an IP acquisition request based on the domain name that needs to be preheated and the first IP address of the client in the preheating area to obtain the second IP address of the first edge node to which the client needs to connect;
[0094] An access module, configured to send an access request to the first edge node according to the second IP address, to determine whether the first edge node has cached resources under the domain name;
[0095] 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.
[0096] In some embodiments, the building blocks are specifically configured to:
[0097] Obtain the first IP address of the client in different IP segments in the preheating area;
[0098] An IP acquisition request is constructed based on the domain name and the first IP address of each client to obtain the second IP address of the first edge node to which each client needs to connect.
[0099] In some embodiments, the building blocks are specifically configured to:
[0100] Obtain the first IP address of one of the clients in each IP network segment in the preheating area.
[0101] In some embodiments, the first IP address of the client and the second IP address of the first edge node to which the client is to connect form a first correspondence; the access module is specifically configured to:
[0102] Performing a deduplication operation on the first corresponding relationship;
[0103] Based on the second IP address in the first corresponding relationship after the deduplication operation is completed, access requests are sent to the first edge nodes respectively to determine whether each first edge node has cached the resources under the domain name.
[0104] In some embodiments, the access module is specifically configured to:
[0105] If there are multiple first IP addresses corresponding to the same second IP address, retain the corresponding relationship between one of the multiple first IP addresses and the second IP address, and delete the corresponding relationships between the other first IP addresses and the second IP address; and / or
[0106] If there are multiple second IP addresses with the same IP network segment, among the multiple second IP addresses, the corresponding relationship between one of the second IP addresses and the first IP address is retained, and the corresponding relationships between the other second IP addresses and the first IP address are deleted.
[0107] In some embodiments, the preheating module is specifically used to:
[0108] For any first edge node, if the first edge node does not cache resources under the domain name, the first edge node is used as an edge node to be preheated;
[0109] Establishing a preheating coverage map, where the preheating coverage map 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;
[0110] Based on the preheating coverage map, preheat the resources under the domain name at the edge node to be preheated.
[0111] In some embodiments, the content distribution 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 to which the edge node to be preheated is connected, and the first IP address of the client to which the edge node to be preheated is connected; the preheating module is specifically used to:
[0112] Based on the preheating coverage map, the resources under the domain name are preheated at the upper-level cache node connected to the edge node to be preheated.
[0113] In some embodiments, the content distribution network further includes an upper-level cache node connected to the first edge node; the access module is specifically configured to:
[0114] Sending an access request to the first edge node based on a specified resource under the domain name that has not been obtained from the first edge node;
[0115] If the specified resource does not exist in the first edge node and the upper-level cache node connected to the first edge node, it is determined that the first edge node does not cache the resource under the domain name.
[0116] In some embodiments, if the first IP address of the client in the preheating area is not obtained, the access module is specifically configured to:
[0117] Send a request to the network device in the preheating area, so that the network device sends a resource access request to access the resources under the domain name;
[0118] According to the resource access response received by the network device, it is determined whether the second edge node to which the network device is connected when accessing the resource under the domain name has cached the resource under the domain name.
[0119] In some embodiments, the resource access response further includes a fourth IP address of the second edge node and a fifth IP address of an upper-level cache node connected to the second edge node; the preheating module is specifically configured to:
[0120] If it is determined, based on the resource access response received by the network device, that the second edge node has not cached the resources under the domain name, preheating the resources under the domain name at the second edge node based on the fourth IP address;
[0121] Or based on the fifth IP address, the upper cache node connected to the second edge node preheats the resources under the domain name.
[0122] Please refer to Figure 4, which is a schematic diagram of an electronic device provided in some embodiments of the present application. The electronic device includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the above method is implemented.
[0123] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0124] 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 the present disclosure. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing, thereby implementing the methods in the aforementioned method embodiments.
[0125] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0126] Some embodiments of the present application further provide a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the above-mentioned method is implemented.
[0127] Furthermore, some embodiments of the present application also disclose a computer program product, including computer instructions, which can implement the above method when executed by a processor.
[0128] Although the embodiments of the present disclosure have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A resource preheating method based on a content distribution network, wherein: The content distribution network includes a plurality of edge nodes for resource caching; the method includes: Based on the domain name that needs to be preheated and the first IP address of the client in the preheating area, an IP acquisition request is constructed to obtain the second IP address of the first edge node to which the client needs to connect; Sending an access request to the first edge node according to the second IP address to determine whether the first edge node has cached 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 of claim 1, wherein: The step of constructing an IP acquisition request based on the domain name for which resource preheating is required and the first IP address of the client in the preheating area includes: Obtaining first IP addresses of clients in different IP network segments in the preheating area; An IP acquisition request is constructed based on the domain name and the first IP address of each client to obtain the second IP address of the first edge node to which each client needs to connect.
3. The method of claim 2, wherein: The obtaining of the first IP address of the client in different IP network segments in the preheating area includes: A first IP address of one of the clients is obtained in each IP network segment of the preheating area.
4. The method of claim 2, wherein: 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 corresponding relationship; The sending an access request to the first edge node according to the second IP address includes: Performing a deduplication operation on the first corresponding relationship; Based on the second IP address in the first corresponding relationship after the deduplication operation is completed, access requests are sent to the first edge nodes respectively to determine whether each first edge node has cached the resources under the domain name.
5. The method of claim 4, wherein: The performing a deduplication operation on the first corresponding relationship includes at least one of the following operations: If there are multiple first IP addresses corresponding to the same second IP address, retaining one of the corresponding relationships between the first IP address and the second IP address, and deleting the other corresponding relationships between the first IP address and the second IP address; or If there are multiple second IP addresses with the same IP network segment, among the multiple second IP addresses, the corresponding relationship between one of the second IP addresses and the first IP address is retained, and the corresponding relationship between the other second IP addresses and the first IP address is deleted.
6. The method of claim 4, wherein: Preheating the 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, use the first edge node as an edge node to be preheated; Establishing a preheating coverage map, wherein the preheating coverage map 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, the resources under the domain name are preheated at the edge node to be preheated.
7. The method of claim 6, wherein: The content distribution network also includes an upper cache node connected to the edge node to be preheated, and the preheating coverage map is further used to characterize a third correspondence between the domain name, a third IP address of the upper cache node connected to the edge node to be preheated, and a first IP address of the client connected to the edge node to be preheated; Preheating the 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 at the upper cache node connected to the edge node to be preheated.
8. The method of claim 1, wherein: The content distribution network further includes an upper-level cache node connected to the first edge node; The sending an access request to the first edge node to determine whether the first edge node has cached the resources under the domain name includes: Sending an access request to the first edge node based on a specified resource under the domain name that has not been obtained from the first edge node; If neither the first edge node nor an upper-level 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 of claim 1, wherein: If the first IP address of the client in the preheating area is not obtained, the method further includes: Sending a request to the network device in the preheating area so that the network device sends a resource access request to access the resources under the domain name; According to the resource access response received by the network device, it is determined whether the second edge node to which the network device is connected when accessing the resource under the domain name has cached the resource under the domain name.
10. The method of claim 9, wherein: The resource access response also includes a fourth IP address of the second edge node and a fifth IP address of an upper cache node connected to the second edge node; If it is determined, according to the resource access response received by the network device, that the second edge node does not cache the resources under the domain name, preheating the resources under the domain name at the second edge node based on the fourth IP address; Or based on the fifth IP address, the upper cache node connected to the second edge node preheats the resources under the domain name.
11. A resource preheating system based on a content distribution network, wherein: The content distribution network includes a plurality of edge nodes for resource caching; the system includes: A construction module, used to construct an IP acquisition request based on the domain name that needs to be preheated and the first IP address of the client in the preheating area, so as to obtain the second IP address of the first edge node to which the client needs to connect; an access module, configured to send an access request to the first edge node according to the second IP address, so as to determine whether the first edge node has cached 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 non-transitory computer-readable storage medium, wherein: The computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
13. An electronic device, wherein: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 10 is implemented.
14. A computer program product, comprising computer instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Resource file preheating method and central management system
CN110661862A
Bypass distribution preheating method and device and electronic equipment
CN110677484A
Resource access method and device, resource access system, equipment and storage medium
CN111355731A
Live broadcast method and device
CN114760487A
Multimedia data interaction method, device and system
CN115190120A