Business request processing method and system, server and storage medium

By employing a message digest algorithm in the CDN system to obtain cache locations and decouple proxy servers from cache clusters, the coupling problem between proxy servers and cache servers is solved, development and operation costs are reduced, processing efficiency and flexibility are improved, and the risk of overload during high concurrency is reduced.

CN116506508BActive Publication Date: 2026-03-17CHINANETCENT TECH
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In existing CDN systems, the strong coupling between proxy servers and cache servers leads to high development and operation costs. The cache hit rate depends on the scheduling algorithm of the proxy server, which increases the number of request forwardings, reduces processing efficiency, makes it difficult to dynamically scale up or down, and is prone to overload under high concurrency.

Method used

The system employs an information digest algorithm to obtain cache locations on cache nodes and detect cached data. The proxy server communicates with the origin server to obtain data, thereby decoupling the proxy server and the cache cluster. The cache cluster only processes cached data, and the proxy server does not need to implement a cache scheduling algorithm, reducing development and operation resources and improving processing efficiency by reducing the number of request forwardings.

Benefits of technology

It achieves efficient processing of CDN systems, reduces development and operation costs, dynamically adjusts cache nodes, improves system processing efficiency and flexibility, and reduces the risk of overload during high concurrency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116506508B_ABST
    Figure CN116506508B_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the technical field of data processing, and discloses a business request processing method and system, a server and a storage medium. The business request processing method is applied to each cache node of a CDN, the CDN further comprises a proxy server in communication with each cache node and a source station in communication with the proxy server, and the method comprises the following steps: processing a business request sent by the proxy server according to an information digest algorithm to obtain a cache location; detecting whether cache data corresponding to the business request can be obtained according to the cache location; when the cache data is obtained according to the cache location, sending the cache data to the proxy server; and when the cache data is not obtained according to the cache location, sending a cache data nonexistence instruction to the proxy server, so that the proxy server communicates with the source station to obtain the cache data when the cache data nonexistence instruction is received; the CDN can improve the processing efficiency of the business request and reduce resources used for development, operation and maintenance of the CDN.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, system, server, and storage medium for processing business requests. Background Technology

[0002] Content Delivery Networks (CDNs) enable users to access services from the nearest server location through load balancing, content distribution, and scheduling, reducing network congestion, improving response speed for business requests, and reducing the pressure on origin servers. Each service node in a CDN system is a group of servers, and the business requests received by each node are random. If each server were to retrieve requests from the origin server and cache the requested data, it would result in a large amount of duplicate caching across the entire group of machines. To improve the throughput and cache hit rate of the CDN system, such as... Figure 1 As shown, existing CDN systems generally consist of a two-tier architecture: a cache-free proxy server and a cached proxy server. The first-tier cache-free proxy server receives user business requests without caching, and then forwards the relevant business requests to the second-tier cached proxy server for processing based on the requested data path (or other methods). If the cached data is hit (i.e., the cached data exists), the cached proxy server directly returns the cached data to the client. If the cached data does not exist, the cached proxy server retrieves the data from the origin server, caches the relevant data from the origin server, and returns it to the first-tier cache-free proxy server.

[0003] However, because the hit rate of cached data depends on the request scheduling algorithm of the proxy server, the coupling between the proxy server and the caching component storing the cached data is relatively strong. When the system has multiple different proxy servers, these proxy servers need to repeatedly implement the same cache scheduling algorithm, thereby increasing the development, operation, and maintenance costs of the entire CDN system. At the same time, when the first-layer proxy server finds that the second-layer caching server does not have data related to the business request, or when the first-layer proxy server receives a request that does not need to be cached, the first-layer proxy service needs to communicate with the origin server through the second-layer caching server to obtain the data related to the business request. This results in an additional forwarding of the business request, thereby reducing the efficiency of the CDN system in processing business requests and increasing the time spent on requests. Summary of the Invention

[0004] The purpose of this application is to provide a method, system, server, and storage medium for processing business requests, so as to improve the efficiency of CDN system in processing business requests, while reducing the resources used by CDN system for development, operation, and maintenance.

[0005] To address the aforementioned technical problems, embodiments of this application provide a method for processing business requests, applied to each cache node of a Content Delivery Network (CDN). The CDN further includes a proxy server communicating with each cache node and an origin server communicating with the proxy server. The method includes: processing a business request sent by the proxy server according to a preset message digest algorithm to obtain a cache location; detecting whether cached data corresponding to the business request can be obtained based on the cache location; when the cached data is obtained based on the cache location, sending the cached data to the proxy server; when the cached data is not obtained based on the cache location, sending a cached data non-existent instruction to the proxy server, so that the proxy server, upon receiving the cached data non-existent instruction, communicates with the origin server to obtain the cached data.

