Cluster address list acquisition method and apparatus, computer device, medium, and product

By obtaining the Internet Protocol address of the service host machine, and performing communication connection and periodic keep-alive probes based on the minimum threshold of available connections, the problem of inflexible cluster address list configuration is solved, achieving efficient and accurate address discovery and monitoring.

CN119520481BActive Publication Date: 2026-01-16CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411747963.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2026-01-16
Estimated Expiration
2044-12-02

AI Technical Summary

Technical Problem

In existing technologies, the configuration of cluster address lists between services is not flexible enough, resulting in low efficiency and insufficient accuracy in address discovery.

Method used

By obtaining the Internet Protocol address of the service host machine, communication connection processing is performed based on the minimum threshold of available connections to obtain a list of available addresses, and the target cluster address list is updated through periodic keep-alive detection.

Benefits of technology

It improves the efficiency and accuracy of address discovery, ensures real-time monitoring and reliability of the address list, and reduces service interruptions caused by unavailable addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520481B_ABST
    Figure CN119520481B_ABST
Patent Text Reader

Abstract

The application relates to a cluster address list acquisition method and device, computer equipment, a medium and a product. Internet protocol addresses of a plurality of service host computers are acquired. According to the internet protocol addresses and a minimum threshold of available connection numbers acquired in advance, communication connection processing is performed on the service host computers to obtain an available address list. Periodic keep-alive detection processing is performed based on the available address list to obtain a target cluster address list. According to the internet protocol addresses and the minimum threshold of available connection numbers, the service host computers are subjected to communication connection processing, available addresses can be quickly screened out, and the address discovery efficiency is improved. After the available address list is obtained, the periodic keep-alive detection processing is performed, the address availability can be monitored in real time, and the accuracy and reliability of the address list are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cloud computing, and particularly relates to a cluster address list acquisition method and device, computer equipment, medium and product. BACKGROUND

[0002] In today's microservice or distributed architecture system, efficient interaction and cooperation between services are crucial. In order to realize smooth calling between services, a cluster node such as a "service registry center" needs to be deployed in the system, and a corresponding client is embedded in the service component to establish contact with the cluster. However, the client embedded in each service needs a way to discover the address list of the cluster node.

[0003] The commonly used solution is to directly configure the static address list of the "service registry center" cluster node on the client side. However, the method of configuring the static address list of the "service registry center" on the client side is not flexible enough. SUMMARY

[0004] Therefore, it is necessary to provide a cluster address list acquisition method, device, computer equipment, medium and product capable of solving the above problems.

[0005] In a first aspect, the present application provides a cluster address list acquisition method, which comprises:

[0006] obtaining the internet protocol addresses of a plurality of service host computers;

[0007] performing communication connection processing on the service host computers according to the internet protocol addresses and a pre-acquired minimum threshold of available connection numbers, to obtain an available address list;

[0008] performing periodic keep-alive detection processing based on the available address list, to obtain a target cluster address list.

[0009] In one embodiment, the communication connection processing on the service host computers according to the internet protocol addresses and the pre-acquired minimum threshold of available connection numbers, to obtain an available address list, comprises:

[0010] performing communication connection processing on the service host computers according to the internet protocol addresses of the service host computers;

[0011] determining the internet protocol addresses of the service host computers that have successfully connected as candidate protocol addresses;

[0012] determining the available address list according to the minimum threshold of available connection numbers and the candidate protocol addresses.

[0013] In one of the embodiments, the periodic keep-alive detection based on the available address list comprises:

[0014] sending a detection request to each available protocol address in the available address list based on the preset period to obtain a detection result of each available protocol address;

[0015] updating the available address list according to the plurality of detection results to obtain the target cluster address list.

[0016] In one of the embodiments, the detection result comprises alive and inactivated; the sending of the detection request to each available protocol address in the available address list based on the preset period to obtain the detection result of each available protocol address comprises:

[0017] sending the detection request to the service host corresponding to the available protocol address for each available protocol address in the available address list;

[0018] in the case of receiving the feedback information returned by the service host, determining that the detection result of the service host is alive;

[0019] in the case of not receiving the feedback information returned by the service host, resending the detection request to the service host until the number of times of sending the detection request reaches the preset number of times and the feedback information is not received, and determining that the detection result of the service host is inactivated.

