Request processing system, method, device and equipment of content distribution network and medium

By introducing cache shard information management components and shard placeholder tables into the content distribution network, the cache update and return of edge nodes in high QPS and high concurrency scenarios are solved, and more efficient shard management and performance improvements are achieved.

CN119814884APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411773103.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

Edge nodes continuously update cache shards and return sources in high QPS and high concurrency scenarios, resulting in large consumption of computing resources and increasing user waiting time, which has become a bottleneck for improving CDN network performance.

Method used

A request processing system for content distribution network is designed, including cache shard information management components, source stations and edge nodes. The shard placeholder table is used to determine whether shards exist and are effective, reduce unnecessary return to source operations, and improve the processing efficiency of edge nodes.

Benefits of technology

By reducing unnecessary return-source operations and improving shard management efficiency, the pressure and CPU losses of edge nodes are reduced, and the load capacity and performance of the CDN network are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814884A_ABST
    Figure CN119814884A_ABST
Patent Text Reader

Abstract

The invention provides a request processing system, method, device and equipment for a content delivery network, and a medium. A source station stores resources; resource fragments are stored in the edge nodes; the cache fragment information management component is used for receiving a resource acquisition request sent by a user and judging whether a first resource segment corresponding to the resource acquisition request exists in a fragment placeholder table of the cache fragment information management component; if yes, acquiring fragment information of a first resource corresponding to the resource acquisition request in the edge node based on the first resource segment; the fragment information indicates whether fragments in the edge node meet a preset resource acquisition condition or not; based on the fragment information, determining a target fragment meeting a resource acquisition condition and a to-be-processed fragment not meeting the resource acquisition condition in the edge node; obtaining a target resource corresponding to the to-be-processed fragment in the source station, and updating the to-be-processed fragment and a fragment placeholder table in the edge node based on the target resource; and returning the target fragment and the target resource to the user, thereby reducing the pressure of the edge node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of server technology, and in particular to a content distribution network request processing system, a content distribution network request processing method, a content distribution network request processing device, an electronic device and a computer-readable medium. Background Art

[0002] CDN (Content Delivery Network) includes a source station and at least one edge node. CDN has a shard caching mechanism. When data resources are cached to edge nodes, they are cut into multiple "slices" of fixed size. When a user initiates a request for a part of a data resource (called a range request), if this part of the data has been cached on the edge node, then CDN can directly return the "slice" corresponding to this part of the data without having to obtain the entire data resource from the source station.

[0003] If the CDN is in a high QPS (Queries Per Second) and high concurrency scenario, and the data content in the CDN source station is frequently updated, the CDN needs to continuously update the cache shards in the edge node. When the cache shards in the edge node do not exist or have expired, the edge node needs to obtain data from the source station. The process of the edge node obtaining data from the source station is called "back to source". The operations of refreshing resources such as edge nodes constantly updating cache shards and back to source are time-consuming and performance-consuming operations, which will consume a lot of computing resources and increase the user's waiting time, causing the edge node to face greater processing pressure and become a bottleneck for improving CDN network performance. Summary of the invention

[0004] The embodiments of the present invention provide a content distribution network request processing system, method, device, electronic device and computer-readable storage medium to solve the problem that edge nodes continuously update cache fragments, return to the source and other refresh resource operations, which are time-consuming and performance-consuming operations, consume a large amount of computing resources, and increase the user's waiting time, causing the edge nodes to face greater processing pressure, becoming a bottleneck for improving CDN network performance.

[0005] The embodiment of the present invention discloses a request processing system of a content distribution network, comprising: a cache shard information management component, a source station and at least one edge node; the cache shard information management component comprises a shard placeholder table; the source station stores preset resources; the edge node stores at least one shard corresponding to the resource;

[0006] The cache shard information management component is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain the shard information of the first resource corresponding to the resource acquisition request in the edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition; based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; obtain the target resource corresponding to the to-be-processed shard in the source station, and based on the target resource, update the to-be-processed shard in the edge node and the shard placeholder table; return the target shard and the target resource to the user.

[0007] Optionally, the resource acquisition request includes a uniform resource locator;

[0008] The cache shard information management component is used to process the uniform resource locator using a preset hash function to obtain a hash value corresponding to the resource acquisition request; based on the hash value, determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain at least one of the shard placeholder information, shard time threshold and shard validity information of the shard corresponding to the first resource segment.

[0009] Optionally, the cache shard information management component is used to determine whether the shard corresponding to the first resource segment exists in the edge node based on the shard placeholder information; if it exists, the existing shard is used as a processable shard; if it does not exist, the non-existent shard is determined as the shard to be processed.

[0010] Optionally, the cache shard information management component is used to determine whether the processable shard is valid based on the shard time threshold and the shard validity information; if the processable shard is valid, the valid processable shard is used as the target shard; if the processable shard is invalid, the invalid processable shard is used as the shard to be processed.

[0011] Optionally, the cache shard information management component is used to determine, based on the target resource, whether there is a first resource segment to be updated corresponding to the target resource in the shard placeholder table; if so, then based on the target resource, update at least one of the shard placeholder information, shard time threshold, and shard validity information of the shard corresponding to the first resource segment to be updated; if not, then based on the target resource, add the first resource segment corresponding to the target resource to the shard placeholder table.

[0012] Optionally, the cache shard information management component is used to receive a preset refresh request and determine whether there is at least one second resource segment corresponding to the refresh request in the shard placeholder table; if so, delete the second resource segment; when the second resource corresponding to the deleted second resource segment is requested by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated.

[0013] The embodiment of the present invention also discloses a request processing method of a content distribution network, comprising:

[0014] Receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in a preset shard placeholder table;

[0015] If it exists, based on the first resource segment, obtaining the shard information of the first resource corresponding to the resource acquisition request in the preset edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition;

[0016] Based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node;

[0017] Obtain a target resource corresponding to the shard to be processed in a preset source station, and based on the target resource, update the shard to be processed and the shard placeholder table in the edge node;

[0018] The target slice and the target resource are returned to the user.

[0019] The embodiment of the present invention further discloses a request processing device for a content distribution network, comprising:

[0020] A receiving module, configured to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in a preset shard placeholder table;

[0021] A shard information acquisition module, configured to acquire, if any, shard information of the first resource corresponding to the resource acquisition request in a preset edge node based on the first resource segment; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition;

[0022] A shard determination module, configured to determine, based on the shard information, a target shard that meets the resource acquisition condition and a to-be-processed shard that does not meet the resource acquisition condition in the edge node;

[0023] A target resource acquisition module, used to acquire a target resource corresponding to the to-be-processed shard in a preset source station, and update the to-be-processed shard in the edge node and the shard placeholder table based on the target resource;

[0024] A returning module is used to return the target slice and the target resource to the user.

[0025] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0026] The memory is used to store computer programs;

[0027] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.

[0028] The embodiment of the present invention further discloses one or more computer-readable media on which instructions are stored. When executed by one or more processors, the processors are enabled to execute the method described in the embodiment of the present invention.

[0029] The embodiments of the present invention include the following advantages:

[0030] In an embodiment of the present invention, a request processing system of a content distribution network includes: a cache shard information management component, a source station and at least one edge node; the cache shard information management component includes a shard placeholder table; the source station stores preset resources; the edge node stores at least one shard corresponding to the resource; the cache shard information management component is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain shard information of the first resource corresponding to the resource acquisition request in the edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition; based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; obtain the target resource corresponding to the to-be-processed shard in the source station, and based on the target resource, update the to-be-processed shard and the shard placeholder table in the edge node; return the target shard and the target resource to the user. Before the user requests to find the resource disk of the edge node, the information about whether the shard exists on the disk is obtained. Based on this information, a decision is made as to whether the disk needs to be searched or whether the resource needs to be retrieved. This reduces the pressure on the edge node and reduces the CPU loss in high QPS and high concurrency scenarios, thereby improving the load capacity. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1It is a structural block diagram of a request processing system of a content distribution network provided in an embodiment of the present invention;

[0032] Figure 2 is a schematic diagram of a shard placeholder table provided in an embodiment of the present invention;

[0033] Figure 3 is a schematic diagram of processing a refresh request provided in an embodiment of the present invention;

[0034] Figure 4 It is a structural block diagram of a request processing device of a content distribution network provided in an embodiment of the present invention;

[0035] Figure 5 is a flowchart of a method for processing a request of a content distribution network provided in an embodiment of the present invention;

[0036] Figure 6 is a flowchart of a shard placeholder table task management method provided in an embodiment of the present invention;

[0037] Figure 7 is a flowchart of steps of another method for processing a request of a content distribution network provided in an embodiment of the present invention;

[0038] Figure 8 is a structural block diagram of another content distribution network request processing device provided in an embodiment of the present invention;

[0039] Fig. 9 is a block diagram of an electronic device provided in an embodiment of the present invention;

[0040] Fig.10 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0042] To facilitate understanding of the technical solutions and technical effects of the embodiments of the present invention, the prior art of the present invention is briefly described below.

[0043] CDN (Content Delivery Network) includes a source station and at least one edge node. Edge nodes refer to servers deployed at the edge of the network and close to users. Edge nodes are generally considered to be part of the CDN cache component. CDN can quickly store or back up customer-requested data to edge nodes that are closer to customers through edge nodes that are widely distributed across the country. Therefore, the data requested by customers can be obtained from edge nodes instead of from the source station every time, which reduces the pressure on the source station and improves customer request efficiency and "zero latency" experience.

[0044] CDN has a sharding cache mechanism. When data resources are cached to edge nodes, they are cut into multiple fixed-size "slices". When a user initiates a request for a portion of data resources (called a range request), if this portion of data has been cached on the edge node, CDN can directly return the "slice" corresponding to this portion of data without having to obtain the entire data resource from the source station, greatly improving the flexibility of CDN request processing.

[0045] The high QPS (Queries Per Second) of CDN refers to the large number of query requests received by CDN per second. The high concurrency of CDN means that CDN needs to process query requests from multiple users at the same time. If CDN is in a high QPS and high concurrency scenario, and the data content in the CDN source station is frequently updated, CDN needs to continuously update the cache shards in the edge nodes. When the cache shards in the edge node do not exist or have expired, the edge node needs to obtain data from the source station. The process of edge nodes obtaining data from the source station is called "back to source". The operations of refreshing resources such as edge nodes constantly updating cache shards and back to source are time-consuming and performance-consuming operations, which will consume a lot of computing resources and increase user waiting time, causing edge nodes to face greater processing pressure and become a bottleneck for improving CDN network performance.

[0046] In addition, the edge node lacks direct information about whether the cache shard is stored on the disk. Each cache shard has a corresponding index entry on the edge node. Edge nodes usually manage cache information by means of shard indexes, that is, they determine whether the cache shard is stored on the edge node's disk by searching for the cache shard by index. Therefore, in response to customer requests or cache shard refresh requests, the edge node can only determine whether the cache shard exists by searching for the cache shard by index. This operation process involves complex and time-consuming comparisons and calculations. In scenarios with high QPS and high concurrency, the operation of determining whether the cache shard exists by searching for the cache shard by index increases the loss of the edge node's CPU (Central Processing Unit), increases the pressure on the edge node, and is not conducive to the expansion of CDN services.

[0047] Reference Figure 1 , shows a structural block diagram of a request processing system of a content distribution network provided in an embodiment of the present invention, comprising: a cache shard information management component, a source station and at least one edge node; the cache shard information management component includes a shard placeholder table; the source station stores preset resources; the edge node stores at least one shard corresponding to the resource;

[0048] The cache shard information management component is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain the shard information of the first resource corresponding to the resource acquisition request in the edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition; based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; obtain the target resource corresponding to the to-be-processed shard in the source station, and based on the target resource, update the to-be-processed shard in the edge node and the shard placeholder table; return the target shard and the target resource to the user.

[0049] In an embodiment of the present invention, a request processing system of a content distribution network includes a cache shard information management component, a source station, and at least one edge node. Among them, the edge node includes a storage component, and the source station stores preset resources. The storage component is used to store at least one shard corresponding to the resource and return the data queried by the user. Since the CDN has a shard caching mechanism, when data resources are cached to the edge node, they will be cut into multiple "slices" of fixed size, so the storage component of the edge node stores data in the form of shards, and the size of each data slice is usually 1M (megabyte).