[0006] Embodiments of this application also provide a service request processing system applied in a Content Delivery Network (CDN). The system includes: a proxy server, various cache nodes, and an origin server. The proxy server communicates with each cache node and the origin server respectively. The proxy server is used to send service requests to the cache nodes. The cache nodes are used to process the service requests according to a preset message digest algorithm to obtain a cache location, detect whether cache data corresponding to the service request can be obtained based on the cache location, and when the cache data is obtained based on the cache location, send the cache data to the proxy server; when the cache data is not obtained based on the cache location, send a cache data non-existent instruction to the proxy server. The proxy server is also used to receive the cache data non-existent instruction and communicate with the origin server to obtain the cache data.

[0007] Embodiments of this application also provide a server, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the aforementioned service request processing method.

[0008] Embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the above-described method for processing business requests.

[0009] In this embodiment, the Content Delivery Network (CDN) includes a proxy server, cache nodes communicating with the proxy server, and an origin server. At each cache node of the CDN, a preset message digest algorithm is used to process the business requests sent by the proxy server to obtain the cache location; the cache location is checked to see if cached data corresponding to the business request can be obtained; when cached data is obtained from the cache location, the cached data is sent to the proxy server; when cached data is not obtained from the cache location, a cache data non-existent instruction is sent to the proxy server, so that the proxy server, upon receiving the cache data non-existent instruction, can communicate with the origin server to obtain the cached data. This allows the CDN to completely decouple the proxy server and the cache cluster by changing the CDN network architecture. The cache cluster only performs cached data-related business and no longer proxies business requests. The proxy server does not need to implement a cache scheduling algorithm, thus reducing the resources used for development, operation, and maintenance of the CDN system, and improving the CDN system's processing efficiency for business requests by reducing the number of forwarding requests. Attached Figure Description

[0010] One or more embodiments are illustrated by way of example with reference to the accompanying drawings, and these illustrative descriptions do not constitute a limitation on the embodiments.

[0011] Figure 1 This is a schematic diagram of the network architecture of a CDN system in the existing technology;

[0012] Figure 2 This is a schematic diagram of the network architecture of the CDN system used in the embodiments of this application;

[0013] Figure 3 This is a schematic diagram of the cache cluster architecture in the CDN system used in the embodiments of this application;

[0014] Figure 4 This is the flow chart of the service request processing method provided in the embodiments of this application. Figure 1 ;

[0015] Figure 5 This is a structural entity diagram of cache nodes and cache locations in the CDN system used in the embodiments of this application;

[0016] Figure 6 This is the flow chart of the service request processing method provided in the embodiments of this application. Figure 2 ;

[0017] Figure 7 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 1 ;

[0018] Figure 8 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 2 ;

[0019] Figure 9 This is the flow chart of the service request processing method provided in the embodiments of this application. Figure 3 ;

[0020] Figure 10 This is a schematic diagram of the expanded cache server structure provided in this application embodiment;

[0021] Figure 11 This is a schematic diagram of the data migration structure between cache nodes provided in an embodiment of this application;

[0022] Figure 12 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 3 ;

[0023] Figure 13 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 4 ;

[0024] Figure 14 This is the flow chart of the service request processing method provided in the embodiments of this application. Figure 4 ;

[0025] Figure 15 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 5 ;

[0026] Figure 16 This is a schematic diagram of the interaction between the proxy server and the cache cluster provided in the embodiments of this application. Figure 6 ;

[0027] Figure 17 This is a schematic diagram of the structure of the business request processing system provided in the embodiments of this application;

[0028] Figure 18 This is a schematic diagram of the server structure provided in an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the various embodiments of this application will be described in detail below with reference to the accompanying drawings. However, those skilled in the art will understand that many technical details have been provided in the various embodiments of this application to help readers better understand this application. However, the technical solutions claimed in this application can be implemented even without these technical details and various changes and modifications based on the following embodiments. The division of the various embodiments below is for the convenience of description and should not constitute any limitation on the specific implementation of this application. The various embodiments can be combined with and referenced by each other without contradiction.

[0030] Existing CDN network architectures such as Figure 1 As shown, using two layers of proxy servers to process business requests results in several drawbacks in the existing CDN network architecture, including:

[0031] a) Cache hits depend on the request scheduling algorithm of the proxy server. The proxy server and the cache server are highly coupled. Multiple proxy servers need to repeatedly implement the exact same cache scheduling algorithm to achieve effective cache hits. Any change in the calculation of the cache algorithm requires changes to every proxy server, resulting in a significant waste of development resources. In addition, in order to ensure the availability of cache nodes, all proxy servers need to continuously probe each cache node in order to update the scheduling algorithm data in a timely manner. As the number of proxy servers increases, the large number of probes increases the internal friction of the CDN system and further increases the complexity of the proxy servers.

