Data update method, device, content delivery network, and electronic device

By setting up relay devices and self-healing mechanisms in the content distribution network, the timeliness and success rate problems caused by the failure of node device updates are solved, and efficient self-healing and success rate improvement of data updates are achieved.

CN114416755BActive Publication Date: 2025-07-11BEIJING KINGSOFT CLOUD NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011177263.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-28
Publication Date
2025-07-11
Estimated Expiration
2040-10-28

AI Technical Summary

Technical Problem

In content distribution network, node equipment fails to update data due to downtime, software upgrade or load, which affects the success rate and timeliness of data updates. It is difficult for existing technology to take into account both.

Method used

By setting up a relay device in the content distribution network, the update status of the cache device is judged based on the preset ratio threshold, the device that failed to update is automatically retryed, and self-healing is performed inside the node, and the central control system records and manages the update status to ensure the success rate and timeliness of data updates.

Benefits of technology

It improves the timeliness and success rate of data updates, reduces the impact of the failure of a few devices on the overall task, and realizes self-healing capabilities within the node.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416755B_ABST
    Figure CN114416755B_ABST
Patent Text Reader

Abstract

The present invention provides a data update method, apparatus, content delivery network, and electronic device; wherein, the method includes: updating data stored in a cache device in a node based on a preset data update task to obtain an update result; wherein, the data update task is sent by a CDN central control system; the update result is used to indicate whether the cache device has successfully updated the data; if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node where the data update fails, update the data stored in the target cache device again based on the data update task. This way can improve the timeliness and success rate of data update.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technologies, and in particular, to a data update method, apparatus, content delivery network, and electronic device. Background Art

[0002] A CDN (Content Delivery Network) network includes a central control system and node devices distributed in various regions; the central control system needs to update various types of service data to the node devices, for example, refreshing service data, preheating service data, and configuring and distributing service data, etc.; however, during the data update process, some node devices may cause data update failures due to reasons such as downtime, software upgrade, high load, etc., resulting in a low success rate of data update. In order to ensure the success rate, it often takes a long time to complete the data update, which affects the timeliness of data update and makes it difficult to balance the success rate and timeliness of data update. Summary of the Invention

[0003] In view of this, an object of the present invention is to provide a data update method, apparatus, content delivery network, and electronic device to improve the timeliness and success rate of data update.

[0004] In a first aspect, an embodiment of the present invention provides a data update method, which is applied to a relay device in a CDN (Content Delivery Network) node of a content delivery network; the method includes: updating data stored in a cache device in the node based on a preset data update task to obtain an update result; wherein, the data update task is sent by a CDN central control system; the update result is used to indicate whether the cache device has successfully updated the data; if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node for which the data update fails, update the data stored in the target cache device again based on the data update task.

[0005] The above method further includes: if there is a target cache device in the node for which the data update fails, return the device information of the target cache device to the central control system.

[0006] The steps of updating the data stored in the target cache device again based on the data update task described above include: performing the following operations: updating the data to the target cache device where the data update fails based on the data update task; recording the execution times of the operations; if there is a target cache device with successful data update, returning the information of the target cache device with successful data update to the central control system; if the execution times are less than the preset times threshold and there is a target cache device with failed data update, continue to perform the operations; if the execution times are less than the preset times threshold and all target cache devices have been successfully updated with data, stop performing the operations; if the execution times reach the preset times threshold and there is a target cache device with failed data update, stop performing the operations and return the information of the target cache device with failed data update to the central control system.

[0007] The method described above further includes: if receiving the first information that the target cache device has crashed, stop performing the operations; wherein, the first information is sent by the central control system.

[0008] The method described above further includes: if there is a target cache device with failed data update among the nodes, recording the device information of the target cache device in the first specified list; if the target cache device has been successfully updated with data, deleting the device information of the target cache device from the first specified list; if the duration of the device information of the target cache device in the first specified list exceeds the first preset duration, deleting the device information of the target cache device from the first specified list.

[0009] The method described above further includes: if the ratio of the number of cache devices that have been successfully updated with data in the node to the total number of cache devices in the node is lower than or equal to the preset ratio threshold, returning the information that the ratio is lower than or equal to the preset ratio threshold to the central control system.

[0010] In a second aspect, an embodiment of the present invention provides a data update method, which is applied to a content delivery network (CDN) central control system; the method includes: sending a data update task to a relay device in the CDN node to perform the following operations through the relay device: updating the data stored in the cache device in the node based on the data update task to obtain an update result; wherein, the update result is used to indicate whether the cache device has been successfully updated with data; if the ratio of the number of cache devices that have been successfully updated with data in the node to the total number of cache devices in the node is higher than the preset ratio threshold, returning the information that the node data update is successful to the central control system; if there is a target cache device with failed data update in the node, updating the data stored in the target cache device again based on the data update task.

[0011] The method described above further includes: if receiving the information that the node data update is successful returned by the relay device, confirming that the node data update is successful.

[0012] The above method further includes: if the device information of the target cache device for which the data update returned by the relay device fails is received, recording the device information of the target cache device in a second specified list; if the information that the data of the target cache device is successfully updated returned by the relay device is received, deleting the device information of the target cache device from the second specified list.

[0013] The above method further includes: if the duration of the device information of the target cache device in the second specified list exceeds a second preset duration, deleting the device information of the target cache device from the second specified list; recording the device information of the target cache device in an automatic re - refresh list to update the data stored in the target cache device again.

[0014] The above method further includes: if the information that the data update of the target cache device returned by the relay device fails is received, recording the device information of the target cache device in a refresh playback list to perform a refresh playback process on the target cache device; deleting the device information of the target cache device from the second specified list.

[0015] The above method further includes: if the information returned by the relay device with a ratio lower than or equal to a preset ratio threshold is received, recording the device information of the target cache device in an automatic re - refresh list to update the data stored in the target cache device again.

[0016] The above method further includes: if the second information that the target cache device is down is received, determining a target list for recording the device information of the target cache device; the second information is sent by the resource management system of the CDN; if the target list is the second specified list or the automatic re - refresh list, recording the device information of the target cache device in a refresh playback list; deleting the device information of the target cache device from the target list.

[0017] After the step of deleting the device information of the target cache device from the target list, the method further includes: sending the information that the target cache device is down to the relay device in the node.

[0018] After the step of recording the device information of the target cache device in the refresh playback list, the method further includes: if the information that the target cache device returns to normal is received, determining whether the device information of the target cache device is recorded in the refresh playback list; if the device information of the target cache device is recorded in the refresh playback list, performing a refresh playback process on the target cache device.

[0019] The step of performing a refresh playback process on the target cache device includes: if the down duration of the target cache device is less than a third preset duration, performing a refresh playback process on the target cache device.

[0020] In a third aspect, an embodiment of the present invention provides a data update device, which is disposed in a relay device in a Content Delivery Network (CDN) node. The device includes: a first update module, configured to update data stored in a cache device in the node based on a preset data update task to obtain an update result, where the data update task is sent by a CDN central control system, and the update result is used to indicate whether the cache device successfully updates the data; an information return module, configured to return information indicating that the node data update is successful to the central control system if the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is higher than a preset ratio threshold; a second update module, configured to, if there is a target cache device in the node where the data update fails, update the data stored in the target cache device again based on the data update task.

