CN112887173B - Storage network detection method, device, equipment and readable storage medium - Google Patents
Storage network detection method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN112887173B CN112887173B CN202110189145.0A CN202110189145A CN112887173B CN 112887173 B CN112887173 B CN 112887173B CN 202110189145 A CN202110189145 A CN 202110189145A CN 112887173 B CN112887173 B CN 112887173B
- Authority
- CN
- China
- Prior art keywords
- detected
- icmp
- file descriptor
- ips
- message
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/12—Network monitoring probes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Cardiology (AREA)
- General Health & Medical Sciences (AREA)
- Environmental & Geological Engineering (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a storage network detection method, which comprises the following steps: acquiring an IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2; creating ICMP messages corresponding to each IP to be detected; an ICMP message is sent to a target host corresponding to each IP to be detected in a parallel mode, and the occupation condition of the IP to be detected is determined according to the return message of the ICMP message; according to the invention, based on the ICMP protocol, the ICMP message is sent to the multipath target hosts in a parallel mode, the reachability of the multiple target hosts, namely the occupation condition of multiple IPs to be detected, is determined, so that the multi-device storage management software can detect unoccupied IP addresses in the management network rapidly and conveniently, and the availability and usability of the multi-device storage management software are improved. In addition, the invention also discloses a storage network detection device, equipment and a computer readable storage medium, which have the same beneficial effects.
Description
Technical Field
The present invention relates to the field of storage technologies, and in particular, to a storage network detection method, apparatus, device, and computer readable storage medium.
Background
ICMP (Internet Control Message Protocol) is an Internet control message protocol, a connectionless-oriented protocol, a sub-protocol of the TCP/IP protocol suite for passing control messages between IP hosts and routers. The control message refers to a message of the network itself such as a network is not connected, whether a host is reachable, whether a route is available, and the like. These control messages, although not transmitting user data, play an important role in the transfer of user data. One typical application of ICMP is Ping, which is a common tool to detect network connectivity, while also being able to collect other relevant information.
Currently, multi-device storage management software (e.g., inpur multi-device management software) is capable of simultaneously managing multiple clusters, hosts, routers, switches, and other network devices. One common scenario is that when the IP address cannot be dynamically acquired without DHCP (Dynamic Host Configuration Protocol ) under the management network of the multi-device storage management software, only static IP is configured, so in order to avoid IP collision, it is necessary to find unoccupied IPs in advance, and detecting all unoccupied IPs under the same network segment is a heavy task.
Therefore, how to enable the multi-device storage management software to quickly and conveniently detect unoccupied IP addresses in the management network, and improve the usability and usability of the multi-device storage management software is an urgent need to be solved nowadays.
Disclosure of Invention
The invention aims to provide a storage network detection method, a storage network detection device, storage network detection equipment and a storage network detection computer readable storage medium, so that multi-device storage management software can rapidly and conveniently detect unoccupied IP addresses in a management network, and the availability and usability of the multi-device storage management software are improved.
In order to solve the above technical problems, the present invention provides a storage network detection method, including:
acquiring an IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2;
creating ICMP messages corresponding to each IP to be detected;
and sending the ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel mode, and determining the occupation condition of the IPs to be detected according to the returned messages of the ICMP messages.
Optionally, the sending the ICMP message to the target hosts corresponding to the IPs to be detected in a parallel manner, and determining the occupation condition of the IPs to be detected according to the return message of the target host, includes:
creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected;
sending the ICMP message to the target host through the pipeline;
polling to detect a target file descriptor in the file descriptors; wherein the target file descriptor is the readable file descriptor;
and determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
Optionally, the determining the occupation condition of the IP to be detected according to the return message of the ICMP message corresponding to the target file descriptor includes:
judging whether a return message of the ICMP message corresponding to the target file descriptor is a normal message returned by the target host;
if yes, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is occupied;
if not, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is unoccupied.
Optionally, the acquiring the IP to be detected includes:
acquiring an IP detection task; wherein, each IP detection task comprises a corresponding IP;
and selecting a preset number of the to-be-detected IPs from the IP detection tasks by using the producer consumer and the priority queue model.
Optionally, the selecting the IP to be detected from the IP detection task by using a producer consumer and priority queue model includes:
adding the IP detection task into a task queue;
and selecting the preset number of the to-be-detected IPs from the task queue according to a preset priority rule.
The invention also provides a storage network detection device, which comprises:
the acquisition module is used for acquiring the IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2;
the creating module is used for creating ICMP messages corresponding to each IP to be detected;
and the parallel detection module is used for sending the ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel mode, and determining the occupation condition of the IPs to be detected according to the returned messages of the ICMP messages.
Optionally, the parallel detection module includes:
the creation sub-module is used for creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected;
a sending submodule, configured to send the ICMP packet to the target host through the pipe;
a polling sub-module, configured to poll and detect a target file descriptor in the file descriptors; wherein the target file descriptor is the readable file descriptor;
and the determining submodule is used for determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
Optionally, the acquiring module includes:
the task acquisition sub-module is used for acquiring an IP detection task; wherein, each IP detection task comprises a corresponding IP;
and the selecting submodule is used for selecting a preset number of the to-be-detected IPs from the IP detection tasks by utilizing the producer consumer and the priority queue model.
The invention also provides a storage network detection device, comprising:
a memory for storing a computer program;
and a processor for implementing the steps of the storage network detection method as described above when executing the computer program.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of a storage network detection method as described above.
The invention provides a storage network detection method, which comprises the following steps: acquiring an IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2; creating ICMP messages corresponding to each IP to be detected; an ICMP message is sent to a target host corresponding to each IP to be detected in a parallel mode, and the occupation condition of the IP to be detected is determined according to the return message of the ICMP message;
therefore, the invention sends the ICMP message to the target hosts corresponding to the IP to be detected in a parallel mode, and determines the occupation condition of the IP to be detected according to the return message of the ICMP message, so that the ICMP message can be sent to multiple target hosts in a parallel mode based on the ICMP protocol, the reachability of the multiple target hosts can be determined quickly and efficiently, namely the occupation condition of the IP to be detected can be determined, the multi-device storage management software can detect unoccupied IP addresses quickly and conveniently in the management network, and the availability and usability of the multi-device storage management software are improved. In addition, the invention also provides a storage network detection device, equipment and a computer readable storage medium, which also have the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for detecting a storage network according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of multi-thread parallel detection of another method for detecting a storage network according to an embodiment of the present invention;
FIG. 3 is a flowchart of IO multiplexing parallel detection in another storage network detection method according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of IO multiplexing parallel detection in another storage network detection method according to an embodiment of the present invention;
fig. 5 is a block diagram of a storage network detection device according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a storage network detection device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a storage network detection method according to an embodiment of the invention. The method may include:
step 101: acquiring an IP to be detected; wherein the number of IPs to be detected is greater than or equal to 2.
The IP to be detected in this step may be an IP address where occupancy detection is currently required.
Specifically, for the specific mode of acquiring the IP to be detected by the processor in the step, the specific mode can be set by a designer according to a practical scene and user requirements, for example, the processor can directly take the IP address set by the user as the IP to be detected; the preset number of IP addresses can also be selected from the plurality of IP addresses to serve as the IP to be detected, for example, in the step, the processor can acquire an IP detection task; selecting a preset number of to-be-detected IPs from the IP detection tasks by using producer consumers and a priority queue model; wherein each IP detection task comprises a respective corresponding IP. The present embodiment does not impose any limitation on this.
Correspondingly, for the processor, a specific mode of selecting a preset number of to-be-detected IPs from the IP detection tasks by using the producer consumer and the priority queue model can be set by a designer, for example, the producer consumer and the priority queue model can insert a network detection task (i.e., an IP detection task) of a certain IP into the task queue through the producer; the task queue may contain fields such as IP, type, and priority of each network detection task; and the consumer acquires a preset number (1024) of IP (i.e. IP to be detected) in the task queue according to the custom priority rule. That is, the processor may add the IP detection task to the task queue; according to the preset priority rule, a preset number of to-be-detected IPs are selected from the task queue, for example, when the preset priority rule is for the IP priority detection of the preset network segment, the processor may preferentially select the IP of the preset network segment from the IP detection task of the task queue until the preset number of IPs are selected as the to-be-detected IPs.
Step 102: and creating ICMP messages corresponding to each IP to be detected.
The ICMP message in this step may be an ICMP protocol message, that is, a message based on the ICMP protocol for detecting whether the network is available.
Specifically, the specific manner of creating the ICMP message corresponding to each IP to be detected in this step may be set by a designer, for example, may be implemented in the same manner or in a similar manner to the message generation method of the ICMP protocol in the prior art, which is not limited in this embodiment.
Step 103: and sending ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel mode, and determining the occupation condition of the IPs to be detected according to the returned messages of the ICMP messages.
It can be understood that the target host in this step may be a host corresponding to the IP to be detected. The purpose of this step may be that the processor sends ICMP messages to multiple target hosts in a parallel manner, and monitors the messages corresponding to the ICMP messages returned by the target hosts (i.e., return messages), so as to quickly and efficiently determine reachability of multiple target hosts, that is, occupation conditions of the IP to be detected are occupied when the target host corresponding to the IP to be detected is reachable; and when the target host corresponding to the IP to be detected is not reachable, the occupation condition of the IP to be detected is unoccupied.
Specifically, in this embodiment, the occupation condition of a plurality of IPs to be detected is monitored in a parallel manner, which is more efficient than a serial monitoring manner. For the processor in this step, an ICMP message is sent to the target host corresponding to each IP to be detected in a parallel manner, and a specific manner of determining the occupation situation of the IP to be detected according to the return message of the ICMP message may be set by a designer, for example, the processor may implement detection of the occupation situation of the IP to be detected based on multiple threads, for example, when the occupation situations of N IPs to be detected need to be detected in this step, as shown in fig. 2, the processor running the multi-device storage management software may create N threads; each thread is utilized to monitor the return message of the ICMP message returned by a corresponding host (namely the target host); after all threads are finished, determining the occupation condition of N to-be-detected IPs. In order to avoid the resource consumption caused by the thread opening and thread switching, in this step, the processor may adopt an asynchronous IO (input/output) manner to implement the detection of the occupation condition of the IP to be detected, for example, based on the IO multiplexing model, send ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel manner, and determine the occupation condition of the IPs to be detected according to the return messages of the ICMP messages. The present embodiment is not limited in this regard.
Specifically, the IO multiplexing model can be established on the basis of a multiplexing function selection provided by the kernel, and the problem of polling waiting in the synchronous non-blocking IO model can be avoided by using the selection function; the principle can be as follows: firstly, adding a socket needing IO operation into a select by a user, and then blocking to wait for return of the select system call; when the data arrives, the socket is activated and the select function returns; the user thread formally initiates a read request, reads the data and continues execution. A user can register a plurality of sockets and then continuously call the select to read the activated sockets, so that the aim of simultaneously processing a plurality of IO requests in the same thread can be fulfilled.
Correspondingly, the embodiment does not limit the specific manner that the processor sends ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel manner based on the IO multiplexing model, and determines the occupation condition of the IPs to be detected according to the return messages of the ICMP messages, as shown in fig. 3, and may include:
step 201: and creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected.
In this step, the pipe may be used to send a channel (socket) of an ICMP packet corresponding to the IP to be detected; in the step, the file descriptors corresponding to each pipeline can be acquired, so that the read operation of the file descriptors is monitored, and the return condition of the return message of the ICMP message is determined; as shown in fig. 4, when the number of IPs to be detected is N, N pipes may be created, N file descriptors corresponding to the N pipes respectively are acquired, and the read operations of the file descriptors are specified to be monitored.
Step 202: and sending the ICMP message to the target host through the pipeline.
Specifically, the purpose of this step may be that the processor sends, through the created pipe (socket) corresponding to each IP to be detected, a corresponding ICMP packet to the target host corresponding to each IP to be detected.
Step 203: polling to detect a target file descriptor in the file descriptors; wherein the target file descriptor is a readable file descriptor.
It will be appreciated that the purpose of this step may be for the processor to determine the target host of the return message that returned the ICMP message by polling for a file descriptor readable in the file descriptor (i.e., the target file descriptor). That is, if the target host corresponding to the IP to be detected returns a return message of the ICMP message, a read operation will occur on the file descriptor corresponding to the IP to be detected, that is, the file descriptor is readable.
Specifically, for the specific mode of polling and detecting the target file descriptor in the file descriptor by the processor in the step, the method can be set by a designer, for example, the poll function can be utilized to poll and detect the target file descriptor in the file descriptor; as shown in fig. 4, the poll function can be used to monitor whether the file descriptor set is readable; and determining the target file descriptor according to the return value of the poll function so as to judge the occurrence of the readable event of the pipeline.
It should be noted that, in this embodiment, the training time of the file descriptor may be set, that is, the timing may be performed when the polling detection of the target file descriptor in the file descriptor is started, and whether the timing time reaches the training time may be determined; if the training time is reached, determining that the occupation condition of the IP to be detected corresponding to the non-target file descriptor in the file descriptors is unoccupied.
Step 204: and determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
It can be understood that the purpose of this step may be to determine, according to a return message of an ICMP message on a pipeline corresponding to a readable file descriptor (i.e., a target file descriptor), an occupancy condition of an IP to be detected corresponding to the file descriptor, where, if the return message of the ICMP message corresponding to the target file descriptor is a normal message returned by a target host, it may be determined that the target host is reachable, that is, the occupancy condition of the IP to be detected corresponding to the file descriptor is occupied.
Specifically, the processor in this step may determine whether the return message of the ICMP message corresponding to the target file descriptor is a normal message returned by the target host; if yes, determining that the occupied condition of the IP to be detected corresponding to the target file descriptor is occupied; if not, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is unoccupied.
In this embodiment, in the embodiment of the present invention, by sending an ICMP packet to a target host corresponding to each IP to be detected in a parallel manner, and determining an occupation condition of the IP to be detected according to a return packet of the ICMP packet, the ICMP packet can be sent to multiple target hosts in a parallel manner based on the ICMP protocol, so as to quickly and efficiently determine reachability of multiple target hosts, that is, determine occupation conditions of multiple IP to be detected, so that multiple device storage management software can quickly and conveniently detect unoccupied IP addresses in a management network, and improve availability and usability of the multiple device storage management software.
Referring to fig. 5, fig. 5 is a block diagram illustrating a storage network detection apparatus according to an embodiment of the present invention. The apparatus may include:
an acquisition module 10, configured to acquire an IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2;
the creating module 20 is configured to create an ICMP packet corresponding to each IP to be detected;
the parallel detection module 30 is configured to send ICMP messages to target hosts corresponding to the IPs to be detected in a parallel manner, and determine occupation conditions of the IPs to be detected according to return messages of the ICMP messages.
Optionally, the parallel detection module 30 may include:
the creation sub-module is used for creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected;
the sending submodule is used for sending the ICMP message to the target host through the pipeline;
a polling sub-module for polling the target file descriptors in the detected file descriptors; wherein the target file descriptor is a readable file descriptor;
and the determining submodule is used for determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
Optionally, the determining submodule may be specifically configured to determine whether a return message of the ICMP message corresponding to the target file descriptor is a normal message returned by the target host; if yes, determining that the occupied condition of the IP to be detected corresponding to the target file descriptor is occupied; if not, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is unoccupied.
Optionally, the acquiring module 10 may include:
the task acquisition sub-module is used for acquiring an IP detection task; each IP detection task comprises a corresponding IP;
and the selecting sub-module is used for selecting a preset number of to-be-detected IPs from the IP detection tasks by utilizing the producer consumer and the priority queue model.
Optionally, selecting the sub-module may include:
a queue unit for adding the IP detection task into a task queue;
and the selecting unit is used for selecting a preset number of to-be-detected IPs from the task queue according to a preset priority rule.
In this embodiment, the parallel detection module 30 sends the ICMP message to the target hosts corresponding to the IPs to be detected in a parallel manner, and determines the occupation condition of the IPs to be detected according to the return message of the ICMP message, so that the ICMP message can be sent to multiple target hosts in a parallel manner based on the ICMP protocol, thereby determining the reachability of the multiple target hosts, that is, determining the occupation condition of the multiple IPs to be detected, so that the multi-device storage management software can detect unoccupied IP addresses quickly and conveniently in the management network, and improving the availability and usability of the multi-device storage management software.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a storage network detection device according to an embodiment of the present invention. The device 1 may comprise:
a memory 11 for storing a computer program; a processor 12 for implementing the steps of the storage network detection method as provided in the above embodiments when executing the computer program.
The device 1 may be embodied as a server, such as a server running multi-device storage management software in a storage system; the device 1 may comprise a memory 11, a processor 12 and a bus 13.
The memory 11 includes at least one type of readable storage medium including flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the device 1. The memory 11 may in other embodiments also be an external storage device of the device 1, such as a plug-in hard disk provided on a server, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like. Further, the memory 11 may also include both an internal storage unit and an external storage device of the device 1. The memory 11 may be used not only for storing application software installed in the device 1 and various types of data, for example: the code or the like that executes the program that stores the network detection method may also be used to temporarily store data that has been output or is to be output.
The processor 12 may in some embodiments be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor or other data processing chip for running program code or processing data stored in the memory 11, such as code executing a program storing a network detection method, etc.
The bus 13 may be a peripheral component interconnect standard (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus may be classified as an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in fig. 6, but not only one bus or one type of bus.
Further, the device may also comprise a network interface 14, which network interface 14 may optionally comprise a wired interface and/or a wireless interface (e.g. WI-FI interface, bluetooth interface, etc.), typically used to establish a communication connection between the device 1 and other electronic devices.
Optionally, the device 1 may further comprise a user interface 15, the user interface 15 may comprise a Display, an input unit such as keys, and the optional user interface 15 may further comprise a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, or the like. The display may also be referred to as a display screen or display unit, as appropriate, for displaying information processed in the device 1 and for displaying a visual user interface.
Fig. 6 shows only a device 1 with components 11-15, it being understood by a person skilled in the art that the structure shown in fig. 6 does not constitute a limitation of the device 1, and may comprise fewer or more components than shown, or may combine certain components, or a different arrangement of components.
In addition, the embodiment of the invention also discloses a computer readable storage medium, and the computer readable storage medium stores a computer program which realizes the steps of the storage network detection method provided by the embodiment when being executed by a processor.
Wherein the storage medium may include: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. The apparatus, device and computer readable storage medium of the embodiments are described more simply because they correspond to the methods of the embodiments, and the description thereof will be given with reference to the method section.
The method, the device, the equipment and the computer readable storage medium for detecting the storage network provided by the invention are described in detail. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
Claims (7)
1. A storage network detection method, comprising:
acquiring an IP detection task; wherein, each IP detection task comprises a corresponding IP;
selecting a preset number of to-be-detected IPs from the IP detection tasks by using producer consumers and a priority queue model; wherein the number of the IPs to be detected is greater than or equal to 2;
creating ICMP messages corresponding to each IP to be detected;
sending the ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel mode, and determining the occupation condition of the IPs to be detected according to the returned messages of the ICMP messages;
the selecting the IP to be detected from the IP detection task by using the producer consumer and priority queue model includes:
adding the IP detection task into a task queue;
and selecting the preset number of the to-be-detected IPs from the task queue according to a preset priority rule.
2. The storage network detection method according to claim 1, wherein the sending the ICMP message to the target hosts corresponding to the IPs to be detected in parallel, and determining the occupancy status of the IPs to be detected according to the return message of the target hosts, includes:
creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected;
sending the ICMP message to the target host through the pipeline;
polling to detect a target file descriptor in the file descriptors; wherein the target file descriptor is the readable file descriptor;
and determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
3. The storage network detection method according to claim 2, wherein the determining the occupation condition of the IP to be detected according to the return message of the ICMP message corresponding to the object file descriptor includes:
judging whether a return message of the ICMP message corresponding to the target file descriptor is a normal message returned by the target host;
if yes, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is occupied;
if not, determining that the occupation condition of the IP to be detected corresponding to the target file descriptor is unoccupied.
4. A storage network detection apparatus, comprising:
the acquisition module is used for acquiring the IP to be detected; wherein the number of the IPs to be detected is greater than or equal to 2;
the creating module is used for creating ICMP messages corresponding to each IP to be detected;
the parallel detection module is used for sending the ICMP messages to the target hosts corresponding to the IPs to be detected in a parallel mode, and determining the occupation condition of the IPs to be detected according to the returned messages of the ICMP messages;
wherein, the acquisition module includes:
the task acquisition sub-module is used for acquiring an IP detection task; wherein, each IP detection task comprises a corresponding IP;
a selecting sub-module, configured to select a preset number of IPs to be detected from the IP detection tasks by using a producer consumer and a priority queue model;
the selecting sub-module comprises:
a queue unit for adding the IP detection task into a task queue;
and the selecting unit is used for selecting the preset number of the to-be-detected IPs from the task queue according to a preset priority rule.
5. The storage network detection apparatus of claim 4, wherein the parallel detection module comprises:
the creation sub-module is used for creating a pipeline corresponding to each IP to be detected and acquiring a file descriptor corresponding to each IP to be detected;
a sending submodule, configured to send the ICMP packet to the target host through the pipe;
a polling sub-module, configured to poll and detect a target file descriptor in the file descriptors; wherein the target file descriptor is the readable file descriptor;
and the determining submodule is used for determining the occupation condition of the IP to be detected corresponding to the target file descriptor according to the returned message of the ICMP message corresponding to the target file descriptor.
6. A storage network detection device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the storage network detection method according to any one of claims 1 to 3 when executing the computer program.
7. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the storage network detection method according to any of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110189145.0A CN112887173B (en) | 2021-02-19 | 2021-02-19 | Storage network detection method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110189145.0A CN112887173B (en) | 2021-02-19 | 2021-02-19 | Storage network detection method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112887173A CN112887173A (en) | 2021-06-01 |
CN112887173B true CN112887173B (en) | 2023-05-23 |
Family
ID=76056585
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110189145.0A Active CN112887173B (en) | 2021-02-19 | 2021-02-19 | Storage network detection method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112887173B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114268559B (en) * | 2021-12-27 | 2024-02-20 | 天翼物联科技有限公司 | Directional network detection method, device, equipment and medium based on TF-IDF algorithm |
CN114629816B (en) * | 2022-03-14 | 2023-11-03 | 京东科技信息技术有限公司 | Public network IP network state detection method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010148882A1 (en) * | 2009-12-07 | 2010-12-29 | 中兴通讯股份有限公司 | Method and device of deadlock detection and self recovery of file transfer protocol |
WO2015154539A1 (en) * | 2014-04-11 | 2015-10-15 | 北京奇虎科技有限公司 | Website security detection method and apparatus |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101931565B (en) * | 2009-06-23 | 2012-07-18 | 中兴通讯股份有限公司 | Network segment detection method and device |
CN102447597B (en) * | 2012-01-11 | 2014-11-19 | 浪潮(北京)电子信息产业有限公司 | Method and device for realizing IP (Internet Protocol) effectiveness detection |
CN107231266A (en) * | 2016-03-24 | 2017-10-03 | 中兴通讯股份有限公司 | The detection method and device of message passage |
CN111510353A (en) * | 2020-04-15 | 2020-08-07 | 深圳市三旺通信股份有限公司 | Detection method, device and equipment of online equipment and computer readable storage medium |
-
2021
- 2021-02-19 CN CN202110189145.0A patent/CN112887173B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2010148882A1 (en) * | 2009-12-07 | 2010-12-29 | 中兴通讯股份有限公司 | Method and device of deadlock detection and self recovery of file transfer protocol |
WO2015154539A1 (en) * | 2014-04-11 | 2015-10-15 | 北京奇虎科技有限公司 | Website security detection method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
CN112887173A (en) | 2021-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111580995B (en) | Synchronous communication method and system of distributed cloud platform and Internet of things intelligent terminal based on MQTT asynchronous communication scene | |
WO2021258753A1 (en) | Service processing method and apparatus, and electronic device and storage medium | |
CN110162270B (en) | Data storage method, storage node and medium based on distributed storage system | |
CN112887173B (en) | Storage network detection method, device, equipment and readable storage medium | |
CN112015544A (en) | Load balancing method, device and equipment of k8s cluster and storage medium | |
CN101616083A (en) | A kind of message forwarding method and device | |
CN110740164A (en) | Server determination method, regulation and control method, device, equipment and storage medium | |
CN105472291A (en) | Digital video recorder with multiprocessor cluster and realization method of digital video recorder | |
US20140337536A1 (en) | Method and apparatus for data communication | |
CN110336888B (en) | A server allocation method, device, system and medium | |
CN116599917B (en) | Network port determining method, device, equipment and storage medium | |
CN106411778A (en) | Data forwarding method and device | |
US20150207731A1 (en) | System and method of forwarding ipmi message packets based on logical unit number (lun) | |
CN110995817B (en) | Request callback method and device and client equipment | |
CN107294911B (en) | Data packet monitoring method and device, remote procedure call system and equipment | |
CN108429703B (en) | DHCP client-side online method and device | |
CN117041172B (en) | White box switch interface request processing method and device | |
CN109347743B (en) | Special line communication method, computer readable storage medium and terminal equipment | |
CN114138371B (en) | Configuration dynamic loading method and device, computer equipment and storage medium | |
CN107766232B (en) | Plug-in management method and device | |
CN113596105B (en) | Content acquisition method, edge node and computer readable storage medium | |
CN108985397B (en) | Method and device for inquiring Bond information and computer storage medium | |
US11271897B2 (en) | Electronic apparatus for providing fast packet forwarding with reference to additional network address translation table | |
CN109391707B (en) | Domain name resolution method, device, equipment and storage medium | |
CN113779021A (en) | Data processing method, device, computer system and readable storage medium |
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 |