[0032] b) Cache servers are difficult to scale up or down: Traditional cache servers are difficult to dynamically adjust their architecture according to actual business needs. User request volume is not fixed; it may be high at certain times and low at others. Increased request volume requires additional servers to handle the load, otherwise it may cause system overload and service unavailability. Conversely, reduced request volume can reduce the number of servers and save server resources. However, this is difficult to achieve with current technology because the first-layer proxy server associates requests with the number of second-layer cache servers. Changes in the second-layer cache servers will invalidate the original request bindings. Therefore, the current practice is to reserve enough resources to cope with the increase in requests, thereby keeping the second-layer cache servers unchanged. This approach is actually very wasteful of resources.

[0033] c) Difficulty in handling sudden surges in requests: A single request might encounter high concurrency at some point, such as during a trending event or a website's flash sale. If the same request is forwarded to the same second-layer caching server, that server might become overloaded and unable to provide service.

[0034] d) When the cache corresponding to the request does not exist, both the first-layer proxy server and the second-layer cache server act as reverse proxies. The first-layer proxy server proxies to the second-layer cache server, and the second-layer cache server proxies to the origin server. There are two drawbacks here: First, the extra proxying of the request wastes a lot of resources, reduces the system service throughput, and also has a negative impact on customer requests, increasing the first packet time and the overall request time. Second, CDN reverse proxies are often configured with some customized requirements according to customer needs. This requires synchronizing the customer's customized configuration to both the first-layer proxy and the second-layer cache server so that they take effect at the same time. In addition to requiring additional synchronization software, it also increases the latency caused by the customer modifying the configuration.

[0035] The CDN network architecture used in this application embodiment is as follows: Figure 2 As shown, it consists of four parts: users, proxy servers, cache clusters, and the origin server. Users communicate with the proxy servers, and the proxy servers communicate with both the cache clusters and the origin server. The number of users, proxy servers, cache clusters, the origin server, and cache nodes is not limited and can be adjusted according to the usage scenario. Figure 3 As shown, each cache cluster in a CDN system contains multiple cache nodes. These multiple cache nodes can be viewed as a decentralized cache cluster. The cache cluster determines the actual service cache node for a request and provides a unified service to the outside world. Proxy servers do not need to concern themselves with the internal architecture and implementation of the cache cluster; instead, they treat all cache nodes as a whole and can request any cache node to obtain service. Each cache node in the cache cluster periodically probes other cache nodes in the cluster and dynamically updates and maintains the current liveness status of each cache node within the cluster. Each cache node can be considered a cache program, and one or more cache programs can run on a physical server, which can be called a cache server.

[0036] Embodiments of this application relate to a method for processing service requests, applied to each cache node of a Content Delivery Network (CDN). The CDN also includes a proxy server communicating with each cache node and an origin server communicating with the proxy server, such as... Figure 4 As shown, the specific steps include:

[0037] Step 101: Process the business requests sent by the proxy server according to the preset message digest algorithm to obtain the cache location.

[0038] In one example implementation, after receiving a business request from the proxy server, the cache node parses the business request to obtain information such as the request domain name and request path. It then processes the request domain name and request path using a message digest algorithm to obtain the request value. Finally, it takes the remainder of this value based on the number of cache nodes in the CDN network. The result of this remainder is the cache location corresponding to the business request. Here, the cache location in the cache node can be regarded as a cache slot that can store cached data. A cache slot is a logical storage unit.

[0039] In one example implementation, a cache node is one of several cache nodes in a cache cluster. The cache node calculates the allocation of each cache location (i.e., cache slot) based on the current state and number of nodes within the cache cluster. The calculation process includes: labeling the cache locations within the cache cluster (e.g., numbering them 1-20000 if there are 20,000 cache locations); constructing a consistent hash ring using the cache node's address information (IP and port) as hash nodes; using all cache location numbers as keys and applying a consistent hash algorithm to obtain the cache node corresponding to each cache location; when a cache node probes other cache nodes within the cache cluster and discovers changes in the number or state of cache nodes, it recalculates the correspondence between cache locations and cache nodes. Figure 5 As shown, the current cache cluster has 20,000 cache locations. Through the consistent hashing algorithm, the cache locations are evenly distributed among 4 cache nodes, with each cache node having 5,000 cache locations.

[0040] In one example implementation, the business requests sent by the proxy server are obtained from the user. After receiving the business requests from the user, the proxy server has two methods to send the business requests to the cache nodes: First, the proxy server randomly selects a cache node as the processor of the business request and sends the business request to the randomly selected cache node; second, the proxy server has a pre-set location-to-node mapping table, which can process the business request according to the information digest algorithm to obtain the cache location, and then obtain the cache node corresponding to the cache location from the location-to-node mapping table and send the business request to that cache node.

[0041] Step 102: Check whether the cached data corresponding to the business request can be obtained based on the cache location.

[0042] In one example implementation, the cache location obtained by the cache node may not contain cache data corresponding to the business request. If the cache data can be obtained based on the cache location, step 103 is executed; if the cache data cannot be obtained based on the cache location, step 104 is executed.

[0043] Step 103: When the cached data is obtained based on the cache location, the cached data is sent to the proxy server.