[0020] In one of the embodiments, the updating of the available address list according to the plurality of detection results to obtain the target cluster address list comprises:

[0021] retaining the available protocol address corresponding to the alive in the available address list, and deleting the available protocol address corresponding to the inactivated in the available address list to obtain the target cluster address list.

[0022] In one of the embodiments, the method further comprises:

[0023] in the case that the number of available protocol addresses in the target cluster address list is less than the minimum threshold of the available connection number, performing the step of obtaining the internet protocol addresses of the plurality of service hosts.

[0024] In a second aspect, the application further provides a cluster address list acquisition device. The device comprises:

[0025] an address acquisition module for acquiring the internet protocol addresses of the plurality of service hosts;

[0026] an available list determination module for performing a communication connection process on each service host according to each internet protocol address and a pre-acquired minimum threshold of the available connection number to obtain an available address list;

[0027] a target list determination module configured to perform periodic keep-alive detection processing based on the available address list, and obtain a target cluster address list.

[0028] In a third aspect, the present application provides a computer device. The computer device comprises a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:

[0029] obtain Internet protocol addresses of a plurality of service host computers;

[0030] perform communication connection processing on the service host computers according to the Internet protocol addresses and a pre-obtained minimum threshold of available connection numbers, and obtain an available address list;

[0031] perform periodic keep-alive detection processing based on the available address list, and obtain a target cluster address list.

[0032] In a fourth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0033] obtain Internet protocol addresses of a plurality of service host computers;

[0034] perform communication connection processing on the service host computers according to the Internet protocol addresses and a pre-obtained minimum threshold of available connection numbers, and obtain an available address list;

[0035] perform periodic keep-alive detection processing based on the available address list, and obtain a target cluster address list.

[0036] In a fifth aspect, the present application provides a computer program product. The computer program product comprises a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0037] obtain Internet protocol addresses of a plurality of service host computers;

[0038] perform communication connection processing on the service host computers according to the Internet protocol addresses and a pre-obtained minimum threshold of available connection numbers, and obtain an available address list;

[0039] perform periodic keep-alive detection processing based on the available address list, and obtain a target cluster address list.

[0040] The cluster address list obtaining method, device, computer device, medium and product obtain the IP addresses of the plurality of service host computers, perform communication connection processing on the service host computers according to the IP addresses and the minimum threshold of the available connection number, obtain an available address list, and perform periodic keep-alive detection processing based on the available address list to obtain a target cluster address list. The communication connection processing on the service host computers according to the IP addresses and the minimum threshold of the available connection number can quickly filter out available addresses, thereby improving the efficiency of address discovery. After the available address list is obtained, the periodic keep-alive detection processing can be performed to monitor the availability of the addresses in real time, thereby greatly improving the accuracy and reliability of the address list. BRIEF DESCRIPTION OF DRAWINGS

[0041] Figure 1 An application environment diagram of the cluster address list obtaining method in an embodiment;

[0042] Figure 2 A flowchart of the cluster address list obtaining method in an embodiment;

[0043] Figure 3 A flowchart of obtaining the available address list in an embodiment;

[0044] Figure 4 A flowchart of obtaining the target cluster address list in an embodiment;

[0045] Figure 5 A flowchart of obtaining the detection results of the available protocol addresses in an embodiment;

[0046] Figure 6 A structural block diagram of the cluster address list obtaining device in an embodiment;

[0047] Figure 7 An internal structure diagram of the computer device in an embodiment. DETAILED DESCRIPTION

[0048] To make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0049] First, before specifically introducing the technical solutions of the embodiments of the present application, the technical background on which the embodiments of the present application are based is introduced.

[0050] Based on this, the present application provides a cluster address list obtaining method, device, computer device, medium and product, which aims to solve the above technical problems.

[0051] The cluster address list acquisition method provided by the embodiments of the present application can be applied to an application environment as shown in Figure 1 The service host 102 communicates with the server 104 through a network. The data storage system can store data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on a cloud or other network server. The server 104 acquires the internet protocol addresses of a plurality of service host machines 102; performs communication connection processing on each service host machine according to each internet protocol address and a pre-acquired minimum threshold of available connection number, to obtain an available address list; and performs periodic keep-alive detection processing based on the available address list, to obtain a target cluster address list. The service host machine 102 is a physical or virtual host machine running a service. The service host machine can be a physical server or a virtual server instance in a cloud computing environment. These host machines are installed with a service discovery registry center or other related service components, and can be accessed and communicated through the internet protocol address. The server 104 can be implemented by an independent server or a server cluster composed of a plurality of servers.