[0050] In the embodiment of the present invention, the cache shard information management component includes a refresh service interface, a shard placeholder table, and a client request service interface. The shard placeholder table records the cache shard placeholder information of the resource requested by the user in the storage component, including the total size Content-Length of the resource, information on whether the shard corresponding to the resource exists in the storage component, and the MD5 (Message-Digest Algorithm 5) value of the shard corresponding to the resource. It should be noted that the shard placeholder table is stored in the form of a hash table.

[0051] The client request service interface can receive a resource acquisition request sent by a user from a client, and query the shard placeholder table to determine whether there is at least one first resource segment of the first resource corresponding to the resource acquisition request in the shard placeholder table. If the first resource segment does not exist in the shard placeholder table, it means that the first resource does not exist in the edge node. The client request service interface needs to perform a back-to-source service, obtain the first resource from the source station, and store the first resource in the edge node, and update the shard placeholder table according to the placeholder information of the first resource in the edge node.

[0052] If the first resource segment exists in the shard placeholder table, it means that the first resource exists in the edge node. Based on the first resource segment, the shard information of the shard corresponding to the first resource in the edge node contained in the shard placeholder table can be obtained. The shard information includes information such as whether there is a shard corresponding to the first resource in the storage component of the edge node, the preset time threshold of the shard corresponding to the first resource, and whether the shard corresponding to the first resource is valid. According to the shard information, the target shard that meets the preset resource acquisition conditions and the to-be-processed shard that does not meet the resource acquisition conditions in the storage component can be determined. Among them, the preset resource acquisition conditions refer to the conditions that the shard corresponding to the first resource exists in the storage component, the current time does not exceed the preset time threshold of the existing shard, and the existing shard is valid.

[0053] The client request service interface can perform back-to-source services, obtain the target resource corresponding to the shard to be processed from the source station, then splice the target resource with the target shard, and return the spliced ​​resource to the user. At the same time, the client request service interface can update the shard to be processed in the edge node based on the target resource, and update the shard placeholder table according to the placeholder information of the updated shard to be processed in the storage component in the edge node.

[0054] The refresh service interface is used to receive the refresh service sent by the refresh platform and complete the batch shard cache refresh service. Among them, the refresh service includes a refresh request. The refresh service interface can query the shard placeholder table to determine the second resource corresponding to the refresh request and complete the refresh task by updating the shard placeholder table.

[0055] In some embodiments of the present invention, the resource acquisition request includes a uniform resource locator;

[0056] The cache shard information management component is used to process the uniform resource locator using a preset hash function to obtain a hash value corresponding to the resource acquisition request; based on the hash value, determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain at least one of the shard placeholder information, shard time threshold and shard validity information of the shard corresponding to the first resource segment.

[0057] In the embodiment of the present invention, the shard placeholder table is stored in the form of a hash table.

[0058] Reference Figure 2 , showing a schematic diagram of a shard placeholder table provided in an embodiment of the present invention.

[0059] In an embodiment of the present invention, the client request service interface can receive a resource acquisition request sent by a user from a client, and the resource acquisition request includes a URL (Uniform Resource Locator). Then, the client request service interface removes the query parameters in the URL, and uses a hash function to calculate the URL after the parameters are removed to generate a hash value, which is the key value in the hash table. It should be noted that each URL corresponds to a unique key value.

[0060] In an embodiment of the present invention, the key value can be used as a node of a single linked list. In the hash table, each key value is followed by a pointer to a different resource segment of the same key value in the form of a single linked list. The resource segment is the first resource segment. For example: the key1 value points to resource a and resource b. If the resource segment pointed to by the key value does not exist in the hash table, the first resource corresponding to the resource acquisition request does not exist in the storage component.

[0061] In the embodiment of the present invention, each resource segment contains 5 fields, namely: resource name, segment placeholder information (prese), timeout (expire), total file size (length) and segment MD5 value. Among them, the resource name is the URL of the resource acquisition request, length is the total file size of the first resource of the resource acquisition request (Content-length); the timeout is the segment time threshold, if the current time exceeds the segment time threshold, the segment is invalid.

[0062] In an embodiment of the present invention, a pointer is also stored in the segment placeholder information, and the pointer points to a continuous memory whose data type is an integer and whose size consists of length bits. Each bit represents the retention of a slice corresponding to the first resource in the storage component of the edge node. If the bit is 1, it means that the slice corresponding to the bit exists in the edge node; if the bit is 0, it means that the slice corresponding to the bit does not exist in the edge node.

[0063] In a specific example, the length is 10M (megabytes), each shard corresponds to 1M, and the length of 10M corresponds to 10 shards in total. If the integer data pointed to by the segment placeholder information is 14 (decimal), then the integer data 14 is 0000001110 (binary), indicating that the 2nd to 4th shards of the first resource exist in the edge node. The other shards of the first resource do not exist in the edge node.

[0064] In an embodiment of the present invention, the shard MD5 value records the information summary of the cache content of the existing shard, which is used to verify the correctness of the information content and determine whether the existing shard is valid. The shard MD5 value points to a segment of continuous memory. An array with a maximum of length elements is stored in the segment of continuous memory. The first element of the array corresponds to the MD5 value of the first existing shard of the first resource, the second element corresponds to the MD5 value of the second existing shard of the first resource, and so on. The elements in the array correspond to the MD5 values ​​of all existing shards in the first resource. It should be noted that the sequences of shards corresponding to adjacent MD5 values ​​are not necessarily adjacent. If the shard of the first resource does not exist, the element of the array is null (empty value).

[0065] In some embodiments of the present invention, the cache shard information management component is used to determine whether the shard corresponding to the first resource segment exists in the edge node based on the shard placeholder information; if it exists, the existing shard is used as a processable shard; if it does not exist, the non-existent shard is determined as the shard to be processed.

[0066] In an embodiment of the present invention, the client request service interface in the cache shard information management component can use the shard placeholder table to obtain information about whether the shard corresponding to the first resource exists in the edge node, and obtain the target shard that meets the preset resource acquisition conditions from the storage component, and obtain the target resource corresponding to the shard to be processed from the source station.