[0044] In one example implementation, when cached data can be obtained from the cache location, it means that the current cache node is the service node for the current business request, which stores the cached data corresponding to the current business request. After obtaining the cached data from the cache location, the cached data is directly sent to the proxy server, which then applies or processes the cached data accordingly.

[0045] Step 104: When no cached data is obtained according to the cache location, a cached data non-existent instruction is sent to the proxy server so that the proxy server can communicate with the source server to obtain the cached data upon receiving the cached data non-existent instruction.

[0046] In one example implementation, if cached data cannot be retrieved from the cache location, it indicates that the current business request is the first access to the business request, and the cache locations of each cache node do not store the cached data corresponding to the current business request. The cache node needs to send a cache data not found instruction to the proxy server. After receiving the cache data not found instruction, the proxy server will send the current business request to the origin server. The origin server processes the received current business request, retrieves the cached data, and sends the cached data to the proxy server. After receiving the cached data corresponding to the current business request from the origin server, the proxy server can send the business write request corresponding to the current business request to the cache node so that the cache node can store the cached data of the current business request.

[0047] In this embodiment, the Content Delivery Network (CDN) includes a proxy server, cache nodes communicating with the proxy server, and an origin server. At each cache node of the CDN, a preset message digest algorithm is used to process the business requests sent by the proxy server to obtain the cache location; the cache location is checked to see if cached data corresponding to the business request can be obtained; when cached data is obtained from the cache location, the cached data is sent to the proxy server; when cached data is not obtained from the cache location, a cache data non-existent instruction is sent to the proxy server, so that the proxy server, upon receiving the cache data non-existent instruction, can communicate with the origin server to obtain the cached data. This allows the CDN to completely decouple the proxy server and the cache cluster by changing the CDN network architecture. The cache cluster only performs cached data-related business and no longer proxies business requests. The proxy server does not need to implement a cache scheduling algorithm, thus reducing the resources used for development, operation, and maintenance of the CDN system, and improving the CDN system's processing efficiency for business requests by reducing the number of forwarding requests.

[0048] Embodiments of this application relate to a method for processing service requests, applied to each cache node of a Content Delivery Network (CDN). The CDN also includes a proxy server communicating with each cache node and an origin server communicating with the proxy server, such as... Figure 6 As shown, the specific steps include:

[0049] Step 201: Process the business requests sent by the proxy server according to the preset message digest algorithm to obtain the cache location.

[0050] In one example implementation, this step is largely the same as step 101 mentioned in the embodiments of this application, and will not be described in detail here.

[0051] Step 202: Based on the preset location-node mapping table, detect whether the cache location is located on the cache node.

[0052] In one example implementation, step 101 mentions that the cache node will calculate and obtain the correspondence between the cache node and the cache location to form a location-to-node mapping table. After the cache node obtains the location-to-node mapping table for the first time, it will store the location-to-node mapping table locally for subsequent use.

[0053] In one example implementation, after obtaining the cache location, the cache node will query the first cache node corresponding to the cache location based on the location-node mapping table, and determine whether the first cache node is the current cache node. If it is the current cache node, steps 204 and 205 will be executed; if it is not the current cache node, step 203 will be executed.

[0054] Step 203: Obtain the first cache node corresponding to the cache location according to the mapping relationship table, and redirect the business request to the first cache node so that the first cache node can process the business request.

[0055] In one example implementation, the reason why the cache node corresponding to the cache location is not the current cache node is that the proxy server sends the business request to the cache node using a random access method. When using the random access method, the proxy server does not consider the correspondence between the cache location and the cache node, but randomly selects one from several cache nodes.

[0056] In one example implementation, after a cache node discovers that the first cache node corresponding to a cache location is not its own, it generates a redirection response based on the business request and the node information of the first cache node. The redirection response and a location-to-node mapping table are then sent to the proxy server. Upon receiving the redirection response and the mapping table, the proxy server forwards the business request to the first cache node based on the redirection response. The first cache node processes the business request and returns the corresponding cached data. The proxy server also stores the mapping table locally as a basis for sending subsequent business requests. Figure 7 As shown, after the proxy server has a mapping table on its local machine, it can directly calculate the cache location based on the business request and access the cache node corresponding to the cache location; where the node information of the first cache node can be information that can identify the first cache node, such as the location, path or name of the first cache node.

[0057] In one example implementation, such as Figure 8 As shown, when the proxy server randomly accesses cache node 1 with a business request, cache node 1 calculates that the cached data of the current request is located in cache location 16384. According to the mapping relationship between cache location and cache node, it can be seen that the cache location is in cache node 4. Then, cache node 1 generates the redirection response based on the business request and cache node 4 and sends it to the proxy server. The proxy server obtains the service node corresponding to the business request from the redirection response, which is cache node 4, and sends the business request to cache node 4 to obtain the cached data.

[0058] Step 204: Check whether the cached data corresponding to the business request can be obtained based on the cache location.

[0059] In one example implementation, this step is largely the same as step 102 mentioned in the embodiments of this application, and will not be described in detail here.