[0021] In a fourth aspect, an embodiment of the present invention provides a data update device, which is disposed in a CDN central control system. The device includes: a task sending module, configured to send a data update task to a relay device in a CDN node, so that the relay device performs the following operations: update data stored in a cache device in the node based on the data update task to obtain an update result, where the update result is used to indicate whether the cache device successfully updates the data; if the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node where the data update fails, update the data stored in the target cache device again based on the data update task.

[0022] In a fifth aspect, an embodiment of the present invention provides a content delivery network, which includes a central control system and at least one node. The node includes a relay device and a cache device. The central control system is configured to: send a data update task to the relay device in the node; the relay device is configured to: update data stored in the cache device in the node based on the data update task to obtain an update result, where the update result is used to indicate whether the cache device successfully updates the data; if the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node where the data update fails, update the data stored in the target cache device again based on the data update task.

[0023] The above-mentioned relay device is further configured to: if there is a target cache device in the node where the data update fails, return the device information of the target cache device to the central control system; the central control system is further configured to: if receiving the device information of the target cache device where the data update fails returned by the relay device, record the device information of the target cache device in a second specified list.

[0024] The above relay device is also used for: performing the following operations: updating data to a target cache device with data update failure based on a data update task; recording the execution times of the operations; if there is a target cache device with successful data update, returning the information of the target cache device with successful data update to the central control system; The central control system is also used for: if receiving the information that the target cache device has successfully updated data returned by the relay device, deleting the device information of the target cache device from the second specified list.

[0025] The above relay device is also used for: if the execution times are less than a preset times threshold and there is a target cache device with data update failure, continuing to perform the operations; if the execution times are less than a preset times threshold and all target cache devices have successfully updated data, stopping to perform the operations; if the execution times reach the preset times threshold and there is a target cache device with data update failure, stopping to perform the operations and returning the information of the target cache device with data update failure to the central control system; The central control system is also used for: if receiving the information that the target cache device has failed to update data returned by the relay device, recording the device information of the target cache device into the refresh playback list to perform refresh playback processing on the target cache device; deleting the device information of the target cache device from the second specified list.

[0026] The above central control system is also used for: if receiving the information that the target cache device has crashed, determining the target list for recording the device information of the target cache device; the information is sent by the resource management system of the CDN; if the target list is the second specified list or the automatic re - refresh list, recording the device information of the target cache device into the refresh playback list; deleting the device information of the target cache device from the target list; sending the information that the target cache device has crashed to the relay device in the node; The relay device is also used for: if receiving the information that the target cache device has crashed sent by the central control system, stopping to perform the operations.

[0027] The above relay device is also used for: if there is a target cache device with data update failure in the node, recording the device information of the target cache device into the first specified list; if the target cache device has successfully updated data, deleting the device information of the target cache device from the first specified list; if the duration of the device information of the target cache device in the first specified list exceeds the first preset duration, deleting the device information of the target cache device from the first specified list.

[0028] The above relay device is further configured to: if the ratio of the number of cache devices in which data is successfully updated in the nodes to the total number of cache devices in the nodes is lower than or equal to a preset ratio threshold, return information that the ratio is lower than or equal to the preset ratio threshold to the central control system; the central control system is further configured to: if it receives the information that the ratio is lower than or equal to the preset ratio threshold returned by the relay device, record the device information of the target cache device in the automatic re-flushing list to update the data stored in the target cache device again.

[0029] The above central control system is further configured to: if it receives the information that the node data update is successful returned by the relay device, confirm that the node data update is successful.

[0030] The above central control system is further configured to: if the duration of the device information of the target cache device in the second specified list exceeds the second preset duration, delete the device information of the target cache device from the second specified list; record the device information of the target cache device in the automatic re-flushing list to update the data stored in the target cache device again.

[0031] The above central control system is further configured to: if it receives the information that the target cache device returns to normal, determine whether the device information of the target cache device is recorded in the refresh playback list; if the device information of the target cache device is recorded in the refresh playback list, perform a refresh playback process on the target cache device.

[0032] The above central control system is further configured to: if the downtime of the target cache device is less than the third preset duration, perform a refresh playback process on the target cache device.

[0033] In a sixth aspect, an embodiment of the present invention provides an electronic device, including a processor and a memory, where the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above data update method.

[0034] In a seventh aspect, an embodiment of the present invention provides a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are called and executed by a processor, the machine-executable instructions cause the processor to implement the above data update method.

[0035] The embodiments of the present invention bring the following beneficial effects:

[0036] The above data update method, device, content delivery network, and electronic device update the data stored in the cache device in the node based on a preset data update task to obtain an update result; if the ratio of the number of cache devices in the node whose data is successfully updated to the total number of cache devices in the node is higher than a preset ratio threshold, an information indicating successful node data update is returned to the central control system; if there is a target cache device in the node where data update fails, the data stored in the target cache device is updated again based on the data update task. In this way, when a certain proportion of the cache devices in the node are successfully updated, an information indicating successful node data update can be returned to the central control system, without waiting for the few cache devices with failed updates to be successfully updated before returning the information indicating successful node data update, thereby improving the timeliness of data update; at the same time, for the few cache devices with failed updates, the relay device continues to update the data inside the node, thereby improving the success rate of data update within the node.

[0037] Other features and advantages of the present invention will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present invention. The objectives and other advantages of the present invention are achieved and obtained by the structures specifically pointed out in the specification, claims, and drawings.

[0038] To make the above objectives, features, and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present invention. For those skilled in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0040] Figure 1 It is a schematic structural diagram of a CDN provided by an embodiment of the present invention;

[0041] Figure 2 It is a flowchart of a data update method provided by an embodiment of the present invention;

[0042] Figure 3 It is a flowchart of another data update method provided by an embodiment of the present invention;

[0043] Figure 4 It is a schematic structural diagram of a data update device provided by an embodiment of the present invention;

[0044] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. Detailed implementation manners

[0045] For the purposes, technical solutions and advantages of the embodiments of the present invention to be clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Apparently, the described embodiments are some, rather than all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the scope of protection of the present invention.

[0046] A CDN network is a distributed network composed of node server clusters distributed in different regions. The central node server of the CDN network distributes user content to the node servers, and provides content data to users through the node servers, thereby effectively solving the congestion condition of the Internet network and improving the response speed of users accessing websites and the availability of websites. There are many nodes in the CDN network for providing services such as caching and acceleration to users; the nodes are usually divided into edge nodes, middle-layer nodes, upper-layer nodes, etc. A node can be implemented by a single device, in which case the node is in a single-machine mode, or can be implemented by a multi-machine cluster, in which case the node is in a multi-machine cluster mode.

[0047] Refer to Figure 1 As shown in the schematic structural diagram of a CDN, when the node is in a multi-machine cluster mode, a node usually includes multiple devices for implementing multiple roles. For example, a Linux Virtual Server (abbreviated as LVS), a relay device (also called Relay), a Cache caching device, a Live device, etc.; each of these roles can be implemented by one or more devices, or multiple of these roles can be integrated on one device for implementation.