[0067] Specifically, the client request service interface includes a decision module and a back-to-source module. The decision module can interface with the resource acquisition request sent by the client. Then, according to the URL contained in the resource acquisition request, query the shard placeholder table to determine whether the first resource corresponding to the resource acquisition request exists in the edge node. If the first resource exists, locate the resource segment corresponding to the resource acquisition request, and determine whether the shard of the first resource exists in the edge node by querying the segment placeholder information. If it exists, the decision module can use the existing shard as a processable shard; if it does not exist, the decision module can use the non-existent shard as a shard to be processed.

[0068] In some embodiments of the present invention, the cache shard information management component is used to determine whether the processable shard is valid based on the shard time threshold and the shard validity information; if the processable shard is valid, the valid processable shard is used as the target shard; if the processable shard is invalid, the invalid processable shard is used as the shard to be processed.

[0069] In an embodiment of the present invention, the decision module in the client request business interface in the cache shard information management component can determine whether the current time exceeds the shard time threshold corresponding to the processable shard by querying the timeout field; if the current time exceeds the shard time threshold corresponding to the processable shard, the processable shard is invalid. If the current time does not exceed the shard time threshold corresponding to the processable shard. If the current time does not exceed the shard time threshold corresponding to the processable shard, the decision module can send the segment placeholder information of the processable shard, the continuous memory pointed to by the shard placeholder information, and the length field to the decision module. If the first resource does not exist, the shard corresponding to the first resource does not exist, or the current time exceeds the shard time threshold corresponding to the processable shard, a NULL value is sent to the decision module.

[0070] In the embodiment of the present invention, the decision module can quickly calculate a sequence of processable slices with a placeholder of 1 and a sequence of processable slices with a placeholder of 0 according to the continuous memory pointed to by the acquired slice placeholder information.

[0071] For the processable shard sequence with a placeholder of 1, the decision module requests the storage component in the edge node to obtain the corresponding processable shard, calculates the shard MD5 value, and compares it with the shard MD5 value of the processable shard in the shard placeholder table. If the calculated shard MD5 value is different from the batch MD5 value in the shard placeholder table, it means that the processable shard is invalid, and the processable shard is treated as a shard to be processed and added to the back-to-source shard list. If the calculated shard MD5 value is the same as the batch MD5 value in the shard placeholder table, it means that the processable shard is valid and does not need to be back-sourced, and the processable shard is used as the target shard.

[0072] For the processable fragment sequence with a placeholder of 0, it is regarded as the fragment to be processed. The invalid fragment to be processed and the fragment to be processed with a placeholder of 0 are spliced ​​to form a back-to-source fragment list, and the length information corresponding to the fragment to be processed in the back-to-source fragment list is transferred to the back-to-source module.

[0073] If the decision module receives a NULL value, the first resource corresponding to the resource acquisition request is added to the back-to-source shard list and handed over to the back-to-source module. The back-to-source module calculates the range segment based on the length information and the back-to-source shard list and initiates a back-to-source request.

[0074] In the embodiment of the present invention, the back-to-source module can obtain the target data corresponding to the range segment from the source station, and the target data is the target resource. The back-to-source module can transfer the target resource to the decision module.

[0075] In some embodiments of the present invention, the cache shard information management component is used to determine, based on the target resource, whether there is a first resource segment to be updated corresponding to the target resource in the shard placeholder table; if so, then based on the target resource, update at least one of the shard placeholder information, shard time threshold, and shard validity information of the shard corresponding to the first resource segment to be updated; if not, then based on the target resource, add the first resource segment corresponding to the target resource to the shard placeholder table.

[0076] In an embodiment of the present invention, the back-to-source module in the client request business interface in the cache shard information management component can transfer the target resource to the decision module, and at the same time, the Content-Lenth field and range segment carried by the target resource calculate the shard interval, and calculate the MD5 digest for the content of each shard contained in the target resource based on the content of at least one shard contained in the target resource. The back-to-source module can calculate the corresponding hash value based on the URL contained in the target resource, and determine whether there is a first resource segment to be updated corresponding to the target resource in the storage component based on the hash value. If it exists, the MD5 digest is used to update at least one of the shard placeholder information, shard placeholder threshold, and shard validity information of the shard corresponding to the first resource segment to be updated. If it does not exist, a new node is added to the header of the linked list corresponding to the key value, and the node includes the first resource segment corresponding to the target resource.

[0077] The back-to-source module can also update the pending shards in the storage component based on the target resource. The decision module can splice the target resource and the target shards and send them to the client.

[0078] In some embodiments of the present invention, the cache shard information management component is used to receive a preset refresh request and determine whether there is at least one second resource segment corresponding to the refresh request in the shard placeholder table; if so, the second resource segment is deleted; when the second resource corresponding to the deleted second resource segment is requested to be obtained by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated.

[0079] In an embodiment of the present invention, the refresh service interface in the cache shard information management component can receive the refresh service sent by the refresh platform and complete the batch shard cache refresh service. The refresh service is the refresh request. In an embodiment of the present invention, in the hot spot scenario of high-frequency refresh, batch refresh requires frequent IO (input / output) reading and writing, which is often very time-consuming.

[0080] Reference Figure 3 , showing a processing diagram of a refresh request provided in an embodiment of the present invention. The refresh service interface includes a refresh request module and an automatic refresh module. Among them, the refresh request module can receive a refresh task request sent by the refresh platform, that is, a refresh request. The refresh request includes a URL, request. The refresh request module can use the URL to query the shard placeholder table to determine whether there is a second resource segment corresponding to the refresh request in the shard placeholder table. The method by which the refresh request module uses the URL to determine whether there is a second resource segment in the shard placeholder table is the same as the method by which the decision module uses the URL to determine whether there is a first resource segment in the shard placeholder table, and the present invention will not be repeated here.

[0081] If the second resource segment exists, the linked list node corresponding to the second resource segment is deleted and the related memory is released. If the second resource segment does not exist, no further processing is required. It should be noted that when the second resource corresponding to the deleted second resource segment is requested by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated, realizing the refresh of the shard placeholder table and the storage components of the edge node.

