[go: up one dir, main page]

CN103501240B - A kind of method of discovering device, apparatus and system - Google Patents

A kind of method of discovering device, apparatus and system Download PDF

Info

Publication number
CN103501240B
CN103501240B CN201310421690.3A CN201310421690A CN103501240B CN 103501240 B CN103501240 B CN 103501240B CN 201310421690 A CN201310421690 A CN 201310421690A CN 103501240 B CN103501240 B CN 103501240B
Authority
CN
China
Prior art keywords
snmp
terminal device
registration request
parameter information
request 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
Application number
CN201310421690.3A
Other languages
Chinese (zh)
Other versions
CN103501240A (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.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201310421690.3A priority Critical patent/CN103501240B/en
Publication of CN103501240A publication Critical patent/CN103501240A/en
Application granted granted Critical
Publication of CN103501240B publication Critical patent/CN103501240B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例提供了一种发现设备的方法、装置及系统,涉及网络通信领域,用于提高系统的工作效率。所述方法,包括:以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;接收所述管理器发送的第一SNMP注册响应消息;在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息;接收所述管理器发送的第二SNMP注册响应消息。本发明实施例适用于网络通信中管理器管理终端设备的场景。

Embodiments of the present invention provide a method, device and system for discovering devices, which relate to the field of network communication and are used to improve the working efficiency of the system. The method includes: sending a first SNMP registration request message to the manager with the first time as a cycle; the first SNMP registration request message carries device parameter information of the terminal device; the device parameter information of the terminal device Refers to the static information of the terminal device; receiving the first SNMP registration response message sent by the manager; after receiving the first SNMP registration response message, sending the message to the manager with a second time period A second SNMP registration request message; receiving a second SNMP registration response message sent by the manager. The embodiment of the present invention is applicable to a scenario where a manager manages terminal devices in network communication.

Description

一种发现设备的方法、装置及系统A method, device and system for discovering equipment

技术领域technical field

本发明涉及网络通信领域,尤其涉及一种发现设备的方法、装置及系统。The present invention relates to the field of network communication, in particular to a method, device and system for discovering equipment.

背景技术Background technique

在网络通信领域中,运维监控系统被广泛应用,它可以对网络中路由器、交换机、服务器、计算机终端、存储设备、防火墙等设备进行实时监测与管理,自动生成网络拓扑的嵌入式硬件设备。数据中心的运维监控系统是自动发现被管理设备的,在自动发现过程中,系统以主动轮询的方式访问现有环境下的所有设备,再使用SNMP(SimpleNetworkManagement Protocol,简单网络管理协议)中GET Request命令获取设备的静态信息。In the field of network communication, the operation and maintenance monitoring system is widely used. It can monitor and manage routers, switches, servers, computer terminals, storage devices, firewalls and other equipment in the network in real time, and automatically generate embedded hardware devices for network topology. The operation and maintenance monitoring system of the data center automatically discovers the managed devices. During the automatic discovery process, the system accesses all devices in the existing environment by active polling, and then uses SNMP (SimpleNetworkManagementProtocol, Simple Network Management Protocol) The GET Request command obtains the static information of the device.

在实现上述运维监控系统发现设备的过程中,发明人发现现有技术中至少存在如下问题:当运维监控系统管理的设备IP(InternetProtocol,网络之间互连的协议)地址段范围大、分布分散、数量多时,系统需要长时间才能完成一遍扫描,并且,若被管理设备静态信息发生更新,运维监控系统不能及时感知及更新相应信息,从而降低了系统工作效率。In the process of realizing the discovery of devices by the above-mentioned operation and maintenance monitoring system, the inventors found that there are at least the following problems in the prior art: when the IP (Internet Protocol, a protocol for interconnection between networks) of the equipment managed by the operation and maintenance monitoring system has a large range of addresses, When the distribution is scattered and the number is large, it takes a long time for the system to complete a scan. Moreover, if the static information of the managed device is updated, the operation and maintenance monitoring system cannot perceive and update the corresponding information in time, thereby reducing the system's work efficiency.

发明内容Contents of the invention

本发明的实施例提供一种发现设备的方法、装置及系统,用以提高系统的工作效率。Embodiments of the present invention provide a method, device and system for discovering devices, so as to improve the working efficiency of the system.

为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:

第一方面,本发明实施例提供了一种发现设备的方法,包括:以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;接收所述管理器发送的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的注册响应消息;在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;接收所述管理器发送的第二SNMP注册响应消息;其中,所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。In the first aspect, the embodiment of the present invention provides a method for discovering devices, including: sending a first SNMP registration request message to the manager with a first time period; the first SNMP registration request message carries a terminal device The device parameter information of the terminal device; the device parameter information of the terminal device refers to the static information of the terminal device; the first SNMP registration response message sent by the manager is received; the first SNMP registration response message is received for the first time Received the registration response message sent by the manager; after receiving the first SNMP registration response message, send a second SNMP registration request message to the manager with a second time period; the second SNMP The device parameter information of the terminal device is carried in the registration request message; the second SNMP registration response message sent by the manager is received; wherein, the second SNMP registration response message is received except the first SNMP registration response message other than SNMP registration response messages.

在第一方面的第一种可能实现方式中,在所述以第一时间为周期,向管理器发送第一SNMP注册请求消息之前,还包括:配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。In the first possible implementation of the first aspect, before sending the first SNMP registration request message to the manager with the first time as a period, it further includes: configuring interface parameters with the manager; The above interface parameters are used to establish a connection with the manager.

结合第一方面或第一方面的第一种可能的实现方式,在第一方面的第二种可能的实现方式中,所述第一时间的值小于所述第二时间的值。With reference to the first aspect or the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the value of the first time is smaller than the value of the second time.

结合第一方面或第一方面的第一至第二任一种可能的实现方式,在第一方面的第三种可能的实现方式中,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。With reference to the first aspect or any of the first to second possible implementations of the first aspect, in a third possible implementation of the first aspect, the second SNMP registration request message carries the terminal The device parameter information of the device includes: when the terminal device updates the device parameter information, the updated device parameter information of the terminal device is carried in the second SNMP registration request message.

结合第一方面或第一方面的第一至第三任一种可能的实现方式,在第一方面的第四种可能的实现方式中,所述第一SNMP注册请求消息包括:第一简单网络管理协议扩展SNMP注册请求消息;所述以第一时间为周期,向管理器发送第一SNMP注册请求消息包括:以第一时间为周期,向管理器发送第一扩展SNMP注册请求消息;所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;所述接收所述管理器发送的第一SNMP注册响应消息包括:接收所述管理器发送的第一扩展SNMP注册响应消息;所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;所述在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息包括:在接收到所述第一扩展SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二扩展SNMP注册请求消息;所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息;所述接收所述管理器发送的第二SNMP注册响应消息包括:接收所述管理器发送的第二扩展SNMP注册响应消息。With reference to the first aspect or any of the first to third possible implementations of the first aspect, in a fourth possible implementation of the first aspect, the first SNMP registration request message includes: a first simple network The management protocol extends the SNMP registration request message; the first SNMP registration request message is sent to the manager by taking the first time as a cycle: sending the first extended SNMP registration request message to the manager by taking the first time as a cycle; The first SNMP registration response message includes: a first extended SNMP registration response message; the receiving the first SNMP registration response message sent by the manager includes: receiving the first extended SNMP registration response message sent by the manager; the The second SNMP registration request message includes: a second extended SNMP registration request message; after receiving the first SNMP registration response message, sending the second SNMP registration request message to the manager with a second time period Including: after receiving the first extended SNMP registration response message, sending a second extended SNMP registration request message to the manager at a second time period; the second SNMP registration response message includes: a second extended An SNMP registration response message: receiving the second SNMP registration response message sent by the manager includes: receiving a second extended SNMP registration response message sent by the manager.

结合第一方面或第一方面的第一至第三任一种可能的实现方式,在第一方面的第五种可能的实现方式中,所述第一SNMP注册请求消息包括:第一简单网络管理协议陷阱SNMP Trap消息;所述以第一时间为周期,向管理器发送第一注册请求消包括:以第一时间为周期,向所述管理器发送所述第一SNMP Trap消息;其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息;所述第一SNMP注册响应消息包括:第一SNMP inform消息;所述接收所述管理器发送的第一SNMP注册响应消息包括:接收所述管理器发送的第一SNMPinform消息;所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息包括:在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP Trap消息;其中,所述第二SNMP Trap消息中携带有终端设备的设备参数信息;所述第二SNMP注册响应消息包括:第二SNMP inform消息;所述接收所述管理器发送的第二SNMP注册响应消息包括:接收所述管理器发送的第二SNMP inform消息。With reference to the first aspect or any of the first to third possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the first SNMP registration request message includes: a first simple network The management protocol traps an SNMP Trap message; the sending of the first registration request message to the manager with the first time as a period includes: sending the first SNMP Trap message to the manager with the first time as a period; wherein, The first SNMP Trap message carries device parameter information of the terminal device; the first SNMP registration response message includes: a first SNMP inform message; the receiving the first SNMP registration response message sent by the manager includes: receiving the first SNMP inform message sent by the manager; the second SNMP registration request message includes: a second SNMP Trap message; after receiving the first SNMP registration response message, taking the second time as a cycle, Sending a second SNMP registration request message to the manager includes: after receiving the first SNMP registration response message, sending a second SNMP Trap message to the manager with a second period of time; wherein, the The second SNMP Trap message carries device parameter information of the terminal device; the second SNMP registration response message includes: a second SNMP inform message; the receiving the second SNMP registration response message sent by the manager includes: receiving the The second SNMP inform message sent by the manager.

结合第一方面的第五种可能的实现方式,在第一方面的第六种可能的实现方式中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。With reference to the fifth possible implementation of the first aspect, in the sixth possible implementation of the first aspect, the device parameter information of the terminal device carried in the first SNMP Trap message includes: the first SNMP A new Trap type is added to identify the device parameter information of the terminal device in the Trap message; the device parameter information of the terminal device carried in the second SNMP Trap message includes: a new Trap is added in the second SNMP Trap message The type identifies device parameter information of the terminal device.

第二方面,本发明实施例提供了一种发现设备的方法,包括:接收终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;若确定未注册所述终端设备的设备参数信息,则对所述终端设备的设备参数信息进行注册,并向所述终端设备发送第一SNMP注册响应消息。In the second aspect, an embodiment of the present invention provides a method for discovering devices, including: receiving an SNMP registration request message sent by a terminal device; the SNMP registration request message carries device parameter information of the terminal device; the terminal The device parameter information of the device refers to the static information of the terminal device; according to the device parameter information of the terminal device carried in the SNMP registration request message, determine whether the device parameter information of the terminal device has been registered; registering the device parameter information of the terminal device, registering the device parameter information of the terminal device, and sending a first SNMP registration response message to the terminal device.

在第二方面的第一种可能的实现方式中,在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,向所述终端设备发送第二SNMP注册响应消息;在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并向所述终端设备发送第二SNMP注册响应消息。In the first possible implementation manner of the second aspect, when it is determined that the device parameter information of the terminal device has been registered, the registered device parameter information of the terminal device and the first SNMP registration request message are detected Whether the device parameter information of the terminal device carried in the SNMP registration request information is the same; when it is detected that the device parameter information of the registered terminal device is completely the same as the device parameter information of the terminal device carried in the SNMP registration request information Next, send a second SNMP registration response message to the terminal device; if it is detected that the device parameter information of the registered terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information In this case, update the registered device parameter information of the terminal device according to the device parameter information of the terminal device in the SNMP registration request information; and send a second SNMP registration response message to the terminal device.

结合第二方面或第二方面的第一种可能的实现方式,在第二方面的第二种可能的实现方式中,所述注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息;所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息;所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息。With reference to the second aspect or the first possible implementation of the second aspect, in the second possible implementation of the second aspect, the registration request message includes: a first SNMP registration request message or a second SNMP registration request message; the first SNMP registration request message is the SNMP registration request message sent by the terminal device to the manager with the first time period; the second SNMP registration request message is the terminal device with the second time period Periodic, SNMP registration request message sent to the manager.

结合第二方面的第二种可能的实现方式,在第二方面的第三种可能的实现方式中,在所述SNMP注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息;在所述SNMP注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。With reference to the second possible implementation of the second aspect, in the third possible implementation of the second aspect, when the SNMP registration request message includes: a first SNMP registration request message, the first SNMP registration The request message includes: the first extended SNMP registration request message; in the case where the SNMP registration request message includes: the second SNMP registration request message, the second SNMP registration request message includes: the second extended SNMP registration request message; In the case where it is determined that the device parameter information of the terminal device has not been registered, the first SNMP registration response message includes: a first extended SNMP registration response message; when it is determined that the device parameter information of the terminal device has been registered In the case of , the second SNMP registration response message includes: a second extended SNMP registration response message.

结合第二方面的第二种可能的实现方式,在第二方面的第四种可能的实现方式中,在所述SNMP注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一SNMP Trap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;在所述SNMP注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一SNMP inform消息;在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二SNMP inform消息。With reference to the second possible implementation of the second aspect, in the fourth possible implementation of the second aspect, when the SNMP registration request message includes: a first SNMP registration request message, the first SNMP registration The request message includes: a first SNMP Trap message; the device parameter information of the terminal device is carried in the first SNMP Trap message; when the SNMP registration request message includes: a second SNMP registration request message, the second The SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries device parameter information of the terminal device; in the case where it is determined that the device parameter information of the terminal device is not registered, the first An SNMP registration response message includes: a first SNMP inform message; in the case that it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second SNMP inform message.

结合第二方面的第四种可能的实现方式,在第二方面的第五种可能的实现方式中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第一SNMPTrap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。With reference to the fourth possible implementation of the second aspect, in a fifth possible implementation of the second aspect, the device parameter information of the terminal device carried in the first SNMP Trap message includes: In the SNMPTrap message, a new Trap type is added to identify the device parameter information of the terminal device; the device parameter information of the terminal device carried in the second SNMP Trap message includes: in the second SNMP Trap message, a new The trap type identifies device parameter information of the terminal device.

第三方面,本发明实施例它提供了一种终端设备,包括:控制单元,发送单元,接收单元;所述控制单元,用于在所述接收单元在接收到所述第一SNMP注册响应消息之前,触发所述发送单元以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述发送单元,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;所述接收单元,用于接收从所述管理器发送来的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息;所述控制单元,还用于在所述接收单元在接收到所述第一SNMP注册响应消息之后,触发所述发送单元以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述发送单元,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述接收单元,还用于接收所述管理器发送的第二SNMP注册响应消息;所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。In the third aspect, the embodiment of the present invention provides a terminal device, including: a control unit, a sending unit, and a receiving unit; the control unit is configured to receive the first SNMP registration response message when the receiving unit receives the first SNMP registration response message Before, triggering the sending unit to send the first SNMP registration request message to the manager with the first time as a cycle; the sending unit is used to send the first SNMP registration request message to the manager with the first time as a cycle; The first SNMP registration request message carries device parameter information of the terminal device; the device parameter information of the terminal device refers to static information of the terminal device; the receiving unit is configured to receive The first SNMP registration response message sent by the manager; the first SNMP registration response message is the first received SNMP registration response message sent by the manager; the control unit is also used in the receiving unit After receiving the first SNMP registration response message, the sending unit is triggered to take the second time as a period to send a second SNMP registration request message to the manager; the sending unit is also used to take the second time as a period , sending a second SNMP registration request message to the manager; the second SNMP registration request message carries the device parameter information of the terminal device; the receiving unit is also used to receive the second SNMP message sent by the manager A registration response message; the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message.

在第三方面的第一种可能的实现方式中,所述控制单元,还用于配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。In a first possible implementation manner of the third aspect, the control unit is further configured to configure interface parameters with the manager; the interface parameters are used to establish a connection with the manager.

结合第三方面或第三方面的第一种可能的实现方式,在第三方面的第二种可能的实现方式中,所述第一时间的值小于所述第二时间的值。With reference to the third aspect or the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the value of the first time is smaller than the value of the second time.

结合第三方面或第三方面的第一至第二种可能实现的方式,在第三方面的第三种可能的实现方式中,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。With reference to the third aspect or the first to second possible implementation manners of the third aspect, in the third possible implementation manner of the third aspect, the second SNMP registration request message carries the The device parameter information includes: when the terminal device updates the device parameter information, the updated device parameter information of the terminal device is carried in the second SNMP registration request message.

结合第三方面或第三方面的第一至第三种可能实现的方式,在第三方面的第四种可能的实现方式中,所述第一SNMP注册请求消息包括:第一简单网络管理协议扩展SNMP注册请求消息;所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。In combination with the third aspect or the first to third possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, the first SNMP registration request message includes: a first simple network management protocol The extended SNMP registration request message; the first SNMP registration response message includes: the first extended SNMP registration response message; the second SNMP registration request message includes: the second extended SNMP registration request message; the second SNMP registration response message Including: the second extended SNMP registration response message.

结合第三方面或第三方面的第一至第三种可能实现的方式,在第三方面的第五种可能的实现方式中,所述第一SNMP注册请求消息包括:第一简单网络管理协议陷阱SNMPTrap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;所述第一SNMP注册响应消息包括:第一SNMPinform消息;所述第二SNMP注册响应消息包括:第二SNMP inform消息;In combination with the third aspect or the first to third possible implementation manners of the third aspect, in a fifth possible implementation manner of the third aspect, the first SNMP registration request message includes: a first simple network management protocol Trap SNMPTrap message; the first SNMP Trap message carries device parameter information of the terminal device; the second SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries the terminal device's Device parameter information; the first SNMP registration response message includes: a first SNMP inform message; the second SNMP registration response message includes: a second SNMP inform message;

结合第三方面的第五种可能实现的方式,在第三方面的第六种可能的实现方式中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。With reference to the fifth possible implementation of the third aspect, in the sixth possible implementation of the third aspect, the device parameter information of the terminal device carried in the first SNMP Trap message includes: the first SNMP A new Trap type is added to identify the device parameter information of the terminal device in the Trap message; the device parameter information of the terminal device carried in the second SNMP Trap message includes: a new Trap is added in the second SNMP Trap message The type identifies device parameter information of the terminal device.

第四方面,本发明实施例提供了一种管理器,包括:接收单元,用于接收从终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有终端设备的设备参数信息;所述设备参数信息是指所述终端设备的静态信息;处理单元,用于根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;所述处理单元,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册;并触发发送单元向所述终端设备发送第一SNMP注册响应消息;所述发送单元,用于向所述终端设备发送第一SNMP注册响应消息。In a fourth aspect, an embodiment of the present invention provides a manager, including: a receiving unit configured to receive an SNMP registration request message sent from a terminal device; the SNMP registration request message carries device parameter information of the terminal device; The device parameter information refers to the static information of the terminal device; the processing unit is configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message The processing unit is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered; and trigger the sending unit to send the first SNMP to the terminal device A registration response message; the sending unit is configured to send a first SNMP registration response message to the terminal device.

在第四方面的第一种可能的实现方式中,所述处理单元,还用于在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;所述处理单元,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;所述处理单元,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;所述发送单元,还用于向所述终端设备发送第二SNMP注册响应消息。In a first possible implementation manner of the fourth aspect, the processing unit is further configured to, when it is determined that the device parameter information of the terminal device has been registered, detect the difference between the registered device parameter information of the terminal device and whether the device parameter information of the terminal device carried in the first SNMP registration request message is the same; When the device parameter information of the terminal device carried in the information is completely the same, the sending unit is triggered to send a second SNMP registration response message to the terminal device; If the device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the device parameter information of the terminal device in the SNMP registration request information, updating the registered device parameter information of the terminal device; and triggering the sending unit to send a second SNMP registration response message to the terminal device; the sending unit is also used to send a second SNMP registration response message to the terminal device Respond to the message.

结合第四方面或第四方面的第一种可能的实现方式,在第四方面的第二种可能的实现方式中,所述注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息;所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息;所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息。With reference to the fourth aspect or the first possible implementation of the fourth aspect, in the second possible implementation of the fourth aspect, the registration request message includes: a first SNMP registration request message or a second SNMP registration request message; the first SNMP registration request message is the SNMP registration request message sent by the terminal device to the manager with the first time period; the second SNMP registration request message is the terminal device with the second time period Periodic, SNMP registration request message sent to the manager.

结合第四方面的第二种可能的实现方式,在第四方面的第三种可能实现的方式中,在所述SNMP注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息;在所述SNMP注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。With reference to the second possible implementation of the fourth aspect, in the third possible implementation of the fourth aspect, when the SNMP registration request message includes: a first SNMP registration request message, the first SNMP registration The request message includes: the first extended SNMP registration request message; in the case where the SNMP registration request message includes: the second SNMP registration request message, the second SNMP registration request message includes: the second extended SNMP registration request message; In the case where it is determined that the device parameter information of the terminal device has not been registered, the first SNMP registration response message includes: a first extended SNMP registration response message; when it is determined that the device parameter information of the terminal device has been registered In the case of , the second SNMP registration response message includes: a second extended SNMP registration response message.

结合第四方面的第二种可能的实现方式,在第四方面的第四种可能实现的方式中,在所述SNMP注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一SNMP Trap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;在所述SNMP注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一SNMP inform消息;在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二SNMP inform消息。With reference to the second possible implementation of the fourth aspect, in the fourth possible implementation of the fourth aspect, when the SNMP registration request message includes: a first SNMP registration request message, the first SNMP registration The request message includes: a first SNMP Trap message; the device parameter information of the terminal device is carried in the first SNMP Trap message; when the SNMP registration request message includes: a second SNMP registration request message, the second The SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries device parameter information of the terminal device; in the case where it is determined that the device parameter information of the terminal device is not registered, the first An SNMP registration response message includes: a first SNMP inform message; in the case that it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second SNMP inform message.

结合第四方面的第四种可能的实现方式,在第四方面的第五种可能实现的方式中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第一SNMPTrap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。With reference to the fourth possible implementation of the fourth aspect, in the fifth possible implementation of the fourth aspect, the device parameter information of the terminal device carried in the first SNMP Trap message includes: In the SNMPTrap message, a new Trap type is added to identify the device parameter information of the terminal device; the device parameter information of the terminal device carried in the second SNMP Trap message includes: in the second SNMP Trap message, a new The trap type identifies device parameter information of the terminal device.

第五方面,本发明实施例提供了一种终端设备,包括:处理器,发送器,接收器;所述处理器,用于在所述接收器在接收到所述第一SNMP注册响应消息之前,触发所述发送器以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述发送器,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;所述接收器,用于接收从所述管理器发送来的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息;所述处理器,还用于在所述接收器在接收到所述第一SNMP注册响应消息之后,触发所述发送器以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述发送器,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述接收器,还用于接收所述管理器发送的第二SNMP注册响应消息;所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。In a fifth aspect, an embodiment of the present invention provides a terminal device, including: a processor, a transmitter, and a receiver; the processor is configured to, before the receiver receives the first SNMP registration response message, , triggering the sender to send the first SNMP registration request message to the manager with the first time as the cycle; the sender is used to send the first SNMP registration request message to the manager with the first time as the cycle; The device parameter information of the terminal device is carried in the first SNMP registration request message; the device parameter information of the terminal device refers to the static information of the terminal device; the receiver is used to receive the information from the manager The first SNMP registration response message sent; the first SNMP registration response message is the first received SNMP registration response message sent by the manager; After receiving the first SNMP registration response message, trigger the sender to send a second SNMP registration request message to the manager with the second time as the cycle; the sender is also used to take the second time as the cycle, Send a second SNMP registration request message to the manager; the second SNMP registration request message carries the device parameter information of the terminal device; the receiver is also used to receive the second SNMP registration message sent by the manager A response message; the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message.

在第五方面的第一种可能实现的方式中,所述处理器,还用于配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。In a first possible implementation manner of the fifth aspect, the processor is further configured to configure interface parameters with the manager; the interface parameters are used to establish a connection with the manager.

第六方面,本发明实施例提供了一种管理器,包括:接收器,用于接收从终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有终端设备的设备参数信息;所述设备参数信息是指所述终端设备的静态信息;处理器,用于根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;所述处理器,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册;并触发发送器向所述终端设备发送第一SNMP注册响应消息;所述发送器,用于向所述终端设备发送第一SNMP注册响应消息。In a sixth aspect, an embodiment of the present invention provides a manager, including: a receiver configured to receive an SNMP registration request message sent from a terminal device; the SNMP registration request message carries device parameter information of the terminal device; The device parameter information refers to static information of the terminal device; a processor configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message ; The processor is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered; and trigger the sender to send the first SNMP to the terminal device A registration response message; the sender is configured to send a first SNMP registration response message to the terminal device.

在第六方面的第一种可能的实现方式中,所述处理器,还用于时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;所述处理器,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;所述处理器,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;所述发送器,还用于向所述终端设备发送第二SNMP注册响应消息。In a first possible implementation manner of the sixth aspect, the processor is further configured to detect the registered device parameter information of the terminal device and all information carried in the first SNMP registration request message. Whether the device parameter information of the terminal device is the same; the processor is further configured to detect that the registered device parameter information of the terminal device is completely consistent with the device parameter information of the terminal device carried in the SNMP registration request information In the same situation, the sending unit is triggered to send a second SNMP registration response message to the terminal device; the processor is also configured to detect that the registered device parameter information of the terminal device is consistent with the SNMP registration request When the device parameter information of the terminal device carried in the information is not completely the same, update the registered device parameter information of the terminal device according to the device parameter information of the terminal device in the SNMP registration request information; And trigger the sending unit to send a second SNMP registration response message to the terminal device; the sender is further configured to send a second SNMP registration response message to the terminal device.

第七方面,本发明实施例提供了一种发现设备的系统,包括:终端设备,管理器;所述终端设备为上述实施例中所述的终端设备;所述管理器为上述实施例中所述的管理器。In a seventh aspect, an embodiment of the present invention provides a system for discovering devices, including: a terminal device and a manager; the terminal device is the terminal device described in the above embodiment; the manager is the terminal device described in the above embodiment described manager.

本发明实施例提供了一种发现设备的方法、装置及系统,终端设备以第一时间为周期主动向管理器发送第一SNMP注册响应消息,管理器根据第一SNMP注册响应消息中携带的终端设备的设备信息进行注册或更新,并向终端设备发送第一SNMP注册响应消息,终端设备在接收到第一SNMP注册响应消息后,开始以第二时间为周期,发送第二SNMP注册响应消息,管理器根据第二SNMP注册响应消息中携带的终端设备的设备参数信息可能进行更新,并向终端设备发送第二SNMP注册响应消息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,系统需要长时间才能完成一遍扫描,才能对终端设备的静态信息进行注册或更新的问题,从而提高了系统工作效率。Embodiments of the present invention provide a method, device, and system for discovering devices. The terminal device actively sends the first SNMP registration response message to the manager at the first time period, and the manager sends the first SNMP registration response message according to the terminal The device information of the device is registered or updated, and a first SNMP registration response message is sent to the terminal device. After receiving the first SNMP registration response message, the terminal device starts to send a second SNMP registration response message at a second time period, The manager may update the device parameter information of the terminal device carried in the second SNMP registration response message, and send the second SNMP registration response message to the terminal device, thereby solving the problem that when the range of IP address range of the device managed by the manager is large and the distribution When the number is scattered and the number is large, the system needs a long time to complete a scan to register or update the static information of the terminal equipment, thereby improving the system work efficiency.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the accompanying drawings that are used in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained based on these drawings without creative effort.

图1为本发明实施例提供的一种发现设备的方法的流程示意图;FIG. 1 is a schematic flowchart of a method for discovering devices provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种发现设备的方法的流程示意图;FIG. 2 is a schematic flowchart of another method for discovering devices provided by an embodiment of the present invention;

图3为本发明实施例提供的另一种发现设备的方法的流程示意图;FIG. 3 is a schematic flowchart of another method for discovering devices provided by an embodiment of the present invention;

图4为本发明实施例提供的另一种发现设备的方法的流程示意图;FIG. 4 is a schematic flowchart of another method for discovering devices provided by an embodiment of the present invention;

图5为本发明实施例提供的一种终端设备的功能示意图;FIG. 5 is a functional schematic diagram of a terminal device provided by an embodiment of the present invention;

图6为本发明实施例提供的一种管理器的功能示意图;FIG. 6 is a functional schematic diagram of a manager provided by an embodiment of the present invention;

图7为本发明实施例提供的一种终端设备的结构示意图;FIG. 7 is a schematic structural diagram of a terminal device provided by an embodiment of the present invention;

图8为本发明实施例提供的一种管理器的结构示意图;FIG. 8 is a schematic structural diagram of a manager provided by an embodiment of the present invention;

图9为本发明实施例提供的一种发现设备的系统的结构示意图。FIG. 9 is a schematic structural diagram of a system for discovering devices provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

本发明实施例提供了一种发现设备的方法,如图1所示,包括:An embodiment of the present invention provides a method for discovering devices, as shown in FIG. 1 , including:

101、以第一时间为周期,向管理器发送第一SNMP(Simple NetworkManagementProtocol,简单网络管理协议)注册请求消息。101. Taking the first time as a period, send a first SNMP (Simple Network Management Protocol, Simple Network Management Protocol) registration request message to the manager.

其中,所述第一SNMP注册请求消息中携带有终端设备的设备参数信息,所述终端设备的设备参数信息是指所述终端设备的静态信息。Wherein, the first SNMP registration request message carries device parameter information of the terminal device, and the device parameter information of the terminal device refers to static information of the terminal device.

具体的,在终端设备与管理器之间建立了的通信信道后,终端设备以预设的第一时间为周期,主动向管理器发送第一SNMP注册请求消息,以使得管理器对终端设备进行注册。Specifically, after the communication channel is established between the terminal device and the manager, the terminal device actively sends the first SNMP registration request message to the manager with the preset first time as a period, so that the manager can register the terminal device. register.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

需要说明的是,第一时间可以预先设置,可以将第一时间设置为15秒,也可以将第一时间设置为20秒,还可以将第一时间设置为其他时间,本发明对此不作限制。It should be noted that the first time can be set in advance, the first time can be set to 15 seconds, the first time can also be set to 20 seconds, and the first time can also be set to other times, which is not limited by the present invention .

进一步的,终端设备向管理器发送第一SNMP注册请求消息可以有两种实现方式。Further, there may be two implementation manners for the terminal device to send the first SNMP registration request message to the manager.

第一实现方式,终端设备向管理器发送第一扩展SNMP注册请求消息。In a first implementation manner, the terminal device sends a first extended SNMP registration request message to the manager.

需要说明的是,第一扩展SNMP注册请求消息在已有的SNMP协议中增加了一种用于请求注册终端设备的设备参数信息的消息。It should be noted that the first extended SNMP registration request message adds a message for requesting registration of device parameter information of the terminal device in the existing SNMP protocol.

第二实现方式,终端设备在第一SNMP Trap消息中增加新的Trap类型标识所述终端设备的设备参数信息。此时,终端设备可以向管理器发送所述第一SNMP Trap(SimpleNetwork Management ProtocolTrap,简单网络管理协议陷阱)消息。也就是说,终端设备可以利用已有的消息,在已有消息中添加或标识出终端设备的设备参数信息,并将此已有消息发送至管理器。In a second implementation manner, the terminal device adds a new Trap type to identify device parameter information of the terminal device in the first SNMP Trap message. At this time, the terminal device may send the first SNMP Trap (SimpleNetwork Management Protocol Trap, Simple Network Management Protocol Trap) message to the manager. That is to say, the terminal device can use the existing message, add or identify the device parameter information of the terminal device in the existing message, and send the existing message to the manager.

示例性的,目前SNMP协议中SNMP Trap消息已定义了七种Trap号,Trap号分别为0-6。其中,Trap号为0时,对应的消息类型为coldstart(冷启动),表示agent(代理器)重启,所有的管理变量将被重新设置,counters(计数器)和gauges(计量表)将被清零;Trap号为1时,对应的消息类型为warmstart(热启动),表示自行启动,所有的管理变量不会初始化;Trap号为2时,对应的消息类型为linkdown(通信链路失败),表示设备的接口变为down(失败)状态,和端口对应的编号用于标示具体端口;Trap号为3时,对应的消息类型为linkup(通信链路恢复),表示当接口变为up状态的时候,和端口对应的编号用于标示具体端口;Trap号为4时,对应的消息类型为authenticationfailure(授权失败),表示如果有人试图用一个错误的community(团体名)查询agent,将触发该trap;Trap号为5时,对应的消息类型为egpneighborloss(EGP邻居丢失),表示EGP的邻居状态变为down;Trap号为6时,对应的消息类型为enterprisespecific(企业自定义),此类型为企业自定义的trap,SNMP的厂商和用户可以在私有的enterprise(企业)分支下定义其自身的trap。除上述对Trap号的已有定义之外,可以增加一个新的Trap号标识所述终端设备的设备参数信息。假设定义新的Trap号为8,则在Trap为8时,对应的消息类型为注册请求消息,表示终端设备的设备参数信息。Exemplarily, seven kinds of trap numbers have been defined in the SNMP Trap message in the SNMP protocol at present, and the trap numbers are 0-6 respectively. Among them, when the Trap number is 0, the corresponding message type is coldstart (cold start), which means that the agent (agent) restarts, all management variables will be reset, and counters (counters) and gauges (meters) will be cleared ; When the trap number is 1, the corresponding message type is warmstart (warm start), which means that it starts automatically, and all management variables will not be initialized; when the trap number is 2, the corresponding message type is linkdown (communication link failure), which means The interface of the device becomes down (failed), and the number corresponding to the port is used to mark the specific port; when the Trap number is 3, the corresponding message type is linkup (communication link recovery), indicating that when the interface becomes up , the number corresponding to the port is used to mark the specific port; when the trap number is 4, the corresponding message type is authentication failure (authorization failure), which means that if someone tries to query the agent with a wrong community (community name), the trap will be triggered; When the Trap number is 5, the corresponding message type is egpneighborloss (EGP neighbor loss), indicating that the EGP neighbor status has become down; when the Trap number is 6, the corresponding message type is enterprisespecific (enterprise-defined), this type is enterprise Defined traps, SNMP manufacturers and users can define their own traps under the private enterprise (enterprise) branch. In addition to the above existing definition of the Trap number, a new Trap number may be added to identify the device parameter information of the terminal device. Assuming that the new trap number is defined as 8, when the trap number is 8, the corresponding message type is a registration request message, which indicates the device parameter information of the terminal device.

需要说明的是,终端设备以第一时间为周期,向管理器发送第一SNMP注册请求消息时,终端设备未接收到管理器返回的SNMP注册响应消息。It should be noted that, when the terminal device sends the first SNMP registration request message to the manager at the first time period, the terminal device does not receive the SNMP registration response message returned by the manager.

示例性的,假设第一时间为15秒,则终端设备向管理器发送了第一个第一SNMP注册请求消息后,经过15秒后,终端设备未接收到管理器返回的SNMP注册响应消息,则终端设备接着向管理器发送第二个第一SNMP注册请求消息。Exemplarily, assuming that the first time is 15 seconds, after the terminal device sends the first first SNMP registration request message to the manager, after 15 seconds, the terminal device does not receive the SNMP registration response message returned by the manager, Then the terminal device then sends the second first SNMP registration request message to the manager.

102、接收所述管理器发送的第一SNMP注册响应消息。102. Receive a first SNMP registration response message sent by the manager.

其中,所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息。Wherein, the first SNMP registration response message is the first received SNMP registration response message sent by the manager.

具体的,在步骤101中,若终端设备向管理器发送的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则终端设备接收管理器发送的第一SNMP注册响应消息可以包括终端设备接收管理器发送的第一扩展SNMP注册响应消息。Specifically, in step 101, if the first SNMP registration request message sent by the terminal device to the manager is the first extended SNMP registration request message, the terminal device may receive the first SNMP registration response message sent by the manager. Receive the first extended SNMP registration response message sent by the manager.

若终端设备向管理器发送的第一SNMP注册请求消息为第一SNMP Trap消息时,终端管理器接收到的第一SNMP注册响应消息可以是SNMP inform(信息)。If the first SNMP registration request message sent by the terminal device to the manager is a first SNMP Trap message, the first SNMP registration response message received by the terminal manager may be SNMP inform (information).

103、在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息。103. After receiving the first SNMP registration response message, send a second SNMP registration request message to the manager with a second time period as a period.

其中,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息。Wherein, the second SNMP registration request message carries device parameter information of the terminal device.

具体的,终端设备在没有接收到第一SNMP注册响应消息前,终端设备可以以第一时间为周期,向管理器发送第一SNMP注册请求消息,在终端设备在第一次接收到SNMP注册响应消息后,即为接收到第一SNMP注册响应消息后,终端设备以第二时间为周期,向管理器发送第二SNMP注册请求消息。Specifically, before the terminal device receives the first SNMP registration response message, the terminal device may send the first SNMP registration request message to the manager at the first time period, and when the terminal device receives the SNMP registration response message for the first time After the message, that is, after receiving the first SNMP registration response message, the terminal device sends the second SNMP registration request message to the manager at the second time period.

也就是说,终端设备在接收到第一SNMP注册响应消息后,可以改变发送SNMP注册请求消息的周期,向管理器发送SNMP注册请求消息。That is to say, after receiving the first SNMP registration response message, the terminal device may change the period of sending the SNMP registration request message, and send the SNMP registration request message to the manager.

优选的,所述第一时间的值小于所述第二时间的值。Preferably, the value of the first time is smaller than the value of the second time.

此时,终端设备在以第一时间为周期向管理器发送第一SNMP注册请求消息后,在接收到第一SNMP注册响应消息时,更改为以第二时间为周期向管理器发送第二SNMP注册请求消息。这样,由于第二时间的值大于第一时间的值,可以自动降低发送第二SNMP注册响应消息的频率。At this time, after the terminal device sends the first SNMP registration request message to the manager at the first time period, when it receives the first SNMP registration response message, it changes to send the second SNMP registration request message to the manager at the second time period. Register request message. In this way, since the value of the second time is greater than the value of the first time, the frequency of sending the second SNMP registration response message may be automatically reduced.

示例性的,假设第一时间为15秒,第二时间为60秒。终端设备在以15秒为周期向管理器发送了3个第一SNMP注册请求消息,第一次接收到管理器发送的SNMP注册响应消息,即为接收到第一SNMP注册响应消息后,终端设备以60秒为周期,向管理器发送第二SNMP注册响应消息。Exemplarily, it is assumed that the first time is 15 seconds, and the second time is 60 seconds. The terminal device sends 3 first SNMP registration request messages to the manager at a period of 15 seconds, and receives the SNMP registration response message sent by the manager for the first time, that is, after receiving the first SNMP registration response message, the terminal device The second SNMP registration response message is sent to the manager at a period of 60 seconds.

进一步的,终端设备以第二时间为周期向管理器发送的第二SNMP注册请求消息与终端设备以第一时间为周期向管理器发送的第一SNMP注册请求消息可能相同,也可能不相同。Further, the second SNMP registration request message sent by the terminal device to the manager at the second time period may be the same as or different from the first SNMP registration request message sent to the manager by the terminal device at the first time period.

需要说明的是,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。It should be noted that the device parameter information of the terminal device carried in the second SNMP registration request message includes: when the terminal device updates the device parameter information, the second SNMP registration request message carries all The updated device parameter information of the terminal device.

具体的,由于第二SNMP注册请求消息与第一SNMP注册请求消息中均携带有终端设备的设备参数信息,所以,在终端设备在接收到第一SNMP注册响应消息后,当终端设备的设备参数信息没有发生改变时,所述第二SNMP注册请求消息与第一SNMP注册请求消息相同。Specifically, since both the second SNMP registration request message and the first SNMP registration request message carry the device parameter information of the terminal device, after the terminal device receives the first SNMP registration response message, when the device parameter information of the terminal device When the information does not change, the second SNMP registration request message is the same as the first SNMP registration request message.

当终端设备的设备参数信息发生改变时,由于第二SNMP注册请求消息中携带的终端设备的设备参数信息为更新后的设备参数信息,所以所述第二SNMP注册请求消息与第一SNMP注册请求消息不相同,此时,管理器需要以第二SNMP注册请求消息中携带的设备参数信息为准,对存储的终端设备的设备参数信息予以更新。When the device parameter information of the terminal device changes, since the device parameter information of the terminal device carried in the second SNMP registration request message is the updated device parameter information, the second SNMP registration request message is the same as the first SNMP registration request message. The messages are different. At this time, the manager needs to update the stored device parameter information of the terminal device based on the device parameter information carried in the second SNMP registration request message.

示例性的,假设设备参数信息中包括IP地址信息,若终端设备在接收到第一SNMP注册响应消息后,IP地址信息发生改变,则终端设备的设备参数信息发生改变,即为更新终端设备的设备参数信息,此时,第二SNMP注册请求消息中携带了更新后的设备参数信息。终端设备将第二SNMP注册请求消息发送至管理器。此时,第一SNMP注册请求消息与第二SNMP注册请求消息不相同。Exemplarily, assuming that the device parameter information includes IP address information, if the IP address information of the terminal device changes after receiving the first SNMP registration response message, the device parameter information of the terminal device changes, that is, update the terminal device's Device parameter information. In this case, the updated device parameter information is carried in the second SNMP registration request message. The terminal device sends the second SNMP registration request message to the manager. At this time, the first SNMP registration request message is different from the second SNMP registration request message.

需要说明的是,第二时间可以预先设定,可以将第二时间设置为45秒,也可以将第二时间设置为60秒,还可以将第二时间设置为其他与第一时间相对应的时间,本发明对此不作限制。It should be noted that the second time can be set in advance, the second time can be set to 45 seconds, the second time can also be set to 60 seconds, and the second time can also be set to other time corresponding to the first time. Time, the present invention is not limited to this.

进一步的,终端设备向管理器发送第二SNMP注册请求消息可以有两种实现方式。Further, there may be two implementation manners for the terminal device to send the second SNMP registration request message to the manager.

具体的可以参考101中终端设备向管理器发送第一SNMP注册请求消息的实现方式,在此不再赘述。For details, reference may be made to the implementation manner in which the terminal device sends the first SNMP registration request message to the manager in step 101, which will not be repeated here.

104、接收所述管理器发送的第二SNMP注册响应消息。104. Receive a second SNMP registration response message sent by the manager.

其中,所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。Wherein, the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message.

需要说明的是,终端设备在接收到第一SNMP注册响应消息后,接收的其他所以注册响应消息均为第二SNMP注册响应消息。It should be noted that after the terminal device receives the first SNMP registration response message, all other registration response messages it receives are second SNMP registration response messages.

具体的,终端设备接收的第二SNMP注册响应消息可以是,在终端设备以第一时间为周期,向管理器发送第一SNMP注册请求消息时,管理器接收到第一SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。Specifically, the second SNMP registration response message received by the terminal device may be that when the terminal device sends the first SNMP registration request message to the manager with the first time as a period, after the manager receives the first SNMP registration request message, The SNMP registration response message returned to the terminal device.

示例性的,假设第一时间为15秒,第二时间为60秒。终端设备以15秒为周期,向管理器发送第一SNMP注册请求消息。若在终端设备发送了第一个第一SNMP注册请求消息后,经过15秒后,未接收到第一SNMP注册响应消息,则终端设备接收向管理器发送第二个第一SNMP注册请求消息。若此时,终端设备接收到第一SNMP注册响应消息。管理器在发送完第一SNMP注册响应消息后,接收到终端设备发送的第二个第一SNMP注册请求消息,则向终端设备返回注册响应消息。此时,终端设备接收到的SNMP注册响应消息为第二SNMP注册响应消息。Exemplarily, it is assumed that the first time is 15 seconds, and the second time is 60 seconds. The terminal device sends a first SNMP registration request message to the manager at a period of 15 seconds. If the terminal device does not receive the first SNMP registration response message after 15 seconds after sending the first first SNMP registration request message, the terminal device receives and sends the second first SNMP registration request message to the manager. If at this time, the terminal device receives the first SNMP registration response message. After sending the first SNMP registration response message, the manager receives the second first SNMP registration request message sent by the terminal device, and returns a registration response message to the terminal device. At this time, the SNMP registration response message received by the terminal device is the second SNMP registration response message.

终端设备接收的第二SNMP注册响应消息也可以是,在终端设备以第二时间为周期,向管理器发送第二SNMP注册请求消息时,管理器接收到第二SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。The second SNMP registration response message received by the terminal device may also be that when the terminal device sends the second SNMP registration request message to the manager with the second time as a cycle, the manager sends the message to the terminal after receiving the second SNMP registration request message. The SNMP registration response message returned by the device.

具体的,在步骤101中,若终端设备向管理器发送的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,或者在步骤103中,若终端设备向管理器发送的第二SNMP注册请求消息为第二扩展SNMP注册请求消息时,则终端设备接收管理器发送的第二SNMP注册响应消息可以包括终端设备接收管理器发送的第二扩展SNMP注册响应消息。Specifically, in step 101, if the first SNMP registration request message sent by the terminal device to the manager is the first extended SNMP registration request message, or in step 103, if the second SNMP registration request message sent by the terminal device to the manager is When the request message is the second extended SNMP registration request message, the second SNMP registration response message sent by the terminal device reception manager may include the second extended SNMP registration response message sent by the terminal device reception manager.

若终端设备向管理器发送的第一SNMP注册请求消息为第一SNMP Trap消息时,或者,若终端设备向管理器发送的第二SNMP注册请求消息为第二SNMP Trap消息时,则终端设备接收到的第二SNMP注册响应消息可以包括SNMP inform。If the first SNMP registration request message sent by the terminal device to the manager is the first SNMP Trap message, or if the second SNMP registration request message sent by the terminal device to the manager is the second SNMP Trap message, then the terminal device receives The received second SNMP registration response message may include SNMP inform.

需要说明的是,在本发明实施例中,终端设备在未接收到第一SNMP注册响应消息前,以第一时间为周期向管理器发送第一SNMP注册请求消息,在接收到第一SNMP注册响应消息后,以第二时间为周期向管理器发送第二SNMP注册请求消息。终端设备在接收到第二SNMP注册响应消息时,并不改变发送周期,仍以第二时间为周期向管理器发送第二SNMP注册请求消息。It should be noted that, in the embodiment of the present invention, before receiving the first SNMP registration response message, the terminal device sends the first SNMP registration request message to the manager at the first time period, and after receiving the first SNMP registration response message, After the response message, a second SNMP registration request message is sent to the manager at a second time period. When receiving the second SNMP registration response message, the terminal device does not change the sending period, but still sends the second SNMP registration request message to the manager at the second time period.

本发明实施例提供了一种发现设备的方法,终端设备在建立了与管理器之间的通信信道后,开始以第一时间为周期发送第一SNMP注册请求消息,当终端设备接收到管理器发送的第一SNMP注册响应消息后,就以第二时间为周期,向管理器发送第二SNMP注册响应消息,并接收第二SNMP注册响应消息。这样,终端设备可以自动将设备参数信息发送至管理器,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。并且,若终端设备的设备参数信息有更新时,终端设备可以及时将更新后的设备参数信息发送至管理器,从而使得管理器能够及时更新终端设备的设备参数信息,进一步提高了系统的工作效率。The embodiment of the present invention provides a method for discovering devices. After the terminal device establishes a communication channel with the manager, it starts to send the first SNMP registration request message at the first time period. When the terminal device receives the After the first SNMP registration response message is sent, the second SNMP registration response message is sent to the manager at the second time period, and the second SNMP registration response message is received. In this way, the terminal device can automatically send the device parameter information to the manager without the need for the manager to scan to obtain the device parameter information of the terminal device, thereby solving the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system. Moreover, if the device parameter information of the terminal device is updated, the terminal device can send the updated device parameter information to the manager in time, so that the manager can update the device parameter information of the terminal device in time, further improving the working efficiency of the system .

本发明实施例提供了一种发现设备的方法,如图2所示,包括:An embodiment of the present invention provides a method for discovering devices, as shown in FIG. 2 , including:

201、接收终端设备发送的SNMP注册请求消息。201. Receive an SNMP registration request message sent by a terminal device.

其中,所述SNMP注册请求消息中携带有所述终端设备的设备参数信息,所述终端设备的设备参数信息是指所述终端设备的静态信息。Wherein, the SNMP registration request message carries device parameter information of the terminal device, and the device parameter information of the terminal device refers to static information of the terminal device.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

进一步的,管理器接收的SNMP注册请求消息可以有两种形式。Further, the SNMP registration request message received by the manager may have two forms.

第一种形式为扩展SNMP注册请求消息。The first form is the extended SNMP registration request message.

需要说明的是,第一扩展SNMP注册请求消息在已有的SNMP协议中增加了一种用于请求注册终端设备的设备参数信息的消息。It should be noted that the first extended SNMP registration request message adds a message for requesting registration of device parameter information of the terminal device in the existing SNMP protocol.

第二种形式为SNMP Trap消息。The second form is SNMP Trap message.

其中,SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。也就是说,终端设备利用已有的消息,在已有消息中添加或标识出端设备的设备参数信息,并将此已有消息发送至管理器。Wherein, a new Trap type is added to the SNMP Trap message to identify the device parameter information of the terminal device. That is to say, the terminal device uses the existing message, adds or identifies the device parameter information of the terminal device in the existing message, and sends the existing message to the manager.

进一步的,所述注册请求消息包括第一SNMP注册请求消息或第二SNMP注册请求消息。Further, the registration request message includes a first SNMP registration request message or a second SNMP registration request message.

其中,所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息,所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息。Wherein, the first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager with the first time as a period, and the second SNMP registration request message is an SNMP registration request message sent by the terminal device at a second time period Periodic, SNMP registration request message sent to the manager.

进一步的,在所述注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息。Further, when the registration request message includes: a first SNMP registration request message, the first SNMP registration request message includes: a first extended SNMP registration request message.

在所述注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息。When the registration request message includes: a second SNMP registration request message, the second SNMP registration request message includes: a second extended SNMP registration request message.

或者,在所述注册请求消息包括:第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一SNMP Trap消息。Alternatively, when the registration request message includes: a first SNMP registration request message, the first SNMP registration request message includes: a first SNMP Trap message.

其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the first SNMP Trap message carries device parameter information of the terminal device.

由于,SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息,所以,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第一SNMPTrap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Since a new Trap type is added in the SNMP Trap message to identify the device parameter information of the terminal device, the device parameter information of the terminal device carried in the first SNMP Trap message includes: in the first SNMPTrap message A new Trap type is added to identify the device parameter information of the terminal device.

在所述注册请求消息包括:第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二SNMP Trap消息。In a case where the registration request message includes: a second SNMP registration request message, the second SNMP registration request message includes: a second SNMP Trap message.

其中,所述第二SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the second SNMP Trap message carries device parameter information of the terminal device.

由于,SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息,所以,所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:在所述第二SNMPTrap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Since a new Trap type is added to the SNMP Trap message to identify the device parameter information of the terminal device, the device parameter information of the terminal device carried in the second SNMP Trap message includes: in the second SNMPTrap message A new Trap type is added to identify the device parameter information of the terminal device.

202、根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息。202. Determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message.

具体的,管理器可以把接收到的SNMP注册请求信息中携带的终端设备的设备参数信息与已存储的设备参数信息依次作比对,用来确定发送该注册请求消息的终端设备的设备参数信息是否已经注册过。Specifically, the manager can sequentially compare the device parameter information of the terminal device carried in the received SNMP registration request message with the stored device parameter information to determine the device parameter information of the terminal device sending the registration request message Is it already registered.

203、若确定未注册所述终端设备的设备参数信息,则对所述终端设备的设备参数信息进行注册,并向所述终端设备发送第一SNMP注册响应消息。203. If it is determined that the device parameter information of the terminal device has not been registered, register the device parameter information of the terminal device, and send a first SNMP registration response message to the terminal device.

具体的,如果管理器在将接收到的终端设备的参数信息与管理器中已存储的所有设备参数信息依次做完对比,管理器确定出没有存储该终端设备的设备参数信息,即管理器没有对该终端设备的设备参数信息进行过注册,则管理器将该终端设备的设备参数信息记录下来,即对终端设备的设备参数信息进行注册,在注册完成后,向该终端设备发送第一SNMP注册响应消息。Specifically, if the manager compares the received parameter information of the terminal device with all the device parameter information stored in the manager in turn, the manager determines that no device parameter information of the terminal device is stored, that is, the manager does not If the device parameter information of the terminal device has been registered, the manager will record the device parameter information of the terminal device, that is, register the device parameter information of the terminal device, and send the first SNMP message to the terminal device after the registration is completed. Register response messages.

具体的,在步骤201中,若管理器接收的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则发送的第一SNMP注册响应消息可以包括第一扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第一SNMP Trap消息时,则管理器发送的第一SNMP注册响应消息可以包括SNMP inform消息。Specifically, in step 201, if the first SNMP registration request message received by the manager is the first extended SNMP registration request message, the first SNMP registration response message sent may include the first extended SNMP registration response message. If the first SNMP registration request message received by the manager is a first SNMP Trap message, the first SNMP registration response message sent by the manager may include an SNMP inform message.

本发明实施例提供了一种发现设备的方法,管理器接收终端设备发送的SNMP注册请求消息,并根据所述SNMP注册请求消息中携带的该终端设备的设备参数信息,确定是否已经注册,若还未注册,则进行注册。这样,管理器可以接收终端设备自动发送的设备参数信息,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。The embodiment of the present invention provides a method for discovering devices. The manager receives the SNMP registration request message sent by the terminal device, and determines whether the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message. If Register if not registered yet. In this way, the manager can receive the device parameter information automatically sent by the terminal device, without the need for the manager to scan to obtain the device parameter information of the terminal device, and then solve the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system.

本发明实施例提供了一种发现设备的方法,包括:An embodiment of the present invention provides a method for discovering devices, including:

301、终端设备配置与所述管理器间的接口参数。301. Configure interface parameters between the terminal device and the manager.

其中,所述接口参数用于建立与所述管理器间的连接。Wherein, the interface parameter is used to establish a connection with the manager.

具体的,在终端设备中设置接口参数,这些参数用来建立终端设备与管理器之间的通信信道,该信道用来专供本设备终端与所述管理器之间的通信。该接口参数为管理IP、终端设备的IP地址、端口号以及其它与建立信道需使用的参数。信道建立好之后,管理器与终端设备的所有通信消息都是在该信道上传输的。Specifically, interface parameters are set in the terminal device, and these parameters are used to establish a communication channel between the terminal device and the manager, and the channel is used exclusively for communication between the terminal of the device and the manager. The interface parameters are the management IP, the IP address of the terminal device, the port number, and other parameters needed to establish the channel. After the channel is established, all communication messages between the manager and the terminal equipment are transmitted on the channel.

302、终端设备以第一时间为周期,向管理器发送第一SNMP注册请求消息。管理器接收第一SNMP注册请求消息。302. The terminal device sends a first SNMP registration request message to the manager with the first time as a period. The manager receives a first SNMP registration request message.

其中,所述第一SNMP注册请求消息中携带有终端设备的设备参数信息。所述终端设备的设备参数信息是指所述终端设备的静态信息。所述第一SNMP注册请求消息是终端设备以第一时间为周期发送的注册请求消息。Wherein, the first SNMP registration request message carries device parameter information of the terminal device. The device parameter information of the terminal device refers to static information of the terminal device. The first SNMP registration request message is a registration request message sent periodically by the terminal device at the first time.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

进一步的,终端设备发送的第一SNMP注册请求消息可以有两种形式。Further, the first SNMP registration request message sent by the terminal device may have two forms.

第一种形式为第一扩展SNMP注册请求消息。The first form is the first extended SNMP registration request message.

需要说明的是,第一扩展SNMP注册请求消息在已有的SNMP协议中增加了一种用于请求注册终端设备的设备参数信息的消息。It should be noted that the first extended SNMP registration request message adds a message for requesting registration of device parameter information of the terminal device in the existing SNMP protocol.

第二种形式为第一SNMP Trap消息。The second form is the first SNMP Trap message.

其中,第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。也就是说,终端设备利用已有的消息,在已有消息中添加或标识出终端设备的设备参数信息,并将此已有消息发送至管理器。Wherein, a new Trap type is added to the first SNMP Trap message to identify device parameter information of the terminal device. That is to say, the terminal device uses the existing message, adds or identifies the device parameter information of the terminal device in the existing message, and sends the existing message to the manager.

进一步的,终端设备向管理器发送第一SNMP注册请求消息可参考步骤101,在此不再赘述。管理器接收第一SNMP注册请求消息,可以参考步骤201,在此不再赘述。Further, for the terminal device to send the first SNMP registration request message to the manager, reference may be made to step 101, which will not be repeated here. For the manager receiving the first SNMP registration request message, refer to step 201, which will not be repeated here.

303、管理器根据所述第一SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息。303. The manager determines whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the first SNMP registration request message.

具体的,可参考步骤202,在此不再赘述。For details, reference may be made to step 202, which will not be repeated here.

需要说明的是,管理器根据确认出的结果不同,下面执行的步骤不同。若管理器确定出未注册所述终端设备的设备参数信息,则执行步骤304,308-312,如图3所示。若管理器确定出注册了所述终端的设备参数信息,则执行步骤305-312,如图4所示。It should be noted that the following steps are different depending on the results confirmed by the manager. If the manager determines that the device parameter information of the terminal device has not been registered, steps 304, 308-312 are performed, as shown in FIG. 3 . If the manager determines that the device parameter information of the terminal is registered, steps 305-312 are performed, as shown in FIG. 4 .

304、若管理器确定未注册,则对所述终端设备的设备参数信息进行注册,并向终端设备发送的第一SNMP注册响应消息。304. If the manager determines that it is not registered, register the device parameter information of the terminal device, and send a first SNMP registration response message to the terminal device.

其中,所述第一SNMP注册响应消息是终端设备第一次接收到的所述管理器发送的SNMP注册响应消息。Wherein, the first SNMP registration response message is the SNMP registration response message sent by the manager and received by the terminal device for the first time.

具体的,管理器确定出没有存储该终端设备的设备参数信息时,即为管理器没有注册终端设备的设备参数信息时,管理器可以将接收到的终端设备的设备参数信息存储下来,即对终端设备的设备参数信息进行注册。在注册完成后,向该终端设备发送第一SNMP注册响应消息。可参考步骤203。Specifically, when the manager determines that the device parameter information of the terminal device is not stored, that is, when the manager has not registered the device parameter information of the terminal device, the manager can store the received device parameter information of the terminal device, that is, to The device parameter information of the terminal device is registered. After the registration is completed, a first SNMP registration response message is sent to the terminal device. Reference may be made to step 203 .

进一步的,在步骤302中,若管理器接收的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则发送的第一SNMP注册响应消息可以包括第一扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第一SNMP Trap消息时,则管理器发送的第一SNMP注册响应消息可以包括SNMP inform消息。Further, in step 302, if the first SNMP registration request message received by the manager is the first extended SNMP registration request message, the first SNMP registration response message sent may include the first extended SNMP registration response message. If the first SNMP registration request message received by the manager is a first SNMP Trap message, the first SNMP registration response message sent by the manager may include an SNMP inform message.

需要说明的是,终端设备在接收到管理器发送的第一SNMP注册响应消息时,可以获知管理器将该终端设备的设备参数信息已经成功注册。It should be noted that, when the terminal device receives the first SNMP registration response message sent by the manager, it may know that the manager has successfully registered the device parameter information of the terminal device.

305、管理器在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同。305. When the manager determines that the device parameter information of the terminal device has been registered, detect the registered device parameter information of the terminal device and the device of the terminal device carried in the first SNMP registration request message Whether the parameter information is the same.

具体的,管理器在确定出已经注册了第一SNMP注册请求消息中携带的终端设备的设备参数信息后,需要确定出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息是否相同。此时,管理器可以将第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器中已注册的终端设备的设备参数信息进行比对,从而检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息是否相同。Specifically, after the manager has determined that the device parameter information of the terminal device carried in the first SNMP registration request message has been registered, it needs to determine that the device parameter information of the terminal device carried in the first SNMP registration request message is the same as the device parameter information carried by the manager. Whether the device parameter information of the registered terminal devices is the same. At this time, the manager can compare the device parameter information of the terminal device carried in the first SNMP registration request message with the device parameter information of the terminal device registered in the manager, so as to detect that the terminal device parameter information carried in the first SNMP registration request message Whether the device parameter information of the terminal device is the same as the device parameter information of the terminal device registered by the manager.

需要说明的是,根据检测结果不同,则执行的步骤不同。若检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息相同,则直接执行步骤307。若检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息不同,则执行步骤306。It should be noted that, according to different detection results, different steps are executed. If it is detected that the device parameter information of the terminal device carried in the first SNMP registration request message is the same as the device parameter information of the terminal device registered by the manager, step 307 is directly executed. If it is detected that the device parameter information of the terminal device carried in the first SNMP registration request message is different from the device parameter information of the terminal device registered by the manager, step 306 is executed.

306、管理器在检测出注册的所述终端设备的设备参数信息与所述注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述第一SNMP注册请求消息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息。306. When the manager detects that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the registration request information, according to the first SNMP registration request message, The device parameter information of the terminal device in the device update the registered device parameter information of the terminal device.

具体的,在所述终端设备更新了设备参数信息时,所述第一SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。管理器在接收到该第一SNMP注册请求消息后,检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与已存储的该终端设备的设备参数信息不同时,可以对已存储的终端设备的设备参数信息进行更新。Specifically, when the terminal device updates the device parameter information, the first SNMP registration request message carries the updated device parameter information of the terminal device. After the manager receives the first SNMP registration request message and detects that the device parameter information of the terminal device carried in the first SNMP registration request message is different from the stored device parameter information of the terminal device, the manager may update the stored device parameter information. The device parameter information of the terminal device is updated.

进一步的,管理器可以将已存储的该终端设备的设备参数信息删除,重新存储第一SNMP注册请求消息中携带的终端设备的设备参数信息。Further, the manager may delete the stored device parameter information of the terminal device, and re-store the device parameter information of the terminal device carried in the first SNMP registration request message.

需要说明的是,第一SNMP注册请求消息中携带的终端设备的设备参数信息与已存储的该终端设备的设备参数信息不同时,说明终端设备的设备参数信息已经改变。终端设备可以在终端设备的设备参数信息中新增加该终端设备的设备参数,也可以修改终端设备的设备参数信息中的某些设备参数的信息,当然,还可以是其他修改终端设备的设备参数信息,本发明对此不作限制。It should be noted that when the device parameter information of the terminal device carried in the first SNMP registration request message is different from the stored device parameter information of the terminal device, it means that the device parameter information of the terminal device has changed. The terminal device can add the device parameters of the terminal device to the device parameter information of the terminal device, and can also modify the information of some device parameters in the device parameter information of the terminal device. Of course, it can also modify the device parameters of the terminal device. Information, the present invention is not limited to this.

307、管理器向终端设备发送第一SNMP注册响应消息。终端设备接收第一SNMP注册响应消息。307. The manager sends a first SNMP registration response message to the terminal device. The terminal device receives the first SNMP registration response message.

其中,所述第二SNMP注册响应消息指的是管理器接收到SNMP注册请求消息后,在确定出已经注册了终端设备的设备参数信息时,向终端设备发送的SNMP注册响应消息。Wherein, the second SNMP registration response message refers to the SNMP registration response message sent to the terminal device by the manager after receiving the SNMP registration request message and determining that the device parameter information of the terminal device has been registered.

需要说明的是,管理器接收到的SNMP注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息。It should be noted that the SNMP registration request message received by the manager includes: a first SNMP registration request message or a second SNMP registration request message.

具体的,在步骤302中,若管理器接收的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则管理器发送的第二SNMP注册响应消息可以包括第一扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第一SNMP Trap消息时,则管理器发送的第二SNMP注册响应消息可以包括SNMP inform消息。终端设备接收管理器发送的第二SNMP注册请求消息,可以参考步骤104,在此不再赘述。Specifically, in step 302, if the first SNMP registration request message received by the manager is the first extended SNMP registration request message, the second SNMP registration response message sent by the manager may include the first extended SNMP registration response message. If the first SNMP registration request message received by the manager is the first SNMP Trap message, the second SNMP registration response message sent by the manager may include an SNMP inform message. For the terminal device receiving the second SNMP registration request message sent by the manager, refer to step 104, which will not be repeated here.

308、终端设备在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向管理器发送第二SNMP注册请求消息。管理器接收第二SNMP注册请求消息。308. After receiving the first SNMP registration response message, the terminal device sends a second SNMP registration request message to the manager with a second time period as a period. The manager receives the second SNMP registration request message.

其中,所述第二SNMP注册请求消息中携带有终端设备的设备参数信息。所述终端设备的设备参数信息是指所述终端设备的静态信息。Wherein, the second SNMP registration request message carries device parameter information of the terminal device. The device parameter information of the terminal device refers to static information of the terminal device.

需要说明的是,若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比没有发生变化,则第二SNMP注册请求消息与第一SNMP注册请求消息相同。若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比发生变化时,则第二SNMP注册请求消息与第一SNMP注册请求消息不同。It should be noted that if the device parameter information of the terminal device carried in the second SNMP registration request message has not changed compared with the device parameter information of the terminal device carried in the first SNMP registration request message, then the second SNMP registration request message Same as the first SNMP registration request message. If the device parameter information of the terminal device carried in the second SNMP registration request message changes compared with the device parameter information of the terminal device carried in the first SNMP registration request message, the second SNMP registration request message and the first SNMP registration The request message is different.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

需要说明的是,第二SNMP注册请求消息是终端设备在接收到管理器发送的第一SNMP注册响应消息之后,以第二时间为周期发送的SNMP注册请求消息。It should be noted that the second SNMP registration request message is an SNMP registration request message sent by the terminal device at a second time period after receiving the first SNMP registration response message sent by the manager.

具体的,终端设备在接收到第一SNMP注册响应消息后,可以改变发送注册请求消息的周期,向管理器发送SNMP注册请求消息。Specifically, after receiving the first SNMP registration response message, the terminal device may change the period for sending the registration request message, and send the SNMP registration request message to the manager.

优选的,所述第一时间的值小于所述第二时间的值。Preferably, the value of the first time is smaller than the value of the second time.

此时,终端设备在以第一时间为周期向管理器发送第一SNMP注册请求消息后,在接收到第一SNMP注册响应消息时,更改为以第二时间为周期向管理器发送第二SNMP注册请求消息。这样,由于第二时间的值大于第一时间的值,可以自动降低发送第二SNMP注册响应消息的频率。At this time, after the terminal device sends the first SNMP registration request message to the manager at the first time period, when it receives the first SNMP registration response message, it changes to send the second SNMP registration request message to the manager at the second time period. Register request message. In this way, since the value of the second time is greater than the value of the first time, the frequency of sending the second SNMP registration response message may be automatically reduced.

进一步的,终端设备发送的第二SNMP注册请求消息可以有两种形式。Further, the second SNMP registration request message sent by the terminal device may have two forms.

第一种形式为第二扩展SNMP注册请求消息。The first form is the second extended SNMP registration request message.

需要说明的是,第二扩展SNMP注册请求消息是新定义的一种用于请求注册终端设备的设备参数信息的消息。It should be noted that the second extended SNMP registration request message is a newly defined message for requesting registration of device parameter information of the terminal device.

第二种形式为第二SNMP Trap消息。The second form is the second SNMP Trap message.

其中,第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。也就是说,终端设备利用已有的消息,在已有消息中添加或标识出端设备的设备参数信息,并将此已有消息发送至管理器。Wherein, a new trap type is added to the second SNMP Trap message to identify the device parameter information of the terminal device. That is to say, the terminal device uses the existing message, adds or identifies the device parameter information of the terminal device in the existing message, and sends the existing message to the manager.

进一步的,终端设备向管理器发送第二SNMP注册请求消息可参考步骤103,在此不再赘述。管理器接收第二SNMP注册请求消息,可以参考步骤201,在此不再赘述。Further, for the terminal device to send the second SNMP registration request message to the manager, reference may be made to step 103, which will not be repeated here. For the manager receiving the second SNMP registration request message, refer to step 201, which will not be repeated here.

309、管理器根据所述第二SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定已注册所述终端设备的设备参数信息。309. The manager determines, according to the device parameter information of the terminal device carried in the second SNMP registration request message, that the device parameter information of the terminal device has been registered.

具体的,由于管理器在接收到第二SNMP注册请求消息之前,已经接收到终端设备发送的第一SNMP注册请求消息,此时管理器若没有注册终端设备的设备参数信息,则管理器注册第一SNMP注册请求消息中携带的终端设备的设备参数信息。此时,管理器再接收到第二SNMP注册请求消息时,管理器可以确定出已经注册了终端设备的设备参数信息。Specifically, since the manager has received the first SNMP registration request message sent by the terminal device before receiving the second SNMP registration request message, if the manager does not register the device parameter information of the terminal device at this time, the manager registers the first SNMP registration request message. The device parameter information of the terminal device carried in an SNMP registration request message. At this time, when the manager receives the second SNMP registration request message, the manager can determine that the device parameter information of the terminal device has been registered.

310、管理器在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第二SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同。310. When the manager determines that the device parameter information of the terminal device has been registered, detect the registered device parameter information of the terminal device and the device of the terminal device carried in the second SNMP registration request message Whether the parameter information is the same.

具体的,管理器在确定出已经注册了第二SNMP注册请求消息中携带的终端设备的设备参数信息后,需要确定出第二SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息是否相同。此时,管理器可以将第二SNMP注册请求消息中携带的终端设备的设备参数信息与管理器中已注册的终端设备的设备参数信息进行比对,从而检测出第二SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息是否相同。Specifically, after the manager has determined that the device parameter information of the terminal device carried in the second SNMP registration request message has been registered, it needs to determine that the device parameter information of the terminal device carried in the second SNMP registration request message is the same as the device parameter information carried by the manager. Whether the device parameter information of the registered terminal devices is the same. At this time, the manager can compare the device parameter information of the terminal device carried in the second SNMP registration request message with the device parameter information of the terminal device registered in the manager, so as to detect that the terminal device parameter information carried in the second SNMP registration request message Whether the device parameter information of the terminal device is the same as the device parameter information of the terminal device registered by the manager.

需要说明的是,根据检测结果不同,则执行的步骤不同。若检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息相同,则直接执行步骤312。若检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息不同,则执行步骤311。It should be noted that, according to different detection results, different steps are executed. If it is detected that the device parameter information of the terminal device carried in the first SNMP registration request message is the same as the device parameter information of the terminal device registered by the manager, step 312 is directly executed. If it is detected that the device parameter information of the terminal device carried in the first SNMP registration request message is different from the device parameter information of the terminal device registered by the manager, step 311 is executed.

311、管理器在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求消息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述第二SNMP注册请求消息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息。311. When the manager detects that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request message, according to the second SNMP registration request The device parameter information of the terminal device in the message updates the registered device parameter information of the terminal device.

具体的,在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。管理器在接收到该第二SNMP注册请求消息后,检测出第二SNMP注册请求消息中携带的终端设备的设备参数信息与已存储的该终端设备的设备参数信息不同时,可以对已存储的终端设备的设备参数信息进行更新。Specifically, when the terminal device updates the device parameter information, the second SNMP registration request message carries the updated device parameter information of the terminal device. After the manager receives the second SNMP registration request message and detects that the device parameter information of the terminal device carried in the second SNMP registration request message is different from the stored device parameter information of the terminal device, the manager may update the stored device parameter information. The device parameter information of the terminal device is updated.

进一步的,管理器可以将已存储的该终端设备的设备参数信息删除,重新存储第二SNMP注册请求消息中携带的终端设备的设备参数信息。Further, the manager may delete the stored device parameter information of the terminal device, and re-store the device parameter information of the terminal device carried in the second SNMP registration request message.

需要说明的是,第二SNMP注册请求消息中携带的终端设备的设备参数信息与已存储的该终端设备的设备参数信息不同时,说明终端设备的设备参数信息已经改变。终端设备可以在终端设备的设备参数信息中新增加该终端设备的设备参数,也可以修改终端设备的设备参数信息中的某些设备参数的信息,当然,还可以是其他修改终端设备的设备参数信息,本发明对此不作限制。It should be noted that when the device parameter information of the terminal device carried in the second SNMP registration request message is different from the stored device parameter information of the terminal device, it means that the device parameter information of the terminal device has changed. The terminal device can add the device parameters of the terminal device to the device parameter information of the terminal device, and can also modify the information of some device parameters in the device parameter information of the terminal device. Of course, it can also modify the device parameters of the terminal device. Information, the present invention is not limited to this.

312、管理器向终端设备发送第二SNMP注册响应消息。终端设备接收第二SNMP注册响应消息。312. The manager sends a second SNMP registration response message to the terminal device. The terminal device receives the second SNMP registration response message.

其中,所述第二SNMP注册响应消息是终端设备接收到的除第一SNMP注册响应消息之外的注册响应消息。所述第二SNMP注册响应消息指的是管理器接收到SNMP注册请求消息后,在确定出已经注册了终端设备的设备参数信息时,向终端设备发送的SNMP注册响应消息。Wherein, the second SNMP registration response message is a registration response message received by the terminal device other than the first SNMP registration response message. The second SNMP registration response message refers to the SNMP registration response message that the manager sends to the terminal device when it determines that the device parameter information of the terminal device has been registered after receiving the SNMP registration request message.

具体的,在步骤308中,若管理器接收的第二SNMP注册请求消息为第二扩展SNMP注册请求消息时,则管理器发送的第二SNMP注册响应消息可以包括第二扩展SNMP注册响应消息。若管理器接收的第二SNMP注册请求消息为第二SNMP Trap消息时,则管理器发送的第二SNMP注册响应消息可以包括第二SNMP inform消息。终端设备接收管理器发送的第二SNMP注册请求消息,可以参考步骤104,在此不再赘述。Specifically, in step 308, if the second SNMP registration request message received by the manager is the second extended SNMP registration request message, the second SNMP registration response message sent by the manager may include the second extended SNMP registration response message. If the second SNMP registration request message received by the manager is the second SNMP Trap message, the second SNMP registration response message sent by the manager may include the second SNMP inform message. For the terminal device receiving the second SNMP registration request message sent by the manager, refer to step 104, which will not be repeated here.

本发明实施例提供了一种发现设备的方法,终端设备配置与管理器之间的接口参数,建立终端设备与管理器之间的通信信道,终端设备在该信道上以第一时间为周期,向管理器发送第一SNMP注册请求消息,管理器接收第一SNMP注册请求消息,并确定是否已注册,若确定出未注册,则进行注册,并向终端设备发送第一SNMP注册响应消息;若确定出已注册并且检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息相同,则直接向终端设备发送第一SNMP注册响应消息;若确定已注册并且检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息不同,则更新已注册的所述终端设备的设备参数信息,并向终端设备发送第一SNMP注册响应消息。终端设备在接收到第一SNMP注册响应消息后,以第二时间为周期,向管理器发送第二SNMP注册请求消息,管理器根据第二SNMP注册请求消息,确定已注册,并检测已注册的终端设备的设备参数信息与第二SNMP注册请求消息中携带有的终端设备的设备参数信息是否相同,若相同,则直接向终端设备发送第二SNMP注册响应消息;若不同,则更新已注册的所述终端设备的设备参数信息,并向终端设备发送第二SNMP注册响应消息。这样,终端设备主动向管理器发送设备参数消息,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。并且,若终端设备的设备参数信息有更新时,终端设备可以及时将更新后的设备参数信息发送至管理器,从而使得管理器能够及时更新终端设备的设备参数信息,进一步提高了系统的工作效率。The embodiment of the present invention provides a method for discovering devices. The terminal device configures interface parameters with the manager, and establishes a communication channel between the terminal device and the manager. The terminal device uses the first time as a period on the channel. Send the first SNMP registration request message to the manager, the manager receives the first SNMP registration request message, and determines whether it is registered, if it is determined that it is not registered, then registers, and sends the first SNMP registration response message to the terminal equipment; if Determining that it has been registered and detected that the device parameter information of the terminal device carried in the first SNMP registration request message is the same as the device parameter information of the terminal device registered by the manager, then directly send the first SNMP registration response message to the terminal device; if Determine that it has been registered and detect that the device parameter information of the terminal device carried in the first SNMP registration request message is different from the device parameter information of the terminal device registered by the manager, then update the registered device parameter information of the terminal device, and Send the first SNMP registration response message to the terminal device. After receiving the first SNMP registration response message, the terminal device sends a second SNMP registration request message to the manager at the second time period, and the manager determines that it has registered according to the second SNMP registration request message, and detects the registered Whether the device parameter information of the terminal device is the same as the device parameter information of the terminal device carried in the second SNMP registration request message, if the same, then directly send the second SNMP registration response message to the terminal device; if not, update the registered device parameter information of the terminal device, and send a second SNMP registration response message to the terminal device. In this way, the terminal device actively sends a device parameter message to the manager without the need for the manager to scan to obtain the device parameter information of the terminal device, thereby solving the problem that the manager needs to It takes a long time to complete the problem of scanning once, which improves the working efficiency of the system. Moreover, if the device parameter information of the terminal device is updated, the terminal device can send the updated device parameter information to the manager in time, so that the manager can update the device parameter information of the terminal device in time, further improving the working efficiency of the system .

如图5所示,其为本发明实施例所提供的一种终端设备的功能示意图。参考图5所示,该终端设备包括:控制单元501,发送单元502,接收单元503。其中,As shown in FIG. 5 , it is a functional schematic diagram of a terminal device provided by an embodiment of the present invention. Referring to FIG. 5 , the terminal device includes: a control unit 501 , a sending unit 502 , and a receiving unit 503 . in,

所述控制单元501,用于在所述接收单元503在接收到所述第一SNMP注册响应消息之前,触发所述发送单元502以第一时间为周期,向管理器发送第一SNMP注册请求消息。The control unit 501 is configured to, before the receiving unit 503 receives the first SNMP registration response message, trigger the sending unit 502 to send a first SNMP registration request message to the manager at a first time period .

所述发送单元502,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息。The sending unit 502 is configured to send a first SNMP registration request message to the manager at a first time period.

其中,所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息。所述终端设备的设备参数信息是指所述终端设备的静态信息。Wherein, the first SNMP registration request message carries device parameter information of the terminal device. The device parameter information of the terminal device refers to static information of the terminal device.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

需要说明的是,第一时间可以预先设置,可以将第一时间设置为15秒,也可以将第一时间设置为20秒,还可以将第一时间设置为其他时间,本发明对此不作限制。It should be noted that the first time can be set in advance, the first time can be set to 15 seconds, the first time can also be set to 20 seconds, and the first time can also be set to other times, which is not limited by the present invention .

可选的,所述第一SNMP注册请求消息可以包括:第一简单网络管理协议扩展SNMP注册请求消息。Optionally, the first SNMP registration request message may include: a first Simple Network Management Protocol extended SNMP registration request message.

此时,所述发送单元502,具体用于以第一时间为周期,向管理器发送第一扩展SNMP注册请求消息。At this time, the sending unit 502 is specifically configured to send the first extended SNMP registration request message to the manager with the first time as a period.

或者,所述第一SNMP注册请求消息可以包括:第一SNMP Trap消息。Alternatively, the first SNMP registration request message may include: a first SNMP Trap message.

其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the first SNMP Trap message carries device parameter information of the terminal device.

此时,所述发送单元502,具体用于以第一时间为周期,向管理器发送第一SNMPTrap消息。At this time, the sending unit 502 is specifically configured to send the first SNMPTrap message to the manager with the first time as a period.

进一步的,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Further, the device parameter information of the terminal device carried in the first SNMP Trap message includes: adding a new Trap type to the first SNMP Trap message to identify the device parameter information of the terminal device.

所述接收单元503,用于接收从所述管理器发送来的第一SNMP注册响应消息。The receiving unit 503 is configured to receive the first SNMP registration response message sent from the manager.

其中,所述第一SNMP注册响应消息是第一次接到的所述管理器发送的注册响应消息。Wherein, the first SNMP registration response message is the first received registration response message sent by the manager.

可选的,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;或者,所述第一SNMP注册响应消息包括:第一SNMP inform消息。Optionally, the first SNMP registration response message includes: a first extended SNMP registration response message; or, the first SNMP registration response message includes: a first SNMP inform message.

具体的,在所述发送单元502向管理器发送第一扩展SNMP注册请求消息时,所述接收单元503,具体用于接收所述管理器发送的第一扩展SNMP注册响应消息。Specifically, when the sending unit 502 sends the first extended SNMP registration request message to the manager, the receiving unit 503 is specifically configured to receive the first extended SNMP registration response message sent by the manager.

在所述发送单元502向管理器发送第一SNMP Trap消息时,所述接收单元503,具体用于接收所管理器发送的第一SNMP inform消息。When the sending unit 502 sends the first SNMP Trap message to the manager, the receiving unit 503 is specifically configured to receive the first SNMP inform message sent by the manager.

所述控制单元501,还用于在所述接收单元503在接收到所述第一SNMP注册响应消息之后,触发所述发送单元502以第二时间为周期,向管理器发送第二SNMP注册请求消息。The control unit 501 is further configured to, after the receiving unit 503 receives the first SNMP registration response message, trigger the sending unit 502 to send a second SNMP registration request to the manager at a second time period information.

具体的,控制单元501在接收单元503接收到第一SNMP注册响应消息之前,可以触发发送单元502以第一时间为周期,向管理器发送第一SNMP注册请求消息。在接收单元503接收到第一SNMP注册响应消息后,可以改变发送周期,触发发送单元502以第二时间为周期,向管理器发送第二SNMP注册请求消息。Specifically, before the receiving unit 503 receives the first SNMP registration response message, the control unit 501 may trigger the sending unit 502 to send the first SNMP registration request message to the manager at a period of the first time. After receiving the first SNMP registration response message, the receiving unit 503 may change the sending cycle, and trigger the sending unit 502 to send the second SNMP registration request message to the manager with the second time as a cycle.

优选的,所述第一时间的值小于所述第二时间的值。Preferably, the value of the first time is smaller than the value of the second time.

所述发送单元502,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息。The sending unit 502 is further configured to send a second SNMP registration request message to the manager at a second time period.

其中,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息。Wherein, the second SNMP registration request message carries device parameter information of the terminal device.

进一步的,发送单元502以第二时间为周期向管理器发送的第二SNMP注册请求消息与发送单元502以第一时间为周期向管理器发送的第一SNMP注册请求消息可能相同,也可能不相同。Further, the second SNMP registration request message sent by the sending unit 502 to the manager at a period of the second time may be the same as the first SNMP registration request message sent to the manager by the sending unit 502 at a period of the first time, or may not be the same. same.

需要说明的是,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。It should be noted that the device parameter information of the terminal device carried in the second SNMP registration request message includes: when the terminal device updates the device parameter information, the second SNMP registration request message carries all The updated device parameter information of the terminal device.

具体的,由于第二SNMP注册请求消息与第一SNMP注册请求消息中均携带有终端设备的设备参数信息,所以,在接收单元503在接收到第一SNMP注册响应消息后,当终端设备的设备参数信息没有发生改变时,所述第二SNMP注册请求消息与第一SNMP注册请求消息相同。Specifically, since both the second SNMP registration request message and the first SNMP registration request message carry the device parameter information of the terminal device, after the receiving unit 503 receives the first SNMP registration response message, when the device parameter information of the terminal device When the parameter information does not change, the second SNMP registration request message is the same as the first SNMP registration request message.

当终端设备的设备参数信息发生改变时,由于第二SNMP注册请求消息中携带的终端设备的设备参数信息为更新后的设备参数信息,所以所述第二SNMP注册请求消息与第一SNMP注册请求消息不相同,此时,管理器需要以第二SNMP注册请求消息中携带的设备参数信息为准,对存储的终端设备的设备参数信息予以更新。When the device parameter information of the terminal device changes, since the device parameter information of the terminal device carried in the second SNMP registration request message is the updated device parameter information, the second SNMP registration request message is the same as the first SNMP registration request message. The messages are different. At this time, the manager needs to update the stored device parameter information of the terminal device based on the device parameter information carried in the second SNMP registration request message.

需要说明的是,第二时间可以预先设定,可以将第二时间设置为45秒,也可以将第二时间设置为60秒,还可以将第二时间设置为其他与第一时间相对应的时间,本发明对此不作限制。It should be noted that the second time can be set in advance, the second time can be set to 45 seconds, the second time can also be set to 60 seconds, and the second time can also be set to other time corresponding to the first time. Time, the present invention is not limited to this.

可选的,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息。Optionally, the second SNMP registration request message includes: a second extended SNMP registration request message.

此时,所述发送单元502,具体用于以第二时间为周期,向管理器发送第二扩展SNMP注册请求消息。At this time, the sending unit 502 is specifically configured to send the second extended SNMP registration request message to the manager with the second time as a period.

或者,所述第二SNMP注册请求消息可以包括:第二SNMP Trap消息。Alternatively, the second SNMP registration request message may include: a second SNMP Trap message.

其中,所述第二SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the second SNMP Trap message carries device parameter information of the terminal device.

此时,所述发送单元502,具体用于以第二时间为周期,向管理器发送第二SNMPTrap消息。At this time, the sending unit 502 is specifically configured to send the second SNMPTrap message to the manager with the second time as a period.

进一步的,所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Further, the device parameter information of the terminal device carried in the second SNMP Trap message includes: adding a new Trap type to the second SNMP Trap message to identify the device parameter information of the terminal device.

所述接收单元503,还用于接收所述管理器发送的第二SNMP注册响应消息。The receiving unit 503 is further configured to receive the second SNMP registration response message sent by the manager.

其中,所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的注册响应消息。Wherein, the second SNMP registration response message is a received registration response message other than the first SNMP registration response message.

需要说明的是,终端设备在接收到第一SNMP注册响应消息后,接收的其他所以注册响应消息均为第二SNMP注册响应消息。It should be noted that after the terminal device receives the first SNMP registration response message, all other registration response messages it receives are second SNMP registration response messages.

具体的,所述接收单元503,接收的第二SNMP注册响应消息可以是,在发送单元502以第一时间为周期,向管理器发送第一SNMP注册请求消息时,管理器接收到第一SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。Specifically, the second SNMP registration response message received by the receiving unit 503 may be that when the sending unit 502 sends the first SNMP registration request message to the manager with the first time as a period, the manager receives the first SNMP registration request message. After the registration request message, return the SNMP registration response message to the terminal device.

所述接收单元503,接收的第二SNMP注册响应消息也可以是,在发送单元502以第二时间为周期,向管理器发送第二SNMP注册请求消息时,管理器接收到第二SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。The second SNMP registration response message received by the receiving unit 503 may also be that when the sending unit 502 sends the second SNMP registration request message to the manager with the second time period, the manager receives the second SNMP registration request After the message, return the SNMP registration response message to the terminal device.

可选的,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息,或者,所述第二SNMP注册响应消息包括:第二SNMP inform消息。Optionally, the second SNMP registration response message includes: a second extended SNMP registration response message, or, the second SNMP registration response message includes: a second SNMP inform message.

进一步的,所述控制单元501,还用于配置与所述管理器间的接口参数。Further, the control unit 501 is also configured to configure interface parameters with the manager.

其中,所述接口参数用于建立与所述管理器间的连接。Wherein, the interface parameter is used to establish a connection with the manager.

本发明实施例提供了一种终端设备,终端设备在建立了与管理器之间的通信信道后,开始以第一时间为周期发送第一SNMP注册请求消息,当终端设备接收到管理器发送的第一SNMP注册响应消息后,就以第二时间为周期,向管理器发送第二SNMP注册响应消息,并接收第二SNMP注册响应消息。这样,终端设备可以自动将设备参数信息发送至管理器,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。并且,若终端设备的设备参数信息有更新时,终端设备可以及时将更新后的设备参数信息发送至管理器,从而使得管理器能够及时更新终端设备的设备参数信息,进一步提高了系统的工作效率。An embodiment of the present invention provides a terminal device. After the terminal device establishes a communication channel with the manager, it starts to send the first SNMP registration request message periodically at the first time. When the terminal device receives the After the first SNMP registration response message, the second SNMP registration response message is sent to the manager at the second time period, and the second SNMP registration response message is received. In this way, the terminal device can automatically send the device parameter information to the manager without the need for the manager to scan to obtain the device parameter information of the terminal device, thereby solving the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system. Moreover, if the device parameter information of the terminal device is updated, the terminal device can send the updated device parameter information to the manager in time, so that the manager can update the device parameter information of the terminal device in time, further improving the working efficiency of the system .

如图6所示,其为本发明实施例所提供的一种管理器的功能示意图。参考图6所示,该管理器包括:接收单元601,处理单元602,发送单元603。其中,As shown in FIG. 6 , it is a functional diagram of a manager provided by an embodiment of the present invention. Referring to FIG. 6 , the manager includes: a receiving unit 601 , a processing unit 602 , and a sending unit 603 . in,

接收单元601,用于接收从终端设备发送的SNMP注册请求消息。The receiving unit 601 is configured to receive an SNMP registration request message sent from a terminal device.

其中,所述SNMP注册请求消息中携带有终端设备的设备参数信息。所述设备参数信息是指所述终端设备的静态信息。Wherein, the SNMP registration request message carries device parameter information of the terminal device. The device parameter information refers to static information of the terminal device.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

具体的,所述SNMP注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息。所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息。所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息。Specifically, the SNMP registration request message includes: a first SNMP registration request message or a second SNMP registration request message. The first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager at a first time period. The second SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager at a second time period.

进一步,所述第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息或者第一SNMP Trap消息。所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息,或者第二SNMP Trap消息。Further, the first SNMP registration request message includes: a first extended SNMP registration request message or a first SNMP Trap message. The second SNMP registration request message includes: a second extended SNMP registration request message, or a second SNMP Trap message.

其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。所述第二SNMPTrap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Wherein, the device parameter information of the terminal device carried in the first SNMP Trap message includes: adding a new Trap type to the first SNMP Trap message to identify the device parameter information of the terminal device. The device parameter information of the terminal device carried in the second SNMP Trap message includes: adding a new Trap type to the second SNMP Trap message to identify the device parameter information of the terminal device.

SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。也就是说,终端设备利用已有的消息,在已有消息中添加或标识出终端设备的设备参数信息,并将此已有消息发送至管理器。A new trap type is added to the SNMP Trap message to identify the device parameter information of the terminal device. That is to say, the terminal device uses the existing message, adds or identifies the device parameter information of the terminal device in the existing message, and sends the existing message to the manager.

需要说明的是,若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比没有发生变化,则第二SNMP注册请求消息与第一SNMP注册请求消息相同。若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比发生变化时,则第二SNMP注册请求消息与第一SNMP注册请求消息不同。It should be noted that if the device parameter information of the terminal device carried in the second SNMP registration request message has not changed compared with the device parameter information of the terminal device carried in the first SNMP registration request message, then the second SNMP registration request message Same as the first SNMP registration request message. If the device parameter information of the terminal device carried in the second SNMP registration request message changes compared with the device parameter information of the terminal device carried in the first SNMP registration request message, the second SNMP registration request message and the first SNMP registration The request message is different.

需要说明的是,第二SNMP注册请求消息是终端设备在接收到管理器发送的第一SNMP注册响应消息之后,以第二时间为周期发送的SNMP注册请求消息。It should be noted that the second SNMP registration request message is an SNMP registration request message sent by the terminal device at a second time period after receiving the first SNMP registration response message sent by the manager.

处理单元602,用于根据所述注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息。The processing unit 602 is configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the registration request message.

所述处理单元602,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册,并触发发送单元603向所述终端设备发送第一SNMP注册响应消息。The processing unit 602 is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered, and trigger the sending unit 603 to send the first SNMP registration response message.

发送单元603,用于向所述终端设备发送第一SNMP注册响应消息。A sending unit 603, configured to send a first SNMP registration response message to the terminal device.

具体的,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息,或者第一SNMP inform消息。若管理器接收的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则发送的第一SNMP注册响应消息可以包括第一扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第一SNMP Trap消息时,则管理器发送的第一SNMP注册响应消息可以包括SNMP inform消息。Specifically, the first SNMP registration response message includes: a first extended SNMP registration response message, or a first SNMP inform message. If the first SNMP registration request message received by the manager is the first extended SNMP registration request message, the sent first SNMP registration response message may include the first extended SNMP registration response message. If the first SNMP registration request message received by the manager is a first SNMP Trap message, the first SNMP registration response message sent by the manager may include an SNMP inform message.

所述处理单元602,还用于在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同。The processing unit 602 is further configured to detect the registered device parameter information of the terminal device and the terminal information carried in the SNMP registration request message when it is determined that the device parameter information of the terminal device has been registered. Whether the device parameter information of the device is the same.

所述处理单元602,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送单元603向所述终端设备发送第二SNMP注册响应消息。The processing unit 602 is further configured to trigger the sending of Unit 603 sends a second SNMP registration response message to the terminal device.

具体的,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息,或者第二SNMP inform消息。若管理器接收的第二SNMP注册请求消息为第二扩展SNMP注册请求消息时,则发送的第二SNMP注册响应消息可以包括第二扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第二SNMP Trap消息时,则管理器发送的第二SNMP注册响应消息可以包括SNMP inform消息。Specifically, the second SNMP registration response message includes: a second extended SNMP registration response message, or a second SNMP inform message. If the second SNMP registration request message received by the manager is a second extended SNMP registration request message, the sent second SNMP registration response message may include the second extended SNMP registration response message. If the first SNMP registration request message received by the manager is the second SNMP Trap message, the second SNMP registration response message sent by the manager may include an SNMP inform message.

所述处理单元602,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并触发所述发送单元603向所述终端设备发送第二SNMP注册响应消息。The processing unit 602 is further configured to, in a case where it is detected that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the The device parameter information of the terminal device in the SNMP registration request information updates the registered device parameter information of the terminal device; and triggers the sending unit 603 to send a second SNMP registration response message to the terminal device.

所述发送单元603,还用于向所述终端设备发送第二SNMP注册响应消息。The sending unit 603 is further configured to send a second SNMP registration response message to the terminal device.

本发明实施例提供了一种管理器,管理器接收终端设备发送的注册请求消息,并根据所述注册请求消息中携带的该终端设备的设备参数信息,确定是否已经注册,若还未注册,则进行注册。这样,管理器可以接收终端设备自动发送的设备参数信息,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。An embodiment of the present invention provides a manager. The manager receives a registration request message sent by a terminal device, and determines whether it has been registered according to the device parameter information of the terminal device carried in the registration request message. If it has not been registered, then register. In this way, the manager can receive the device parameter information automatically sent by the terminal device, without the need for the manager to scan to obtain the device parameter information of the terminal device, and then solve the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system.

如图7所示,其为本发明实施例所提供的一种终端设备的结构示意图。参考图7所示,该终端设备包括:发送器701,接收器702,存储器703以及分别于发送器701,接收器702,存储器703相连的处理器704。As shown in FIG. 7 , it is a schematic structural diagram of a terminal device provided by an embodiment of the present invention. Referring to FIG. 7, the terminal device includes: a transmitter 701, a receiver 702, a memory 703, and a processor 704 connected to the transmitter 701, the receiver 702, and the memory 703 respectively.

所述处理器704,用于在所述接收器702在接收到所述第一SNMP注册响应消息之前,触发所述发送器701以第一时间为周期,向管理器发送第一SNMP注册请求消息。The processor 704 is configured to, before the receiver 702 receives the first SNMP registration response message, trigger the transmitter 701 to send a first SNMP registration request message to the manager at a first time period .

所述发送器701,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息。The sender 701 is configured to send a first SNMP registration request message to the manager at a first time period.

其中,所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息。所述终端设备的设备参数信息是指所述终端设备的静态信息。Wherein, the first SNMP registration request message carries device parameter information of the terminal device. The device parameter information of the terminal device refers to static information of the terminal device.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

需要说明的是,第一时间可以预先设置,可以将第一时间设置为15秒,也可以将第一时间设置为20秒,还可以将第一时间设置为其他时间,本发明对此不作限制。It should be noted that the first time can be set in advance, the first time can be set to 15 seconds, the first time can also be set to 20 seconds, and the first time can also be set to other times, which is not limited by the present invention .

可选的,所述第一SNMP注册请求消息可以包括:第一简单网络管理协议扩展SNMP注册请求消息。Optionally, the first SNMP registration request message may include: a first Simple Network Management Protocol extended SNMP registration request message.

此时,所述发送器701,具体用于以第一时间为周期,向管理器发送第一扩展SNMP注册请求消息。At this time, the sender 701 is specifically configured to send the first extended SNMP registration request message to the manager with the first time as a period.

或者,所述第一SNMP注册请求消息可以包括:第一简单网络管理协议陷阱SNMPTrap消息。Alternatively, the first SNMP registration request message may include: a first Simple Network Management Protocol trap SNMPTrap message.

其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the first SNMP Trap message carries device parameter information of the terminal device.

此时,所述发送器701,具体用于以第一时间为周期,向管理器发送第一SNMP Trap消息。At this time, the sender 701 is specifically configured to send the first SNMP Trap message to the manager with the first time as a period.

进一步的,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Further, the device parameter information of the terminal device carried in the first SNMP Trap message includes: adding a new Trap type to the first SNMP Trap message to identify the device parameter information of the terminal device.

所述接收器702,用于接收从所述管理器发送来的第一SNMP注册响应消息。The receiver 702 is configured to receive the first SNMP registration response message sent from the manager.

其中,所述第一SNMP注册响应消息是第一次接到的所述管理器发送的注册响应消息。Wherein, the first SNMP registration response message is the first received registration response message sent by the manager.

可选的,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;或者,所述第一SNMP注册响应消息包括:第一SNMP inform消息。Optionally, the first SNMP registration response message includes: a first extended SNMP registration response message; or, the first SNMP registration response message includes: a first SNMP inform message.

具体的,在所述发送器701向管理器发送第一扩展SNMP注册请求消息时,所述接收器702,具体用于接收所述管理器发送的第一扩展SNMP注册响应消息。Specifically, when the sender 701 sends the first extended SNMP registration request message to the manager, the receiver 702 is specifically configured to receive the first extended SNMP registration response message sent by the manager.

在所述发送器701向管理器发送第一SNMP Trap消息时,所述接收器702,具体用于接收所管理器发送的第一SNMP inform消息。When the sender 701 sends the first SNMP Trap message to the manager, the receiver 702 is specifically configured to receive the first SNMP inform message sent by the manager.

所述处理器704,还用于在所述接收器702在接收到所述第一SNMP注册响应消息之后,触发所述发送器701以第二时间为周期,向管理器发送第二SNMP注册请求消息。The processor 704 is further configured to, after the receiver 702 receives the first SNMP registration response message, trigger the transmitter 701 to send a second SNMP registration request to the manager at a second time period information.

具体的,处理器704在接收器702接收到第一SNMP注册响应消息之前,可以触发发送器701以第一时间为周期,向管理器发送第一SNMP注册请求消息。在接收器702接收到第一SNMP注册响应消息后,可以改变发送周期,触发发送器701以第二时间为周期,向管理器发送第二SNMP注册请求消息。Specifically, before the receiver 702 receives the first SNMP registration response message, the processor 704 may trigger the sender 701 to send the first SNMP registration request message to the manager at a period of the first time. After receiving the first SNMP registration response message, the receiver 702 may change the sending cycle, and trigger the sender 701 to send the second SNMP registration request message to the manager with the second time as a cycle.

优选的,所述第一时间的值小于所述第二时间的值。Preferably, the value of the first time is smaller than the value of the second time.

所述发送器701,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息。The sender 701 is further configured to send a second SNMP registration request message to the manager at a second time period.

其中,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息。Wherein, the second SNMP registration request message carries device parameter information of the terminal device.

进一步的,发送器701以第二时间为周期向管理器发送的第二SNMP注册请求消息与发送器701以第一时间为周期向管理器发送的第一SNMP注册请求消息可能相同,也可能不相同。Further, the second SNMP registration request message sent by the sender 701 to the manager at a period of the second time may be the same as the first SNMP registration request message sent to the manager by the sender 701 at a period of the first time, or may not be the same. same.

需要说明的是,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。It should be noted that the device parameter information of the terminal device carried in the second SNMP registration request message includes: when the terminal device updates the device parameter information, the second SNMP registration request message carries all The updated device parameter information of the terminal device.

具体的,由于第二SNMP注册请求消息与第一SNMP注册请求消息中均携带有终端设备的设备参数信息,所以,在接收器702在接收到第一SNMP注册响应消息后,当终端设备的设备参数信息没有发生改变时,所述第二SNMP注册请求消息与第一SNMP注册请求消息相同。Specifically, since both the second SNMP registration request message and the first SNMP registration request message carry the device parameter information of the terminal device, after the receiver 702 receives the first SNMP registration response message, when the device parameter information of the terminal device When the parameter information does not change, the second SNMP registration request message is the same as the first SNMP registration request message.

当终端设备的设备参数信息发生改变时,由于第二SNMP注册请求消息中携带的终端设备的设备参数信息为更新后的设备参数信息,所以所述第二SNMP注册请求消息与第一SNMP注册请求消息不相同,此时,管理器需要以第二SNMP注册请求消息中携带的设备参数信息为准,对存储器703中存储的终端设备的设备参数信息予以更新。When the device parameter information of the terminal device changes, since the device parameter information of the terminal device carried in the second SNMP registration request message is the updated device parameter information, the second SNMP registration request message is the same as the first SNMP registration request message. The messages are different. At this time, the manager needs to update the device parameter information of the terminal device stored in the memory 703 based on the device parameter information carried in the second SNMP registration request message.

需要说明的是,第二时间可以预先设定,可以将第二时间设置为45秒,也可以将第二时间设置为60秒,还可以将第二时间设置为其他与第一时间相对应的时间,本发明对此不作限制。It should be noted that the second time can be set in advance, the second time can be set to 45 seconds, the second time can also be set to 60 seconds, and the second time can also be set to other time corresponding to the first time. Time, the present invention is not limited to this.

可选的,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息。Optionally, the second SNMP registration request message includes: a second extended SNMP registration request message.

此时,所述发送器701,具体用于以第二时间为周期,向管理器发送第二扩展SNMP注册请求消息。At this time, the sender 701 is specifically configured to send the second extended SNMP registration request message to the manager with the second time as a period.

或者,所述第二SNMP注册请求消息可以包括:第二SNMP Trap消息。Alternatively, the second SNMP registration request message may include: a second SNMP Trap message.

其中,所述第二SNMP Trap消息中携带有终端设备的设备参数信息。Wherein, the second SNMP Trap message carries device parameter information of the terminal device.

此时,所述发送器701,具体用于以第二时间为周期,向管理器发送第二SNMP Trap消息。At this time, the sender 701 is specifically configured to send the second SNMP Trap message to the manager with the second time as a period.

进一步的,所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Further, the device parameter information of the terminal device carried in the second SNMP Trap message includes: adding a new Trap type to the second SNMP Trap message to identify the device parameter information of the terminal device.

所述接收器702,还用于接收所述管理器发送的第二SNMP注册响应消息。The receiver 702 is further configured to receive the second SNMP registration response message sent by the manager.

其中,所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。Wherein, the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message.

需要说明的是,终端设备在接收到第一SNMP注册响应消息后,接收的其他SNMP注册响应消息均为第二SNMP注册响应消息。It should be noted that, after the terminal device receives the first SNMP registration response message, other SNMP registration response messages received are all second SNMP registration response messages.

具体的,所述接收器702,接收的第二SNMP注册响应消息可以是,在发送器701以第一时间为周期,向管理器发送第一SNMP注册请求消息时,管理器接收到第一SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。Specifically, the second SNMP registration response message received by the receiver 702 may be that when the sender 701 sends the first SNMP registration request message to the manager with the first time period, the manager receives the first SNMP registration request message. After the registration request message, return the SNMP registration response message to the terminal device.

所述接收器702,接收的第二SNMP注册响应消息也可以是,在发送器701以第二时间为周期,向管理器发送第二SNMP注册请求消息时,管理器接收到第二SNMP注册请求消息后,向终端设备返回的SNMP注册响应消息。The second SNMP registration response message received by the receiver 702 may also be that the manager receives the second SNMP registration request when the transmitter 701 sends the second SNMP registration request message to the manager with the second time as a period After the message, return the SNMP registration response message to the terminal device.

可选的,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息,或者,所述第二SNMP注册响应消息包括:第二SNMP inform消息。Optionally, the second SNMP registration response message includes: a second extended SNMP registration response message, or, the second SNMP registration response message includes: a second SNMP inform message.

进一步的,所述处理器704,还用于配置与所述管理器间的接口参数。Further, the processor 704 is also configured to configure interface parameters with the manager.

其中,所述接口参数用于建立与所述管理器间的连接。Wherein, the interface parameter is used to establish a connection with the manager.

本发明实施例提供了一种终端设备,终端设备在建立了与管理器之间的通信信道后,开始以第一时间为周期发送第一SNMP注册请求消息,当终端设备接收到管理器发送的第一SNMP注册响应消息后,就以第二时间为周期,向管理器发送第二SNMP注册响应消息,并接收第二SNMP注册响应消息。这样,终端设备可以自动将设备参数信息发送至管理器,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。并且,若终端设备的设备参数信息有更新时,终端设备可以及时将更新后的设备参数信息发送至管理器,从而使得管理器能够及时更新终端设备的设备参数信息,进一步提高了系统的工作效率。An embodiment of the present invention provides a terminal device. After the terminal device establishes a communication channel with the manager, it starts to send the first SNMP registration request message periodically at the first time. When the terminal device receives the After the first SNMP registration response message, the second SNMP registration response message is sent to the manager at the second time period, and the second SNMP registration response message is received. In this way, the terminal device can automatically send the device parameter information to the manager without the need for the manager to scan to obtain the device parameter information of the terminal device, thereby solving the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system. Moreover, if the device parameter information of the terminal device is updated, the terminal device can send the updated device parameter information to the manager in time, so that the manager can update the device parameter information of the terminal device in time, further improving the working efficiency of the system .

如图8所示,其为本发明实施例所提供的一种管理器的结构示意图。参考图8所示,该管理器包括:发送器801,接收器802,存储器804以及分别于发送器801,接收器802,存储器804相连的处理器803。其中,As shown in FIG. 8 , it is a schematic structural diagram of a manager provided by an embodiment of the present invention. Referring to FIG. 8 , the manager includes: a sender 801 , a receiver 802 , a memory 804 and a processor 803 connected to the sender 801 , receiver 802 , and memory 804 respectively. in,

接收器802,用于接收从终端设备发送的SNMP注册请求消息。The receiver 802 is configured to receive the SNMP registration request message sent from the terminal device.

其中,所述SNMP注册请求消息中携带有终端设备的设备参数信息。所述设备参数信息是指所述终端设备的静态信息。Wherein, the SNMP registration request message carries device parameter information of the terminal device. The device parameter information refers to static information of the terminal device.

进一步的,所述终端设备的设备参数信息包括:终端设备的设备型号、额定功率、管理IP。Further, the device parameter information of the terminal device includes: device model, rated power, and management IP of the terminal device.

需要说明的是,所述终端设备的设备参数信息还可以包括终端设备的生产厂商等其他参数信息,本发明对此不做限定。It should be noted that the device parameter information of the terminal device may also include other parameter information such as a manufacturer of the terminal device, which is not limited in the present invention.

具体的,所述SNMP注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息。所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息。所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息。Specifically, the SNMP registration request message includes: a first SNMP registration request message or a second SNMP registration request message. The first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager at a first time period. The second SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager at a second time period.

进一步,所述第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息或者第一SNMP Trap消息。所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息,或者第二SNMP Trap消息。Further, the first SNMP registration request message includes: a first extended SNMP registration request message or a first SNMP Trap message. The second SNMP registration request message includes: a second extended SNMP registration request message, or a second SNMP Trap message.

其中,所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。所述第二SNMPTrap消息中携带有终端设备的设备参数信息包括:所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。Wherein, the device parameter information of the terminal device carried in the first SNMP Trap message includes: adding a new Trap type to the first SNMP Trap message to identify the device parameter information of the terminal device. The device parameter information of the terminal device carried in the second SNMP Trap message includes: adding a new Trap type to the second SNMP Trap message to identify the device parameter information of the terminal device.

SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。也就是说,终端设备利用已有的消息,在已有消息中添加或标识出终端设备的设备参数信息,并将此已有消息发送至管理器。A new trap type is added to the SNMP Trap message to identify the device parameter information of the terminal device. That is to say, the terminal device uses the existing message, adds or identifies the device parameter information of the terminal device in the existing message, and sends the existing message to the manager.

需要说明的是,若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比没有发生变化,则第二SNMP注册请求消息与第一SNMP注册请求消息相同。若第二SNMP注册请求消息中携带的终端设备的设备参数信息与第一SNMP注册请求消息中携带的终端设备的设备参数信息相比发生变化时,则第二SNMP注册请求消息与第一SNMP注册请求消息不同。It should be noted that if the device parameter information of the terminal device carried in the second SNMP registration request message has not changed compared with the device parameter information of the terminal device carried in the first SNMP registration request message, then the second SNMP registration request message Same as the first SNMP registration request message. If the device parameter information of the terminal device carried in the second SNMP registration request message changes compared with the device parameter information of the terminal device carried in the first SNMP registration request message, the second SNMP registration request message and the first SNMP registration The request message is different.

需要说明的是,第二SNMP注册请求消息是终端设备在接收到管理器发送的第一SNMP注册响应消息之后,以第二时间为周期发送的SNMP注册请求消息。It should be noted that the second SNMP registration request message is an SNMP registration request message sent by the terminal device at a second time period after receiving the first SNMP registration response message sent by the manager.

处理器803,用于根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息。The processor 803 is configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message.

所述处理器803,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册,并触发发送器801向所述终端设备发送第一SNMP注册响应消息。The processor 803 is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered, and trigger the transmitter 801 to send the first SNMP registration response message.

发送器801,用于向所述终端设备发送第一SNMP注册响应消息。The sender 801 is configured to send a first SNMP registration response message to the terminal device.

具体的,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息,或者第一SNMP inform消息。若管理器接收的第一SNMP注册请求消息为第一扩展SNMP注册请求消息时,则发送的第一SNMP注册响应消息可以包括第一扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第一SNMP Trap消息时,则管理器发送的第一SNMP注册响应消息可以包括SNMP inform消息。Specifically, the first SNMP registration response message includes: a first extended SNMP registration response message, or a first SNMP inform message. If the first SNMP registration request message received by the manager is the first extended SNMP registration request message, the sent first SNMP registration response message may include the first extended SNMP registration response message. If the first SNMP registration request message received by the manager is a first SNMP Trap message, the first SNMP registration response message sent by the manager may include an SNMP inform message.

所述处理器803,还用于在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;The processor 803 is further configured to detect the registered device parameter information of the terminal device and the terminal information carried in the SNMP registration request message when it is determined that the device parameter information of the terminal device has been registered. Whether the device parameter information of the device is the same;

所述处理器803,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送器801向所述终端设备发送第二SNMP注册响应消息;The processor 803 is further configured to trigger the sending of The device 801 sends a second SNMP registration response message to the terminal device;

具体的,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息,或者第二SNMP inform消息。若管理器接收的第二SNMP注册请求消息为第二扩展SNMP注册请求消息时,则发送的第二SNMP注册响应消息可以包括第二扩展SNMP注册响应消息。若管理器接收的第一SNMP注册请求消息为第二SNMP Trap消息时,则管理器发送的第二SNMP注册响应消息可以包括SNMP inform消息。Specifically, the second SNMP registration response message includes: a second extended SNMP registration response message, or a second SNMP inform message. If the second SNMP registration request message received by the manager is a second extended SNMP registration request message, the sent second SNMP registration response message may include the second extended SNMP registration response message. If the first SNMP registration request message received by the manager is the second SNMP Trap message, the second SNMP registration response message sent by the manager may include an SNMP inform message.

所述处理器803,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息,即将SNMP注册请求信息中携带的所述终端设备的设备参数信息存储到存储器804中;并触发所述发送器801向所述终端设备发送第二SNMP注册响应消息;The processor 803 is further configured to, in a case where it is detected that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the The device parameter information of the terminal device in the SNMP registration request information, update the registered device parameter information of the terminal device, that is, store the device parameter information of the terminal device carried in the SNMP registration request information into the memory 804; And trigger the transmitter 801 to send a second SNMP registration response message to the terminal device;

所述发送器801,还用于向所述终端设备发送第二SNMP注册响应消息。The sender 801 is further configured to send a second SNMP registration response message to the terminal device.

本发明实施例提供了一种管理器,管理器接收终端设备发送的SNMP注册请求消息,并根据所述SNMP注册请求消息中携带的该终端设备的设备参数信息,确定是否已经注册,若还未注册,则进行注册。这样,管理器可以接收终端设备自动发送的设备参数信息,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。An embodiment of the present invention provides a manager. The manager receives the SNMP registration request message sent by the terminal device, and determines whether the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message. Register, then register. In this way, the manager can receive the device parameter information automatically sent by the terminal device, without the need for the manager to scan to obtain the device parameter information of the terminal device, and then solve the problem of management when the IP address range of the device managed by the manager is large, the distribution is scattered, and the number is large. It takes a long time for the server to complete a scan, which improves the working efficiency of the system.

本发明实施例提供了一种发现设备的系统,如图9所示,包括:终端设备901,管理器902。An embodiment of the present invention provides a device discovery system, as shown in FIG. 9 , including: a terminal device 901 and a manager 902 .

其中,所述终端设备901为上述实施例所述的终端设备。Wherein, the terminal device 901 is the terminal device described in the foregoing embodiments.

所述管理器902为上述实施例所述的管理器。The manager 902 is the manager described in the above embodiments.

本发明实施例提供了一种发现设备的方法、装置及系统,终端设备配置与管理器之间的接口参数,建立终端设备与管理器之间的通信信道,终端设备在该信道上以第一时间为周期,向管理器发送第一SNMP注册请求消息,管理器接收第一SNMP注册请求消息,并确定是否已注册,若确定出未注册,则进行注册,并向终端设备发送第一SNMP注册响应消息;若确定出已注册并且检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息相同,则直接向终端设备发送第一SNMP注册响应消息;若确定已注册并且检测出第一SNMP注册请求消息中携带的终端设备的设备参数信息与管理器已注册的终端设备的设备参数信息不同,则更新已注册的所述终端设备的设备参数信息,并向终端设备发送第一SNMP注册响应消息。终端设备在接收到第一SNMP注册响应消息后,以第二时间为周期,向管理器发送第二SNMP注册请求消息,管理器根据第二SNMP注册请求消息,确定已注册,并检测已注册的终端设备的设备参数信息与第二SNMP注册请求消息中携带有的终端设备的设备参数信息是否相同,若相同,则直接向终端设备发送第二SNMP注册响应消息;若不同,则更新已注册的所述终端设备的设备参数信息,并向终端设备发送第二SNMP注册响应消息。这样,终端设备主动向管理器发送设备参数消息,无需管理器进行扫描获取终端设备的设备参数信息,进而解决了当管理器管理的设备IP地址段范围大、分布分散、数量多时,管理器需要长时间才能完成一遍扫描的问题,提高了系统的工作效率。并且,若终端设备的设备参数信息有更新时,终端设备可以及时将更新后的设备参数信息发送至管理器,从而使得管理器能够及时更新终端设备的设备参数信息,进一步提高了系统的工作效率。Embodiments of the present invention provide a method, device, and system for discovering devices. The terminal device configures the interface parameters between the manager and establishes a communication channel between the terminal device and the manager. The terminal device uses the first The time is periodic, send the first SNMP registration request message to the manager, the manager receives the first SNMP registration request message, and determines whether it is registered, if it is determined that it is not registered, then registers, and sends the first SNMP registration request message to the terminal device Response message; if it is determined that it has registered and detects that the device parameter information of the terminal device carried in the first SNMP registration request message is the same as the device parameter information of the terminal device registered by the manager, then directly send the first SNMP registration message to the terminal device Response message; if it is determined that it has been registered and it is detected that the device parameter information of the terminal device carried in the first SNMP registration request message is different from the device parameter information of the terminal device registered by the manager, update the registered device of the terminal device parameter information, and send the first SNMP registration response message to the terminal device. After receiving the first SNMP registration response message, the terminal device sends a second SNMP registration request message to the manager at the second time period, and the manager determines that it has registered according to the second SNMP registration request message, and detects the registered Whether the device parameter information of the terminal device is the same as the device parameter information of the terminal device carried in the second SNMP registration request message, if the same, then directly send the second SNMP registration response message to the terminal device; if not, update the registered device parameter information of the terminal device, and send a second SNMP registration response message to the terminal device. In this way, the terminal device actively sends a device parameter message to the manager without the need for the manager to scan to obtain the device parameter information of the terminal device, thereby solving the problem that the manager needs to It takes a long time to complete the problem of scanning once, which improves the working efficiency of the system. Moreover, if the device parameter information of the terminal device is updated, the terminal device can send the updated device parameter information to the manager in time, so that the manager can update the device parameter information of the terminal device in time, further improving the working efficiency of the system .

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (29)

1.一种发现设备的方法,其特征在于,包括:1. A method for discovering equipment, comprising: 在终端设备与管理器之间建立了通信信道后,所述终端设备以第一时间为周期,向管理器发送第一简单网络管理协议SNMP注册请求消息,所述终端设备是未注册或已注册的终端设备;所述第一SNMP注册请求消息中携带有终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;After the communication channel is established between the terminal device and the manager, the terminal device sends a first Simple Network Management Protocol SNMP registration request message to the manager with the first time period, and the terminal device is unregistered or registered the terminal device; the first SNMP registration request message carries the device parameter information of the terminal device; the device parameter information of the terminal device refers to the static information of the terminal device; 接收所述管理器发送的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息;Receive the first SNMP registration response message sent by the manager; the first SNMP registration response message is the first received SNMP registration response message sent by the manager; 在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述第一SNMP注册请求消息与所述第二SNMP注册请求消息相同或不同;After receiving the first SNMP registration response message, send a second SNMP registration request message to the manager with a second period of time; the second SNMP registration request message carries the device of the terminal device Parameter information; the first SNMP registration request message is the same as or different from the second SNMP registration request message; 接收所述管理器发送的第二SNMP注册响应消息;其中,所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。receiving a second SNMP registration response message sent by the manager; wherein, the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message. 2.根据权利要求1所述的方法,其特征在于,在所述以第一时间为周期,向管理器发送第一SNMP注册请求消息之前,还包括:2. The method according to claim 1, characterized in that, before the first SNMP registration request message is sent to the manager at the first time as a cycle, further comprising: 配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。Configure interface parameters with the manager; the interface parameters are used to establish a connection with the manager. 3.根据权利要求1所述的方法,其特征在于,所述第一时间的值小于所述第二时间的值。3. The method according to claim 1, wherein the value of the first time is smaller than the value of the second time. 4.根据权利要求1所述的方法,其特征在于,所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:4. The method according to claim 1, wherein the device parameter information of the terminal device carried in the second SNMP registration request message includes: 在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。When the terminal device updates the device parameter information, the second SNMP registration request message carries the updated device parameter information of the terminal device. 5.根据权利要求1-4任一项所述的方法,其特征在于,所述第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息;5. The method according to any one of claims 1-4, wherein the first SNMP registration request message comprises: a first extended SNMP registration request message; 所述以第一时间为周期,向管理器发送第一SNMP注册请求消息包括:Said taking the first time as a period, sending the first SNMP registration request message to the manager includes: 以第一时间为周期,向管理器发送第一扩展SNMP注册请求消息;Taking the first time as a period, sending the first extended SNMP registration request message to the manager; 所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;The first SNMP registration response message includes: a first extended SNMP registration response message; 所述接收所述管理器发送的第一SNMP注册响应消息包括:The receiving the first SNMP registration response message sent by the manager includes: 接收所述管理器发送的第一扩展SNMP注册响应消息;receiving the first extended SNMP registration response message sent by the manager; 所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;The second SNMP registration request message includes: a second extended SNMP registration request message; 所述在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息包括:After receiving the first SNMP registration response message, sending a second SNMP registration request message to the manager with a second time period as a period includes: 在接收到所述第一扩展SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二扩展SNMP注册请求消息;After receiving the first extended SNMP registration response message, sending a second extended SNMP registration request message to the manager at a second time period; 所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息;The second SNMP registration response message includes: a second extended SNMP registration response message; 所述接收所述管理器发送的第二SNMP注册响应消息包括:The receiving the second SNMP registration response message sent by the manager includes: 接收所述管理器发送的第二扩展SNMP注册响应消息。receiving the second extended SNMP registration response message sent by the manager. 6.根据权利要求1-4任一项所述的方法,其特征在于,6. The method according to any one of claims 1-4, characterized in that, 所述第一SNMP注册请求消息包括:第一简单网络管理协议陷阱SNMP Trap消息;The first SNMP registration request message includes: a first Simple Network Management Protocol trap SNMP Trap message; 所述以第一时间为周期,向管理器发送第一SNMP注册请求消包括:Said taking the first time as a cycle, sending the first SNMP registration request message to the manager includes: 以第一时间为周期,向所述管理器发送所述第一SNMP Trap消息;其中,所述第一SNMPTrap消息中携带有终端设备的设备参数信息;Taking the first time as a period, sending the first SNMP Trap message to the manager; wherein, the first SNMP Trap message carries device parameter information of the terminal device; 所述第一SNMP注册响应消息包括:第一简单网络管理协议信息SNMP inform消息;The first SNMP registration response message includes: the first Simple Network Management Protocol information SNMP inform message; 所述接收所述管理器发送的第一SNMP注册响应消息包括:The receiving the first SNMP registration response message sent by the manager includes: 接收所述管理器发送的第一SNMP inform消息;receiving the first SNMP inform message sent by the manager; 所述第二SNMP注册请求消息包括:第二SNMP Trap消息;The second SNMP registration request message includes: a second SNMP Trap message; 所述在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP注册请求消息包括:After receiving the first SNMP registration response message, sending a second SNMP registration request message to the manager with a second time period as a period includes: 在接收到所述第一SNMP注册响应消息后,以第二时间为周期,向所述管理器发送第二SNMP Trap消息;其中,所述第二SNMP Trap消息中携带有终端设备的设备参数信息;After receiving the first SNMP registration response message, sending a second SNMP Trap message to the manager at a second time period; wherein, the second SNMP Trap message carries device parameter information of the terminal device ; 所述第二SNMP注册响应消息包括:第二SNMP inform消息;The second SNMP registration response message includes: a second SNMP inform message; 所述接收所述管理器发送的第二SNMP注册响应消息包括:The receiving the second SNMP registration response message sent by the manager includes: 接收所述管理器发送的第二SNMP inform消息。receiving the second SNMP inform message sent by the manager. 7.根据权利要求6所述的方法,其特征在于,7. The method of claim 6, wherein, 所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the first SNMP Trap message includes: 所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;In the first SNMP Trap message, a new Trap type is added to identify the device parameter information of the terminal device; 所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the second SNMP Trap message includes: 所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。A new Trap type is added to the second SNMP Trap message to identify device parameter information of the terminal device. 8.一种发现设备的方法,其特征在于,包括:8. A method for discovering devices, comprising: 接收终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;所述SNMP注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息;所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息;所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息;Receive the SNMP registration request message sent by the terminal device; the SNMP registration request message carries the device parameter information of the terminal device; the device parameter information of the terminal device refers to the static information of the terminal device; the SNMP registration The request message includes: a first SNMP registration request message or a second SNMP registration request message; the first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager with the first time period; the The second SNMP registration request message is an SNMP registration request message sent to the manager by the terminal device taking the second time as a cycle; 根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;Determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message; 若确定未注册所述终端设备的设备参数信息,则对所述终端设备的设备参数信息进行注册,并向所述终端设备发送第一SNMP注册响应消息。If it is determined that the device parameter information of the terminal device is not registered, register the device parameter information of the terminal device, and send a first SNMP registration response message to the terminal device. 9.根据权利要求8所述的方法,其特征在于,还包括:9. The method according to claim 8, further comprising: 在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;When it is determined that the device parameter information of the terminal device has been registered, detecting whether the registered device parameter information of the terminal device is the same as the device parameter information of the terminal device carried in the first SNMP registration request message ; 在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,向所述终端设备发送第二SNMP注册响应消息;When it is detected that the registered device parameter information of the terminal device is exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, sending a second SNMP registration response message to the terminal device; 在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并向所述终端设备发送第二SNMP注册响应消息。When it is detected that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the terminal device in the SNMP registration request information, device parameter information of the device, updating the registered device parameter information of the terminal device; and sending a second SNMP registration response message to the terminal device. 10.根据权利要求8或9所述的方法,其特征在于,10. The method according to claim 8 or 9, characterized in that, 在所述SNMP注册请求消息包括第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息;In the case where the SNMP registration request message includes a first SNMP registration request message, the first SNMP registration request message includes: a first extended SNMP registration request message; 在所述SNMP注册请求消息包括第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;In the case where the SNMP registration request message includes a second SNMP registration request message, the second SNMP registration request message includes: a second extended SNMP registration request message; 在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;In the case where it is determined that the device parameter information of the terminal device is not registered, the first SNMP registration response message includes: a first extended SNMP registration response message; 在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。In the case that it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second extended SNMP registration response message. 11.根据权利要求8或9所述的方法,其特征在于,11. The method according to claim 8 or 9, characterized in that, 在所述SNMP注册请求消息包括第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一SNMP Trap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;In the case where the SNMP registration request message includes a first SNMP registration request message, the first SNMP registration request message includes: a first SNMP Trap message; the device parameter information of the terminal device is carried in the first SNMP Trap message; 在所述SNMP注册请求消息包括第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;In the case where the SNMP registration request message includes a second SNMP registration request message, the second SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries device parameter information of the terminal device ; 在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一SNMP inform消息;In the case where it is determined that the device parameter information of the terminal device is not registered, the first SNMP registration response message includes: a first SNMP inform message; 在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二SNMP inform消息。In the case where it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second SNMP inform message. 12.根据权利要求11所述的方法,其特征在于,12. The method of claim 11, wherein, 所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the first SNMP Trap message includes: 在所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;Adding a new Trap type to identify the device parameter information of the terminal device in the first SNMP Trap message; 所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the second SNMP Trap message includes: 在所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。A new Trap type is added to the second SNMP Trap message to identify the device parameter information of the terminal device. 13.一种终端设备,其特征在于,包括:控制单元,发送单元,接收单元;13. A terminal device, comprising: a control unit, a sending unit, and a receiving unit; 所述控制单元,用于在终端设备与管理器之间建立了通信信道后,所述终端设备是未注册或已注册的终端设备,所述接收单元在接收到第一SNMP注册响应消息之前,触发所述发送单元以第一时间为周期,向管理器发送第一SNMP注册请求消息;The control unit is configured to establish a communication channel between the terminal device and the manager, the terminal device is an unregistered or registered terminal device, and before the receiving unit receives the first SNMP registration response message, Triggering the sending unit to send a first SNMP registration request message to the manager with the first time as a period; 所述发送单元,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;The sending unit is configured to send a first SNMP registration request message to the manager with a first time period; the first SNMP registration request message carries device parameter information of the terminal device; the terminal device's The device parameter information refers to the static information of the terminal device; 所述接收单元,用于接收从所述管理器发送来的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息;The receiving unit is configured to receive a first SNMP registration response message sent from the manager; the first SNMP registration response message is the first received SNMP registration response message sent by the manager; 所述控制单元,还用于在所述接收单元在接收到所述第一SNMP注册响应消息之后,触发所述发送单元以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第一SNMP注册请求消息与所述第二SNMP注册请求消息相同或不同;The control unit is further configured to, after the receiving unit receives the first SNMP registration response message, trigger the sending unit to send a second SNMP registration request message to the manager in a period of the second time; The first SNMP registration request message is the same as or different from the second SNMP registration request message; 所述发送单元,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;The sending unit is further configured to send a second SNMP registration request message to the manager with a second time period; the second SNMP registration request message carries device parameter information of the terminal device; 所述接收单元,还用于接收所述管理器发送的第二SNMP注册响应消息;所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。The receiving unit is further configured to receive a second SNMP registration response message sent by the manager; the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message. 14.根据权利要求13所述的终端设备,其特征在于,14. The terminal device according to claim 13, characterized in that, 所述控制单元,还用于配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。The control unit is further configured to configure interface parameters with the manager; the interface parameters are used to establish a connection with the manager. 15.根据权利要求13所述的终端设备,其特征在于,15. The terminal device according to claim 13, characterized in that, 所述第一时间的值小于所述第二时间的值。The value of the first time is less than the value of the second time. 16.根据权利要求13所述的终端设备,其特征在于,16. The terminal device according to claim 13, characterized in that, 所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the second SNMP registration request message includes: 在所述终端设备更新了设备参数信息时,所述第二SNMP注册请求消息中携带有所述终端设备的更新后的设备参数信息。When the terminal device updates the device parameter information, the second SNMP registration request message carries the updated device parameter information of the terminal device. 17.根据权利要求13-16任一项所述的终端设备,其特征在于,17. The terminal device according to any one of claims 13-16, characterized in that, 所述第一SNMP注册请求消息包括:第一简单网络管理协议扩展SNMP注册请求消息;The first SNMP registration request message includes: a first Simple Network Management Protocol extended SNMP registration request message; 所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;The first SNMP registration response message includes: a first extended SNMP registration response message; 所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;The second SNMP registration request message includes: a second extended SNMP registration request message; 所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。The second SNMP registration response message includes: a second extended SNMP registration response message. 18.根据权利要求13-16任一项所述的终端设备,其特征在于,18. The terminal device according to any one of claims 13-16, characterized in that, 所述第一SNMP注册请求消息包括:第一简单网络管理协议陷阱SNMP Trap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;The first SNMP registration request message includes: a first Simple Network Management Protocol trap SNMP Trap message; the first SNMP Trap message carries device parameter information of the terminal device; 所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;The second SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries device parameter information of the terminal device; 所述第一SNMP注册响应消息包括:第一SNMP inform消息;The first SNMP registration response message includes: a first SNMP inform message; 所述第二SNMP注册响应消息包括:第二SNMP inform消息。The second SNMP registration response message includes: a second SNMP inform message. 19.根据权利要求18所述的终端设备,其特征在于,19. The terminal device according to claim 18, characterized in that, 所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the first SNMP Trap message includes: 所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;In the first SNMP Trap message, a new Trap type is added to identify the device parameter information of the terminal device; 所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the second SNMP Trap message includes: 所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。A new Trap type is added to the second SNMP Trap message to identify device parameter information of the terminal device. 20.一种管理器,其特征在于,包括:20. A manager, characterized in that, comprising: 接收单元,用于接收从终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有终端设备的设备参数信息;所述设备参数信息是指所述终端设备的静态信息;所述注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息;所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息;所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息;The receiving unit is used to receive the SNMP registration request message sent from the terminal device; the SNMP registration request message carries the device parameter information of the terminal device; the device parameter information refers to the static information of the terminal device; the registration The request message includes: a first SNMP registration request message or a second SNMP registration request message; the first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager with the first time period; the The second SNMP registration request message is an SNMP registration request message sent to the manager by the terminal device taking the second time as a cycle; 处理单元,用于根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;A processing unit, configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message; 所述处理单元,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册;并触发发送单元向所述终端设备发送第一SNMP注册响应消息;The processing unit is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered; and trigger the sending unit to send the first SNMP registration information to the terminal device response message; 所述发送单元,用于向所述终端设备发送第一SNMP注册响应消息。The sending unit is configured to send a first SNMP registration response message to the terminal device. 21.根据权利要求20所述的管理器,其特征在于,21. The manager of claim 20, wherein: 所述处理单元,还用于在确定出已注册所述终端设备的设备参数信息时,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;The processing unit is further configured to, when it is determined that the device parameter information of the terminal device has been registered, detect the registered device parameter information of the terminal device and the Whether the device parameter information of the terminal device is the same; 所述处理单元,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;The processing unit is further configured to trigger the sending unit when it is detected that the registered device parameter information of the terminal device is exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information Sending a second SNMP registration response message to the terminal device; 所述处理单元,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并触发所述发送单元向所述终端设备发送第二SNMP注册响应消息;The processing unit is further configured to, when it is detected that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the SNMP The device parameter information of the terminal device in the registration request information updates the registered device parameter information of the terminal device; and triggers the sending unit to send a second SNMP registration response message to the terminal device; 所述发送单元,还用于向所述终端设备发送第二SNMP注册响应消息。The sending unit is further configured to send a second SNMP registration response message to the terminal device. 22.根据权利要求20或21所述的管理器,其特征在于,22. The manager of claim 20 or 21, wherein 在所述SNMP注册请求消息包括第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一扩展SNMP注册请求消息;In the case where the SNMP registration request message includes a first SNMP registration request message, the first SNMP registration request message includes: a first extended SNMP registration request message; 在所述SNMP注册请求消息包括第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二扩展SNMP注册请求消息;In the case where the SNMP registration request message includes a second SNMP registration request message, the second SNMP registration request message includes: a second extended SNMP registration request message; 在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一扩展SNMP注册响应消息;In the case where it is determined that the device parameter information of the terminal device is not registered, the first SNMP registration response message includes: a first extended SNMP registration response message; 在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二扩展SNMP注册响应消息。In the case that it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second extended SNMP registration response message. 23.根据权利要求20或21所述的管理器,其特征在于,23. The manager of claim 20 or 21, wherein 在所述SNMP注册请求消息包括第一SNMP注册请求消息的情况下,第一SNMP注册请求消息包括:第一SNMP Trap消息;所述第一SNMP Trap消息中携带有终端设备的设备参数信息;In the case where the SNMP registration request message includes a first SNMP registration request message, the first SNMP registration request message includes: a first SNMP Trap message; the device parameter information of the terminal device is carried in the first SNMP Trap message; 在所述SNMP注册请求消息包括第二SNMP注册请求消息的情况下,所述第二SNMP注册请求消息包括:第二SNMP Trap消息;所述第二SNMP Trap消息中携带有终端设备的设备参数信息;In the case where the SNMP registration request message includes a second SNMP registration request message, the second SNMP registration request message includes: a second SNMP Trap message; the second SNMP Trap message carries device parameter information of the terminal device ; 在所述确定未注册所述终端设备的设备参数信息的情况下,所述第一SNMP注册响应消息包括:第一SNMP inform消息;In the case where it is determined that the device parameter information of the terminal device is not registered, the first SNMP registration response message includes: a first SNMP inform message; 在所述确定出已注册所述终端设备的设备参数信息的情况下,所述第二SNMP注册响应消息包括:第二SNMP inform消息。In the case where it is determined that the device parameter information of the terminal device has been registered, the second SNMP registration response message includes: a second SNMP inform message. 24.根据权利要求23所述的管理器,其特征在于,24. The manager of claim 23, wherein 所述第一SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the first SNMP Trap message includes: 在所述第一SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息;Adding a new Trap type to identify the device parameter information of the terminal device in the first SNMP Trap message; 所述第二SNMP Trap消息中携带有终端设备的设备参数信息包括:The device parameter information of the terminal device carried in the second SNMP Trap message includes: 在所述第二SNMP Trap消息中增加了新的Trap类型标识所述终端设备的设备参数信息。A new Trap type is added to the second SNMP Trap message to identify the device parameter information of the terminal device. 25.一种终端设备,其特征在于,包括:处理器,发送器,接收器;25. A terminal device, comprising: a processor, a transmitter, and a receiver; 所述处理器,用于在终端设备与管理器之间建立了通信信道后,所述终端设备是未注册或已注册的终端设备,所述接收器在接收到第一SNMP注册响应消息之前,触发所述发送器以第一时间为周期,向管理器发送第一SNMP注册请求消息;The processor is configured to establish a communication channel between the terminal device and the manager, the terminal device is an unregistered or registered terminal device, and before the receiver receives the first SNMP registration response message, Triggering the sender to send a first SNMP registration request message to the manager with the first time as a period; 所述发送器,用于以第一时间为周期,向管理器发送第一SNMP注册请求消息;所述第一SNMP注册请求消息中携带有所述终端设备的设备参数信息;所述终端设备的设备参数信息是指所述终端设备的静态信息;The sender is configured to send a first SNMP registration request message to the manager with the first time as a period; the first SNMP registration request message carries device parameter information of the terminal device; the terminal device's The device parameter information refers to the static information of the terminal device; 所述接收器,用于接收从所述管理器发送来的第一SNMP注册响应消息;所述第一SNMP注册响应消息是第一次接到的所述管理器发送的SNMP注册响应消息;The receiver is configured to receive a first SNMP registration response message sent from the manager; the first SNMP registration response message is the first received SNMP registration response message sent by the manager; 所述处理器,还用于在所述接收器在接收到所述第一SNMP注册响应消息之后,触发所述发送器以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第一SNMP注册请求消息与所述第二SNMP注册请求消息相同或不同;The processor is further configured to, after the receiver receives the first SNMP registration response message, trigger the sender to send a second SNMP registration request message to the manager with a second time period as a period; The first SNMP registration request message is the same as or different from the second SNMP registration request message; 所述发送器,还用于以第二时间为周期,向管理器发送第二SNMP注册请求消息;所述第二SNMP注册请求消息中携带有所述终端设备的设备参数信息;The sender is further configured to send a second SNMP registration request message to the manager with a second time period; the second SNMP registration request message carries device parameter information of the terminal device; 所述接收器,还用于接收所述管理器发送的第二SNMP注册响应消息;所述第二SNMP注册响应消息是接收到的除第一SNMP注册响应消息之外的SNMP注册响应消息。The receiver is further configured to receive a second SNMP registration response message sent by the manager; the second SNMP registration response message is a received SNMP registration response message other than the first SNMP registration response message. 26.根据权利要求25所述的终端设备,其特征在于,26. The terminal device according to claim 25, characterized in that, 所述处理器,还用于配置与所述管理器间的接口参数;所述接口参数用于建立与所述管理器间的连接。The processor is further configured to configure interface parameters with the manager; the interface parameters are used to establish a connection with the manager. 27.一种管理器,其特征在于,包括:27. A manager, comprising: 接收器,用于接收从终端设备发送的SNMP注册请求消息;所述SNMP注册请求消息中携带有终端设备的设备参数信息;所述设备参数信息是指所述终端设备的静态信息;所述注册请求消息包括:第一SNMP注册请求消息或第二SNMP注册请求消息;所述第一SNMP注册请求消息是所述终端设备以第一时间为周期,向管理器发送的SNMP注册请求消息;所述第二SNMP注册请求消息是所述终端设备以第二时间为周期,向管理器发送的SNMP注册请求消息;The receiver is configured to receive an SNMP registration request message sent from a terminal device; the SNMP registration request message carries device parameter information of the terminal device; the device parameter information refers to static information of the terminal device; the registration The request message includes: a first SNMP registration request message or a second SNMP registration request message; the first SNMP registration request message is an SNMP registration request message sent by the terminal device to the manager with the first time period; the The second SNMP registration request message is an SNMP registration request message sent to the manager by the terminal device taking the second time as a cycle; 处理器,用于根据所述SNMP注册请求消息中携带的所述终端设备的设备参数信息,确定是否已注册所述终端设备的设备参数信息;A processor, configured to determine whether the device parameter information of the terminal device has been registered according to the device parameter information of the terminal device carried in the SNMP registration request message; 所述处理器,还用于在确定未注册所述终端设备的设备参数信息的情况下,对所述终端设备的设备参数信息进行注册;并触发发送器向所述终端设备发送第一SNMP注册响应消息;The processor is further configured to register the device parameter information of the terminal device when it is determined that the device parameter information of the terminal device is not registered; and trigger the sender to send the first SNMP registration information to the terminal device response message; 所述发送器,用于向所述终端设备发送第一SNMP注册响应消息。The sender is configured to send a first SNMP registration response message to the terminal device. 28.根据权利要求27所述的管理器,其特征在于,28. The manager of claim 27, wherein 所述处理器,还用于,检测已注册的所述终端设备的设备参数信息与所述第一SNMP注册请求消息中携带有的所述终端设备的设备参数信息是否相同;The processor is further configured to detect whether the registered device parameter information of the terminal device is the same as the device parameter information of the terminal device carried in the first SNMP registration request message; 所述处理器,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息完全相同的情况下,触发所述发送器向所述终端设备发送第二SNMP注册响应消息;The processor is further configured to trigger the transmitter when it is detected that the registered device parameter information of the terminal device is exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information Sending a second SNMP registration response message to the terminal device; 所述处理器,还用于在检测出注册的所述终端设备的设备参数信息与所述SNMP注册请求信息中携带的所述终端设备的设备参数信息不完全相同的情况下,根据所述SNMP注册请求信息中的所述终端设备的设备参数信息,更新已注册的所述终端设备的设备参数信息;并触发所述发送器向所述终端设备发送第二SNMP注册响应消息;The processor is further configured to, when it is detected that the registered device parameter information of the terminal device is not exactly the same as the device parameter information of the terminal device carried in the SNMP registration request information, according to the SNMP The device parameter information of the terminal device in the registration request information updates the registered device parameter information of the terminal device; and triggers the sender to send a second SNMP registration response message to the terminal device; 所述发送器,还用于向所述终端设备发送第二SNMP注册响应消息。The sender is further configured to send a second SNMP registration response message to the terminal device. 29.一种发现设备的系统,其特征在于,包括:终端设备,管理器;29. A system for discovering devices, comprising: a terminal device and a manager; 所述终端设备为权利要求13-19任一项所述的终端设备;或者,所述终端设备为权利要求25或26所述的终端设备;The terminal device is the terminal device described in any one of claims 13-19; or, the terminal device is the terminal device described in claim 25 or 26; 所述管理器为权利要求20-24任一项所述的管理器;或者,所述管理器为权利要求27或28所述的管理器。The manager is the manager according to any one of claims 20-24; or, the manager is the manager according to claim 27 or 28.
CN201310421690.3A 2013-09-16 2013-09-16 A kind of method of discovering device, apparatus and system Active CN103501240B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310421690.3A CN103501240B (en) 2013-09-16 2013-09-16 A kind of method of discovering device, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310421690.3A CN103501240B (en) 2013-09-16 2013-09-16 A kind of method of discovering device, apparatus and system

Publications (2)

Publication Number Publication Date
CN103501240A CN103501240A (en) 2014-01-08
CN103501240B true CN103501240B (en) 2017-10-03

Family

ID=49866415

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310421690.3A Active CN103501240B (en) 2013-09-16 2013-09-16 A kind of method of discovering device, apparatus and system

Country Status (1)

Country Link
CN (1) CN103501240B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170373921A1 (en) * 2014-12-25 2017-12-28 Thomson Licensing Method and apparatus for snmp set operations
CN108848147B (en) * 2018-06-04 2021-08-24 京信网络系统股份有限公司 SNMP agent device registration method, device, computer device and storage medium
CN109245929A (en) * 2018-09-13 2019-01-18 京信通信系统(中国)有限公司 Method, apparatus, computer storage medium and the equipment of the automatic discovery network equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6360260B1 (en) * 1996-11-12 2002-03-19 International Business Machines Corporation Discovery features for SNMP managed devices
CN1731740A (en) * 2005-07-29 2006-02-08 杭州华为三康技术有限公司 Network equipment management method and network management system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100550763C (en) * 2005-08-26 2009-10-14 杭州华三通信技术有限公司 The management method of the network equipment and network management system
KR100748701B1 (en) * 2006-09-05 2007-08-13 삼성전자주식회사 Network equipment management system using SNP and its method
CN101188528A (en) * 2007-11-30 2008-05-28 武汉市中光通信公司 Method for alarm synchronization in network management system
CN101572621A (en) * 2008-03-26 2009-11-04 杭州华三通信技术有限公司 Error cause return method and system capable of realizing network management
CN101621455A (en) * 2008-07-02 2010-01-06 华为技术有限公司 Method for managing network equipment, network management station, and equipment
CN102377619A (en) * 2011-11-22 2012-03-14 江苏亿通高科技股份有限公司 Automatic detecting and processing method for communication abnormality of simple network management protocol (SNMP) agent
CN102685877B (en) * 2012-05-16 2015-08-19 北京星网锐捷网络技术有限公司 User data synchronization method, wireless controller and Network Management Equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6360260B1 (en) * 1996-11-12 2002-03-19 International Business Machines Corporation Discovery features for SNMP managed devices
CN1731740A (en) * 2005-07-29 2006-02-08 杭州华为三康技术有限公司 Network equipment management method and network management system

Also Published As

Publication number Publication date
CN103501240A (en) 2014-01-08

Similar Documents

Publication Publication Date Title
US11743153B2 (en) Apparatus and process for monitoring network behaviour of Internet-of-things (IoT) devices
CN106452857B (en) Method for generating configuration information and network control unit
EP2837159B1 (en) System asset repository management
WO2014118622A1 (en) Method of managing zigbee network in the internet of things
CN103036732B (en) A kind of method of network monitoring process, system and equipment
TW201543243A (en) Capability monitoring in a service oriented architecture
CN108028835B (en) Automatic configuration server and server execution method
CN104301141B (en) A kind of method, apparatus and system for preserving configuration information
CN108471369A (en) A kind of network dialing method, device and storage medium
KR101139836B1 (en) Method and system for two-phase mechanism for discovering web services based management service
CN105704042A (en) Message processing method, BNG and BNG cluster system
CN104202314B (en) A kind of method and device for preventing DDOS attack
CN103501240B (en) A kind of method of discovering device, apparatus and system
US11038898B2 (en) Slow protocol packet processing method and related apparatus
US9961163B2 (en) Method and system for notifying subscriber devices in ISP networks
US8422400B2 (en) Method and apparatus for discovering devices in a network
CN106230667B (en) VTEP keep-alive detection method and device
US10097418B2 (en) Discovering network nodes
KR20160118813A (en) Gateway device being connected to remote server through mobile network and ip management method thereof
CN104660506B (en) A kind of method, apparatus and system of data packet forwarding
CN116709575A (en) Network connection method and device, electronic equipment and readable storage medium
CN105634810B (en) Method and system for accessing universal plug and play device, access device
EP2077018A1 (en) Method for controlling access to a network in a communication system
CN110505075A (en) Device management method and related devices
CN108616390A (en) The realization device of girff management method, device and girff management

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220215

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right