[0048] The central control system needs to update various types of service data to each node. For example, refreshing service data, preheating service data, and configuring and issuing service data, etc.; the following takes refreshing service as an example for illustration. Refreshing, also called updating of the same-name content, is an operation of deleting or setting an expiration for a URL (Uniform Resource Locator) or a directory on the Cache caching device in the node. Refreshing is a commonly used function in the CDN service. After the content of the source site is updated, through refreshing, each layer of nodes in the CDN can update the latest content in a timely manner, ensuring that users can access the latest content information. Therefore, refreshing has relatively high requirements in terms of timeliness and success rate.

[0049] The implementation mode of refreshing is mostly that the central control system issues a refreshing task to the relay device in the node, and the relay device completes the refreshing task of the Cache caching device in the node. In a large CDN network, there are a huge number of Cache caching devices. These Cache caching devices may cause the failure of the refreshing task due to reasons such as downtime, software upgrade, high load, etc., which will ultimately affect the success rate of refreshing. To solve the problem of refreshing task failure, the implementation schemes in related technologies are mostly re-refreshing after failure, automatic removal of faulty devices, etc.; however, these methods require a long time to complete the refreshing task, sacrificing timeliness to ensure the success rate. These two indicators, timeliness and success rate, restrict each other and it is difficult to balance them.

[0050] Based on the above problems, this embodiment provides a data update method, device, content delivery network, and electronic device; this technology can be applied to scenarios of issuing various service data such as refreshing services, preheating services, and configuration distribution services in the CDN network.

[0051] As Figure 2 shown, this method is applied to a relay device in a content delivery network CDN node; this method includes the following steps:

[0052] Step S202, based on a preset data update task, update the data stored in the caching device in the node to obtain an update result; wherein, the data update task is issued by the CDN central control system; the update result is used to indicate whether the caching device successfully updates the data;

[0053] The data update task may specifically include data update tasks corresponding to various services such as refreshing services, preheating services, and configuration distribution services; the data update task is issued by the central control system of the CDN network to each node, and the relay device in the node receives the data update task. After receiving the data update task, the relay device can update the data stored in the caching device in the node based on this data update task. The update result is sent by the caching device to the relay device. For example, when the caching device updates successfully, the caching device returns an update result of successfully updating the data to the relay device; if the caching device updates fails, the caching device returns an update result of failed to update the data to the relay device.

[0054] The node may include one caching device or multiple caching devices; when there are multiple caching devices in the node, the relay device can obtain the update result corresponding to each caching device.

[0055] Step S204, if the ratio of the number of caching devices in the node that successfully update the data to the total number of caching devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system;

[0056] The relay device can count the number of cache devices that have successfully updated data based on the update results returned by each cache device; the total number of cache devices in the node can be obtained in advance; the above preset ratio threshold can also be set in advance. For example, it can be set to 90%, 95%, 98%, etc. That is, when most of the cache devices in the node have successfully updated data, it can be considered that the node has been successfully updated, and then information indicating that the node data has been successfully updated is returned to the central control system. The above preset ratio threshold can be uniformly configured by the central control system and then sent to each node; different ratio thresholds can be set for different nodes according to factors such as node type, region, and operator.

[0057] Step S206, if there is a target cache device in the node whose data update fails, update the data stored in the target cache device again based on the data update task.

[0058] When the number of cache devices that have successfully updated data is less than the total number of cache devices in the node, even if the ratio is higher than the preset ratio and information indicating that the node data has been successfully updated is returned to the central control system, there are still cache devices in the node whose data update fails. To improve the success rate of data update, after returning the information indicating that the node data has been successfully updated to the central control system, continue to update the target cache device whose data update fails at the node level.

[0059] The target cache device whose data update fails is often due to reasons such as downtime, slow response, software upgrade, and high load, resulting in data update failure. Usually, it takes a relatively long time to eliminate these reasons and successfully update this data; to avoid the failure of a small number of cache devices to update data from affecting the overall success rate and timeliness of the data update task, the above steps in this embodiment set a ratio threshold. When the ratio of the number of cache devices that have successfully updated data in the node to the total number of cache devices in the node is higher than this ratio threshold, information indicating that the node data has been successfully updated is returned to the central control system; thus, the success rate and timeliness of the data update task are improved as a whole; as for the target cache device with a small number of task update failures, the relay device continues to update the target cache device at the node level, without the central control system repeatedly sending update tasks, enabling the cache device with update failure to achieve self-healing within the node.

[0060] The above data update method updates the data stored in the cache devices in a node based on a preset data update task to obtain an update result. If the ratio of the number of cache devices in the node for which the data has been successfully updated to the total number of cache devices in the node is higher than a preset ratio threshold, an information indicating successful update of the node data is returned to the central control system. If there is a target cache device in the node for which the data update fails, the data stored in the target cache device is updated again based on the data update task. In this method, when the cache devices in the node for which the update is successful reach a certain proportion, an information indicating successful update of the node data can be returned to the central control system without waiting for the few cache devices for which the update fails to be successfully updated, thereby improving the timeliness of data update. At the same time, for the few cache devices for which the update fails, the relay device in the node continues to update the data, thereby increasing the success rate of data update within the node.

[0061] If there are a few target cache devices in the node for which the data update fails, while the relay device in the node continues to update the target cache devices, the relay device also needs to return the device information of the target cache devices to the central control system. This device information can uniquely identify the target cache devices. For example, it can be the URL (Uniform Resource Locator) information, IP (Internet Protocol Address) information, etc. of the devices. If the relay device in the node successfully updates the target cache devices when continuing to update them, the device information of the target cache devices is deleted from the central control system. If the continuous update fails, that is, the node self-healing fails, the central control system can continue to update the target cache devices in other ways to ensure that the target cache devices are finally updated successfully.

[0062] When there are target cache devices in the node for which the data update fails, in order to update the data stored in the target cache devices again based on the data update task, the following operations can be performed in a loop: update the data to the target cache devices for which the data update fails based on the data update task; record the number of executions of the operation. Specifically, the relay device in the node can send a data update instruction to the target cache devices for which the data update fails again based on the above data update task to update the data stored in the target cache devices. If there are multiple target cache devices, a data update instruction is sent to each target cache device. Before the first execution of the above operations, the number of executions of the operation can be initialized to zero; after each execution of the above operations, the following judgment can be made:

[0063] First, if there is a target cache device with successful updated data, return the information of the target cache device with successful updated data to the central control system; after performing the above operation once, some of the target cache data may be successfully refreshed. At this time, the relay device will no longer refresh the successfully refreshed target cache data subsequently, and also inform the central control system that the target cache data has been successfully refreshed and no other processing needs to be performed based on this target cache data.

[0064] Second, if the number of executions is less than the preset number threshold and there is a target cache device with failed updated data, continue to perform the operation; if the number of executions is less than the preset number threshold and all target cache devices have successfully updated data, stop performing the operation. The preset number threshold can be set to 10 times or other numbers. When the number of executions is less than the preset number threshold, as long as there is still one target cache device with failed updated data, the above operation needs to be continued for the target cache device with failed updated data; for the cache devices that have already successfully updated data, the above operation does not need to be performed again.