[0052] In one embodiment, as shown in Figure 2 A cluster address list acquisition method is provided, which is described by taking the server in Figure 1 as an example, including the following steps:

[0053] S201, acquiring internet protocol addresses of a plurality of service host machines.

[0054] The service host machine refers to a physical server or a virtual server instance running a specific service. It provides a running environment and resources for the service, and can be installed with a service discovery registry center and other key components.

[0055] The internet protocol address (IP address) refers to a digital label assigned to each device connected to a computer network, used for identification and communication in the network. In the embodiments of the present application, the IP address of the service host machine is key information for locating and connecting the service host machine.

[0056] In the embodiments of the present application, the IP addresses of the plurality of service host machines can be acquired through a pre-configured file or database. For example, when the system starts, the pre-stored service host IP address list is read from a configuration file.

[0057] Another implementation: The IP address of the service host machine can also be automatically discovered through network scanning. For example, a specific network scanning tool is used to scan in a specific network range, find the host machine running the specific service, and acquire the IP address thereof.

[0058] S202, performing a communication connection process on each service host according to each Internet protocol address and a minimum threshold of available connection numbers, to obtain an available address list.

[0059] The minimum threshold of available connection numbers is a preset value, which is used to determine whether the current available connection number is sufficient. When the available connection number is less than the threshold, the server triggers a specific operation to find more available service host addresses.

[0060] The available address list refers to a list containing all successfully connected service host addresses obtained after performing the communication connection process on the service host. The service host corresponding to the address in the list is considered available and can be used for subsequent service invocation and communication.

[0061] In the embodiment of the application, TCP connection attempts can be used to connect to each service host IP address. If the connection is successful, the address is added to the available address list, and relevant information such as connection time and connection status is recorded. At the same time, a timer is started to periodically perform a keep-alive probe on the connection. If the connection fails and the reason for the failure is “connection refused”, it is considered that there is no service discovery registration center running on the service host, and the address is not added to the available address list.

[0062] Another implementation: asynchronous connection can be used to simultaneously attempt to connect to multiple service host IP addresses. This can improve the efficiency of connection processing and reduce the connection establishment time. When the connection is successful or fails, a callback function is used to perform corresponding processing, and the result is added to the available address list or excluded from the address.

[0063] S203, performing a periodic keep-alive probe process based on the available address list, to obtain a target cluster address list.

[0064] The target cluster address list refers to the final address list obtained by performing a periodic keep-alive probe process on the available address list. This list contains the current available service registration center addresses and is the main basis for the system to perform service invocation and communication.

[0065] In the embodiment of the application, a specific probe request or heartbeat packet is periodically sent to each address in the available address list. If a response is received within a specified time, it is considered that the connection is still available, and the address is maintained in the available address list. If no response is received for a plurality of times, the address is deleted from the available address list. At the same time, it is checked whether the current available connection number is less than the minimum threshold of available connection numbers. If so, a new round of address probe process is triggered, the service host IP address is reacquired, and the connection process and keep-alive probe are performed.

[0066] Another embodiment: A distributed keep-alive probing mechanism can be used to distribute the keep-alive probing task to multiple nodes for parallel processing. This can improve the efficiency of keep-alive probing and timely discover connection failures. When a connection failure is discovered, a message passing mechanism is used to inform other nodes to update the available address list and trigger a new round of address probing in time.

[0067] The cluster address list acquisition method, device, computer equipment, medium and product described above acquire the Internet protocol addresses of multiple service host computers; perform communication connection processing on the service host computers according to the Internet protocol addresses and a pre-acquired minimum threshold of available connection numbers to obtain an available address list; and perform periodic keep-alive probing processing based on the available address list to obtain a target cluster address list. The present application performs communication connection processing on the service host computers according to the Internet protocol addresses and the minimum threshold of available connection numbers, which can quickly filter out available addresses and improve the efficiency of address discovery. After obtaining the available address list, periodic keep-alive probing processing is performed, which can monitor the availability of addresses in real time and greatly improve the accuracy and reliability of the address list.

