CN110635963B - Network state detection method and device - Google Patents

Network state detection method and device Download PDF

Info

Publication number
CN110635963B
CN110635963B CN201810664791.6A CN201810664791A CN110635963B CN 110635963 B CN110635963 B CN 110635963B CN 201810664791 A CN201810664791 A CN 201810664791A CN 110635963 B CN110635963 B CN 110635963B
Authority
CN
China
Prior art keywords
server
identification information
servers
command
network
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
CN201810664791.6A
Other languages
Chinese (zh)
Other versions
CN110635963A (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 Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201810664791.6A priority Critical patent/CN110635963B/en
Publication of CN110635963A publication Critical patent/CN110635963A/en
Application granted granted Critical
Publication of CN110635963B publication Critical patent/CN110635963B/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
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a network state detection method and device. The method comprises the following steps: the method comprises the steps that a first server issues a first command to a plurality of second servers so that the second servers receive and execute the first command, wherein the first command is used for detecting the network state among the plurality of second servers; the first server receives a command execution result sent by the second server; and the first server determines the network state among the second servers according to the command execution result. Through the method and the device, the problems of complex network communication state process and complex steps of the detection server in the related technology are solved.

Description

Network state detection method and device
Technical Field
The present application relates to the field of network detection, and in particular, to a method and an apparatus for detecting a network status.
Background
The system comprises a system main board, a system auxiliary board, a system main board, a system auxiliary board, a system auxiliary board and a system.
In the work of maintaining the network, it is very important to detect the connectivity of different servers in the network, for example, there are A, B, C three servers in the network, and it is necessary to know whether the three servers can be connected with each other, and usually, it is necessary to determine whether the current server can be connected with other servers by ping other servers (ping command is a common command for detecting whether the network is connected with other servers).
When the number of servers is large, logging in to each server to execute commands ping each server (how many servers there are, how many times ping commands need to be executed on each server) is time-consuming and troublesome. Through some tools of batch operation, the workload can be reduced, but scripts still need to be written for execution, and the scripts need to be modified every time the number of servers changes, which is very troublesome.
Aiming at the problems of complex process and complex steps of detecting the network communication state of the server in the related technology, no effective solution is provided at present.
Disclosure of Invention
The main purpose of the present application is to provide a method and an apparatus for detecting a network state, so as to solve the problems of complex process and complex steps of detecting a network connection state of a server in the related art.
In order to achieve the above object, according to an aspect of the present application, there is provided a network status detection method including: the method comprises the steps that a first server issues a first command to a plurality of second servers so that the second servers receive and execute the first command, wherein the first command is used for detecting the network state among the second servers; the first server receives a command execution result sent by the second server; and the first server determines the network state among the second servers according to the command execution result.
Further, the issuing, by the first server, the first command to the plurality of second servers includes: the first server receives identification information sent by a plurality of second servers, wherein the identification information is the identification information of the second servers, which is obtained when batch operation tools of the second servers are started; and the first server issues the first command to a second server corresponding to the received identification information.
Further, after the first server receives a plurality of identification information, the method further comprises: the first server compares the received identification information with the stored identification information of all the second servers to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server, and the target identification information is not contained in the received identification information; and determining that the second server networks corresponding to the target identification information cannot be communicated.
In order to achieve the above object, according to an aspect of the present application, there is provided a network status detection method including: the method comprises the steps that a second server receives a first command sent by a first server, wherein the first command is used for detecting the network state among a plurality of second servers; the second server executes the first command to obtain a command execution result; and the second server sends the command execution result to the first server.
Further, the second server executes the first command to obtain a command execution result, including: a sending party sends a preset data packet to a receiving party, wherein the sending party and the receiving party are different second servers, and the receiving party returns a data packet to the sending party under the condition of network communication; if the sender receives the data packet returned by the receiver, determining that the sender is in network communication with the receiver; and if the sender does not receive the data packet returned by the receiver, determining that the sender is not communicated with the receiver network.
In order to achieve the above object, according to an aspect of the present application, there is provided a network status detecting apparatus including: a first server sending unit, configured to enable a first server to issue a first command to a plurality of second servers, so that the second servers receive and execute the first command, where the first command is used to detect a network state between the plurality of second servers; a first server receiving unit configured to cause the first server to receive a result of execution of the command sent by the second server; and the first determining unit is used for enabling the first server to determine the network state among the second servers according to the command execution result.
Further, the first server transmission unit includes: a first server receiving subunit, configured to enable the first server to receive identification information sent by a plurality of second servers, where the identification information is identification information of the second servers, where the identification information is obtained when a batch operation tool of the second servers is started; and the first server sending subunit is used for enabling the first server to issue the first command to a second server corresponding to the received identification information.
Further, the apparatus further comprises: a comparing unit, configured to, after the first server receives multiple pieces of identification information, enable the first server to compare the received identification information with stored identification information of all the second servers to obtain target identification information, where the target identification information is included in the identification information stored on the first server, and the target identification information is not included in the received identification information; and the second determining unit is used for determining that the second server network corresponding to the target identification information cannot be communicated.
In order to achieve the above object, according to an aspect of the present application, there is provided a storage medium including a stored program, wherein the program performs the above network status detection method.
In order to achieve the above object, according to one aspect of the present application, there is provided a processor for executing a program, wherein the program executes to perform the above network state detection method.
In the embodiment of the invention, a batch operation tool is installed on a first server and a second server, the first server has one server, the second servers have a plurality of servers, the first server stores identification information of all the second servers, the first server issues a first command to the plurality of second servers, after receiving the first command, the second servers execute the first command to detect whether other second servers can be communicated with the second servers, the second servers which cannot be communicated with the second servers are reported to the first server, so that the first server can know which second servers are in a state of unable communication, does not need to log in each server to execute a ping command, does not need to modify a script even if the number of the servers changes, the batch operation tool can dynamically update the servers needing to be detected, and automatically executes the ping command on each server, the problems that in the prior art, the process of detecting the network communication state of the server is complex and the steps are complex are solved, and the effect of improving the efficiency of detecting the network communication state of the server is achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
fig. 1 is a flowchart illustrating an alternative method for a first server to perform network status detection according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative method for a second server to perform network status detection according to an embodiment of the present application;
FIG. 3 is a flow chart of an alternative network status detection method according to an embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative network status detection apparatus according to an embodiment of the present application;
fig. 5 is a schematic diagram of an alternative network status detection apparatus according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an embodiment of the present application, a network status detection method is provided.
Fig. 1 is a flowchart illustrating an alternative method for a first server to perform network status detection according to an embodiment of the present application. As shown in fig. 1, the method comprises the steps of:
step S102, the first server issues a first command to the plurality of second servers, so that the second servers receive and execute the first command, where the first command is used to detect a network state between the plurality of second servers.
Step S104, the first server receives the command execution result sent by the second server.
And step S106, the first server determines the network state among the second servers according to the command execution result.
The batch operation tool may be a salt, for example, a salt master is installed on a first server and a salt minus is installed on a second server.
In the embodiment of the invention, a batch operation tool is installed on a first server and a second server, the first server has one server, the second servers have a plurality of servers, the first server stores identification information of all the second servers, the first server issues a first command to the plurality of second servers, after receiving the first command, the second servers execute the first command to detect whether other second servers can be communicated with the second servers, the second servers which cannot be communicated with the second servers are reported to the first server, so that the first server can know which second servers are in a state of unable communication, does not need to log in each server to execute a ping command, does not need to modify a script even if the number of the servers changes, the batch operation tool can dynamically update the servers needing to be detected, and automatically executes the ping command on each server, the problems that in the prior art, the process of detecting the network communication state of the server is complex and the steps are complex are solved, and the effect of improving the efficiency of detecting the network communication state of the server is achieved.
For example, the server S1 is a first server, the server S2, the server S3, the server S4, and the server S5 are second servers, and the server S1 stores identification information of the server S2, the server S3, the server S4, and the server S5 (for example, the IP of the server S2, the server S3, the server S4, and the server S5). The server S1 issues a first command to the server S2, the server S3, the server S4, and the server S5, and the server S2, the server S3, the server S4, and the server S5 execute the first command after receiving the first command. Assuming that the server S2 finds that the server S3 cannot be connected and the server S4 and the server S5 can be connected through detection, the server S2 sends the command execution result to the server S1, and the server S1 knows that the server S2 and the server S3 cannot be connected after receiving the command execution result.
Optionally, the issuing, by the first server, the first command to the plurality of second servers includes: the method comprises the steps that a first server receives identification information sent by a plurality of second servers, wherein the identification information is the identification information of the second servers, which is obtained when batch operation tools of the second servers are started; and the first server issues a first command to a second server corresponding to the received identification information.
Optionally, after the first server receives the plurality of identification information, the method further comprises: the first server compares the received identification information with the stored identification information of all the second servers to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server, and the target identification information is not contained in the received identification information; and determining that the second server networks corresponding to the target identification information cannot be communicated.
The network unavailability of the second server may have two situations: the first condition is as follows: the second server is unable to communicate with the first server network; case two: the second server cannot be in network communication with other second servers.
In the embodiment of the present invention, if it is desired to determine whether a second server is in a network connection state, the method can be divided into two steps, step one: and judging whether the second server can be communicated with the first server or not. And if the first step judges that the second server can not be communicated with the first server, determining that the second server network can not be communicated. And if the second server can be communicated with the first server in the step one, executing the step two. Step two: and judging whether the second server can be communicated with other second servers. And if the second server can be communicated with other servers in the second step, determining that the second server network is in a communication state.
When the batch operation tool of the second server is started, the identification information of the second server is obtained and sent to the first server. If the network of the second server is in a normal state, namely in a connected state, the first server can receive the identification information sent by the second server; and if the network of the second server is in an abnormal state, the first server cannot receive the identification information sent by the second server.
The first server stores the identification information of all the second servers in advance. If a certain second server does not send own identification information to the first server, it can be determined that the second server network cannot be connected. If a certain second server sends the identification information of the second server to the first server, whether the second server can be in network communication with other second servers needs to be further judged.
The second server may send data packets to other second servers to detect network conditions. In order to distinguish between the second server that transmits the data packet and the second server that receives the data packet, the sender and the receiver are distinguished, respectively. The sender and the receiver are different second servers, and the receiver returns a data packet to the sender under the condition of network communication; if the sender receives the data packet returned by the receiver, the sender and the receiver are determined to be in network communication; and if the sender does not receive the data packet returned by the receiver, determining that the sender is not communicated with the receiver network.
For example, the server S1 is a first server, the servers S2, S3, S4, S5, S6, and S7 are second servers, and the server S1 stores identification information of the servers S2, S3, S4, S5, S6, and S7 (for example, the servers S2, S3, S4, S5, S6, and S7 store IP addresses). When the batch operation tool of the second server is started, the identification information of the second server is obtained and sent to the first server, for example, the IP of the second server is sent to the first server, and if the network of the second server is abnormal, the IP of the second server cannot be sent to the first server. If the network of the server S6 and the server S7 is abnormal, the server S6 and the server S7 cannot transmit their own IP to the server S1. The server S1 receives the identification information sent by the server S2, the server S3, the server S4, and the server S5, and the server S1 compares the received identification information with the stored identification information of all the second servers to obtain identification information of the server S6 and the server S7 as the target identification information, so that the first server can determine that the second server S6 and the server S7 corresponding to the target identification information, and thus, the first server S1 determines that the networks of the server S6 and the server S7 are both abnormal and unable to communicate. The server S1 issues a first command to the server S2, the server S3, the server S4, and the server S5, and the server S2, the server S3, the server S4, and the server S5 execute the first command after receiving the first command. Assuming that the server S2 finds that the server S3 cannot be connected and the server S4 and the server S5 can be connected through detection, the server S2 sends the command execution result to the server S1, and the server S1 knows that the server S2 and the server S3 cannot be connected after receiving the command execution result.
Fig. 2 is a flowchart illustrating an alternative method for detecting a network status performed by a second server according to an embodiment of the present application. As shown in fig. 2, the method comprises the steps of:
step S202, the second server receives a first command issued by the first server, where the first command is used to detect a network status between the plurality of second servers.
Step S204, the second server executes the first command to obtain a command execution result.
In step S206, the second server sends the result of the command execution to the first server.
The batch operation tool may be a salt, for example, a salt master is installed on a first server and a salt minus is installed on a second server.
In the embodiment of the invention, a batch operation tool is installed on a first server and a second server, the first server has one server, the second servers have a plurality of servers, the first server stores identification information of all the second servers, the first server issues a first command to the plurality of second servers, after receiving the first command, the second servers execute the first command to detect whether other second servers can be communicated with the second servers, the second servers which cannot be communicated with the second servers are reported to the first server, so that the first server can know which second servers are in a state of unable communication, does not need to log in each server to execute a ping command, does not need to modify a script even if the number of the servers changes, the batch operation tool can dynamically update the servers needing to be detected, and automatically executes the ping command on each server, the problems that in the prior art, the process of detecting the network communication state of the server is complex and the steps are complex are solved, and the effect of improving the efficiency of detecting the network communication state of the server is achieved.
For example, the server S1 is a first server, the server S2, the server S3, the server S4, and the server S5 are second servers, and the server S1 stores identification information of the server S2, the server S3, the server S4, and the server S5 (for example, the IP of the server S2, the server S3, the server S4, and the server S5). The server S1 issues a first command to the server S2, the server S3, the server S4, and the server S5, and the server S2, the server S3, the server S4, and the server S5 execute the first command after receiving the first command. Assuming that the server S2 finds that the server S3 cannot be connected and the server S4 and the server S5 can be connected through detection, the server S2 sends the command execution result to the server S1, and the server S1 knows that the server S2 and the server S3 cannot be connected after receiving the command execution result.
Optionally, the executing, by the second server, the first command to obtain a command execution result, where the executing includes: the sending party sends a preset data packet to the receiving party, wherein the sending party and the receiving party are different second servers, and the receiving party returns a data packet to the sending party under the condition of network communication; if the sender receives the data packet returned by the receiver, the sender and the receiver are determined to be in network communication; and if the sender does not receive the data packet returned by the receiver, determining that the sender is not communicated with the receiver network.
The network unavailability of the second server may have two situations: the first condition is as follows: the second server is unable to communicate with the first server network; case two: the second server cannot be in network communication with other second servers.
In the embodiment of the present invention, if it is desired to determine whether a second server is in a network connection state, the method can be divided into two steps, step one: and judging whether the second server can be communicated with the first server or not. And if the first step judges that the second server can not be communicated with the first server, determining that the second server network can not be communicated. And if the second server can be communicated with the first server in the step one, executing the step two. Step two: and judging whether the second server can be communicated with other second servers. And if the second server can be communicated with other servers in the second step, determining that the second server network is in a communication state.
When the batch operation tool of the second server is started, the identification information of the second server is obtained and sent to the first server. If the network of the second server is in a normal state, namely in a connected state, the first server can receive the identification information sent by the second server; and if the network of the second server is in an abnormal state, the first server cannot receive the identification information sent by the second server.
The first server stores the identification information of all the second servers in advance. If a certain second server does not send own identification information to the first server, it can be determined that the second server network cannot be connected. If a certain second server sends the identification information of the second server to the first server, whether the second server can be in network communication with other second servers needs to be further judged.
The second server may send data packets to other second servers to detect network conditions. In order to distinguish between the second server that transmits the data packet and the second server that receives the data packet, the sender and the receiver are distinguished, respectively. The sender and the receiver are different second servers, and the receiver returns a data packet to the sender under the condition of network communication; if the sender receives the data packet returned by the receiver, the sender and the receiver are determined to be in network communication; and if the sender does not receive the data packet returned by the receiver, determining that the sender is not communicated with the receiver network.
For example, the server S1 is a first server, the servers S2, S3, S4, S5, S6, and S7 are second servers, and the server S1 stores identification information of the servers S2, S3, S4, S5, S6, and S7 (for example, the servers S2, S3, S4, S5, S6, and S7 store IP addresses). When the batch operation tool of the second server is started, the identification information of the second server is obtained and sent to the first server, for example, the IP of the second server is sent to the first server, and if the network of the second server is abnormal, the IP of the second server cannot be sent to the first server. If the network of the server S6 and the server S7 is abnormal, the server S6 and the server S7 cannot transmit their own IP to the server S1. The server S1 receives the identification information sent by the server S2, the server S3, the server S4, and the server S5, and the server S1 compares the received identification information with the stored identification information of all the second servers to obtain identification information of the server S6 and the server S7 as the target identification information, so that the first server can determine that the second server S6 and the server S7 corresponding to the target identification information, and thus, the first server S1 determines that the networks of the server S6 and the server S7 are both abnormal and unable to communicate. The server S1 issues a first command to the server S2, the server S3, the server S4, and the server S5, and the server S2, the server S3, the server S4, and the server S5 execute the first command after receiving the first command. Assuming that the server S2 finds that the server S3 cannot be connected and the server S4 and the server S5 can be connected through detection, the server S2 sends the command execution result to the server S1, and the server S1 knows that the server S2 and the server S3 cannot be connected after receiving the command execution result.
According to the embodiment of the invention, the server to be detected can be dynamically changed by acquiring the IP of the server which normally runs in the saltstack administration. The acquired IP is automatically decomposed into a plurality of ping commands, the ping commands are issued to all servers for execution, output results are converted, and complexity of manual operation is avoided.
As shown in fig. 3, the present solution comprises 3 parts:
a Saltstack master (first server) acquires an IP equipped with a Saltstack minus server (second server).
The Saltstack timing can obtain the basic information (such as IP) of the current server when starting, and send the basic information to the Saltstack master, so that the Saltstack master has the basic information of all servers with Saltstack timing. The Saltstack master server will establish a network connection with each normally running Saltstack administration, and extract the IP of the server establishing the connection from the basic information.
2. And issuing an IP command acquired by ping.
The Saltstack itself is a tool for batch operations on multiple servers, which are executed on all servers equipped with Saltstack administration by breaking up the IP obtained in the previous step into multiple pings (i.e., ping different servers).
3. And converting the result and outputting the detection result.
Multiple ping commands are executed on the server, and different ping commands may output ping connection or ping disconnection according to actual network conditions. And outputting the IP which can not be passed by ping of each server, so as to obtain the number of the servers which can not be communicated by the current network.
The embodiment of the invention dynamically acquires the thought of the IP to be detected and automatically issues a plurality of ping commands by utilizing the characteristics that the saltstack master and the saltstack development normally run server establish network connection and the saltstack master stores the basic information of the server with the saltstack development.
This patent describes a method based on saltstack carries out network UNICOM and detects, through the information of the server that is equipped with saltstack minus that saltstack master server kept and saltstack minus that all has the installation on every server, the server that dynamic update needs the detection, other servers of automatic ping in batches on every server to output testing result.
The embodiment of the present application further provides a network status detection device, and it should be noted that the network status detection device according to the embodiment of the present application may be used to execute the method for detecting a network status provided in the embodiment of the present application. The network state detection device provided by the embodiment of the present application is introduced below.
Fig. 4 is a schematic diagram of an alternative network status detecting device according to an embodiment of the present application, which is disposed on a first server. As shown in fig. 4, the apparatus includes: a first server sending unit 10, a first server receiving unit 20, and a first determining unit 30.
The first server sending unit 10 is configured to enable the first server to issue a first command to the plurality of second servers, so that the second servers receive and execute the first command, where the first command is used to detect a network status between the plurality of second servers.
A first server receiving unit 20, configured to enable the first server to receive a command execution result sent by the second server.
A first determining unit 30, configured to enable the first server to determine the network status between the second servers according to the command execution result.
Optionally, the first server sending unit includes: the first server receiving sub-unit and the first server sending sub-unit. And the first server receiving subunit is configured to enable the first server to receive the identification information sent by the plurality of second servers, where the identification information is the identification information of the second servers, which is obtained when the batch operation tool of the second servers is started. And the first server sending subunit is used for enabling the first server to issue a first command to the second server corresponding to the received identification information.
Optionally, the apparatus further comprises: a comparison unit and a second determination unit. And the comparing unit is used for enabling the first server to compare the received identification information with the stored identification information of all the second servers after the first server receives the plurality of identification information to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server, and the target identification information is not contained in the received identification information. And the second determining unit is used for determining that the second server network corresponding to the target identification information cannot be communicated.
The embodiment of the present application further provides a network status detection device, and it should be noted that the network status detection device according to the embodiment of the present application may be used to execute the method for detecting a network status provided in the embodiment of the present application. The network state detection device provided by the embodiment of the present application is introduced below.
Fig. 5 is a schematic diagram of an alternative network status detecting device according to an embodiment of the present application, where the device is disposed on a second server. As shown in fig. 5, the apparatus includes: a second server receiving unit 50, a second server executing unit 60, and a second server transmitting unit 70.
The second server receiving unit 50 is configured to enable the second server to receive a first command issued by the first server, where the first command is used to detect a network status between multiple second servers.
And a second server executing unit 60, configured to enable the second server to execute the first command, and obtain a command execution result.
A second server sending unit 70, configured to enable the second server to send the command execution result to the first server.
Optionally, the second server execution unit 60 includes: the second server sends the sub-unit, the first determining sub-unit and the second determining sub-unit. And the second server sending subunit is used for enabling the sending party to send a preset data packet to the receiving party, wherein the sending party and the receiving party are different second servers, and under the condition of network communication, the receiving party returns a data packet to the sending party. And the first determining subunit is used for determining that the sender is in network communication with the receiver under the condition that the sender receives the data packet returned by the receiver. And the second determining subunit is configured to determine that the sender is not communicated with the network of the receiver if the sender does not receive the data packet returned by the receiver.
The network state detection device comprises a processor and a memory, wherein the first server sending unit 10, the first server receiving unit 20, the first determining unit 30 and the like are all stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can set one or more than one kernel, and the network state detection method is executed by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flas RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium having a program stored thereon, the program implementing a network status detection method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein a network state detection method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
issuing a first command to a plurality of second servers so that the second servers receive and execute the first command, wherein the first command is used for detecting the network state among the plurality of second servers; the first server receives a command execution result sent by the second server; and the first server determines the network state among the second servers according to the command execution result.
Receiving identification information sent by a plurality of second servers, wherein the identification information is the identification information of the second servers, which is obtained when batch operation tools of the second servers are started; and issuing a first command to a second server corresponding to the received identification information.
After receiving a plurality of identification information, comparing the received identification information with the stored identification information of all the second servers to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server and is not contained in the received identification information; and determining that the second server networks corresponding to the target identification information cannot be communicated.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
issuing a first command to a plurality of second servers so that the second servers receive and execute the first command, wherein the first command is used for detecting the network state among the plurality of second servers; the first server receives a command execution result sent by the second server; and the first server determines the network state among the second servers according to the command execution result.
Receiving identification information sent by a plurality of second servers, wherein the identification information is the identification information of the second servers, which is obtained when batch operation tools of the second servers are started; and issuing a first command to a second server corresponding to the received identification information.
After receiving a plurality of identification information, comparing the received identification information with the stored identification information of all the second servers to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server and is not contained in the received identification information; and determining that the second server networks corresponding to the target identification information cannot be communicated.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A network state detection method is characterized by comprising the following steps:
the method comprises the steps that a first server issues a first command to a plurality of second servers so that the second servers receive and execute the first command, wherein the first command is used for detecting the network state among the second servers;
the first server receives a command execution result sent by the second server;
the first server determines the network state among the second servers according to the command execution result;
the first server and the second server are both provided with batch operation tools;
the first server issues a first command to a plurality of second servers, and the first command comprises the following steps: the first server receives identification information sent by a plurality of second servers, wherein the identification information is the identification information of the second servers, which is obtained when batch operation tools of the second servers are started; the first server issues the first command to a second server corresponding to the received identification information;
the method further comprises the following steps: judging whether the second server is in a network connection state, wherein judging whether the second server is in the network connection state comprises: judging whether the second server can be communicated with the first server or not, if so, determining that the second server network cannot be communicated, if so, judging whether the second server can be communicated with other second servers or not, and if so, determining that the second server network is in a communicated state.
2. The method of claim 1, wherein after the first server receives a plurality of identification information, the method further comprises:
the first server compares the received identification information with the stored identification information of all the second servers to obtain target identification information, wherein the target identification information is contained in the identification information stored on the first server, and the target identification information is not contained in the received identification information;
and determining that the second server networks corresponding to the target identification information cannot be communicated.
3. A network state detection method is characterized by comprising the following steps:
the method comprises the steps that a second server receives a first command sent by a first server, wherein the first command is used for detecting the network state among a plurality of second servers;
the second server executes the first command to obtain a command execution result;
the second server sends the command execution result to the first server;
the first server and the second server are both provided with batch operation tools;
the second server receives a first command issued by the first server, and the method comprises the following steps: the method comprises the steps that a plurality of second servers send identification information to a first server, wherein the identification information is obtained when batch operation tools of the second servers are started; the second server corresponding to the identification information receives the first command issued by the first server;
the method further comprises the following steps: judging whether the second server is in a network connection state, wherein judging whether the second server is in the network connection state comprises: judging whether the second server can be communicated with the first server or not, if so, determining that the second server network cannot be communicated, if so, judging whether the second server can be communicated with other second servers or not, and if so, determining that the second server network is in a communicated state.
4. The method of claim 3, wherein the second server executes the first command to obtain a command execution result, comprising:
a sending party sends a preset data packet to a receiving party, wherein the sending party and the receiving party are different second servers, and the receiving party returns a data packet to the sending party under the condition of network communication;
if the sender receives the data packet returned by the receiver, determining that the sender is in network communication with the receiver;
and if the sender does not receive the data packet returned by the receiver, determining that the sender is not communicated with the receiver network.
5. A network status detection apparatus, comprising:
a first server sending unit, configured to enable a first server to issue a first command to a plurality of second servers, so that the second servers receive and execute the first command, where the first command is used to detect a network state between the plurality of second servers;
a first server receiving unit configured to cause the first server to receive a result of execution of the command sent by the second server;
a first determining unit, configured to enable the first server to determine a network state between the second servers according to the command execution result;
the first server and the second server are both provided with batch operation tools;
the first server transmission unit includes: a first server receiving subunit, configured to enable the first server to receive identification information sent by a plurality of second servers, where the identification information is identification information of the second servers, where the identification information is obtained when a batch operation tool of the second servers is started; the first server sending subunit is configured to enable the first server to issue the first command to a second server corresponding to the received identification information;
the apparatus is further configured to determine whether the second server is in a network connection state, where determining whether the second server is in the network connection state includes: judging whether the second server can be communicated with the first server or not, if so, determining that the second server network cannot be communicated, if so, judging whether the second server can be communicated with other second servers or not, and if so, determining that the second server network is in a communicated state.
6. The apparatus of claim 5, further comprising:
a comparing unit, configured to, after the first server receives multiple pieces of identification information, enable the first server to compare the received identification information with stored identification information of all the second servers to obtain target identification information, where the target identification information is included in the identification information stored on the first server, and the target identification information is not included in the received identification information;
and the second determining unit is used for determining that the second server network corresponding to the target identification information cannot be communicated.
7. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program performs the method of any one of claims 1 to 2.
8. A processor, characterized in that the processor is configured to run a program, wherein the program when running performs the method of any of claims 1 to 2.
CN201810664791.6A 2018-06-25 2018-06-25 Network state detection method and device Active CN110635963B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810664791.6A CN110635963B (en) 2018-06-25 2018-06-25 Network state detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810664791.6A CN110635963B (en) 2018-06-25 2018-06-25 Network state detection method and device

Publications (2)

Publication Number Publication Date
CN110635963A CN110635963A (en) 2019-12-31
CN110635963B true CN110635963B (en) 2021-11-05

Family

ID=68968698

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810664791.6A Active CN110635963B (en) 2018-06-25 2018-06-25 Network state detection method and device

Country Status (1)

Country Link
CN (1) CN110635963B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102437960A (en) * 2011-12-21 2012-05-02 福建星网锐捷网络有限公司 Detection processing method and system of cluster mode, and network equipment
CN104917842A (en) * 2015-06-16 2015-09-16 上海斐讯数据通信技术有限公司 System and method for processing batch tasks
CN106878109A (en) * 2017-03-13 2017-06-20 网宿科技股份有限公司 Server detection method and server system
CN107682411A (en) * 2017-09-14 2018-02-09 广州西麦科技股份有限公司 A kind of extensive SDN controllers cluster and network system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106487560A (en) * 2015-08-31 2017-03-08 北京国双科技有限公司 A kind of acquisition method of server configuration information, apparatus and system
US10476768B2 (en) * 2016-10-03 2019-11-12 Microsoft Technology Licensing, Llc Diagnostic and recovery signals for disconnected applications in hosted service environment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102437960A (en) * 2011-12-21 2012-05-02 福建星网锐捷网络有限公司 Detection processing method and system of cluster mode, and network equipment
CN104917842A (en) * 2015-06-16 2015-09-16 上海斐讯数据通信技术有限公司 System and method for processing batch tasks
CN106878109A (en) * 2017-03-13 2017-06-20 网宿科技股份有限公司 Server detection method and server system
CN107682411A (en) * 2017-09-14 2018-02-09 广州西麦科技股份有限公司 A kind of extensive SDN controllers cluster and network system

Also Published As

Publication number Publication date
CN110635963A (en) 2019-12-31

Similar Documents

Publication Publication Date Title
US10802906B2 (en) Monitoring method and apparatus of server, and storage medium
US11940965B2 (en) Data migration method and apparatus
WO2016184175A1 (en) Database processing method and apparatus
CN110798490B (en) Method and device for accessing third-party system based on data center and data center
CN111147313B (en) Message abnormity monitoring method and device, storage medium and electronic equipment
CN113518002B (en) Monitoring method, device, equipment and storage medium based on server-free platform
CN112422361A (en) Switch testing method, device and medium
US11533676B2 (en) Wireless networking method and apparatus for air-conditioning system
CN114363334B (en) Cloud system, network configuration method, device and equipment of cloud desktop virtual machine
CN108541000B (en) Method, medium and device for detecting network connection
CN112600703B (en) Network equipment remote access fault positioning method and device
CN114064780A (en) Session information processing method, system, device, storage medium and electronic equipment
CN110635963B (en) Network state detection method and device
CN112565348A (en) Intelligent equipment testing method and system, computer equipment and storage medium
CN114691445A (en) Cluster fault processing method and device, electronic equipment and readable storage medium
RU2693903C1 (en) Method, apparatus and processing system for expanded port
CN112445504A (en) Equipment firmware upgrading method, device and system
CN108234658B (en) Method and device for sensing health condition of server cluster and server
US10491421B2 (en) Ring protection network module
CN111049671A (en) System integration method and device
CN113051143A (en) Detection method, device, equipment and storage medium for service load balancing server
CN109558256B (en) Controlled terminal automatic recovery method and device
CN111967010B (en) Trusted service method, trusted service device, trusted service equipment and storage medium
CN113271235B (en) Fuzzy test method and device for network traffic, storage medium and processor
CN115243248B (en) Method and device for identifying traffic sharing type of terminal and electronic equipment

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