[0065] Finally, if the number of executions reaches the preset number threshold and there is a target cache device with failed updated data, stop performing the operation and return the information of the target cache device with failed updated data to the central control system. When the number of executions reaches the preset number threshold, if there is still a target cache device with failed updated data, this target cache device is likely to be in a down state and there is no need to perform the above operation again. At this time, return the information of the target cache device with failed updated data to the central control system, and the central control system will take other methods to update the data of this target cache device.

[0066] During the process of repeatedly performing the above operation, if the first information indicating that the target cache device is down is received, stop performing the operation; among them, this first information is sent by the central control system. The resource management system in the CDN network monitors the working status of each device in the CDN in real time or at regular intervals. For example, if cache device A goes down, the resource management system will inform the central control system of the information that cache device A is down, and the central control system will send this information to the relay device in the node to which cache device A belongs. After receiving the information that cache device A is down, the relay device will no longer perform operations on cache device A, that is, it will no longer update data to this cache device A.

[0067] To record the target cache devices for which data update fails, a first specified list can be set in the relay device. This first specified list can also be referred to as the device self-healing queue. If there are target cache devices in the node for which data update fails, record the device information of the target cache devices in the first specified list. If the target cache device successfully updates the data, delete the device information of the target cache device from the first specified list. During the process of repeatedly performing the above operations, for each successfully updated target cache device, delete the target cache device from the above first specified list. If there are still target cache devices in the first specified list, continue to perform the above operations.

[0068] When the number of execution times of the operation exceeds the above preset number threshold, even if there are still target cache devices in the first specified list for which the update fails, the relay device will no longer continue to update these target cache devices. And when the number of execution times of the operation exceeds the above preset number threshold, these target cache devices for which the update fails need to be reported to the central control system. Therefore, the device information stored in the first specified list becomes meaningless. At this time, an automatic cleaning mechanism for the first specified list needs to be set. If the duration of the device information of the target cache device in the first specified list exceeds the first preset duration, delete the device information of the target cache device from the first specified list. The first preset duration can be set in advance, for example, set to 15 minutes.

[0069] The above embodiment describes the processing method of the relay device when the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is higher than the preset ratio threshold and there are target cache devices in the node for which data update fails. In another case, if the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is lower than or equal to the preset ratio threshold, return information that the ratio is lower than or equal to the preset ratio threshold to the central control system. If the ratio of the number of cache devices in the node that successfully update the data to the total number of cache devices in the node is lower than or equal to the preset ratio threshold, it means that a relatively large proportion of the cache devices in this node have not been updated successfully. At this time, it can be considered that this node update fails and information that the ratio is lower than or equal to the preset ratio threshold needs to be returned to the central control system. The central control system needs to perform subsequent update processes based on this, such as automatically reflashing this node.

[0070] The following describes the data update method of this embodiment from the perspective of the content delivery network (CDN) central control system. The central control system issues a data update task to the relay device in the CDN node to perform the following operations through the relay device:

[0071] Based on the data update task, update the data stored in the cache devices in the node to obtain an update result; where the update result is used to indicate whether the cache devices have successfully updated the data; if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating successful node data update to the central control system; if there is a target cache device in the node with a failed data update, update the data stored in the target cache device again based on the data update task.

[0072] After the relay device finishes the above operations, if the central control system receives the information indicating successful node data update returned by the relay device, it means that the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than the preset ratio threshold, that is, most of the cache devices have successfully updated the data, and at this time, it is confirmed that the node data update is successful.

[0073] If the central control system receives the information indicating successful node data update returned by the relay device and also receives the device information of the target cache device with a failed data update returned by the relay device, record the device information of the target cache device in the second specified list; the second specified list is similar in function to the first specified list in the relay device and is used to record the device information of the target cache device with a failed data update; if the relay device subsequently updates the data of the target cache device in multiple cycles and receives the information indicating successful data update of the target cache device returned by the relay device, delete the device information of the target cache device from the second specified list. This method can ensure that the central control system can obtain the latest device update information in real time and ensure information synchronization.

[0074] When the relay device no longer executes the operation of updating the target cache device in a loop, the data in the second specified list is no longer updated. If there is still a target cache device with a failed data update in the second specified list, the target cache device needs to be transferred to other lists for subsequent other data update methods. Similar to the above first specified list, the second specified list also has an automatic cleaning mechanism. If the duration of the device information of the target cache device in the second specified list exceeds the second preset duration, delete the device information of the target cache device from the second specified list; record the device information of the target cache device in the automatic re - brush list to update the data stored in the target cache device again.

[0075] The second preset duration can be set in advance, for example, set to 15 minutes. The above automatic re - brush list is another list set in the central control system. After recording the device information of the target cache device in the automatic re - brush list, the central control system can send the data update task to the relay device of the node in real time or at regular intervals, and this data update task can update the target cache device recorded in the automatic re - brush list.

[0076] If the relay device in the node fails to update the data of the target cache device after multiple rounds of data update, the relay device returns information indicating that the data update of the target cache device has failed to the central control system; at this time, if the central control system receives the information indicating that the data update of the target cache device has failed returned by the relay device, it records the device information of the target cache device in the refresh and playback list to perform refresh and playback processing on the target cache device; and deletes the device information of the target cache device from the second specified list. The above refresh and playback list is set in the central control system, and the central control system performs refresh and playback processing on the target cache devices in the refresh and playback list in real time or according to a schedule. The refresh and playback processing is mainly used for: when the device switches from the paused state to the running state, performing supplementary refresh work on the data in the device. If the relay device fails to update the data of the target cache device after multiple rounds of data update, it can be inferred that the target cache device has crashed; at this time, the target cache device is placed in the refresh and playback list; when the target cache device is running normally, the central control system performs refresh and playback on the target cache devices in the refresh and playback list, and can complete the data update task of the target cache device.

[0077] After the central control system sends a data update task to the relay device in the node, if it receives information returned by the relay device that the ratio is lower than or equal to the preset ratio threshold, it records the device information of the target cache device in the automatic re - refresh list to update the data stored in the target cache device again. As can be seen from the foregoing embodiments, the above ratio is: the ratio of the number of cache devices in the node that have successfully updated data to the total number of cache devices in the node; if this ratio is lower than or equal to the preset ratio threshold, it means that a relatively large number of cache devices in the node have not been updated successfully. At this time, the central control system can consider that the data update of the node has failed, and by re - issuing a data update task to the node to which the target cache device in the automatic re - refresh list belongs, it can continue to update the data in the target cache device in the node. For example, the central control system can issue a data update task to the node to which the target cache device in the automatic re - refresh list belongs every certain period, such as 5 minutes or 10 minutes, etc. Automatic re - refresh can be understood as that the device status in the node is normal, but due to various reasons, the data update of the node fails, and the central control system retries later and sends a data update task to the node again.

[0078] After the central control system sends a data update task to the node, if it receives the second information indicating that the target cache device has crashed sent by the resource management system of the CDN, it determines the target list for recording the device information of the target cache device; if the target list is the second specified list or the automatic re - refresh list, it records the device information of the target cache device in the refresh and playback list; and deletes the device information of the target cache device from the target list.

