Method and device for detecting upper link of content distribution node, and computer equipment
By using a consistent hash ring in the CDN to determine the second node server and forward the detection request to the server, the problem of low detection efficiency of upper-level links in the CDN is solved, and efficient detection and fault avoidance of upper-level links are achieved.
Patent Information
- Application Number
- CN202411708875.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2044-11-27
AI Technical Summary
In content distribution network (CDN), it is difficult for the prior art to efficiently detect the server status of the upper-layer link, resulting in the inability to detect and avoid forwarding of requests to the failed server when the upper-layer link fails.
By using a consistent hash ring in the content distribution node, the first hash value is calculated to determine the second node server, and forward the detection request of the upper link to the second node server for detection, ensuring that there is and only one server in the same content distribution node initiates a detection request for the upper link.
It realizes efficient detection of the upper-layer link, reduces the number of detection requests, ensures efficient execution of detection tasks, and avoids forwarding of requests to the failed server.
Smart Images

Figure CN119544575A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, and computer equipment for detecting an upper link of a content distribution node. Background Art
[0002] In the content delivery network (CDN), the service model is that the edge node receives the user's request, then sends the user request to the parent node of the upper layer, and the parent node sends the user request to the customer's source station. When a node at a certain layer in the CDN network forwards the request to the upper link, it is necessary to avoid sending the request to a faulty server. Therefore, when forwarding the request, the lower link needs to detect the server of the upper link.
[0003] In the related art, the status of a server in the upper link can be marked back through the user's real request. When the user's real request fails to return to this server, this server is marked as faulty and remains unavailable for a period of time. The user's real request will no longer be forwarded to the faulty server. However, the user's real request cannot sense whether the upper server has returned to normal during the unavailable period, and the efficiency of the upper link detection cannot be ensured. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device and computer equipment for detecting the upper link of a content distribution node in order to solve the above technical problems.
[0005] In a first aspect, the present application provides a method for detecting an upper link of a content distribution node, which is applied to a first node server in the content distribution node. The method comprises:
[0006] In response to the upper layer link detection request of the first node server, obtaining link information of the upper layer link;
[0007] Calculating a first Hash value of first Hash value input data, where the first Hash value input data is calculated based on the link information;
[0008] Based on the first hash value, a second node server on a consistent hash ring is obtained, where the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, where the node server in a normal state includes a node server that normally sends a request to an upper link and receives a response;
[0009] Sending a detection request of the upper layer link to the second node server, so that the second node server detects the upper layer link based on the detection request;
[0010] Receive a detection result of the second node server detecting the upper layer link.
[0011] In one embodiment, the method further comprises:
[0012] storing second Hash value input data, where the second Hash value input data is calculated based on a detection result of the second node server;
[0013] The updated detection result is obtained from the second node server corresponding to the second Hash value input data based on the second Hash value input data at a regular basis.
[0014] In one of the embodiments, after obtaining the link information of the upper layer link, the method further includes:
[0015] It is determined whether the upper layer link operates normally based on the link information of the upper layer link, and in the case of a failure of the upper layer link, other upper layer links excluding the failed upper layer link are selected for detection.
[0016] In one of the embodiments, in the case of all upper layer link failures, the method further comprises:
[0017] Randomly select any upper link for detection. If no detection result is received, reselect other upper links for detection.
[0018] In one of the embodiments, if the second node server does not receive an updated detection result within a preset time, the detection request of the second node server is deleted.
[0019] In one embodiment, obtaining a second node server on a consistent hash ring based on the first hash value includes:
[0020] Calculate a second hash value of a node server in a normal state based on a hash function, and map the second hash value to different positions on a hash ring to form a consistent hash ring;
[0021] The first hash value is mapped to the consistent hash ring to obtain a hash value within a preset range, and a corresponding second node server is obtained based on the hash value within the preset range.
[0022] In a second aspect, the present application further provides a detection device for an upper link of a content distribution node, which is applied to a first node server in the content distribution node, and the device includes:
[0023] A response module, configured to obtain link information of the upper link in response to the upper link detection request of the first node server;
[0024] A calculation module, configured to calculate a first Hash value of first Hash value input data based on a Hash function, wherein the first Hash value input data is calculated based on the link information;
[0025] A switching module, configured to obtain a second node server on a consistent hash ring based on the first hash value, wherein the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, wherein the node server in a normal state includes a node server that normally sends a request to an upper link and receives a response;
[0026] A sending module, used for sending the detection request of the upper link to the second node server, so that the second node server detects the upper link;
[0027] A receiving module is used to receive the detection result of the second node server.
[0028] In one embodiment, the device further comprises:
[0029] storing second Hash value input data, where the second Hash value input data is calculated based on a detection result of the second node server;
[0030] The updated detection result is obtained from the second node server corresponding to the second Hash value input data based on the second Hash value input data at a regular basis.
[0031] In one of the embodiments, after obtaining the link information of the upper layer link, the device further includes:
[0032] It is determined whether the upper layer link operates normally based on the link information of the upper layer link, and in the case of a failure of the upper layer link, other upper layer links excluding the failed upper layer link are selected for detection.
[0033] In one of the embodiments, in the case of all upper layer link failures, the apparatus further comprises:
[0034] Randomly select any upper link for detection. If no detection result is received, reselect other upper links for detection.
[0035] In one of the embodiments, if the second node server does not receive an updated detection result within a preset time, the detection request of the second node server is deleted.
[0036] In one embodiment, obtaining a second node server on a consistent hash ring based on the first hash value includes:
[0037] Calculate a second hash value of a node server in a normal state based on a hash function, and map the second hash value to different positions on a hash ring to form a consistent hash ring;
[0038] The first hash value is mapped to the consistent hash ring to obtain a hash value within a preset range, and a corresponding second node server is obtained based on the hash value within the preset range.
[0039] In a third aspect, the present disclosure further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the detection method of the upper link of the content distribution node are implemented.
[0040] In a fourth aspect, the present disclosure further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the method for detecting an upper link of a content distribution node when the computer program is executed by a processor.
[0041] In a fifth aspect, the present disclosure further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the detection method of the upper link of the content distribution node.
[0042] The above-mentioned method for detecting the upper link of the content distribution node has at least the following beneficial effects:
[0043] The embodiment scheme provided by the present disclosure obtains a first hash value based on the link information of the upper-layer link for the detection of each upper-layer link. A consistent hash ring is constructed based on all available servers in the same content distribution node, and a second node server on the consistent hash ring is obtained based on the first hash value, ensuring that there is only one server in the same content distribution node that initiates a detection request for the upper-layer link. This can ensure the efficient execution of the detection task and reduce the amount of detection requests.
[0044] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the conventional technology, the drawings required for use in the embodiments or the conventional technology descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0046] Figure 1A schematic diagram of a node actively detecting an upper link in an embodiment;
[0047] Figure 2 A schematic diagram of an independent detection server independently detecting an upper layer link in an embodiment;
[0048] Figure 3 A schematic diagram of a flow chart of a method for detecting an upper link of a content distribution node in an embodiment;
[0049] Figure 4 A schematic diagram of determining a second node server according to a consistent hash ring in an embodiment;
[0050] Figure 5 A schematic diagram of a server abnormality in one embodiment;
[0051] Figure 6 A schematic diagram of detecting an upper link of a content distribution node in one embodiment;
[0052] Figure 7 It is a structural block diagram of a detection device for an upper link of a content distribution node in one embodiment;
[0053] Figure 8 is an internal structure diagram of a computer device in one embodiment;
[0054] Fig. 9 The figure is a diagram of the internal structure of a server in one embodiment. DETAILED DESCRIPTION
[0055] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0056] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are only examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims. The terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, product or device including a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, product or device. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.
[0057] Figure 1 The figure is a schematic diagram of a node actively detecting an upper link in an embodiment. Each server in the node detects the server of the upper link. When the detection request fails, the corresponding server of the upper link is marked as faulty, and the user's real data is no longer forwarded to the faulty server. However, each server in the node needs to initiate an independent detection for each upper server separately. A CDN node generally contains several or even dozens of servers. In this way, the detection request for one upper server will be expanded dozens of times.
[0058] Figure 2 This is a schematic diagram of an independent detection server independently detecting an upper link in an embodiment. The availability of the upper link is centrally detected by a central detection server, and each server in the CDN node obtains the server status of the upper link from the central detection server. However, if the stability of the central server is too dependent, once the central detection server fails to detect, all servers in the CDN node will obtain an incorrect status, resulting in an abnormal upper link.
[0059] In some embodiments of the present disclosure, Figure 3 As shown, a method for detecting an upper layer link of a content distribution node is provided, which is applied to a first node server in the content distribution node. In a specific embodiment, the method may include the following steps:
[0060] S302: In response to the upper link detection request of the first node server, obtain link information of the upper link.
[0061] In the content delivery network (CDN) network structure, the upper link refers to the upper layer of the current CDN node. For example, if the user's accelerated domain name has only one edge node, the upper link of the edge node is the customer's origin site. If the user's accelerated domain name has a parent node, the upper link of the edge node is the parent node, and the upper link of the parent node is the origin site.
[0062] When the first node server of the CDN receives a detection request for the upper link, it will first determine the link information of an upper link according to the user configuration or the CDN's upper link return rule. The link information may include the upper-layer return source domain name and the determined server address, port, and upper-layer return protocol. User configuration includes that users can configure specific return source rules on the CDN management platform to specify which requests should be returned to which upper link server. The CDN network itself also has default return source rules, which can help CDN nodes select the optimal upper link server. For example, the CDN network may select the most appropriate upper link server based on network conditions, latency, load and other factors.
[0063] S304: Calculate a first Hash value of first Hash value input data, where the first Hash value input data is calculated based on the link information.
[0064] First Hash value input data is obtained according to the link information, the link information is converted into a unified string format, and a Hash value of the first Hash value input data is calculated using a Hash function.
[0065] S306: Obtain a second node server on a consistent hash ring based on the first hash value, wherein the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, wherein the node server in a normal state includes a node server that normally sends requests to an upper layer link and receives responses.
[0066] Figure 4 The schematic diagram of determining the second node server according to the consistent hash ring in one embodiment. Check all servers in the content distribution node to determine which servers are in normal state. Servers in normal state refer to those servers that can normally send requests to the upper link and receive responses. Use the node servers in normal state to build a consistent hash ring, and obtain the second node server on the consistent hash ring based on the first hash value. The servers in each content distribution node will regularly detect the availability of other servers, which can be achieved by sending heartbeat packets, regular requests, etc. When a server fails and goes offline, the return to the source is abnormal, or a new server is added, the consistent hash ring will be dynamically updated to ensure the accuracy and effectiveness of the hash ring. Figure 5 A schematic diagram of a server exception in an embodiment.
[0067] S308: Send the detection request of the upper link to the second node server, so that the second node server detects the upper link based on the detection request.
[0068] S310: Receive a detection result of the second node server detecting the upper layer link.
[0069] The first node server forwards the detection request of the upper link to the second node server. After receiving the detection task, the second node server initiates a detection request for the upper link. At the same time, the detection results will be saved on the second node server and detected regularly, and the detection results of the detection of the upper link will be sent to the first node server. Among them, the detection task target server determined by consistent hashing can be the first server itself.
[0070] In the above-mentioned method for detecting the upper link of the content distribution node, for each detection of the upper link, a first hash value is obtained based on the link information of the upper link. A consistent hash ring is constructed based on all available servers in the same content distribution node, and a second node server on the consistent hash ring is obtained based on the first hash value, ensuring that there is only one server in the same content distribution node that initiates a detection request for the upper link. This can ensure the efficient execution of the detection task and reduce the amount of detection requests.
[0071] In some embodiments of the present disclosure, the method further includes:
[0072] storing second Hash value input data, where the second Hash value input data is calculated based on a detection result of the second node server;
[0073] The updated detection result is obtained from the second node server corresponding to the second Hash value input data based on the second Hash value input data at a regular basis.
[0074] Figure 6 A schematic diagram of the detection of the upper link of the content distribution node in an embodiment. The first node server receives the detection result from the second node server, generates the second hash value input data based on the detection result, and saves the detection result locally. A scheduled task is set, and the second node server corresponding to the second hash value input data is regularly requested for the latest detection status according to the second hash value input data of the saved task result. After receiving the latest detection status from the second node server, the locally saved detection result is updated.
[0075] In some embodiments of the present disclosure, after obtaining the link information of the upper layer link, the method further includes:
[0076] It is determined whether the upper layer link operates normally based on the link information of the upper layer link, and in the case of a failure of the upper layer link, other upper layer links excluding the failed upper layer link are selected for detection.
[0077] When the first node server receives a detection request and needs to return to the upper link, it selects a normally working upper link according to the link information of the upper link. If the selected upper link is in a faulty state, the request will no longer be forwarded to the upper link address, and another upper link address will be selected according to the strategy of returning to the upper layer, and the same judgment will be made.
[0078] In some embodiments of the present disclosure, in the case where all upper layer links fail, the method further includes:
[0079] Randomly select any upper link for detection. If no detection result is received, reselect other upper links for detection.
[0080] If all upper-layer link addresses selected by the first node server according to the return-to-upper-layer policy are in a faulty state in the detection result, an upper-layer link may be randomly or blindly selected by polling to return to the upper-layer link.
[0081] In some embodiments of the present disclosure, if the second node server does not receive an updated detection result within a preset time, the detection request of the second node server is deleted.
[0082] If the second node server does not receive any updated detection result or upper layer link detection request sent by other servers within a period of time, the detection task is deleted.
[0083] In some embodiments of the present disclosure, obtaining a second node server on the consistent hash ring based on the first hash value includes:
[0084] Calculate a second hash value of a node server in a normal state based on a hash function, and map the second hash value to different positions on a hash ring to form a consistent hash ring;
[0085] The first hash value is mapped to the consistent hash ring to obtain a hash value within a preset range, and a corresponding second node server is obtained based on the hash value within the preset range.
[0086] Each server calculates a hash value based on its information, such as IP address or name, and maps this hash value to a certain position on a virtual ring to form a consistent hash ring. Each upper link detection request calculates a hash value based on the link information of the upper link it obtains, and maps this hash value to a certain position on the ring, and can find the nearest server node in the clockwise direction on the consistent hash ring, which is responsible for storing or processing this data item.
[0087] In one embodiment of the present disclosure, an edge node A includes 10 machines, and the internal parent domain name resolution used by the edge node to return to the upper layer has 10 service IPs (Internet Protocol), among which a specific parent node B includes 20 servers. Parent node B provides back-source for 100 accelerated domain names of users, and its upper-layer link corresponds to 100 real user sources. Each source station resolution has multiple real IP addresses of the source station, for example, each customer source has 5 different source IP addresses.
[0088] When machine 1 of edge node A receives a user's request and needs to return to the upper-level parent node, the edge machine selects a specific parent node ip1 and calculates a specific hash value h1 based on the internal domain name of the parent node, the parent node ip, and the port of the parent node.
[0089] According to this specific hash value h1, in the consistent hash ring constructed by the 10 machines of edge node A, it is determined that edge machine 6 will perform the detection task. When each machine of edge node A selects the parent node that uses ip1 to return to the upper layer, the corresponding detection task will be performed by edge machine 6 according to the result of consistent hashing.
[0090] In this way, the 10 parent IPs of the parent upper-layer link corresponding to the edge node and their corresponding detection tasks will be roughly evenly distributed and hashed to each edge node machine.
[0091] When ip1 of parent node B receives the real request from the user, it needs to return to the upper-layer link source station. Assuming that the return-to-source domain name is www.origin1.com, there are 5 ip addresses after DNS resolution of the return-to-source domain name. This time the return-to-source request needs to return to ip2, so another hash value h2 is calculated based on www.origin1.com, ip2 and the return-to-source port.
[0092] According to this specific hash value h2, in the consistent hash ring constructed by the 20 machines of the parent node B, it is determined that the machine 15 of the parent node will perform the detection task. When each machine of the parent node B needs to go back to the source to the ip2 of www.origin.com, the result of the consistent hash will be unified as machine 15, and machine 15 will eventually send the detection request to the source station. All other machines will not directly send the detection request to the source station for the ip2 of www.origin.com.
[0093] In this way, the 100 sources on the parent node have a total of 500 back-to-source IP addresses, and their detection tasks will be roughly distributed and hashed to the 20 parent node machines. And for each source IP address, only one parent machine will detect it, and the detection results will be synchronized to each parent node machine.
[0094] Assume that at a certain moment the fault of machine 8 corresponding to the parent node B is eliminated, and the other 19 machines on the parent node B learn that machine 8 is offline through detection within the node, and rebuild the consistent hash ring after eliminating machine 8. After that, the detection task that previously hashed to the upper-level source IP on machine 8 will be redistributed to other machines through the principle of consistent hashing.
[0095] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0096] Based on the same inventive concept, the disclosed embodiment also provides a detection device for the upper link of a content distribution node for implementing the above-mentioned detection method for the upper link of a content distribution node. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiment of the detection device for the upper link of a content distribution node provided below can be referred to the limitations of the detection method for the upper link of a content distribution node in the above text, and will not be repeated here.
[0097] The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiments of this specification and is combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiments of the present disclosure is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0098] In one embodiment, Figure 7 As shown, a detection device 700 for an upper link of a content distribution node is provided. The device 700 may include:
[0099] A response module 702, configured to obtain link information of the upper link in response to the upper link detection request of the first node server;
[0100] A calculation module 704, configured to calculate a first Hash value of first Hash value input data based on a Hash function, where the first Hash value input data is calculated based on the link information;
[0101] A switching module 706 is used to obtain a second node server on a consistent hash ring based on the first hash value, wherein the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, wherein the node server in a normal state includes a node server that normally sends a request to an upper link and receives a response;
[0102] A sending module 708, configured to send the detection request of the upper link to the second node server, so that the second node server detects the upper link;
[0103] The receiving module 710 is configured to receive the detection result of the second node server.
[0104] In one embodiment, the device further comprises:
[0105] storing second Hash value input data, where the second Hash value input data is calculated based on a detection result of the second node server;
[0106] The updated detection result is obtained from the second node server corresponding to the second Hash value input data based on the second Hash value input data at a regular basis.
[0107] In one of the embodiments, after obtaining the link information of the upper layer link, the device further includes:
[0108] It is determined whether the upper layer link operates normally based on the link information of the upper layer link, and in the case of a failure of the upper layer link, other upper layer links excluding the failed upper layer link are selected for detection.
[0109] In one of the embodiments, in the case of all upper layer link failures, the apparatus further comprises:
[0110] Randomly select any upper link for detection. If no detection result is received, reselect other upper links for detection.
[0111] In one of the embodiments, if the second node server does not receive an updated detection result within a preset time, the detection request of the second node server is deleted.
[0112] In one embodiment, obtaining a second node server on a consistent hash ring based on the first hash value includes:
[0113] Calculate a second hash value of a node server in a normal state based on a hash function, and map the second hash value to different positions on a hash ring to form a consistent hash ring;
[0114] The first hash value is mapped to the consistent hash ring to obtain a hash value within a preset range, and a corresponding second node server is obtained based on the hash value within the preset range.
[0115] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0116] Each module in the above-mentioned detection device for the upper link of the content distribution node can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0117] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. 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 detection requests. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a detection method for an upper link of a content distribution node is implemented.
[0118] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. 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 communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a detection method for the upper link of the content distribution node is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0119] Those skilled in the art will understand that Figure 8 , Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present disclosure, and does not constitute a limitation on the computer device to which the scheme of the present disclosure is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0120] 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 method described in any embodiment of the present disclosure is implemented.
[0121] In one embodiment, a computer program product is provided, including a computer program, which implements the method described in any embodiment of the present disclosure when executed by a processor.
[0122] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided by the present disclosure can include at least one of non-volatile and volatile memory. 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided by the present disclosure may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided by the present disclosure may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to this.
[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.
[0124] The above-described embodiments only express several implementation methods of the present disclosure, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present disclosure, and these all belong to the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the attached claims.
Claims
1. A method for detecting an upper link of a content distribution node, characterized in that: Applied to a first node server in the content distribution node, the method comprises: In response to the upper layer link detection request of the first node server, obtaining link information of the upper layer link; Calculating a first Hash value of first Hash value input data, where the first Hash value input data is calculated based on the link information; Based on the first hash value, a second node server on a consistent hash ring is obtained, where the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, where the node server in a normal state includes a node server that normally sends a request to an upper link and receives a response; Sending a detection request of the upper layer link to the second node server, so that the second node server detects the upper layer link based on the detection request; Receive a detection result of the second node server detecting the upper layer link.
2. The method according to claim 1, characterized in that The method further comprises: storing second Hash value input data, where the second Hash value input data is calculated based on a detection result of the second node server; The updated detection result is obtained from the second node server corresponding to the second Hash value input data based on the second Hash value input data at a regular basis.
3. The method according to claim 1, characterized in that After obtaining the link information of the upper link, the method further includes: It is determined whether the upper layer link operates normally based on the link information of the upper layer link, and in the case of a failure of the upper layer link, other upper layer links excluding the failed upper layer link are selected for detection.
4. The method according to claim 3, characterized in that In the event of all upper layer link failures, the method further comprises: Randomly select any upper link for detection. If no detection result is received, reselect other upper links for detection.
5. The method according to claim 2, characterized in that: If the second node server does not receive the updated detection result within a preset time, the detection request of the second node server is deleted.
6. The method according to claim 1, characterized in that The second node server on the consistent hash ring obtained based on the first hash value includes: Calculate a second hash value of a node server in a normal state based on a hash function, and map the second hash value to different positions on a hash ring to form a consistent hash ring; The first hash value is mapped to the consistent hash ring to obtain a hash value within a preset range, and a corresponding second node server is obtained based on the hash value within the preset range.
7. A detection device for an upper link of a content distribution node, characterized in that: Applied to a first node server in the content distribution node, the device comprises: A response module, configured to obtain link information of the upper link in response to the upper link detection request of the first node server; A calculation module, configured to calculate a first Hash value of first Hash value input data based on a Hash function, wherein the first Hash value input data is calculated based on the link information; A switching module, configured to obtain a second node server on a consistent hash ring based on the first hash value, wherein the consistent hash ring is constructed based on a node server in a normal state in the content distribution node where the first node server is located, wherein the node server in a normal state includes a node server that normally sends a request to an upper link and receives a response; A sending module, used for sending the detection request of the upper link to the second node server, so that the second node server detects the upper link; A receiving module is used to receive the detection result of the second node server.
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
Method, device and system for probing link quality
CN102136969A
Distributed message distribution method and device based on consistent hash and scheduling node
CN110888735A
Distributed network asset active detection method and system
CN111786857A
Service request processing method and system, server and storage medium
CN116506508A
Service dial testing method and system and related equipment
CN116980332A
Cited By
Performance data detection method and device, computer equipment and storage medium
CN120128511A