[0060] Step 205: When cached data is obtained according to the cache location, the cached data is sent to the proxy server; when cached data is not obtained according to the cache location, a cached data not found instruction is sent to the proxy server so that the proxy server can communicate with the origin server to obtain the cached data when it receives the cached data not found instruction.

[0061] In one example implementation, this step is largely the same as steps 103 and 104 mentioned in the embodiments of this application, and will not be described in detail here.

[0062] In this embodiment of the application, based on other embodiments, when the current cache node is unable to serve the current request, the current business request can be redirected to a link node that can provide services, so as to ensure that the business request can be processed.

[0063] Embodiments of this application relate to a method for processing service requests, applied to each cache node of a Content Delivery Network (CDN). The CDN also includes a proxy server communicating with each cache node and an origin server communicating with the proxy server, such as... Figure 9 As shown, the specific steps include:

[0064] Step 301: When a change in the mapping relationship is detected, based on the changed mapping relationship, obtain each first cache location that does not have a mapping relationship with the cache node from several cache locations.

[0065] In one example implementation, the cache nodes store the mapping relationship between cache nodes and cache locations, with one cache node corresponding to several cache locations. The cache nodes periodically probe other cache nodes in the cache cluster. When a change in the number of cache nodes in the cache cluster is detected, since the number of cache locations remains unchanged but the number of cache nodes changes, the cache nodes need to recalculate the mapping relationship between cache nodes and cache locations, which may result in changes to the ownership of some cache locations. The changes in the number of cache nodes include: a decrease in the number of cache nodes due to cache node failure or cache cluster scaling down, and an increase in the number of cache nodes due to cache node recovery or cache cluster scaling up.

[0066] In one example implementation, such as Figure 10 As shown, to improve service capacity, the cache cluster added cache node 5. Due to the change in the number of cache nodes, the cache locations are recalculated to belong to cache nodes according to the consistency algorithm mentioned in step 101. At this time, the correspondence between some cache locations and cache nodes changes. For example, the cache location 1000 (4001-5000) is changed from belonging to cache node 1 to cache node 2.

[0067] In one example implementation, when a cache node detects a change in the mapping relationship between the cache node and the cache location, it needs to compare the original mapping relationship between the cache node and the cache location with the changed mapping relationship to obtain the first cache locations where the mapping relationship has changed.

[0068] Step 302: Based on the changed mapping relationship, obtain each second cache node corresponding to each first cache location.

[0069] In one example implementation, for each first cache location where the mapping relationship has changed, the corresponding second cache node is obtained based on the changed mapping relationship.

[0070] Step 303: Send the first cache data in each first cache location to each second cache node.

[0071] In one example implementation, after determining the corresponding second cache nodes for each first cache location, the first cache data in each first cache location is sent to each second cache node. The process of sending the first cache data can essentially be viewed as the process of migrating data from the current cache node to the first cache node. For example... Figure 11 As shown, after obtaining the mapping relationship between the changed cache node and the cache location, the first cache node (cache node 1) migrates the data corresponding to cache locations 4001-5000 to the second cache node (cache node 2).

[0072] In one example implementation, during the data migration process between the current cache node and each of the second cache nodes, because the current cache node has cached data corresponding to some business requests, each of the second cache nodes has cached data corresponding to some business requests, and the proxy server sends business requests based on the original mapping table or by using random access, the cache node needs to redirect the business requests when processing them.

[0073] In one example implementation, such as Figure 12 As shown, when the data migration between the current cache node (cache node 1) and each of the second cache nodes (cache node 2) is not complete, when cache node 1 (or cache node 2) receives a business request, if cache node 1 (or cache node 2) processes the business request and obtains cached data, it returns the cached data to the proxy server; if cache node 1 (or cache node 2) processes the business request but does not obtain cached data, it redirects the business request to cache node 2 (or cache node 1); cache node 2 (or cache node 1) processes the redirected business request, and if it can obtain cached data, it returns the cached data to the proxy server. The system returns a response to the proxy server. If the cached data is not found, the business request is redirected to cache node 1 (or cache node 2). When cache node 1 (or cache node 2) receives the redirected business request and processes it, if the cached data is not found, it counts the number of redirections. If the number of redirections does not meet a preset threshold, the business request is redirected to cache node 2 (or cache node 1). If the number of redirections meets the preset threshold, a cached data non-existent instruction is sent to the proxy server. When the proxy server receives the cached data non-existent instruction, it communicates with the origin server to obtain the corresponding cached data.

[0074] In one example implementation, during the data migration process, the current cache node (cache node 1) and each of the second cache nodes (cache node 2) can still receive business write requests; when cache node 1 receives a business write request, it redirects it to cache node 2, which provides the corresponding service; when cache node 2 receives a business write request, it directly provides the corresponding service.

[0075] In one example implementation, during the data migration process, other cache nodes (cache nodes 3) in the cache cluster, besides the current cache node (cache node 1) and each second cache node (cache node 2), can also receive service requests provided by the second cache node (cache node 2). When cache node 3 receives a service request provided by cache node 2, it redirects the service request to cache node 2, and cache node 2 determines whether to perform redirection processing or return cached data to the proxy server.

[0076] In one example implementation, such as Figure 13 As shown, after the data migration between the current cache node (cache node 1) and each of the second cache nodes (cache node 2) is completed, both cache node 1 and cache node 2 can receive business requests provided by cache node 2. When cache node 1 receives a business request, it redirects it to cache node 2, which then provides the corresponding service. When cache node 2 receives a business write request, it directly provides the corresponding service. When cache node 1 redirects the business request, it sends the modified mapping table to the proxy server. The proxy server can then send business requests based on the modified mapping table or through random access.

[0077] In one example implementation, for the proxy server, since the proxy server accesses cache nodes based on a mapping table between cache locations and cache nodes or by random access, when the cache cluster is scaled up or down, the changed mapping table contains the changed node information. The proxy server will access the new cache nodes according to the changed mapping relationship. Therefore, the proxy server is unaware of the scaling up or down of the cache cluster.

[0078] In this embodiment, based on other embodiments, the cache cluster can be dynamically scaled up or down without operating the proxy server. During the scaling up or down, the normal response of the proxy server to business requests is maintained, so that the CDN system can be quickly adjusted according to the number of business requests, which greatly saves machine resources.

[0079] Embodiments of this application relate to a method for processing service requests, applied to each cache node of a Content Delivery Network (CDN). The CDN also includes a proxy server communicating with each cache node and an origin server communicating with the proxy server, such as... Figure 14As shown, the specific steps include:

[0080] Step 401: Obtain each diffusion cache node based on the hot service requests and the status information of each cache node.

[0081] In one example implementation, the hot service requests received by the cache node are sent by the proxy server through random access or based on a mapping table of location and node. Before obtaining each distributed cache node, the cache node needs to determine whether the current cache node is the service node corresponding to the hot service request based on the mapping table of location and node. If it is, the operation of steps 401-404 is executed. If not, the hot service request is redirected to the cache node that provides services for the hot service request, and the cache node that provides services for the hot service request executes the operation of steps 401-404.

[0082] In one example implementation, when a cache node receives a large number of business requests, the business request can be considered a hot business request. The cache node can determine whether to perform cache hot diffusion based on any one or more dimensions, such as the access data of the hot business request, the size of the cache data responding to the hot business request, the status information of each cache node in the cache cluster, and the system resource status of the CDN system. That is, to spread the cache data of the hot business request to more cache nodes. When cache hot diffusion is required, one or more diffusion cache nodes can be selected from each cache node based on the above dimensions.

[0083] In one example implementation, after obtaining the diffusion cache nodes, diffusion node information for hot business requests can be generated based on the cache nodes and each diffusion cache node. The diffusion node information is stored at the cache nodes and sent to the proxy server. The proxy server stores the diffusion node information corresponding to the cache nodes locally for later use.

[0084] In one example implementation, the proxy server receives a hot service request. After obtaining the cache node corresponding to the hot service request, it can determine whether the proxy server locally stores the diffusion node information of the cache node. If the diffusion node information exists, it obtains the diffusion cache nodes corresponding to the cache node from the diffusion node information and distributes the hot service request to the cache node and / or each diffusion cache node. The cache node and / or each diffusion cache node then processes the hot service request, thereby further improving the processing efficiency of the CDN system. If the diffusion node information does not exist, the hot service request is sent to the cache node, and the cache node performs the operations from steps 401 to 404.

[0085] In one example implementation, after the cache node obtains each diffusion cache node, it can also choose not to store the correspondence between the cache node and each diffusion cache node. When the hot service request is received again, the diffusion cache nodes can be obtained again and subsequent processing can be performed.

[0086] Step 402: Send hotspot cache data to each diffusion cache node.

[0087] In one example implementation, such as Figure 15 As shown, after the current cache node (cache node 1) determines the diffusion cache nodes (cache node 2 and cache node 4) for hot business requests, the hot cache data corresponding to the hot business requests can be diffused and migrated to the diffusion cache nodes (cache node 2 and cache node 4), so that both cache node 1, cache node 2 and cache node 4 have hot cache data corresponding to the hot business requests, and the hot business requests can be processed synchronously.

[0088] Step 403: During the hot spot cache data transmission process, receive and process the hot spot service requests redirected by each diffusion cache node. In this case, if the diffusion cache node does not obtain the hot spot cache data corresponding to the hot spot service request, it will redirect the hot spot service request to the cache node.

[0089] In one example implementation, during the data migration process from the current cache node (cache node 1) to the spreading cache nodes (cache node 2 and cache node 4), if cache node 1 receives a hot service request, it will process the hot service request and return a response structure. If cache node 2 and cache node 4 receive a hot service request, they cannot respond to the hot service request because they do not store all the hot service cache data. Instead, they can only redirect the hot service request to cache node 1 according to the mapping relationship between cache location and cache node.

[0090] Step 404: After the hot spot cache data is sent, the hot spot service requests are redirected to each diffusion cache node based on the preset distribution rules, so that each diffusion cache node can process the hot spot service requests and send the obtained hot spot cache data to the proxy server.

[0091] In one example implementation, such as Figure 16As shown, after the data migration from the current cache node (cache node 1) to the spreading cache nodes (cache node 2 and cache node 4) is completed, when cache node 1 receives a hot service request, cache node 1 will redirect some hot service requests to cache nodes 2 and 4 based on its own load and the load of cache nodes 2 and 4. After receiving the hot service request, cache nodes 2 and 4 do not need to perform mapping calculations between the request and the cache location node, but directly query the local hot cache data and respond.

[0092] In this embodiment, based on other embodiments, the cache node can also make real-time intelligent decisions on whether to perform hot-spot business request hot diffusion processing based on multiple dimensions such as the number of current business requests, response data size, cache node status, and system resource status, thereby dynamically improving the service capability of the current cache request and making the service capability of the cache cluster more flexible.

[0093] The steps of the various methods described above are only for clarity. In practice, they can be combined into one step or some steps can be split into multiple steps. As long as they include the same logical relationship, they are all within the scope of protection of this patent. Adding insignificant modifications or introducing insignificant designs to the algorithm or process, but without changing the core design of the algorithm and process, are also within the scope of protection of this patent.

[0094] The embodiments of this application relate to a business request processing system. The following is a detailed description of the business request processing system of this embodiment. The following content is merely for ease of understanding and is not essential for implementing this example. Figure 17 This is a schematic diagram of the business request processing system in this embodiment, including: a proxy server 501, a cache node 502, and an origin server 503.

[0095] Among them, proxy server 501 is used to send business requests to cache node 502.

[0096] Cache node 502 is used to process business requests according to the message digest algorithm to obtain the cache location, detect whether the cache data corresponding to the business request can be obtained according to the cache location, and send the cache data to the proxy server 501 when the cache data is obtained according to the cache location; when the cache data is not obtained according to the cache location, send a cache data not found instruction to the proxy server 501.

[0097] The proxy server 501 is also used to receive cached data non-existent instructions and communicate with the origin server 503 to obtain cached data.

[0098] In one example implementation, the proxy server 501 is also used to send business requests to the cache node 502 based on random access or based on a location-to-node mapping table.

[0099] It is not difficult to see that this embodiment is a system embodiment corresponding to the above method embodiments, and this embodiment can be implemented in conjunction with the above method embodiments. The relevant technical details and technical effects mentioned in the above embodiments are still valid in this embodiment, and will not be repeated here to reduce repetition. Accordingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0100] This application's embodiments relate to a server, such as... Figure 18 As shown, it includes: at least one processor 601; and a memory 602 communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions executable by the at least one processor 601, the instructions being executed by the at least one processor 601 to enable the at least one processor 601 to perform the service request processing methods in the above embodiments.

[0101] The memory and processor are connected via a bus, which can include any number of interconnecting buses and bridges, connecting various circuits of one or more processors and memories. The bus can also connect various other circuits, such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and will not be described further herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be a single element or multiple elements, such as multiple receivers and transmitters, providing a unit for communicating with various other devices over a transmission medium. Data processed by the processor is transmitted over the wireless medium via an antenna, which further receives data and transmits it to the processor.

[0102] The processor manages the bus and general processing, and also provides various functions, including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Memory is used to store data used by the processor during operation.

[0103] This application relates to a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the method embodiments described above.

[0104] That is, those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. This program is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0105] Those skilled in the art will understand that the above embodiments are specific embodiments for implementing this application, and in practical applications, various changes can be made to them in form and detail without departing from the spirit and scope of this application.

Claims

1. A method of processing a service request, characterized by, The application discloses a cache cluster applied to a content distribution network (CDN), wherein the CDN further comprises a proxy server in communication with the cache cluster and a source station in communication with the proxy server, and the cache cluster is composed of a plurality of cache nodes. The method is executed by any cache node in the cache cluster, and the method comprises the following steps of: Any cache node in the cache cluster receives a service request from the proxy server; The cache node processes a request domain name and a request path in the service request according to a preset information digest algorithm to determine a cache location corresponding to the service request, and detects whether the cache location belongs to the current cache node according to a preset mapping relationship table between locations and nodes; When the cache location belongs to the current cache node, it is detected whether cache data corresponding to the service request can be acquired according to the cache location; When the cache location does not belong to the current cache node, a first cache node corresponding to the cache location is acquired according to the mapping relationship table, and the service request is redirected to the first cache node for processing by the first cache node; When the cache data is acquired according to the cache location, the cache data is sent to the proxy server; When the cache data is not acquired according to the cache location, a cache data nonexistence instruction is sent to the proxy server, so that the proxy server acquires the cache data from the source station when the cache data nonexistence instruction is received; The redirection of the service request to the first cache node comprises generating a redirection response based on the service request and node information of the first cache node, and sending the redirection response and the mapping relationship table to the proxy server, so that the proxy server sends the service request to the first cache node according to the redirection response.

