CDN-based access request processing method and apparatus
By obtaining the hierarchical structure and selecting target CDN nodes within the CDN node, and optimizing resource location using hash calculation and hash ring, the problem of multiple origin pulls in CDN scenarios is solved, achieving efficient resource acquisition and load balancing, and improving system stability and reliability.
Patent Information
- Application Number
- PCT/CN2025/079272
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-28
- Filing Date
- 2025-02-26
- Publication Date
- 2026-01-02
AI Technical Summary
In CDN scenarios, factors such as cache invalidation, cache conflicts, inconsistent cache rules, and load balancing strategies can lead to multiple origin pulls, excessive bandwidth consumption, and excessive server load.
By obtaining the hierarchical structure within the CDN node, determining the target level, and selecting a suitable target CDN node to handle access requests, resource location is optimized using hash calculation and hash ring, reducing the number of origin pulls, and achieving load balancing and efficient transmission of cached content.
It improves resource acquisition efficiency, reduces access pressure on the origin server, lowers network traffic costs and server load, enhances system stability and reliability, and strengthens the flexibility and scalability of the CDN network.
Smart Images

Figure CN2025079272_02012026_PF_FP_ABST
Abstract
Description
A CDN-based access request processing method and device
[0001] Cross-reference to Related Applications
[0002] The present application claims priority to the Chinese patent application No. 202410865071.1, filed on June 28, 2024, and entitled "A CDN-based access request processing method and device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present disclosure relates to the field of network communication, and in particular to a CDN-based access request processing method and device. BACKGROUND
[0004] Content Delivery Network (CDN) is a technology that caches website static resources on servers distributed around the world to accelerate content transmission and improve website performance. Its working principle is based on caching website static resources (such as images, videos, CSS, JavaScript files, etc.) on servers located in different geographic locations. When users request to access these resources, CDN will automatically deliver content from the nearest server to the user, rather than directly from the original server. SUMMARY
[0005] The present disclosure provides a CDN-based access request processing method and device.
[0006] In a first aspect, an embodiment of the present disclosure provides a CDN-based access request processing method, which is applied to a CDN node, and the method comprises:
[0007] obtaining an access request, wherein the access request carries an access resource identifier;
[0008] if there is no cached content corresponding to the access resource identifier in the current CDN node, obtaining a hierarchical structure of the CDN node, and obtaining a target level associated with the current CDN node based on the hierarchical structure;
[0009] obtaining a target CDN node in the target level for receiving the access request;
[0010] obtaining cached content corresponding to the access resource identifier through the target CDN node.
[0011] In a second aspect, an embodiment of the present disclosure provides a resource scheduling device based on edge computing, which comprises:
[0012] The first obtaining module is configured to obtain an access request, wherein the access request carries an access resource identifier;
[0013] The second obtaining module is configured to, if the cache content corresponding to the access resource identifier does not exist in the current CDN node, obtain a hierarchical structure of the CDN node, and obtain a target level associated with the current CDN node based on the hierarchical structure.
[0014] The traversing module is configured to obtain a target CDN node in the target level for receiving the access request.
[0015] The processing module is configured to transmit the cache content corresponding to the access resource identifier through the target CDN node.
[0016] In a third aspect, an embodiment of the present disclosure provides a computer device, including a memory and a processor, which are communicatively connected with each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the method in the first aspect or any of the corresponding embodiments.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer readable storage medium, which stores computer instructions, and the computer instructions are used to make a computer execute the method in the first aspect or any of the corresponding embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0018] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings needed in the specific embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present disclosure, and those skilled in the art can also obtain other drawings according to these drawings without creative labor.
[0019] FIG. 1 is a flow diagram of a CDN-based access request processing method according to some embodiments of the present disclosure;
[0020] FIG. 2 is a flow diagram of a CDN-based access request processing method according to some embodiments of the present disclosure;
[0021] FIG. 3 is a schematic diagram of a back-to-source process of a CDN node according to some embodiments of the present disclosure;
[0022] FIG. 4 is a schematic diagram of a back-to-source process of a CDN node according to some embodiments of the present disclosure;
[0023] FIG. 5 is a schematic diagram of a back-to-source process of a CDN node according to some embodiments of the present disclosure;
[0024] FIG. 6 is a structural block diagram of a CDN-based access request processing apparatus according to an embodiment of the present disclosure;
[0025] FIG. 7 is a schematic diagram of a hardware structure of a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] As described above, CDN can accelerate content transmission and improve website performance by caching website static resources on servers distributed around the world. However, in the CDN scenario, multiple times of origin-pulling may occur due to factors such as cache invalidation, cache conflict, inconsistent cache rules, and load balancing strategies, which may cause problems such as excessive bandwidth consumption and server load.
[0027] To make the objects, technical solutions, and advantages of one embodiment of the present disclosure clearer, the technical solutions of one embodiment of the present disclosure will be described clearly and completely below with reference to the drawings of one embodiment of the present disclosure. Obviously, the described embodiments are only some of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present disclosure.
[0028] According to one embodiment of the present disclosure, a CDN-based access request processing method and apparatus are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0029] In the present embodiment, a CDN-based access request processing method is provided. FIG. 1 is a flowchart of a CDN-based access request processing method according to one embodiment of the present disclosure. As shown in FIG. 1, the flow includes the following steps:
[0030] In step S101, an access request is obtained, wherein the access request carries an access resource identifier.
[0031] Specifically, when the current CDN node receives an access request, the request carries an access resource identifier, which usually refers to the specific content requested by the user, such as a web page, an image, a video, etc. Access requests mainly come from two main sources: ① from the client, the user enters the URL or clicks the link in the browser, triggering a request for a certain resource. This request will be sent to the nearest CDN node. ② Forwarding from the next level of CDN node, when a CDN node cannot directly satisfy the user's request, it will try to find the resource in its cache. If not, it will request from the upper CDN node. This process may be repeated several times until the CDN node with the required resource is found, and then the node returns the resource to the initial request node, which returns it to the user.
[0032] In both cases, the access request carries the identifier of the resource, which can help the CDN node accurately locate the required resource and then perform corresponding processing, such as obtaining the resource from the cache, requesting the resource from the source server, or further forwarding the request to other CDN nodes.
[0033] Step S102, if the access resource identifier corresponding cache content does not exist in the current CDN node, the hierarchical structure of the CDN node is obtained, and the target level associated with the current CDN node is obtained based on the hierarchical structure.
[0034] Specifically, based on the hierarchical structure, the target level associated with the current CDN node is obtained, including: if the hierarchical structure is a single-layer structure, the level of the current CDN node is taken as the target level; if the hierarchical structure is a multi-layer structure, and there is a previous level of the current CDN node, the previous level of the current CDN node is taken as the target level; if the hierarchical structure is a multi-layer structure, and there is no previous level of the current CDN node, the level of the current CDN node is taken as the target level.
[0035] The CDN network is usually composed of multiple levels of nodes, each node has its specific position and association relationship. First, the level of the current CDN node and the relationship with other nodes need to be obtained. Determine the target level: ① single-layer structure case: if the CDN network is a single-layer structure, it means that all nodes are on the same level. In this case, the level of the current CDN node is the target level. ② Multi-layer structure case: if there is a previous level of the current CDN node, the previous level is taken as the target level. If there is no previous level of the current CDN node, the level of the current CDN node is the target level.
[0036] It can be understood that in a single-layer structure, all CDN nodes are at the same level, without upper and lower levels. Therefore, in this case, the level where the current CDN node is located is the target level. There is no need to look up other levels upwards or downwards. In a multi-layer structure, there is an upper and lower level relationship between levels. If the level where the current CDN node is located has a previous level, the previous level will be defined as the target level. This means that the data flow or request should be transmitted or processed to the previous level. If the level where the current CDN node is located does not have a previous level, i.e. at the topmost layer, the level where the current CDN node is located is the target level, without the need to further look up upwards.
[0037] Through this process, the target level associated with the current CDN node can be accurately determined. The purpose of this is to ensure that access requests can be properly forwarded and processed according to the hierarchical structure of the CDN network, in order to ultimately obtain the required resources and return them to the user.
[0038] Step S103, obtaining the target CDN node in the target level for receiving the access request.
[0039] Specifically, after determining the target level, it is necessary to select one or more suitable CDN nodes from this level to receive the access request. This usually involves load balancing and routing strategies. Load balancing: if there are multiple CDN nodes in the target level, a load balancing algorithm can be used to balance the distribution of requests, ensuring that each node can handle an appropriate number of requests. Common load balancing algorithms include round robin, least connections, etc. Alternatively, the optimal node can be selected according to the characteristics of the request, the performance of the target CDN node and the network conditions, etc. This may involve considerations of geographical location, network latency, etc.
[0040] After determining the target CDN node, the access request can be sent to these nodes for them to process the request and provide the required resources. Through the above steps, the target CDN node in the target level for receiving the access request can be obtained according to the access resource identifier. This ensures that the request can be effectively routed to the appropriate node and ultimately obtain the required resources.
[0041] Step S104, obtaining the cache content corresponding to the access resource identifier through the target CDN node.
[0042] Specifically, the access request is obtained by the CDN node, and whether the cache content exists can be determined according to the access resource identifier. If the cache does not exist, the target CDN node that can receive the access request can be quickly found from the target level, and the cache content of the access resource is provided through the node. In this way, the efficiency of resource acquisition can be greatly improved, and the access pressure on the source server can be reduced. In addition, by obtaining the target CDN node for receiving the access request in the target level, load balancing for different access requests can be achieved. The access request can be reasonably distributed to different CDN nodes, thereby reducing the load pressure of a single node and improving the stability and reliability of the overall system.
[0043] The present disclosure can more effectively route the request to the nearest target CDN node by implementing the hierarchical structure and the selection of the target CDN node in the CDN node, thereby reducing the response time and improving the content transmission speed. When the requested resource does not exist in the cache of the current CDN node, the scheme can guide the request to other CDN nodes through the hierarchical structure and the target CDN node selection mechanism, thereby reducing the load of the source server and improving the stability and reliability of the overall system. Through intelligent target CDN node selection and cache content transmission, the hit rate of the cache content in the CDN network can be increased, and the situation of returning to the source server due to resource loss can be reduced, thereby reducing the network traffic cost and the server load.
[0044] In addition, through the mechanism of the hierarchical structure and the target CDN node selection, a more flexible and scalable architecture is provided for the CDN network, and the allocation and resource utilization of the nodes can be dynamically adjusted according to the network traffic and load conditions to cope with different traffic and access requirements.
[0045] FIG. 2 is a flowchart of a CDN-based access request processing method according to an embodiment of the present disclosure. As shown in FIG. 2, the flow includes the following steps:
[0046] In step S201, an access request is obtained, wherein the access request carries an access resource identifier. For details, see step S101 in the above embodiment, which will not be described in detail here.
[0047] In step S202, if the cache content corresponding to the access resource identifier does not exist in the current CDN node, the hierarchical structure of the CDN node is obtained, and the target level associated with the current CDN node is obtained based on the hierarchical structure. For details, see step S102 in the above embodiment, which will not be described in detail here.
[0048] In step S203, a target CDN node for receiving the access request in the target level is obtained.
[0049] In one embodiment of the present disclosure, obtaining a target CDN node in a target hierarchy for receiving an access request comprises the following steps a1-a2:
[0050] Step a1, obtaining node information of all CDN nodes in the target hierarchy.
[0051] Specifically, the current CDN node first sends a request to the central router to obtain information of other CDN nodes in the target hierarchy. The request usually contains some identifiers, such as identifiers of target content or geographical location of user request, etc. After receiving the request, the central router queries according to the information in the request to determine which CDN nodes store the required content or are most suitable for serving the user request. The central router returns the CDN node information meeting the conditions to the CDN node initiating the request according to the query result. The information usually includes the location, IP address, etc. of the node. After receiving the node information, the current CDN node performs subsequent hash calculation to determine the target CDN node in the target hierarchy for receiving the access request.
[0052] Step a2, calculating based on the node information and the access resource identifier to determine the target CDN node in the target hierarchy for receiving the access request.
[0053] In one embodiment of the present disclosure, calculating based on the node information and the access resource identifier to determine the target CDN node in the target hierarchy for receiving the access request comprises: performing hash calculation using the node information to obtain a hash value corresponding to each CDN node in the target hierarchy; constructing a hash ring based on the hash value corresponding to each CDN node; performing hash calculation using the access resource identifier to obtain a target hash value; traversing the hash ring to obtain a hash value hit by the target hash value, and taking the CDN node corresponding to the hash value hit by the target hash value as the target CDN node.
[0054] Specifically, performing hash calculation using the node information means taking the information (such as IP address, bandwidth, etc.) of each CDN node as input and using a hash function to calculate a unique hash value. After obtaining the hash value corresponding to each CDN node, they are used to construct a hash ring. The hash ring is a logical ring structure, each CDN node corresponds to a position on the hash ring, and the order of the ring is sorted according to the size of the hash value. Next, the access resource identifier is used to perform hash calculation to obtain a target hash value. The access resource identifier can be any identifier, such as URL or file name, etc. As shown in FIG. 3, a target hash value can be obtained by performing hash calculation on the access resource identifier. Then, traverse the hash ring to find the CDN node corresponding to the hash value hit by the target hash value. The specific method is to traverse along the hash ring in the clockwise direction to find the first hash value greater than or equal to the target hash value corresponding to the CDN node. This CDN node is the target CDN node.
[0055] For example: The request content identifier is "example.com / image.jpg". There are three CDN nodes A, B, and C. We need to calculate the hash value for each CDN node in the target layer and construct a hash ring. First, for each CDN node, we can use its location or IP address to perform a hash calculation, obtaining a unique hash value. Assume node A has a hash value of 10, node B has a hash value of 20, and node C has a hash value of 30. Second, we construct a hash ring based on the node hash values. In this example, the nodes on the hash ring are in the order A, B, and C, with corresponding hash values of 10, 20, and 30. Then, we perform a hash calculation using the resource identifier "example.com / image.jpg" to obtain a target hash value. This hash value can use the same or a similar algorithm as the node information hash calculation; let's assume the target hash value is 15. Starting from the target hash value, we traverse the hash ring, finding the first node with a hash value greater than the target hash value. In this example, the target hash value 15 is greater than node A's hash value 10 but less than node B's hash value 20, so the node that matches the target hash value is B. Therefore, in this example, node B is the node that the target hash value hits, and is thus selected as the target CDN node.
[0056] The method provided in one embodiment of this disclosure utilizes hash calculation and hash rings to quickly determine the target CDN node, avoiding the time overhead of linear search throughout the network and improving the efficiency of resource location. The construction of the hash ring gives the system good scalability; when adding or removing CDN nodes, only the hash ring needs to be reconstructed, without requiring large-scale adjustments to the entire system. This ensures data consistency even when nodes change; the addition or removal of nodes does not lead to large-scale data migration or reorganization.
[0057] Step S204: Access the cached content corresponding to the resource identifier through the target CDN node.
[0058] In one embodiment of this disclosure, accessing cached content corresponding to the access resource identifier through the target CDN node includes: if the target CDN node is located at the level above the current CDN node, then sending an access request to the target CDN node so that the target CDN node returns the cached content corresponding to the access resource identifier to the client corresponding to the access request.
[0059] As shown in FIG. 4, the client initiates an access request carrying an access resource identifier www.abc.com / 1.html, and the access request is sent to "CDN node 1 machine 2", i.e. the client request first reaches a specific node in the CDN network. Machine 2 finds that there is no cache corresponding to the URL locally, and will first obtain the node information of all nodes at the upper level from the center route: when machine 2 finds that it does not have the cache of the requested URL locally, it will send a request to the center route to obtain the information of other nodes and machines at the upper level.
[0060] After machine 2 obtains the node information (the node information includes the ID of the CDN node and the room representation of the room containing the CDN node), the obtained node information is subjected to hash calculation, and all the information of nodes and machines is placed on a hash ring, and each node and machine will have a hash value.
[0061] The access resource identifier of the access request is subjected to hash consistency calculation, a calculation result is obtained, the calculation result is matched with the hash ring, and it is found that the hit node machine is "CDN node 2 machine 1", and machine 2 will forward the request to "CDN node 2 machine 1".
[0062] At this time, "CDN node 2 machine 1" finds that it also does not have a cache, and will also obtain the node information of all nodes at the upper level from the center route, and perform consistency hash calculation, and after calculation, it is found that the hit node machine is "CDN node 3 machine N". Then, "CDN node 2 machine 1" will forward the request to "CDN node 3 machine N" hit by the consistency hash calculation. "CDN node 3 machine N" finds that it also does not have a cache, and at the same time, since it is already the last layer, there is no upper node, so it will initiate a back-to-source request to the source station to obtain the final cache content. Finally, it will return the cache content of the request to the client, and save the content in its own cache for the next request.
[0063] Since the target CDN node is located at the upper level of the layer where the current CDN node is located, the time for sending the access request to the target node is short, which can effectively reduce the access delay of the access resource. The user can obtain the required cache content faster, improving the user experience. By sending the access request to the target CDN node, the use of network bandwidth can be reduced. Because it is not necessary to return the entire content of the access resource to the current node, but only the cache content needs to be fed back to the client. In this way, the amount of data transmitted in the network can be reduced, and the bandwidth resources are saved. By sending the access request to the target CDN node, the effect of load balancing can be achieved. By dispersing the access request to different target nodes, the load of the request can be evenly distributed, avoiding the overload of a single node, and improving the overall performance and stability of the system.
[0064] In another embodiment of the present disclosure, the target CDN node identifies the corresponding cache content according to the access resource identifier, including: if the target CDN node is located in the same level as the current CDN node and is different from the current CDN node, sending an access request to the target CDN node, so that the target CDN node feeds back the access resource identifier corresponding to the cache content to the client corresponding to the access request.
[0065] As shown in FIG. 5, the client initiates an access request, the access request carries an access resource identifier www.abc.com / 1.html, and the access request is sent to "CDN node 1 machine 2". Since "CDN node 1 machine 2" does not have a cache corresponding to the URL, it will request the node information of all nodes in the same level from the center. After obtaining the node information, "CDN node 1 machine 2" puts all the nodes and machines on the hash ring and performs consistent hash calculation. The hash key is usually the access URL. After calculation, it is found that the hit node machine is "CDN node 2 machine 2". "CDN node 1 machine 2" initiates a request to "CDN node 2 machine 2". If "CDN node 2 machine 2" also does not have a cache, "CDN node 2 machine 2" will finally perform a back source. After obtaining the cache content, it is fed back to the client.
[0066] The cache content is returned to "CDN node 1 machine 2" through "CDN node 2 machine 2", and then returned to the client by "CDN node 1 machine 2". In the whole process, through the consistent hash algorithm, the CDN node can map the request to different node machines according to the hash function, realizing load balancing and fault transfer. At the same time, the CDN node can also manage the cache through the consistent hash algorithm to improve the hit rate and performance of the cache.
[0067] Since the target CDN node is located in the same level as the current CDN node but is different from the current node, sending an access request to the target node can utilize local cache, thereby reducing cross-node data transmission and delay. This can improve the efficiency of resource acquisition, speed up access speed, and improve user experience. By sending an access request to the target CDN node, cross-node load balancing can be achieved. Even within the same level, there may be uneven load between different nodes. By sending a request to other nodes, the load can be dispersed, improving the overall stability and performance of the system. In addition, compared with sending a request to the upper level, sending a request to other nodes in the same level can reduce the routing nodes in network transmission, saving network resources and bandwidth cost.
[0068] In another embodiment of the present disclosure, the target CDN node identifies the corresponding cache content based on the access resource identifier, including: if the target CDN node is located in the same level as the current CDN node, and is the same as the current CDN node, sending a back-to-source request to the source station based on the access resource identifier; receiving the cache content returned by the source station based on the back-to-source request, and feeding back the cache content to the client corresponding to the access request.
[0069] As shown in FIG. 6, the client initiates an access request carrying an access resource identifier www.abc.com / 1.html, and the access request is sent to "CDN node 1 machine 2", i.e., the client request first reaches a specific node in the CDN network. Machine 2 finds that there is no cache corresponding to the URL locally, and will first obtain the node information of all nodes in the same level from the center route: when machine 2 finds that it does not have the cache of the requested URL locally, it will send a request to the center route to obtain the node information of the same level (which can be the same region or the same data center). The obtained node information is hashed, and the information of all nodes and machines is placed on a hash ring, and each node and machine has a hash value. After calculation, it is found that the hit node machine is itself, and a back-to-source request is initiated directly by itself to obtain the cache content corresponding to the URL from the source station, and the content is cached for subsequent requests.
[0070] By caching in the same level as the target CDN node and the current CDN node, more users can benefit from local caching when accessing the same resource. This can reduce the frequency of back-to-source requests, reduce the access pressure on the source station, and improve user experience. Feeding back the cache content to the client corresponding to the access request can reduce network transmission time and delay. Because the cache content can be transmitted directly to the user from the nearest CDN node, it does not need to be obtained from the source station, thereby improving access speed and response efficiency. In addition, when the target CDN node is located in the level of the current CDN node, redundancy and fault tolerance can be achieved on the network topology. If the current node fails or has network problems, the cache content can still be obtained from other nodes in the same level without directly returning to the source, thereby improving the reliability and stability of the system.
[0071] In this embodiment, an edge computing-based resource scheduling device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and details are not repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and contemplated.
[0072] The embodiment provides a resource scheduling device based on edge computing, as shown in Figure 7, comprising:
[0073] The first acquisition module 701 is used for acquiring an access request, wherein the access request carries an access resource identifier;
[0074] The second acquisition module 702 is used for acquiring a hierarchical structure of a CDN node if there is no cache content corresponding to the access resource identifier in the CDN node, and acquiring a target level associated with the CDN node based on the hierarchical structure.
[0075] The traversal module 703 is used for acquiring a target CDN node in the target level for receiving the access request.
[0076] The processing module 704 is used for feeding back the cache content corresponding to the access resource identifier to a client corresponding to the access request through the target CDN node.
[0077] In one embodiment of the present disclosure, the second acquisition module 702 is used for taking a level where the CDN node is located as the target level if the hierarchical structure is a single-level structure, taking an upper level of the level where the CDN node is located as the target level if the hierarchical structure is a multi-level structure and there is the upper level of the level where the CDN node is located, and taking the level where the CDN node is located as the target level if the hierarchical structure is a multi-level structure and there is no upper level of the level where the CDN node is located.
[0078] In one embodiment of the present disclosure, the traversal module 703 is used for acquiring node information of all CDN nodes in the target level, and performing calculation based on the node information and the access resource identifier to determine the target CDN node in the target level for receiving the access request.
[0079] In one embodiment of the present disclosure, the traversal module 703 is used for performing hash calculation by using the node information to obtain a hash value corresponding to each CDN node in the target level, constructing a hash ring based on the hash value corresponding to each CDN node, performing hash calculation by using the access resource identifier to obtain a target hash value, traversing the hash ring to obtain a hash value hit by the target hash value, and taking a CDN node corresponding to the hash value hit by the target hash value as the target CDN node.
[0080] In one embodiment of the present disclosure, the processing module 704 is used for sending the access request to the target CDN node if the target CDN node is located in the upper level of the level where the CDN node is located, so that the target CDN node feeds back the cache content corresponding to the access resource identifier to the client corresponding to the access request.
[0081] In an embodiment of the present disclosure, the processing module 704 is configured to, if the target CDN node is located in the same level as the current CDN node, send a back-to-source request to the source station based on the access resource identifier, and receive the cached content returned by the source station based on the back-to-source request and feed back the cached content to the client corresponding to the access request.
[0082] In an embodiment of the present disclosure, the processing module 704 is configured to, if the target CDN node is located in the same level as the current CDN node, send a back-to-source request to the source station based on the access resource identifier, and receive the cached content returned by the source station based on the back-to-source request and feed back the cached content to the client corresponding to the access request.
[0083] In an embodiment of the present disclosure, by judging whether the cached content corresponding to the access resource identifier exists in the CDN node, unnecessary back-to-source request can be avoided. If the cached content exists, the request can be directly responded, the number of back-to-source is reduced, and the bandwidth consumption is saved. If the cached content does not exist, the target CDN node in the target level for receiving the access request can be obtained, the nearby access and acceleration can be realized, the request can be distributed to the target CDN node closest to the user, the target CDN node can respond to the access request, the number of back-to-source of the CDN node is reduced, and the load of the source server is reduced.
[0084] Referring to FIG. 8, FIG. 8 is a structural schematic diagram of a computer device according to an optional embodiment of the present disclosure. As shown in FIG. 8, the computer device includes one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components communicate and cooperate with each other by using different buses, and can be installed on a common mainboard or in other manners as needed. The processor can process instructions executed in the computer device, including instructions stored in the memory or the memory to display graphical information on a GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0085] The processor 10 can be a central processor, a network processor, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a generic array logic, or any combination thereof.
[0086] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the method illustrated in the above embodiments.
[0087] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function. The data storage area can store data created by the use of the computer device according to the presentation of the applet landing page, and the like. In addition, the memory 20 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some optional embodiments, the memory 20 can optionally include a memory disposed remotely with respect to the processor 10, and these remote memories can be connected to the computer device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0088] The memory 20 can include a volatile memory, such as a random access memory; the memory can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid-state disk; and the memory 20 can also include a combination of the above-mentioned kinds of memories.
[0089] The computer device further includes a communication interface 30 for the computer device to communicate with other devices or communication networks.
[0090] In one embodiment of the present disclosure, a computer readable storage medium is also provided. The method according to the embodiment of the present disclosure can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code originally stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded to a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general-purpose computer, a special-purpose processor, or programmable or special-purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state disk, and the like. Further, the storage medium can also include a combination of the above-mentioned kinds of memories. It can be understood that the computer, the processor, the microprocessor controller, or the programmable hardware includes a storage component that can store or receive software or computer code, which, when accessed and executed by the computer, the processor, or the hardware, implements the method illustrated in the above embodiments.
[0091] Although the embodiments of the present disclosure are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present disclosure, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A CDN-based access request processing method, wherein the method is applied to a CDN node, and the method comprises: obtaining an access request, wherein the access request carries an access resource identifier; if there is no cache content corresponding to the access resource identifier in the current CDN node, obtaining a hierarchical structure of the CDN node, and obtaining a target level associated with the current CDN node based on the hierarchical structure; obtaining a target CDN node in the target level for receiving the access request; and obtaining cache content corresponding to the access resource identifier through the target CDN node. 2.The method of claim 1, wherein the obtaining a target level associated with the current CDN node based on the hierarchical structure comprises: if the hierarchical structure is a single-level structure, taking the level where the current CDN node is located as the target level; if the hierarchical structure is a multi-level structure and there is a previous level of the level where the current CDN node is located, taking the previous level of the level where the current CDN node is located as the target level; if the hierarchical structure is a multi-level structure and there is no previous level of the level where the current CDN node is located, taking the level where the current CDN node is located as the target level. 3.The method of claim 1, wherein the obtaining a target CDN node in the target level for receiving the access request comprises: obtaining node information of all CDN nodes in the target level; and based on the node information and the access resource identifier, determining the target CDN node in the target level for receiving the access request. 4.The method of claim 3, wherein the determining the target CDN node in the target level for receiving the access request based on the node information and the access resource identifier comprises: performing hash calculation using the node information to obtain a hash value corresponding to each CDN node in the target level; constructing a hash ring based on the hash value corresponding to each CDN node; performing hash calculation using the access resource identifier to obtain a target hash value; traversing the hash ring to obtain a hash value hit by the target hash value, and taking the CDN node corresponding to the hash value hit by the target hash value as the target CDN node. 5.The method of claim 1, wherein the obtaining cache content corresponding to the access resource identifier through the target CDN node comprises: if the target CDN node is located in a previous level of the level where the current CDN node is located, sending the access request to the target CDN node, so that the target CDN node feeds back the cache content corresponding to the access resource identifier to a client corresponding to the access request. 6.The method of claim 1, wherein the obtaining cache content corresponding to the access resource identifier through the target CDN node comprises: If the target CDN node is located in the same level as the current CDN node, a back-to-source request is sent to a source station based on the access resource identifier.
7. The method of claim 1, wherein the obtaining the cached content corresponding to the access resource identifier by the target CDN node comprises: If the target CDN node is located in the same level as the current CDN node, a back-to-source request is sent to a source station based on the access resource identifier. The cached content returned by the source station based on the back-to-source request is received and fed back to the client corresponding to the access request.
8. An edge computing-based resource scheduling apparatus, comprising: a first obtaining module configured to obtain an access request, wherein the access request carries an access resource identifier; a second obtaining module configured to, if there is no cached content corresponding to the access resource identifier in a current CDN node, obtain a hierarchical structure of the CDN node and obtain a target level associated with the current CDN node based on the hierarchical structure; a traversing module configured to obtain a target CDN node in the target level for receiving the access request; a processing module configured to obtain the cached content corresponding to the access resource identifier by the target CDN node.
9. A computer device, comprising: a memory and a processor, which are in communication connection with each other, and the memory stores computer instructions, and the processor executes the computer instructions to perform the method in any one of claims 1 to 7.
10. A computer readable storage medium, which stores computer instructions for causing a computer to perform the method in any one of claims 1 to 7.
Citation Information
Patent Citations
CDN node data searching method and device and network device
CN109951543A
Access request processing method and device and electronic equipment
CN112153160A
Source returning method, device and equipment of CDN node
CN113472852A
CDN-based access request processing method and device
CN118413572A