CN113630282B - Method and device for detecting server state - Google Patents

Method and device for detecting server state Download PDF

Info

Publication number
CN113630282B
CN113630282B CN202010376012.XA CN202010376012A CN113630282B CN 113630282 B CN113630282 B CN 113630282B CN 202010376012 A CN202010376012 A CN 202010376012A CN 113630282 B CN113630282 B CN 113630282B
Authority
CN
China
Prior art keywords
time
response
network device
information
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010376012.XA
Other languages
Chinese (zh)
Other versions
CN113630282A (en
Inventor
方健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Huawei Digital Technologies Co Ltd
Original Assignee
Beijing Huawei Digital Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Huawei Digital Technologies Co Ltd filed Critical Beijing Huawei Digital Technologies Co Ltd
Priority to CN202010376012.XA priority Critical patent/CN113630282B/en
Publication of CN113630282A publication Critical patent/CN113630282A/en
Application granted granted Critical
Publication of CN113630282B publication Critical patent/CN113630282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/16Threshold monitoring

Abstract

The application provides a method for detecting the state of a server, which comprises the following steps: the network equipment sends N authentication request messages, the N authentication request messages correspond to N response messages one by one, each authentication request message is used for indicating a server to send the response message corresponding to each authentication request message to the network equipment, and N is a positive integer greater than or equal to 2; the network equipment acquires first information and/or second information, wherein the first information comprises first time and second time, and the second information comprises the first nonresponse times and the second nonresponse times; the network device detects the state of the server according to the first information or the second information. The method for detecting the state of the server can improve the accuracy of detecting the state of the server.

Description

Method and device for detecting server state
Technical Field
The present application relates to the field of data communication access technologies, and in particular, to a method and an apparatus for detecting a server status.
Background
The user escape function can meet the requirement of the user to access network resources under the condition that the authentication server cannot work normally. The basic process of the user escape function is that when the access equipment detects that the state of the authentication server is off-line, the access equipment can grant a specific network access right to a user, so that the basic network access requirement of the user is met. Therefore, the accurate detection of the state of the authentication server is a precondition for ensuring the normal starting of the escape function of the user and also a precondition for meeting the basic network access requirement of the user.
An existing method for detecting the state of an authentication server is described by taking a remote authentication in user service (RADIUS) as an example. An access device (e.g., a Network Access Server (NAS)) determines the state of the RADIUS server by detecting whether an interruption occurs for two consecutive detection periods. And determining whether the detection period is interrupted or not by comparing the times that the NAS does not receive a response message sent by the RADIUS server in the detection period with a threshold value. When the method is adopted to detect the state of the RADIUS server, the accuracy of the detection result is not high. For example, when the threshold is set to be small, when the NAS accesses more users, it is easy to misjudge that the RADIUS server is faulty or offline. For another example, when the threshold is set to be large, in the case of a NAS accessing a small user, it is easy to miss detection that the RADIUS server is faulty or offline.
Therefore, how to effectively detect the state of the server is an urgent problem to be solved at present.
Disclosure of Invention
The application provides a method and a device for detecting a server state, so as to improve the accuracy of detecting the server state.
In a first aspect, a method for detecting a server status is provided, where the method includes:
the network equipment sends N authentication request messages, the N authentication request messages correspond to N response messages one by one, each authentication request message is used for indicating a server to send the response message corresponding to each authentication request message to the network equipment, and N is a positive integer greater than or equal to 2;
the network equipment acquires first information and/or second information, wherein the first information comprises first time and second time, and the second information comprises the number of times of first non-response and the number of times of second non-response;
the network equipment detects the state of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first non-response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second non-response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods.
Based on the scheme, the number of times of non-response of the server in a unit period and the duration of non-response of the server are comprehensively considered, and the state of the server is detected. Compared with the existing method for detecting the server, the method for detecting the server has higher accuracy in detecting the state of the server in different application scenes (for example, scenes with fewer users or more users accessed in the network equipment).
With reference to the first aspect, in certain implementations of the first aspect, the detecting, by the network device, the state of the server according to the first information or the second information includes:
under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; alternatively, the first and second electrodes may be,
and under the condition that the network equipment acquires the second information before acquiring the first information, the network equipment detects the state of the server according to the second information.
With reference to the first aspect, in some implementation manners of the first aspect, in a case that the network device acquires the first information before acquiring the second information, the detecting, by the network device, a state of the server according to the first information includes:
in the first time and the second time, when the network device does not receive Q response packets, the network device detects the state of the server according to the second time and the first time, including:
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
wherein, the Q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is more than or equal to 0 and less than or equal to N-2.
With reference to the first aspect, in some implementations of the first aspect, in a case that the network device acquires the first information before acquiring the second information, the detecting, by the network device, a state of the server according to the first information includes:
in the first time and the second time, when the network device receives Q response packets and does not receive K response packets, the detecting the state of the server according to the first time and the second time includes:
adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages;
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
the Q response messages are Q response messages in the N response messages, Q is a positive integer, Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages.
With reference to the first aspect, in some implementations of the first aspect, if the network device acquires the second information before the network device acquires the first information, the network device detects a state of the server according to the second information, including:
detecting that the server is in an off-line state under the condition that the number of times of the first non-response is greater than or equal to a first threshold value and the number of times of the second non-response is greater than or equal to the first threshold value; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value; alternatively, the first and second liquid crystal display panels may be,
and detecting that the server is in an online state under the condition that the first unresponsive times are less than the first threshold value and the second unresponsive times are greater than or equal to the first threshold value.
In a second aspect, an apparatus for detecting a server status is provided, the apparatus comprising:
a receiving and sending unit, configured to send N authentication request messages, where the N authentication request messages correspond to N response messages one to one, each authentication request message is used to instruct a server to send a response message corresponding to each authentication request message to the network device, and N is a positive integer greater than or equal to 2;
the processing unit is used for acquiring first information and/or second information, wherein the first information comprises first time and second time, and the second information comprises the first non-response times and the second non-response times;
the processing unit is further used for detecting the state of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first no response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second no response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods.
With reference to the second aspect, in some implementations of the second aspect, the processing unit is further configured to:
under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; alternatively, the first and second electrodes may be,
and under the condition that the network equipment acquires the second information before acquiring the first information, the network equipment detects the state of the server according to the second information.
With reference to the second aspect, in some implementations of the second aspect, in a case that the first information is acquired before the network device acquires the second information, the processing unit is further configured to:
in the case that the network device does not receive Q response packets within the first time and the second time, the network device detects the state of the server according to the second time and the first time, including:
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
and Q is a positive integer and is not less than 0 and not more than N-2.
With reference to the second aspect, in some implementations of the second aspect, in a case that the first information is acquired before the network device acquires the second information, the processing unit is further configured to:
in the first time and the second time, when the network device receives Q response packets and does not receive K response packets, the detecting the state of the server according to the first time and the second time includes:
adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages;
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
the Q response messages are Q response messages in the N response messages, Q is a positive integer, Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages.
With reference to the second aspect, in some implementations of the second aspect, before the network device acquires the first information, the processing unit is further configured to:
detecting that the server is in an off-line state under the condition that the number of times of the first non-response is greater than or equal to a first threshold value and the number of times of the second non-response is greater than or equal to the first threshold value; alternatively, the first and second liquid crystal display panels may be,
detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value; alternatively, the first and second liquid crystal display panels may be,
and detecting that the server is in an online state under the condition that the first unresponsive times are less than the first threshold value and the second unresponsive times are greater than or equal to the first threshold value.
In a third aspect, an apparatus is provided, and the apparatus includes a memory configured to store instructions and a processor configured to read the instructions stored in the memory, so that the apparatus performs the method in the first aspect and any possible implementation manner of the first aspect.
In a fourth aspect, a processor is provided, comprising: input circuit, output circuit and processing circuit. The processing circuit is configured to receive signals via the input circuit and transmit signals via the output circuit, such that any of the first aspects and the method of any one of the possible implementations of the first aspects are implemented.
In a specific implementation process, the processor may be a chip, the input circuit may be an input pin, the output circuit may be an output pin, and the processing circuit may be a transistor, a gate circuit, a flip-flop, various logic circuits, and the like. The input signal received by the input circuit may be received and input by, for example, but not limited to, a receiver, the signal output by the output circuit may be, for example, but not limited to, output to and transmitted by a transmitter, and the input circuit and the output circuit may be the same circuit that functions as the input circuit and the output circuit, respectively, at different times. The embodiment of the present application does not limit the specific implementation manner of the processor and various circuits.
In a fifth aspect, a processing apparatus is provided that includes a processor and a memory. The processor is configured to read instructions stored in the memory and to receive signals via the receiver and transmit signals via the transmitter to perform the method of the first aspect as well as any one of the possible implementations of the first aspect.
Optionally, the number of the processors is one or more, and the number of the memories is one or more.
Alternatively, the memory may be integral to the processor or provided separately from the processor.
In a specific implementation process, the memory may be a non-transient memory, such as a Read Only Memory (ROM), which may be integrated on the same chip as the processor, or may be separately disposed on different chips.
It will be appreciated that the associated data interaction process, for example, sending the indication information, may be a process of outputting the indication information from the processor, and receiving the capability information may be a process of receiving the input capability information from the processor. In particular, the data output by the processor may be output to a transmitter and the input data received by the processor may be from a receiver. The transmitter and receiver may be collectively referred to as a transceiver, among others.
A sixth aspect provides a computer-readable storage medium for storing a computer program comprising instructions for performing the method of the first aspect above and any possible implementation manner of the first aspect above.
In a seventh aspect, a computer program product is provided that comprises instructions, which when run on a computer, cause the computer to perform the method of the first aspect and any possible implementation manner of the first aspect.
In an eighth aspect, a chip is provided that includes at least one processor and an interface; the at least one processor is configured to invoke and run a computer program, so that the chip executes the method in the first aspect and any possible implementation manner of the first aspect.
In a ninth aspect, there is provided a system comprising the network device of the first aspect.
Drawings
Fig. 1 is a schematic flow chart of a method 100 for detecting a server status provided by an embodiment of the present application.
Fig. 2 is an embodiment of a situation that a network device receives a response packet in a first time and a second time according to the embodiment of the present application.
Fig. 3 is a schematic flow chart of a method 300 for detecting a server status according to an embodiment of the present application.
Fig. 4 is a schematic flow chart of a method 400 for detecting a server status according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of an apparatus 500 for detecting a server status according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an apparatus 600 for detecting a server status according to an embodiment of the present application.
Detailed Description
The technical solution in the present application will be described below with reference to the accompanying drawings.
This application is intended to present various aspects, embodiments or features around a system comprising a number of devices, components, modules, and the like. It is to be understood and appreciated that the various systems may include additional devices, components, modules, etc. and/or may not include all of the devices, components, modules etc. discussed in connection with the figures. Furthermore, a combination of these schemes may also be used.
Fig. 1 shows a schematic flowchart of a method 100 for detecting a server status according to an embodiment of the present application.
As shown in fig. 1, the method 100 for detecting the server status includes steps 110 to 130, which are described in detail below.
In step 110, the network device sends N authentication request messages.
The N authentication request messages correspond to the N response messages one by one, each authentication request message is used for indicating the server to send the response message corresponding to each authentication request message to the network equipment, and N is a positive integer greater than or equal to 2. That is, one authentication request message corresponds to one response message, and the server may send the response message corresponding to the authentication request message to the network device according to the received authentication request message.
Specifically, the network device sends N authentication request messages, where an ith authentication request message corresponds to an ith response message, i is a positive integer, and i is greater than or equal to 1 and less than or equal to N. And the server sends an ith response message to the network equipment according to the received ith authentication request message.
Illustratively, the network device sends 2 authentication request messages, which are an authentication request message a and an authentication request message B. The authentication request message a corresponds to the response message a, and the authentication request message B corresponds to the response message B. The server sends a response message A to the network equipment according to the received authentication request message A, and the server sends a response message B to the network equipment according to the received authentication request message B.
In the embodiment of the present application, the number of the N authentication request messages sent by the network device is not specifically limited. For example, the network device sends 2 authentication request messages. As another example, the network device sends 5 authentication request messages. For another example, the network device sends 8 authentication request messages.
It should be understood that the sending time of the N authentication request messages sent by the network device may be different.
Illustratively, the network device sends 3 authentication request messages, which are an authentication request message a, an authentication request message B, and an authentication request message C. The network device transmits an authentication request message a at time #1, an authentication request message B at time #2, and an authentication request message C at time #3, and the time #1, the time #2, and the time #3 are different.
Step 120, the network device obtains the first information and/or the second information,
in an embodiment of the present application, the first information includes a first time and a second time.
The first time is the time when the network device does not receive the first response message, the first response message is one of the N response messages which is not received by the network device for the first time, the second time is the time when the network device does not receive the second response message, and the second response message is one of the N response messages which is not received by the network device for the last time.
Specifically, the first response message is a response message in N response messages that the network device has not received for the first time, and it can be understood that j is a positive integer, and j is greater than or equal to 1 and less than or equal to N.
For example, suppose that the network device sequentially sends a total of 3 authentication request messages, which are an authentication request message a, an authentication request message B, and an authentication request message C. The response message a corresponds to the authentication request message a, the response message B corresponds to the authentication request message B, and the response message C corresponds to the authentication request message C. And the response message which is not received by the network equipment for the first time is a response message A. In this case, the response message a is the first response message.
Specifically, the second response message is a response message in the N response messages that have not been received by the network device for the last time, which may be understood as that the network device has not received the kth response message in the N response messages, k is a positive integer, and k is greater than or equal to 1 and less than or equal to N. For example, suppose that the network device sequentially sends 3 authentication request messages, which are an authentication request message a, an authentication request message B, and an authentication request message C. The response message a corresponds to the authentication request message a, the response message B corresponds to the authentication request message B, and the response message C corresponds to the authentication request message C. And the response message which is not received by the network equipment for the last time is the response message B. In this case, the response message B is the second response message.
In the embodiment of the present application, a manner in which the network device determines that the response packet is not received is not specifically limited.
In some embodiments, when the network device receives a response packet corresponding to the authentication request packet within a predefined time, it may be determined that the network device receives the response packet; when the network device does not receive the response packet corresponding to the authentication request packet within the predefined time, it may be determined that the network device does not receive the response packet.
For example, assuming that the predefined time is 1 minute, the network device sends the authentication request message a at 10.
For example, assuming that the predefined time is 1 minute, the network device sends the authentication request message a at 10.
For convenience of understanding, the first time and the second time are described by taking as an example whether the response message is received within the predefined time and determining whether the network device receives the response message.
In some embodiments, when the network device does not receive a response packet corresponding to the authentication request packet within a predefined time, it may be determined that the network device does not receive the response packet. In this case, the time when the network device does not receive the response message is the time when the network device sends the authentication request message plus the predefined time.
Specifically, the predefined time is T, and the time for the network device to send the authentication request packet a is T. In this case, it may be determined that the time corresponding to the network device not receiving the response packet a is T + T. The response message a corresponds to the authentication request message a.
Illustratively, the network device sequentially sends 2 authentication request messages, specifically, the network device sends an authentication request message a at 10. The authentication request message A corresponds to the response message A, the authentication request message B corresponds to the response message B, and the predefined time is 1 minute. The network device does not receive the response message a at 10. In this case, the first time may be determined to be 10, and the second time may be determined to be 10.
Illustratively, the network device sequentially sends 3 authentication request messages, specifically, the network device sends an authentication request message a at 10. The authentication request message A corresponds to the response message A, the authentication request message B corresponds to the response message B, the authentication request message C corresponds to the response message C, and the predefined time is 1 minute. The network device does not receive the response message a at 10. In this case, the first time may be determined to be 10, and the second time may be determined to be 10.
In the implementation of the present application, the second information includes the number of times of the first non-response and the number of times of the second non-response.
The first non-response times are times of response messages which are not received by the network equipment in a first period, the second non-response times are times of response messages which are not received by the network equipment in a second period, and the first period and the second period are two continuous periods.
Specifically, the number of times of the first non-response is the number of times that the network device does not receive L response messages in the first period, the L response messages are L response messages in the N response messages, L is an integer and is not less than 0 and not more than N, the number of times of the second non-response is the number of times that the network device does not receive P response messages in the second period, the P response messages are P response messages in the N response messages, P is an integer and is not less than 0 and not more than N-L, and the first period and the second period are two consecutive periods.
For example, it is assumed that the period a and the period B are two consecutive periods, and the network device sends 3 authentication request messages, which are an authentication request message a, an authentication request message B, and an authentication request message C, respectively. The authentication request message A corresponds to the response message A, the authentication request message B corresponds to the response message B, and the authentication request message C corresponds to the response message C. The network device does not receive the response message a in the period a, and does not receive the response message B in the period B. In this case, the number of first non-responses is 1, and the number of second non-responses is 1.
For example, it is assumed that the period a and the period B are two consecutive periods, and the network device sends 3 authentication request messages, which are an authentication request message a, an authentication request message B, and an authentication request message C, respectively. The authentication request message A corresponds to the response message A, the authentication request message B corresponds to the response message B, and the authentication request message C corresponds to the response message C. The network device does not receive the response message a in the period a, and does not receive the response message B and the response message C in the period B. In this case, the number of first non-responses is 1, and the number of second non-responses is 3.
In the embodiment of the present application, the period lengths of the first period and the second period are not particularly limited.
As one implementation, the length of the period may be a predefined length. For example, the period length of the first period is 1, 2, 3, \8230:, N minutes, N is a positive integer of 1 or more.
As another implementation, the length of the period is set according to an application scenario. For example, the cycle length in a scenario where the network device accesses more users may be smaller than the cycle length in a scenario where the network device accesses less users.
Step 130, the network device detects the state of the server according to the first information or the second information.
In this embodiment, the detecting, by the network device, the state of the server according to the first information or the second information includes:
under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; alternatively, the first and second liquid crystal display panels may be,
and under the condition that the network equipment acquires the second information before acquiring the first information, the network equipment detects the state of the server according to the second information.
That is, the network device may detect the state of the server based on the information acquired first.
It should be noted that after the network device acquires the first information, the network device does not continue to acquire the second information.
Illustratively, when the network device first acquires the first information at time T1, the network device detects the state of the server according to the first information. And after the time T1, the network equipment does not acquire the second information any more and clears the content of the previously acquired part of the second information.
Illustratively, when the network device first acquires the second information at time T1, the network device detects the state of the server according to the second information. And after the time T1, the network equipment does not acquire the first information any more and clears the content of the first information of the previously acquired part.
In some embodiments, in a case where the network device acquires the first information before acquiring the second information, the network device detects a state of the server according to the first information, including:
in the first time and the second time, under the condition that the network device does not receive Q response messages, the network device detects the state of the server according to the second time and the first time, including:
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to the preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than the preset time;
q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is more than or equal to 0 and less than or equal to N-2.
That is, in the first time and the second time, the state of the server may be detected by using the method described above when the network device does not receive one or more response packets.
In the embodiment of the application, the network device does not receive Q response messages in the first time and the second time, which can be understood as that, in the first time and the second time, the server sends Q response messages to the network device, and the network device does not receive the Q response messages, Q is a positive integer, and Q is greater than or equal to 0 and less than or equal to N-2. In the embodiment of the present application, the size of the preset time is not particularly limited. For example, the preset time may be set empirically, such as the preset time may be 8, 10, 11, 13, 15, 20 seconds, etc.
In other embodiments, in a case where the network device acquires the first information before acquiring the second information, the detecting, by the network device, the state of the server according to the first information includes:
in the first time and the second time, the network device receives Q response messages, and detects the state of the server according to the first time and the second time under the condition that K response messages are not received, including:
adjusting the third time to the first time, wherein the third time is the time corresponding to the time when the network equipment does not receive one response message in the K response messages for the first time after receiving the Q response messages;
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to the preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than the preset time;
the network equipment receives the Q response messages, wherein the Q response messages are Q response messages in the N response messages, Q is a positive integer, Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message which is not received after the network equipment receives the Q response messages.
In this embodiment of the present application, the third time is a time corresponding to a time when the network device does not receive one response packet of the K response packets for the first time after receiving the Q response packets.
For example, during the first time and the second time, the network device receives a response message a first, and does not receive a response message B thereafter. In this case, the time corresponding to the non-reception of the response message B is the third time.
For example, in the first time and the second time, the network device receives a response packet a first, and then does not receive a response packet B and a response packet C, respectively. In this case, the time corresponding to the non-reception of the response message B is recorded as the third time.
For example, the network device does not receive the response message a, then receives the response message B, and then does not receive the response message C during the first time and the second time. In this case, the time corresponding to the non-reception of the response message C is the third time.
In this embodiment of the present application, at least one response packet in the K response packets is a response packet that is not received after the network device receives Q response packets.
Illustratively, Q =3, k =2 during the first time and the second time. That is, the network device receives 3 response messages in the first time and the second time, and the response messages are respectively marked as a response message a, a response message B and a response message C; the network device does not receive 2 response messages, and the response messages are respectively marked as a response message D and a response message E. In this case, the response packet D and/or the response packet E may be a response packet that is not received after the network device receives 3 response packets.
In some embodiments, in a case that the network device acquires the second information before the network device acquires the first information, the detecting, by the network device, the state of the server according to the second information includes:
detecting that the server is in an off-line state under the condition that the number of times of the first no response is greater than or equal to a first threshold value and the number of times of the second no response is greater than or equal to the first threshold value; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to a first threshold value and the number of times of the second no response is less than the first threshold value; alternatively, the first and second liquid crystal display panels may be,
and detecting that the server is in an online state under the condition that the number of times of the first no response is less than a first threshold value and the number of times of the second no response is greater than or equal to the first threshold value.
Illustratively, the first threshold is set to 5, the number of times of acquiring the first non-response is 6, and the number of times of acquiring the second non-response is 6. In this case, it may be detected that the server is in an offline state.
Illustratively, the first threshold is set to 5, the number of times of acquiring the first non-response is set to 3, and the number of times of acquiring the second non-response is set to 6. In this case, it may be detected that the server is online.
In the embodiment of the present application, the first threshold may be set according to experience or application scenarios. For example, the first threshold is 3, 4, 5, 6, 7, \ 8230 \ 8230;, N, etc., with N being a positive integer.
The method for detecting the server comprehensively considers the number of times of non-response of the server in a unit period and the duration of the non-response of the server, and detects the state of the server. Compared with the existing method for detecting the server, the method for detecting the server has higher accuracy in detecting the state of the server in different application scenes (for example, scenes that fewer users or more users are accessed in network equipment).
Fig. 2 illustrates an embodiment of a case where a network device receives a response packet in a first time and a second time according to the embodiment of the present application. It should be understood that fig. 2 is illustrative only and does not limit the present application in any way. For example, the network device may receive more response messages or may not receive more response messages during the first time and the second time.
As shown in fig. 2, "X" indicates that the network device does not receive a response message, "a" indicates that the network device receives a response message. The network device does not receive the response message a at the time t1, does not receive the response message B at the time t3, receives the response message C at the time t4, does not receive the response message D at the time t5, and does not receive the response message E at the time t2. Wherein t1< t3< t4< t5< t2.
Next, a method for detecting a server status according to an embodiment of the present application is described with reference to fig. 2 and fig. 3.
Fig. 3 shows a schematic flow chart of a method 300 for detecting a server status according to an embodiment of the present application.
As shown in fig. 3, the method 300 for detecting the server status includes steps 310 to 330, which are described in detail below.
For ease of understanding, the method 200 for detecting the server is described in the embodiment of the present application by taking N as 5, q as 1, and k as 2 as an example.
In step 310, the network device sends N authentication request messages.
Wherein, N is 5, and the 5 authentication request messages are an authentication request message a, an authentication request message B, an authentication request message C, an authentication request message D, and an authentication request message E, respectively. The response message a corresponds to the authentication request message a, the response message B corresponds to the authentication request message B, the response message C corresponds to the authentication request message C, the response message D corresponds to the authentication request message D, and the response message E corresponds to the authentication request message E. Specifically, referring to fig. 2, the network device does not receive the response packet a at time t1, does not receive the response packet B at time t3, receives the response packet C at time t4, does not receive the response packet D at time t5, and does not receive the response packet E at time t2. Wherein t1< t3< t4< t5< t2.
In step 320, the network device obtains the first information.
Wherein the first information comprises a first time and a second time.
The method for obtaining the first time and the second time is the same as the method in step 120 and step 130, and for brevity, detailed description is omitted here.
According to the method of step 120, the network device first determines t1 as a first time and t2 as a second time. As can be seen from the method of step 130, the first time needs to be updated in the embodiment of the present application. Specifically, the third time is adjusted to the first time. As can be seen from fig. 2, the third time is t5. Therefore, t5 in fig. 2 is a first time, and t2 is a second time.
In step 330, the network device detects the state of the server according to the first information.
In this embodiment, the method for the network device to detect the state of the server according to the first information is the same as the method in step 130, and details are not described herein for brevity.
According to the first time t5 and the second time t2 determined in step 320, detecting the state of the server includes:
when the difference between t5 and t2 is greater than or equal to the preset time, detecting that the server is in an off-line state; alternatively, the first and second liquid crystal display panels may be,
and when the difference between t5 and t2 is less than the preset time, detecting that the server is in an online state.
According to the method for detecting the server, the state of the server can be detected according to the duration of the non-response of the server.
Fig. 4 shows a schematic flow chart of a method 400 of detecting server status provided by the present application.
As shown in fig. 4, the method 400 for detecting the server status includes steps 410 to 440, which will be described in detail below.
In step 410, the network device sends N authentication request messages.
The method of step 410 is the same as that of step 110, and for brevity, will not be described in detail here.
In step 420, the network device obtains the first information and the second information.
The first information comprises a first time and a second time, and the second information comprises the first unresponsive times and the second unresponsive times. The method for acquiring the first information and the second information in step 410 is the same as the method for acquiring the first information and the second information in step 120 and step 130, and for brevity, detailed description is omitted here.
In step 430, whether the network device acquires the first information before acquiring the second information is determined.
In this embodiment of the present application, whether the network device acquires the first information before acquiring the second information includes:
when the first information is acquired before the network device acquires the second information, after step 430, step 440 is executed; alternatively, the first and second electrodes may be,
if the first information is not acquired before the network device acquires the second information, step 450 is executed after step 430.
Before the network device acquires the second information, the first information is not acquired. That is, the network device acquires the second information first. In other words, the second information is acquired before the network device acquires the first information.
Step 440, the network device detects the state of the server according to the first information.
The method of step 440 is the same as that of step 130, and therefore, for brevity, the detailed description thereof is omitted here.
Step 450, the network device detects the state of the server according to the second information.
The method of step 450 is the same as that of step 130, and therefore, for brevity, will not be described in detail here.
The method for detecting the server comprehensively considers the number of times of non-response of the server in a unit period and the duration of the non-response of the server, and detects the state of the server. Compared with the existing method for detecting the server, the method for detecting the server has higher accuracy in detecting the state of the server in different application scenes (for example, scenes with fewer users or more users accessed in the network equipment).
The method for detecting the server status provided by the present application is described in detail above with reference to fig. 2 to 4. It should be understood that the methods of fig. 2-4 are illustrative only and are not limiting upon the present application. For example, the network device may also acquire only the first information, and detect the state of the server according to the first information.
The apparatus for detecting a server status and the device for detecting a server status provided by the present application are described in detail below with reference to fig. 5 and 6.
Fig. 5 shows a schematic structural diagram of an apparatus 500 for detecting a server status according to an embodiment of the present application.
The apparatus 500 for detecting the server status includes: a transceiver unit 510 and a processing unit 520. The transceiver unit 510 and the processing unit 520 communicate with each other via an internal connection path to transmit control and/or data signals.
A transceiving unit 510, configured to send N authentication request messages, where the N authentication request messages correspond to N response messages one to one, and each authentication request message is used to instruct a server to send a response message corresponding to each authentication request message to the network device, where N is a positive integer greater than or equal to 2;
a processing unit 520, configured to obtain first information and/or second information, where the first information includes a first time and a second time, and the second information includes a first non-response number and a second non-response number;
the processing unit 520 is further configured to detect a status of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first non-response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second non-response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods.
Optionally, in some implementations, the processing unit 520 is further configured to:
under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; alternatively, the first and second electrodes may be,
and under the condition that the network equipment acquires the second information before acquiring the first information, the network equipment detects the state of the server according to the second information.
Optionally, in some implementations, in the case that the first information is acquired before the network device acquires the second information, the processing unit 520 is further configured to:
in the first time and the second time, when the network device does not receive Q response packets, the network device detects the state of the server according to the second time and the first time, including:
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
and Q is a positive integer and is not less than 0 and not more than N-2.
Optionally, in some implementations, in the case that the first information is acquired before the network device acquires the second information, the processing unit 520 is further configured to:
in the first time and the second time, when the network device receives Q response packets and does not receive K response packets, the detecting the state of the server according to the first time and the second time includes:
adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages;
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
the Q response messages are Q response messages in the N response messages, Q is a positive integer, Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages.
Optionally, in some implementations, before the network device acquires the first information, the processing unit 520 is further configured to:
detecting that the server is in an off-line state under the condition that the number of times of the first non-response is greater than or equal to a first threshold value and the number of times of the second non-response is greater than or equal to the first threshold value; alternatively, the first and second liquid crystal display panels may be,
detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value; alternatively, the first and second electrodes may be,
and detecting that the server is in an online state under the condition that the number of times of the first no response is less than the first threshold value and the number of times of the second no response is greater than or equal to the first threshold value.
Fig. 6 shows a schematic structural diagram of an apparatus 600 for detecting a server status according to an embodiment of the present application.
The apparatus 600 for detecting a server state includes: a transceiver 610, a processor 620, and a memory 630. Wherein, the transceiver 610, the processor 620 and the memory 630 communicate with each other via the interconnection path to transmit control and/or data signals, the memory 630 is used for storing a computer program, and the processor 610 is used for calling and running the computer program from the memory 630 to control the transceiver 620 to transmit and receive signals.
A transceiver 610, configured to send N authentication request messages, where the N authentication request messages correspond to N response messages one to one, each authentication request message is used to instruct a server to send a response message corresponding to each authentication request message to the network device, and N is a positive integer greater than or equal to 2;
a processor 620, configured to obtain first information and/or second information, where the first information includes a first time and a second time, and the second information includes a first number of times of no response and a second number of times of no response;
the processor 620 is further configured to detect a status of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first no response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second no response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods.
Optionally, in some implementations, the processor 620 is further configured to:
under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; alternatively, the first and second electrodes may be,
and under the condition that the network equipment acquires the second information before acquiring the first information, the network equipment detects the state of the server according to the second information.
Optionally, in some implementations, in the case that the first information is acquired before the network device acquires the second information, the processor 620 is further configured to:
in the first time and the second time, when the network device does not receive Q response packets, the network device detects the state of the server according to the second time and the first time, including:
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
and Q is a positive integer and is not less than 0 and not more than N-2.
Optionally, in some implementations, in the case that the first information is acquired before the network device acquires the second information, the processor 620 is further configured to:
in the first time and the second time, the detecting, by the network device, the state of the server according to the first time and the second time when Q response packets are received and K response packets are not received includes:
adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages;
detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; alternatively, the first and second electrodes may be,
detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time;
the Q response messages are Q response messages in the N response messages, Q is a positive integer, Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages.
Optionally, in some implementations, before the network device acquires the first information, the processor 620 is further configured to:
detecting that the server is in an off-line state under the condition that the number of times of the first non-response is greater than or equal to a first threshold value and the number of times of the second non-response is greater than or equal to the first threshold value; alternatively, the first and second liquid crystal display panels may be,
detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value; alternatively, the first and second liquid crystal display panels may be,
and detecting that the server is in an online state under the condition that the number of times of the first no response is less than the first threshold value and the number of times of the second no response is greater than or equal to the first threshold value.
It should be understood that the processor in the embodiments of the present application may be a Central Processing Unit (CPU), and the processor may also be other general-purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will also be appreciated that the memory in the embodiments of the subject application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The non-volatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. Volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of example, and not limitation, many forms of Random Access Memory (RAM) are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), and direct bus RAM (DR RAM).
The above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer instructions or the computer program are loaded or executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, data center, etc., that contains one or more collections of available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. The semiconductor medium may be a solid state disk.
It should be understood that the term "and/or" herein is merely one type of association relationship that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists singly, A and B exist simultaneously, and B exists singly, wherein A and B can be singular or plural. In addition, the "/" in this document generally indicates that the former and latter associated objects are in an "or" relationship, but may also indicate an "and/or" relationship, and may be understood with particular reference to the former and latter contexts.
In the present application, "at least one" means one or more, "a plurality" means two or more. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not imply any order of execution, and the order of execution of the processes should be determined by their functions and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one type of logical functional division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solutions of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (5)

