Server testing methods and devices, storage media and electronic devices

By loosely coupling a health detection mechanism in the server cluster, and using status detection requests and identification information to determine the server status, the problem of misjudgment of health status caused by tight coupling between the proxy end and the backend server configuration level is solved, thereby improving the stability and disaster recovery capability of the server cluster.

CN119652726BActive Publication Date: 2026-01-30HUNAN HAPPLY SUNSHINE INTERACTIVE ENTERTAINMENT MEDIA CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411775617.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2026-01-30
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

In traditional server health monitoring mechanisms, the tight coupling between the agent and the backend server configuration levels can lead to misjudgments of health status, affecting the stability and reliability of the server cluster.

Method used

By sending a status detection request from the target server to the reference server and determining the server status based on the status identification information if no response is received within a predetermined time interval, the health detection achieves loose coupling and accuracy, and reduces configuration complexity.

Benefits of technology

It improves the stability and disaster recovery capabilities of the server cluster, reduces configuration complexity and the cost of replacing proxy servers, and enhances the accuracy and efficiency of health checks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652726B_ABST
    Figure CN119652726B_ABST
Patent Text Reader

Abstract

This application discloses a server detection method, apparatus, storage medium, and electronic device. The method includes: sending a target status detection request to a reference server through a target proxy server at a first moment; determining that the reference server is in an abnormal state if reference status information has not been received through the target proxy server at a second moment; obtaining status identifier information carried in the reference status information if the reference status information is received through the target proxy server before the second moment; determining that the reference server is in a normal operating state if the status identifier information matches the target status identifier information; and determining that the reference server is in an abnormal state if the status identifier information does not match the target status identifier information. This solves the technical problem of the tight coupling between the proxy end and the backend server configuration layer affecting the stability of the server cluster.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computers, in particular to a server detection method and device, a storage medium and an electronic device. BACKGROUND

[0002] In the high-availability architecture of a server cluster, the traditional server health detection mechanism often relies on the agent end sending a probe request to the backend server to evaluate the running state of the server. This method requires the backend server to design and expose a special port path for receiving and responding to the health check signal of the agent. The agent end collects response information by periodically sending requests to these paths and determines the health status of the server according to the preset strategy. However, the implementation of this mechanism intensifies the coupling between the agent end and the backend server, especially in the configuration level. Any inconsistency in the configuration can lead to false judgment of the health status, thereby affecting the stability and reliability of the entire cluster.

[0003] In other words, using the server detection method provided in the related art, there is still the technical problem of false judgment of the health status due to the close coupling between the agent end and the backend server in the configuration level, thereby affecting the stability of the server cluster.

[0004] At present, there is no effective solution to the above problems. SUMMARY

[0005] The embodiments of the present application provide a server detection method and device, a storage medium and an electronic device to at least solve the technical problem of affecting the stability of the server cluster due to the close coupling between the agent end and the backend server in the configuration level.

[0006] According to an aspect of the embodiments of the present application, a detection method of a server is provided, comprising: sending, by a target server, a target state detection request to a reference server through a target proxy server at a first time point, wherein the state detection message is used to acquire state information of the reference server, the target server and the reference server both belong to a target server cluster, and the target proxy server is a proxy server configured for the target server cluster; in a case that the target server has not received reference state information returned by the reference server through the target proxy server at a second time point, determining that the reference server is in an abnormal state, wherein the second time point is later than the first time point, and a time interval between the second time point and the first time point is greater than a target interval; in a case that the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, acquiring state identification information carried in the reference state information; in a case that the state identification information matches target state identification information, determining that the reference server is in a normal operation state; and in a case that the state identification information does not match the target state identification information, determining that the reference server is in an abnormal state.

[0007] According to another aspect of the embodiments of the present application, a detection device of a server is further provided, comprising: a sending unit, configured to send a target state detection request to a reference server through a target proxy server at a first time point, wherein the state detection message is used to acquire state information of the reference server, the target server and the reference server both belong to a target server cluster, and the target proxy server is a proxy server configured for the target server cluster; a first determining unit, configured to determine that the reference server is in an abnormal state in a case that the target server has not received reference state information returned by the reference server through the target proxy server at a second time point, wherein the second time point is later than the first time point, and a time interval between the second time point and the first time point is greater than a target interval; a second determining unit, configured to acquire state identification information carried in the reference state information in a case that the target server receives the reference state information returned by the reference server through the target proxy server before the second time point; in a case that the state identification information matches target state identification information, determining that the reference server is in a normal operation state; and in a case that the state identification information does not match the target state identification information, determining that the reference server is in an abnormal state.

