Request processing method, apparatus, device, and storage medium

By combining information from multiple dimensions such as node bandwidth and storage capacity in the CDN network to determine the target node, the inefficiency problem in existing technologies is solved, and more efficient content acquisition and caching utilization are achieved.

CN123185201APending Publication Date: 2026-11-27TENCENT DIGITAL TIANJIN
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510686740.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing technologies, determining the target node based on the bandwidth of the CDN node can easily lead to low request processing efficiency.

Method used

By obtaining the first ratio that matches the content, and combining information from multiple dimensions such as the node's bandwidth and storage capacity, the target node is determined.

Benefits of technology

It improves the processing efficiency of content retrieval requests, reduces the number of times the origin server is accessed, and increases cache utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123185201A_ABST
    Figure CN123185201A_ABST
Patent Text Reader

Abstract

The application discloses a request processing method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: receiving a content acquisition request sent by a client, the content acquisition request being used for requesting a CDN to acquire first content, the CDN comprising at least two nodes; acquiring a first ratio matching the first content, the first ratio being used for indicating a proportional relationship between information in at least two dimensions, and the information in each dimension being used for representing an attribute of a node; determining a target node from the at least two nodes according to the content acquisition request and the first ratio; and sending the content acquisition request to the target node, the target node being used for processing the content acquisition request. The above method improves the efficiency of request processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a request processing method, apparatus, device, and storage medium. Background Technology

[0002] With the advancement of computer technology, the application of CDN (Content Delivery Network) has become increasingly widespread. When a CDN server network receives a content retrieval request from a client, it determines an optimal CDN node (called the target node). This target node processes the content retrieval request; for example, it retrieves the content and returns it to the client.

[0003] In related technologies, nodes are generally allocated based on their bandwidth, with priority given to assigning nodes with larger bandwidth to content retrieval requests.

[0004] However, in related technologies, the method of determining the target node directly based on bandwidth can easily lead to low efficiency in request processing. Summary of the Invention

[0005] This application provides a request processing method, apparatus, device, and storage medium, which can improve request processing efficiency. The technical solution provided by this application includes the following aspects.

[0006] According to one aspect of the embodiments of this application, a request processing method is provided, the method comprising the following steps.

[0007] Receive a content retrieval request sent by a client, the content retrieval request being used to request first content from a CDN, the CDN comprising at least two nodes;

[0008] Obtain a first ratio that matches the first content, the first ratio being used to indicate the proportional relationship between information in at least two dimensions, each dimension being used to characterize an attribute of the node;

[0009] Based on the content retrieval request and the first ratio, determine the target node from the at least two nodes;

[0010] The content retrieval request is sent to the target node, and the target node is used to process the content retrieval request.

[0011] According to one aspect of the embodiments of this application, a request processing apparatus is provided, the apparatus comprising the following modules.

[0012] A request receiving module is used to receive a content retrieval request sent by a client. The content retrieval request is used to request first content from a CDN, and the CDN includes at least two nodes.

[0013] The ratio acquisition module is used to acquire a first ratio that matches the first content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, and the information in each dimension is used to characterize an attribute of the node.

[0014] A node determination module is used to determine a target node from the at least two nodes based on the content acquisition request and the first ratio.

[0015] A request sending module is used to send the content retrieval request to the target node, and the target node is used to process the content retrieval request.

[0016] According to one aspect of the embodiments of this application, a computer device is provided, the computer device including a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the above-described request processing method.

[0017] According to one aspect of the present application, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, the computer program being loaded and executed by a processor to implement the above-described request processing method.

[0018] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the above-described request processing method.

[0019] The technical solutions provided in this application embodiment may have the following beneficial effects:

[0020] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the first content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of node information and the content retrieval request is more closely aligned with the first content and the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a computer system provided in one embodiment of this application;

[0022] Figure 2 This is a schematic diagram of a request processing method provided in one embodiment of this application;

[0023] Figure 3 This is a schematic diagram of a request processing method provided in another embodiment of this application;

[0024] Figure 4 This is a schematic diagram of a node determination method based on a hash ring provided in one embodiment of this application;

[0025] Figure 5 This is a schematic diagram of a request processing method provided in another embodiment of this application;

[0026] Figure 6 This is a flowchart of a request processing method provided in one embodiment of this application;

[0027] Figure 7 This is a flowchart of a request processing method provided in another embodiment of this application;

[0028] Figure 8 This is a flowchart of a request processing method provided in another embodiment of this application;

[0029] Figure 9 This is a flowchart of a request processing method provided in another embodiment of this application;

[0030] Figure 10 This is a flowchart of a request processing method provided in another embodiment of this application;

[0031] Figure 11 This is a block diagram of a request processing apparatus provided in one embodiment of this application;

[0032] Figure 12 This is a structural block diagram of a computer device provided in one embodiment of this application. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0034] Please refer to Figure 1 This illustration shows a schematic diagram of a computer system provided in one embodiment of this application. The computer system may include: a terminal device 10 and a server 20.

[0035] Terminal device 10 includes, but is not limited to, mobile phones, tablets, smart voice interaction devices, game consoles, wearable devices, multimedia playback devices, PCs (Personal Computers), in-vehicle terminals, smart home appliances, VR (Virtual Reality) devices, AR (Augmented Reality) devices, MR (Mixed Reality) devices, XR (Extended Reality) devices, and other electronic devices. A client application for the target application can be installed on terminal device 10. Optionally, the target application can be an application that needs to be downloaded and installed, or it can be a webpage or a mini-program; this application embodiment does not limit this. This application does not limit the specific type of the target application; the target application can be at least one of the following: game applications, video applications, social applications, live streaming applications, shopping applications, etc.

[0036] For example, server 20 is used to provide background services for the client of the target application in terminal device 10. For example, server 20 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms, but is not limited to these.

[0037] Terminal device 10 and server 20 can communicate with each other via a network. This network can be a wired network or a wireless network.

[0038] Optionally, server 20 is implemented as a CDN. Exemplarily, server 20 includes an intermediate node 21 and at least one node. Exemplarily, intermediate node 21 receives a content retrieval request sent by a client on terminal device 10. Exemplarily, intermediate node 21 determines a target node 22 from at least one node to handle the content retrieval request. Exemplarily, target node 22 retrieves first content according to the content retrieval request. Exemplarily, target node 22 sends the first content to the client.

[0039] Of course, intermediate node 21 can also be independent of the CDN and implemented as a different network node than the nodes in the CDN.

[0040] Optionally, intermediate node 21 is used to allocate an appropriate node for the content retrieval request sent by the client. Intermediate node 21 can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server, but is not limited to these.

[0041] Optionally, the target node 22 is used to handle content retrieval requests sent by the client. The target node 22 can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server, but is not limited to these. In possible implementations, the target node 22 can also be implemented as a terminal device.

[0042] Intermediate node 21 and target node 22 can communicate with each other via a network. This network can be a wired network or a wireless network.

[0043] In the following embodiments of this application, the execution entity of each step is explained and described using a computer device. For example, the computer device may be the server 20 or the intermediate node 21.

[0044] The following is combined Figures 2-5 The following is a brief description of the request processing methods mentioned in this application.

[0045] PCDN (Peer-to-Peer Content Delivery Network) is even more edge-oriented than CDN's edge data centers. It is a content delivery network composed of a massive number of heterogeneous nodes (with varying amounts of memory, bandwidth, disk size, etc. among the nodes).

[0046] Please refer to Figure 2 If file A is not cached locally on the PCDN node, the process of a user requesting file A from the PCDN node includes at least one of the following steps.

[0047] S1, the user (client) requests file A from the PCDN node.

[0048] S2, PCDN node lookup (local) cache.

[0049] S3, PCDN cache not hit, PCDN node requests file A back to origin.

[0050] S4, the source site response file A is sent to the PCDN node.

[0051] S5, PCDN node caches file A.

[0052] S6, PCDN node response file A is given to the user.

[0053] Please refer to Figure 3 If file A is cached locally on the PCDN node, the process of a user requesting file A from the PCDN node includes at least one of the following steps.

[0054] P1, the user requests file A from the PCDN node.

[0055] P2, PCDN node lookup (local) cache.

[0056] P3, cache hit, PCDN node directly responds to file A with the user.

[0057] In related technologies, the larger the node bandwidth, the more files can be cached. However, the PCDN network has a high degree of node heterogeneity, with many nodes having very small storage and unable to cache many files. This results in a high origin pull rate on small storage nodes, leading to high origin pull costs. Origin pull refers to the need to request the corresponding file from the origin server when the content delivery network does not have the corresponding file cached.

