A health examination method, device and equipment
By establishing a TCP connection between the load balancer and the RS device and using probe request messages with TCP options, the problem of misjudging the availability of the RS device in existing health check methods is solved. This enables accurate detection and health status judgment of the RS device's UDP service, thereby improving the reliability of the system.
Patent Information
- Application Number
- CN202411762848.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2026-02-10
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing health check methods cannot accurately determine the availability of backend RS devices in load balancing equipment, leading to misjudgments, especially when no ICMP unreachable message is received.
By establishing a TCP connection between the load balancer and the RS device, and using probe request messages carrying TCP options for health status detection, the available range of TCP options is expanded, enabling accurate detection of UDP services on the RS device.
This improves the accuracy of the load balancer's assessment of the health status of RS device UDP services, reduces the false positive rate, and enhances the reliability of the load balancing system.
Smart Images

Figure CN119743411B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a health check method, device and equipment. BACKGROUND
[0002] In a cloud network, in the use scenario of a load balancing device, corresponding listeners and a plurality of RS devices are created for different types of protocols. When an external or internal service client accesses a service of a server, a load balancing (LoadBalancer, LB) device distributes service access traffic to a plurality of RS devices to realize distribution of service load. To ensure that the service traffic distributed to the RS devices can be normally processed, the availability of the RS devices in a backend group must be ensured, and generally, the LB device periodically sends a probe packet of a corresponding protocol and a service port to the RS device to perform port state detection, that is, health check.
[0003] For a backend RS device with health check exception, the load balancing device needs to remove it from the backend group to avoid traffic forwarding exception. If the load balancing device receives an ICMP Destination Unreachable error packet (ICMP destination unreachable packet) returned by the RS device, and the data part of the ICMP Destination Unreachable error packet encapsulates a UDP service packet sent by the load balancing device, the load balancing device determines that the RS device is unhealthy, and removes the RS device from the backend server group. However, if the load balancing device does not receive the corresponding ICMP Destination unreachable packet, it cannot accurately determine that the backend service device is definitely unavailable, and there is a possibility of misjudgment, for example, the RS device does not send the ICMP Destination Unreachable packet, or the RS device does not receive the UDP request sent by the load balancing device, or the RS device is faulty and finally causes UDP type service traffic exception. SUMMARY
[0004] The present application provides a health check method, device and equipment to solve the problem of low accuracy of the existing health check method.
[0005] In a first aspect, an embodiment of the present application provides a health check method applied to a load balancing device, and the method comprises the following steps.
[0006] In a case where the load balancing device does not receive an ICMP unreachable packet of a to-be-checked RS device for the first time, the load balancing device sends a probe request packet carrying a TCP option to the to-be-checked RS device through a TCP connection, and the probe request packet is used to probe the availability of a UDP service port of the to-be-checked RS device.
[0007] The load balancing device receives the response request message returned by the RS device to be inspected, and determines the health status of the RS device to be inspected based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be inspected is available.
[0008] Optionally, the method further includes:
[0009] After the load balancing device distributes the UDP service to multiple RS devices, it establishes corresponding TCP connections between the load balancing device and the multiple RS devices for the UDP service ports, and creates TCP options. The TCP options are used to check whether the UDP service ports on the RS devices are available.
[0010] Optionally, before establishing corresponding TCP connections on the UDP service ports between the load balancer and multiple RS devices, the following steps are also included:
[0011] The load balancing device initiates network detection to multiple RS devices to check whether the network of each RS device is available.
[0012] Establish corresponding TCP connections on the UDP service ports between the load balancer and multiple RS devices, including:
[0013] For each of the multiple RS devices that is network-available, a corresponding TCP connection is established on the UDP service port between the load balancer and the RS device.
[0014] Optionally, the load balancing device receives the response request message returned by the RS device to be inspected, and determines the health status of the RS device to be inspected based on the response request message, including:
[0015] The load balancing device parses the response request message;
[0016] If the response request message contains information indicating that the UDP service port of the RS device to be checked is available, the health status of the RS device to be checked is determined to be normal.
[0017] If the response request message indicates that the UDP service port of the RS device to be checked is unavailable, the health status of the RS device to be checked is determined to be abnormal.
[0018] Optionally, the method further includes:
[0019] For RS devices for which the load balancer does not receive an ICMP unreachable message, and for RS devices to be checked whose health status is normal, the load balancer checks the health status of the RS devices and the RS devices to be checked according to a preset health check time.
[0020] In a second aspect, embodiments of this application provide a health check method applied to an RS device, the method comprising:
[0021] If the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, the RS device under inspection receives a probe request message carrying TCP options sent by the load balancer through a TCP connection.
[0022] Based on the probe request message, the RS device to be inspected queries whether its UDP service port is available and replies with a response request message, which includes at least information on whether the UDP service port of the RS device to be inspected is available.
[0023] Optionally, based on the probe request message, the RS device to be inspected queries whether its UDP service port is available, including:
[0024] Based on the IP address and UDP service port information of the RS device to be inspected, the RS device to be inspected queries the availability of the UDP service port.
[0025] In a third aspect, embodiments of this application provide a health check device applied to a load balancing device, the device comprising:
[0026] The probe request module is used to send a probe request message carrying TCP options to the RS device under inspection via a TCP connection when the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time. The probe request message is used to probe the availability of the UDP service port of the RS device under inspection.
[0027] The response request receiving module is used for the load balancing device to receive the response request message returned by the RS device to be inspected, and to determine the health status of the RS device to be inspected based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be inspected is available.
[0028] In a fourth aspect, embodiments of this application provide a health check device applied to an RS device, the device comprising:
[0029] The probe request receiving module is used to, when the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, have the RS device under inspection receive a probe request message carrying TCP options sent by the load balancer through a TCP connection.
[0030] A response request module is used to, based on the probe request message, query whether the UDP service port of the RS device to be inspected is available, and reply with a response request message, wherein the response request message includes at least information on whether the UDP service port of the RS device to be inspected is available.
[0031] In a fifth aspect, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement a health check method as described in any one of the first aspects above, or a health check method as described in any one of the second aspects above.
[0032] This application offers the following advantages: It proposes a health check method, apparatus, and device. First, if the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, the load balancer sends a probe request message carrying TCP options to the RS device under inspection via a TCP connection. This probe request message is used to probe the availability of the UDP service port of the RS device under inspection. Then, the load balancer receives a response request message returned by the RS device under inspection and determines the health status of the RS device based on the response request message. The response request message at least contains information on whether the UDP service port of the RS device under inspection is available. This health check method is based on a reliable connection-based UDP service check method. A reliable TCP connection is established between the load balancer and the RS device, new TCP options are added, and TCP interaction messages carrying these new TCP options are used to accurately probe the operation status of the UDP service and the sending status of ICMP unreachable messages on the RS device, thereby improving the accuracy of the load balancer's probe of the UDP service health status of the RS device. Attached Figure Description
[0033] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1This application provides a health check method for load balancing equipment.
[0035] Figure 2 This application provides a schematic diagram illustrating the sending and receiving of a TCP probe request message carrying option 249.
[0036] Figure 3 This is a flowchart illustrating the steps of a health check method for RS devices proposed in an embodiment of this application.
[0037] Figure 4 This is a process for detecting the availability of the UDP service port of an RS device according to an embodiment of this application;
[0038] Figure 5 This is an architectural diagram of a health check device for load balancing equipment proposed in an embodiment of this application;
[0039] Figure 6 This is an architectural diagram of a health check device applied to an RS device according to an embodiment of this application;
[0040] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0041] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0042] To clearly illustrate the technical solutions of this application, the following are some technical keywords and their definitions mentioned in the description of the embodiments of this application. TCP (Transmission Control Protocol): A connection-oriented, reliable transport layer communication protocol. UDP (User Datagram Protocol): A connectionless transport layer protocol that provides simple, unreliable transmission services. ICMP (Internet Control Message Protocol): A sub-protocol of the TCP / IP protocol suite, connectionless, used for transmitting error control messages. LB (Load Balancer): A network device that distributes a large number of requests and business packets to different backend servers, thereby preventing resource overload, requests being sent to abnormal servers, and eliminating single points of failure. RS (Real Server): Also known as a backend server / device, it is the actual device that handles the traffic distributed by the LB; generally, multiple RSs form a backend group. Listener: A listener responsible for listening to requests on the LB and specifying how to forward requests to the backend.
[0043] The health check process for the UDP service of the RS device involves the following steps: First, a ping test is performed to check if the backend service device (RS device) is running. Then, a UDP request is sent to the backend service device (RS device) on a specified port to determine if the load balancer receives an ICMP Destination Unreachable message. If the load balancer receives an ICMP Destination Unreachable error message from the RS device, and the data portion of the message encapsulates the UDP service packet sent by the load balancer, the load balancer determines that the RS device is unhealthy and removes it from the backend server group. If the load balancer does not receive an ICMP Destination Unreachable error message from the RS device, it determines that the RS device is healthy and can distribute traffic to it according to the algorithm.
[0044] Based on the above health check principle, if the load balancer does not receive an ICMP Destination Unreachable error message, it cannot be accurately determined that the backend service device (RS device) is definitely unusable. For example, the RS device may not have sent an ICMP Destination Unreachable message, or the RS device as a whole may not have received the UDP request sent by the load balancer, or the RS device as a whole may have failed, ultimately causing abnormal UDP traffic.
[0045] Based on this, this application proposes a health check method. By establishing a TCP connection between the load balancer and the RS device, and using interactive messages carrying TCP options, the method accurately probes the operational status of the UDP service on the RS device, thereby accurately determining the health of the UDP service on the RS device. This method enhances the usability of the TCP protocol by expanding the available range of TCP options, and improves the detection method of the UDP service on the RS device in the load balancer, thereby increasing the accuracy of the health check and effectively reducing false judgments about the availability of UDP port services in the load balancer.
[0046] See Figure 1 , Figure 1 This application proposes a health check method for load balancing equipment, which includes the following steps:
[0047] Step 101: If the load balancer does not receive an ICMP unreachable message from the RS device to be inspected for the first time, the load balancer sends a probe request message carrying TCP options to the RS device to be inspected via a TCP connection. The probe request message is used to probe the availability of the UDP service port of the RS device to be inspected.
[0048] If the load balancer does not receive an ICMP Destination Unreachable message from the RS device under inspection on its first attempt, it sends a probe request message carrying TCP options through an established TCP connection to accurately detect the health status of the RS device. To achieve this check, new options are added to the TCP options carried in the probe request message, enabling it to detect the UDP service status through TCP message exchanges. This establishes a probe request message to probe the availability of the UDP service port of the RS device under inspection. This ICMP Destination Unreachable message is simply referred to as an ICMP unreachable message.
[0049] A new TCP option is defined in the probe request message to expand the scope of available TCP options and enhance the usability of the TCP protocol. This TCP option includes a TCP header and a data section. The new TCP option is named StatusCheck, and new fields, operation (opcode) and value (value), are added to the TCP header. The operation field contains the probe request value and the response request value. The data section of the TCP option stores the specific query object information specified when the operation is set to request, and provides it in JSON format with {key:value}.
[0050] Specifically, the TCP header data structure of the new TCP option defined in the probe request message in this application embodiment is shown in Table 1. It includes the fields kind (1 byte), Length (1 byte), and Info (8 bytes). Kind is used to identify the type of option. In this application, its value is 249. Converting it to hexadecimal, kind is F9. When kind is 249, the newly defined TCP option can be represented as option249. The length of the TCP option header is 10. The Info field is divided into four parts: opcode (1 byte), IP address (4 bytes), port (2 bytes), and check status (1 byte). The opcode is 01 (CheckRequest, probe request) or 02 (CheckReply, response request). The IP address is the IP address of the RS device to be checked. The port is the UDP service port of the RS device to be checked. The check status is only filled with specific values in the CheckReply message (response request message), and is set to 0 in the CheckRequest message (probe request message). In actual transmission, this newly defined TCP option is carried via the PSH ACK message, and additional query command information can be carried in the TCP data portion. If the RS device to be checked receives a message with option 249 set to CheckRequest (probe request message), it should respond with a message set to CheckReply (response request message) by filling the Info field of the TCP options with the health check result of the RS device to be checked.
[0051] Table 1. TCP Header Data Structure for TCP Options
[0052]
[0053] For example, in step 101, the data structure of the probe request message carrying TCP options sent by the load balancing device is as follows: kind is 249, length is 10, the opcode in the Info field is 01, and all other contents in the Info field are 0 (i.e., 000000000000000). The data section is filled with JSON-formatted data used to query the availability of the corresponding IP address and port of the RS device to be checked: {“IP”:”xxxx”,”port”:”yyyy”}.
[0054] In the actual TCP packet exchange process, the JSON format data in the data part is exchanged in ASCII code. Assuming the IP of the RS device to be checked is 10.1.1.1 and the UDP service port is 10001, the JSON data converted to ASCII code is 7b226970223a2231302e312e312e31222c22706f7274223a223130303031227d.
[0055] Step 102: The load balancing device receives the response request message returned by the RS device to be checked, and determines the health status of the RS device to be checked based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be checked is available.
[0056] The load balancer queries the health status of the RS device to be checked based on whether the UDP service port on the RS device to be checked is available. First, the load balancer receives a response request message returned by the RS device to be checked. This response request message contains at least information on whether the UDP service port of the RS device to be checked is available. The load balancer determines the health status of the RS device to be checked based on the information on whether the UDP service port is available contained in the response request message.
[0057] This application proposes a health check method. First, if the load balancer does not receive an ICMP unreachable message from the RS device under test for the first time, the load balancer sends a probe request message carrying TCP options to the RS device under test via a TCP connection. This probe request message is used to probe the availability of the RS device's UDP service port. Then, the load balancer receives a response request message from the RS device under test and determines the health status of the RS device based on the response request message. The response request message at least contains information about whether the RS device's UDP service port is available. By establishing a reliable TCP connection between the load balancer and the RS device, the UDP health check process is transformed from connectionless to connection-oriented. Simultaneously, the use of new TCP options to check the availability of the UDP service port on the RS device reduces false positives in probing the UDP service health status of the RS device, improving the reliability of the load balancing system.
[0058] In an optional implementation, to enable the interaction between probe request messages and response request messages carrying TCP options as described above, the method further includes the following steps:
[0059] Step 103: After the load balancing device distributes the UDP service to multiple RS devices, it establishes a corresponding TCP connection between the UDP service port of the load balancing device and the multiple RS devices, and creates TCP options. The TCP options are used to check whether the UDP service port on the RS device is available.
[0060] To implement connection-based health checks between each load balancer and each RS device, after the load balancer distributes the UDP service across multiple RS devices, corresponding TCP connections are established between the load balancer and the UDP service ports of each RS device. This enables connection-based health checks between the load balancer and each RS device. Then, TCP options are created to check the availability of the UDP service ports on the RS devices. The availability of the UDP service ports is queried by filling in the query command information in the data section of the TCP options.
[0061] In an optional implementation, before establishing corresponding TCP connections on the UDP service ports between the load balancer and the multiple RS devices in step 103, the network availability of the RS devices is further checked. Specifically, the load balancer initiates a network test to the multiple RS devices to determine if the network of each RS device is available. For example, the load balancer initiates a ping test to the RS devices to check if the network interface card (NIC) IP address of each RS device is available. If the network of an RS device is unavailable, the RS device can be directly determined to be unhealthy and removed from the backend group.
[0062] Based on the above embodiments, when the network of the RS devices is available, it indicates that the Layer 3 network connectivity between the load balancer and the RS devices is sufficient. Therefore, corresponding TCP connections are established between the load balancer and the UDP service ports of multiple RS devices. This also includes establishing a corresponding TCP connection between the load balancer and the UDP service port of the RS devices with available network connectivity. In this case, network availability between the load balancer and the RS devices can be guaranteed, enabling the exchange of messages carrying TCP options and preventing situations where either the load balancer or the RS devices fail to receive messages.
[0063] In an optional implementation, for the TCP connection between the load balancer and the RS device, if the load balancer does not receive an ICMP unreachable message from the RS device to be inspected for the first time, a TCP connection can be established between the UDP service port of the RS device to be inspected and the load balancer. This eliminates the need to establish a TCP connection between each RS device and the load balancer in advance, thereby improving inspection efficiency and reducing the energy consumption of the inspection system.
[0064] Based on the above embodiments, step 102, in which the load balancing device receives the response request message returned by the RS device to be inspected and determines the health status of the RS device to be inspected based on the response request message, further includes the following steps:
[0065] Step 1021: The load balancing device parses the response request message.
[0066] After receiving the response request message, the load balancer parses the check status contained in the message and uses this status to determine the health status of the RS device to be checked. This check status changes based on the availability of the RS device's UDP service port. If the UDP service port is available, the field in the check status can be 01, indicating a normal health check; if the UDP service port is available, the field can be 00, indicating an abnormal health check.
[0067] Step 1022: If the response request message contains information indicating that the UDP service port of the RS device to be checked is available, determine that the health status of the RS device to be checked is normal.
[0068] If the check status field in the response request message is 01, it indicates that the UDP service port of the RS device to be checked is available, and the health status of the RS device to be checked is determined to be normal. With the RS device to be checked confirmed to be healthy, the load balancer can offload traffic to the RS device to be checked.
[0069] Step 1023: If the response request message indicates that the UDP service port of the RS device to be checked is unavailable, determine that the health status of the RS device to be checked is abnormal.
[0070] If the check status field in the response request message is 00, it indicates that the UDP service port of the RS device to be checked is unavailable, and the health status of the RS device to be checked is determined to be abnormal. If the RS device to be checked is determined to be unhealthy, the load balancer will remove the RS device to be checked from the backend group, and the load balancer will not forward UDP service packets to the RS device to be checked.
[0071] Based on the above embodiments, the method further includes the following steps:
[0072] Step 104: For RS devices for which the load balancer did not receive an ICMP unreachable message, and for RS devices to be checked whose health status is normal, the load balancer checks the health status of the RS devices and the RS devices to be checked according to a preset health check time.
[0073] Because the health status of RS devices fluctuates frequently—meaning an RS device currently deemed healthy may become unusable due to other reasons after a period of time—this embodiment addresses this by having the load balancer check the health status of all RS devices for which the load balancer has not received an ICMP unreachable message, and for RS devices awaiting inspection whose health check status is normal, according to a preset health check interval. The preset health check interval can be any preset time, such as 5 seconds, 10 seconds, etc. This method improves the reliability of the inspection system.
[0074] To clearly illustrate the process by which the load balancing device in this application processes packets carrying TCP options, please refer to [reference needed]. Figure 2 , Figure 2This is a schematic diagram illustrating the sending and receiving of a TCP probe request message carrying option 249, as proposed in an embodiment of this application. The TCP option is defined as option 249, "client" refers to the load balancer, and "server" refers to the RS device to be inspected. A UDP listener is configured and health checks are enabled on the load balancer. A service auxiliary application supporting the new TCP option is installed and enabled on the RS device, and the TCP and UDP protocol listening processes for the corresponding UDP service ports are started. The load balancer initiates a health check process for the UDP service port of the RS device. Upon receiving an ICMP unreachable message from the RS device, the load balancer determines that the RS device is unavailable. If the load balancer does not receive an ICMP unreachable message, it initiates a ping test to the PS device. Given the RS device's network interface card IP address, the load balancer uses the port of the RS device in its UDP listener to establish a TCP connection with the RS device. This involves a three-way handshake (including the following three processes: the load balancer sends a SYN synchronization sequence (SYN seq = x) to the RS device; the RS device, upon receiving the SYN synchronization sequence, sends a packet with the SYN synchronization sequence and ACK flag (SYNseq = y, ack = x + 1) to the load balancer; and the load balancer, upon receiving the packet with the SYN synchronization sequence and ACK flag, sends an ACK packet (ACK = y + 1) to the RS device). Afterward, a PSH ACK packet is sent, carrying the newly defined TCP option (option 249), i.e., PSH ACK option 249, request. The load balancer receives the response request message (PSH ACK option 249, reply) from the RS device under inspection, and also receives an ACK message. The load balancer first replies with an ACK message to the RS device under inspection, and then parses the inspection status field in option 249 to determine the health status of the RS device under inspection.
[0075] See Figure 3 , Figure 3 This is a flowchart illustrating the steps of a health check method for RS devices proposed in this application, the method comprising the following steps:
[0076] Step 301: If the load balancer does not receive an ICMP unreachable message from the RS device to be inspected for the first time, the RS device to be inspected receives a probe request message carrying TCP options sent by the load balancer through a TCP connection.
[0077] If the load balancer does not receive an ICMP unreachable message from the RS device under inspection on the first attempt, it indicates that the RS device under inspection may have a health problem. The RS device under inspection receives a probe request message carrying TCP options sent by the load balancer via a TCP connection. Based on the field in the probe request message that includes a field to probe the availability of the RS device's UDP service port, the load balancer probes the availability of the RS device's UDP service port to accurately determine the health status of the RS device under inspection.
[0078] Step 302: Based on the probe request message, the RS device to be inspected queries whether the UDP service port of the RS device to be inspected is available, and replies with a response request message, the response request message including at least the information on whether the UDP service port of the RS device to be inspected is available.
[0079] Based on the content contained in the probe request message, the RS device to be checked queries whether its UDP service port is available. It modifies the fields in the probe request message according to the availability of the UDP service port and replies with the modified request message as a response request message to the load balancer. The RS device is pre-configured with an auxiliary program that supports new TCP options. Upon receiving the probe request message, it performs a local probe of the availability of the specified UDP port. If the specified UDP port on the RS device is detected to be unavailable, the RS device's UDP is determined to be unhealthy, and its health check status is marked as down (unhealthy). Conversely, if the port is available, the RS device's health check status is determined to be up (healthy).
[0080] In an optional embodiment, step 302 above, based on the probe request message, involves the RS device to be inspected querying whether its UDP service port is available, specifically including the following steps:
[0081] Step 3021: Based on the IP address and UDP service port information of the RS device to be inspected, the RS device to be inspected queries the availability of the UDP service port.
[0082] The data portion of the probe request message carrying TCP options is filled with the IP address and UDP service port information of the RS device to be inspected. Based on the IP address and UDP service port information of the RS device to be inspected, the RS device to be inspected can determine whether the UDP service port is available.
[0083] For example, assuming the IP of the RS device to be checked is 10.1.1.1, the UDP service port is 10001, and the UDP service port of the RS device to be checked is available, in step 302, the data structure of the response request message sent by the RS device to be checked to the load balancer is as follows: kind is 249, length is 10, the opcode in the Info field is 02, IP is 0a010101, port is 2711 (the IP and port values are in ASCII form), the check status is 01 (indicating that the health check is normal), and the padding value of the data part of the TCP option in the response request message is 020a010101271101 (ASCII form).
[0084] If the UDP service port of the RS device to be checked is unavailable, in step 302, the data structure of the response request message sent by the RS device to be checked to the load balancer is as follows: kind is 249, length is 10, the opcode in the Info field is 02, IP is 0a010101, port is 2711, check status is 00 (indicating that the health check is abnormal), and the padding value of the data part of the TCP option in the response request message is 020a010101271100.
[0085] To clearly illustrate the process by which the RS device under inspection in this application processes messages carrying TCP options, please refer to [reference needed]. Figure 2 After the RS device to be inspected receives the probe request message (PSH ACK option249, request) and ACK message from the load balancer, it first replies with an ACK message, and then processes the probe request message through the auxiliary application. It queries the availability of the UDP service port based on the IP address and port filled in the data part of the probe request message, obtains the information on whether the UDP service port is available, fills the relevant information into the response request message (PSH ACK option249, reply), and replies to the load balancer.
[0086] See Figure 4 , Figure 4This application presents an embodiment of a UDP service port availability detection process for an RS device. First, the load balancer initiates a UDP listener health check. If the load balancer receives an ICMP unreachable message from the RS device, it determines that the RS device is unhealthy and the UDP service port is unavailable. Then, if the load balancer does not receive an ICMP unreachable message from the RS device, it sends a ping packet to check the RS network connectivity. If the RS network is unreachable, it determines that the RS device is unhealthy and the UDP service port is unavailable. Further, if the RS network ping probe is successful, the load balancer initiates a PSH ACK packet carrying option 249 and a UDP specific port probe request to the TCP connection established with the RS device. If the UDP port is unavailable in the RS device's response message, it determines that the RS device is unhealthy and the UDP service port is unavailable. If the UDP port is available in the RS device's response message, it determines that the RS device is healthy and the UDP service is available.
[0087] See Figure 5 , Figure 5 This is an architectural diagram of a health check device for a load balancing device proposed in an embodiment of this application. The device includes:
[0088] The probe request module 501 is used to send a probe request message carrying TCP options to the RS device under inspection via a TCP connection when the load balancing device does not receive an ICMP unreachable message from the RS device under inspection for the first time. The probe request message is used to probe the availability of the UDP service port of the RS device under inspection.
[0089] The response request receiving module 502 is used for the load balancing device to receive the response request message returned by the RS device to be checked, and to determine the health status of the RS device to be checked based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be checked is available.
[0090] Optionally, the device further includes:
[0091] The TCP connection establishment module is used to establish corresponding TCP connections between the load balancing device and the multiple RS devices after the load balancing device distributes the UDP service to multiple RS devices, and to create TCP options. The TCP options are used to check whether the UDP service ports on the RS devices are available.
[0092] Optionally, prior to the TCP connection establishment module, the following may also be included:
[0093] The network detection module is used by the load balancing device to initiate network detection to multiple RS devices and detect whether the network of each RS device is available.
[0094] The TCP connection establishment module includes:
[0095] A submodule is established to establish a corresponding TCP connection between the load balancer and the RS device on the UDP service port for the RS device that is available in the network among the multiple RS devices.
[0096] Optionally, the module for receiving response requests includes:
[0097] The parsing submodule is used by the load balancing device to parse the response request message;
[0098] The first determining submodule is used to determine that the health status of the RS device to be checked is normal when the response request message contains that the UDP service port of the RS device to be checked is available.
[0099] The second determination submodule is used to determine that the health status of the RS device to be checked is abnormal when the response request message indicates that the UDP service port of the RS device to be checked is unavailable.
[0100] Optionally, the device further includes:
[0101] The inspection module is used to inspect the health status of the RS devices and the RS devices to be inspected according to a preset health check time for RS devices for which the load balancer has not received an ICMP unreachable message and RS devices whose health status is normal.
[0102] See Figure 6 , Figure 6 This is an architectural diagram of a health check device for RS equipment proposed in an embodiment of this application. The device includes:
[0103] The probe request receiving module 601 is used to, when the load balancer does not receive an ICMP unreachable message from the RS device to be inspected for the first time, have the RS device to be inspected receive a probe request message carrying TCP options sent by the load balancer through a TCP connection.
[0104] The response request module 602 is used to query whether the UDP service port of the RS device to be inspected is available based on the probe request message, and reply with a response request message, wherein the response request message includes at least information on whether the UDP service port of the RS device to be inspected is available.
[0105] Optionally, the module for sending a response request includes:
[0106] The availability query submodule is used to query the availability of the UDP service port of the RS device under inspection based on the IP address and UDP service port information of the RS device under inspection.
[0107] Based on the same concept, this application discloses an electronic device in a third aspect. Figure 7 A schematic diagram of an electronic device disclosed in an embodiment of this application is shown, such as... Figure 7 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory of the electronic device is not less than 12G, and the main frequency of the processor is not less than 2.4GHz. The memory 110 and the processor 120 are connected via a bus communication connection. The memory 110 stores a computer program, which can run on the processor 120 to implement a health check method disclosed in the embodiments of this application.
[0108] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0109] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0110] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0111] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0112] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0113] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0114] The above provides a detailed description of a health examination method, apparatus, and device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A health examination method, characterized in that, Applied to load balancing devices, the method includes: If the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, the load balancer sends a probe request message carrying TCP options to the RS device under inspection via a TCP connection. The probe request message is used to probe the availability of the UDP service port of the RS device under inspection. The load balancing device receives the response request message returned by the RS device to be inspected, and determines the health status of the RS device to be inspected based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be inspected is available.
2. The health examination method according to claim 1, characterized in that, The method further includes: After the load balancing device distributes the UDP service to multiple RS devices, it establishes corresponding TCP connections between the load balancing device and the multiple RS devices for the UDP service ports, and creates TCP options. The TCP options are used to check whether the UDP service ports on the RS devices are available.
3. The health examination method according to claim 2, characterized in that, Before establishing corresponding TCP connections on the UDP service ports between the load balancer and multiple RS devices, the following steps are also included: The load balancing device initiates network detection to multiple RS devices to check whether the network of each RS device is available. Establish corresponding TCP connections on the UDP service ports between the load balancer and multiple RS devices, including: For each of the multiple RS devices that is network-available, a corresponding TCP connection is established on the UDP service port between the load balancer and the RS device.
4. The health examination method according to claim 1, characterized in that, The load balancing device receives the response request message returned by the RS device to be inspected, and determines the health status of the RS device to be inspected based on the response request message, including: The load balancing device parses the response request message; If the response request message contains information indicating that the UDP service port of the RS device to be checked is available, the health status of the RS device to be checked is determined to be normal. If the response request message indicates that the UDP service port of the RS device to be checked is unavailable, the health status of the RS device to be checked is determined to be abnormal.
5. The health examination method according to any one of claims 1-4, characterized in that, The method further includes: For RS devices for which the load balancer does not receive an ICMP unreachable message, and for RS devices to be checked whose health status is normal, the load balancer checks the health status of the RS devices and the RS devices to be checked according to a preset health check time.
6. A health examination method, characterized in that, Applied to RS devices, the method includes: If the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, the RS device under inspection receives a probe request message carrying TCP options sent by the load balancer through a TCP connection. Based on the probe request message, the RS device to be inspected queries whether its UDP service port is available and replies with a response request message, which includes at least information on whether the UDP service port of the RS device to be inspected is available.
7. The health examination method according to claim 6, characterized in that, Based on the probe request message, the RS device to be inspected queries whether its UDP service port is available, including: Based on the IP address and UDP service port information of the RS device to be inspected, the RS device to be inspected queries the availability of the UDP service port.
8. A health check device, characterized in that, Applied to load balancing equipment, the device includes: The probe request module is used to send a probe request message carrying TCP options to the RS device under inspection via a TCP connection when the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time. The probe request message is used to probe the availability of the UDP service port of the RS device under inspection. The response request receiving module is used for the load balancing device to receive the response request message returned by the RS device to be inspected, and to determine the health status of the RS device to be inspected based on the response request message. The response request message contains at least information on whether the UDP service port of the RS device to be inspected is available.
9. A health check device, characterized in that, Applied to RS devices, the apparatus includes: The probe request receiving module is used to, when the load balancer does not receive an ICMP unreachable message from the RS device under inspection for the first time, have the RS device under inspection receive a probe request message carrying TCP options sent by the load balancer through a TCP connection. A response request module is used to, based on the probe request message, query whether the UDP service port of the RS device to be inspected is available, and reply with a response request message, wherein the response request message includes at least information on whether the UDP service port of the RS device to be inspected is available.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the health examination method according to any one of claims 1-5, or the health examination method according to any one of claims 6-7.
Citation Information
Patent Citations
Method and device for health detection for equalized equipment
CN101640620A
Health state checking method and device, electronic equipment and storage medium
CN118055043A