Method, system, device and equipment for refreshing cache resources

By introducing management components and refresh components into the cache device, establishing long connections and batch processing of refresh tasks, the problem of high pressure and high failure rate of regional content management nodes during CDN network resource refresh is solved, and more efficient and stable resource refresh is achieved.

CN113221038BActive Publication Date: 2025-03-11HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010072575.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-01-21
Publication Date
2025-03-11
Estimated Expiration
2040-01-21

AI Technical Summary

Technical Problem

When the CDN network resource is refreshed, the regional content management nodes in each cache node cluster have high refresh pressure and high failure rate.

Method used

By introducing management components and refresh components into the cache device and establishing a long connection, the management components receive multiple refresh tasks sent by the regional content management node and sending them to the refresh component in batches for execution.

Benefits of technology

Reduces the request frequency of the regional content management node and the connection establishment frequency of the cache device, reduces the load pressure, and improves refresh efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113221038B_ABST
    Figure CN113221038B_ABST
Patent Text Reader

Abstract

The present application provides a method for refreshing cache resources, which is applied to a cache device. The cache device includes a management component and a refresh component. A long connection is established between the management component and the refresh component. The method includes: the management component receives multiple refresh tasks sent by a regional content management node; the management component sends the multiple refresh tasks in batches to the refresh component through the long connection; and the refresh component executes the multiple refresh tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the computer field, and in particular to a method, system, device and equipment for refreshing cache resources. Background Art

[0002] Content Delivery Network (CDN) is a computer network system interconnected through the Internet. The system uses a cluster of cache nodes closest to each user to cache resources such as music, pictures, movies, applications, etc. that the user may need, so that when the user needs the resource, the resource can be sent to the user faster and more reliably.

[0003] Generally speaking, a CDN network includes multiple cache node clusters for storing cache resources. Each cache node cluster includes a regional content management node and a cache device. The cache device is used to store cache resources, and the regional content management node is used to manage the cache device. When the CDN network needs to refresh the resources in the cache node cluster, the regional content management node of each cache node cluster will send the refresh task to each cache device under its management one by one. For example, assuming that a cache node cluster includes 100 cache devices and there are currently 100 million cache resources that need to be refreshed, then the regional content management node of the cache node cluster will send 100×100 million=10 billion requests. The frequent sending of requests will occupy a large amount of computing resources, causing great pressure on the regional content management nodes, resulting in a high failure rate of the regional content management nodes. Summary of the invention

[0004] The present application provides a method, system, device and equipment for refreshing cache resources, which can solve the problem of high refresh pressure and high failure rate of regional content management nodes in each cache node cluster when refreshing CDN network resources.

[0005] In a first aspect, a method for refreshing cache resources is provided, which is applied to a cache device, wherein the cache device includes a management component and a refresh component, and a long connection is established between the management component and the refresh component. The method includes:

[0006] The management component receives a plurality of refresh tasks sent by the regional content management node;

[0007] The management component sends the multiple refresh tasks in batches to the refresh component through the long connection;

[0008] The refresh component executes the plurality of refresh tasks.

[0009] It can be understood that a persistent connection refers to a connection state in which multiple data packets can be sent continuously. During the period when the persistent connection is maintained, if no data packet is sent, both parties need to send a link detection packet, which is mostly used for frequent operations and point-to-point communications. In the embodiment of the present application, the management component of the cache device receives multiple refresh tasks, which are tasks that the refresh component needs to perform. The management component must send them to the refresh component one by one, which just meets the requirements of frequent long connection operations and point-to-point communications, so that the regional content management node no longer needs to send requests frequently, and the cache device does not need to establish connections frequently. The load of the regional content management node and the cache device is balanced, the refresh pressure is greatly reduced, and the refresh efficiency is greatly improved, thereby solving the problem of high refresh pressure and high failure rate of the regional content management node of each cache node cluster when the CDN network resources are refreshed.

[0010] In a possible implementation manner of the first aspect, the management component receives multiple refresh tasks sent by the regional content management node, including: the management component sequentially receives multiple refresh task groups sent by the regional content management node, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold, and the threshold is determined by the regional content management node according to the refresh task processing capability of the cache device; the management component sends the multiple refresh tasks to the refresh component in batches through a long connection, including: the management component sequentially disassembles each of the multiple refresh task groups to obtain multiple refresh tasks; and the management component sends the multiple refresh tasks one by one to the refresh component through the long connection.

[0011] It can be understood that after receiving multiple refresh tasks sent by the regional content management node, the management component of the cache device will divide the multiple refresh tasks into multiple refresh task groups according to the refresh task processing capability of the cache device, and send the multiple refresh tasks in groups. Each time the management component of the cache device receives a refresh task group, it can decompose it into individual refresh tasks and send them to the refresh component in sequence through a long connection, thereby avoiding the need for the cache device to reserve a large amount of storage resources for storing refresh tasks waiting to be executed, thereby improving the refresh efficiency of the cache device.

[0012] In a possible implementation manner of the first aspect, when a management component of the cache device fails, the method further includes: a refresh component receiving a plurality of refresh tasks sent by a regional content management node; and the refresh component executing the plurality of refresh tasks.

[0013] It can be understood that when the management component of the cache device fails, the regional content management node can communicate directly with the refresh component, thereby ensuring the normal refresh function, avoiding the problem of refresh failure after the management component of the cache device fails, and thus improving the stability of the cache node cluster refresh.

[0014] In a second aspect, a cache resource refresh system is provided, the cache resource refresh system comprising a cache node cluster and a global management center, the cache node cluster is connected to the global management center, the cache node cluster comprises a regional content management node and a cache device, the cache device comprises a management component and a refresh component, a long connection is established between the management component and the refresh component, wherein:

[0015] The global management center is used to send multiple refresh tasks to the regional content management nodes of the cache node cluster;