1. A method for detecting a state of a server, the method comprising:
the network equipment sends N authentication request messages, the N authentication request messages correspond to N response messages one by one, each authentication request message is used for indicating a server to send the response message corresponding to each authentication request message to the network equipment, and N is a positive integer greater than or equal to 2;
the network equipment acquires first information and/or second information, wherein the first information comprises first time and second time, and the second information comprises the times of first non-response and the times of second non-response;
the network equipment detects the state of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first no response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second no response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods;
the network device detects the state of the server according to the first information or the second information, and the method comprises the following steps: under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; or, the network device detects the state of the server according to the second information when the network device acquires the second information before acquiring the first information;
the detecting, by the network device, the state of the server according to the first information under the condition that the first information is acquired before the network device acquires the second information includes: in the first time and the second time, when the network device does not receive Q response packets, the network device detects the state of the server according to the second time and the first time, including: detecting that the server is in an off-line state when the difference between the second time and the first time is greater than or equal to a preset time; or detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time; q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is more than or equal to 0 and less than or equal to N-2;
or, in the case that the network device acquires the first information before acquiring the second information, the detecting, by the network device, the state of the server according to the first information includes: in the first time and the second time, when the network device receives Q response packets and does not receive K response packets, the detecting the state of the server according to the first time and the second time includes: adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages; detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; or detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time; wherein the Q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages;
the detecting, by the network device, the state of the server according to the second information under the condition that the network device acquires the second information before the network device acquires the first information includes: detecting that the server is in an offline state under the condition that the number of times of the first no response is greater than or equal to a first threshold value and the number of times of the second no response is greater than or equal to the first threshold value; or, under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value, detecting that the server is in an online state; or, detecting that the server is in an online state when the number of the first no-response times is less than the first threshold and the number of the second no-response times is greater than or equal to the first threshold.
2. An apparatus for detecting a state of a server, the apparatus comprising:
a receiving and sending unit, configured to send N authentication request messages, where the N authentication request messages correspond to N response messages one to one, each authentication request message is used to instruct a server to send a response message corresponding to each authentication request message to a network device, and N is a positive integer greater than or equal to 2;
the processing unit is used for acquiring first information and/or second information, wherein the first information comprises first time and second time, and the second information comprises the number of times of first non-response and the number of times of second non-response;
the processing unit is further configured to detect a state of the server according to the first information or the second information;
the first time is a time corresponding to that the network device does not receive a first response message, the first response message is a response message in the N response messages that the network device does not receive for the first time, the second time is a time corresponding to that the network device does not receive a second response message, the second response message is a response message in the N response messages that the network device does not receive for the last time, the number of times of the first no response is the number of times of the response message that the network device does not receive in a first period, the number of times of the second no response is the number of times of the response message that the network device does not receive in a second period, and the first period and the second period are two consecutive periods;
the processing unit is further to: under the condition that the network equipment acquires the first information before acquiring the second information, the network equipment detects the state of the server according to the first information; or, the network device detects the state of the server according to the second information when the network device acquires the second information before acquiring the first information;
the processing unit is further configured to, in a case where the first information is acquired before the network device acquires the second information: in the first time and the second time, when the network device does not receive Q response packets, the network device detects the state of the server according to the second time and the first time, including: detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; or detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time; q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is more than or equal to 0 and less than or equal to N-2;
or, in a case that the first information is acquired before the network device acquires the second information, the processing unit is further configured to: in the first time and the second time, when the network device receives Q response packets and does not receive K response packets, the detecting the state of the server according to the first time and the second time includes: adjusting a third time to the first time, where the third time is a time corresponding to a time when the network device does not receive one of the K response messages for the first time after receiving the Q response messages; detecting that the server is in an off-line state under the condition that the difference between the second time and the first time is greater than or equal to preset time; or detecting that the server is in an online state under the condition that the difference between the second time and the first time is less than preset time; wherein the Q response messages are Q response messages in the N response messages, Q is a positive integer, and Q is not less than 1 and not more than N-2-K, the K response messages are K response messages in the N response messages, and at least one response message in the K response messages is a response message that is not received after the network device receives the Q response messages;
the processing unit is further configured to, when the network device acquires the second information before the network device acquires the first information, further: detecting that the server is in an offline state under the condition that the number of times of the first no response is greater than or equal to a first threshold value and the number of times of the second no response is greater than or equal to the first threshold value; or, detecting that the server is in an online state under the condition that the number of times of the first no response is greater than or equal to the first threshold value and the number of times of the second no response is less than the first threshold value; or, detecting that the server is in an online state when the number of the first no-response times is less than the first threshold and the number of the second no-response times is greater than or equal to the first threshold.
3. An apparatus to detect a server state comprising a processor and a memory, the memory to store instructions, the processor to read the instructions stored in the memory to perform the method of claim 1.
4. A computer-readable storage medium comprising a computer program which, when run on a computer, causes the computer to perform the method of claim 1.
5. A chip comprising at least one processor and an interface;
the at least one processor configured to invoke and execute a computer program to cause the chip to perform the method of claim 1.
CN202010376012.XA 2020-05-07 2020-05-07 Method and device for detecting server state Active CN113630282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010376012.XA CN113630282B (en) 2020-05-07 2020-05-07 Method and device for detecting server state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010376012.XA CN113630282B (en) 2020-05-07 2020-05-07 Method and device for detecting server state