[0068] In an exemplary embodiment, based on the above embodiment, please refer to Figure 3 The present embodiment relates to the process of performing communication connection processing on the service host computers according to the Internet protocol addresses and a pre-acquired minimum threshold of available connection numbers to obtain an available address list, which includes the following steps:

[0069] S301, performing communication connection processing on the service host computers according to the Internet protocol addresses of the service host computers.

[0070] In the present embodiment, for the IP address of each service host computer, a TCP connection attempt is used to attempt connection. A synchronous connection method can be used to sequentially connect each IP address, and after successful connection, relevant information such as connection time, connection status, etc. is recorded.

[0071] S302, determining an available address list according to the minimum threshold of available connection numbers and the candidate protocol addresses.

[0072] The candidate protocol addresses refer to the service host computer IP addresses that may become available addresses in the process of performing communication connection processing on the service host computers.

[0073] In the embodiments of the present application, firstly, the number of candidate protocol addresses that have successfully established connection is counted. If the number is greater than or equal to the minimum threshold of the available connection number, the candidate protocol addresses of the successful connection are grouped into the available address list. If the number is less than the minimum threshold of the available connection number, the connection attempt is continued on other candidate protocol addresses that have not been connected until the threshold requirement is met or all candidate protocol addresses have been attempted.

[0074] Through the judgment and screening of the connection number, the embodiments of the present application can ensure that the addresses in the available address list are all verified available addresses, thereby improving the reliability and stability of the system.

[0075] In an exemplary embodiment, based on the above embodiments, please refer to Figure 4 The embodiments of the present application relate to the process of obtaining the target cluster address list based on the periodic keep-alive detection processing of the available address list, which includes the following steps.

[0076] S401, sending a detection request to each available protocol address in the available address list based on a preset period to obtain the detection result of each available protocol address.

[0077] In the embodiments of the present application, a timer can be set to send a lightweight detection request, such as a simple heartbeat packet, to each available protocol address in the available address list at a preset period. If a response is received within the specified time, the detection result of the address is considered available; if no response is received, it is marked as unavailable.

[0078] Another implementation: a distributed detection method can be used to distribute the detection task to multiple nodes for simultaneous detection. Each node is responsible for detecting a part of the available protocol addresses and aggregating the detection results to the center node for processing. In this way, the detection efficiency can be improved and the detection time can be reduced.

[0079] S402, updating the available address list according to the multiple detection results to obtain the target cluster address list.

[0080] In the embodiments of the present application, the server traverses all the detection results. If the detection result of a certain available protocol address is available, it is retained in the available address list; if the detection result is unavailable, it is deleted from the available address list. The updated available address list is the target cluster address list.

[0081] Another implementation: a buffer area can be set up, and for the address whose detection result is unavailable, it is first put into the buffer area, and observation is continued for a period of time. If the detection result of the address is restored to available during the buffer period, it is re-added to the available address list; if it is unavailable all the time during the buffer period, it is finally deleted from the available address list. In this way, misjudgment caused by network fluctuations and the like can be avoided.

[0082] The embodiment of the application can discover the unavailability of the address in time through regular keep-alive detection, ensure that the addresses in the target cluster address list are all truly available, and improve the reliability of the system.

[0083] In an exemplary embodiment, based on the above embodiment, see Figure 5 The detection result of the embodiment of the application includes survival and inactivation; the process of sending a detection request to each available protocol address in the available address list based on a preset period and obtaining the detection result of each available protocol address includes the following steps:

[0084] S501, for each available protocol address in the available address list, a detection request is sent to the service host corresponding to the available protocol address.

[0085] The embodiment of the application can use a network request mode, such as an HTTP request or a specific custom protocol request, to send a detection request to a service host. The request can carry some identification information so that the service host can identify and respond quickly. An asynchronous detection request sending mode can also be used to send requests to multiple service hosts at the same time, improving the detection efficiency. Multi-threading or an asynchronous programming framework can be used to implement asynchronous sending.

[0086] S502, in the case where feedback information returned by the service host is received, the detection result of the service host is determined to be survival.

[0087] The feedback information refers to the response of the service host to the detection request, which can be a specific signal, data packet, etc., and is used to confirm the state of the service host.

[0088] The embodiment of the application immediately marks the detection result of the service host as survival when the feedback information returned by the service host is received, and records the time of receiving the feedback and the like information for subsequent analysis and statistics. The feedback information can also be further verified, for example, the integrity and correctness of the feedback information are checked. Only when the verification passes, the detection result is determined to be survival.