[0079] As can be seen from the foregoing embodiments, the target cache device recorded in the second specified list is continuing to be updated again through the relay device within the node; the target cache device recorded in the automatic refresh list can send a data update task to the node to which the device belongs again through the central control system. Recording the target cache device that has crashed in the second specified list or the automatic refresh list is of little significance. At this time, the device information of the target cache device needs to be recorded in the refresh playback list; as can be seen from the foregoing embodiments, refresh playback is mainly used for: when the device transitions from the paused state to the running state, performing supplementary refresh work on the data in the device. The central control system performs refresh playback processing on the target cache device in the refresh playback list, and can complete the data update task for the crashed target cache device.

[0080] In addition, after the central control system receives the second information that the target cache device has crashed sent by the resource management system, in addition to deleting the device information of the target cache device from the target list, it also needs to send the information that the target cache device has crashed to the relay device in the node; so that the relay device stops performing data update operations on the target cache device.

[0081] After the step of recording the device information of the target cache device in the refresh playback list, if the information that the target cache device has returned to normal is received, it is judged whether the device information of the target cache device is recorded in the refresh playback list; if the device information of the target cache device is recorded in the refresh playback list, refresh playback processing is performed on the target cache device. In most cases, the crashed target cache device can return to normal within the specified time. If the crash duration of the target cache device is less than the third preset duration, refresh playback processing is performed on the target cache device; for example, the third preset duration is 24 hours, and at this time the target cache device is still recorded in the refresh playback list; however, if the target cache device has crashed for a long time and the refresh playback list has been cleared, then no refresh playback processing is performed on the target cache device at this time, and the target cache device can be directly initialized.

[0082] For a further understanding of the data update method in the above embodiments, refer to Figure 3 the process of another data update method shown in; this method is implemented through multi-party interaction, including the central control system, the relay device in the node, and the cache device (also known as Cache) in the node; among them, the refresh agent and the self-healing agent both run in the relay device.

[0083] First, the central control system issues a data update task to the refresh agent and calls the Refreshd program in the refresh agent, which can refresh the cache devices in the node; the refresh process can also be understood as data updating. The cache device returns information on whether the refresh is successful to the refresh agent.

[0084] For the refresh agent, if all the cache devices in the node are successfully refreshed, it reports the information that the node is successfully refreshed to the central control system. The central control system confirms that the node is successfully refreshed, and the node completes the data update task; however, as long as one cache device in the node fails to be refreshed, the refresh agent calls the self-healing agent.

[0085] After the self-healing agent is called, it needs to determine whether the ratio of the number of cache devices that are successfully refreshed in the node to the total number of cache devices in the node is higher than a preset ratio threshold; if it is higher than the preset ratio threshold, it can be considered that there are more cache devices that fail to be refreshed, and the ratio of the cache devices that fail to be refreshed is not exceeded, then it reports the information that the node is successfully refreshed to the central control system through the refresh agent, and at the same time reports the device information of the cache devices that fail to be refreshed; the central control system includes the device information of the cache devices that fail to be refreshed in the self-healing information; this self-healing information is the second specified list described in the above embodiment; at the same time, the self-healing agent will also record the above self-healing information itself. If the ratio is lower than or equal to the preset ratio threshold, it can be considered that there are fewer cache devices that fail to be refreshed, and the ratio of the cache devices that fail to be refreshed is exceeded, then it reports the information that the node fails to be refreshed to the central control system through the refresh agent, and at the same time reports the device information of the cache devices that fail to be refreshed; the central control system includes the device information of the cache devices that fail to be refreshed in the automatic re-refresh list.

[0086] In the case where the ratio is higher than the preset ratio threshold, the self-healing agent starts a timed retry operation. For example, it refreshes the cache devices that fail to be refreshed again every certain period of time; the retry operation can be looped a specified number of times, such as 10 times. During the operation, if there are cache devices that are successfully refreshed, it reports the device information of the cache devices that are successfully refreshed to the central control system through the refresh agent; the central control system then deletes the device information of this cache device from the above self-healing information. If there are still cache devices that fail to be refreshed after the retry times reach the specified number, the recorded self-healing information is deleted; at the same time, it reports the device information of the cache devices that fail to be refreshed to the central control system through the refresh agent; the central control system includes the cache devices that fail to be refreshed in the refresh playback list; at the same time, the recorded self-healing information is deleted.

[0087] In addition, the central control system is provided with a cleaning mechanism for self-healing information. When a certain duration is reached, such as 15 minutes, if it times out, the recorded self-healing information is automatically cleared, and the device information of the caching device in the self-healing information is included in the automatic re-flashing list. Similarly, the self-healing agent is also provided with a cleaning mechanism for self-healing information. When a certain duration is reached, such as 15 minutes, if it times out, the recorded self-healing information is automatically cleared.

[0088] If it is found that the device is in a suspended state, the central control system needs to check whether the device is in the self-healing information or the automatic re-flashing list; if it is in the self-healing information or the automatic re-flashing list, the device information of the device is recorded in the refresh playback list, and the device information of the device is deleted from the self-healing information or the automatic re-flashing list; at the same time, the self-healing agent is informed to delete the device information of the device from the self-healing queue. If the device information of the device is not in the self-healing information or the automatic re-flashing list, there is no need to record the device information of the device in the refresh playback list.

[0089] When the caching device switches from the suspended state to the normal operation state, the central control system needs to check whether the device is in the refresh playback list. If it is in the refresh playback list, the device is refreshed and played back, and at the same time, the state of the device is changed to the normal operation state; if the device is not in the refresh playback list, there is no need to refresh and play back the device, and only the operation state of the device needs to be changed.

[0090] The above data update method improves the success rate and timeliness of data update by means of node self-healing. In a node cluster, if a small number of devices (generally set to account for 5%) fail to be refreshed successfully, we will cache this task in the relay device of the node and try to re-flash a certain number of times, but report to the central control node that the node is refreshed successfully, and at the same time report the caching devices that have not been refreshed successfully. Before the self-healing time expires, if the caching device is refreshed successfully, the node will report the information that the caching device is refreshed successfully, and then remove the device information of the caching device from the self-healing queue; if the caching device fails, the device information of the caching device is moved into the refresh playback list; otherwise, the failure information is moved into the automatic re-flashing after expiration. Through this method, if a small number of devices in the node fail to be refreshed successfully, it can be digested at the node level; the refresh failure caused by temporarily high load is eliminated, and the refresh failure caused by the timeliness from the device probe down to the perception of the refreshed system is eliminated.

[0091] Corresponding to the above method embodiment, see Figure 4 The structural schematic diagram of a data update device shown in the figure. This device is set in the relay device of the content delivery network CDN node; this device includes:

[0092] The first update module 40 is configured to update the data stored in the cache device in the node based on a preset data update task, and obtain an update result; wherein, the data update task is sent by the CDN central control system; the update result is used to indicate whether the cache device has successfully updated the data.

[0093] The information return module 42 is configured to, if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system.

[0094] The second update module 44 is configured to, if there is a target cache device in the node whose data update fails, update the data stored in the target cache device again based on the data update task.