[0008] According to still another aspect of the embodiments of the present application, a computer readable storage medium is further provided, and the computer readable storage medium stores a computer program, wherein the computer program is set to execute the above-mentioned detection method of a server when running.

[0009] According to another aspect of the embodiments of the present application, a computer program product or computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device performs the detection method of the server as above.

[0010] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises a memory and a processor, the memory stores a computer program, and the processor is configured to execute the detection method of the server as above through the computer program.

[0011] In the embodiments of the present application, the target server sends a target state detection request to the reference server through the target proxy server at a first time point, the state detection message is used to obtain the state information of the reference server, the target server and the reference server both belong to the target server cluster, and the target proxy server is a proxy server configured for the target server cluster; in the case that the target server has not received the reference state information returned by the reference server through the target proxy server at a second time point, it is determined that the reference server is in an abnormal state, wherein the second time point is later than the first time point, and the time interval between the second time point and the first time point is greater than the target interval; in the case that the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, the state identification information carried in the reference state information is obtained; in the case that the state identification information matches the target state identification information, it is determined that the reference server is in a normal operation state; and in the case that the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state. In other words, by decentralizing the initiation right and the determination right of health detection to the backend server, a more loosely coupled, efficient and accurate server cluster health detection mechanism is realized, the stability and disaster recovery capability of the entire server cluster are significantly improved, and the configuration complexity and the replacement cost of the proxy server are reduced. The technical problem of affecting the stability of the server cluster due to the health state misjudgment caused by the inconsistent configuration of the proxy end and the backend server in the detection method of the server provided in the related art is solved. BRIEF DESCRIPTION OF DRAWINGS

[0012] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application and illustrate the illustrative embodiments of the present application and their description serve to explain the present application, but do not constitute improper limitations on the present application. In the drawings:

[0013] Figure 1 is a flowchart of an optional detection method of a server according to the embodiments of the present application;

[0014] Figure 2 is a schematic diagram of an optional server detection method according to an embodiment of the application;

[0015] Figure 3 is a schematic diagram of an optional server detection method according to an embodiment of the application;

[0016] Figure 4 is a schematic diagram of an optional server detection method according to an embodiment of the application;

[0017] Figure 5 is a structural schematic diagram of an optional server detection device according to an embodiment of the application;

[0018] Figure 6 is a structural schematic diagram of an optional electronic device according to an embodiment of the application. DETAILED DESCRIPTION

[0019] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work should fall within the scope of protection of the present application.

[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0021] Optionally, as an optional solution, as shown in Figure 1 the server detection method comprises:

[0022] S102, the target server sends a target state detection request to the reference server through the target proxy server at a first time point, wherein the state detection message is used to obtain state information of the reference server, the target server and the reference server belong to the target server cluster, and the target proxy server is a proxy server configured for the target server cluster.

[0023] Optionally, in some embodiments, the server detection method described above can be applied in the application scenario of the server detection method, but is not limited to the application scenario. The application scenario is mainly in a distributed server cluster environment, especially in a server cluster under a cloud platform, a data center or a high-availability architecture, to ensure the health status of the server and the stable operation of the cluster.

[0024] It should be noted that in some embodiments, the target server described above can be used to indicate a server for health status detection, which is built-in with a target server detection module responsible for sending a state detection request to other servers in the cluster. In addition, the target server detection module can also be used to receive a state detection request sent by other servers in the target server cluster. The reference server described above can be used to indicate one of the other servers in the target server cluster detected by the target server.

[0025] Further, the target proxy server described above can be used to indicate a proxy server shared by the target server cluster, which is responsible for forwarding traffic and relaying health check requests. In this embodiment, the target proxy server forwards the target state detection request through a normal business traffic forwarding channel without creating a dedicated health detection channel.

[0026] It should be noted that the target server described above can periodically perform health detection on the reference server according to a target period. Correspondingly, other servers in the target server cluster also periodically perform health detection on the target server. In other words, in some embodiments, any server in the target server cluster can periodically perform health detection on other servers in the target server cluster, and can also be health detected by other servers in the target server cluster, which is not limited in this embodiment.

[0027] For example, as shown in Figure 2 , the target proxy server 202 can send and receive health detection messages to the target server detection module 204-1 configured in the target server 204 through the business traffic forwarding channel. At the same time, the business interface 204-2 of the target server 204 also sends and receives business traffic through the target proxy server through the business traffic forwarding channel.