[0089] S503, in the case of not receiving the feedback information returned by the service host, re-sending the probe request to the service host until the sending number of the probe request reaches the preset number and the feedback information is not received, determining that the probe result of the service host is determined to be inactivated.

[0090] The embodiment of the application can set a counter, increase the value of the counter each time the feedback information is not received, and resend the probe request. When the counter reaches the preset number, it is determined that the probe result of the service host is inactivated, and the service host is deleted from the available address list. The waiting time can also be increased or the request parameters can be adjusted, for example, the timeout time of the request is increased, each time the probe request is resent, to improve the possibility of obtaining the feedback information. If the feedback information is still not received after multiple adjustments, it is determined to be inactivated.

[0091] The embodiment of the application can reduce the possibility of misjudgment and improve the accuracy of the judgment of the availability of the service host by sending multiple probe requests and determining the state of the service host according to the feedback. The inactivated service host can be found in time and deleted from the available address list, which can avoid using the unavailable address to call the service and improve the reliability of the system.

[0092] In an exemplary embodiment, based on the above embodiment, the embodiment of the application relates to a process of updating the available address list according to multiple probe results to obtain a target cluster address list, including the following steps: retaining the available protocol address corresponding to the probe result representing survival in the available address list, and deleting the available protocol address corresponding to the probe result representing inactivation from the available address list to obtain the target cluster address list.

[0093] In the embodiment of the application, the available address list can be traversed, and for each available protocol address, the corresponding probe result is checked. If the probe result is survival, the address is retained in the available address list; if the probe result is inactivation, the address is deleted from the available address list. The marked method can also be used, the addresses with the probe result of survival are marked, and then the unmarked addresses (i.e. inactivated addresses) are uniformly processed and deleted from the available address list. This can improve the processing efficiency, especially when processing large-scale address lists.

[0094] The embodiment of the present application can ensure that the addresses in the target cluster address list are available by updating the available address list according to the detection result, retaining only the live addresses and deleting the inactive addresses, thereby improving the accuracy of the address list. Using the accurate address list for service calling can avoid service interruption or errors caused by using unavailable addresses, thereby improving the reliability of the system. With the state change of the service host, dynamically updating the address list can make the system better adapt to the change of resources, reasonably allocate resources, and improve the performance and efficiency of the system.

[0095] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further comprises the following steps:

[0096] When the number of available protocol addresses in the target cluster address list is less than the minimum threshold of the available connection number, the step of obtaining the Internet protocol addresses of the plurality of service hosts is performed.

[0097] The embodiment of the present application can set up a monitoring mechanism to periodically check the number of available protocol addresses in the target cluster address list. When the number is found to be less than the minimum threshold of the available connection number, the step of obtaining the Internet protocol addresses of the plurality of service hosts is triggered immediately. The monitoring can be implemented using a timer or periodic task scheduling. The number of available protocol addresses in the target cluster address list can also be checked in real time when the system performs service calling. If the number is found to be insufficient when service calling is performed, the process of obtaining new service host IP addresses is started immediately to ensure the availability and stability of the service.

[0098] The embodiment of the present application automatically triggers the step of obtaining new addresses when the number of available addresses is insufficient, which can make the system adaptively cope with the change of address resources, thereby improving the flexibility and adaptability of the system. By supplementing the available addresses in time, it is ensured that the system has sufficient available connections at any time, thereby improving the availability and stability of the service.

[0099] In an exemplary embodiment, based on the above embodiment, the method of the embodiment of the present application further comprises the following steps:

[0100] Step 1: The server obtains the Internet protocol addresses of the plurality of service hosts;

[0101] Step 2: Each service host is processed for communication connection according to the Internet protocol address of each service host; the Internet protocol address of the service host with a successful connection is determined as a candidate protocol address; and the available address list is determined according to the minimum threshold of the available connection number and the candidate protocol address;

[0102] Step 3: For each available protocol address in the available address list, send a probe request to the service host corresponding to the available protocol address; if feedback information is received from the service host, determine that the probe result of the service host is alive; if no feedback information is received from the service host, resend the probe request to the service host until the number of probe requests sent reaches the preset number and no feedback information is received, then determine that the probe result of the service host is inactive;