Publications (2)

Publication Number Publication Date
CN113630282A CN113630282A (en) 2021-11-09
CN113630282B true CN113630282B (en) 2022-12-27

Family

ID=78376713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010376012.XA Active CN113630282B (en) 2020-05-07 2020-05-07 Method and device for detecting server state

Country Status (1)

Country Link
CN (1) CN113630282B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109196916A (en) * 2016-12-30 2019-01-11 华为技术有限公司 A kind of method, apparatus and system obtaining authentication information

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102624570B (en) * 2012-04-27 2015-04-15 杭州东信北邮信息技术有限公司 Monitoring system and method for detecting availability of web server
CN105939201A (en) * 2015-07-13 2016-09-14 杭州迪普科技有限公司 Method and device for checking state of server
CN105517195A (en) * 2015-11-27 2016-04-20 上海华为技术有限公司 State detection method and wireless network node
CN108566312A (en) * 2017-12-29 2018-09-21 美的集团股份有限公司 Off-line checking method, device and computer readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109196916A (en) * 2016-12-30 2019-01-11 华为技术有限公司 A kind of method, apparatus and system obtaining authentication information

Also Published As

Publication number Publication date
CN113630282A (en) 2021-11-09

Similar Documents

Publication Publication Date Title
CN107040494B (en) User account abnormity prevention method and system
EP4053711A1 (en) Consensus method for blockchain, and consensus node, electronic device and storage medium
US11838881B2 (en) Method and device for transmitting synchronization signal block based on added time window, and storage medium
US11275814B2 (en) Recording ledger data on a blockchain
CN108400904A (en) A kind of health examination method and device based on micro services framework
CN108513361B (en) Channel access method, device and storage medium
CN110247986A (en) A kind of document transmission method, device and electronic equipment
CN110489983B (en) Chip access method and device, chip and terminal
CN109145651B (en) Data processing method and device
CN108366098B (en) Data interaction method and device for network nodes
CN110958161B (en) Block chain link point monitoring method and device and storage medium
CN109600254B (en) Method for generating full-link log and related system
CN108400885A (en) A kind of service availability detection method, device and electronic equipment
CN113630282B (en) Method and device for detecting server state
WO2019119269A1 (en) Network fault detection method and control center device
US11606282B2 (en) Method and device for detecting network reliability
CN112235630B (en) Data backup transmission method, LED mesh loop backup system and electronic equipment
US11405406B2 (en) Fraudulent transmission data detection device, fraudulent transmission data detection method, and storage medium
CN107977418A (en) A kind of screenshot picture management method, screenshot picture managing device and mobile terminal
US7788546B2 (en) Method and system for identifying communication errors resulting from reset skew
CN110909032A (en) Method and device for managing data in block chain
CN110347632B (en) Communication method and device
KR102016029B1 (en) Apparatus and method for distributing load of vehicle communication
US20210165722A1 (en) Apparatus and method for transmitting fuzzing data for one-way protocol software fuzzing
CN106993300B (en) Access control method and system for terminal hotspot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant