Performance data detection method and device, computer equipment and storage medium
By dynamically updating the status and count of detection tasks in the CDN network, and only performing detection tasks when users access it, the problem of increasing server processing pressure while increasing the resource utilization rate is improved.
Patent Information
- Application Number
- CN202510610966.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-13
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2045-05-13
AI Technical Summary
In large-scale CDN networks, fixed-cycle detection methods increase server processing pressure, resulting in a decrease in resource utilization.
By obtaining the first request timestamp of multiple content distribution nodes of each accelerated domain name in the content distribution network, dynamically update the status and task count of the detection task, and perform the detection task only when there is a user access.
It effectively avoids continuous detection requests when there is no user access for a long time, saves unnecessary detection overhead, and improves resource utilization of the content distribution network.
Smart Images

Figure CN120128511A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing technologies, and particularly to a method and apparatus for detecting performance data, a computer device, a storage medium, and a computer program product. Background Art
[0002] In the current Internet environment, the CDN (Content Delivery Network) dynamic acceleration technology is widely used to optimize the user access experience. For dynamic requests in business scenarios such as database queries, personalized recommendations, and real-time interactions, the CDN needs to efficiently return to the origin to ensure data timeliness and access stability.
[0003] For this purpose, related technologies usually adopt a periodic detection method to detect the network quality of the origin server and transit nodes to obtain key detection metrics such as RTT (Round-Trip Time), packet loss rate, download rate, and first packet time. Subsequently, the routing decision center of the CDN will select an optimal return-to-origin link based on this data to ensure fast and reliable transmission of dynamic requests.
[0004] However, for large-scale CDN networks, this fixed-period detection method increases the processing pressure on the server, resulting in a decrease in resource utilization. Summary of the Invention
[0005] Based on this, it is necessary to provide a method and apparatus for detecting performance data, a computer device, a computer-readable storage medium, and a computer program product that can improve the resource utilization of the content delivery network for the above technical problems.
[0006] In a first aspect, this application provides a method for detecting performance data. The method is applied to a content delivery network, which includes multiple content delivery nodes for responding to user requests for accelerated domain names. The method includes:
[0007] For each of the accelerated domain names, obtain the first request timestamps of multiple content delivery nodes; the first request timestamp is used to record the latest user request time of the accelerated domain name for the content delivery node;
[0008] Select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current time and the target timestamp; wherein, the detection task corresponds to one or more accelerated domain names, and the detection task is used to detect the performance data of the content delivery nodes;
[0009] Update the task count of the detection task according to the task status;
[0010] Execute the detection task according to the task status and the task count.
[0011] In one embodiment, updating the task count of the detection task according to the task status includes:
[0012] When the task status before update is inactive and the task status after update is active, register the detection task and increment the task count of the detection task by 1;
[0013] When the task status before update is active and the task status after update is inactive, decrement the task count of the detection task by 1;
[0014] When the task status before and after update is active, update the task count according to the change of the content distribution node corresponding to the accelerated domain name.
[0015] In one embodiment, updating the task count according to the change of the content distribution node corresponding to the accelerated domain name includes:
[0016] When the content distribution node corresponding to the accelerated domain name changes, perform the following steps:
[0017] For the changed content distribution node, register the detection task and increment the task count of the newly registered detection task by 1;
[0018] For the content distribution node before the change, decrement the task count of the detection task by 1.
[0019] In one embodiment, executing the detection task according to the task status and the task count includes:
[0020] When the task status is inactive, suspend the execution of the detection task;
[0021] When the task count is 0, cancel the registration of the detection task.
[0022] In one embodiment, after updating the task status of the detection task corresponding to the accelerated domain name according to the current time and the target timestamp, include:
[0023] When the task status is active, obtain the second request timestamp of the adjacent transit node of the content distribution node; the second request timestamp is used to record the latest user request time of the accelerated domain name for the adjacent transit node;
[0024] Compare the second request timestamp and the target timestamp;
[0025] When the target timestamp is greater than the second request timestamp, update the second request timestamp according to the target timestamp.
[0026] In one embodiment, the updating the task status of the probing task corresponding to the accelerated domain name according to the current moment and the target timestamp includes:
[0027] When the time difference between the current moment and the moment corresponding to the target timestamp is greater than a preset duration threshold, determine that the task status of the new probing task corresponding to the accelerated domain name is an inactive state;
[0028] When the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold, determine that the task status of the new probing task corresponding to the accelerated domain name is an active state.
[0029] In a second aspect, the present application further provides a performance data probing device, which is applied to a content delivery network. The content delivery network includes multiple content delivery nodes for responding to user requests for an accelerated domain name. The device includes:
[0030] A data acquisition module, configured to obtain, for each of the accelerated domain names, the first request timestamps of multiple content delivery nodes; the first request timestamp is used to record the latest user request time of the accelerated domain name for the content delivery node;
[0031] A status update module, configured to select the latest first request timestamp as the target timestamp, and update the task status of the probing task corresponding to the accelerated domain name according to the current moment and the target timestamp; wherein, the probing task corresponds to one or more of the accelerated domain names, and the probing task is used to probe the performance data of the content delivery node;
[0032] A task counting module, configured to update the task count of the probing task according to the task status;
[0033] A task processing module, configured to execute the probing task according to the task status and the task count.
[0034] In a third aspect, the present application further provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0035] For each of the accelerated domain names, obtain the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request time of the accelerated domain name for the content distribution nodes.
[0036] Select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current time and the target timestamp; wherein, the detection task corresponds to one or more of the accelerated domain names, and the detection task is used to detect the performance data of the content distribution nodes.
[0037] Update the task count of the detection task according to the task status.
[0038] Execute the detection task according to the task status and the task count.
[0039] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0040] For each of the accelerated domain names, obtain the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request time of the accelerated domain name for the content distribution nodes.
[0041] Select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current time and the target timestamp; wherein, the detection task corresponds to one or more of the accelerated domain names, and the detection task is used to detect the performance data of the content distribution nodes.
[0042] Update the task count of the detection task according to the task status.
[0043] Execute the detection task according to the task status and the task count.
[0044] In a fifth aspect, the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0045] For each of the accelerated domain names, obtain the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request time of the accelerated domain name for the content distribution nodes.
[0046] Select the latest first request timestamp as the target timestamp, and update the task status of the probe task corresponding to the accelerated domain name according to the current time and the target timestamp; wherein, the probe task corresponds to one or more of the accelerated domain names, and the probe task is used to probe the performance data of the content distribution node;
[0047] Update the task count of the probe task according to the task status;
[0048] Execute the probe task according to the task status and the task count.
[0049] The above performance data detection method, device, computer device, storage medium and computer program product are applied to a content distribution network including multiple content distribution nodes. For each accelerated domain name, by obtaining the first request timestamps of multiple content distribution nodes, the latest user request time of the accelerated domain name for the content distribution node is obtained. The content distribution network is used to respond to the user requests of the accelerated domain name. Therefore, the first request timestamp can represent the time when the corresponding accelerated domain name last sent a user request to each content distribution node. Next, select the latest first request timestamp as the target timestamp, and the target timestamp can represent the time when the corresponding accelerated domain name last sent a user request to the content distribution network. Update the task status of the probe task corresponding to the accelerated domain name according to the current time and the target timestamp. The probe task is used to probe the performance data of the content distribution node, and it corresponds to one or more accelerated domain names. Update the task count of the probe task according to the obtained task status, and a conclusion can be obtained on whether the probe task needs to be executed based on the situation of user requests sent by at least one accelerated domain name. Finally, execute the probe task according to the task status and the task count, and it can be dynamically determined whether the probe task should be executed based on the situation of the content distribution node receiving user requests, thereby avoiding continuously executing probe requests when there is no user access for a long time, saving unnecessary probe overhead, and thus improving the resource utilization rate of the content distribution network. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0051] Figure 1 It is an application environment diagram of the performance data detection method in an embodiment;
[0052] Figure 2 It is a flowchart of the performance data detection method in an embodiment;
[0053] Figure 3 Schematic diagram of the interaction relationship among the configuration platform, management server, and multiple nodes in the performance data detection method in one embodiment;
[0054] Figure 4 Schematic flowchart of step S206 in the performance data detection method in one embodiment;
[0055] Figure 5 Block diagram of the structure of the performance data detection device in one embodiment;
[0056] Figure 6 Internal structure diagram of a computer device in one embodiment;
[0057] Figure 7 Internal structure diagram of a computer device in another embodiment. Detailed implementation manners
[0058] In order to make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0059] The performance data detection method provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. The terminal 102 can be used to receive user requests and send the user requests to the server 104. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or can be placed in the cloud or other network servers. The data storage system can be used to store the first request timestamps of multiple content distribution nodes, as well as information such as the correspondence between the accelerated domain names and the detection tasks. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0060] In an exemplary embodiment, as Figure 2 shown, a performance data detection method is provided. Taking the method applied to the Figure 1 server 104 as an example for description, this method can be applied to a content delivery network. The content delivery network includes multiple content distribution nodes and is used to respond to user requests for accelerated domain names, as Figure 3As shown in the figure, the server 104 may include a configuration platform, multiple management servers, and multiple cache hosts. Among them, the configuration platform is used to send acceleration domain name configurations to the management servers according to user requests. The management servers are used to perform channel - specific configuration parsing after receiving the acceleration domain name configurations, and send HTTP requests to multiple cache hosts according to the configuration parsing results. The multiple cache hosts are used to form multiple content distribution nodes, and the content distribution nodes are divided into edge nodes and transit nodes. The following steps S202 to S208 are included. Among them:
[0061] Step S202: For each acceleration domain name, obtain the first request timestamps of multiple content distribution nodes.
[0062] Among them, the first request timestamp is used to record the latest user request time of the acceleration domain name for the content distribution node.
[0063] Exemplarily, the management server can periodically send batch HTTP requests to multiple cache hosts. For example, assume that there are currently three acceleration domain names A, B, and C. The management server can send batch HTTP requests to the cache hosts within its management scope at one time to query the user request timestamps of multiple acceleration domain names. After receiving the query request, the cache host can return the latest user request timestamp of each acceleration domain name as the first request timestamp according to its own access log or database.
[0064] Step S204: Select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the acceleration domain name according to the current time and the target timestamp.
[0065] Among them, the detection task corresponds to one or more acceleration domain names, and the detection task is used to detect the performance data of the content distribution node, such as round - trip delay, packet loss rate, download rate, and first - packet time, etc.
[0066] Exemplarily, the target timestamp can be expressed as Timestamp1:
[0067] Timestamp1 = max{RS1_Timestamp1, RS2_Timestamp1,..., RSn_Timestamp1}
[0068] Among them, RS1_Timestamp1 represents the latest timestamp of the user request of cache host 1 (the first request timestamp), RS2_Timestamp1 represents the latest timestamp of the user request of cache host 2 (the first request timestamp)..., and there are a total of n cache hosts in this node. For example, there are three cache hosts RS1, RS2, and RS3, which return the following timestamp data respectively: RS1 returns: domain name A (2024-03-19 12:00:01), domain name B (2024-03-19 11:58:30), domain name C (2024-03-19 12:01:15); RS2 returns: domain name A (2024-03-19 12:00:05), domain name B (2024-03-19 11:59:10), domain name C (2024-03-19 12:00:45); RS3 returns: domain name A (2024-03-19 11:59:55), domain name B (2024-03-19 11:59:00), domain name C (2024-03-19 12:00:30). After the management server collects this data, it selects the maximum timestamp among them as the target timestamp.
[0069] Subsequently, the management server compares the target timestamp with the current system time to determine whether the detection task is still within the validity period. Exemplarily, server 104 can determine that the task status of the detection task corresponding to the new accelerated domain name is inactive when the time difference between the current moment and the moment corresponding to the target timestamp is greater than the preset duration threshold; and determine that the task status of the detection task corresponding to the new accelerated domain name is active when the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold.
[0070] Further, if the current system time is 12:05:00 and the validity period of the detection task is set to 5 minutes, then calculate the time difference 12:05:00 - 12:00:10 = 4 minutes and 50 seconds, which means it is still within the validity period. Therefore, the management server can mark the status of the detection task as 1, indicating that the task is active, and continue to perform the detection operation to collect the performance data of the content distribution node. If the management server finds that the time difference between the current time and the target timestamp exceeds the validity period of the detection task, it indicates that the accelerated domain name has not been accessed by users for a long time, and the detection task should be marked as inactive. For example, if the current system time is 12:06:00 and the target timestamp is still 12:00:10, then the time difference is 6 minutes, exceeding the 5-minute validity period. In this case, the management server can mark the status of the detection task as 0, indicating that the task is no longer active, and the subsequent process will handle the subsequent operations of the inactive task.
[0071] Exemplarily, when the task status is active, the server 104 may also obtain a second request timestamp of an adjacent transit node of the content distribution node; the second request timestamp is used to record the latest user request time of the accelerated domain name for the adjacent transit node; compare the second request timestamp with the target timestamp; and update the second request timestamp according to the target timestamp when the target timestamp is greater than the second request timestamp.
[0072] Further, the management server of the server 104 may send an HTTP request to an adjacent transit node associated with an accelerated domain name that has been determined to be in an active state, notifying the node of the target timestamp of the domain name. For example, assume that the server 104 determines that the target timestamp of an accelerated domain name A is 12:00:10. Then it may send this timestamp to the adjacent transit node of the domain name, requesting it to update the local timestamp record.
[0073] After receiving the target timestamp, the adjacent transit node may compare it with the existing latest request timestamp of the accelerated domain name. For example, assume that the second request timestamp (Timestamp2) of the accelerated domain name of an adjacent transit node currently stores 11:59:50, and the target timestamp (Timestamp1) sent by the server 104 is 12:00:10. Then the adjacent transit node may compare the two, take the larger value as the latest timestamp, i.e., max(12:00:10, 11:59:50) = 12:00:10, and update this value to the memory as the latest user request time of the accelerated domain name on this adjacent transit node.
[0074] If the adjacent transit node finds that the stored Timestamp2 is already greater than the target timestamp sent by the management server, for example, the local Timestamp2 is 12:00:15 and the Timestamp1 sent by the server 104 is 12:00:10, then the adjacent transit node does not need to update and still maintains the current Timestamp2 = 12:00:15, ensuring that the timestamp update always maintains the latest user request time and will not be overwritten by an earlier time, thereby optimizing the data synchronization of the entire CDN acceleration link and enabling subsequent detection tasks to be adjusted based on the latest access situation.
[0075] Step S206, update the task count of the detection task according to the task status.
[0076] Among them, the task count of the detection task is used to track the activity of each detection task to ensure proper detection and performance monitoring of the accelerated domain name. Exemplarily, the management server may register a detection task and increment the task count of the detection task when the task status before the update is inactive and the task status after the update is active; when the task status before the update is active and the task status after the update is inactive, decrement the task count of the detection task.
[0077] Furthermore, the management server of server 104 can respectively obtain the status flag of the previous detection task and the status flag of the current detection task. If the status flag of the previous task is 0 (indicating an inactive state) and the current status flag is 1 (indicating an active state), then it can be considered that the detection task of this domain name has switched from an inactive state to an active state. In this case, the management server can immediately register the detection tasks for all content distribution nodes (including the origin server and the transit nodes) of the accelerated domain name. Exemplarily, all relevant origin server IP (addresses) and transit node IPs can be added to the detection task, and the detection task counts for these IPs will be incremented by 1, indicating that these nodes need to participate in the execution of the detection task. For example, if there are three IPs for the origin server and the transit nodes of an accelerated domain name respectively, then the detection task counts for these three IPs will be incremented to 1, indicating that they need to start participating in regular performance monitoring and data detection.
[0078] Conversely, if the status flag of the previous task is 1 (indicating an active state) and the current status flag is 0 (indicating an inactive state), then it can be considered that the detection task of this domain name has switched from an active state to an inactive state. At this time, the management server can reduce the detection task counts for the relevant origin server and transit nodes, that is, decrement their detection task counts by 1. The decrement operation of 1 indicates that the detection tasks for these IPs will no longer be executed. For example, if the previous detection task count for an IP is 1 and the status of the domain name becomes inactive, then the detection task count for this IP will be decremented to 0, indicating that the detection task for this node has ended. This process ensures the effective management of detection tasks and avoids redundant detection requests. When the detection task is in an active state, the system will increase the corresponding detection load, and when the detection task is no longer needed, the corresponding task count will be reduced, thereby reducing the detection pressure on the system. In this way, the system can dynamically adjust the number of detection tasks, thereby improving efficiency and reducing unnecessary resource consumption.
[0079] Step S208, execute the detection task according to the task status and the task count.
[0080] Exemplarily, the server 104 may suspend the execution of the detection task when the task status is inactive; and cancel the detection task when the task count is 0.
[0081] Furthermore, the task status of the detection task reflects whether the task needs to continue, and the task count indicates how many accelerated domain names are currently using the detection task for the same group of origin servers or relay nodes. Therefore, the server 104 can determine whether the count of the detection task is 0. If the count is 0, it means that no accelerated domain name is using this detection task. At this time, the server 104 can cancel the detection task for the relevant origin server or relay node and stop the performance detection of these nodes. The cancellation operation can effectively avoid sending invalid detection requests to nodes that no longer need to be detected, thus saving resources.
[0082] If the task count is not 0, it means that there are still other accelerated domain names sharing the detection task for the same origin server or relay node. In this case, the server 104 will not cancel the detection task but continue to maintain the operation of these tasks to ensure that the performance of each domain name can be continuously monitored. In this way, the system can avoid redundant detection of the origin server or relay node, thereby reducing the load on the node, improving efficiency, and helping to reduce the detection volume of the origin server and relay node. Especially when some accelerated domain names have no customer access or low traffic, unnecessary detection of these domain names can be avoided, thus reducing the burden on the origin server and relay node. In addition, as more customers access dynamic acceleration, the increase in the number of detection tasks may affect the system performance. Therefore, by efficiently managing the registration and cancellation of different accelerated domain names sharing the same detection task, the system can continuously provide efficient and reliable content distribution services without affecting performance.
[0083] In the above performance data detection method, which is applied to a content distribution network including multiple content distribution nodes, for each accelerated domain name, by obtaining the first request timestamps of multiple content distribution nodes, the latest user request time of the accelerated domain name for the content distribution nodes is obtained. The content distribution network is used to respond to user requests of the accelerated domain name. Therefore, the first request timestamp can represent the time when the corresponding accelerated domain name last sent a user request to each content distribution node. Next, the latest first request timestamp is selected as the target timestamp, and the target timestamp can represent the time when the corresponding accelerated domain name last sent a user request to the content distribution network. The task status of the detection task corresponding to the accelerated domain name is updated according to the current time and the target timestamp. The detection task is used to detect the performance data of the content distribution nodes and corresponds to one or more accelerated domain names. The task count of the detection task is updated according to the obtained task status. It is possible to obtain a conclusion on whether the detection task needs to be executed based on the situation of user requests sent by at least one accelerated domain name. Finally, the detection task is executed according to the task status and the task count, and it is possible to dynamically determine whether the detection task should be executed based on the situation of the content distribution nodes receiving user requests, thereby avoiding continuously executing detection requests when there is no user access for a long time, saving unnecessary detection overhead, and thus improving the resource utilization rate of the content distribution network.
[0084] In an exemplary embodiment, as Figure 4 shown, step S206 includes steps S302 to S306. Among them:
[0085] Step S302, when the task status before update is inactive and the task status after update is active, register the detection task and increment the task count of the detection task by 1.
[0086] Exemplarily, when the task status of an accelerated domain name switches from inactive to active, it means that there is user access to this accelerated domain name. The server 104 can register a new detection task and ensure that the detection task can monitor the performance data of the origin server and the transit nodes. Therefore, in this case, the server 104 can perform the registration operation of the detection task and increment the count of this task by 1 to indicate that there is a new accelerated domain name using this detection task.
[0087] Step S304, when the task status before update is active and the task status after update is inactive, decrement the task count of the detection task by 1.
[0088] Exemplarily, when the status of the detection task changes from the active state to the inactive state, it indicates that there are no longer user requests for this accelerated domain name, and the server 104 needs to reduce the count of the detection task. At this time, the server 104 can decrement the task count of the detection task by 1 to reflect the decrease in the number of accelerated domain names still using this task. If the task count drops to 0, it means that no accelerated domain name is using this detection task. At this time, the server 104 can enter the subsequent task cancellation process and stop detecting this origin server or relay node to reduce unnecessary resource consumption.
[0089] Step S306, in the case where the task status before and after the update is the active state, update the task count according to the change situation of the content distribution node corresponding to the accelerated domain name.
[0090] In the case where the sub-channel configuration has not changed, although the configuration of the accelerated domain name itself has not changed, DNS (Domain Name System) resolution may change due to the coverage adjustment of the domain name resolution group, which may further lead to changes in the content distribution nodes (origin server and relay parent node). DNS resolution change means that when the resolution result of the domain name changes, new source IPs or relay parent node IPs may appear, or the original IPs are no longer valid. At this time, the system needs to make corresponding adjustments to ensure that the accelerated domain name can return to the origin stably and accurately. If the resolution result changes, the new source IPs and relay parent node IPs need to be registered as detection tasks, and performance detection of these new nodes needs to be started to ensure that the new origin servers and relay nodes can correctly participate in the selection of the acceleration and return-to-origin links and obtain new performance data in a timely manner. At the same time, the management server also needs to cancel the detection tasks of the old source IPs and relay parent node IPs to avoid wasting computing resources and causing unnecessary load.
[0091] Therefore, in this embodiment, the management server can start an independent coroutine (i.e., a lightweight task that executes concurrently), and periodically perform DNS resolution operations on the return-to-origin domain name and the relay parent node domain name. The role of the coroutine is to periodically check for changes in DNS resolution and update the resolution result in a timely manner to ensure that the detection tasks in the system always maintain the latest status and ensure that the return-to-origin path of the accelerated domain name can select the correct and valid source IPs and relay parent node IPs.
[0092] Exemplarily, when the content distribution node corresponding to the accelerated domain name changes, the server 104 can perform the following steps: for the changed content distribution node, register a detection task and increment the task count of the newly registered detection task by 1; for the content distribution node before the change, decrement the task count of the detection task by 1.
[0093] Further, when the server 104 processes the situation where the content distribution nodes of the accelerated domain name may change. First, the server 104 can determine whether the probing task of the domain name was active last time. If the previous task status was active, then the server 104 can further check whether the origin site and the transit parent node have changed. If the origin site and the transit parent node have changed, the server 104 can take a series of operations to update the task count of the probing task. Specifically, the server 104 can register new probing tasks for the new origin IP and the new transit parent node IP, and increment the task count of these newly registered probing tasks by 1. Since as the origin site or the transit node of the accelerated domain name changes, new nodes need to be monitored and probed so as to obtain the performance data of these nodes in a timely manner, thereby making reasonable routing decisions. At the same time, the server 104 will also decrement the task count of the probing task for the old origin IP and the old transit parent node IP, thereby reflecting that these nodes no longer require probing tasks and reducing the burden on the system.
[0094] In addition, if the origin site or the transit parent node has not changed, then the server 104 does not need to perform any additional processing, and the task count and the probing task remain unchanged, thereby ensuring that the task count is adjusted only when the actual network topology of the accelerated domain name changes, thereby efficiently managing the probing task and reducing redundant performance consumption.
[0095] In another exemplary embodiment, in order to update the probing task status of all accelerated domain names under the sub-channel directory in a timely manner, the management server starts an independent coroutine to periodically initiate an HTTP request to batch query the maximum timestamps of user requests for each accelerated domain name from the cache host group covered by the management server (including edge nodes and transit nodes), and determine whether the requests for each accelerated domain name are still active.
[0096] During the execution process, the management server first obtains the maximum request timestamp of each accelerated domain name as the first request timestamp, compares them to obtain the target timestamp, and obtains the task status of whether the probing task is active. If the request for the current domain name is in an active state while the request for this domain name was in an inactive state last time, then the probing task status of this domain name is marked as 1, indicating that the probing task has become active. At this time, the management server notifies the corresponding transit nodes, informs them of the latest timestamp, and immediately registers the probing tasks for all origin IPs and transit node IPs of this domain name. The task count of each newly registered origin IP and transit parent node IP probing task will be incremented by 1.
[0097] Conversely, if the current request is in an inactive state and the previous request was in an active state, the management server marks the probing task status of the domain name as 0, indicating that the task has become inactive. At this time, the management server reduces the probing task counts for all source IPs and transit parent node IPs. If the probing task count for a certain IP is 0, the management server cancels the probing task corresponding to that IP. If the probing task count is still greater than 0, it means that the IP is still shared by other accelerated domain names, so the probing task cannot be cancelled. The management server can effectively update the probing task status of the accelerated domain name, ensure that redundant probing is no longer performed, avoid unnecessary performance consumption, and at the same time ensure that the probing tasks of the source station and transit nodes are always consistent with the actual access status of the accelerated domain name.
[0098] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0099] Based on the same inventive concept, an embodiment of the present application further provides a performance data probing device for implementing the performance data probing method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the performance data probing device provided below can refer to the limitations on the performance data probing method in the above text, and will not be repeated here.
[0100] In an exemplary embodiment, as Figure 5 shown, a performance data probing device is provided. The device is applied to a content delivery network, and the content delivery network includes multiple content delivery nodes for responding to user requests for accelerated domain names, and includes: a data acquisition module 402, a status update module 404, a task counting module 406, and a task processing module 408, where:
[0101] The data acquisition module 402 is configured to obtain, for each accelerated domain name, the first request timestamps of multiple content delivery nodes; the first request timestamps are used to record the latest user request time of the accelerated domain name for the content delivery nodes;
[0102] A status update module 404 is used to select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current time and the target timestamp; wherein, the detection task corresponds to one or more accelerated domain names, and the detection task is used to detect the performance data of the content distribution node;
[0103] A task counting module 406 is used to update the task count of the detection task according to the task status;
[0104] A task processing module 408 is used to execute the detection task according to the task status and the task count.
[0105] In one embodiment, the task counting module 406 includes:
[0106] A first counting unit is used to register the detection task and increment the task count of the detection task by 1 when the task status before update is inactive and the task status after update is active; and decrement the task count of the detection task by 1 when the task status before update is active and the task status after update is inactive;
[0107] A second counting unit is used to update the task count according to the change of the content distribution node corresponding to the accelerated domain name when the task status before and after update is active.
[0108] In one embodiment, the second counting unit is specifically used to: when the content distribution node corresponding to the accelerated domain name changes, perform the following steps: for the changed content distribution node, register the detection task and increment the task count of the newly registered detection task by 1; for the content distribution node before the change, decrement the task count of the detection task by 1.
[0109] In one embodiment, the task processing module 408 is specifically used to: pause the execution of the detection task when the task status is inactive; cancel the detection task when the task count is 0.
[0110] In one embodiment, the status update module 404 is further used to: when the task status is active, obtain the second request timestamp of the adjacent transit node of the content distribution node; the second request timestamp is used to record the latest user request time of the accelerated domain name for the adjacent transit node; compare the second request timestamp and the target timestamp; and update the second request timestamp according to the target timestamp when the target timestamp is greater than the second request timestamp.
[0111] In one embodiment, the status update module 404 is specifically configured to: determine that the task status of the detection task corresponding to the new acceleration domain name is an inactive state when the time difference between the current moment and the moment corresponding to the target timestamp is greater than a preset duration threshold; and determine that the task status of the detection task corresponding to the new acceleration domain name is an active state when the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold.
[0112] Each module in the above performance data detection device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0113] In an exemplary embodiment, a computer device is provided. The computer device can be a server, and its internal structure diagram can be as Figure 6 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the first request timestamps of multiple content distribution nodes, as well as information such as the correspondence between acceleration domain names and detection tasks. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a performance data detection method.
[0114] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 7As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it realizes a performance data detection method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.
[0115] Those skilled in the art can understand that Figure 7 the structure shown in the figure is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0116] In an exemplary embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory. When the processor executes the computer program, the following steps are implemented: for each accelerated domain name, obtain the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request times of the accelerated domain names for the content distribution nodes; select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current moment and the target timestamp; wherein, the detection task corresponds to one or more accelerated domain names, and the detection task is used to detect the performance data of the content distribution nodes; update the task count of the detection task according to the task status; execute the detection task according to the task status and the task count.
[0117] In one embodiment, when the processor executes a computer program, the following steps are further implemented: when the task state before update is an inactive state and the task state after update is an active state, register a probe task and increment the task count of the probe task by 1; when the task state before update is an active state and the task state after update is an inactive state, decrement the task count of the probe task by 1; when the task states before and after update are both active states, update the task count according to the change situation of the content distribution node corresponding to the accelerated domain name.
[0118] In one embodiment, when the processor executes a computer program, the following steps are further implemented: when the content distribution node corresponding to the accelerated domain name changes, execute the following steps: for the changed content distribution node, register a probe task and increment the task count of the newly registered probe task by 1; for the content distribution node before the change, decrement the task count of the probe task by 1.
[0119] In one embodiment, when the processor executes a computer program, the following steps are further implemented: when the task state is an inactive state, suspend the execution of the probe task; when the task count is 0, cancel the registration of the probe task.
[0120] In one embodiment, when the processor executes a computer program, the following steps are further implemented: when the task state is an active state, obtain the second request timestamp of the adjacent transit node of the content distribution node; the second request timestamp is used to record the latest user request time of the accelerated domain name for the adjacent transit node; compare the second request timestamp with the target timestamp; when the target timestamp is greater than the second request timestamp, update the second request timestamp according to the target timestamp.
[0121] In one embodiment, when the processor executes a computer program, the following steps are further implemented: when the time difference between the current moment and the moment corresponding to the target timestamp is greater than the preset duration threshold, determine that the task state of the probe task corresponding to the new accelerated domain name is an inactive state; when the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold, determine that the task state of the probe task corresponding to the new accelerated domain name is an active state.
[0122] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: for each accelerated domain name, obtain the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request times of the accelerated domain names for the content distribution nodes; select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the accelerated domain name according to the current moment and the target timestamp; wherein, the detection task corresponds to one or more accelerated domain names, and the detection task is used to detect the performance data of the content distribution nodes; update the task count of the detection task according to the task status; and execute the detection task according to the task status and the task count.
[0123] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in the case where the task status before update is an inactive state and the task status after update is an active state, register the detection task and increment the task count of the detection task by 1; in the case where the task status before update is an active state and the task status after update is an inactive state, decrement the task count of the detection task by 1; in the case where the task status before and after update are both active states, update the task count according to the change situation of the content distribution nodes corresponding to the accelerated domain name.
[0124] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in the case where the content distribution nodes corresponding to the accelerated domain name change, perform the following steps: for the changed content distribution nodes, register the detection task and increment the task count of the newly registered detection task by 1; for the content distribution nodes before the change, decrement the task count of the detection task by 1.
[0125] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in the case where the task status is an inactive state, suspend the execution of the detection task; in the case where the task count is 0, cancel the registration of the detection task.
[0126] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: in the case where the task status is an active state, obtain the second request timestamp of the adjacent transit nodes of the content distribution nodes; the second request timestamp is used to record the latest user request times of the accelerated domain names for the adjacent transit nodes; compare the second request timestamp with the target timestamp; in the case where the target timestamp is greater than the second request timestamp, update the second request timestamp according to the target timestamp.
[0127] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the time difference between the current moment and the moment corresponding to the target timestamp is greater than a preset duration threshold, determining that the task status of the detection task corresponding to the new accelerated domain name is an inactive state; when the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold, determining that the task status of the detection task corresponding to the new accelerated domain name is an active state.
[0128] In one embodiment, a computer program product is provided, including a computer program, which when executed by a processor, implements the following steps: for each accelerated domain name, obtaining the first request timestamps of multiple content distribution nodes; the first request timestamps are used to record the latest user request time of the accelerated domain name for the content distribution nodes; selecting the latest first request timestamp as the target timestamp, and updating the task status of the detection task corresponding to the accelerated domain name according to the current moment and the target timestamp; wherein, the detection task corresponds to one or more accelerated domain names, and the detection task is used to detect the performance data of the content distribution nodes; updating the task count of the detection task according to the task status; and executing the detection task according to the task status and the task count.
[0129] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the task status before the update is an inactive state and the task status after the update is an active state, registering the detection task and incrementing the task count of the detection task by 1; when the task status before the update is an active state and the task status after the update is an inactive state, decrementing the task count of the detection task by 1; when the task status before and after the update are both active states, updating the task count according to the change situation of the content distribution nodes corresponding to the accelerated domain name.
[0130] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the content distribution nodes corresponding to the accelerated domain name change, the following steps are executed: for the changed content distribution nodes, registering the detection task and incrementing the task count of the newly registered detection task by 1; for the content distribution nodes before the change, decrementing the task count of the detection task by 1.
[0131] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the task status is an inactive state, suspending the execution of the detection task; when the task count is 0, canceling the detection task.
[0132] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the task status is the active state, obtain the second request timestamp of the adjacent transit node of the content distribution node; the second request timestamp is used to record the latest user request time of the acceleration domain name for the adjacent transit node; compare the second request timestamp with the target timestamp; when the target timestamp is greater than the second request timestamp, update the second request timestamp according to the target timestamp.
[0133] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: when the time difference between the current moment and the moment corresponding to the target timestamp is greater than the preset duration threshold, determine that the task status of the detection task corresponding to the new acceleration domain name is the inactive state; when the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold, determine that the task status of the detection task corresponding to the new acceleration domain name is the active state.
[0134] It should be noted that the collection, use, and processing of the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application need to comply with relevant regulations.
[0135] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, etc., without limitation.
[0136] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.
[0137] The above-described embodiments merely represent several implementation manners of the present application. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A performance data detection method, characterized in that: The method is applied to a content distribution network, the content distribution network includes a plurality of content distribution nodes, and is used to respond to user requests for acceleration domain names. The method includes: For each of the acceleration domain names, obtaining first request timestamps of the plurality of content distribution nodes; the first request timestamp is used to record the latest user request time of the acceleration domain name to the content distribution node; Select the latest first request timestamp as the target timestamp, and update the task status of the detection task corresponding to the acceleration domain name according to the current time and the target timestamp; wherein the detection task corresponds to one or more acceleration domain names, and the detection task is used to detect the performance data of the content distribution node; Update the task count of the detection task according to the task status; The detection task is executed according to the task state and the task count.
2. The method according to claim 1, characterized in that The updating of the task count of the detection task according to the task status includes: When the task state before the update is an inactive state and the task state after the update is an active state, register the detection task and increase the task count of the detection task by 1; When the task state before the update is an active state and the task state after the update is an inactive state, the task count of the detection task is reduced by 1; When the task status before and after the update is both in the active state, the task count is updated according to the change of the content distribution node corresponding to the acceleration domain name.
3. The method according to claim 2, characterized in that The updating of the task count according to the change of the content distribution node corresponding to the acceleration domain name includes: When the content distribution node corresponding to the acceleration domain name changes, perform the following steps: For the changed content distribution node, register the detection task, and add 1 to the task count of the newly registered detection task; For the content distribution node before the change, the task count of the detection task is reduced by 1.
4. The method according to claim 1, characterized in that: The performing the detection task according to the task state and the task count includes: When the task state is an inactive state, suspending execution of the detection task; When the task count is 0, the detection task is cancelled.
5. The method according to any one of claims 1 to 4, characterized in that: After the task status of the detection task corresponding to the acceleration domain name is updated according to the current time and the target timestamp, the method includes: When the task status is active, obtaining a second request timestamp of an adjacent transfer node of the content distribution node; the second request timestamp is used to record the latest user request time of the acceleration domain name to the adjacent transfer node; comparing the second request timestamp with the target timestamp; When the target timestamp is greater than the second request timestamp, the second request timestamp is updated according to the target timestamp.
6. The method according to any one of claims 1 to 4, characterized in that: The updating of the task status of the detection task corresponding to the acceleration domain name according to the current time and the target timestamp includes: When the time difference between the current time and the time corresponding to the target timestamp is greater than a preset time threshold, determining that the task state of the new detection task corresponding to the acceleration domain name is in an inactive state; When the time difference between the current moment and the moment corresponding to the target timestamp is less than or equal to the preset duration threshold, it is determined that the task state of the new detection task corresponding to the acceleration domain name is an active state.
7. A performance data detection device, characterized in that: The device is applied to a content distribution network, the content distribution network includes a plurality of content distribution nodes, and is used to respond to a user request for an acceleration domain name. The device includes: A data acquisition module, used to acquire, for each of the acceleration domain names, a first request timestamp of the plurality of content distribution nodes; the first request timestamp is used to record the latest user request time of the acceleration domain name to the content distribution node; A status update module, configured to select the latest first request timestamp as a target timestamp, and update the task status of the detection task corresponding to the acceleration domain name according to the current time and the target timestamp; wherein the detection task corresponds to one or more acceleration domain names, and the detection task is used to detect the performance data of the content distribution node; A task counting module, used for updating the task count of the detection task according to the task status; A task processing module is used to execute the detection task according to the task state and the task count.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Dynamic acceleration method and device in content distribution network
CN107517228A
CDN quality detection method and system
CN112839089A
Service request processing method and device, equipment and storage medium
CN113037862A
Execution method and device of detection task, equipment, storage medium and product
CN115174434A
Method and device for detecting upper link of content distribution node, and computer equipment
CN119544575A