[0028] S104, if the target server has not received the reference status information returned by the reference server through the target proxy server at the second time, it is determined that the reference server is in an abnormal state, wherein the second time is later than the first time, and the time interval between the second time and the first time is greater than the target interval.

[0029] It should be noted that the aforementioned target status detection request can be, but is not limited to, a request sent by the target server to the reference server through the target proxy server to obtain its status information, such as an HTTP request. The aforementioned reference status information is the status information returned by the reference server to the target server after receiving the target status detection request, used to characterize its current operating status. The aforementioned status identification information is a specific identifier carried in the reference status information, such as an HTTP status code, used to determine whether the reference server is operating normally.

[0030] S106, if the target server receives the reference status information returned by the reference server through the target proxy server before the second time, obtain the status identifier information carried in the reference status information; if the status identifier information matches the target status identifier information, determine that the reference server is in normal operating state; if the status identifier information does not match the target status identifier information, determine that the reference server is in abnormal state.

[0031] It should be noted that, in the case of the status identifier information being an HTTP status code, the aforementioned target status identifier information can be a status code used to indicate that the server is functioning normally, such as status code 200.

[0032] Optionally, but not limited to, the above steps can be explained using distance-based examples:

[0033] Initialization configuration: Configure the target server detection module for target server 1, set the IP address of the target proxy server to 10.1.1.1, the fixed path to / health, and set the target interval to 3 seconds.

[0034] Target status detection request sending: At any first moment, the transmitter in the target server detection module of target server 1 sends an HTTP request to the / health path of 10.1.1.1. The request contains the identifier of target server 1 and the identifier of target server 2 to be detected.

[0035] Waiting interval for target: After sending the request, target server 1 starts timing and waits for the target interval of 3 seconds in order to receive the response from target server 2.

[0036] Receiving and analyzing reference state information: if a response of the target server 2 is received within the target interval, the determinator in the target server detection module analyzes the state information in the response, such as the HTTP status code being 200, indicating that the target server 2 is in a normal operation state; if not 200, it is determined to be an abnormal state.

[0037] Processing if reference state information is not received: if any response of the target server 2 is not received after the end of the target interval, the determinator in the target server detection module directly marks the state of the target server 2 as abnormal, and triggers the disaster recovery processing flow.

[0038] It should be noted that the above examples are provided for the convenience of explaining the above steps, and there is no limitation on the above server detection method.

[0039] In the embodiment of the present application, the target server sends a target state detection request to the reference server through the target proxy server at the first time, wherein the state detection message is used to obtain the state information of the reference server, the target server and the reference server belong to the target server cluster, and the target proxy server is a proxy server configured for the target server cluster; in the case that the target server has not received the reference state information returned by the reference server through the target proxy server at the second time, it is determined that the reference server is in an abnormal state, wherein the second time is later than the first time, and the time interval between the second time and the first time is greater than the target interval; in the case that the target server receives the reference state information returned by the reference server through the target proxy server before the second time, the state identification information carried in the reference state information is obtained; in the case that the state identification information matches the target state identification information, it is determined that the reference server is in a normal operation state; in the case that the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state. In other words, by decentralizing the initiation right and the determination right of health detection to the backend server, a more loosely coupled, efficient and accurate server cluster health detection mechanism is realized, the stability and disaster recovery capability of the entire server cluster are significantly improved, and the configuration complexity and the replacement cost of the proxy server are reduced. The health state misjudgment problem caused by the tight coupling of the configuration level of the proxy end and the backend server in the server detection method provided in the related art is solved, thereby affecting the stability of the server cluster.

[0040] Optionally, as an optional solution, the target server sends a target state detection request to the reference server through the target proxy server at the first time, which includes:

[0041] The target server detection module configured in the target server sends a target state detection request to the reference server detection module configured in the reference server through the target proxy server at a first time, wherein the target state detection request carries a reference network address of the reference server detection module and a port identifier of a detection port configured for the reference server detection module.

[0042] It should be noted that the target server detection module is a software module built-in the target server, which is responsible for periodically sending health check requests to other servers in the target server cluster, receiving and processing health state responses of other servers, and performing state judgment and disaster recovery processing according to the received health state information.

[0043] Correspondingly, the reference server detection module is a software module built-in the reference server, which is responsible for periodically sending health check requests to other servers in the target server cluster, receiving and processing health state responses of other servers, and performing state judgment and disaster recovery processing according to the received health state information.

[0044] Optionally, the server health detection program (including the target server detection module and the reference server detection module) can but is not limited to include, as shown in Figure 3 including:

[0045] The transmitter 302 is configured to send detection requests, for example, to send http requests to a fixed path of a certain IP address at a fixed frequency, and to pass the corresponding status code and the corresponding address in the request result to the determinator. The fixed frequency does not need to be configured and can be set internally, for example, 2 times per second; the certain IP needs to be configured as the IP address of the proxy, and no matter what kind of proxy implementation is used, it has IP attribute, so this configuration does not exist binding, and the proxy can be replaced at any time; the fixed path is built-in as the path of the receiver.

[0046] The receiver 304 is configured to receive health state responses, for example, to give a web interface, receive http requests, and return the local IP as the result to the other party.

[0047] The determinator 306 is configured to determine the health state, for example, to receive the IP and state information passed by the transmitter, and to mark the IP as online or offline according to the built-in determination rule. For example, if no return of a certain IP is received for 3 seconds in succession, it is marked as offline; if a normal return is received once, it is marked as online.

[0048] The state maintainer 308 is configured to store all backend node IPs and health states, which is essentially a memory space that maintains the determination results of the determinator.

[0049] Disaster recovery processor 310 is used to execute disaster recovery strategy when the backend node is abnormal, for example, subscribe to health state change event in state maintenance ware, so as to trigger different actions, this part can be realized by user according to self business, disaster recovery execution form includes but not limited to script, webhook and the like.

[0050] Optionally, the above steps can be exemplarily explained by the following examples, but not limited to:

[0051] S1, environment configuration environment: a target server cluster under a cloud platform, which includes target server 1, target server 2 to target server N, and target proxy server (such as load balancer). The IP address of the target proxy server is 10.1.1.a, and the IP address of the target server 1 is 10.1.1.b. It is assumed that the target server 1 needs to detect the health status of the target server 2, and the IP address of the target server 2 is 10.1.1.c, and the detection port is 8080.

[0052] S2, target state detection request sending request time: the first time is set as the current time, such as 2023-04-0110:00:00. Transmitter: the transmitter module on the target server 1 starts to work, which sends a target state detection request to the detection port 8080 of the target server 2 through the target proxy server 10.1.1.a. Request content: the target state detection request contains a specific HTTP request, for example, a GET request to / health path, and carries the identification of the target server 1 and the reference network address (IP: 10.1.1.c) of the target server 2 and the detection port identification (port: 8080) in the request header.

[0053] S3, state detection request forwarding the target proxy server 10.1.1.a receives the target state detection request, and based on the built-in forwarding rules, forwards the request to the detection port 8080 of the target server 2. The receiver module of the target server 2 receives the request and processes it, and then returns an HTTP response on the / health path through the transmitter module, which contains state identification information, such as HTTP status code 200 indicating normal operation, or 500 indicating internal server error.

[0054] S4, the receiver module of the target server 1 receives the response forwarded by the target proxy server, and transmits the state identification information in the response to the determinator. The determinator determines the health state of the target server 2 according to the built-in determination rule, such as marking as abnormal if 200 status code response is not received for three times in succession. State information maintenance: if the state identification information of the target server 2 indicates that it is in a normal operation state, the state maintainer updates the health state information of all backend nodes in the cluster, and marks the state of the target server 2 as normal. If the state identification information indicates abnormality, the state maintainer marks the state of the target server 2 as abnormal, and triggers the disaster recovery strategy of the disaster recovery processor.

[0055] S5, disaster recovery processing flow The disaster recovery processor subscribes to the health state change event in the state maintainer, and once it detects that the state of the target server 2 is determined to be abnormal, it performs the predefined disaster recovery operation, such as automatically executing the “restart service” script to attempt to restore the service of the target server 2. Alternatively, if the target server 2 cannot be restored by restarting, the disaster recovery processor can perform a more complex disaster recovery strategy, such as redirecting traffic to other healthy servers in the cluster to ensure service continuity and high availability.

[0056] It should be noted that the above example is an optional example provided for the convenience of explaining the above steps, and there is no limitation on the detection method of the above server.

[0057] By defining the target server detection module and the reference server detection module, the initiation and response responsibilities of health detection are clearly divided, making the health check mechanism more modular and manageable. At the same time, the reference network address and port identifier carried in the target state detection request ensure the accuracy and pertinence of the request, avoiding the problem of misfiring or response mismatch, and improving the accuracy and efficiency of health detection.

[0058] Optionally, as an optional solution, in the case that the target server has not received the reference state information returned by the reference server through the target proxy server at the second time, determining that the reference server is in an abnormal state comprises: in the case that the target server detection module has not received the reference state information returned by the reference server detection module through the target proxy server at the second time, determining that the reference server is in an abnormal state.