[0058] Maximizing the value of PCDN nodes involves: 1. Fully utilizing the node's uplink bandwidth (i.e., the bandwidth used to respond to users), resulting in higher returns. 2. Reducing backhaul bandwidth. Origin server bandwidth costs are significant; reducing backhaul bandwidth can effectively lower costs, which necessitates improving cache hit rates.

[0059] Due to the high heterogeneity of PCDN nodes, some nodes have high bandwidth but low storage, while others have low bandwidth but high storage. To maximize the value of PCDN nodes, it is necessary to improve cache utilization: 1. Schedule high-frequency files to nodes with high bandwidth. (High file frequency means that a file is requested many times per unit of time, which requires a large node bandwidth and low storage requirements.) 2. Schedule low-frequency files to nodes with large storage. (Low-frequency files, assuming they are only requested once per hour, require large storage to ensure that the cache is not cleared for at least one hour; otherwise, the next request will need to retrieve data from the origin server. If the cache is too small, space may need to be cleared to cache other files.)

[0060] For example, the hash ring-based node determination method in a PCDN network is as follows: Figure 4 As shown, the PCDN network uses consistent hashing for matching. When a user requests a file, the corresponding node is matched according to the consistent hash, and that node is responsible for caching the file. The request is then scheduled to the corresponding node.

[0061] For example, hash ring 410 represents different resources. Hash ring 420 represents different nodes in the PCDN network. Here, "resource" refers to the resource requested by the user. Figure 4As shown, the content retrieval request corresponding to resource 1 is scheduled to node A. Figure 4 As shown, the content retrieval request corresponding to resource 2 is scheduled to node D.

[0062] PCDN groups all nodes into a consistent hash ring, without considering file popularity or the impact of heterogeneous node storage space on cache utilization. For example, it might schedule many cold files to nodes with small storage, resulting in a high node origin pull rate and low cache utilization.

[0063] PCDN typically calculates a node's weight on the consistent hashing ring based on its bandwidth (usually using 1Mbps as a unit for each virtual node, dividing the node into multiple virtual nodes based on bandwidth; the more virtual nodes, the greater the weight). However, scheduling based on bandwidth can lead to high origin pull rates for such nodes. For example, consider a node with 100Mbps bandwidth / 1GB storage, assuming each file is 0.5GB (enough to store two files). The following two scenarios both involve scheduling 100Mbps traffic to this node. A / B / C / D / E / F refer to filenames.

[0064] Table 1 shows the scheduling sequences and return-to-origin rates for different scenarios.

[0065] Scene Scheduling sequence Source return rate High-demand businesses A|A|A|A|A|A|A|A|A|A 10% Businesses with low popularity B|C|D|E|F|B|C|D|E|F 100%

[0066] In Table 1 above, for high-demand services (file A is highly popular), 10 requests for file A were scheduled to this node. This node only needs to retrieve the origin server and cache the file on the first request, and the subsequent 9 requests can directly hit the local cache, resulting in an origin server retrieval rate of 10%. This approach performs well, as high-demand files are scheduled to nodes with high bandwidth, resulting in high cache utilization.

[0067] In Table 1 above, for low-frequency requests (files B / C / D / E / F are low-frequency), the first two requests for files B and C, after being retrieved from the origin server and cached, already fill the 1GB storage of that node. The third request for file D does not hit the cache; after being retrieved from the origin server, caching it requires clearing the previously cached B or C. This continues, resulting in a persistent cache miss, poor utilization, and a 100% origin server hit rate. This approach is poor because low-frequency files are scheduled to nodes with limited storage. If the node's storage space is sufficient to cache B / C / D / E / F, then over time, with more requests coming in, the origin server hit rate can continuously decrease.

[0068] This application fully considers the impact of bandwidth and storage on cache utilization and designs a multi-level consistent hash ring based on two-dimensional features (such as bandwidth and storage) to enable small storage to serve more hot files and allow limited storage to serve a large number of requests, thereby significantly improving cache utilization.

[0069] Specifically, the PCDN platform runs multiple services with varying levels of activity; high-activity services rely heavily on bandwidth, while low-activity services rely heavily on storage. When partitioning virtual nodes, basing the partitions solely on bandwidth or storage is unreasonable, as is simply weighting them individually. Therefore, virtual nodes are partitioned according to a weighted average of bandwidth and storage, creating multiple hash rings with different weighting ratios (i.e., the ratios mentioned below). Services are then matched to the most suitable ring based on their activity level.

[0070] Please refer to Figure 5 This diagram illustrates a request processing method provided in another embodiment of this application. The method may include at least one of the following steps (Q1 to Q10).

[0071] In step Q1, the terminal device sends a content retrieval request to the intermediate node.

[0072] Step Q2: The intermediate node obtains the popularity value of the first content requested.

[0073] Step Q3: The intermediate node obtains the hash ring corresponding to the heat value.

[0074] In step Q4, the intermediate node determines the target virtual node from the hash ring.

[0075] Step Q5: The intermediate node deduces the target node from the target virtual node.

[0076] In step Q6, the intermediate node sends a content retrieval request to the target node.

[0077] Step Q7: If the target node has the first content in its local cache, retrieve the first content from the local cache.

[0078] In step Q8, if the target node does not have the first content in its local cache, it retrieves the first content from the origin server and caches it.

[0079] Step Q9: The target node sends the first content to the intermediate node.

[0080] In step Q10, the intermediate node sends the first content to the terminal device.

[0081] For details on the specific implementation of the solution, please refer to the explanation of the following embodiments, which will not be repeated here.

[0082] Please refer to Figure 6 The diagram illustrates a flowchart of a request processing method provided in one embodiment of this application. The execution entity for each step of this method can be the aforementioned computer device. The method may include at least one of the following steps (610-640).

[0083] Step 610: Receive the content retrieval request sent by the client. The content retrieval request is used to request the first content from the CDN.

[0084] The client mentioned in the embodiments of this application refers to the client of the target application. This application does not limit the specific type of the target application, which can be at least one of the following: game application, video application, social application, live streaming application, shopping application, etc.

[0085] The content retrieval request in this embodiment is a request to retrieve first content. Exemplarily, the first content can be at least one of text, file, audio, video, etc. Exemplarily, the content retrieval request is an HTTP (Hypertext Transfer Protocol) request.

[0086] For example, here CDN is considered to be the backend server of the target application, or the CDN includes the backend server of the target application.

[0087] The CDN in this embodiment includes at least one node, and each node is considered a CDN node. Exemplarily, a CDN node is used to process content retrieval requests sent by a client. A CDN node can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server, but is not limited to these.

[0088] This application does not limit the type of CDN, such as PCDN (Peer-to-Peer Content Delivery Network, decentralized node network), also known as P2P CDN. Exemplarily, CDN nodes are also called PCDN nodes. Exemplarily, PCDN nodes can be terminal devices in addition to servers.

[0089] Step 620: Obtain a first ratio that matches the first content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, where each dimension is used to characterize an attribute of the node.

[0090] In some embodiments, a target node is determined from at least two nodes based on the content retrieval request and the node information corresponding to at least two nodes included in the CDN. The node information includes information in at least two dimensions, each dimension being used to characterize an attribute of the node.

[0091] For example, different content corresponds to different ratios. For example, the ratio matching each content is preset. For example, the first ratio is used to indicate the proportional relationship between information in at least two dimensions. Taking information in at least two dimensions including node bandwidth and node storage as an example, the first ratio can be the ratio between node bandwidth and node storage. For example, the first ratio can be any numerical value, such as a:b, where a represents a preset value of node bandwidth, b represents a preset value of node storage, a and b can be any preset numerical value, and a and b are positive numbers. For example, the first ratio is 1Mbps / 1GB, simplified as 1:1. For example, the first ratio is 1Mbps / 5GB, simplified as 1:5. For example, the first ratio is 1Mbps / 10GB, simplified as 1:10. Of course, the first ratio can also be other ratios, and the specific numerical value of the ratio is not limited in this application.

[0092] For example, taking information with at least two dimensions, including first information and second information, as an example, the first ratio is c:d, where c represents a preset value of the first information, d represents a preset value of the second information, and c and d can be any preset value, and both c and d are positive numbers. The first information is information containing any one or at least two attributes of the aforementioned node information. The second information is information containing any one or at least two attributes of the aforementioned node information.

[0093] Of course, the first ratio can be the ratio between preset values ​​of two dimensions of information, or it can be the ratio between preset values ​​of N dimensions of information. Any one of the N dimensions of information is any attribute information included in the above node information, and N is an integer greater than 2.