[0082] In the embodiment of the present invention, the refresh task of the automatic refresh module is triggered by a pre-set timer, usually once a day, and is triggered during non-hotspot periods. When triggered, the automatic refresh module will traverse the shard placeholder table, compare the resource segment expire field with the current time, and if it has timed out, directly delete the linked list node and release memory. Regular timeout refresh will improve the query hit rate and efficiency of the shard placeholder table and effectively reduce the query time.

[0083] In an embodiment of the present invention, a request processing system of a content distribution network includes: a cache shard information management component, a source station and at least one edge node; the cache shard information management component includes a shard placeholder table; the source station stores preset resources; the edge node stores at least one shard corresponding to the resource; the cache shard information management component is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; if so, based on the first resource segment, obtain shard information of the first resource corresponding to the resource acquisition request in the edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition; based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; obtain the target resource corresponding to the to-be-processed shard in the source station, and based on the target resource, update the to-be-processed shard and the shard placeholder table in the edge node; return the target shard and the target resource to the user. Before the user requests to find the resource disk of the edge node, the information about whether the shard exists on the disk is obtained. Based on this information, a decision is made as to whether the disk needs to be searched or whether the resource needs to be retrieved. This reduces the pressure on the edge node and reduces the CPU loss in high QPS and high concurrency scenarios, thereby improving the load capacity.

[0084] In the embodiment of the present invention, a strategy of separation of "storage" and "management" is adopted to separate the business part responsible for processing customer requests, back-to-source, refresh, etc. from the storage part responsible for caching real resources. The cache shard information management component is responsible for processing client requests, refresh requests, back-to-source and other services, and the storage component is mainly responsible for the storage of resource data and the return of query data, thereby reducing the performance consumption of frequent queries to the underlying storage. A request back-to-source mechanism based on shard placeholder information is used to dynamically maintain the shard occupancy of the underlying storage by maintaining a full shard placeholder table, so as to make decisions based on the placeholder information, reduce the amount of underlying calculations, improve the back-to-source efficiency, and reduce request latency. Using a lightweight refresh method, in a high-frequency refresh scenario, high-level information is used to refresh the shard cache, avoiding frequent underlying calls, thereby reducing the consumption of query disks, and improving refresh efficiency and node performance. The present invention provides a high-performance shard cache information management and efficient client request and shard cache refresh solution, which solves the defects of the existing CDN cache management solution in high QPS and high concurrency scenarios, such as extended request time, excessive CPU loss, and high node processing pressure. In hotspot scenarios, high-frequency business requests and refresh requests can effectively alleviate disk pressure, reduce CPU loss, and improve the load capacity of CDN nodes, providing a basis for breaking through CDN network performance bottlenecks.

[0085] In an embodiment of the present invention, a lightweight refresh method is used to refresh the shard cache at the high-level information. Compared with the existing method of refreshing by changing the underlying index, the present invention does not need to rely on the total size of the target resource to calculate the shard position, and avoids the modification of the underlying index, thereby reducing IO consumption, improving refresh efficiency and node performance, and having more performance advantages under frequent refresh tasks. This solution maintains the high-level information of the shard cache at the business level, which can reduce underlying consumption, efficiently return to the source, reduce request latency, and implement fast lightweight shard refresh tasks under high-frequency batch refresh tasks, thereby reducing disk pressure, while reducing CPU loss in hot spots and improving load capacity. Provide customers with efficient request and refresh services, and provide performance guarantees for the business expansion of the CDN network.

[0086] Reference Figure 4 , shows a structural block diagram of a request processing device of a content distribution network provided in an embodiment of the present invention, which specifically includes the following modules:

[0087] The fragment placeholder information module is used to record the cache fragment placeholder information corresponding to the requested resource, including the total resource size Content-Length, whether the fragment exists in the storage component, and the MD5 value of the cache fragment, etc., which are stored in the form of a hash table. Specifically, in the hash table, after each key, different resource segments pointing to the same key value are linked by pointers in the form of a single linked list. Each resource segment contains 5 fields: resource name, fragment placeholder information prese, timeout expire, total file size length, and fragment MD5 value. Among them, the resource name is the unique mark of the resource segment, which is used to accurately match the resource segment; length is the total size of the resource file requested by the client (Content-length), which is used to calculate the fragment information; expire is the timeout field, which stipulates that if the time limit is exceeded, the resource will be invalid and need to be returned to the source; the prese fragment placeholder information field saves a pointer, which points to a continuous memory. The data type of the continuous memory is integer, and the size consists of length bits. Each bit represents the retention of the corresponding fragment in the storage component, 1 means existence, and 0 means non-existence. This field is used to query the shard placeholder information of the target resource, providing information basis for back-to-source decision-making and refresh tasks. The shard placeholder information module dynamically records the high-level information of the storage component shard cache, reducing the consumption of the underlying IO.

[0088] The client request module is used to process client business requests and obtain target resource data. Specifically, the resource segment corresponding to the client request URL is obtained through interaction with the shard placeholder information module. If the resource segment exists, it means that at least part of the shards of the resource have been stored in the storage component; if the resource segment does not exist, it means that the resource does not exist in the storage component. For the non-existent resource segment, the range is summarized and then a back-to-source request is initiated to the source station. For the existing resource segment, the expire field returned by the shard placeholder information module is further judged. If it has timed out, the back-to-source is initiated after the summary. If it has not timed out, the returned segment placeholder information prese field is further used to obtain the shard sequence with a placeholder of 1 and the shard sequence with a placeholder of 0 through bitwise AND operation. For the sequence of 0, it is spliced ​​and processed to form a back-to-source shard list, and the range segment is further analyzed according to the length field, and the back-to-source request is initiated respectively. For the sequence with a placeholder of 1, the storage component is requested to obtain it respectively, and then the MD5 value of the obtained shard content is calculated and compared with the MD5 value given by the shard placeholder information module. If there is no match, it means that the shard needs to be returned to the source; if there is a match, it means that the content is valid. Finally, the client request module splices all the obtained shard contents and responds to the client. In this way, making a return-to-source decision based on the placeholder information can effectively reduce the underlying calculation amount, improve the return-to-source efficiency, and reduce the request latency.