[0095] The above device further includes a device information return module, configured to, if there is a target cache device in the node whose data update fails, return the device information of the target cache device to the central control system.

[0096] The above second update module is further configured to perform the following operations: update data to the target cache device whose data update fails based on the data update task; record the number of executions of the operation; if there is a target cache device whose data update is successful, return the information of the target cache device whose data update is successful to the central control system; if the number of executions is less than a preset number threshold and there is a target cache device whose data update fails, continue to perform the operation; if the number of executions is less than a preset number threshold and all target cache devices have successfully updated the data, stop performing the operation; if the number of executions reaches the preset number threshold and there is a target cache device whose data update fails, stop performing the operation and return the information of the target cache device whose data update fails to the central control system.

[0097] The above device further includes an operation termination module, configured to: if a first piece of information indicating that the target cache device has crashed is received, stop performing the operation; wherein, the first piece of information is sent by the central control system.

[0098] The above device further includes a first information processing module, configured to: if there is a target cache device in the node whose data update fails, record the device information of the target cache device in a first specified list; if the target cache device has successfully updated the data, delete the device information of the target cache device from the first specified list; if the duration of the device information of the target cache device in the first specified list exceeds a first preset duration, delete the device information of the target cache device from the first specified list.

[0099] The above device further includes a second information return module, configured to: if the ratio of the number of cache devices in the node for which data has been successfully updated to the total number of cache devices in the node is lower than or equal to a preset ratio threshold, return information that the ratio is lower than or equal to the preset ratio threshold to the central control system.

[0100] This embodiment further provides a schematic structural diagram of another data update device; the device is disposed in the central control system of a content delivery network CDN; the device includes a task distribution module, configured to:

[0101] distribute a data update task to a relay device in the CDN node, so that the relay device performs the following operations: based on the data update task, update the data stored in the cache device in the node to obtain an update result; wherein, the update result is used to indicate whether the cache device has successfully updated the data; if the ratio of the number of cache devices in the node for which data has been successfully updated to the total number of cache devices in the node is higher than a preset ratio threshold, return information that the node data update is successful to the central control system; if there is a target cache device in the node for which data update fails, update the data stored in the target cache device again based on the data update task.

[0102] The above device further includes a confirmation module, configured to: if receiving the information that the node data update is successful returned by the relay device, confirm that the node data update is successful.

[0103] The above device further includes a second information processing module, configured to: if receiving the device information of the target cache device for which data update fails returned by the relay device, record the device information of the target cache device in a second specified list; if receiving the information that the target cache device has successfully updated the data returned by the relay device, delete the device information of the target cache device from the second specified list.

[0104] The above device further includes a second information processing module, configured to: if the duration of the device information of the target cache device in the second specified list exceeds a second preset duration, delete the device information of the target cache device from the second specified list; record the device information of the target cache device in an automatic re-flush list to update the data stored in the target cache device again.

[0105] The above device further includes a third information processing module, configured to: if receiving the information that the data update of the target cache device fails returned by the relay device, record the device information of the target cache device in a refresh playback list to perform a refresh playback process on the target cache device; delete the device information of the target cache device from the second specified list.

[0106] The above device further includes a fourth information processing module, which is configured to: if it receives information returned by a relay device with a ratio lower than or equal to a preset ratio threshold, record the device information of the target cache device into an automatic re-flushing list to update the data stored in the target cache device again.

[0107] The above device further includes a fifth information processing module, which is configured to: if it receives second information about the downtime of the target cache device, determine a target list for recording the device information of the target cache device; the second information is sent by the resource management system of the CDN; if the target list is a second specified list or an automatic re-flushing list, record the device information of the target cache device into a refresh playback list; and delete the device information of the target cache device from the target list.

[0108] The above device further includes an information sending module, which is configured to: send information about the downtime of the target cache device to the relay device in the node.

[0109] The above device further includes a first refresh playback module, which is configured to: if it receives information that the target cache device has returned to normal, determine whether the device information of the target cache device is recorded in the refresh playback list; if the device information of the target cache device is recorded in the refresh playback list, perform a refresh playback process on the target cache device.

[0110] The above device further includes a second refresh playback module, which is configured to: if the downtime duration of the target cache device is less than a third preset duration, perform a refresh playback process on the target cache device.

[0111] This embodiment further provides a content delivery network, which includes a central control system and at least one node; the node includes a relay device and a cache device; the network structure of the network can be referred to Figure 1 as shown, and the functions of the central control system and the relay device in this network are mainly described here.

[0112] First of all, the central control system is configured to: send a data update task to the relay device in the node; the relay device is configured to: based on the data update task, update the data stored in the cache device in the node to obtain an update result; the update result is used to indicate whether the cache device has successfully updated the data; if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node with a data update failure, update the data stored in the target cache device again based on the data update task.

[0113] The above relay device is further configured to: if there is a target cache device with a failed data update among the nodes, return the device information of the target cache device to the central control system; the central control system is further configured to: if it receives the device information of the target cache device with a failed data update returned by the relay device, record the device information of the target cache device in a second specified list.

[0114] The above relay device is further configured to: perform the following operations: update data to a target cache device with a failed data update based on a data update task; record the number of times the operation is executed; if there is a target cache device with a successfully updated data, return the information of the target cache device with a successfully updated data to the central control system; the central control system is further configured to: if it receives the information of the target cache device with a successfully updated data returned by the relay device, delete the device information of the target cache device from the second specified list.

[0115] The above relay device is further configured to: if the number of executions is less than a preset number threshold and there is a target cache device with a failed data update, continue to perform the operation; if the number of executions is less than the preset number threshold and all target cache devices are successfully updated with data, stop performing the operation; if the number of executions reaches the preset number threshold and there is a target cache device with a failed data update, stop performing the operation and return the information of the target cache device with a failed data update to the central control system; the central control system is further configured to: if it receives the information of the target cache device with a failed data update returned by the relay device, record the device information of the target cache device in a refresh playback list to perform a refresh playback process on the target cache device; delete the device information of the target cache device from the second specified list.

[0116] The above central control system is further configured to: if it receives the information that a target cache device has crashed, determine the target list that records the device information of the target cache device; the information is sent by the resource management system of the CDN; if the target list is the second specified list or the automatic re - refresh list, record the device information of the target cache device in the refresh playback list; delete the device information of the target cache device from the target list; send the information that the target cache device has crashed to the relay device in the node; the relay device is further configured to: if it receives the information that the target cache device has crashed sent by the central control system, stop performing the operation.

[0117] The above relay device is further configured to: if there is a target cache device with a failed data update in the node, record the device information of the target cache device in a first specified list; if the target cache device is successfully updated with data, delete the device information of the target cache device from the first specified list; if the duration of the device information of the target cache device in the first specified list exceeds a first preset duration, delete the device information of the target cache device from the first specified list.

[0118] The above relay device is also used to: if the ratio of the number of cache devices in the node where the data is successfully updated to the total number of cache devices in the node is lower than or equal to a preset ratio threshold, return the information that the ratio is lower than or equal to the preset ratio threshold to the central control system; the central control system is also used to: if it receives the information returned by the relay device that the ratio is lower than or equal to the preset ratio threshold, record the device information of the target cache device into the automatic re-flash list to update the data stored in the target cache device again.