[0094] In some embodiments, each of the at least two nodes included in the CDN has corresponding node information. Exemplarily, this node information refers to information related to the node. Exemplarily, the node information includes information in at least two dimensions. Each dimension of information is used to characterize an attribute of the node; that is, the node information includes information on at least two attributes.

[0095] In this embodiment of the application, the node's attributes include at least one of the following: hardware attributes, software attributes, network attributes, performance attributes, environmental attributes, etc.

[0096] For example, the hardware attribute information includes at least one of the following: node memory, node storage capacity, node power supply, node physical size, etc.

[0097] For example, the information in the software attributes includes at least one of the following: node operating system, node virtualization support, node database service, node security configuration, etc.

[0098] For example, network attribute information includes at least one of the following: node network interface card, node IP (Internet Protocol Address) address, node bandwidth, node traffic limit, node network latency, etc.

[0099] For example, the performance attribute information includes at least one of the following: node computing performance, node storage performance, node network performance, etc.

[0100] For example, the environmental attribute information includes at least one of the following: node operating temperature, node power consumption, node noise level, etc.

[0101] In the technical solutions mentioned in the embodiments of this application, the node information includes information corresponding to at least two of the following: node memory, node storage capacity, node power supply, node physical size, node operating system, node virtualization support, node database service, node security configuration, node network card, node IP address, node bandwidth, node traffic limit, node network latency, node computing performance, node storage performance, node network performance, node operating temperature, node power consumption, node noise level, etc.

[0102] In some embodiments, the first ratio is positively correlated with the popularity value of the first content.

[0103] For example, the higher the popularity value of the first content, the larger the first ratio. For example, the first ratio is 1:1.

[0104] For example, the lower the popularity value of the first content, the smaller the first ratio. For example, the first ratio is 1:5.

[0105] For example, if the popularity value of the first content is higher, the node bandwidth is greater, that is, the node bandwidth in the first ratio is positively correlated with the popularity value of the first content.

[0106] For example, if the popularity value of the first content is lower, the node storage amount is smaller, that is, the node storage amount in the first ratio is negatively correlated with the popularity value of the first content.

[0107] In other embodiments, the first ratio is not strictly positively correlated with the popularity value of the first content. For example, the popularity value is divided into different popularity value intervals, each interval corresponding to a different ratio. For example, the number of popularity value intervals is at least two.

[0108] Optionally, consider two heat value intervals as an example. One heat value interval is 0 to d, and the other heat value interval is d to ∞ (d is a positive number). That is, using the heat value d as the dividing line, when the heat value is less than d, the ratio corresponding to the heat value is the second ratio; when the heat value is greater than or equal to d, the ratio corresponding to the heat value is the third ratio. For example, the second ratio is less than the third ratio.

[0109] In this embodiment, the first ratio is positively correlated with the popularity value of the first content, which allows the target node to be quickly determined for different popularity values. By introducing the first ratio, the efficiency of determining the target node is improved.

[0110] Step 630: Determine the target node from at least two nodes based on the content retrieval request and the first ratio.

[0111] In some embodiments, a target node is determined from at least two nodes based on a preset algorithm, an input content retrieval request, and node information corresponding to at least two nodes. In other embodiments, a neural network model outputs a node identifier for the target node based on the input content retrieval request and node information corresponding to at least two nodes. The target node is then determined based on this node identifier. Exemplarily, this neural network model is a trained model used to determine the target node.

[0112] In some embodiments, a target node is determined from at least two nodes based on a preset algorithm, a content retrieval request, and a first ratio. In other embodiments, a neural network model outputs a node identifier of the target node based on the content retrieval request and the first ratio. The target node is then determined based on this node identifier. Exemplarily, the neural network model is a trained model used to determine the target node.

[0113] In some embodiments, information in at least two dimensions includes node bandwidth and node storage.

[0114] In this application embodiment, node bandwidth (or simply bandwidth) refers to the maximum amount of data that can be transmitted per unit time, typically expressed in bits per second. For example, node bandwidth is used to indicate a node's data transmission capability.

[0115] In this application embodiment, node storage capacity (or simply storage) refers to the maximum capacity of data that a node can hold, and can also be considered as the size of the storage space on the node. For example, the storage space here includes at least one of temporary storage space, permanent storage space, etc.

[0116] In some embodiments, the node information of the target node satisfies at least one of the following: the node bandwidth of the target node is positively correlated with the popularity value of the first content; the node storage of the target node is negatively correlated with the popularity value of the first content.

[0117] The popularity value mentioned in the embodiments of this application is used to indicate the number of times a content is requested within a single time period. For example, the more times a first piece of content is requested within a unit of time, the higher its popularity value. Conversely, the fewer times a first piece of content is requested within a unit of time, the lower its popularity value.

[0118] Optionally, the higher the popularity value of the first content, the higher the node bandwidth of the target node. This is because a high popularity value indicates frequent requests for the first content, which places relatively high bandwidth demands. Therefore, higher node bandwidth is required.

[0119] Optionally, the lower the popularity value of the first content, the larger the node storage size of the target node. This is because a lower popularity value indicates that the first content will not be frequently requested, thus requiring relatively more storage. It is undesirable for the cached first content on the target node to be easily cleared, causing the node to constantly retrieve the first content from the origin server, resulting in a high origin-fetching rate. Therefore, a larger node storage size is needed to reduce the possibility of the first content being cleared due to insufficient node storage space, thereby reducing the likelihood of origin-fetching.

[0120] The technical solution provided in this application fully considers the impact of bandwidth and storage on cache utilization, enabling nodes with small storage (small storage volume) to serve more hot files (high popularity value), allowing limited storage to serve a large number of requests, significantly improving cache utilization and reducing the possibility of back-to-origin requests.

[0121] For details on how to determine the target node, please refer to the explanation of the following embodiments.

[0122] Step 640: Send a content retrieval request to the target node, which will then process the content retrieval request.

[0123] For example, after determining the target node, the intermediate node forwards the content retrieval request to the target node so that the target node can process the content retrieval request.

[0124] For example, as described above, the intermediate node can be a server or a terminal device, and this application does not limit it in this regard. For example, as described above, the target node can be a server or a terminal device, and this application does not limit it in this regard.

[0125] In this embodiment, there are connections between the nodes in the CDN. These connections can be wired network connections or wireless network connections. For example, the intermediate node can be a node included in the CDN, or it can be another node independent of the CDN.

[0126] In some embodiments, the target node is configured to, in response to a content retrieval request, retrieve the first content from the local storage space if the first content exists in the local storage space.

[0127] In other words, if the target node already has the first content in its local storage space, it will retrieve the first content from its local storage space. The node storage capacity mentioned above can be the maximum storage capacity of the node's local storage space.

[0128] In some embodiments, the target node is further configured to, in response to a content retrieval request, retrieve the first content from the source node of the CDN if the first content does not exist in the local storage space, and store the first content in the local storage space.

[0129] In other words, if the target node does not have the first content in its local storage space, it obtains the first content from the source node of the CDN and stores the first content in its local storage space.

[0130] The source node mentioned in the embodiments of this application is also known as the origin server. The origin server is used to store the original files of the target application or webpage. The origin server is the server in a CDN that stores the original data, also called a "back-to-origin server" or "origin server". It is the final source of all content; when the CDN edge node does not cache the content requested by the user, it will pull data from the origin server and cache it. For example, if the target node does not have the first content in its local storage space, it obtains the first content from the origin server. Optionally, the target node stores the first content in its local storage space.

[0131] In some embodiments, the target node is also used to send first content to the client.

[0132] In other words, the target node sends the first content to the client. For example, the target node first sends the first content to the intermediate node, and then the intermediate node sends the first content to the client.

[0133] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the first content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of node information and the content retrieval request is more closely aligned with the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests.

[0134] The technical solution provided in this application embodiment allows the target node to retrieve the first content locally and send it to the client if the first content exists locally; otherwise, it retrieves the first content from the origin server and sends it to the client. This method of prioritizing local retrieval minimizes data transmission overhead and reduces the number of origin server requests. It improves request processing efficiency and speeds up content retrieval.

[0135] Please refer to Figure 7 The diagram illustrates a flowchart of a request processing method provided in one embodiment of this application. The execution entity for each step of this method can be the aforementioned computer device. The method may include at least one of the following steps (710-760).

[0136] Step 710: Receive the content retrieval request sent by the client. The content retrieval request is used to request the first content from the CDN.

[0137] Step 720: Obtain a first ratio that matches the first content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, where each dimension is used to characterize an attribute of the node.