[0089] The refresh business module is used to process refresh requests and scheduled refresh tasks. Specifically, by parsing the batch refresh request initiated by the refresh platform, the target resource URL to be refreshed is obtained, and the shard placeholder information module is queried according to the hash value of the resource URL. If the placeholder information of the corresponding resource URL is returned, it means that the resource exists, and the resource segment where the resource is located is deleted from the linked list and the relevant memory is released; if a NULL value is returned, it means that the resource does not exist, and the refresh can be ignored. The scheduled refresh task is triggered by the timer set by the module, usually once a day, and is triggered during non-hotspot periods. When the scheduled refresh task is triggered, the shard placeholder table will be traversed and the resource segment expire field will be compared. If it has timed out, the node will be deleted and the memory will be released; if it has not timed out, no processing is required. Refresh the shard cache at the high-level information to reduce the consumption of query disks, thereby improving refresh efficiency and node performance.

[0090] Reference Figure 5 , shows a flowchart of a method for processing a request of a content distribution network provided in an embodiment of the present invention, which may specifically include the following steps:

[0091] Step 501, request resolution. The cache shard information management component determines whether the request is an external client request or a refresh task request initiated by the internal refresh platform through request resolution. If it is a client request, proceed to step 502; if it is a refresh request, proceed to step 515.

[0092] Step 502, obtain the request URL and range header. By parsing the client request and removing the parameters, the target resource URL is further obtained, and the range header carried is parsed to obtain the target range segment information. If there is no range header, the default is to obtain all resources.

[0093] Step 503: Calculate the hash value of the resource URL and obtain the key value of the target resource segment according to a predetermined hash value calculation method.

[0094] Step 504, query the shard placeholder table. The shard placeholder table is queried according to the key value calculated in step 503. The shard placeholder table will respond with the corresponding segment placeholder information (the resource segment exists) or a NULL field (the resource segment does not exist). If the resource segment exists, proceed to step 505; if the resource segment does not exist, proceed to step 509.

[0095] Step 505, check whether it has timed out. According to the expire field returned by the segment placeholder table, determine whether it has timed out. If it has not timed out, proceed to step 506; if it has timed out, proceed to step 509.

[0096] Step 506: Calculate the existing and non-existing fragment sequences according to the prese field. According to the prese field returned by the segment placeholder table, calculate the placeholder sequence of 1 (existing) and the sequence of 0 (non-existing). For the existing sequence, proceed to step 507; for the non-existing sequence, proceed to step 509.

[0097] Step 507: Request the storage component to send the fragment information corresponding to the existing sequence to the storage component.

[0098] Step 508, compare the MD5 value of the slice. After obtaining the target data, calculate the MD5 value of the target slice content and compare it with the MD5 in the segment placeholder information obtained in step 504. If they do not match, proceed to step 509; if they match, proceed to step 514.

[0099] Step 509: Add the back-to-source shard list. Integrate the shards that need to be back-to-source into the back-to-source shard list to prepare data for the back-to-source.

[0100] Step 510: Calculate the range segment to be returned to the source. According to the length information obtained in step 4 and the fragment sequence number and other information, the range segment that needs to be returned to the source is concatenated and calculated.

[0101] Step 511: Initiate a back-to-source request. For the range segments calculated in step 510, initiate back-to-source requests respectively.

[0102] Step 512: Update the fragment placeholder table. Calculate the fragment information based on the Content-Length response header and range segment of the source station response, create a new placeholder table, and record the newly acquired fragment information in the placeholder table: change the placeholder byte corresponding to the fragment sequence number to 1, and the rest to 0. Update this new placeholder table to the fragment placeholder table.

[0103] Step 513: Update the shard cache and push the new shard data obtained from the source to the storage component.

[0104] Step 514: Integrate target data. After all requested target slices have been acquired, all slices are spliced ​​and integrated, and step 518 is performed.

[0105] Step 515: Parse the batch refresh URL parameters. Parse the batch URL parameters carried in the refresh request and calculate the corresponding key value. After obtaining a key value, proceed to step 516.

[0106] Step 516, query the shard placeholder table. Query the shard placeholder table according to the key value calculated in step 515. The shard placeholder table will respond with the corresponding segment placeholder information (the resource segment exists) or a NULL field (the resource segment does not exist). For the existing resource segment, proceed to step 517; for the non-existent resource segment, proceed to step 514.

[0107] Step 517, deleting the node and releasing the memory. The refresh purpose is achieved by deleting the linked list node where the target resource segment is located in the shard placeholder table, and the related memory is released, and then step 519 is performed.

[0108] Step 518, respond to the client. In this embodiment, the data is sent to the client.

[0109] Step 519, end.

[0110] Reference Figure 6 , shows a flowchart of a shard placeholder table task management method provided in an embodiment of the present invention, which specifically includes the following steps:

[0111] Step 601, task identification. The shard placeholder table mainly handles two types of tasks: query and update. When a task arrives, the task type is first determined. If it is a query task, proceed to step 602; if it is an update task, proceed to step 607.

[0112] Step 602, query the shard hash table. The shard placeholder table stores the full amount of information of the shard cache using the information in the hash table. Search the hash table according to the query keyword (target key value). If the hash value exists, obtain the corresponding resource segment pointer. If the resource segment pointer is empty, proceed to step 606; if not empty, proceed to step 603.

[0113] Step 603, compare the resource segment name pointed to by the pointer and the request URL. Compare the name field pointed to by the pointer and the target URL of the query task. If they match, proceed to step 604; if not, assign the next of the node pointed to by the pointer to the pointer and proceed to step 602.

[0114] Step 604, compare the expire field. Further compare the expire field of the resource segment pointed to by the pointer with the current time. If it has timed out, it means that the resource is invalid and needs to be pulled back to the source again, and proceed to step 606; if it has not timed out, it means that the resource content is valid, and proceed to step 605.

[0115] Step 605: Return the values ​​of the prese, MD5 and length fields. The values ​​of the prese, MD5 and length fields of the target resource segment are packaged and returned.

[0116] Step 606, return NULL. Return NULL value and proceed to step 613.