[0103] Step 4: Retain the available protocol addresses that correspond to the probe results indicating liveness in the available address list, and delete the available protocol addresses that correspond to the probe results indicating inactivity in the available address list to obtain the target cluster address list;

[0104] Step 5: If the number of available protocol addresses in the target cluster address list is less than the minimum threshold for available connections, proceed with the step of obtaining the Internet protocol addresses of multiple service host machines.

[0105] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0106] Based on the same inventive concept, this application also provides a cluster address list acquisition device for implementing the cluster address list acquisition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more cluster address list acquisition device embodiments provided below can be found in the limitations of the cluster address list acquisition method described above, and will not be repeated here.

[0107] In one embodiment, such as Figure 6 As shown, a cluster address list acquisition device 600 is provided, comprising:

[0108] Address acquisition module 601 is used to acquire Internet Protocol addresses of multiple service host machines;

[0109] The available list determining module 602 is configured to perform a communication connection process on each service host according to each Internet protocol address and a pre-acquired minimum threshold of available connection number, to obtain an available address list.

[0110] The target list determining module 603 is configured to perform a periodical keep-alive detection process based on the available address list, to obtain a target cluster address list.

[0111] In one embodiment, the available list determining module 602 includes:

[0112] The communication connection unit is configured to perform a communication connection process on each service host according to an Internet protocol address of each service host.

[0113] The candidate address determining unit is configured to determine the Internet protocol address of the service host with successful connection as a candidate protocol address.

[0114] The available list determining unit is configured to determine an available address list according to the minimum threshold of available connection number and the candidate protocol address.

[0115] In one embodiment, the target list determining module includes:

[0116] The detection result determining unit is configured to send a detection request to each available protocol address in the available address list based on a preset period, to obtain a detection result of each available protocol address.

[0117] The target list determining unit is configured to update the available address list according to the plurality of detection results, to obtain a target cluster address list.

[0118] In one embodiment, the detection result includes alive and inactivated; and the detection result determining unit includes:

[0119] The request sending sub-unit is configured to send a detection request to the service host corresponding to the available protocol address for each available protocol address in the available address list.

[0120] The first result determining sub-unit is configured to determine the detection result of the service host as alive in a case where feedback information returned by the service host is received.

[0121] The second result determining sub-unit is configured to resend the detection request to the service host until the number of times of sending the detection request reaches a preset number of times and the feedback information is not received, and determine the detection result of the service host as inactivated in a case where the feedback information is not received.

[0122] In one embodiment, the target list determining unit includes:

[0123] The updating subunit is configured to retain, in the available address list, an available protocol address corresponding to a survival result, and delete, in the available address list, an available protocol address corresponding to an inactivation result, to obtain a target cluster address list.

[0124] In one of the embodiments, the apparatus further includes:

[0125] The iteration execution module is configured to execute the step of obtaining the IP addresses of the plurality of service hosts when the number of available protocol addresses in the target cluster address list is less than the minimum threshold of the available connection number.

[0126] The modules in the cluster address list obtaining apparatus can be implemented by software, hardware, or a combination thereof. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.

[0127] In one embodiment, a computer device is provided, which can be a server. An internal structure diagram of the computer device can be as shown in Figure 7 The computer device includes a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured 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 operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external service hosts through a network connection. The computer program is executed by the processor to implement a cluster address list obtaining method.

[0128] Those skilled in the art can understand that Figure 7 the structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0129] In one embodiment, a computer device is provided, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the following steps:

[0130] Obtaining internet protocol addresses of a plurality of service hosts;

[0131] According to each internet protocol address and a pre-obtained minimum threshold of available connection numbers, performing a communication connection process on each service host to obtain an available address list;

[0132] Based on the available address list, performing a periodic keep-alive probe process to obtain a target cluster address list.

[0133] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0134] According to the internet protocol addresses of each service host, performing a communication connection process on each service host;

[0135] Determining the internet protocol addresses of the service hosts that are successfully connected as candidate protocol addresses;

[0136] According to the minimum threshold of available connection numbers and the candidate protocol addresses, determining an available address list.

[0137] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0138] Based on a preset period, sending a probe request to each available protocol address in the available address list to obtain a probe result of each available protocol address;

[0139] According to a plurality of probe results, updating the available address list to obtain a target cluster address list.

[0140] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0141] For each available protocol address in the available address list, sending a probe request to the service host corresponding to the available protocol address;