[0016] The regional content management node of the cache node cluster is used to send the multiple refresh tasks to the cache devices of the cache node cluster;

[0017] The cache device of the cache node cluster is used to call the management component and send the multiple refresh tasks in batches to the refresh component through the long connection;

[0018] The cache device of the cache node cluster is used to call the refresh component to execute the multiple refresh tasks.

[0019] In a possible implementation of the second aspect, the regional content management node of the cache node cluster is used to divide the multiple refresh tasks into multiple refresh task groups according to the refresh task processing capability of the cache device, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold; the regional content management node of the cache node cluster is used to send the multiple refresh task groups to the cache devices of the cache node cluster in sequence; the cache devices of the cache node cluster are used to call the management component to disassemble each of the multiple refresh task groups in sequence to obtain multiple refresh tasks; the cache devices of the cache node cluster are used to call the management component to send the multiple refresh tasks one by one to the refresh component through the long connection.

[0020] In a possible implementation of the second aspect, the multiple refresh tasks are determined by the global management center after sorting multiple refresh requests according to priorities, and the multiple refresh requests include refresh requests sent by users and refresh requests sent by source stations.

[0021] In a possible implementation manner of the second aspect, the regional content management node of the cache node cluster is further used to send the multiple refresh tasks to the refresh component of the cache device when the management component of the cache device fails; the refresh component of the cache device executes the multiple refresh tasks.

[0022] In a third aspect, a cache device is provided, the cache device comprising a management component and a refresh component, a long connection is established between the management component and the refresh component, wherein:

[0023] The management component is used to receive multiple refresh tasks sent by the regional content management node;

[0024] The management component is used to send the multiple refresh tasks in batches to the refresh component through the long connection;

[0025] The refresh component is used to execute the multiple refresh tasks.

[0026] In a possible implementation manner of the third aspect, the management component is used to sequentially receive multiple refresh task groups sent by the regional content management node, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold, and the threshold is determined by the regional content management node according to the refresh task processing capability of the cache device; the management component is used to batch send the multiple refresh tasks to the refresh component through the long connection, including: the management component is used to disassemble each of the multiple refresh task groups in turn to obtain multiple refresh tasks; the management component is used to send the multiple refresh tasks one by one to the refresh component through the long connection.

[0027] In a possible implementation manner of the third aspect, the refresh component is used to receive a plurality of refresh tasks sent by the regional content management node when the management component of the cache device fails; and the refresh component is used to execute the plurality of refresh tasks.

[0028] In a fourth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on a computing device, enable the computing device to implement the method described in the first aspect.

[0029] According to a fifth aspect, a computer program product is provided, comprising a computer program. When the computer program is read and executed by a computing device, the computing device performs the method described in the first aspect.

[0030] In a sixth aspect, an electronic device is provided, comprising a processor and a memory, wherein the processor executes a code in the memory to implement the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.

[0032] Figure 1 It is a structural diagram of a CDN system involved in this application;

[0033] Figure 2 It is a structural diagram of a cache resource refresh system in the related art;

[0034] Figure 3 This is a flow chart of a cache resource refresh method in a related technology under an application scenario;

[0035] Figure 4 It is a structural diagram of a cache resource refresh system provided by this application;

[0036] Figure 5 This is a flow chart of a cache resource refresh method provided by this application;

[0037] Figure 6 It is a flow chart of a cache resource refresh method in an application scenario provided by the present application;

[0038] Figure 7 It is a flowchart of a cache resource refresh method in another application scenario provided by the present application;

[0039] Figure 8 It is a structural schematic diagram of a cache device provided by the present application;

[0040] Fig. 9 It is a structural schematic diagram of an electronic device provided by this application. DETAILED DESCRIPTION

[0041] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0042] First, the system architecture of the CDN involved in this application is described.

[0043] See also Figure 1 , Figure 1 1 is a schematic diagram of the structure of a content delivery network (CDN) involved in the present application. The CDN system includes an origin station 100, a CDN network 200, and a terminal device 300. The CDN network includes a plurality of cache node clusters 210, and the cache node clusters 210 can be divided into a central cache node cluster 201 and an edge cache node cluster 202.

[0044] The terminal device 300 is usually a user's personal device, which is used by the user to access the content data of the source station 110. For example, the terminal device can be a smart phone, a tablet computer, a desktop computer, a vehicle-mounted device, a wearable device, etc., which are not specifically limited here.

[0045] The source station 100 is usually set up in a data center far away from the terminal device 300, and is used to store a large amount of content data. For example, the source station 100 can be a node of a website that provides entertainment, sports, news, or video viewing or downloading, can be a node of a website that provides audio playback of music or books, can be a node of a website that provides text reading of news, articles, books, etc., and is not specifically limited here.

[0046] The central cache node cluster 201 is the upper node of the edge cache node cluster 202 . At the same time, the central cache node cluster 201 is also the lower node of the source station 100 . That is to say, the central cache node cluster 201 can play a connecting role between the source station 100 and the edge cache node cluster 202 .

[0047] The edge cache node cluster 202, which can also be called a proxy cache (Surroigate), is only one hop away from the terminal device 300 and is used to cache the content data sent by the source station 100 to the edge cache node cluster 202 for nearby access by the terminal device 300. Specifically, the edge cache node cluster 202 stores the image of the source station 100, and the edge cache node cluster 202 is usually set at the edge of the network. Therefore, the edge cache node cluster 202 can replace the source station 100 to provide content data to the terminal device 300, thereby realizing edge storage and dissemination of content data, solving the problem of network congestion, and improving the response speed of the terminal device 300 accessing the source station 100.

[0048] The following will introduce in detail the setting principles of the source station 100, the central cache node cluster 201, the edge cache node cluster 202 and the terminal device 300.

