CDN cache content refreshing methods, cache server, processing unit, computer-readable medium, and computer program product
By introducing a content refresh rule wall and processing units working together in the CDN, the latest copy is retrieved from the origin server when the URL is matched, which solves the problem of high resource consumption for CDN cached content refresh and improves system performance and efficiency.
Patent Information
- Application Number
- PCT/CN2025/099000
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-28
- Filing Date
- 2025-06-04
- Publication Date
- 2026-01-02
AI Technical Summary
The existing CDN cache content refresh consumes too many resources, leading to a decrease in system performance. In addition, the maintenance cost of the full information database is high, and the resource consumption is also large.
By having the cache server and processing unit work together, and using the content refresh rule wall for URL matching, the latest copy is only retrieved from the origin server when a match is successful, reducing the need for full scans and full database operations.
It effectively reduces the resource consumption of CDN cached content refresh, improves refresh efficiency and accuracy, and reduces the overall consumption of system resources.
Smart Images

Figure CN2025099000_02012026_PF_FP_ABST
Abstract
Description
CDN cache content refresh methods, cache servers, processing units, computer-readable media, computer program products
[0001] Cross-references to related applications
[0002] This application claims priority to Chinese Patent Application No. 202410867174.1, filed with the Chinese Patent Office on June 28, 2024, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to, but is not limited to, the field of Content Delivery Network (CDN) technology. Background Technology
[0004] Refreshing cached content on a Content Delivery Network (CDN) is a common CDN scenario.
[0005] With the development of technology, the resources consumed by refreshing CDN cached content are increasing, resulting in CDN resource shortages and a decline in the overall system performance. Summary of the Invention
[0006] This disclosure provides a method for refreshing CDN cached content, a cache server, a processing unit, a computer-readable medium, and a computer program product.
[0007] In a first aspect, embodiments of this disclosure provide a method for refreshing CDN cached content, based on a cache server, comprising: obtaining a target object and determining a content refresh rule wall based on the target object, wherein the target object is determined by a processing unit according to content refresh rules carried in a content refresh request; receiving a media content service request from a target terminal, wherein the media content service request includes a Uniform Resource Locator (URL) of media content; determining whether the URL matches the content refresh rule wall; and in response to a successful match between the URL and the content refresh rule wall, obtaining a latest copy of the media content from the origin server and sending the latest copy to the target terminal.
[0008] Secondly, embodiments of this disclosure provide a method for refreshing CDN cached content, based on a processing unit, comprising: receiving a content refresh request from a content provider, the content refresh request carrying content refresh rules; determining a target object according to the content refresh rules, the target object being used by the cache server to match a Uniform Resource Locator URL in a media content service request from a target terminal; and sending the target object to the cache server.
[0009] Thirdly, embodiments of this disclosure provide a cache server, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the CDN cache content refresh methods of embodiments of this disclosure.
[0010] Fourthly, embodiments of this disclosure provide a processing unit, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the CDN cache content refresh methods of embodiments of this disclosure.
[0011] Fifthly, embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the CDN cache content refresh methods of embodiments of this disclosure.
[0012] Sixthly, embodiments of this disclosure provide a computer program product, which includes a computer program that, when executed by a processor, implements any of the CDN cache content refresh methods of embodiments of this disclosure. Attached Figure Description
[0013] In the accompanying drawings of the embodiments disclosed herein:
[0014] Figure 1 is a flowchart of a method for refreshing CDN cached content on a cache server according to an embodiment of this disclosure;
[0015] Figure 2 is a flowchart of a method for refreshing CDN cache content of a processing unit according to an embodiment of this disclosure;
[0016] Figure 3 is a block diagram of a cache server provided in an embodiment of this disclosure;
[0017] Figure 4 is a block diagram of a processing unit provided in an embodiment of this disclosure;
[0018] Figure 5 is a block diagram of a computer-readable medium provided in an embodiment of this disclosure;
[0019] Figure 6 is a block diagram of the CDN system on which a CDN cache content refresh method provided in this embodiment of the present disclosure depends;
[0020] Figure 7 is an interactive flowchart of a CDN cache content refresh method provided in this embodiment of the present disclosure;
[0021] Figure 8 is an interactive flowchart of another CDN cache content refresh method provided in this embodiment of the present disclosure;
[0022] Figure 9 is a block diagram of the CDN system on which another CDN cache content refresh method provided in this embodiment of the present disclosure depends;
[0023] Figure 10 is an interactive flowchart of another CDN cache content refresh method provided in this embodiment of the present disclosure;
[0024] Figure 11 is an interactive flowchart of another CDN cache content refresh method provided in this embodiment of the present disclosure;
[0025] Figure 12 is an interactive flowchart of another CDN cache content refresh method provided in this embodiment of the present disclosure. Detailed Implementation
[0026] To enable those skilled in the art to better understand the technical solutions of this disclosure, the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.
[0027] The present disclosure will be described more fully below with reference to the accompanying drawings; however, the embodiments shown may be embodied in different forms, and the present disclosure should not be construed as limited to the embodiments set forth below. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will enable those skilled in the art to fully understand the scope of the disclosure.
[0028] The accompanying drawings of the embodiments disclosed herein are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the detailed embodiments to explain this disclosure and do not constitute a limitation thereof. The above and other features and advantages will become more apparent to those skilled in the art from the description of the detailed embodiments with reference to the accompanying drawings.
[0029] This disclosure may be described with reference to plan and / or cross-sectional views using the ideal schematic diagrams of this disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances.
[0030] Where there is no conflict, the various embodiments of this disclosure and the features thereof in the embodiments may be combined with each other.
[0031] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to limit the disclosure. The term "and / or" as used in this disclosure includes any and all combinations of one or more of the associated enumerated entries. The singular forms "a" and "the" as used in this disclosure are also intended to include the plural forms, unless the context clearly indicates otherwise. The terms "comprising," "made of," etc., as used in this disclosure specify the presence of the stated feature, integral, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof.
[0032] Unless otherwise specified, all terms used in this disclosure (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning, unless expressly so defined in this disclosure.
[0033] This disclosure is not limited to the embodiments shown in the accompanying drawings, but includes modifications to the configuration based on the manufacturing process. Therefore, the areas illustrated in the drawings are schematic, and the shapes of the areas shown illustrate specific shapes of the areas of an element, but are not intended to be limiting.
[0034] A Content Delivery Network (CDN) is a transmission network whose primary function is to deploy nodes at the network edge to distribute audio, video, text, and image content stored on the network to these edge nodes. Content copies stored in the CDN are considered content caches. When a user requests content services, the CDN's scheduling system directs the request to an edge node, where the content is downloaded directly, improving user response speed and reducing the bandwidth required from the backbone network. Currently, CDNs are widely used in e-commerce, food delivery, application stores, and mobile app services such as audio and video, becoming an essential part of internet infrastructure.
[0035] In addition to passive aging of cached content according to its caching time, there is another scenario for content refresh in CDN: content providers actively issue work orders. For content that meets certain rules, even if the content has not reached its timeout period and has already been updated on the origin server, it is necessary to delete this content on the edge nodes in advance so that when users request the response content later, the edge nodes can retrieve it from the origin server and provide users with the latest copy of the content. This is the content refresh process.
[0036] In some related technologies, after a content refresh ticket is issued, a full scan of the CDN nodes contracted by the content provider is performed, and content matching the rules is deleted. This approach requires significant storage read / write (IO) resources to execute the content refresh ticket.
[0037] In some related technologies, a full information database of cached content in the CDN is established, and a query index is built. After a content refresh work order is issued, the index of the full information database is traversed and retrieved. The content refresh rules are then fuzzily matched with the content URL to determine whether the content needs to be refreshed. If so, the distribution location of the cached content is found through the full information database, and the corresponding content is then deleted. This approach results in a large number of records in the full information database, high database maintenance costs, and significant resource consumption during matching.
[0038] It is evident that when content providers proactively issue work orders and delete the corresponding content on edge nodes in advance, it results in significant resource consumption. With technological advancements, the resources consumed by refreshing CDN cached content are increasing, leading to CDN resource strain and a decline in overall system performance.
[0039] In this embodiment, the target object is determined by the processing unit based on the content refresh rules carried in the content refresh request. The caching server can first obtain the target object and determine the content refresh rule wall based on the target object. After receiving the media content service request from the target terminal, it can determine whether there is a content refresh rule in the content refresh rule wall that matches the URL included in the media service request. If there is a content refresh rule in the content refresh rule wall that matches the URL, it obtains the latest copy of the media content from the origin server and sends the latest copy to the target terminal. Therefore, the caching server obtains the media content refresh status through the target object, thereby achieving the effect of caching content refresh without triggering content operations, effectively reducing the resources consumed by CDN caching content refresh.
[0040] As can be seen, in this embodiment of the disclosure, the content refresh rules can take effect quickly without requiring all cache servers in the CDN to perform a full disk scan or maintain a database of all content. The overall system resource consumption is relatively small. When a content refresh work order is received, the refresh rule base is built, and the refresh effect can be achieved, effectively reducing resource consumption.
[0041] In a first aspect, embodiments of this disclosure provide a method for refreshing CDN cached content, which is based on a cache server.
[0042] The method in this embodiment is performed by a cache server in a CDN, which can cooperate with a processing unit to refresh the CDN cached content.
[0043] In this embodiment, the cache server and the processing unit can communicate, such as through long-term evolution (LTE) systems, universal mobile telecommunication systems (UMTS), 5G New Radio (NR) systems and their evolved communication systems, or through wireless networks such as Wi-Fi. This application does not limit the communication method between the cache server and the processing unit.
[0044] In this embodiment of the disclosure, the cache server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0045] Referring to FIG1, the CDN cache content refresh method of this disclosure embodiment may include S101 to S104.
[0046] S101, obtain the target object, and refresh the rule wall based on the content determined by the target object.
[0047] The target object is determined by the processing unit based on the content refresh rules carried in the content refresh request.
[0048] S102, Receive media content service request from target terminal.
[0049] The media content service request includes the Uniform Resource Locator (URL) of the media content.
[0050] S103, determine whether the URL of the media content in the media service request matches the content refresh rule wall.
[0051] S104, in response to the successful match between the URL of the media content and the content refresh rule wall, retrieve the latest copy of the media content from the origin server and send the latest copy to the target terminal.
[0052] In this embodiment of the disclosure, the caching server can act as an edge node of a CDN. In a CDN, media content such as audio, video, text, and images stored at the origin server can be distributed to edge nodes and cached there. When a user requests media content, the terminal can quickly retrieve the media content from the edge nodes.
[0053] After a content provider refreshes (updates, modifies, or replaces) media content on the origin server, it can send a content refresh request to the processing unit. This content refresh request carries the content refresh rules. It should be understood that the content refresh request indicates that the content provider has refreshed the media content on the origin server, and the content refresh rules it carries can be used to characterize the URL features of the specific refreshed media content.
[0054] Therefore, after receiving a content refresh request, the processing unit can determine that the content provider has refreshed the media content on the origin server. Furthermore, it can determine the specific media content to be refreshed based on the content refresh rules it carries.
[0055] In this embodiment, the content refresh rule can be in the form of a regular expression, such as: ^http: / / video.xx.com / path1 / *. The target object is determined by the processing unit according to the content refresh rule carried in the content refresh request. The target object is a transmittable message format, which can be a file, or a message structure such as XML, JSON, or TXT.
[0056] It should be understood that if media content has been updated on the origin server, the cache server needs to obtain the latest version of that media content from the origin server. Therefore, after the processing unit determines the target object based on the content update rules carried in the content update request, it can send the target object to the cache server so that the cache server can determine whether the media content requested by the user has been updated on the origin server, i.e., whether it needs to obtain the corresponding latest copy from the origin server.
[0057] The caching server can obtain the target object from the processing unit and determine the content refresh rule wall based on the target object. In this embodiment, the content refresh rule wall is an efficient regular expression matching data structure, which is composed of the effective state machines of multiple content refresh rule expressions. It is a structure that includes matching factors of all content refresh rules that need to be matched, and can be used to quickly match URLs to determine whether the URL matches one or more content refresh rules that generate the content refresh rule wall, and thus determine whether the content needs to be refreshed.
[0058] In this embodiment of the disclosure, the target terminal can refer to a terminal that needs to acquire media content. The target terminal can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc.
[0059] The target terminal can send a media content service request to the caching server. This media content service request can be used to request media content, and the media content service request can include the URL of the media content.
[0060] Based on this, after receiving a media content service request from the target terminal, the caching server can determine whether the URL of the media content requested by the target terminal matches the content refresh rule wall.
[0061] If the URL of the media content requested by the target terminal matches the content refresh rule wall, it indicates that the URL matches one or more content refresh rules provided by the content provider, and the media content requested by the target terminal has been refreshed on the origin server. Therefore, in response to the URL of the media content requested by the target terminal matching the content refresh rule wall, the caching server retrieves the latest copy of the media content from the origin server and sends the latest copy to the target terminal.
[0062] It should be understood that there can be multiple cache servers in a CDN network. The target terminal can specify the cache server to which it sends media content service requests through the scheduling system. The scheduling system can allocate the corresponding cache server to the target terminal based on the performance indicators of each cache server. The specific allocation and scheduling process can be found in relevant technologies, which will not be described in detail here.
[0063] In this embodiment, the target object is determined by the processing unit based on the content refresh rules carried in the content refresh request. The caching server can first obtain the target object and determine the content refresh rule wall based on the target object. After receiving the media content service request from the target terminal, it can determine whether the URL included in the media service request matches the content refresh rule wall. If the URL matches the content refresh rule wall successfully, it obtains the latest copy of the media content from the origin server and sends the latest copy to the target terminal. Therefore, the caching server obtains the media content refresh status through the target object, thereby achieving the effect of caching content refresh without triggering content operations, effectively reducing the resources consumed by CDN caching content refresh.
[0064] In some embodiments, the target object of this disclosure can be obtained by format conversion from a rule base, which is constructed based on the content refresh rules carried in the content refresh request. Accordingly, the rule base constructed based on the content refresh rules carried in the content refresh request is format converted, and determining the content refresh rule wall based on the target object in S101 may include:
[0065] S1011, perform the corresponding reverse format conversion on the target object based on the rule base to obtain the content refresh rule wall.
[0066] As one embodiment of this disclosure, the processing unit can construct a rule base based on the content refresh rules carried in the refresh request, and convert the rule base into a target object. Since the target object is a transmittable message format, the processing unit can send the target object to the cache server. After receiving the target object, the cache server can perform a reverse format conversion on the target object to obtain the content refresh rule wall.
[0067] It should be understood that the reverse format conversion performed in the cache server corresponds to the format conversion performed in the processing unit; they are opposite conversion methods. For example, assuming the rule base and content refresh rule wall are regular expressions; if the target object is in XML format, the format conversion performed by the processing unit is from regular expression to XML format, and the reverse format conversion performed by the cache server is from XML format to regular expression; if the target object is in TXT format, the format conversion performed by the processing unit is from regular expression to TXT format, and the reverse format conversion performed by the cache server is from TXT format to regular expression. In this embodiment, the target object can be a transmittable message, and its specific format is not limited.
[0068] As one embodiment of this disclosure, by using format conversion in the processing unit and corresponding reverse format conversion in the cache server, both timely collection of content refresh rules and rapid transmission of content refresh rules in the CDN are achieved, which helps to improve the efficiency and accuracy of refresh.
[0069] In some embodiments, after determining whether the URL of the media content in the media service request matches the content refresh rule wall (S103), the method of this disclosure embodiment may further include S105 and S106.
[0070] S105, in response to a mismatch between the URL of the media content and the content refresh rule wall, check if a local cache copy of the media content exists in the local cache.
[0071] S106, corresponding to finding a copy of the local cache in the local cache, send the copy of the local cache to the target terminal.
[0072] As one embodiment of this disclosure, the target terminal requests media content from the cache server. If the URL of the media content does not match the content refresh rule wall, it indicates that the content provider has not refreshed the media content on the origin server, and the copies previously distributed by the origin server to each cache server are available. At this time, the cache server can check in its local cache whether a local cache copy of the media content exists.
[0073] If the caching server has a local cache copy of the media content in its local cache, the caching server can directly send the local cache copy to the target terminal, thereby enabling the target terminal to quickly obtain the required media content.
[0074] As one embodiment of this disclosure, if the target terminal does not refresh the media content on the source server, the caching server can directly send a local cached copy of the media content to the target terminal, thus ensuring the efficiency of the target terminal in obtaining the media content.
[0075] In some embodiments, after checking whether a local cache copy of the media content exists in the local cache (S106), the method of this disclosure embodiment may further include: S107, corresponding to the absence of a local cache copy in the local cache, obtaining the latest copy from the source station and sending the latest copy to the target terminal.
[0076] As one embodiment of this disclosure, if the caching server does not find a local cached copy of the media content in its local cache, it can obtain the latest copy of the media content from the origin server and send the obtained latest copy to the target terminal. This ensures that the target terminal can obtain the media content and reduces the impact of untimely or erroneous media content distribution.
[0077] In some embodiments, the target objects of this disclosure include full target objects obtained by format conversion from the full rule base and incremental target objects obtained by format conversion from the incremental rule base; the content refresh rule wall includes the full rule wall corresponding to the full rule base and the incremental rule wall corresponding to the incremental rule base.
[0078] As one embodiment of this disclosure, the target objects include full target objects and incremental target objects, and the content refresh wall includes full rule walls and incremental rule walls, with the full rule wall corresponding to the full target objects and the incremental rule wall corresponding to the incremental target objects.
[0079] As one embodiment of this disclosure, the rule base includes a full rule base and an incremental rule base. The full rule base corresponds to all valid content refresh rules of the processing unit at the current moment, while the incremental rule base corresponds to the content refresh rules added by the processing unit from the moment the full rule base was last constructed to the current moment. Full target objects are obtained by format conversion from the full rule base, and the full rule wall is obtained by corresponding reverse format conversion from the full target objects. Incremental target objects are obtained by format conversion from the incremental rule base, and the incremental rule wall is obtained by corresponding reverse format conversion from the incremental target objects.
[0080] It should be understood that the full rule base and the incremental rule base are constructed by the processing unit based on the content refresh rules carried in the content refresh request. The construction process will be explained later and will not be described in detail here.
[0081] When the content refresh rules include both a full rule wall and an incremental rule wall, the caching server can determine whether the media content's URL matches the full rule wall and whether it matches the incremental rule wall, respectively. If the media content's URL matches any one or more of the full and incremental rule walls, the caching server retrieves the latest copy of the media content from the origin server. If the media content's URL does not match either the full or incremental rule walls, the caching server checks its local cache for a local cache copy of the media content.
[0082] It should be understood that in this embodiment of the disclosure, there is no restriction on the matching order of the full rule wall and the incremental rule wall.
[0083] It should be understood that the caching server can also compare the generation time of the content refresh rule with the acquisition time of the local cache copy. If the content refresh rule is generated first and the local cache copy is acquired later, the local cache copy is sent to the target terminal. If the content refresh rule is generated later and the local cache copy is acquired first, the latest copy is retrieved from the origin server and sent to the target terminal.
[0084] It should be noted that after the cache server obtains the latest copy, it will store the latest copy in its local cache. At this point, the latest copy becomes the new local cache copy.
[0085] In some embodiments, after obtaining the latest copy of the media content from the source site (S104 or S107), the method of this disclosure embodiment may further include: S108, writing the latest copy to the tail of the disk queue of the cache server using an infinite loop disk writing method.
[0086] As one embodiment of this disclosure, after the caching server obtains the latest copy of the media content, it can use an infinite loop write method to write the latest copy to the end of the disk queue. In this way, the latest copy can be retained for a relatively long time until it reaches its aging time.
[0087] It should be understood that if the caching server previously stored a local cache copy of the media content, the caching server does not need to delete that local cache copy. Instead, it stores both the local cache copy and the latest copy in its local cache, with the latest copy stored at the end of the disk queue. In this way, as data is written, the local cache copy can be overwritten earlier, thus refreshing the media content without performing a deletion operation and saving resources.
[0088] In addition, although the storage space occupied by the local cache copy in the local cache is not released on the surface, the local cache copy is overwriteable, and the storage space it occupies is actually available, thus improving the utilization of storage space and saving storage resources.
[0089] In some embodiments, after obtaining the latest copy of the media content from the source site (S104 or S107), the method of this disclosure embodiment may further include: S109, setting the same aging time for the latest copy of the media content and the local cache copy, so as to delete the latest copy of the media content and the local cache copy simultaneously after the aging time is reached.
[0090] As one embodiment of this disclosure, the cache server obtains the latest copy of the media content, but there is also a local cache copy. In this case, the cache server may not perform a deletion operation, but instead store both in the cache. However, the same aging time can be set for both, and both can be deleted at the same time after the aging time is reached. This way, when the latest copy has a problem or the user needs to use the old copy (i.e. the previous local cache copy), the old copy can be provided quickly, thereby improving fault tolerance.
[0091] It should be understood that when storing both the latest copy and the local cache copy, identifiers (such as numbers or names) can be set for each to distinguish between the two versions of the copy, thereby using different storage spaces in the local cache of the cache server to store the two versions of the copy respectively.
[0092] Secondly, embodiments of this disclosure provide a method for refreshing CDN cached content, which is based on a processing unit.
[0093] The method of this disclosure is performed by a processing unit in a network device (such as a server), which can cooperate with a cache server in a CDN to refresh the CDN cached content.
[0094] In this embodiment, the processing unit may be a unit in a network device used for main data processing, such as a CPU, which will not be described in detail here.
[0095] Referring to FIG2, the CDN cache content refresh method of this disclosure embodiment may include S201 to S203.
[0096] S201, Receive a content refresh request from the content provider, which carries the content refresh rules.
[0097] S202, determine the target object based on the content refresh rules.
[0098] The target object is used by the cache server to match the URL in the media content service request from the target terminal.
[0099] S203, send the target object to the cache server.
[0100] In this embodiment of the disclosure, the processing unit receives a content refresh request from a content provider. The content refresh request indicates that the content provider has refreshed (updated, modified, or replaced) the media content on the origin site. The content refresh request carries a content refresh rule, which can be used to represent the URL of the media content refreshed by the content provider on the origin site.
[0101] Therefore, the processing unit can obtain the content refresh rules from the content refresh request and determine which media content in the source site the content provider has refreshed based on the content refresh rules.
[0102] In this embodiment of the present disclosure, the processing unit can determine the target object based on the content refresh rules carried in the content refresh request, and send the target object to the cache server. After receiving the target object, the cache server can determine whether the media content requested by the target terminal has been refreshed on the origin server based on the target object. This process can be referred to S101 to S104, and will not be described in detail here.
[0103] The target object is a transmittable message format. After the processing unit establishes a communication connection with the cache server, it can send the target object to the cache server. For example, the target object can be a file, or a message structure such as XML, JSON, or TXT.
[0104] In this embodiment of the disclosure, after receiving a content refresh request from a content provider, the processing unit constructs a rule base according to the content refresh rules carried in the content refresh request, then serializes the rule base into a target object for content refresh, and finally sends the target object to the cache server, so that the cache server can obtain the content refresh status. Thus, without triggering the content deletion operation of the cache server, the effect of refreshing the cached content of the cache server is achieved, which effectively reduces the resources consumed by CDN cached content refresh.
[0105] In some embodiments, determining the target object according to the content refresh rules (S202) may include: S2021, constructing a rule base according to the content refresh rules; S2022, converting the rule base to a new format to obtain the target object.
[0106] As one embodiment of this disclosure, the processing unit can construct a rule base according to the content refresh rules, and serialize the rule base into a target object, so as to transmit the content refresh rules to the cache server through the target object.
[0107] The processing unit can obtain one or more refresh rules from the content refresh request. The processing unit can use multi-modal compilation technologies, such as Hyperscan and Onigruruma, to merge multiple content refresh rules to obtain a rule library. Alternatively, the processing unit can choose other regular expression merging mechanisms to merge multiple content refresh rules to obtain a rule library. In this embodiment, multiple content refresh rules are given to the processing unit and distributed to the cache server. The specific method of merging the rule library and the method of format conversion for the rule library are not described in detail here.
[0108] In some embodiments, the rule base in this disclosure may include a full rule base and an incremental rule base. The full rule base corresponds to all content refresh rules that are currently valid, while the incremental rule base corresponds to all newly added content refresh rules from the time the full rule base was last built until the current time.
[0109] As one embodiment of this disclosure, the rule base is divided into two types: a full rule base and an incremental rule base. The full rule base corresponds to all valid content refresh rules in the processing unit at the current moment, and is formed by merging these content refresh rules. The incremental rule base corresponds to the content refresh rules added to the processing unit from the moment the full rule base was last constructed to the current moment, and is formed by merging these content refresh rules.
[0110] It should be understood that the full rule base is one and is built periodically (the period is a preset time interval, which can be set as needed, such as once a week). The incremental rule base can be one or more, and the processing unit can build an incremental rule base each time it receives a content refresh request. Within the preset time interval, the number of content refresh requests received by the processing unit is consistent with the number of incremental rule bases built.
[0111] In some embodiments, constructing a rule base based on content refresh rules (S2021) may include: S2021, in response to the time interval between the current time and the last time the full rule base was constructed reaching a preset time interval, constructing a full rule base based on all valid content refresh rules at the current time; S2022, in response to receiving a content refresh request, constructing an incremental rule base corresponding to the time between the current time and the last time the full rule base was constructed based on the content refresh rules carried in the content refresh request.
[0112] As one embodiment of this disclosure, the processing unit can construct a full rule base every preset time interval based on all currently valid content refresh rules. The preset time interval can be set as needed, for example, it can be set to one week or one month. It should be understood that the full rule base involves a large number of content refresh rules, and constructing a full rule base consumes a lot of time and resources.
[0113] As one embodiment of this disclosure, the processing unit can build an incremental rule base each time it receives a content refresh request. This improves efficiency and allows for timely synchronization of source site refresh information to the cache processor.
[0114] It should be understood that the processing unit can distribute the full rule base to each cache server after each full rule base is built. This is because the full rule base is built periodically, and is also periodically synchronized to the cache servers.
[0115] It should be understood that the processing unit can distribute the incremental rule base to each cache server immediately after each incremental rule base is built. The processing unit can also distribute the incremental rule base built during the period to each cache server at the end of the period. Furthermore, the processing unit can distribute the newly built (undistributed) incremental rule base to each cache server when the number of newly built (undistributed) incremental rule bases reaches a preset value. The above is merely an exemplary description of synchronizing incremental rule bases and is not intended to limit the embodiments of this disclosure. Other synchronization methods can be performed as needed in the embodiments of this disclosure, which will not be described in detail here.
[0116] Thirdly, referring to FIG3, an embodiment of the present disclosure provides a cache server, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the CDN cache content refresh methods of the present disclosure embodiments.
[0117] Fourthly, referring to FIG4, an embodiment of the present disclosure provides a processing unit, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the CDN cache content refresh methods of the present disclosure embodiments.
[0118] Fifthly, referring to FIG5, embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements any of the methods for refreshing CDN cached content according to embodiments of the present disclosure.
[0119] Sixthly, embodiments of this disclosure provide a computer program product, which includes a computer program that, when executed by a processor, implements any of the CDN cache content refresh methods of embodiments of this disclosure.
[0120] Among them, the processor is a device with data processing capabilities, including but not limited to the central processing unit (CPU); the memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to the data bus (Bus).
[0121] It should be understood that the CDN cache content refresh method, cache server, processing unit, computer-readable medium, and computer program product provided in the embodiments of this disclosure can be applied to CDN business-to-business (B2B) on-demand, B2B live streaming, over-the-top (OTT) video, and IP-based television (IPTV) products.
[0122] Example 1
[0123] The following is an exemplary description of a method for refreshing CDN cached content according to an embodiment of this disclosure.
[0124] The method provided in this disclosure can be applied to a CDN system. Referring to FIG6, the CDN system provided in this disclosure may include a processing unit, a cache server, a scheduling system, a target terminal, an origin server, and a content provider.
[0125] The processing unit is configured to receive content refresh rules sent by the content provider, build a rule library based on the content refresh rules, perform format conversion on the rule library to obtain a transmittable target object, and synchronize the target object to all cache servers.
[0126] In one possible implementation, the processing unit is configured to receive a content refresh request sent by the content provider and obtain the content refresh rules from the content refresh request.
[0127] In one possible implementation, the processor can build the rule base based on the content refresh rules by choosing existing multi-model compilation technologies such as Hyperscan and Onigruruma.
[0128] In one possible implementation, the rule base can be formatted into a transmittable target object, where the format conversion can be serialization, and the target object can be a file or a message structure such as XML, JSON, or TXT.
[0129] In one possible implementation, the processing unit constructs content refresh rules into a full rule base and an incremental rule base: the full rule base contains all active content refresh rules in the current system and is constructed periodically; the incremental rule base is constructed each time a content refresh request is received, starting from the moment the full rule base was last constructed. There can be one or more incremental rule bases; any rule base constructed between the moment the full rule base was last constructed and the current moment can be considered an incremental rule base.
[0130] Cache servers: one or more, configured to receive media content service (such as playback or download) requests from target terminals, obtain (i.e. download from the origin server) the latest copy of the media content from the origin server, and send the latest copy to the target terminal, thereby providing media content services to the target terminal.
[0131] The caching server has storage capabilities and can also cache the latest copies of the acquired content locally, providing playback or download services for the latest copies of the media content to subsequent target terminals.
[0132] In this embodiment, the caching server needs to obtain the target object from the processing unit and then quickly perform reverse format conversion (such as deserialization) in its local memory to obtain the content refresh rule wall. When providing media content services to the target terminal, the caching server quickly matches the URL requested by the target terminal with the content refresh rule wall in its local memory.
[0133] It should be understood that for media content service requests whose URLs match the content refresh rule wall, the latest copy is directly obtained from the origin server and sent to the target terminal without needing to determine whether a local cached copy of the media content exists locally; for media content service requests whose URLs do not match the content refresh rule wall, it is determined whether an old copy of the content (i.e., a local cached copy) exists in the local cache, and if so, the old copy is sent to the target terminal first.
[0134] In one possible implementation, the content refresh rule wall is an efficient regular expression matching data structure, which is composed of multiple content refresh rule expressions in an effective state machine. It is compiled and merged through multi-mode compilation and can be used to quickly match the URL of media content service request to determine whether the URL matches one or more content refresh rules provided by the content provider.
[0135] In one possible implementation, the content refresh rule wall can be configured with a full rule wall and an incremental rule wall: the full rule wall is deserialized from the full rule library synchronized from the processing unit; the incremental rule wall is deserialized from the incremental rule library synchronized from the processing unit.
[0136] In one possible implementation, there are two strategies for handling old copies that have been refreshed in the cache server:
[0137] Strategy 1: Older replica data blocks are not deleted. The cache server uses an infinite loop disk writing method, writing the latest replica data blocks to the end of the disk queue until the older replica data blocks are automatically overwritten.
[0138] Strategy 2 assigns a number to each copy. After the media content is refreshed, the cache server re-downloads the latest copy from the source and stores it alongside the old copy until the aging time is reached, at which point both the new and old copies are deleted.
[0139] Target terminal: The end user of the origin server, configured to send media content service requests to the origin server or cache server.
[0140] Origin site: This is the content origin site, configured to store media content and provide caching servers with services for downloading and playing media content from the origin. The media content stored in the content origin site will be updated from time to time according to the requirements of the content provider.
[0141] Content Provider: The operator of the content origin site, responsible for producing and storing media content on the content origin site; the content provider will update the media content on the content origin site according to its own needs, and send content refresh requests to the CDN processing unit, submitting the content refresh rules (such as regular expressions) to the CDN processing unit.
[0142] The scheduling system is the global access point for CDN target terminal services. It collects performance metrics of all cache servers, receives media content download or playback redirection requests sent by the target terminal, selects a suitable cache server, and schedules the target terminal's services to the corresponding cache server.
[0143] The method disclosed in this embodiment is applicable to all CDN systems, including self-built CDNs by apps, CDNs provided by telecom operators, and CDNs provided by internet operators. The CDN system employing this invention can support all current broadband internet, mobile internet, and IoT applications, such as music apps, video apps, short video apps, online audiobook software, app stores, and e-book apps.
[0144] Referring to FIG7, an exemplary method for refreshing CDN cached content according to an embodiment of the present disclosure may include the following steps 701 to 705.
[0145] 701, Content Provider replaces media content on the origin site.
[0146] 702, The content provider sends a content refresh request to the processing unit, which carries the content refresh rules.
[0147] 703, the processing unit collects content refresh requests, and uses multi-mode compilation technology to build a rule base for all content refresh rules of the content refresh requests, and serializes the rule base into a transmittable target object.
[0148] In one possible implementation, the rule base is constructed using multi-model compilation technology. The target object after serialization of the rule base can be a file or a message structure such as XML, JSON, or TXT.
[0149] In one possible implementation, the processing unit constructs a full rule base and an enhanced rule base based on the content refresh rules: the full rule base contains all active content refresh rules in the current system and is compiled once every certain period of time; the incremental rule base is the cumulative number of newly added content refresh rules from the last time the full rule base was built until the current system time, and each newly added content refresh rule is compiled once every time.
[0150] 704, the processing unit will synchronously distribute the target object to all cache servers.
[0151] In one possible implementation, target object synchronization can be achieved through file transfer, Hypertext Transfer Protocol Secure (HTTPS) messaging, etc.
[0152] In one possible implementation, the processing unit synchronizes the full target objects corresponding to the full rule base and the incremental target objects corresponding to the incremental rule base to all cache servers respectively.
[0153] 705. After receiving the target object from the processing unit, the cache server loads it into memory and deserializes it into a content refresh rule wall.
[0154] In one possible implementation, the caching service receives the rule base synchronized by the processing unit as separate full target objects and incremental target objects, which are deserialized into full content refresh rule walls and incremental content refresh rule walls in memory, respectively.
[0155] The content refresh rule wall was built using cache servers 701 to 705.
[0156] Referring to Figure 8, an exemplary method for refreshing CDN cached content according to an embodiment of this disclosure may include the following steps 801 to 808.
[0157] 801, The target terminal sends a content service redirection request to the scheduling system.
[0158] 802, the scheduling system returns the service address of the cache server to the target terminal.
[0159] 803 indicates that the target terminal sends a media content service request to the cache server corresponding to the service address, and the request carries the URL of the media content.
[0160] 804: When the cache server receives the URL requested by the target terminal, it quickly matches the URL with the content refresh rule wall in memory. For media content service requests where the URL matches successfully, it executes steps 805 to 807; for media content service requests where the URL does not match successfully, it executes step 808.
[0161] A successful URL match means that the URL matches the content refresh rules. An unsuccessful URL match means that the URL does not match the content refresh rules.
[0162] 805 indicates that the cache server does not check whether a local cached copy of the media content exists in its local cache, but directly requests the latest copy of the media content requested by the target terminal from the origin server.
[0163] 806 indicates that the origin server sends the latest copy of the media content requested by the target terminal to the cache server.
[0164] 807, the cache server sends the latest copy of the media content to the target terminal.
[0165] 808 indicates that the cache server reads a local cached copy of the media content requested by the target terminal and sends the local cached copy to the target terminal.
[0166] Example 2
[0167] The following is an exemplary description of a CDN cache content refresh method according to an embodiment of this disclosure. The method provided in this embodiment can be applied to a CDN system. Referring to FIG9, the CDN system provided in this embodiment may include a video website, a content provider, a CDN management system, a CDN scheduling system, cache server A, cache server B, and a user's mobile phone. It should be understood that the CDN system may also include other electronic devices, which will not be described in detail here.
[0168] The video website, also known as the source site in this embodiment, is configured to provide media content services, such as HTTP / HLS video playback services, and its domain name is video.xx.com.
[0169] The content provider (CP) is responsible for operating the video.xx.com website.
[0170] A CDN management system configured to handle content refresh requests from content providers includes a processing unit according to embodiments of this disclosure.
[0171] The CDN scheduling system, also known as the terminal scheduling system, is configured to provide Domain Name System (DNS) domain name scheduling functionality.
[0172] Cache server A: Its service address is 192.168.0.1:80;
[0173] Cache server B: Its service address is 192.168.0.2:80;
[0174] The user's mobile phone, i.e. the target terminal of this embodiment, has a video app installed and is capable of accessing the video website vieo.xx.com and playing and downloading videos.
[0175] For the CDN system shown in Figure 9:
[0176] The content provider has already published two media content items on the video website: vod1, with the source path being / path1 / vod1.mp4; and vod2, with the source path being / path2 / vod2.mp4.
[0177] A local cache copy of vod1 has already been cached in cache server A.
[0178] A local cache copy of vod2 has already been cached on cache server B.
[0179] The content provider has submitted 10 content refresh work orders to the CDN management system. The CDN management system has aggregated the rules in all the content refresh work orders into a rule list, list1.
[0180] In this context, the content refresh work order represents a content refresh request in this embodiment of the disclosure.
[0181] Based on the CDN system shown in FIG9 and referring to FIG10, an exemplary method for refreshing CDN cached content according to an embodiment of the present disclosure may include the following steps 1001 to 1007.
[0182] 1001, Content providers update media content vod1 on video websites;
[0183] 1002, The content provider sends a content refresh work order related to vod1 to the CDN management system.
[0184] It carries the content refresh rule rule1, whose expression is ^http: / / video.xx.com / path1 / *.
[0185] 1003. The CDN management system adds the content refresh rule rule1 to the existing content refresh rule list list1, compiles it into a rule library using Hyperscan, and serializes it into a file rules.db.
[0186] The file rules.db is the target object.
[0187] 1004, The CDN management system passes the file rules.db to cache server A.
[0188] 1005, Cache service A deserializes the file rules.db into content refresh rule wall A.
[0189] 1006, The CDN management system passes the file rules.db to cache server B.
[0190] 1007, Cache service B deserializes the file rules.db into content refresh rule wall B.
[0191] The steps 1001 to 1007 above implement the process of the cache server retrieving content and refreshing the rule wall.
[0192] The process of refreshing the application content refresh rule wall in cache server A is described below. Referring to FIG11, an exemplary CDN cache content refresh method according to an embodiment of this disclosure may include the following steps 1101 to 1107.
[0193] 1101, The user's mobile phone sends a service redirection request for vod1 to the CDN scheduling system.
[0194] 1102, The CDN scheduling system returned the address of cache server A as 192.168.0.1:80.
[0195] At 11:03, the user's mobile phone sends a media playback request for vod1 to the cache server A.
[0196] The URL is http: / / video.xx.com / path1 / vod1.mp4.
[0197] 1104, caching server A matches the playback request URL with the content refresh rule wall A. If the match is successful, it is considered that vod1 has been refreshed.
[0198] At 11:05, cache server A requests the video website to download the latest copy of vod1.
[0199] At 11:06, the video website returned the latest copy of vod1 to cache server A.
[0200] At 11:07, cache server A sends the latest copy of vod1 to the user's mobile phone.
[0201] The following describes the process of refreshing the content refresh rule wall in cache server B. Referring to Figure 12, an exemplary CDN cache content refresh method according to an embodiment of this disclosure may include the following steps 1201 to 1205.
[0202] 1201, The user's mobile phone sends a vod2 redirection request to the CDN scheduling system.
[0203] 1202, The CDN scheduling system returned the address of cache server B as 192.168.0.2:80.
[0204] 1203, The user's mobile phone sends a media playback request for vod2 to the cache server B.
[0205] The URL is http: / / video.xx.com / path2 / vod2.mp4.
[0206] 1204. Cache server B matches the playback request URL with the content refresh rule wall B. If the match fails, it is assumed that vod2 has not been refreshed.
[0207] At 12:05, cache server B sends a local cached copy of vod2 to the user's mobile phone.
[0208] Those skilled in the art will understand that all or some of the steps, systems, and devices disclosed above, as functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0209] In hardware implementations, the division between functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.
[0210] Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer. Furthermore, as is known to those skilled in the art, communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0211] This disclosure has disclosed exemplary embodiments, and although specific terminology has been used, it is for general illustrative purposes only and should not be construed as limiting. In some instances, it will be apparent to those skilled in the art that features, characteristics, and / or elements described in conjunction with particular embodiments may be used alone, or in combination with features, characteristics, and / or elements described in conjunction with other embodiments, unless otherwise expressly indicated. Therefore, those skilled in the art will understand that various changes in form and detail may be made without departing from the scope of this disclosure as set forth by the appended claims.
Claims
1. A method for refreshing cached content in a Content Delivery Network (CDN), based on a cache server, comprising: Obtain the target object and determine the content refresh rule wall based on the target object. The target object is determined by the processing unit according to the content refresh rules carried in the content refresh request. Receive a media content service request from a target terminal, wherein the media content service request includes a Uniform Resource Locator (URL) for the media content; Determine whether the URL matches the content refresh rule wall; In response to a successful match between the URL and the content refresh rule wall, the latest copy of the media content is retrieved from the origin server and sent to the target terminal.
2. The method according to claim 1, wherein, The target object is obtained by format conversion from a rule base, which is constructed based on the content refresh rules carried in the content refresh request. The step of determining the content refresh rule wall based on the target object includes: The target object is then subjected to a corresponding reverse format conversion based on the format conversion to obtain the content refresh rule wall.
3. The method according to claim 1, wherein, After determining whether the URL matches the content refresh rule wall, the method further includes: In response to the URL not matching the content refresh rule wall, check if a local cache copy of the media content exists in the local cache; Corresponding to the finding of the local cache copy in the local cache, the local cache copy is sent to the target terminal.
4. The method according to claim 3, wherein, After checking whether a local cache copy of the media content exists in the local cache, the method further includes: If no copy of the local cache is found in the local cache, the latest copy is obtained from the source server and sent to the target terminal.
5. The method according to any one of claims 1 to 4, wherein, The target objects include full target objects obtained by format conversion from the full rule base and incremental target objects obtained by format conversion from the incremental rule base. The full rule base corresponds to all content refresh rules that are currently valid in the processing unit. The incremental rule base corresponds to the content refresh rules added by the processing unit from the last time the full rule base was built to the current time. The content refresh rule wall includes the full rule wall corresponding to the full target objects and the incremental rule wall corresponding to the incremental target objects.
6. The method according to any one of claims 1 to 4, wherein, After obtaining the latest copy of the media content from the origin server, the process further includes: The latest copy is written to the end of the disk queue of the cache server using an infinite loop write method.
7. The method according to any one of claims 1 to 4, wherein, After obtaining the latest copy of the media content from the origin server, the process further includes: Set the same aging time for the latest copy and the local cache copy of the media content, so that both the latest copy and the local cache copy of the media content are deleted simultaneously after the aging time is reached.
8. A method for refreshing CDN cached content, based on a processing unit, comprising: Receive a content refresh request from a content provider, the content refresh request carrying content refresh rules; The target object is determined according to the content refresh rules. The target object is used by the cache server to match the Uniform Resource Locator URL in the media content service request from the target terminal. The target object is sent to the cache server.
9. The method according to claim 8, wherein, Determining the target object according to the content refresh rules includes: A rule base is constructed based on the content refresh rules described above; The rule base is converted to obtain the target object, which is a transmittable message format.
10. The method according to claim 9, wherein, The rule base includes a full rule base and an incremental rule base. The full rule base corresponds to all content refresh rules that are currently valid, and the incremental rule base corresponds to the new content refresh rules added from the time the full rule base was last built until the current time.
11. The method according to claim 10, wherein, The step of constructing a rule base based on the content refresh rules includes: In response to the time interval between the current time and the last time the full rule base was built reaching a preset time interval, the rules are refreshed based on all valid content at the current time, and the full rule base is built. In response to receiving the content refresh request, an incremental rule base corresponding to the time between the current moment and the last time the full rule base was built is constructed based on the content refresh rules carried in the content refresh request.
12. A cache server, comprising a memory and a processor; the memory storing a computer program executable by the processor, wherein the computer program, when executed by the processor, implements the CDN cache content refresh method according to any one of claims 1 to 7.
13. A processing unit comprising a memory and a processor; the memory storing a computer program executable by the processor, wherein the computer program, when executed by the processor, implements the CDN cache content refresh method according to any one of claims 8 to 11.
14. A computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the CDN cache content refresh method according to any one of claims 1 to 7, or the CDN cache content refresh method according to any one of claims 8 to 11.
15. A computer program product comprising a computer program that, when executed by a processor, implements the CDN cache content refresh method according to any one of claims 1 to 7, or the CDN cache content refresh method according to any one of claims 8 to 11.
Citation Information
Patent Citations
Update method and device of caching data
CN105868234A
Cache data updating method and device
CN105868251A
Cache directory refreshing method and device
CN106202112A
Back-to-source method in content delivery network and related device
CN112513830A
Method and device for refreshing cache data, electronic equipment and storage medium
CN113271359A