[0117] Step 607, determine whether it is a refresh task. If it is a refresh task, proceed to step 608; if not, proceed to step 610.

[0118] Step 608: query the shard hash table. According to the hash value of the target URL that needs to be refreshed, search the shard hash table to locate the target resource segment.

[0119] Step 609: Delete the target resource segment node. According to the query result, delete the node where the resource segment is located from the linked list. Go to step 613.

[0120] Step 610, query the shard hash table. According to the hash value of the provided target URL, search the shard hash table. If the resource segment exists, proceed to step 611; if not, proceed to step 612.

[0121] Step 611, modify the resource segment information. After locating the target resource segment, update the field information, including the prese, MD5, length, and expire fields.

[0122] Step 612: Add a resource segment node. Add a resource segment node to the header of the linked list pointed to by the resource segment pointer in the hash table, and fill the resource name, prese, MD5, length, and expire fields with relevant information of the target resource segment.

[0123] Step 613, end.

[0124] Reference Figure 7 , shows a flowchart of a request processing method for a content distribution network provided in an embodiment of the present invention, which may specifically include the following steps:

[0125] Step 701, receiving a resource acquisition request sent by a user, and determining whether there is at least one first resource segment corresponding to the resource acquisition request in a preset shard placeholder table;

[0126] Step 702: If it exists, based on the first resource segment, obtain the shard information of the first resource corresponding to the resource acquisition request in the preset edge node; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition;

[0127] Step 703: Determine, based on the shard information, a target shard that meets the resource acquisition condition and a to-be-processed shard that does not meet the resource acquisition condition in the edge node;

[0128] Step 704: Obtain a target resource corresponding to the to-be-processed shard in a preset source station, and update the to-be-processed shard and the shard placeholder table in the edge node based on the target resource;

[0129] Step 705: Return the target slice and the target resource to the user.

[0130] In any of the above embodiments, the resource acquisition request includes a uniform resource locator; step 701 includes:

[0131] Sub-step S11, using a preset hash function to process the uniform resource locator to obtain a hash value corresponding to the resource acquisition request;

[0132] Sub-step S12, judging, according to the hash value, whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table;

[0133] Step 702 includes:

[0134] Sub-step S21, based on the first resource segment, obtaining at least one of the slice placeholder information, the slice time threshold and the slice validity information of the slice corresponding to the first resource segment.

[0135] In any of the above embodiments, step 703 includes:

[0136] Sub-step S31, based on the slice placeholder information, determining whether the slice corresponding to the first resource segment exists in the edge node;

[0137] Sub-step S32, if it exists, taking the existing fragment as a processable fragment;

[0138] Sub-step S33: If the fragment does not exist, the fragment that does not exist is determined as the fragment to be processed.

[0139] In any of the above embodiments, step 703 includes:

[0140] Sub-step S41, judging whether the processable fragment is valid based on the fragment time threshold and the fragment validity information;

[0141] Sub-step S42, if the processable fragment is valid, taking the valid processable fragment as the target fragment;

[0142] Sub-step S43: If the processable slice fails, the failed processable slice is used as the to-be-processed slice.

[0143] In any of the above embodiments, step 704 includes:

[0144] Sub-step S51, based on the target resource, determining whether there is a first resource segment to be updated corresponding to the target resource in the shard placeholder table;

[0145] Sub-step S52, if it exists, then based on the target resource, updating at least one of the slice placeholder information, the slice time threshold and the slice validity information of the slice corresponding to the first resource segment to be updated;

[0146] Sub-step S53: if it does not exist, then based on the target resource, add the first resource segment corresponding to the target resource in the slice placeholder table.

[0147] In any of the above embodiments, the method includes:

[0148] Sub-step S61, receiving a preset refresh request, and determining whether there is at least one second resource segment corresponding to the refresh request in the slice placeholder table;

[0149] Sub-step S62, if it exists, delete the second resource segment; when the second resource corresponding to the deleted second resource segment is requested by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated.

[0150] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0151] Reference Figure 8 , shows a structural block diagram of another content distribution network request processing device provided in an embodiment of the present invention, which may specifically include the following modules:

[0152] The receiving module 801 is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the preset shard placeholder table;

[0153] A shard information acquisition module 802 is used to acquire shard information of the first resource corresponding to the resource acquisition request in a preset edge node based on the first resource segment, if any; the shard information is used to indicate whether the shard in the edge node meets the preset resource acquisition condition;

[0154] A shard determination module 803 is used to determine, based on the shard information, a target shard that meets the resource acquisition condition and a to-be-processed shard that does not meet the resource acquisition condition in the edge node;

[0155] The target resource acquisition module 804 is used to acquire the target resource corresponding to the to-be-processed shard in the preset source station, and update the to-be-processed shard in the edge node and the shard placeholder table based on the target resource;

[0156] The return module 805 is used to return the target slice and the target resource to the user.

[0157] In an optional embodiment of the present invention, the resource acquisition request includes a uniform resource locator; the receiving module includes:

[0158] A hash value acquisition submodule, used to process the uniform resource locator using a preset hash function to obtain a hash value corresponding to the resource acquisition request;

[0159] A first resource segment determination submodule, configured to determine, according to the hash value, whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table;

[0160] The fragment information acquisition module includes:

[0161] The information acquisition submodule is used to acquire at least one of the slice placeholder information, the slice time threshold and the slice validity information of the slice corresponding to the first resource segment based on the first resource segment.

[0162] In an optional embodiment of the present invention, the fragmentation determination module includes:

[0163] An existence determination submodule, used for determining whether a slice corresponding to the first resource segment exists in the edge node based on the slice placeholder information;

[0164] The processable fragment is used as a submodule, and is used to treat the existing fragment as the processable fragment if it exists;

[0165] The to-be-processed fragment determination submodule is used to determine the non-existent fragment as the to-be-processed fragment if the fragment does not exist.

[0166] In an optional embodiment of the present invention, the fragmentation determination module includes:

[0167] A validity judgment submodule, used for judging whether the processable fragment is valid based on the fragment time threshold and the fragment validity information;

[0168] The target slice is used as a submodule, and is used to take the valid processable slice as the target slice if the processable slice is valid;