[0049] The source station 100 may be independently arranged in a single server or in a data center, wherein the source station 100 may be a service object of a CDN network.

[0050] The central cache node cluster 201 may be independently set in a single server or in a data center. The central cache node cluster 201 stores the content of the source station 100. When the content of the source station 100 is updated, the content of the central cache node cluster 201 is updated accordingly.

[0051] The edge service nodes 202 may be respectively set in a plurality of different regions. For example, edge cache node cluster 1 may be set in South China, edge cache node cluster 2 may be set in Central China, edge cache node cluster 3 may be set in West China, edge cache node cluster 4 may be set in North China, edge cache node cluster 5 may be set in East China, etc., which are not specifically limited here.

[0052] The terminal device 300 can be set in multiple different regions. For example, the terminal device 1 can be set in the South China region, the terminal device 2 can be set in the Central China region, the terminal device 3 can be set in the West China region, the terminal device 4 can be set in the North China region, the terminal device 5 can be set in the East China region, etc., which is not specifically limited here.

[0053] That is to say, edge cache node cluster 1 is located in South China, and terminal device 1 is located in South China. Therefore, terminal device 1 and edge cache node cluster 1 are in the same area, and the distance between them is the shortest; edge cache node cluster 2 is located in South China, and terminal device 2 is located in South China. Therefore, terminal device 2 and edge cache node cluster 2 are in the same area, and the distance between them is the shortest; edge cache node cluster 3 is located in South China, and terminal device 3 is located in South China. Therefore, terminal device 3 and edge cache node cluster 3 are in the same area, and the distance between them is the shortest; edge cache node cluster 4 is located in South China, and terminal device 4 is located in South China. Therefore, terminal device 4 and edge cache node cluster 4 are in the same area, and the distance between them is the shortest; edge cache node cluster 5 is located in South China, and terminal device 5 is located in South China. Therefore, terminal device 5 and edge cache node cluster 5 are in the same area, and the distance between them is the shortest.

[0054] In order to ensure that the terminal device 300 can obtain the content data of the source station 100 as soon as possible, the content data of the source station 100 can be sent to each edge cache node cluster 202 through the central cache node cluster 201 in advance. Then, when the terminal device 300 requests content data from the source station 100, the edge cache node cluster 202 "near" the terminal device 300 sends the content data to the terminal device 300. For example, the source station 100 can send the content data to the edge nodes 1 to 5 in advance through the central cache node cluster 1. When terminal device 1 requests content data from source station 100, the distance between terminal device 1 and edge cache node cluster 1 is the shortest, so edge cache node cluster 1 can send content data to terminal device 1; when terminal device 2 requests content data from source station 100, the distance between terminal device 2 and edge cache node cluster 2 is the shortest, so edge cache node cluster 2 can send content data to terminal device 2; when terminal device 3 requests content data from source station 100, the distance between terminal device 3 and edge cache node cluster 3 is the shortest, so edge cache node cluster 3 can send content data to terminal device 3; when terminal device 4 requests content data from source station 100, the distance between terminal device 4 and edge cache node cluster 4 is the shortest, so edge cache node cluster 4 can send content data to terminal device 4; when terminal device 5 requests content data from source station 100, the distance between terminal device 5 and edge cache node cluster 5 is the shortest, so edge cache node cluster 5 can send content data to terminal device 5.

[0055] It should be noted that in other embodiments, the number of source stations is not limited to 1, but can be other positive integers, the number of central cache node clusters is not limited to 2, but can be other positive integers, the number of edge caches and cache node clusters is not limited to 5, but can be other positive integers, and no specific limitation is made here.

[0056] It can be understood that, referring to the above content, each cache node cluster 210 in the CDN network 200 stores the content data of the source station 100. When the source station 100 performs resource refresh to generate the latest content data, each cache node cluster 210 also needs to perform corresponding resource refresh to ensure that the content data received by the user's terminal device 300 is real-time and the latest content data. Figure 1 and Figure 2 , the process of CDN resource refresh is explained in detail.

[0057] Figure 2 It is a structural diagram of a cache resource refresh system in the related technology, which is applied to CDN networks, such as Figure 2 As shown, the CDN network 200 includes Figure 1The cache node cluster 210 shown (specifically, the central cache node cluster 201 and the edge cache node cluster 202 in the aforementioned content) also includes a global management center 400. The global management center 400 is connected to the source station 100 and the cache node cluster 210, wherein:

[0058] The global management center 400 is used to receive resource refresh requests sent by the terminal device 300 or the source station 100, generate one or more refresh tasks, and send one or more refresh tasks to each cache node cluster 210 in the CDN network 200, thereby completing the resource refresh of the CDN network 200. For example, after the current source station 100 generates new content data, the source station 100 will send a resource refresh request to the global management center 400. The global management center 400 can generate one or more refresh tasks based on the number and status of the cache node clusters 210 in the CDN network 200, and send the one or more refresh tasks to the cache node clusters 210. In a specific implementation, the global management center 400 can be separately set in a single device with data processing capabilities or computing capabilities, such as a server. It can also be set in multiple servers, such as a data center, and can also be set in a computing device that simulates a complete hardware system function through software and runs in a completely isolated environment. This application does not make specific limitations.

[0059] The cache node cluster 210 may include a regional content management node 211 and a cache device 212. It should be understood that Figure 2 Only one regional content management node 211 and three cache devices 212 are described. In a specific implementation, the number of regional content management nodes 211 can be one or more, and the number of cache devices 212 can also be one or more, which is not specifically limited in this application.

