CN107613002A - A kind of method, apparatus of inquiry apparatus information and its equipment used - Google Patents

A kind of method, apparatus of inquiry apparatus information and its equipment used Download PDF

Info

Publication number
CN107613002A
CN107613002A CN201710850937.1A CN201710850937A CN107613002A CN 107613002 A CN107613002 A CN 107613002A CN 201710850937 A CN201710850937 A CN 201710850937A CN 107613002 A CN107613002 A CN 107613002A
Authority
CN
China
Prior art keywords
equipment
network segment
target network
thread
segment limit
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.)
Granted
Application number
CN201710850937.1A
Other languages
Chinese (zh)
Other versions
CN107613002B (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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710850937.1A priority Critical patent/CN107613002B/en
Publication of CN107613002A publication Critical patent/CN107613002A/en
Application granted granted Critical
Publication of CN107613002B publication Critical patent/CN107613002B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of method of inquiry apparatus information to include:The thread of predetermined number is created in target network segment limit;Order group corresponding to each equipment corresponding device type inquired about in the target network segment limit, and the querying command by the thread into each equipment transmission order group;Return information is judged whether, if so, then recording the return information.As can be seen here, the method for inquiry apparatus information disclosed by the invention, the facility information of target device in target network segment limit is obtained using multi-thread concurrent, is realized by relatively low cost with higher Efficiency Inquiry facility information.The invention also discloses a kind of device of inquiry apparatus information and its equipment and computer-readable recording medium of the inquiry apparatus information used, above-mentioned technique effect can be equally realized.

Description

A kind of method, apparatus of inquiry apparatus information and its equipment used
Technical field
The present invention relates to computer communication field, a kind of method, apparatus more specifically to inquiry apparatus information and The equipment and computer-readable recording medium of its inquiry apparatus information used.
Background technology
During daily O&M, generally by deployed with devices in the same network segment, in order to unified maintenance and management.Safeguarding During, it is necessary to often check the state of equipment in the network segment.The method for checking equipment state in the prior art, one kind are using clothes Business device manages these equipment, is to expend hardware and soft by the network management page come query facility state, the shortcomings that this method Part cost is high;Another is by the IP address of manual pinged device, is to obtain the state of equipment, the shortcomings that this method Obtain less efficient.
Therefore, how with higher Efficiency Inquiry facility information to be that those skilled in the art need to solve by relatively low cost Certainly the problem of.
The content of the invention
It is an object of the invention to provide a kind of method, apparatus of inquiry apparatus information and its inquiry apparatus information used Equipment and computer-readable recording medium, realize by relatively low cost with higher Efficiency Inquiry facility information.
To achieve the above object, the embodiments of the invention provide a kind of method of inquiry apparatus information, including:
The thread of predetermined number is created in target network segment limit;
Order group corresponding to each equipment corresponding device type inquired about in the target network segment limit, and pass through the line Journey sends the querying command in the order group to each equipment;
Return information is judged whether, if so, then recording the return information.
Wherein, after the thread that predetermined number is created in target network segment limit, in addition to:
According to the IP address and port numbers of each equipment in the target network segment limit, by the thread to described every Individual equipment sends connection request, so that each equipment returns to request results;
Judged to whether there is the connected device of successful connection in the target network segment limit according to the request results, if It is then to inquire about order group corresponding to the device type of the connected device.
Wherein, if target device connection failure in the target network segment limit, in addition to:
Judge whether the target device connection number reaches default connection number;
If it is not, then send connection request to the target device again through the thread.
Wherein, inquire about before order group corresponding to the device type of each equipment in the target network segment limit, also wrap Include:
User name cipher code set corresponding to the connected device corresponding device type is inquired about, and institute is utilized by the thread State connected device described in the user name password login in user name cipher code set;
Judge with the presence or absence of the logging device logined successfully in the connected device, if so, then having been stepped on described in inquiry Order group corresponding to the device type of recording apparatus.
Wherein, inquire about before user name cipher code set corresponding to the connected device corresponding device type, in addition to:
The device type of the connected device is determined according to the request results.
To achieve the above object, the embodiments of the invention provide a kind of device of inquiry apparatus information, including:
Creation module, for creating the thread of predetermined number in target network segment limit;
Enquiry module, for inquiring about order corresponding to each equipment corresponding device type in the target network segment limit Group, and the querying command by the thread into each equipment transmission order group;
Logging modle, for judging whether return information, if so, then recording the return information.
Wherein, in addition to:
Link block, for the IP address and port numbers according to each equipment in the target network segment limit, pass through institute State thread and send connection request to each equipment, so that each equipment returns to request results;
First judge module, connected into for judging to whether there is in the target network segment limit according to the request results The connected device of work(, if so, then triggering the enquiry module.
Wherein, in addition to:
Login module, for inquiring about user name cipher code set corresponding to the connected device corresponding device type, and pass through The thread utilizes connected device described in the user name password login in the user name cipher code set;
Second judge module, for judging with the presence or absence of the logging device logined successfully in the connected device, if It is then to trigger the enquiry module.
To achieve the above object, the embodiments of the invention provide a kind of equipment of inquiry apparatus information, including:
Memory, for storage information polling routine;
Processor, inquiry apparatus information method described in any of the above-described is realized during for performing described information polling routine Step.
To achieve the above object, the embodiments of the invention provide a kind of computer-readable recording medium, the computer can Read to be stored with information inquiry program in storage medium, any one as described above is realized when described information polling routine is executed by processor The method of the inquiry apparatus information.
By above scheme, a kind of method of inquiry apparatus information provided in an embodiment of the present invention includes:In target The thread of predetermined number is created in the range of the network segment;The each equipment corresponding device type inquired about in the target network segment limit is corresponding Order group, and send to each equipment by the thread querying command in the order group;Judge whether Return information, if so, then recording the return information.As can be seen here, the side of inquiry apparatus information provided in an embodiment of the present invention Method, using multi-thread concurrent obtain target network segment limit in target device facility information, realize by relatively low cost with Higher Efficiency Inquiry facility information.The invention also discloses a kind of device of inquiry apparatus information and its query facility used The equipment and computer-readable recording medium of information, can equally realize above-mentioned technique effect.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this Some embodiments of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can be with Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of flow chart of the method for inquiry apparatus information disclosed in the embodiment of the present invention;
Fig. 2 is the flow chart of the method for another inquiry apparatus information disclosed in the embodiment of the present invention;
Fig. 3 is a kind of structure chart of the device of inquiry apparatus information disclosed in the embodiment of the present invention;
Fig. 4 is a kind of structure chart of the equipment of inquiry apparatus information disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made Embodiment, belong to the scope of protection of the invention.
The embodiment of the invention discloses a kind of method of inquiry apparatus information, realize by relatively low cost with higher Efficiency Inquiry facility information.
Referring to Fig. 1, a kind of flow chart of the method for inquiry apparatus information disclosed in the embodiment of the present invention, as shown in figure 1, bag Include:
S101:The thread of predetermined number is created in target network segment limit;
In specific implementation, firstly for given target network segment limit, go to create in advance according to given concurrent connection number If the thread of quantity, such as 10 can be created concurrently in target network segment limit 172.16.1.0 to 172.16.1.255 Socket threads.
Socket, also known as socket, Socket are one of basic technologies of computer network communication.Nowadays it is most of Network software, as browser, immediate communication tool even P2P downloads are all based on Socket realizations.Socket It is the intervening software abstraction layer that application layer communicates with TCP/IP protocol suite, it is a group interface.In design pattern, Socket its Real is exactly a Facade, and it is hidden in the TCP/IP protocol suite of complexity behind Socket interfaces, for user, one group Simple interface is exactly all, to allow Socket to go tissue data, to meet the agreement specified.
S102:Order group corresponding to each equipment corresponding device type inquired about in the target network segment limit, and pass through The thread sends the querying command in the order group to each equipment;
S103:Return information is judged whether, if so, the return information is then recorded, if it is not, then terminating flow.
In specific implementation, by the concurrent Socket threads of above-mentioned establishment, each equipment out of target network segment limit Corresponding device type may be used to send to each equipment successively in the order group of inquiry apparatus information and ordered, until returning equipment Information.If a certain equipment has a return information, successful inquiring, return information corresponding to the equipment is recorded, and by the equipment State is arranged to successful inquiring.If the complete order of a certain equipment is attempted to fail, the state of the equipment is arranged to look into Ask failure.
In the above example, 10 concurrent Socket threads inquire about the facility information of 10 equipment simultaneously, are returned when existing When equipment corresponding to returning result or a certain thread is identified as inquiry failure, the thread, which continues to inquire about, removes above-mentioned 10 in the target network segment Facility information outside individual equipment, inquire about and finish until all devices in the target network segment.
The method of inquiry apparatus information provided in an embodiment of the present invention, obtained using multi-thread concurrent in target network segment limit The facility information of target device, realize by relatively low cost with higher Efficiency Inquiry facility information.
The embodiment of the invention discloses a kind of method of inquiry apparatus information, relative to a upper embodiment, the present embodiment pair Technical scheme has made further instruction and optimization.Specifically:
Referring to Fig. 2, the flow chart of the method for another inquiry apparatus information provided in an embodiment of the present invention, as shown in Fig. 2 Including:
S201:The thread of predetermined number is created in target network segment limit;
S221:According to the IP address and port numbers of the target device in the target network segment limit, by the thread to The target device sends connection request, so that the target device returns to request results;
S222:Judge that the connection in the target network segment limit with the presence or absence of successful connection is set according to the request results It is standby, if so, then entering S231, if it is not, the state of the equipment in the target network segment limit then is arranged into connection failure;
In specific implementation, before the order during each equipment into the target network segment sends order group, also need to pass through Socket threads connect equipment.According to the IP address and port numbers of target device, pass through the multithreading of asynchronous communication meanses Socket is gone to connect multiple equipment, and returning to request results according to target device in thread is handled, if successful connection, The target device is connected device, into S231, is lost if it fails to connect, the state of the target device then is arranged into connection Lose.
S231:The device type of the connected device is determined according to the request results;
In specific implementation, affiliated type directly can be informed processor by equipment by request results, so as to processor The device type of the connected device is determined by the request results, certainly, processor can also be true by other means Determine the device type of connected device, be not especially limited herein.
S232:User name cipher code set corresponding to the connected device corresponding device type is inquired about, and passes through the thread Utilize connected device described in the user name password login in the user name cipher code set;
S233:Judge with the presence or absence of the logging device logined successfully in the connected device, if so, then entering S204, if it is not, the state of the connected device then is arranged into login failure;
After above-mentioned connected device successful connection, the user that may be used from each connected device corresponding device type Each group user name password is attempted successively in name cipher code set, until login successfully, will if each group user name password logs in failure The state of the connected device is arranged to login failure.
It is understood that it can be the thread for connecting the equipment to log in the thread that connected device uses, or The equipment redistributes other threads and carries out register, is not especially limited herein.
S204:Order group corresponding to logging device corresponding device type described in inquiry, and by the thread to described Logging device sends the querying command in the order group;
S205:Judge to whether there is the equipment with return information in the logging device, if so, then record is in the presence of returning Return information corresponding to the equipment of letter in reply breath, if it is not, the state of the logging device then is arranged into inquiry failure.
On the basis of above-described embodiment, preferably, if the target device in the target network segment limit Connection failure, then also include:
Judge whether the target device connection number reaches default connection number;
If it is not, then send connection request to the target device again through the thread.
If the target device connection failure in the target network segment limit, the thread before being continuing with goes to connect the mesh Marking device, until reaching default connection number, if the target device still connection failure, the state of the target device is set For connection failure.
A kind of device of inquiry apparatus information provided in an embodiment of the present invention is introduced below, one kind described below The device of inquiry apparatus information can be with cross-referenced with a kind of above-described method of inquiry apparatus information.
Referring to Fig. 3, a kind of structure chart of the device of inquiry apparatus information provided in an embodiment of the present invention, as shown in figure 3, bag Include:
Creation module 301, for creating the thread of predetermined number in target network segment limit;
Enquiry module 302, for inquiring about life corresponding to each equipment corresponding device type in the target network segment limit Make group, and the querying command by the thread into each equipment transmission order group;
Logging modle 303, for judging whether return information, if so, then recording the return information.
The device of inquiry apparatus information provided in an embodiment of the present invention, obtained using multi-thread concurrent in target network segment limit The facility information of target device, realize by relatively low cost with higher Efficiency Inquiry facility information.
On the basis of above-described embodiment, preferably, in addition to:
Link block, for the IP address and port numbers according to each equipment in the target network segment limit, pass through institute State thread and send connection request to each equipment, so that each equipment returns to request results;
First judge module, connected into for judging to whether there is in the target network segment limit according to the request results The connected device of work(, if so, then triggering the enquiry module.
On the basis of above-described embodiment, preferably, in addition to:
Login module, for inquiring about user name cipher code set corresponding to the connected device corresponding device type, and pass through The thread utilizes connected device described in the user name password login in the user name cipher code set;
Second judge module, for judging with the presence or absence of the logging device logined successfully in the connected device, if It is then to trigger the enquiry module.
Present invention also provides a kind of equipment of inquiry apparatus information, and referring to Fig. 4, one kind provided in an embodiment of the present invention is looked into The structure chart of the equipment of facility information is ask, as shown in figure 4, including:
Memory 401, for storage information polling routine;
Processor 402, the step of above-described embodiment provides can be realized during for performing described information polling routine.When The right server can also include the component such as various network interfaces, power supply.
The equipment of inquiry apparatus information provided in an embodiment of the present invention, obtained using multi-thread concurrent in target network segment limit The facility information of target device, realize by relatively low cost with higher Efficiency Inquiry facility information.
Present invention also provides a kind of computer-readable recording medium, has information inquiry program thereon, and described information is looked into The step of above-described embodiment provides can be realized by asking when program is executed by processor.The storage medium can include:USB flash disk, shifting Dynamic hard disk, read-only storage (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disc or CD etc. are various can be with the medium of store program codes.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other The difference of embodiment, between each embodiment identical similar portion mutually referring to.
The foregoing description of the disclosed embodiments, professional and technical personnel in the field are enable to realize or using the present invention. A variety of modifications to these embodiments will be apparent for those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one The most wide scope caused.
It should also be noted that, in this manual, such as first and second or the like relational terms be used merely to by One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning Covering including for nonexcludability, so that process, method, article or equipment including a series of elements not only include that A little key elements, but also the other element including being not expressly set out, or also include for this process, method, article or The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged Except other identical element in the process including the key element, method, article or equipment being also present.

Claims (10)

  1. A kind of 1. method of inquiry apparatus information, it is characterised in that including:
    The thread of predetermined number is created in target network segment limit;
    Order group corresponding to each equipment corresponding device type inquired about in the target network segment limit, and by the thread to Each equipment sends the querying command in the order group;
    Return information is judged whether, if so, then recording the return information.
  2. 2. the method for inquiry apparatus information according to claim 1, it is characterised in that created in target network segment limit pre- If after the thread of quantity, in addition to:
    According to the IP address and port numbers of each equipment in the target network segment limit, each set to described by the thread Preparation send connection request, so that each equipment returns to request results;
    Judged to whether there is the connected device of successful connection in the target network segment limit according to the request results, if so, Then inquire about order group corresponding to the device type of the connected device.
  3. 3. the method for inquiry apparatus information according to claim 2, it is characterised in that if in the target network segment limit Target device connection failure, then also include:
    Judge whether the target device connection number reaches default connection number;
    If it is not, then send connection request to the target device again through the thread.
  4. 4. the method for inquiry apparatus information according to claim 3, it is characterised in that inquire about in the target network segment limit Each equipment device type corresponding to before order group, in addition to:
    User name cipher code set corresponding to the connected device corresponding device type is inquired about, and the use is utilized by the thread Connected device described in user name password login in name in an account book cipher code set;
    Judge, with the presence or absence of the logging device logined successfully in the connected device, to set if so, then having logged in described in inquiry Order group corresponding to standby device type.
  5. 5. the method for inquiry apparatus information according to claim 4, it is characterised in that inquire about belonging to the connected device Before user name cipher code set corresponding to device type, in addition to:
    The device type of the connected device is determined according to the request results.
  6. A kind of 6. device of inquiry apparatus information, it is characterised in that including:
    Creation module, for creating the thread of predetermined number in target network segment limit;
    Enquiry module, for inquiring about order group corresponding to each equipment corresponding device type in the target network segment limit, and Pass through querying command of the thread into each equipment transmission order group;
    Logging modle, for judging whether return information, if so, then recording the return information.
  7. 7. the device of inquiry apparatus information according to claim 6, it is characterised in that also include:
    Link block, for the IP address and port numbers according to each equipment in the target network segment limit, pass through the line Journey sends connection request to each equipment, so that each equipment returns to request results;
    First judge module, for being judged according to the request results in the target network segment limit with the presence or absence of successful connection Connected device, if so, then triggering the enquiry module.
  8. 8. the device of inquiry apparatus information according to claim 7, it is characterised in that also include:
    Login module, for inquiring about user name cipher code set corresponding to the connected device corresponding device type, and by described Thread utilizes connected device described in the user name password login in the user name cipher code set;
    Second judge module, for judging with the presence or absence of the logging device logined successfully in the connected device, if so, then Trigger the enquiry module.
  9. A kind of 9. equipment of inquiry apparatus information, it is characterised in that including:
    Memory, for storage information polling routine;
    Processor, the inquiry apparatus information as described in any one of claim 1 to 5 is realized during for performing described information polling routine The step of method.
  10. 10. a kind of computer-readable recording medium, it is characterised in that be stored with information on the computer-readable recording medium and look into Program is ask, the inquiry apparatus information as described in any one of claim 1 to 5 is realized when described information polling routine is executed by processor Method.
CN201710850937.1A 2017-09-20 2017-09-20 Method and device for inquiring equipment information and equipment used by same Active CN107613002B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710850937.1A CN107613002B (en) 2017-09-20 2017-09-20 Method and device for inquiring equipment information and equipment used by same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710850937.1A CN107613002B (en) 2017-09-20 2017-09-20 Method and device for inquiring equipment information and equipment used by same

Publications (2)

Publication Number Publication Date
CN107613002A true CN107613002A (en) 2018-01-19
CN107613002B CN107613002B (en) 2021-04-06

Family

ID=61061186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710850937.1A Active CN107613002B (en) 2017-09-20 2017-09-20 Method and device for inquiring equipment information and equipment used by same

Country Status (1)

Country Link
CN (1) CN107613002B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733001A (en) * 2021-01-14 2021-04-30 上海蓝云网络科技有限公司 Method and device for acquiring subscription information and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070150900A1 (en) * 2005-12-27 2007-06-28 Hankins Richard A Data structure and management techniques for local user-level thread data
CN101424941A (en) * 2007-10-31 2009-05-06 北京北方微电子基地设备工艺研究中心有限责任公司 Control implementing method and system
CN103248539A (en) * 2013-05-17 2013-08-14 上海大亚科技有限公司 Network equipment integrated test control system and method
CN104735143A (en) * 2015-03-18 2015-06-24 湖南天冠电子信息技术有限公司 Batch control system and method based on smart home cloud platform

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070150900A1 (en) * 2005-12-27 2007-06-28 Hankins Richard A Data structure and management techniques for local user-level thread data
CN101424941A (en) * 2007-10-31 2009-05-06 北京北方微电子基地设备工艺研究中心有限责任公司 Control implementing method and system
CN103248539A (en) * 2013-05-17 2013-08-14 上海大亚科技有限公司 Network equipment integrated test control system and method
CN104735143A (en) * 2015-03-18 2015-06-24 湖南天冠电子信息技术有限公司 Batch control system and method based on smart home cloud platform

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733001A (en) * 2021-01-14 2021-04-30 上海蓝云网络科技有限公司 Method and device for acquiring subscription information and electronic equipment
CN112733001B (en) * 2021-01-14 2023-09-29 上海蓝云网络科技有限公司 Method and device for acquiring subscription information and electronic equipment

Also Published As

Publication number Publication date
CN107613002B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN109062690A (en) A kind of request responding method, server, medium and system
JP4512179B2 (en) Storage apparatus and access management method thereof
CN103733148A (en) Energy management gateways and processes
WO2009149451A3 (en) Controlling resource allocation for backup operations
CN104317726A (en) Testing method for storage IO performance
CN103973781A (en) Method and system for monitoring screen based on proxy server
CN105591743A (en) Method and device for carrying out identity authentication through equipment operation features of user terminal
CN103902458A (en) Universal storage software test design method
CN103067372B (en) Cloud terminal logs in method and the login system of Cloud Server
CN102377737B (en) The system and method for the interactive email access protocol server of a kind of many account access
CN104461747A (en) Distributed type task scheduling system
CN101022400A (en) Method and device for realizing resource distribution of network stroage system
CN104852919A (en) Method and apparatus for realizing portal authentication
US20070011373A1 (en) System and method for identifying inoperable connection points in a storage enclosure
IE20070695A1 (en) System and method for the dynamic loading of protocol adapters
CN110175439A (en) User management method, device, equipment and computer readable storage medium
EP2725514B1 (en) Security information sharing system and execution method thereof
CN106603721A (en) Remote control method and system and remote control client
CN103561083A (en) Data processing method for Internet of things
CN107613002A (en) A kind of method, apparatus of inquiry apparatus information and its equipment used
CN102572011A (en) Method, device and system for processing data
CN101764689A (en) Method of system for controlling logging-in mode of user
CN106406771B (en) Log recording method and logger
CN102339305B (en) Database cluster failure recovery method on basis of partial ordering relation logs
US20080167050A1 (en) Method and system for managing user preferences for one or more software applications runing on a mobile computing device

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