[0059] In a case where the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, the obtaining of the state identifier information carried in the reference state information comprises: in a case where the target server detection module receives the reference state information returned by the reference server detection module through the target proxy server before the second time point, the obtaining of the state identifier information carried in the reference state information;

[0060] In a case where the state identifier information matches the target state identifier information, the determining of the reference server as being in a normal state comprises: in a case where the state identifier information matches the target state identifier information, the target server detection module determines the reference server as being in a normal state.

[0061] In a case where the state identifier information does not match the target state identifier information, the determining of the reference server as being in an abnormal state comprises: in a case where the state identifier information does not match the target state identifier information, the target server detection module determines the reference server as being in an abnormal state.

[0062] It should be noted that the target server detection module receives the above-mentioned reference state information through the receiver, and determines the running state of the reference server by using the determinator.

[0063] By using the embodiment of the present application, the target server detection module performs health check, which can not only accurately identify the abnormal state of the reference server, but also accurately distinguish the normal running state and the abnormal state based on the matching of the state identifier information. This enables the disaster recovery processor to make disaster recovery decisions more quickly and accurately, such as automatically isolating the abnormal server, reallocating traffic, etc., thereby further enhancing the stability and disaster recovery capability of the server cluster.

[0064] Optionally, as an optional solution, after determining that the reference server is in an abnormal state, the method further comprises:

[0065] reporting, by the target server detection module, abnormal prompt information to a cluster maintenance system for maintaining the target server cluster, wherein the abnormal prompt information is used to prompt a storage fault of the reference server.

[0066] It should be noted that in some embodiments, the target server detection module can but is not limited to report the above-mentioned abnormal prompt information through the disaster recovery processor. The above-mentioned cluster maintenance system can but is not limited to a system responsible for detecting and managing the running state of the entire target server cluster, including but not limited to functions such as fault detection, resource allocation, cluster configuration management, etc. It is usually an important tool for cluster operation and maintenance, and can receive health state reports and abnormal information from each server in the cluster.

[0067] Further, when the target server detects that the reference server is in an abnormal state, the target server detection module generates and sends prompt information. The prompt information may include, but is not limited to, the identification (such as an IP address) of the reference server, a description of the abnormal state (such as a storage failure), and detailed information such as a possible abnormal timestamp, for further positioning and processing of the problem by the cluster maintenance system, which is not limited in the embodiment.

[0068] In the embodiment, after the target server detection module determines that the reference server is in an abnormal state, the abnormal prompt information is reported to the cluster maintenance system, so as to timely notify the operation and maintenance personnel or the monitoring system, realize rapid positioning and processing of the fault, reduce the influence range and duration of the fault, and improve the management and maintenance efficiency of the cluster.

[0069] Optionally, as an optional solution, the server detection method further includes:

[0070] The target server is configured with a target server detection module, wherein the target server detection module is configured to send a state detection message to a server other than the target server in the target server cluster, to detect the running state of the server other than the target server in the target server cluster, and the target server detection module is further configured to receive a state detection request sent by the server other than the target server in the target server cluster;

[0071] The target server detection module is configured with a network address and a detection port.

[0072] It should be noted that in the embodiment, the network address configuration is a network address required by the target server detection module, which is usually an IP address, and is used to receive the state detection request sent by the other server. The module may also need to know the network address of the other server in order to actively send a health check request. The detection port is a specific port number, and the target server detection module listens to the state detection request on the port, and the other server sends the state detection request to the target server through the port. The detection port ensures the distinction between the health check request and other service requests, and avoids unnecessary interference.

[0073] In the embodiment, the target server is configured with the target server detection module, the network address, and the detection port, which not only simplifies the configuration process of the health detection, but also improves the flexibility and expansibility of the configuration, makes it more convenient to add or replace servers in the server cluster, and reduces the risk of health detection misjudgment caused by configuration errors.

[0074] Optionally, as an optional solution, the server detection method further includes:

[0075] In a case where the target server receives the reference state detection request sent by the reference server through the target proxy server, the target proxy server sends target state information for responding to the reference state detection request to the reference server, wherein the target state information is used to represent the running state of the target server, and in a case where the reference server receives the target state information, the running state of the target server is determined according to the target state information.

[0076] Optionally, in some embodiments, the reference state detection request is used to indicate a request sent by the reference server to the target server, and the purpose is to obtain the running state information of the target server. The target state information can be, but is not limited to, information returned by the target server in response to the reference state detection request, and is used to represent the running state of the target server, and can include HTTP identification code and other information, which is not limited in this embodiment.