[0060] The regional content management node 211 is used to manage the cache devices 212 under the same cache node cluster 210. The regional content management node 211 may specifically refer to a device with data processing capability or computing capability, which may include but is not limited to a central processing unit (CPU), a general processor, a hard disk, a memory, a network card, and a system bus, etc. Since the regional content management node 211 needs to respond to service requests and perform processing, generally speaking, the regional content management node 211 should have the ability to undertake and guarantee services, and has higher requirements in terms of processing capability, stability, reliability, security, scalability, manageability, etc. than a general computer architecture. When the regional content management node 211 is a virtual device, the regional content management node 211 can simulate a computing device with complete hardware system functions and running in a completely isolated environment through software. For example, the regional content management node 211 can be a virtual machine virtualized on a server. A virtual machine is an application program running on a computer, which can simulate a standard PC environment based on x86. This environment is the same as a real computer, with one or more devices including chipset, CPU, memory, graphics card, sound card, network card, floppy drive, hard disk, optical drive, serial port, parallel port, USB controller, Small Computer System Interface (SCSI) controller, etc.

[0061] The cache device 212 is used to store a large amount of content data from the source station 100. The cache device 212 can specifically refer to a device with data storage capabilities. For example, the cache device 212 can be a storage device in a storage area network (SAN) in a data center. The storage device in the SAN is an intelligent device, such as an independent disk replica array (Redundant Arrays of Independent Drives, RAID, RAID), which can also be called an object-based storage device (OSD). Each OSD has its own storage controller / processor, cache and network system, and can provide an OSD object interface, so that the cache device 212 can communicate with the regional content management node 211 through the OSD object interface, and provide data storage functions for the regional content management node 211.

[0062] The following example illustrates the process of CDN network resource refresh in the related art by taking the case where the cache node cluster 210 needs to process two refresh tasks and the cache node cluster 210 has only one regional content management node 211 and one cache device 212. Figure 3 As shown, the specific steps of resource refresh can be as follows:

[0063] 1. The global management center 400 generates two refresh tasks. Specifically, after receiving the resource update request sent by the source station, the global management center 400 can generate two refresh tasks according to the number of cache node clusters in the CDN network being 2.

[0064] 2. The global management center 400 sends two refresh tasks to the regional content management node 211 of the cache node cluster 210, and the regional content management node receives the two refresh tasks;

[0065] 3. The regional content management node 211 establishes a short connection with the cache device 212, wherein a short connection refers to a connection state in which only one data packet can be sent. A short connection is established each time a data packet is sent, and the short connection is disconnected after the sending is completed;

[0066] 4. The regional content management node 211 sends the first refresh task to the cache device 212, and the cache device 212 receives the first refresh task;

[0067] 5. The cache device 212 executes the first refresh task;

[0068] 6. The cache device 212 disconnects the short connection with the regional content management node 211;

[0069] 7. The regional content management node 211 establishes a short connection with the refresh component of the cache device 212;

[0070] 8. The regional content management node 211 sends the second refresh task to the cache device 212, and the cache device 212 receives the second refresh task;

[0071] 9. The cache device 212 executes the second refresh task;

[0072] 10. The cache device 212 disconnects the short connection with the regional content management node 211.

[0073] In summary, after receiving multiple refresh tasks sent by the global management center 400, the regional content management node 211 notifies the cache device to refresh the data, because the content data of the source station 100 are all stored in the cache device 212. Each time the regional content management node sends a refresh task to the cache device 212, the cache device 212 will establish a short connection with the regional content management node. For a regional content management node with only one cache device 212 in the cache node cluster 210, if there are n refresh tasks, n refresh tasks will be sent to the cache device 212, and n short connections will be established between the cache device and the regional content management node 211. If there are m cache devices 212 in the cache node cluster 210, if there are n refresh tasks, the regional content management node 211 will send m×n refresh tasks to the cache device 212, and n short connections will be established between each cache device 212 and the regional content management node 211. Frequent sending of requests will occupy a large amount of computing resources, causing tremendous pressure on the regional content management nodes, resulting in a high failure rate of the regional content management nodes.

[0074] In order to solve the problem of high refresh pressure and high failure rate of regional content management nodes in each cache node cluster when refreshing CDN network resources, the present application provides a cache resource refresh system 300, and the units inside the cache resource refresh system can be divided into multiple types. Figure 4 This is an exemplary division method. In actual applications, the cache node cluster 210 may also include more or fewer units, modules or subsystems, which is not limited in this application.

[0075] like Figure 4 As shown, the resource refresh system 300 includes a global management center 400 and a cache node cluster 210, a regional content management node 211 and a cache device 212, wherein the specific description of the regional content management node 211 and the cache device 212 can be referred to Figure 2 Embodiment, here will not expand the details, but with Figure 2 The difference between the embodiments is that in the resource refresh system 300 provided by the present application, each cache device 212 may include a management component and a cache component, the management component is used to receive the refresh task sent by the regional content management node 211, and establish a long connection with the refresh component, and send the refresh task to the refresh component in batches through the long connection. The refresh component is used to receive the refresh task sent by the management component through the long connection, and refresh the cache resources according to the refresh task.

[0076] In one embodiment, the global management center 400 is used to send multiple refresh tasks to the regional content management node 211 of the cache node cluster 210; the regional content management node 211 of the cache node cluster is used to send the multiple refresh tasks to the cache device 212 of the cache node cluster 210; the cache device 212 of the cache node cluster 210 is used to call the management component and send the multiple refresh tasks to the refresh component in batches through the long connection; the cache device 212 of the cache node cluster 210 is used to call the refresh component to execute the multiple refresh tasks. It can be understood that after receiving multiple refresh tasks sent by the regional content management node, the management component of the cache device 212 will divide the multiple refresh tasks into multiple refresh task groups according to the refresh task processing capability of the cache device, and send the multiple refresh tasks in groups. Each time the management component of the cache device 212 receives a refresh task group, it can disassemble it into individual refresh tasks and send them to the refresh component in sequence through a long connection, thereby avoiding the need for the cache device 212 to reserve a large amount of storage resources for storing refresh tasks waiting to be executed, thereby improving the refresh efficiency of the cache device 212, reducing the time required for CDN network resource refresh, and improving user experience.