[0138] In some embodiments, a popularity value of a first content is obtained based on a content retrieval request. The popularity value of the first content is used to indicate the number of times the first content is requested to be retrieved per unit time.

[0139] For example, a popularity value of the first content is obtained based on a content retrieval request. In a possible implementation, the content retrieval request carries identification information of the first content. For example, the popularity value of the first content is obtained based on the identification information of the first content. For example, the identification information of the first content is used as an index to look up the popularity value of the first content. For example, the popularity values ​​corresponding to different content are pre-stored on the intermediate nodes.

[0140] For example, a pre-configured third relationship table is obtained, which includes at least one set of matching relationships (or correspondence relationships, or mapping relationships) between popularity values ​​and content identification information. For example, the intermediate nodes store the third relationship table in advance.

[0141] For example, the popularity value that matches the identification information of the first content is obtained from the third relation table and used as the popularity value of the first content.

[0142] In some embodiments, a first ratio is obtained based on the popularity value of the first content. The first ratio is a ratio that matches the popularity value of the first content and is used to indicate the proportional relationship between information in at least two dimensions.

[0143] For example, a first ratio is obtained based on the popularity value of the first content. In a possible implementation, the intermediate nodes pre-store the ratios corresponding to different popularity values. The first ratio is the ratio corresponding to the popularity value of the first content.

[0144] For example, a pre-configured second relationship table is obtained, which includes at least one set of matching relationships (or correspondence relationships, or mapping relationships) between heat values ​​and ratios. For example, the intermediate nodes store the second relationship table in advance.

[0145] For example, the ratio that matches the popularity value of the first content is obtained from the second relation table and used as the first ratio. Optionally, the popularity value of the first content is used as an index to find the ratio that matches the popularity value of the first content from the second relation table and used as the first ratio.

[0146] The technical solution provided in this application embodiment can improve the speed of determining the first ratio by pre-configuring the second relationship table, thereby improving the efficiency of request processing.

[0147] Step 730: Obtain the hash value of the first content based on the content retrieval request.

[0148] For example, the hash value corresponding to the first content is obtained. For example, the hash value of the first content is calculated using a hash function. For example, the hash value of the first content is calculated based on its identifier information using a hash function. For example, the hash value of each content is either pre-stored or calculated in real time.

[0149] Step 740: Obtain the first hash ring according to the first ratio. The first hash ring is a hash ring that matches the first ratio. The hash ring is used to indicate the hash value space in the form of a virtual ring. The first hash ring is used to indicate the positions of at least two nodes in the hash value space.

[0150] In some embodiments, there is a correspondence between a first ratio and a first hash ring. For example, after the first ratio is determined, the first hash ring that matches (corresponds to) the first ratio is obtained using the first ratio as an index.

[0151] In some embodiments, a first hash ring is obtained based on a first ratio. The first hash ring is a hash ring that matches the first ratio and is used to indicate the hash value space in the form of a virtual ring. In some embodiments, the first hash ring is used to indicate the positions of at least two nodes in the hash value space.

[0152] In some embodiments, the first hash ring is used to indicate the position of the virtual nodes corresponding to at least two nodes in the hash value space, and the virtual nodes corresponding to at least two nodes are determined based on the first ratio and the node information corresponding to at least two nodes.

[0153] The hash ring in this application refers to a consistent hashing ring. For example, consistent hashing organizes the entire hash value space into a virtual ring. If the value space of the hash function is 0 to c (where c is a positive number), then the entire hash ring is used to represent 0 to c, mapping all input values ​​to 0 to c to form a virtual ring.

[0154] In one possible implementation, the virtual nodes corresponding to the nodes are hashed. For example, the IP address, hostname, or other business attributes of the virtual node are selected as keys, and a hash function is used to obtain the hash value corresponding to the virtual node. Based on this, the virtual node corresponding to each node can be mapped to a position on a hash ring. For example, the virtual nodes corresponding to all nodes included in the CDN are mapped onto the hash ring.

[0155] The first hash ring in this embodiment refers to a hash ring on which virtual nodes have been mapped, that is, a hash ring that includes virtual nodes. For the specific construction process of this first hash ring, please refer to the explanation of the following embodiments, which will not be repeated here.

[0156] In this embodiment, each ratio corresponds to a matching hash ring. For example, the hash ring matched by the first ratio is the first hash ring. For example, the hash rings matched by each ratio are pre-constructed.

[0157] For example, a pre-configured first relation table is obtained, which includes at least one set of matching relationships (or correspondence relationships, or mapping relationships) between ratios and hash rings. For example, the intermediate nodes store the first relation table in advance.

[0158] For example, a hash ring matching the first ratio is obtained from the first relation table and is used as the first hash ring. Alternatively, the hash ring matching the first ratio is found from the first relation table using the first ratio as an index and is used as the first hash ring.

[0159] Of course, the first hash ring can also be constructed based on the first ratio after the first ratio has been determined. This application does not limit the timing of constructing the first hash ring.

[0160] The technical solution provided in this application embodiment can improve the determination speed of hash ring by pre-configuring the first relation table, thereby improving the efficiency of request processing.

[0161] Step 750: Determine the target node from at least two nodes based on the hash value of the first content and the first hash ring.

[0162] In some embodiments, a target node is determined from at least two nodes based on a first ratio and node information corresponding to at least two nodes respectively. For example, the closest node on a first hash ring is found based on the hash value of the first content and is selected as the target node.

[0163] Optionally, based on the first ratio, virtual node partitioning is performed on at least two nodes respectively, resulting in virtual nodes corresponding to at least two nodes respectively. For example, the target node is determined from the virtual nodes corresponding to at least two nodes respectively.

[0164] For details regarding the division of virtual nodes, please refer to the explanation of the following embodiments, which will not be repeated here.

[0165] Step 760: Send a content retrieval request to the target node, which will then process the content retrieval request.

[0166] The technical solution provided in this application uses the popularity value of the first content as a limiting condition to determine the target node. This allows first content with a high popularity value (i.e., the services with high popularity value mentioned below) to be allocated to nodes with large node bandwidth, while first content with a low popularity value (i.e., the services with low popularity value mentioned below) can be allocated to nodes with large node storage capacity. This approach helps improve the utilization rate of node cache and reduce the number of origin server requests.

[0167] The following explanation of step 750, in conjunction with steps K1 to K2, provides further clarification.

[0168] Step K1: Based on the hash value of the first content and the first hash ring, determine the target virtual node from the virtual nodes corresponding to at least two nodes respectively.

[0169] For example, after obtaining the hash value of the first content, the position of the first content on the first hash ring can be obtained. Based on the position of the first content on the first hash ring, and the positions of the virtual nodes corresponding to at least two nodes on the first hash ring, a target virtual node is determined. For example, the target virtual node is the virtual node on the first hash ring closest to the location of the first content. For example, the target virtual node is the virtual node on the first hash ring closest to the location of the first content in a first direction. For example, the first direction is clockwise.

[0170] In some embodiments, starting from the hash value of the first content, moving along the first direction of the first hash ring, the first virtual node passed is determined as the target virtual node.

[0171] For example, the first direction is clockwise. For example, starting from the hash value of the first content, moving clockwise along the first hash ring, the first virtual node passed is identified as the target virtual node.

[0172] For example, the first direction is counterclockwise. For example, starting from the hash value of the first content, moving counterclockwise along the first hash ring, the first virtual node passed is determined as the target virtual node.

[0173] In some embodiments, a target node is determined from at least two nodes based on a first ratio and node information corresponding to at least two nodes respectively.

[0174] Optionally, based on the first ratio, virtual node partitioning is performed on at least two nodes respectively, resulting in virtual nodes corresponding to at least two nodes respectively. For example, the target node is determined from the virtual nodes corresponding to at least two nodes respectively.

[0175] The technical solution provided in this application starts with the hash value of the first content, moves along a first direction of the first hash ring, and determines the first virtual node passed through as the target virtual node. This method ensures that the determined virtual node is the node that best matches the first content, which not only improves the speed of determining the target virtual node but also guarantees the accuracy of the determined node.

[0176] The construction process of the first hash ring in this embodiment is as follows.

[0177] For example, virtual nodes corresponding to at least two nodes are determined based on the first ratio and the node information corresponding to at least two nodes respectively.

[0178] Optionally, based on the first ratio, the virtual node partitioning is performed on at least two nodes respectively to determine the virtual nodes corresponding to at least two nodes respectively.

[0179] Optionally, virtual nodes here differ from physical nodes. A physical node is an actual, existing physical node, while a virtual node is merely a virtual node and does not exist as a physical node. A virtual node corresponding to a physical node is used to represent that physical node.