[0077] By using the embodiment of the present application, the ability of the target server to respond to the detection request of the reference server is increased, that is, the target server can send target state information reflecting the running state of the target server to the reference server through the target proxy server. This bidirectional health check mechanism not only strengthens the health state synchronization between the servers in the cluster, but also provides more detailed health state information, which helps the disaster recovery processor to make more accurate decisions, and further improves the disaster recovery management capability of the cluster.

[0078] Optionally, as an optional example, the detection method of the server can be exemplarily explained based on the following example as shown in Figure 4

[0079] As shown in Figure 4 The proxy server of the target server cluster is proxy server A, and the target server cluster includes N servers, including server 1, server 2 to server N; the server 1, the server 2 to the server N are all configured with a business port and a server health detection program (used to represent a server detection module); the server 1, the server 2 to the server N all use the business interface configured by each server to receive and send the business traffic received and sent through the forwarding channel of the proxy server A, and the server 1, the server 2 to the server N all use the server health detection program configured by each server to receive and send the health detection message received and sent through the forwarding channel of the proxy server A.

[0080] It should be noted that the above example is an optional example provided for the purpose of explaining the above steps, and the detection method of the server is not limited in any way.

[0081] ​It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the action sequence described, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily necessary for the present application.

[0082] According to another aspect of the embodiments of the present application, a detection device for implementing the detection method of the server is also provided. As shown in the figure, the device comprises: Figure 5

[0083] The sending unit 502 is configured to send a target state detection request to the reference server through the target proxy server at the first time, wherein the state detection message is used to obtain the state information of the reference server, the target server receiving the state detection message and the reference server both belong to the target server cluster, and the target proxy server is a proxy server configured for the target server cluster.

[0084] The first determination unit 504 is configured to determine that the reference server is in an abnormal state if the reference server returns the reference state information through the target proxy server at the second time, wherein the second time is later than the first time, and the time interval between the second time and the first time is greater than the target interval.

[0085] The second determination unit 506 is configured to obtain the state identification information carried in the reference state information if the target server receives the reference state information returned by the reference server through the target proxy server before the second time. If the state identification information matches the target state identification information, it is determined that the reference server is in a normal operating state. If the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state.

[0086] Optionally, in some embodiments, the sending unit comprises a sending module, which is configured to send a target state detection request to the reference server detection module configured in the reference server through the target proxy server at the first time, wherein the target state detection request carries the reference network address of the reference server detection module and the port identification of the detection port configured for the reference server detection module.

[0087] ​Optionally, in some embodiments, the first determining unit comprises a first determining module configured to determine that the reference server is in an abnormal state if the reference state information returned by the reference server detection module has not been received by the target proxy server at the second time; the second determining unit comprises a first obtaining module configured to obtain state identification information carried in the reference state information if the reference state information returned by the reference server detection module is received by the target server detection module through the target proxy server before the second time; the second determining unit further comprises a second determining module configured to determine that the reference server is in a normal state if the state identification information matches the target state identification information; and the second determining unit further comprises a third determining module configured to determine that the reference server is in an abnormal state if the state identification information does not match the target state identification information.

[0088] Optionally, in some embodiments, the apparatus further comprises an abnormal message reporting unit configured to report abnormal prompt information to a cluster maintenance system for maintaining the target server cluster through the target server detection module, wherein the abnormal prompt information is used to prompt a storage fault of the reference server.

[0089] Optionally, in some embodiments, the apparatus further comprises a first configuring unit configured to configure the target server with a target server detection module, wherein the target server detection module is configured to send a state detection message to a server other than the target server in the target server cluster to detect a running state of the server other than the target server in the target server cluster, and the target server detection module is further configured to receive a state detection request sent by the server other than the target server in the target server cluster; and a second configuring unit configured to configure the target server detection module with a network address and a detection port.

[0090] Optionally, in some embodiments, the apparatus further comprises a receiving unit configured to send target state information used to respond to the reference state detection request to the reference server through the target proxy server if the target server receives the reference state detection request sent by the reference server through the target proxy server, wherein the target state information is used to represent a running state of the target server, and the running state of the target server is determined according to the target state information if the target state information is received by the reference server.

[0091] The specific embodiments can refer to the examples shown in the server detection method, and will not be described here.

[0092] According to another aspect of the embodiments of the present application, an electronic device for implementing the server detection method is provided. The electronic device is taken as an example to illustrate the embodiments. As shown in FIG. 8, the electronic device comprises a processor 801, a memory 802 and a communication interface 803. Figure 6As shown, the electronic device includes a memory 602 in which a computer program is stored, and a processor 604 configured to execute the steps in any of the method embodiments described above through the computer program.