[0077] In one embodiment, the multiple refresh tasks are determined by the global management center after sorting multiple refresh requests according to priority, and the multiple refresh requests include refresh requests sent by users and refresh requests sent by source stations. It can be understood that compared with the traditional method of directly sending all refresh tasks to each regional content management node, the global management center in the embodiment of the present application will prioritize the refresh tasks and give priority to high-priority refresh tasks, which effectively improves the refresh efficiency and improves the user experience.

[0078] In one embodiment, the regional content management node of the cache node cluster is also used to send the multiple refresh tasks to the refresh component of the cache device in the event that the management component of the cache device fails; the refresh component of the cache device executes the multiple refresh tasks. It is understandable that in the event that the management component of the cache device fails, the regional content management node can directly communicate with the refresh component, thereby ensuring the normal refresh function, avoiding the problem of refresh failure after the management component of the cache device fails, and thus improving the stability of the cache node cluster refresh.

[0079] Combine the following Figure 5 ,right Figure 4 The resource refresh process of the resource refresh system 300 shown is introduced in detail.

[0080] like Figure 5As shown, the resource refresh system 300 provided in the present application can execute the following steps to complete the resource refresh of the CDN network.

[0081] S401: The regional content management node 211 receives multiple refresh tasks.

[0082] In one embodiment, the multiple refresh tasks are determined by the global management center 400 after sorting multiple refresh requests according to priority, and the multiple refresh requests include refresh requests sent by users and refresh requests sent by source stations. Figure 3 In the embodiment, compared with directly sending all refresh tasks to each regional content management node, the global management center 400 in the embodiment of the present application will prioritize the refresh tasks and give priority to high-priority refresh tasks, which effectively improves the refresh efficiency and improves the user experience.

[0083] For example, assuming that terminal device A uses a VIP user to access the source station, and terminal device B uses an ordinary user to access the source station, then after the global management center 400 receives the refresh requests from terminal device A and terminal device B, the refresh request initiated by terminal device A will be processed in priority over terminal device B. If terminal device A is connected to edge cache node cluster A, and terminal device B is connected to edge cache node cluster B, then the global management center 400 can first generate multiple refresh tasks based on the refresh request initiated by terminal device A, and send them to edge cache node cluster A, and then generate multiple refresh tasks based on the refresh request initiated by terminal device B, and send them to edge cache node cluster B. For another example, the source station 100 initiates multiple refresh requests, and a resource (such as live broadcast source A) finds sensitive information in the pornographic identification process, and the resource needs to be refreshed and deleted immediately. Then, after the global management center 400 receives multiple refresh requests, the refresh request of the resource will be processed in priority over other refresh requests. It should be understood that the above examples are only for illustration and cannot constitute a specific limitation.

[0084] S402 : the management component receives multiple refresh tasks sent by the regional content management node 211 .

[0085] S403: A long connection is established between the management component of the cache device 212 and the refresh component of the cache device 212 .

[0086] Among them, a persistent connection refers to a connection state in which multiple data packets can be sent continuously. During the period when the persistent connection is maintained, if no data packet is sent, both parties need to send a link detection packet, which is mostly used for frequent operations and point-to-point communication. It can be understood that in the embodiment of the present application, the management component of the cache device 212 receives multiple refresh tasks, which are all tasks that the refresh component needs to execute. The management component must send them to the refresh component one by one, which just meets the requirements of frequent persistent connection operations and point-to-point communication, thereby avoiding frequent link establishment and tearing down to cause CPU pressure on the cache device 212, and improving the refresh efficiency of the cache device 212.

[0087] Understandably, in Figure 2-Figure 3 In the CDN cache resource refresh system in the related technology described in the embodiment, since the regional content management node 211 only sends one refresh task to the cache device 212 each time, the management component of the cache device 212 can only establish a short connection with the regional content management node 211, which causes the cache device 212 to frequently establish and disconnect links, resulting in high refresh pressure. However, in the present application, the regional content management node 211 sends multiple refresh tasks to the cache device 212 each time, and the management component of the cache device 212 can establish a long connection with the refresh component that is suitable for frequent operations and point-to-point communication, thereby avoiding the process of frequent link establishment and disconnection of the cache device 212, so that the cache device 212 can be evenly loaded and the CPU utilization of the cache device is improved.

[0088] S404: The management component of the cache device 212 sends multiple refresh tasks in batches to the refresh component through the persistent connection. It is understandable that when the management component of the cache device 212 sends refresh tasks to the refresh component through the persistent connection, the persistent connection will remain in a multiplexed state.

[0089] S405 : The refresh component of the cache device 212 executes the multiple refresh tasks to refresh the cache resources of the cache device 212 .

[0090] S406: The management component of the cache device 212 disconnects the long connection with the refresh component of the cache device 212. In a specific implementation, the long connection between the management component of the cache device 212 and the refresh component of the cache device 212 can be released when the duration of the long connection in the non-reuse state exceeds a preset threshold. For example, if the preset threshold is 10 seconds, if the management component of the cache device 212 sends x refresh tasks to the refresh component of the cache device 212 through the long connection in the 1st to 4th seconds, then the long connection is in the reused state from the 1st to 4th seconds, and if the long connection is in the non-reuse state from the 5th to the 15th seconds, then in the 16th second, the management component of the cache device 212 can trigger the release of the long connection between the management component of the cache device 212 and the refresh component of the cache device 212. It should be understood that the above examples are for illustration only and do not constitute specific limitations.

[0091] In a specific implementation, the management component of the cache device 212 may also send the refresh task processing result to the regional content management node 211 , and the regional content management node may count the refresh task processing results of multiple cache devices 212 and report the statistical results to the global content management center 400 .