[0180] Optionally, for the i-th node among at least two nodes, the i-th node is divided into virtual nodes according to the first ratio to obtain at least one virtual node corresponding to the i-th node. The node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer.

[0181] For example, the i-th node refers to any one of at least two nodes.

[0182] For example, taking a first ratio of 1Mbps / 1GB as an example, if the node bandwidth of the i-th node is 100Mbps and the node storage is 100GB, then the i-th node can be divided into a maximum of 100 virtual nodes. Each virtual node has a node bandwidth of 1Mbps and a node storage of 1GB.

[0183] For example, taking a first ratio of 1Mbps / 1GB as an example, if the node bandwidth of the i-th node is 60Mbps and the node storage is 300GB, then the i-th node can be divided into a maximum of 60 virtual nodes. Each virtual node has a node bandwidth of 1Mbps and a node storage of 1GB.

[0184] For example, taking a first ratio of 1Mbps / 5GB as an example, if the node bandwidth of the i-th node is 100Mbps and the node storage is 100GB, then the i-th node can be divided into a maximum of 20 virtual nodes. Each virtual node has a node bandwidth of 1Mbps and a node storage of 5GB.

[0185] For example, taking a first ratio of 1Mbps / 5GB as an example, if the node bandwidth of the i-th node is 60Mbps and the node storage is 300GB, then the i-th node can be divided into a maximum of 60 virtual nodes. Each virtual node has a node bandwidth of 1Mbps and a node storage of 5GB.

[0186] For example, for the i-th node, the sum of the node bandwidths of all its corresponding virtual nodes is less than or equal to the node bandwidth of the i-th node.

[0187] For example, for the i-th node, the sum of the node storage of all its corresponding virtual nodes is less than or equal to the node storage of the i-th node.

[0188] Optionally, for each of the at least two nodes, the virtual node partitioning is performed separately to obtain the virtual nodes corresponding to the at least two nodes respectively.

[0189] For example, for each of at least two nodes, a virtual node is partitioned according to a first ratio to obtain at least one virtual node corresponding to the node, and the node information of each virtual node corresponding to the node satisfies the first ratio.

[0190] For example, the positions of the virtual nodes corresponding to at least two nodes in the hash ring are determined based on the hash values ​​of the virtual nodes corresponding to at least two nodes respectively.

[0191] Optionally, a hash value can be calculated for each virtual node corresponding to each node using a hash function to obtain the hash value of each virtual node corresponding to each node.

[0192] For example, a first hash ring is constructed based on the hash ring and the positions of the virtual nodes corresponding to at least two nodes in the hash ring.

[0193] Optionally, each virtual node corresponding to each node is mapped to a hash ring based on the hash value of each virtual node corresponding to each node. Here, the hash ring before mapping refers to the initial hash ring, which only represents the hash value space.

[0194] Based on this, the position of each virtual node on the hash ring was determined, thus obtaining the first hash ring.

[0195] The technical solution provided in this application constructs a first hash ring by partitioning at least two nodes into virtual nodes, demonstrating the diversity of hash ring construction methods. Furthermore, performing the virtual node partitioning based on a first ratio also reflects the matching between the first hash ring and the first ratio. Therefore, the final determined target node meets the requirement of the heat value corresponding to the first ratio, reflecting the accuracy of node determination and improving the utilization rate of node cache.

[0196] Step K2: Determine the node corresponding to the target virtual node as the target node.

[0197] For example, since there is a correspondence between nodes and their corresponding virtual nodes, once the target virtual node is determined, the node to which the target virtual node belongs can also be deduced. That is, there is a mapping relationship between virtual nodes and nodes, and based on this mapping relationship, the node corresponding to the target virtual node can be obtained to get the target node.

[0198] The technical solution provided in this application addresses the uneven distribution of physical nodes (nodes in a CDN) on the hash ring by introducing virtual nodes. Specifically, instead of mapping physical nodes to the hash ring, virtual nodes are mapped to the hash ring, and these virtual nodes are then mapped to physical nodes. This two-layer mapping relationship improves the balance of nodes on the hash ring, thus meeting the requirements of load balancing.

[0199] Of course, it is also possible not to introduce virtual nodes. In other possible implementations, the target node is determined from at least two nodes based on the hash value of the first content and the first hash ring. In this case, the first hash ring is used to indicate the positions of the at least two nodes in the hash value space.

[0200] One possible implementation involves hashing the nodes. For example, the node's IP address, hostname, or other business attribute is selected as a key and hashed using a hash function to obtain the node's hash value. Based on this, each node can be mapped to a position on a hash ring. For example, all nodes included in the CDN are mapped onto the hash ring.

[0201] The first hash ring in this embodiment refers to a hash ring on which nodes have been mapped, that is, a hash ring that includes nodes. For the specific construction process of this first hash ring, please refer to the explanation of the following embodiments, which will not be repeated here.

[0202] For example, the hash value of the first content is calculated using a hash function. For example, based on the hash value of the first content, the first content is mapped onto a first hash ring to obtain the position of the first content on the first hash ring.

[0203] For example, each node included in the CDN has a corresponding location on the first hash ring. For example, the hash value of the node is calculated using a hash function to map the node to the hash ring, thus obtaining the first hash ring.

[0204] For example, starting from the position of the hash value of the first content on the first hash ring, moving along a first direction of the first hash ring, the first node passed is determined as the target node. For example, the first direction is clockwise. For example, starting from the position of the hash value of the first content on the first hash ring, moving along a clockwise direction of the first hash ring, the first node passed is determined as the target node.

[0205] The request processing method provided in this application embodiment specifically includes at least one of the following steps 1 to 13 (not shown in the figure).

[0206] Step 1: The intermediate node receives the content retrieval request sent by the client. The content retrieval request is used to request the first content from the CDN.

[0207] Step 2: The intermediate node obtains the popularity value of the first content based on the content retrieval request. The popularity value of the first content is used to indicate the number of times the first content is requested to be retrieved per unit time.

[0208] Step 3: The intermediate node obtains the first ratio based on the popularity value of the first content. The first ratio is a ratio that matches the popularity value of the first content. The ratio is used to indicate the ratio of node bandwidth to node storage.

[0209] Step 4: For the i-th node among at least two nodes, the intermediate node performs virtual node partitioning according to the first ratio to obtain at least one virtual node corresponding to the i-th node. The node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer.

[0210] Step 5: For each of the at least two nodes, the intermediate node performs virtual node partitioning to obtain the virtual nodes corresponding to the at least two nodes respectively.

[0211] Step 6: The intermediate node determines the position of the virtual node corresponding to at least two nodes in the hash ring based on the hash values ​​of the virtual nodes corresponding to at least two nodes respectively.

[0212] Step 7: The intermediate node constructs the first hash ring based on the hash ring and the positions of the virtual nodes corresponding to at least two nodes in the hash ring.

[0213] Step 8: The intermediate node obtains the first hash ring.

[0214] Step 9: Starting from the hash value of the first content, the intermediate node moves clockwise along the first hash ring and determines the first virtual node it passes through as the target virtual node.

[0215] Step 10: The intermediate node determines the node corresponding to the target virtual node as the target node.

[0216] Step 11: The target node responds to the content retrieval request and retrieves the first content from the local storage space if the first content already exists in the local storage space.

[0217] Step 12: In response to the content retrieval request, if the first content does not exist in the local storage space, the target node retrieves the first content from the source node of the CDN and stores the first content in the local storage space.

[0218] Step 13: The target node sends the first content to the client.

[0219] The technical solution provided in this application will be further explained below with reference to Table 2.

[0220] Table 2 shows the ratios of different hash rings, the number of virtual nodes, and the correspondence between scenarios.

[0221]

[0222] For example, consider two bandwidth-to-storage ratios. Two nodes: Node A has 100Mbps bandwidth / 100GB storage, and Node B has 60Mbps bandwidth / 300GB storage. Design two consistent hash rings based on these storage-to-bandwidth ratios.

[0223] 1. A consistent hashing ring with a bandwidth-to-storage ratio of 1:1 (virtual nodes have 1Mbps bandwidth / 1GB storage). Node A is divided into 100 virtual nodes, and node B into 60 virtual nodes. For high-frequency services (most files are frequently accessed), this ring is used for consistent hashing. The advantage is that nodes with higher bandwidth have more virtual nodes, resulting in more frequently matched files. This satisfies the requirement of "scheduling frequently accessed files to nodes with higher bandwidth" to improve cache utilization.

[0224] 2. A consistent hashing ring with a bandwidth-to-storage ratio of 1:5 (virtual nodes have 1Mbps bandwidth / 5GB storage). Node A is divided into 20 virtual nodes, and node B into 100 virtual nodes. For low-frequency services (most files are low-frequency), this ring is used for consistent hashing. The advantage is that nodes with larger storage have more virtual nodes, resulting in more matching of cold files. This satisfies the requirement of "scheduling low-frequency files to nodes with larger storage" to "improve cache utilization."

[0225] It should be noted that nodes A and B exist on both hash rings simultaneously. The technical solution provided in this application is not limited to the bandwidth-to-storage ratios of 1:1 and 1:5; multiple consistent hash rings are possible.

[0226] The technical solution provided in this application fully considers the impact of bandwidth and storage on cache utilization. It designs a multi-level consistent hash ring based on two-dimensional features, which can schedule more popular files to high-bandwidth nodes and more unpopular files to high-storage nodes. This fully utilizes the bandwidth and storage of nodes, significantly improves cache utilization, increases bandwidth revenue, and effectively reduces the cost of returning to the origin (reduced origin return rate).

[0227] The following describes specific application scenarios and examples.

[0228] Scenario 1, the content is video content.

[0229] Please refer to Figure 8 The diagram illustrates a flowchart of a request processing method provided in another embodiment of this application. The execution entity for each step of this method can be the aforementioned computer device. The method may include at least one of the following steps (810-840).

[0230] Step 810: Receive a content retrieval request sent by the client. The content retrieval request is used to request video content from the CDN, which includes at least two nodes.

[0231] Step 820: Obtain a first ratio that matches the video content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, each of which is used to characterize an attribute of the node.

[0232] Step 830: Determine the target node from at least two nodes based on the content retrieval request and the first ratio.

[0233] Step 840: Send a content retrieval request to the target node, which will then process the content retrieval request.

[0234] In some embodiments, the hash value of the video content is obtained based on the content retrieval request.

[0235] In some embodiments, a first hash ring is obtained based on a first ratio. The first hash ring is a hash ring that matches the first ratio. The hash ring is used to indicate the hash value space in the form of a virtual ring. The first hash ring is used to indicate the positions of at least two nodes in the hash value space.

[0236] In some embodiments, the target node is determined from at least two nodes based on the hash value of the video content and a first hash ring.

[0237] In some embodiments, the first hash ring is used to indicate the position of the virtual nodes corresponding to at least two nodes in the hash value space. The virtual nodes corresponding to at least two nodes are determined based on the first ratio and the node information corresponding to at least two nodes. The node information includes information in at least two dimensions.

[0238] In some embodiments, a target virtual node is determined from the virtual nodes corresponding to at least two nodes based on the hash value of the video content and the first hash ring; the node corresponding to the target virtual node is then determined as the target node.

[0239] In some embodiments, starting from the hash value of the video content, moving along a first direction of the first hash ring, the first virtual node passed is determined as the target virtual node.

[0240] In some embodiments, the construction process of the first hash ring is as follows: based on the first ratio and the node information corresponding to at least two nodes, determine the virtual nodes corresponding to at least two nodes respectively; based on the hash values ​​of the virtual nodes corresponding to at least two nodes respectively, determine the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring; and construct the first hash ring based on the hash ring and the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring.

[0241] In some embodiments, for the i-th node among at least two nodes, the i-th node is divided into virtual nodes according to a first ratio to obtain at least one virtual node corresponding to the i-th node, and the node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer; for each of the at least two nodes, the virtual node is divided into virtual nodes respectively to obtain virtual nodes corresponding to the at least two nodes respectively.

[0242] In some embodiments, a pre-configured first relation table is obtained, the first relation table including at least one set of matching relationships between ratios and hash rings; from the first relation table, a hash ring that matches a first ratio is obtained as a first hash ring.

[0243] In some embodiments, based on a content retrieval request, a popularity value of the video content is obtained, the popularity value of the video content being used to indicate the number of times the video content is requested to be retrieved per unit time; based on the popularity value of the video content, a first ratio is obtained, the first ratio being a ratio that matches the popularity value of the video content.

[0244] In some embodiments, a pre-configured second relationship table is obtained, the second relationship table including at least one set of matching relationships between popularity values ​​and ratios; from the second relationship table, the ratio that matches the popularity value of the video content is obtained as the first ratio.

[0245] In some embodiments, the first ratio is positively correlated with the popularity value of the video content, which indicates the number of times the video content is requested per unit time.

[0246] In some embodiments, information in at least two dimensions includes node bandwidth and node storage.

[0247] In some embodiments, the target node satisfies at least one of the following: the node bandwidth of the target node is positively correlated with the popularity value of the video content; the node storage of the target node is negatively correlated with the popularity value of the video content.

[0248] In some embodiments, the target node is configured to, in response to a content retrieval request, retrieve video content from local storage if the video content exists in local storage; the target node is also configured to, in response to a content retrieval request, retrieve video content from the source node of the CDN if the video content does not exist in local storage; store the video content in local storage; and the target node is also configured to send the video content to the client.

[0249] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the video content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of node information and the content retrieval request is more closely aligned with the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests.

[0250] Scenario 2, the content is audio.

[0251] Please refer to Figure 9 The diagram illustrates a flowchart of a request processing method provided in another embodiment of this application. The execution entity for each step of this method can be the aforementioned computer device. The method may include at least one of the following steps (910-940).

[0252] Step 910: Receive a content retrieval request sent by the client. The content retrieval request is used to request audio content from the CDN, which includes at least two nodes.

[0253] Step 920: Obtain a first ratio that matches the audio content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, each of which is used to characterize an attribute of the node.

[0254] Step 930: Determine the target node from at least two nodes based on the content retrieval request and the first ratio.

[0255] Step 940: Send a content retrieval request to the target node, which will then process the content retrieval request.

[0256] In some embodiments, based on a content retrieval request, the hash value of the audio content is obtained; based on a first ratio, a first hash ring is obtained, the first hash ring being a hash ring that matches the first ratio, the hash ring being used to indicate the hash value space in the form of a virtual ring, and the first hash ring being used to indicate the positions of at least two nodes in the hash value space;

[0257] In some embodiments, the target node is determined from at least two nodes based on the hash value of the audio content and a first hash ring.

[0258] In some embodiments, the first hash ring is used to indicate the position of the virtual nodes corresponding to at least two nodes in the hash value space. The virtual nodes corresponding to at least two nodes are determined based on the first ratio and the node information corresponding to at least two nodes. The node information includes information in at least two dimensions.

[0259] In some embodiments, a target virtual node is determined from the virtual nodes corresponding to at least two nodes based on the hash value of the audio content and the first hash ring; the node corresponding to the target virtual node is then determined as the target node.

[0260] In some embodiments, starting from the hash value of the audio content, moving along a first direction of the first hash ring, the first virtual node passed is determined as the target virtual node.

[0261] In some embodiments, the construction process of the first hash ring is as follows: based on the first ratio and the node information corresponding to at least two nodes, determine the virtual nodes corresponding to at least two nodes respectively; based on the hash values ​​of the virtual nodes corresponding to at least two nodes respectively, determine the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring; and construct the first hash ring based on the hash ring and the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring.

[0262] In some embodiments, for the i-th node among at least two nodes, the i-th node is divided into virtual nodes according to a first ratio to obtain at least one virtual node corresponding to the i-th node, and the node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer; for each of the at least two nodes, the virtual node is divided into virtual nodes respectively to obtain virtual nodes corresponding to the at least two nodes respectively.

[0263] In some embodiments, a pre-configured first relation table is obtained, the first relation table including at least one set of matching relationships between ratios and hash rings; from the first relation table, a hash ring that matches a first ratio is obtained as a first hash ring.

[0264] In some embodiments, based on a content retrieval request, a popularity value of the audio content is obtained, the popularity value of the audio content being used to indicate the number of times the audio content is requested to be retrieved per unit time; based on the popularity value of the audio content, a first ratio is obtained, the first ratio being a ratio that matches the popularity value of the audio content.

[0265] In some embodiments, a pre-configured second relationship table is obtained, the second relationship table including at least one set of matching relationships between heat values ​​and ratios; from the second relationship table, the ratio that matches the heat value of the audio content is obtained as the first ratio.

[0266] In some embodiments, the first ratio is positively correlated with the popularity value of the audio content, which indicates the number of times the audio content is requested per unit time.

[0267] In some embodiments, information in at least two dimensions includes node bandwidth and node storage.

[0268] In some embodiments, the target node satisfies at least one of the following: the node bandwidth of the target node is positively correlated with the popularity value of the audio content; the node storage of the target node is negatively correlated with the popularity value of the audio content.

[0269] In some embodiments, the target node is configured to, in response to a content retrieval request, retrieve audio content from local storage if the audio content exists in local storage; the target node is also configured to, in response to a content retrieval request, retrieve audio content from the source node of the CDN if the audio content does not exist in local storage; store the audio content in local storage; and the target node is also configured to send the audio content to the client.

[0270] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the audio content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of information about the node and the content retrieval request is more closely aligned with the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests.

[0271] Scenario 3, the content is the file content.

[0272] Please refer to Figure 10 The diagram illustrates a flowchart of a request processing method provided in another embodiment of this application. The execution entity for each step of this method can be the aforementioned computer device. The method may include at least one of the following steps (1010-1040).

[0273] Step 1010: Receive a content retrieval request sent by the client. The content retrieval request is used to request file content from the CDN, which includes at least two nodes.

[0274] Step 1020: Obtain a first ratio that matches the file content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, each of which is used to characterize an attribute of the node.

[0275] Step 1030: Determine the target node from at least two nodes based on the content retrieval request and the first ratio.

[0276] Step 1040: Send a content retrieval request to the target node, which will then process the content retrieval request.

[0277] In some embodiments, the hash value of the file content is obtained based on the content retrieval request.

[0278] In some embodiments, a first hash ring is obtained based on a first ratio. The first hash ring is a hash ring that matches the first ratio. The hash ring is used to indicate the hash value space in the form of a virtual ring. The first hash ring is used to indicate the positions of at least two nodes in the hash value space.

[0279] In some embodiments, the target node is determined from at least two nodes based on the hash value of the file content and a first hash ring.

[0280] In some embodiments, the first hash ring is used to indicate the position of the virtual nodes corresponding to at least two nodes in the hash value space. The virtual nodes corresponding to at least two nodes are determined based on the first ratio and the node information corresponding to at least two nodes. The node information includes information in at least two dimensions.

[0281] In some embodiments, a target virtual node is determined from the virtual nodes corresponding to at least two nodes based on the hash value of the file content and the first hash ring; the node corresponding to the target virtual node is then determined as the target node.

[0282] In some embodiments, starting from the hash value of the file content, moving along a first direction of the first hash ring, the first virtual node passed is determined as the target virtual node.

[0283] In some embodiments, the construction process of the first hash ring is as follows: based on the first ratio and the node information corresponding to at least two nodes, determine the virtual nodes corresponding to at least two nodes respectively; based on the hash values ​​of the virtual nodes corresponding to at least two nodes respectively, determine the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring; and construct the first hash ring based on the hash ring and the positions of the virtual nodes corresponding to at least two nodes respectively in the hash ring.

[0284] In some embodiments, for the i-th node among at least two nodes, the i-th node is divided into virtual nodes according to a first ratio to obtain at least one virtual node corresponding to the i-th node, and the node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer; for each of the at least two nodes, the virtual node is divided into virtual nodes respectively to obtain virtual nodes corresponding to the at least two nodes respectively.

[0285] In some embodiments, a pre-configured first relation table is obtained, the first relation table including at least one set of matching relationships between ratios and hash rings; from the first relation table, a hash ring that matches a first ratio is obtained as a first hash ring.

[0286] In some embodiments, based on a content retrieval request, a popularity value of the file content is obtained, which indicates the number of times the file content is requested to be retrieved per unit time; based on the popularity value of the file content, a first ratio is obtained, which is a ratio that matches the popularity value of the file content.

[0287] In some embodiments, a pre-configured second relationship table is obtained, the second relationship table including at least one set of matching relationships between popularity values ​​and ratios; from the second relationship table, the ratio that matches the popularity value of the file content is obtained as the first ratio.

[0288] In some embodiments, the first ratio is positively correlated with the popularity value of the file content, which indicates the number of times the file content is requested per unit time.

[0289] In some embodiments, information in at least two dimensions includes node bandwidth and node storage.

[0290] In some embodiments, the target node satisfies at least one of the following: the node bandwidth of the target node is positively correlated with the popularity value of the file content; the node storage of the target node is negatively correlated with the popularity value of the file content.

[0291] In some embodiments, the target node is configured to, in response to a content retrieval request, retrieve the file content from the local storage space if the file content exists in the local storage space; the target node is also configured to, in response to a content retrieval request, retrieve the file content from the source node of the CDN if the file content does not exist in the local storage space; store the file content in the local storage space; and the target node is also configured to send the file content to the client.

[0292] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the file content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of node information and the content retrieval request is more closely aligned with the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests.

[0293] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0294] Please refer to Figure 11This diagram illustrates a block diagram of a request processing apparatus according to an embodiment of this application. The apparatus has the functionality to implement the method example described above; this functionality can be implemented in hardware or by hardware executing corresponding software. The apparatus can be the computer device described above, or it can be located within a computer device. Figure 11 As shown, the device 1100 may include: a request receiving module 1110, a ratio acquisition module 1115, a node determination module 1120, and a request sending module 1130.

[0295] The request receiving module 1110 is used to receive a content retrieval request sent by the client. The content retrieval request is used to request first content from the CDN, and the CDN includes at least two nodes.

[0296] The ratio acquisition module 1115 is used to acquire a first ratio that matches the first content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, and the information in each dimension is used to characterize an attribute of the node.

[0297] The node determination module 1120 is used to determine a target node from the at least two nodes based on the content acquisition request and the first ratio.

[0298] The request sending module 1130 is used to send the content acquisition request to the target node, and the target node is used to process the content acquisition request.

[0299] In some embodiments, the node determination module 1120 is configured to: obtain the hash value of the first content according to the content acquisition request; obtain a first hash ring according to the first ratio, wherein the first hash ring is a hash ring that matches the first ratio, the hash ring is used to indicate the hash value space in the form of a virtual ring, and the first hash ring is used to indicate the position of the at least two nodes in the hash value space; and determine the target node from the at least two nodes according to the hash value of the first content and the first hash ring.

[0300] In some embodiments, the first hash ring is used to indicate the position of the virtual nodes corresponding to the at least two nodes in the hash value space. The virtual nodes corresponding to the at least two nodes are determined based on the first ratio and the node information corresponding to the at least two nodes, and the node information includes information in at least two dimensions.

[0301] In some embodiments, the node determination module 1120 is configured to determine a target virtual node from the virtual nodes corresponding to the at least two nodes respectively, based on the hash value of the first content and the first hash ring; and determine the node corresponding to the target virtual node as the target node.

[0302] In some embodiments, the node determination module 1120 is configured to move along a first direction of the first hash ring, starting from the hash value of the first content, and determine the first virtual node passed through as the target virtual node.

[0303] In some embodiments, the node determination module 1120 is configured to determine the virtual nodes corresponding to the at least two nodes based on the first ratio and the node information corresponding to the at least two nodes respectively; determine the position of the virtual nodes corresponding to the at least two nodes in the hash ring based on the hash value of the virtual nodes corresponding to the at least two nodes respectively; and construct the first hash ring based on the hash ring and the position of the virtual nodes corresponding to the at least two nodes respectively in the hash ring.

[0304] In some embodiments, the node determination module 1120 is configured to, for the i-th node among the at least two nodes, perform virtual node partitioning on the i-th node according to the first ratio to obtain at least one virtual node corresponding to the i-th node, wherein the node information of each virtual node corresponding to the i-th node satisfies the first ratio, and i is a positive integer; and to perform virtual node partitioning on each of the at least two nodes respectively to obtain virtual nodes corresponding to the at least two nodes respectively.

[0305] In some embodiments, the node determination module 1120 is configured to obtain a pre-configured first relationship table, the first relationship table including at least one set of matching relationships between ratios and hash rings; and to obtain a hash ring that matches the first ratio from the first relationship table as the first hash ring.

[0306] In some embodiments, the first ratio is positively correlated with the popularity value of the first content.

[0307] In some embodiments, the ratio acquisition module 1115 is configured to acquire the popularity value of the first content based on the content acquisition request, wherein the popularity value of the first content is used to indicate the number of times the first content is requested to be acquired per unit time; and acquire the first ratio based on the popularity value of the first content, wherein the first ratio is a ratio that matches the popularity value of the first content.

[0308] In some embodiments, the ratio acquisition module 1115 is used to acquire a pre-configured second relationship table, the second relationship table including at least one set of matching relationships between popularity values ​​and ratios; and to acquire from the second relationship table the ratio that matches the popularity value of the first content as the first ratio.