[0142] In the case of receiving feedback information returned by the service host, determining that the probe result of the service host is alive;

[0143] In the case of not receiving feedback information returned by the service host, resending the probe request to the service host until the number of times of sending the probe request reaches a preset number of times and the feedback information is not received, and determining that the probe result of the service host is determined to be inactivated.

[0144] In one embodiment, the processor, when executing the computer program, further implements the following steps:

[0145] In the available address list, retaining the available protocol addresses corresponding to the probe results representing alive, and deleting the available protocol addresses corresponding to the probe results representing inactivated in the available address list to obtain a target cluster address list.

[0146] In one embodiment, the processor also implements the following steps when executing the computer program:

[0147] When the number of available protocol addresses in the target cluster address list is less than the minimum threshold of available connections, the step of obtaining the Internet protocol addresses of the plurality of service host computers is performed.

[0148] According to some embodiments of the present application, a non-transitory computer readable storage medium including instructions, for example, a memory including instructions, is also provided, which can be executed by a processor of an electronic device to complete the above method. For example, the non-transitory computer readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0149] According to some embodiments of the present application, a computer program product is also provided, which can implement the above method when executed by a processor. The computer program product includes one or more computer instructions. When loaded and executed on a computer, these computer instructions can implement some or all of the above method according to the processes or functions described in the embodiments of the present application, in whole or in part.

[0150] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0151] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application 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 storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric 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 but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0152] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.

[0153] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A cluster address list acquisition method characterized by comprising: The method comprises: obtaining internet protocol addresses of a plurality of service host computers; performing communication connection processing on each of the service host computers according to the internet protocol address of each of the service host computers, determining the internet protocol address of a service host computer that is successfully connected as a candidate protocol address, and determining an available address list according to a pre-obtained minimum threshold of the number of available connections and the candidate protocol address; for each available protocol address in the available address list, sending a probe request to the service host computer corresponding to the available protocol address, determining the probe result of the service host computer as alive if feedback information returned by the service host computer is received, re-sending the probe request to the service host computer if the feedback information returned by the service host computer is not received, determining the probe result of the service host computer as dead if the number of times of sending the probe request reaches a preset number and the feedback information is not received, and updating the available address list according to a plurality of the probe results to obtain a target cluster address list.

2. The method of claim 1, wherein, The updating of the available address list according to a plurality of the probe results to obtain the target cluster address list comprises: retaining the available protocol address corresponding to the probe result representing alive in the available address list, and deleting the available protocol address corresponding to the probe result representing dead from the available address list to obtain the target cluster address list.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: if the number of available protocol addresses in the target cluster address list is less than the minimum threshold of the number of available connections, performing the step of obtaining internet protocol addresses of a plurality of service host computers.

4. The method of claim 1, wherein, The obtaining of internet protocol addresses of a plurality of service host computers comprises: obtaining the internet protocol addresses of the plurality of service host computers from a pre-configured file or database, and / or obtaining the internet protocol addresses of the plurality of service host computers through network scanning.

5. The method of claim 1, wherein, The internet protocol address of the service host computer is used for locating and connecting the service host computer.

6. The method of claim 1, wherein, The communication connection processing comprises transmission control protocol (TCP) connection processing and / or synchronous connection processing.

7. A cluster address list acquisition apparatus characterized by comprising: The device comprises: an address obtaining module configured to obtain internet protocol addresses of a plurality of service host computers; an available list determining module configured to perform communication connection processing on each of the service host computers according to the internet protocol address of each of the service host computers, determine the internet protocol address of a service host computer that is successfully connected as a candidate protocol address, and determine an available address list according to a pre-obtained minimum threshold of the number of available connections and the candidate protocol address; A target list determining module is configured to send a probe request to a service host corresponding to each available protocol address in the available address list, determine that a probe result of the service host is alive if feedback information returned by the service host is received, resend the probe request to the service host if the feedback information returned by the service host is not received, determine that the probe result of the service host is determined to be inactive if the number of times of sending the probe request reaches a preset number and the feedback information is not received, update the available address list according to a plurality of probe results to obtain a target cluster address list.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6. The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Management method and device of exclusive host machine and electronic equipment

    CN112751694A

  • Hardware protocol stack-based TCP long connection keep-alive method and device

    CN115225690A