[0093] Optionally, in the embodiment, the electronic device can be located in at least one of the plurality of network devices of the computer network.

[0094] Optionally, in the embodiment, the processor can be configured to execute the following steps through the computer program:

[0095] S1, the target server sends a target state detection request to the reference server through the target proxy server at a first time, wherein the state detection message is used to obtain the state information of the reference server, the target server and the reference server both belong to the target server cluster, and the target proxy server is a proxy server configured for the target server cluster;

[0096] S2, in the case that the target server has not received the reference state information returned by the reference server through the target proxy server at a second time, it is determined that the reference server is in an abnormal state, wherein the second time is later than the first time, and the time interval between the second time and the first time is greater than the target interval;

[0097] S3, in the case that the target server receives the reference state information returned by the reference server through the target proxy server before the second time, the state identification information carried in the reference state information is obtained; in the case that the state identification information matches the target state identification information, it is determined that the reference server is in a normal operation state; in the case that the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state.

[0098] Optionally, those skilled in the art can understand that, Figure 6 The structure shown is only schematic, and the electronic device can also be a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, etc. Figure 6 It does not limit the structure of the electronic device described above. For example, the electronic device can also include more or fewer components (such as network interfaces, etc.) than Figure 6 shown, or have a different configuration than Figure 6 shown.

[0099] The memory 602 can be used to store software programs and modules, such as program instructions / modules corresponding to the server detection method and device in the embodiments of the present application. The processor 604 executes various functions and data processing by running the software programs and modules stored in the memory 602, that is, implements the server detection method described above. The memory 602 can include a high-speed random access memory, and can further include a non-volatile memory such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 602 can further include a memory remotely arranged with respect to the processor 604, which can be connected to the terminal through a network. Examples of the network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. As an example, as shown in Figure 6 The memory 602 can include but is not limited to the sending unit 502, the first determination unit 504, and the second determination unit 506 in the server detection device described above. In addition, other module units in the server detection device described above can also be included, but are not limited to, which will not be described in detail in this example.

[0100] Optionally, the transmission device 606 described above is used to receive or send data via a network. Specific examples of the network can include wired networks and wireless networks. In one example, the transmission device 606 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable to communicate with the Internet or a local area network. In one example, the transmission device 606 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet in a wireless manner.

[0101] In addition, the electronic device described above further includes a display 608 and a connection bus 610 for connecting various module components in the electronic device.

[0102] In other embodiments, the terminal device or the server described above can be a node in a distributed system, where the distributed system can be a blockchain system, which can be a distributed system formed by the plurality of nodes communicating through a network. Wherein, the nodes can form a point-to-point network, and any form of computing device, such as a server, a terminal, and other electronic devices, can become a node in the blockchain system by joining the point-to-point network.

[0103] According to an aspect of the present application, a computer program product is provided, which includes computer programs / instructions containing program codes for executing the above method. In such an embodiment, the computer program can be downloaded and installed from a network by a communication part, and / or installed from a detachable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are executed.

[0104] According to an aspect of the present application, another computer program product is also provided, which includes a non-volatile computer readable storage medium storing a computer program, which is executed by a processor to implement the steps of the method in various embodiments of the present application.

[0105] According to an aspect of the present application, a computer readable storage medium is provided, from which a processor of a computer device reads computer instructions, and the processor executes the computer instructions to enable the computer device to execute the above method.

[0106] Optionally, in the present embodiment, the above computer readable storage medium can be configured to store a computer program for executing the following steps:

[0107] S1. The target server sends a target state detection request to a reference server through a target proxy server at a first time point, wherein the state detection message is used to obtain state information of the reference server, the target server and the reference server both belong to a target server cluster, and the target proxy server is a proxy server configured for the target server cluster;

[0108] S2. In a case where the target server has not received reference state information returned by the reference server through the target proxy server at a second time point, it is determined that the reference server is in an abnormal state, wherein the second time point is later than the first time point, and a time interval between the second time point and the first time point is greater than a target interval;

[0109] S3. In a case where the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, state identification information carried in the reference state information is obtained; in a case where the state identification information matches target state identification information, it is determined that the reference server is in a normal operation state; in a case where the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state.

[0110] Optionally, in the embodiment, all or part of the steps in the various methods of the above embodiments can be understood by those skilled in the art that the terminal device related hardware can be instructed by a program, and the program can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0111] The integrated units in the above embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of software products. The computer software product is stored in a storage medium and includes a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0112] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.