2. The method of claim 1, wherein, The service request is sent to the cache node by the proxy server based on a random access mode or an access mode based on the mapping relationship table.

3. The method of claim 1, wherein, The method further comprises the following steps of: When it is detected that the mapping relationship table has changed, each first cache location without a mapping relationship with the cache node is acquired from a plurality of cache locations corresponding to the cache node based on the changed mapping relationship table; Each second cache node corresponding to each first cache location is acquired based on the changed mapping relationship; Each first cache data in each first cache location is sent to each second cache node. The changed mapping relationship is generated according to a preset consistent hash algorithm, the changed number of cache nodes and the number of cache locations when the number of cache nodes changes.

4. The method of claim 3, wherein, The sending of each first cache data in each first cache location to each second cache node further comprises the following steps of: In the sending process of each first cache data, when the received service request is processed and the cache data is not acquired, the service request is redirected to the second cache node for processing the service request, acquiring the cache data and sending to the proxy server, or the service request is redirected to the cache node when the cache data is not acquired; When the service request is received by each second cache node, the service request is processed and the redirection times of the service request are acquired when the cache data is not acquired; If the redirection times do not satisfy the preset threshold, the service request is redirected to the second cache node; If the redirection times satisfy the preset threshold, the cache data does not exist instruction is sent to the proxy server.

5. The method of claim 3, wherein, The sending of each first cache data in each first cache position to each second cache node further comprises: When the service request is a service write request, the service write request is redirected to the second cache node for processing the service write request.

6. The method of claim 1, wherein, When the service request is a hot service request, the method further comprises: According to the hot service request and the state information of each cache node, each diffusion cache node is acquired; Hot cache data is sent to each diffusion cache node; In the sending process of the hot cache data, the hot service request redirected by each diffusion cache node is received and processed, wherein the diffusion cache node redirects the hot service request to the cache node when the hot cache data corresponding to the hot service request is not acquired; After the sending of the hot cache data is completed, the hot service request is redirected to each diffusion cache node based on a preset distribution rule, so that each diffusion cache node processes the hot service request and sends the acquired hot cache data to the proxy server.

7. The method of claim 6, wherein, The sending of hot cache data to each diffusion cache node further comprises: According to the cache node and each diffusion cache node, diffusion node information of the hot service request is generated; The diffusion node information is sent to the proxy server, so that when the hot service request is received, the proxy server distributes the hot service request to the cache node and / or each diffusion cache node according to the diffusion node information, and the cache node and / or each diffusion cache node processes the hot service request.

8. A system for processing a service request, characterized by The system is applied in a content distribution network (CDN), and comprises a proxy server, a cache cluster and a source station, the proxy server communicates with the cache cluster and the source station respectively, and the cache cluster is composed of multiple cache nodes; The proxy server is configured to send a service request to any cache node in the cache cluster; The cache cluster is configured to send the service request to the proxy server when the cache data is not acquired. The cache node is configured to receive a service request from the proxy server, process a request domain name and a request path in the service request according to a preset information digest algorithm, determine a cache location corresponding to the service request, detect whether the cache location belongs to the current cache node according to a preset mapping relationship table of locations and nodes, when the cache location belongs to the current cache node, detect whether cache data corresponding to the service request can be obtained according to the cache location, when the cache location does not belong to the current cache node, obtain a first cache node corresponding to the cache location according to the mapping relationship table, and redirect the service request to the first cache node, so that the first cache node processes the service request, wherein the redirection of the service request to the first cache node comprises generating a redirection response based on the service request and node information of the first cache node, sending the redirection response and the mapping relationship table to the proxy server, so that the proxy server sends the service request to the first cache node according to the redirection response When the cache data is obtained according to the cache location, the cache data is sent to the proxy server, and when the cache data is not obtained according to the cache location, a cache data nonexistence instruction is sent to the proxy server The proxy server is further configured to receive the cache data nonexistence instruction, and communicate with the source station to obtain the cache data.

9. The system for processing of service requests according to claim 8, characterized in that, The proxy server is further configured to send the service request to the cache node based on a random access mode or an access mode based on a location and node mapping relationship table.

10. A server, characterized by Comprise: At least one processor; And The memory is in communication connection with the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the service request processing method in any one of claims 1 to 7.

11. A computer readable storage medium storing a computer program, wherein the computer program comprises program instructions configured to cause a processor to perform the method according to any one of claims 1 to 10. The computer program is executed by the processor to implement the service request processing method in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cache data updating method and device

    CN105868231A

  • Data request processing method and device, computer equipment and storage medium

    CN112076464A

  • Content delivery method, apparatus, and system

    US20160323365A1