[0092] In the above process, the regional content management node 211 sends multiple refresh tasks to the management component of the cache device 211, and the management component of the cache device 211 triggers the establishment of a long connection with the refresh component, so that the management component 211 can generate only one sending request, and the management component and the refresh component of the cache device only establish one connection, so that the cache device can complete multiple refresh tasks, so that the regional content management node. In other words, if there are m cache devices 212 in the cache node cluster 210 and n refresh tasks, the regional content management node will send m refresh tasks to the management component of the cache device 212, and the management component and the refresh component of each cache device will establish one long connection, so that the processing pressure of the regional content management node is greatly reduced, thereby solving the problem of high refresh pressure and high failure rate of the regional content management node 211.

[0093] In the embodiment of the present application, in order to prevent the cache device 212 from receiving too many refresh tasks, resulting in the cache device 212 occupying a large amount of storage resources for storing refresh tasks waiting to be executed, the management component receives multiple refresh tasks sent by the regional content management node, including: the management component sequentially receives multiple refresh task groups sent by the regional content management node, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold, and the threshold is determined by the regional content management node according to the refresh task processing capability of the cache device; the management component sends the multiple refresh tasks to the refresh component in batches through the long connection, including: the management component sequentially disassembles each of the multiple refresh task groups to obtain multiple refresh tasks; the management component sends the multiple refresh tasks one by one to the refresh component through the long connection. Simply put, after the regional content management node of the cache node cluster receives multiple refresh tasks to be processed by the cache node cluster sent by the global management center, the regional content management node of the cache node cluster will divide the multiple refresh tasks into multiple refresh task groups according to the refresh task processing capability of the cache device of the cache node cluster, and send the multiple refresh tasks in groups. Each time the management component of the cache device receives a refresh task group, it can disassemble it into individual refresh tasks and send them to the refresh component in sequence through a long connection, thereby avoiding the need for the cache device to reserve a large amount of storage resources for storing refresh tasks waiting to be executed, thereby improving the refresh capability of the cache device.

[0094] For example, if Figure 6As shown, if cache node cluster 1 includes 1 regional content management node and 3 cache devices, namely cache device 1, cache device 2 and cache device 3, assuming that each cache device can process 10,000 refresh tasks per second, then after receiving 100,000 refresh tasks sent by the global management center, the regional content management node of cache node cluster 1 can send 8,000 refresh tasks to the management component of each cache device per second. After receiving 8,000 refresh tasks, the management component of each cache device will establish a long connection with the refresh component and send the 800 refresh tasks to the refresh component one by one for the refresh component to execute one by one. The cache device receives 8,000 refresh tasks per second, and the actual processing capacity of the cache device is 10,000 refresh tasks per second. Therefore, each cache device does not need to reserve additional storage space for storing refresh tasks waiting to be executed, thereby improving the refresh efficiency of the cache device. Moreover, referring to the above content, it can be known that the long connection will only be disconnected when the duration of the non-reuse state exceeds the preset threshold, so the 100,000 refresh tasks can all be transmitted through the long connection, without the need to frequently establish and tear down the link, which greatly improves the efficiency of resource refresh of the cache node cluster. It should be understood that the above examples are for illustration only and are not specifically limited in this application.

[0095] In the embodiment of the present application, in the case of a failure of the management component of the cache device, the method further comprises: the refresh component receives multiple refresh tasks sent by the regional content management node; the refresh component executes the multiple refresh tasks. It can be understood that in the case of a failure of the management component of the cache device, the regional content management node directly communicates with the refresh component, thereby ensuring the normal refresh function, avoiding the problem of refresh failure after the failure of the cache device management component, and improving the stability of the cache node cluster refresh.

[0096] Below is still Figure 3 Taking the embodiment as an example, the cache node cluster 210 needs to process two refresh tasks, and the cache node cluster 210 has only one regional content management node 211 and one cache device 212, and the process of refreshing CDN network resources using the cache resource refresh method provided by the present application is illustrated. Figure 7 As shown, the specific steps of resource refresh can be as follows:

[0097] 1. The global management center 400 receives refresh requests sent by multiple users or source stations, prioritizes the refresh requests, and generates two refresh tasks to be processed by cache node cluster 1;

[0098] 2. The global management center 400 sends two refresh tasks to the regional content management node 211 of the cache node cluster 210, and the regional content management node receives the two refresh tasks;

[0099] 3. The regional content management node sends two refresh tasks to the management component of the cache device 212 according to the processing capacity of the cache device (assuming that 10 refresh tasks are processed per second), and the management component receives the two refresh tasks;

[0100] 4. The management component of the cache device 212 establishes a long connection with the refresh component of the cache device 212;

[0101] 5. The management component of the cache device 212 sends two refresh tasks to the refresh component of the cache device 212 in sequence through a long connection, and the refresh component of the cache device 212 receives the two refresh tasks;

[0102] 6. The refresh component of the cache device 212 performs two refresh tasks in sequence;

[0103] 7. The management component of the cache device 212 disconnects the long connection from the refresh component of the cache device 212. Here, the management component of the cache device 212 disconnects the long connection from the refresh component of the cache device 212 when the duration of the long connection in the non-reuse state exceeds a preset threshold.

[0104] Therefore, for a regional content management node with only one cache device 212 in the cache node cluster 210, if there are n refresh tasks, it can send only one request to the management component of the cache device 212, that is, send the n refresh tasks at one time, and the management component and the refresh component of the cache device will establish one long connection, so that the cache device 212 can complete the n refresh tasks. If there are m cache devices 212 in the cache node cluster 210 and n refresh tasks to be processed, the regional content management node can send only m requests, that is, each device sends n refresh tasks at one time, and the management component and the refresh component of each cache device only establish one long connection, so that the m cache devices under the cache node cluster can complete the n refresh tasks.