[0119] The above central control system is also used to: if it receives the information that the node data update is successful returned by the relay device, confirm that the node data update is successful.

[0120] The above central control system is also used to: if the duration of the device information of the target cache device in the second specified list exceeds the second preset duration, delete the device information of the target cache device from the second specified list; record the device information of the target cache device into the automatic re-flash list to update the data stored in the target cache device again.

[0121] The above central control system is also used to: if it receives the information that the target cache device returns to normal, determine whether the device information of the target cache device is recorded in the refresh playback list; if the device information of the target cache device is recorded in the refresh playback list, perform a refresh playback process on the target cache device.

[0122] The above central control system is also used to: if the downtime duration of the target cache device is less than the third preset duration, perform a refresh playback process on the target cache device.

[0123] This embodiment also provides an electronic device, including a processor and a memory, where the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above data update method.

[0124] See Figure 5 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100, and the processor 100 executes the machine-executable instructions to implement the above data update method.

[0125] Furthermore, Figure 5 The electronic device shown also includes a bus 102 and a communication interface 103, and the processor 100, the communication interface 103, and the memory 101 are connected through the bus 102.

[0126] Among them, the memory 101 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk memory. The communication connection between this system network element and at least one other network element is realized through at least one communication interface 103 (which can be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 102 can be an ISA bus, a PCI bus, an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 5 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0127] The processor 100 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above method can be completed by the integrated logic circuit in the hardware of the processor 100 or instructions in software form. The above-mentioned processor 100 can be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it can also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. It can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in combination with the embodiments of the present invention can be directly embodied as being executed and completed by a hardware decoding processor, or executed and completed by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, register, etc. This storage medium is located in the memory 101, and the processor 100 reads the information in the memory 101 and combines its hardware to complete the steps of the method in the foregoing embodiments.

[0128] This embodiment also provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the above data update method.

[0129] The computer program product of the data update method, device, content delivery network, and electronic device provided by the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the foregoing method embodiments. For specific implementation, reference can be made to the method embodiments and will not be elaborated herein.

[0130] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems and devices described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0131] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installation", "connection", and "connection" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication inside two components. For those skilled in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.

[0132] If the above functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program code.

[0133] In the description of the present invention, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation to the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.

[0134] Finally, it should be noted that the above embodiments are only specific implementation manners of the present invention, used to illustrate the technical solutions of the present invention, rather than limiting it. The protection scope of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art within the technical scope disclosed by the present invention can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A data update method, characterized in that, The method is applied to a relay device in a content delivery network (CDN) node; the method includes: Updating data stored in a cache device in the node based on a preset data update task to obtain an update result; wherein, the data update task is sent by a CDN central control system; the update result is used to indicate whether the cache device has successfully updated the data; If the ratio of the number of cache devices in the node that have successfully updated data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; If there is a target cache device in the node with a failed data update, update the data stored in the target cache device again based on the data update task.

2. The method according to claim 1, characterized in that The method further includes: If there is a target cache device in the node with a failed data update, return the device information of the target cache device to the central control system.

3. The method according to claim 1, characterized in that, The step of updating the data stored in the target cache device again based on the data update task includes: Performing the following operations: updating data to a target cache device with a failed data update based on the data update task; recording the number of executions of the operation; if there is a target cache device with a successful data update, return the information of the target cache device with a successful data update to the central control system; If the number of executions is less than a preset number threshold and there is a target cache device with a failed data update, continue to perform the operation; if the number of executions is less than a preset number threshold and all target cache devices have been successfully updated, stop performing the operation; If the number of executions reaches the preset number threshold and there is a target cache device with a failed data update, stop performing the operation and return the information of the target cache device with a failed data update to the central control system.

4. The method according to claim 3, wherein The method further includes: If a first piece of information indicating that the target cache device has crashed is received, stop performing the operation; wherein, the first piece of information is sent by the central control system.

5. The method according to claim 3, wherein The method further includes: If there is a target cache device in the node with a failed data update, record the device information of the target cache device in a first specified list; If the target cache device has been successfully updated, delete the device information of the target cache device from the first specified list; If the duration of the device information of the target cache device in the first specified list exceeds a first preset duration, delete the device information of the target cache device from the first specified list.

6. The method according to claim 1, wherein The method further includes: If the ratio of the number of cache devices in the node that have successfully updated data to the total number of cache devices in the node is lower than or equal to the preset ratio threshold, return information indicating that the ratio is lower than or equal to the preset ratio threshold to the central control system.

7. A data update method, characterized in that, The method is applied to a CDN central control system of a content delivery network (CDN); the method includes: Sending a data update task to a relay device in a CDN node so that the relay device performs the following operations: Based on the data update task, update the data stored in the cache device in the node to obtain an update result; wherein, the update result is used to indicate whether the cache device has successfully updated the data; If the ratio of the number of cache devices in the node that have successfully updated data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; If there is a target cache device in the node with a data update failure, update the data stored in the target cache device again based on the data update task.

8. The method according to claim 7, wherein The method further includes: If receiving the information indicating that the node data update is successful returned by the relay device, confirm that the node data update is successful.

9. The method according to claim 7, wherein The method further includes: If receiving the device information of the target cache device with a data update failure returned by the relay device, record the device information of the target cache device in a second specified list; If receiving the information indicating that the target cache device has successfully updated data returned by the relay device, delete the device information of the target cache device from the second specified list.

10. The method according to claim 9, wherein The method further includes: If the duration of the device information of the target cache device in the second specified list exceeds a second preset duration, delete the device information of the target cache device from the second specified list; Record the device information of the target cache device in an automatic re-flash list to update the data stored in the target cache device again.

11. The method according to claim 9, wherein The method further includes: If receiving the information indicating that the target cache device has a data update failure returned by the relay device, record the device information of the target cache device in a refresh playback list to perform a refresh playback process on the target cache device; Delete the device information of the target cache device from the second specified list.

12. The method according to claim 7, wherein The method further includes: If receiving the information returned by the relay device that the ratio is lower than or equal to the preset ratio threshold, record the device information of the target cache device in an automatic re-flash list to update the data stored in the target cache device again.

13. The method according to claim 7, wherein The method further includes: If receiving a second piece of information indicating that the target cache device is down, determine a target list for recording the device information of the target cache device; the second piece of information is sent by the resource management system of the CDN; If the target list is the second specified list or the automatic re-flash list, record the device information of the target cache device in a refresh playback list; delete the device information of the target cache device from the target list; Wherein, the second specified list is used to record the device information of the target cache device with a data update failure, so that the relay device can continue to update the data of the target cache device in multiple loops; The automatic re-flash list is used to record the device information of the target cache device with a data update failure transferred from the second specified list when the relay device no longer loops to perform the operation of updating the target cache device and there are still target cache devices with data update failures in the second specified list, so that the relay device can continue to update the data of the target cache device in multiple loops; The refreshed playback list is used to record the device information of the target cache device that still fails to update data after the relay device has updated the data to the target cache device in multiple cycles, so as to perform refreshed playback processing on the target cache device; the refreshed playback processing is used for: when the device changes from the paused state to the running state, supplement and refresh the data in the device.