[0113] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented by other means. Among them, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed mutual units can be indirect coupling or communication connection through some interface, unit or module, and can be electrical or other forms.

[0114] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.

[0115] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software function unit.

[0116] The above merely preferred embodiments of the present application, it should be noted that for those of ordinary skill in the art, without departing from the principles of the present application, can also make a number of improvements and refinements, these improvements and refinements should also be considered as the scope of protection of the present application.

Claims

1. A detection method of a server, characterized by, The method comprises the following steps: a target server sends a target state detection request to a reference server through a target proxy server at a first time point, wherein the state detection request is used to obtain state information of the reference server, the target server and the reference server belong to a target server cluster, and the target proxy server is a proxy server configured for the target server cluster; in a case where the target server has not received reference state information returned by the reference server through the target proxy server at a second time point, it is determined that the reference server is in an abnormal state, wherein the second time point is later than the first time point, and a time interval between the second time point and the first time point is greater than a target interval; in a case where the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, state identification information carried in the reference state information is obtained; in a case where the state identification information matches target state identification information, it is determined that the reference server is in a normal operation state; and in a case where the state identification information does not match the target state identification information, it is determined that the reference server is in an abnormal state.

2. The method of claim 1, wherein, The target server sends a target state detection request to a reference server through a target proxy server at a first time point, which comprises the following steps: a target server detection module configured in the target server sends the target state detection request to a reference server detection module configured in the reference server through the target proxy server at a first time point, wherein the target state detection request carries a reference network address of the reference server detection module and a port identifier of a detection port configured for the reference server detection module.

3. The method of claim 2, wherein in a case where the target server detection module has not received reference state information returned by the reference server detection module through the target proxy server at a second time point, it is determined that the reference server is in an abnormal state; in a case where the target server detection module receives the reference state information returned by the reference server detection module through the target proxy server before the second time point, state identification information carried in the reference state information is obtained; in a case where the state identification information matches target state identification information, it is determined that the reference server is in a normal state. The determining that the reference server is in an abnormal state in the case that the state identification information does not match the target state identification information comprises: the target server detection module determining that the reference server is in an abnormal state in the case that the state identification information does not match the target state identification information.

4. The method of claim 2, wherein, After the determining that the reference server is in an abnormal state, the method further comprises: reporting abnormal prompt information to a cluster maintenance system for maintaining the target server cluster through the target server detection module, wherein the abnormal prompt information is used to prompt the reference server storage failure.

5. The method according to any one of claims 1 to 4, characterized in that, Before the target server sends a target state detection request to the reference server through a target proxy server at a first time, the method further comprises: configuring a target server detection module for the target server, wherein the target server detection module is used to send a state detection message to a server other than the target server in the target server cluster to detect the running state of the server other than the target server in the target server cluster, and the target server detection module is further used to receive a state detection request sent by the server other than the target server in the target server cluster; configuring a network address and a detection port for the target server detection module.

6. The method according to any one of claims 1 to 4, characterized in that, The server detection method further comprises: in the case that the target server receives a reference state detection request sent by the reference server through the target proxy server, sending target state information used to respond to the reference state detection request to the reference server through the target proxy server, wherein the target state information is used to represent the running state of the target server, and in the case that the reference server receives the target state information, the running state of the target server is determined according to the target state information.

7. A detection apparatus of a server, characterized by comprising: comprises: a sending unit, configured to send a target state detection request to a reference server through a target proxy server at a first time, wherein the state detection message is used to acquire state information of the reference server, a target server receiving the state detection message and the reference server both belong to a target server cluster, and the target proxy server is a proxy server configured for the target server cluster; a first determining unit, configured to determine that the reference server is in an abnormal state in the case that reference state information returned by the reference server has not been received through the target proxy server at a second time, wherein the second time is later than the first time, and a time interval between the second time and the first time is greater than a target interval. The second determining unit is configured to: in a case where the target server receives the reference state information returned by the reference server through the target proxy server before the second time point, acquire state identifier information carried in the reference state information; in a case where the state identifier information matches target state identifier information, determine that the reference server is in a normal operation state; and in a case where the state identifier information does not match the target state identifier information, determine that the reference server is in an abnormal state.

8. A computer readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program, when executed by a processor, performs the method of any one of claims 1 to 6.

9. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction, when executed by a processor, implements the steps of the method of any one of claims 1 to 6.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 6 by using the computer program.

Citation Information

Patent Citations

  • Method and system for detecting health state of server cluster

    CN114168481A

  • Fault processing method, device and system for application server cluster

    CN116095082A