[0169] The to-be-processed slice is used as a submodule, and is used to use the failed processable slice as the to-be-processed slice if the processable slice fails.

[0170] In an optional embodiment of the present invention, the target resource acquisition module includes:

[0171] A first resource segment to be updated judgment submodule, used for judging, based on the target resource, whether there is a first resource segment to be updated corresponding to the target resource in the shard placeholder table;

[0172] An updating submodule, configured to update at least one of the slice placeholder information, the slice time threshold, and the slice validity information of the slice corresponding to the first resource segment to be updated based on the target resource, if any;

[0173] An adding submodule is used to add a first resource segment corresponding to the target resource in the slice placeholder table based on the target resource if it does not exist.

[0174] In an optional embodiment of the present invention, the device comprises:

[0175] A refresh request receiving module, configured to receive a preset refresh request and determine whether there is at least one second resource segment corresponding to the refresh request in the shard placeholder table;

[0176] A deletion module is used to delete the second resource segment if it exists; when the second resource corresponding to the deleted second resource segment is requested by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated.

[0177] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0178] In addition, an embodiment of the present invention further provides an electronic device, such as Fig. 9 As shown, it includes a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0179] Memory 903, used for storing computer programs;

[0180] The processor 901 is used to implement the request processing method of a content distribution network when executing the program stored in the memory 903.

[0181] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0182] The communication interface is used for communication between the above terminal and other devices.

[0183] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0184] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0185] like Fig.10 As shown, in another embodiment provided by the present invention, a computer-readable storage medium 1001 is also provided, in which instructions are stored. When the computer-readable storage medium 1001 is run on a computer, the computer executes a request processing method for a content distribution network described in the above embodiment.

[0186] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the request processing method of a content distribution network described in the above embodiment.

[0187] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.

[0188] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0189] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0190] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A request processing system for a content distribution network, characterized in that: include: A cache shard information management component, a source station and at least one edge node; the cache shard information management component includes a shard placeholder table; the source station stores preset resources; At least one shard corresponding to the resource is stored in the edge node; The cache shard information management component is used to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; If so, based on the first resource segment, obtaining the shard information of the first resource corresponding to the resource acquisition request in the edge node; The shard information is used to indicate whether the shards in the edge node meet the preset resource acquisition conditions; Based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; Obtain a target resource corresponding to the shard to be processed in the source station, and based on the target resource, update the shard to be processed and the shard placeholder table in the edge node; return the target shard and the target resource to the user.

2. The request processing system according to claim 1, characterized in that: The resource acquisition request includes a uniform resource locator; The cache shard information management component is used to process the uniform resource locator using a preset hash function to obtain a hash value corresponding to the resource acquisition request; According to the hash value, determining whether there is at least one first resource segment corresponding to the resource acquisition request in the shard placeholder table; If it exists, based on the first resource segment, at least one of the slice placeholder information, the slice time threshold and the slice validity information of the slice corresponding to the first resource segment is obtained.

3. The request processing system according to claim 2, characterized in that: The cache shard information management component is used to determine whether the shard corresponding to the first resource segment exists in the edge node based on the shard placeholder information; if so, use the existing shard as a processable shard; If it does not exist, the non-existent fragment is determined as the fragment to be processed.

4. The request processing system according to claim 3, characterized in that: The cache shard information management component is used to determine whether the processable shard is valid based on the shard time threshold and the shard validity information; if the processable shard is valid, the valid processable shard is used as the target shard; If the processable slice fails, the failed processable slice is used as the to-be-processed slice.

5. The request processing system according to claim 2, characterized in that: The cache shard information management component is used to determine, based on the target resource, whether there is a first resource segment to be updated corresponding to the target resource in the shard placeholder table; if so, update at least one of the shard placeholder information, the shard time threshold, and the shard validity information of the shard corresponding to the first resource segment to be updated based on the target resource; If not, based on the target resource, add the first resource segment corresponding to the target resource in the slice placeholder table.

6. The request processing system according to claim 5, characterized in that: The cache shard information management component is used to receive a preset refresh request and determine whether there is at least one second resource segment corresponding to the refresh request in the shard placeholder table; If it exists, deleting the second resource segment; When the second resource corresponding to the deleted second resource segment is requested to be acquired by the user, the second resource segment in the shard placeholder table is added, and the shard corresponding to the second resource segment in the edge node is updated.

7. A method for processing a request in a content distribution network, characterized in that: include: Receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in a preset shard placeholder table; If so, based on the first resource segment, obtaining the shard information of the first resource corresponding to the resource acquisition request in the preset edge node; The shard information is used to indicate whether the shards in the edge node meet the preset resource acquisition conditions; Based on the shard information, determine the target shard that meets the resource acquisition condition and the to-be-processed shard that does not meet the resource acquisition condition in the edge node; Obtain a target resource corresponding to the shard to be processed in a preset source station, and based on the target resource, update the shard to be processed and the shard placeholder table in the edge node; The target slice and the target resource are returned to the user.

8. A request processing device for a content distribution network, characterized in that: include: A receiving module, configured to receive a resource acquisition request sent by a user, and determine whether there is at least one first resource segment corresponding to the resource acquisition request in a preset shard placeholder table; A shard information acquisition module, configured to acquire shard information of the first resource corresponding to the resource acquisition request in a preset edge node based on the first resource segment, if any; The shard information is used to indicate whether the shards in the edge node meet the preset resource acquisition conditions; A shard determination module, configured to determine, based on the shard information, a target shard that meets the resource acquisition condition and a to-be-processed shard that does not meet the resource acquisition condition in the edge node; A target resource acquisition module, used to acquire a target resource corresponding to the to-be-processed shard in a preset source station, and update the to-be-processed shard in the edge node and the shard placeholder table based on the target resource; A returning module is used to return the target slice and the target resource to the user.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to claim 7 when executing the program stored in the memory.

10. One or more computer readable media having instructions stored thereon which, when executed by one or more processors, cause the processors to perform the method of claim 7.

Citation Information

Patent Citations

  • Data request method, server and computer readable storage medium

    CN112055044A

  • Cache data management method and device, equipment and medium

    CN117742598A