[0105] It is understandable that the above process is Figure 3 Compared with the embodiment, firstly, the steps of the entire resource refresh are greatly reduced, so that the efficiency of resource refresh of the cache node cluster is greatly improved. Secondly, the regional content management node no longer needs to send requests frequently, and the cache device does not need to establish connections frequently, so that the load of the regional content management node and the cache device is balanced, the refresh pressure is greatly reduced, and the refresh efficiency is greatly improved.

[0106] In summary, the cache resource refresh method provided by the present application, after the regional content management node of the cache node cluster receives multiple refresh tasks sent by the global management center, sends multiple refresh tasks to the management component of each cache device under the same cache node cluster, so that the management component of the cache device establishes a long connection with the refresh component, and sends multiple refresh tasks to the cache device one by one through the long connection, so that the cache device can refresh resources. The above method makes it unnecessary for the regional content management node to send requests frequently, and the cache device does not need to establish connections frequently, so that the load of the regional content management node and the cache device is balanced, the refresh pressure is greatly reduced, and the refresh efficiency is greatly improved, avoiding the problem of high failure rate of regional content management nodes in the scenario of massive refresh tasks.

[0107] The method of the embodiment of the present application is described in detail above. In order to facilitate better implementation of the above scheme of the embodiment of the present application, correspondingly, related equipment for cooperating in implementing the above scheme is also provided below.

[0108] See also Figure 8 , Figure 8 The schematic diagram of the structure of a cache device 800 provided in an embodiment of the present application. The units inside the cache device 800 can be divided into multiple types. Figure 8 This is an exemplary division method. In actual applications, the cache device 800 may also include more or fewer units, modules or subsystems, and this application does not limit it.

[0109] The cache device 800 is the cache device 212 mentioned above. The cache device 800 includes a management component 810 and a refresh component 820. A long connection is established between the management component and the refresh component, wherein:

[0110] The management component 810 is used to receive multiple refresh tasks sent by the regional content management node;

[0111] The management component 810 is used to send the multiple refresh tasks in batches to the refresh component through the long connection;

[0112] The refresh component 820 is used to execute the multiple refresh tasks.

[0113] In one embodiment, the management component 810 is used to sequentially receive multiple refresh task groups sent by the regional content management node, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold, and the threshold is determined by the regional content management node according to the refresh task processing capability of the cache device; the management component 810 is used to batch send the multiple refresh tasks to the refresh component through the long connection, including: the management component 810 is used to sequentially disassemble each of the multiple refresh task groups to obtain multiple refresh tasks; the management component 810 is used to send the multiple refresh tasks one by one to the refresh component through the long connection.

[0114] In one embodiment, the refresh component 820 is used to receive a plurality of refresh tasks sent by the regional content management node when the management component of the cache device fails; the refresh component 820 is used to execute the plurality of refresh tasks.

[0115] In summary, the cache node cluster provided by the present application, after the regional content management node of the cache node cluster receives multiple refresh tasks sent by the global management center, sends multiple refresh tasks to the management component of each cache device under the same cache node cluster, so that the management component of the cache device establishes a long connection with the refresh component, and sends multiple refresh tasks to the cache device one by one through the long connection, so that the cache device can refresh resources. The above method makes it unnecessary for the regional content management node to send requests frequently, and the cache device does not need to establish connections frequently, so that the load of the regional content management node and the cache device is balanced, the refresh pressure is greatly reduced, and the refresh efficiency is greatly improved, avoiding the problem of high failure rate of regional content management nodes in the scenario of massive refresh tasks.

[0116] See also Fig. 9 , Fig. 9 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 900 may be the cache device 212 and the cache device 700 in the above content. Fig. 9 As shown, the electronic device 900 includes: a processor 910 , a communication interface 920 and a memory 930 , and the processor 910 , the communication interface 920 and the memory 930 are interconnected via an internal bus 940 .

[0117] The processor 910, the communication interface 920 and the memory 930 can be connected via a bus, or can communicate via other means such as wireless transmission. The embodiment of the present application takes the connection via bus 940 as an example, wherein the bus 940 can be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus 940 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0118] The processor 910 may be composed of one or more general-purpose processors, such as a central processing unit (CPU), or a combination of a CPU and a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. The processor 910 executes various types of digital storage instructions, such as software or firmware programs stored in the memory 930, which enables the computing device 900 to provide a wide variety of services.

[0119] Specifically, the processor 910 may include a management component and a refresh component, wherein the management component may implement processing functions by calling program codes in the memory 930, such as receiving multiple refresh tasks, sending the multiple refresh tasks to the refresh component of the cache device, etc., and may be specifically used to execute S402 to step S404, step S406 and optional steps of the aforementioned method, and may also be used to execute Figure 5-Figure 7 The other steps described in the embodiment are not described here. The refresh component can call the program code in the memory 930 to implement the processing function, such as executing multiple refresh tasks received, and can also be used to execute Figure 4-Figure 6 The other steps described in the embodiment will not be described in detail here.

[0120] The memory 930 may include a volatile memory (Volatile Memory), such as a random access memory (Random Access Memory, RAM); the memory 930 may also include a non-volatile memory (Non-Volatile Memory), such as a read-only memory (Read-Only Memory, ROM), a flash memory (Flash Memory), a hard disk drive (Hard Disk Drive, HDD) or a solid-state drive (SSD); the memory 930 may also include a combination of the above types. Among them, the memory 930 may store application code and data. The program code may be a program code for a management component, a program code for a refresh component, or a code for establishing a long connection, a code for dividing multiple refresh tasks into multiple refresh task groups, etc. The data may be cache resource data, or multiple refresh tasks to be processed, an interface identifier for establishing a long connection, etc. It may also include a program code for implementing Figure 4-Figure 6 The program codes and data of other steps described in the embodiment will not be described in detail here.