[0309] In some embodiments, the first ratio is positively correlated with the popularity value of the first content, which is used to indicate the number of times the first content is requested per unit time.

[0310] In some embodiments, the information of at least two dimensions includes: node bandwidth and node storage.

[0311] In some embodiments, the target node satisfies at least one of the following: the node bandwidth of the target node is positively correlated with the popularity value of the first content; the node storage of the target node is negatively correlated with the popularity value of the first content.

[0312] In some embodiments, the target node is configured to, in response to the content retrieval request, retrieve the first content from the local storage space if the first content exists in the local storage space; the target node is further configured to, in response to the content retrieval request, retrieve the first content from the source node of the CDN if the first content does not exist in the local storage space; store the first content in the local storage space; and the target node is further configured to send the first content to the client.

[0313] Compared to related technologies that determine the target node solely based on bandwidth, the technical solution provided in this application obtains a first ratio that matches the first content to determine the target node from at least one node. This method of determining the target node by combining the proportional relationship between at least two dimensions of node information and the content retrieval request is more closely aligned with the node's own characteristics (such as considering the node's bandwidth and storage capacity), thus resulting in better processing performance and higher efficiency for content retrieval requests.

[0314] It should be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules when implementing its functions. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.

[0315] Please refer to Figure 12 This diagram illustrates a structural block diagram of a computer device 1200 provided in one embodiment of this application. The computer device 1200 can be any electronic device capable of data computation, processing, and storage. The computer device 1200 can be used to implement the request processing method provided in the above embodiments.

[0316] Typically, computer device 1200 includes a processor 1201 and a memory 1202.

[0317] Processor 1201 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1201 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1201 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1201 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 1201 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0318] The memory 1202 may include one or more computer-readable storage media, which may be non-transitory. The memory 1202 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1202 are used to store a computer program configured to be executed by one or more processors to implement the request processing method described above.

[0319] Those skilled in the art will understand that Figure 12 The structure shown does not constitute a limitation on the computer device 1200 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0320] In an exemplary embodiment, a computer-readable storage medium is also provided, wherein a computer program is stored therein, which, when executed by a processor, implements the above request processing method.

[0321] In some embodiments, the computer-readable storage medium may include ROM (Read-Only Memory), RAM (Random Access Memory), SSD (Solid State Drives), or optical disc, etc. The random access memory may include ReRAM (Resistance Random Access Memory) and DRAM (Dynamic Random Access Memory).

[0322] In an exemplary embodiment, a computer program product is also provided, the computer program product including a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, causing the computer device to perform the request processing method described above.

[0323] It should be noted that the collection and processing of relevant data (including requests, content, etc.) in this application should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0324] It should be understood that "multiple" as used herein refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, the step numbers described herein are merely illustrative of one possible execution order. In some other embodiments, the steps may not be executed in numerical order, such as two steps with different numbers being executed simultaneously, or two steps with different numbers being executed in the reverse order of the illustration. This application does not limit this.

[0325] The above description is merely an exemplary embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A request processing method, characterized in that, The method includes: The system receives a content retrieval request sent by a client. The content retrieval request is used to request first content from a content delivery network (CDN), and the CDN includes at least two nodes. Obtain a first ratio that matches the first content, the first ratio being used to indicate the proportional relationship between information in at least two dimensions, each dimension being used to characterize an attribute of the node; Based on the content retrieval request and the first ratio, determine the target node from the at least two nodes; The content retrieval request is sent to the target node, and the target node is used to process the content retrieval request.

2. The method according to claim 1, characterized in that, The step of determining the target node from the at least two nodes based on the content acquisition request and the first ratio includes: Based on the content retrieval request, obtain the hash value of the first content; Based on the first ratio, a first hash ring is obtained. The first hash ring is a hash ring that matches the first ratio. The hash ring is used to indicate the hash value space in the form of a virtual ring. The first hash ring is used to indicate the position of the at least two nodes in the hash value space. The target node is determined from the at least two nodes based on the hash value of the first content and the first hash ring.

3. The method according to claim 2, characterized in that, The first hash ring is used to indicate the position of the virtual nodes corresponding to the at least two nodes in the hash value space. The virtual nodes corresponding to the at least two nodes are determined based on the first ratio and the node information corresponding to the at least two nodes. The node information includes information in at least two dimensions. Determining the target node from the at least two nodes based on the hash value of the first content and the first hash ring includes: Based on the hash value of the first content and the first hash ring, the target virtual node is determined from the virtual nodes corresponding to the at least two nodes respectively; The node corresponding to the target virtual node is determined as the target node.

4. The method according to claim 3, characterized in that, The step of determining the target virtual node from the virtual nodes corresponding to the at least two nodes based on the hash value of the first content and the first hash ring includes: Starting from the hash value of the first content, move along the first direction of the first hash ring, and determine the first virtual node passed as the target virtual node.

5. The method according to any one of claims 2 to 4, characterized in that, The construction process of the first hash ring is as follows: Based on the first ratio and the node information corresponding to the at least two nodes respectively, determine the virtual nodes corresponding to the at least two nodes respectively; Based on the hash values ​​of the virtual nodes corresponding to the at least two nodes respectively, determine the positions of the virtual nodes corresponding to the at least two nodes in the hash ring; The first hash ring is constructed based on the hash ring and the positions of the virtual nodes corresponding to the at least two nodes in the hash ring.

6. The method according to claim 5, characterized in that, The step of determining the virtual nodes corresponding to the at least two nodes based on the first ratio and the node information corresponding to the at least two nodes includes: For the i-th node among the at least two nodes, according to the first ratio, the i-th node is divided into virtual nodes to obtain at least one virtual node corresponding to the i-th node. The node information of each virtual node corresponding to the i-th node satisfies the first ratio, where i is a positive integer. For each of the at least two nodes, a virtual node partitioning is performed to obtain the virtual nodes corresponding to the at least two nodes respectively.

7. The method according to any one of claims 2 to 6, characterized in that, The step of obtaining the first hash ring based on the first ratio includes: Obtain a pre-configured first relation table, which includes at least one set of matching relationships between ratios and hash rings; From the first relation table, obtain the hash ring that matches the first ratio, and use it as the first hash ring.

8. The method according to any one of claims 1 to 7, characterized in that, Obtaining the first ratio that matches the first content includes: Based on the content retrieval request, the popularity value of the first content is obtained, and the popularity value of the first content is used to indicate the number of times the first content is requested to be retrieved per unit time. The first ratio is obtained based on the popularity value of the first content, and the first ratio is a ratio that matches the popularity value of the first content.

9. The method according to claim 8, characterized in that, The step of obtaining the first ratio based on the popularity value of the first content includes: Obtain a pre-configured second relationship table, which includes at least one set of matching relationships between heat values ​​and ratios; From the second relationship table, obtain the ratio that matches the popularity value of the first content, and use it as the first ratio.

10. The method according to any one of claims 1 to 9, characterized in that, The first ratio is positively correlated with the popularity value of the first content, which is used to indicate the number of times the first content is requested per unit time.

11. The method according to any one of claims 1 to 10, characterized in that, The information in at least two dimensions includes: node bandwidth and node storage capacity.

12. The method according to claim 11, characterized in that, The target node satisfies at least one of the following: The node bandwidth of the target node is positively correlated with the popularity value of the first content; The node storage capacity of the target node is negatively correlated with the popularity value of the first content.

13. The method according to any one of claims 1 to 12, characterized in that, The target node is configured to, in response to the content retrieval request, retrieve the first content from the local storage space if the first content exists in the local storage space. The target node is also configured to, in response to the content retrieval request, retrieve the first content from the source node of the CDN if the first content does not exist in the local storage space; The first content is stored in the local storage space; The target node is also used to send the first content to the client.

14. A request processing apparatus, characterized in that, The device includes: The request receiving module is used to receive a content retrieval request sent by the client. The content retrieval request is used to request the content delivery network (CDN) to retrieve first content. The CDN includes at least two nodes. The ratio acquisition module is used to acquire a first ratio that matches the first content. The first ratio is used to indicate the proportional relationship between information in at least two dimensions, and the information in each dimension is used to characterize an attribute of the node. A node determination module is used to determine a target node from the at least two nodes based on the content acquisition request and the first ratio. A request sending module is used to send the content retrieval request to the target node, and the target node is used to process the content retrieval request.

15. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program that is loaded and executed by the processor to implement the request processing method as described in any one of claims 1 to 13.

16. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the request processing method as described in any one of claims 1 to 13.

17. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer-readable storage medium, which a processor reads from and executes to implement the request processing method as described in any one of claims 1 to 13.