14. The method according to claim 13, wherein, After the step of deleting the device information of the target cache device from the target list, the method further includes: sending the information that the target cache device has crashed to the relay device in the node.

15. The method according to claim 13, wherein After the step of recording the device information of the target cache device into the refreshed playback list, the method further includes: If the information that the target cache device has returned to normal is received, determine whether the device information of the target cache device is recorded in the refreshed playback list; If the device information of the target cache device is recorded in the refreshed playback list, perform refreshed playback processing on the target cache device.

16. The method according to claim 15, wherein The step of performing refreshed playback processing on the target cache device includes: if the downtime of the target cache device is less than the third preset duration, perform refreshed playback processing on the target cache device.

17. A data update device, characterized in that, The device is arranged in a relay device in a Content Delivery Network (CDN) node; the device includes: A first update module, configured to update the data stored in the cache device in the node based on a preset data update task, and obtain an update result; wherein, the data update task is sent by a CDN central control system; the update result is used to indicate whether the cache device has successfully updated the data; An information return module, configured to, if the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return the information that the node data update is successful to the central control system; A second update module, configured to, if there is a target cache device in the node whose data update fails, update the data stored in the target cache device again based on the data update task.

18. A data update device, characterized in that, The device is arranged in a CDN central control system of a Content Delivery Network (CDN); the device includes: A task sending module, configured to send a data update task to a relay device in a CDN node, so as to perform the following operations through the relay device: Update the data stored in the cache device in the node based on the data update task, and obtain an update result; wherein, the update result is used to indicate whether the cache device has successfully updated the data; If the ratio of the number of cache devices in the node that have successfully updated the data to the total number of cache devices in the node is higher than a preset ratio threshold, return the information that the node data update is successful to the central control system; If there is a target cache device in the node whose data update fails, update the data stored in the target cache device again based on the data update task.

19. A content delivery network, characterized in that, The network includes a central control system and at least one node; the node includes a relay device and a cache device; The central control system is configured to: send a data update task to the relay device in the node; The relay device is used to: update the data stored in the cache device in the node based on the data update task, and obtain an update result; the update result is used to indicate whether the cache device has successfully updated the data; If the ratio of the number of cache devices in the node that have successfully updated data to the total number of cache devices in the node is higher than a preset ratio threshold, return information indicating that the node data update is successful to the central control system; if there is a target cache device in the node where the data update fails, update the data stored in the target cache device again based on the data update task.

20. The network according to claim 19, wherein, The relay device is further used to: if there is a target cache device in the node where the data update fails, return the device information of the target cache device to the central control system; The central control system is further used to: if it receives the device information of the target cache device where the data update fails returned by the relay device, record the device information of the target cache device in a second specified list.

21. The network according to claim 20, wherein, The relay device is further used to perform the following operations: update data to the target cache device where the data update fails based on the data update task; record the number of executions of the operation; If there is a target cache device that has successfully updated data, return the information of the target cache device that has successfully updated data to the central control system; The central control system is further used to: if it receives the information that the target cache device has successfully updated data returned by the relay device, delete the device information of the target cache device from the second specified list.

22. The network according to claim 21, wherein, The relay device is further used to: if the number of executions is less than a preset number threshold and there is a target cache device where the data update fails, continue to perform the operation; if the number of executions is less than a preset number threshold and all target cache devices have successfully updated data, stop performing the operation; If the number of executions reaches the preset number threshold and there is a target cache device where the data update fails, stop performing the operation and return the information of the target cache device where the data update fails to the central control system; The central control system is further used to: if it receives the information that the target cache device has failed to update data returned by the relay device, record the device information of the target cache device in a refresh playback list to perform a refresh playback process on the target cache device; Delete the device information of the target cache device from the second specified list.

23. The network according to claim 21, wherein, The central control system is further used to: if it receives the information that the target cache device has crashed, determine the target list that records the device information of the target cache device; the information is sent by the resource management system of the CDN; if the target list is the second specified list or the automatic re - refresh list, record the device information of the target cache device in the refresh playback list; Delete the device information of the target cache device from the target list; send the information that the target cache device has crashed to the relay device in the node; Among them, the second specified list is used to record the device information of the target cache device with data update failure, so that the relay device can continue to update the data to the target cache device in multiple loops; the automatic re-flush list is used to record the device information of the target cache device with data update failure transferred from the second specified list when the relay device no longer loops to execute the operation of updating the target cache device and there are still target cache devices with data update failure in the second specified list, so that the relay device can continue to update the data to the target cache device in multiple loops; the refresh playback list is used to record the device information of the target cache device that still fails to update the data after the relay device updates the data to the target cache device in multiple loops, so as to perform refresh playback processing on the target cache device; The refresh playback processing is used for: when the device changes from the paused state to the running state, perform supplementary refresh work on the data in the device; The relay device is further used for: if it receives the information that the target cache device has crashed sent by the central control system, stop executing the operation.

24. The network according to claim 21, wherein The relay device is further used for: If there is a target cache device with data update failure in the node, record the device information of the target cache device in the first specified list; If the target cache device successfully updates the data, delete the device information of the target cache device from the first specified list; If the duration of the device information of the target cache device in the first specified list exceeds the first preset duration, delete the device information of the target cache device from the first specified list.

25. The network according to claim 19, wherein, The relay device is further used for: if the ratio of the number of cache devices that successfully update the data in the node to the total number of cache devices in the node is lower than or equal to the preset ratio threshold, return the information that the ratio is lower than or equal to the preset ratio threshold to the central control system; The central control system is further used for: if it receives the information that the ratio is lower than or equal to the preset ratio threshold returned by the relay device, record the device information of the target cache device in the automatic re-flush list to update the data stored in the target cache device again.

26. The network according to claim 19, characterized in that, The central control system is further used for: if it receives the information that the node data update is successful returned by the relay device, confirm that the node data update is successful.

27. The network according to claim 20, wherein The central control system is further used for: If the duration of the device information of the target cache device in the second specified list exceeds the second preset duration, delete the device information of the target cache device from the second specified list; Record the device information of the target cache device in the automatic re-flush list to update the data stored in the target cache device again.

28. The network according to claim 23, wherein The central control system is further used for: If it receives the information that the target cache device has returned to normal, judge whether the device information of the target cache device is recorded in the refresh playback list; If the device information of the target cache device is recorded in the refresh playback list, perform a refresh playback process on the target cache device.

29. The network according to claim 28, wherein The central control system is further configured to: If the downtime of the target cache device is less than a third preset duration, perform a refresh playback process on the target cache device.

30. An electronic device, characterized in that, It includes a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the data update method according to any one of claims 1-6, or the data update method according to any one of claims 7-16.

31. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions cause the processor to implement the data update method according to any one of claims 1-6, or the data update method according to any one of claims 7-16.

Citation Information

Patent Citations

  • On-line progressive program updating method for wireless sensor network

    CN102665196A

  • Content updating method and content updating device

    CN108540505A