[0121] The communication interface 920 can be a wired interface (such as an Ethernet interface), an internal interface (such as a high-speed serial computer expansion bus (Peripheral Component Interconnect express, PCIe) bus interface), a wired interface (such as an Ethernet interface) or a wireless interface (such as a cellular network interface or a wireless local area network interface) for communicating with other devices or modules.

[0122] Need to explain, Fig. 9 This is only a possible implementation of the embodiment of the present application. In practical applications, the electronic device may also include more or fewer components, which is not limited here. Figure 5-Figure 7 The relevant explanations in the embodiments are not repeated here. Fig. 9 The electronic device shown may also be a computer cluster composed of multiple computing nodes, which is not specifically limited in this application.

[0123] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores instructions, which, when executed on a processor, Figure 5-Figure 7 The method flow shown is realized.

[0124] The present application also provides a computer program product. When the computer program product is run on a processor, Figure 5-Figure 7 The method flow shown is realized.

[0125] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above embodiments 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 or 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 devices. 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 by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 containing one or more available media sets. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a high-density digital video disc (DVD), or a semiconductor medium. The semiconductor medium may be an SSD.

[0126] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for refreshing cache resources, characterized in that: Applied to a cache device, the cache device includes a management component and a refresh component, a long connection is established between the management component and the refresh component, and the method includes: The management component receives a plurality of refresh tasks sent by the regional content management node; The management component sends the multiple refresh tasks in batches to the refresh component through the long connection; The refresh component executes the plurality of refresh tasks.

2. The method according to claim 1, characterized in that The management component receives a plurality of refresh tasks sent by the regional content management node, including: The management component sequentially receives a plurality of refresh task groups sent by the regional content management node, wherein the number of tasks of each of the plurality of refresh task groups is less than a threshold value, and the threshold value is determined by the regional content management node according to the refresh task processing capability of the cache device; The management component sending the multiple refresh tasks in batches to the refresh component through the long connection includes: The management component sequentially disassembles each of the multiple refresh task groups to obtain multiple refresh tasks; The management component sends the multiple refresh tasks to the refresh component one by one through the long connection.

3. The method according to claim 1 or 2, characterized in that: In the event of a failure of a management component of the cache device, the method further comprises: The refresh component receives a plurality of refresh tasks sent by the regional content management node; The refresh component executes the plurality of refresh tasks.

4. A cache resource refresh system, characterized in that: The cache resource refresh system includes a cache node cluster and a global management center, the cache node cluster is connected to the global management center, the cache node cluster includes a regional content management node and a cache device, the cache device includes a management component and a refresh component, and a long connection is established between the management component and the refresh component, wherein: The global management center is used to send multiple refresh tasks to the regional content management nodes of the cache node cluster; The regional content management node of the cache node cluster is used to send the multiple refresh tasks to the cache devices of the cache node cluster; The cache device of the cache node cluster is used to call the management component and send the multiple refresh tasks in batches to the refresh component through the long connection; The cache device of the cache node cluster is used to call the refresh component to execute the multiple refresh tasks.

5. The system according to claim 4, characterized in that The regional content management node of the cache node cluster is used to divide the multiple refresh tasks into multiple refresh task groups according to the refresh task processing capacity of the cache device, wherein the number of tasks in each of the multiple refresh task groups is less than a threshold; The regional content management node of the cache node cluster is used to send the multiple refresh task groups to the cache devices of the cache node cluster in sequence; The cache device of the cache node cluster is used to call the management component to sequentially decompose each of the multiple refresh task groups to obtain multiple refresh tasks; The cache device of the cache node cluster is used to call the management component and send the multiple refresh tasks to the refresh component one by one through the long connection.

6. The system according to claim 4 or 5, characterized in that: The multiple refresh tasks are determined by the global management center after sorting multiple refresh requests according to priorities, and the multiple refresh requests include refresh requests sent by users and refresh requests sent by source stations.

7. The system according to any one of claims 4 to 6, characterized in that: The regional content management node of the cache node cluster is further configured to send the multiple refresh tasks to the refresh component of the cache device in the event of a failure of the management component of the cache device; A refresh component of the cache device executes the plurality of refresh tasks.

8. A cache device, comprising a management component and a refresh component, wherein a long connection is established between the management component and the refresh component, wherein: The management component is used to receive multiple refresh tasks sent by the regional content management node; The management component is used to send the multiple refresh tasks in batches to the refresh component through the long connection; The refresh component is used to execute the multiple refresh tasks.

9. The device according to claim 8, characterized in that The management component is used to sequentially receive multiple refresh task groups sent by the regional content management node, wherein the number of tasks of each of the multiple refresh task groups is less than a threshold, and the threshold is determined by the regional content management node according to the refresh task processing capability of the cache device; The management component, for sending the plurality of refresh tasks in batches to the refresh component through the long connection, comprises: The management component is used to sequentially disassemble each of the multiple refresh task groups to obtain multiple refresh tasks; The management component is used to send the multiple refresh tasks one by one to the refresh component through the long connection.

10. The device according to claim 8 or 9, characterized in that The refresh component is used to receive a plurality of refresh tasks sent by the regional content management node when the management component of the cache device fails; The refresh component is used to execute the multiple refresh tasks.

11. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on a computing device, cause the computing device to execute the method according to any one of claims 1 to 3.

12. A computer program product, characterized in that The method comprises a computer program, which, when read and executed by a computing device, enables the computing device to perform the method according to any one of claims 1 to 3.

13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the processor executes the code in the memory to implement the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Distributed system node processing task method

    CN103581225A

  • Crowd-sourced content delivery network system, method and device

    CN104618506A