WO2014169879A1 - Device status updating method and device - Google Patents

Device status updating method and device Download PDF

Info

Publication number
WO2014169879A1
WO2014169879A1 PCT/CN2014/078336 CN2014078336W WO2014169879A1 WO 2014169879 A1 WO2014169879 A1 WO 2014169879A1 CN 2014078336 W CN2014078336 W CN 2014078336W WO 2014169879 A1 WO2014169879 A1 WO 2014169879A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
status
devices
same
offline
Prior art date
Application number
PCT/CN2014/078336
Other languages
French (fr)
Chinese (zh)
Inventor
殷宝玉
缪泽锋
吴春明
吴水生
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2014169879A1 publication Critical patent/WO2014169879A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0866Checking the configuration
    • H04L41/0873Checking configuration conflicts between network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for updating a device state. Background technique
  • Tr069 CPE WAN Management Protocol
  • SNMP Simple Network Management Protocol
  • the embodiment of the invention provides a method and a device for updating a device state, which are used to solve the above technical problem.
  • an embodiment of the present invention provides a method for updating a device state, where the method includes:
  • the first device is the device that obtains the latest IP address.
  • finding a plurality of devices having the same IP address comprises: when the device acquires a new IP Receiving a trigger message of the device, where the trigger message is used to trigger a search operation of multiple devices having the same new IP address; searching for the same new IP address according to the trigger message Multiple devices.
  • the device state of the first device in the foregoing multiple devices is kept in an online state, and the device state of the other device is set to an offline state, including: maintaining a device state of the device that obtains the new IP address online. ; Set the device status of the above multiple settings found to be offline.
  • searching for the plurality of devices having the same IP address comprises: periodically searching for whether there are multiple devices having the same IP address; and when finding a plurality of devices having the same IP address, determining time for each device to acquire the IP address .
  • the device state of the first device is maintained in an online state, and the device state of the other device is set to an offline state, including: according to the determined time for each device to obtain an IP address, the latest acquisition is obtained.
  • the device status of the device with the IP address remains online; the device status of the other device is set to the offline state.
  • the present invention also provides an apparatus for updating a device state, wherein the device includes: a lookup module configured to search for a plurality of devices having the same IP address; and a status update module configured to The device state of the first device of the plurality of devices is kept in an online state, and the device state of the device other than the first device is set to an offline state; wherein the first device is newly obtained IP address device.
  • the foregoing search module includes: a triggering subunit configured to: when the device acquires a new IP address, receive a trigger message of the device; wherein the trigger message is used for triggering, having the same new IP address.
  • a triggering subunit configured to: when the device acquires a new IP address, receive a trigger message of the device; wherein the trigger message is used for triggering, having the same new IP address.
  • a lookup operation of the plurality of devices the first lookup subunit configured to search for a plurality of devices having the same new IP address as described above according to the trigger message.
  • the status update module includes: a first online holding subunit configured to keep a device status of the device that acquires the new IP address in an online state; and a first offline setting subunit configured to find the above multiple The set device status is set to offline.
  • the foregoing search module includes: a second search subunit configured to periodically search for whether to save In a plurality of devices having the same IP address; the time determining subunit is configured to determine when each device acquires the IP address when finding multiple devices having the same IP address.
  • the status update module includes: a second online holding sub-unit configured to keep the device status of the device that has recently obtained the IP address in an online state according to the determined time for obtaining the IP address of each device; , configured to set the device status of other devices to offline.
  • the device state of the device that newly obtained the IP address is kept online, and the device state of the other device is set to the offline state.
  • the invention solves the problem that the device status update is not timely and inaccurate in the related art.
  • the present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline.
  • the normal update structure 4 Structured Query Language (referred to as SQL) can achieve state update.
  • FIG. 1 is a flowchart of a method for updating a device state according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a device 1 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a device 2 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention
  • FIG. 4 is a schematic flowchart of a device 3 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of the device 1 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention
  • FIG. 6 is a device 2 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention; Schematic diagram of the address;
  • FIG. 7 is a schematic flowchart of a device 3 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention
  • FIG. 8 is a schematic flowchart of performing a batch update task in a network management system at a certain time according to an embodiment of the present invention
  • FIG. 9 is a flow chart of a real-time update mode according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of a periodic batch update manner according to an embodiment of the present invention.
  • FIG. 11 is a block diagram showing the structure of an apparatus for updating a device state according to an embodiment of the present invention. detailed description
  • the present invention provides a method and device for updating the state of the device.
  • the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting.
  • the IP address of the NMS assigned to the device will be Reuse, the device of the same IP address exists in the network management system.
  • the device state that has obtained the latest IP address is online, and the device state that has obtained the IP before. Real-time or regular batch settings are offline.
  • FIG. 1 is a flowchart of a method for updating a device state according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps (step S102-step S104) :
  • Step S102 searching for multiple devices having the same IP address
  • step S104 the device state of the first device in the plurality of devices is kept in an online state, and the device state of the devices other than the first device is set to an offline state.
  • the device state of the device that newly obtained the IP address is kept online, and the device state of the other device is set to the offline state.
  • the invention solves the problem that the device status update is not timely and inaccurate in the related art.
  • the present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline. Ordinary update SQL can achieve state updates.
  • the first device after the first device obtains a new IP address on the DHCP server side, the first device sends the network management to the network management system.
  • the network management system can usually be processed in two ways:
  • the first way Real-time update mode. After the first device reports the new IP address, the DHCP server is immediately triggered to find multiple devices of the same IP in the system, and the status of the devices other than the first device is updated to the offline state. , thereby achieving accurate monitoring of the device status from the online state to the offline state;
  • the second way Cycle batch update mode. After the network management system enables a task and calculates the older devices in the same IP address, the offline status update function is implemented in batches. This method is applicable to the case where the real-time performance of the status monitoring is not high, because it is batch processing, compared with the first type. The way is much more efficient.
  • the present embodiment provides a preferred implementation manner, that is, the multiple devices having the same IP address are: when the device obtains a new IP address, receiving a trigger message of the device; The trigger message is used to trigger a lookup operation of multiple devices having the same new IP address; and find a plurality of devices having the same new IP address according to the trigger message.
  • the device state of the first device in the foregoing multiple devices is kept online, and the device state of the other device is set to the offline state, including: maintaining the device state of the device that obtains the new IP address in an online state; The device status of the other devices of the plurality of the same IPs mentioned above is set to the offline state.
  • this embodiment provides a preferred implementation manner, that is, searching for multiple devices having the same IP address includes: periodically searching for whether multiple devices having the same IP address exist; finding the same IP When multiple devices of an address are determined, it is determined when each device acquires the IP address.
  • the device status is set to the offline state, including: according to the determined time for each device to obtain an IP address, the device state of the device that has obtained the latest IP address is kept online; and the device state of the other device is set to the offline state.
  • the present embodiment achieves the following effects: High efficiency, no need to poll the device, and only need to count the devices of the same IP address in the system to determine that the state of these devices is offline. Simple, actual ordinary update SQL statement can achieve state updates. Compared with the prior art, the existing technology needs to poll the device, and the device can obtain the relevant parameters to determine whether the device is online or offline, which is very expensive, and is not needed in this embodiment, thereby saving cost.
  • the real-time update mode and the periodic batch update mode are respectively described in detail by the specific embodiment.
  • the real-time update mode means that when each device reports a new IP, it will immediately trigger the system to find the record of the same IP. If found, then Clear the IP address in the record and set the status to offline.
  • FIG. 2 is a schematic flowchart of the device 1 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention. As shown in FIG. 2, the device 1 is assigned an IP1 address, and the message including the IP1 address is reported to the network management system. The process is as follows:
  • Step 1 Device 1 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server assigns IP1 to device 1.
  • Step 3 The device 1 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of device 1 and the device status is online.
  • Step 5 The NMS returns a successful packet to the device 1.
  • FIG. 3 is a schematic flowchart of the device 2 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention.
  • device 2 is assigned an IP1 address, and IP1 is included.
  • the message of the address is reported to the network management system.
  • the network management system triggers the process of clearing the IP address of device 1 in real time, as follows:
  • Step 1 Device 2 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server assigns IP1 to device 2.
  • Step 3 Device 2 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of the device 2 and the device status is online. At the same time, check Find device 1 with the same IP address, clear the IP address of device 1, and set the status to offline.
  • Step 5 The network management replies to the device 2.
  • the schematic diagram of the process shows that after the DHCP server reclaims the IP1, the device 3 is assigned an IP1 address, and the message containing the IP1 address is reported to the network management system.
  • the network management system triggers the real-time emptying of the IP address of the device 2.
  • Step 1 Device 3 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server assigns IP1 to device 3.
  • Step 3 Device 3 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of the device 3 and the device status is online. At the same time, the device 2 with the same IP address is found, and the IP address of the device 2 is cleared, and the concatenation status is offline.
  • Step 5 The network management replies to the device 3, and the process ends.
  • the periodic batch update mode means that the system periodically searches for records with the same IP. If it exists, the system clears the IP address of the previously contacted device according to the latest contact time of the device, and sets the status to offline.
  • FIG. 5 is a schematic diagram of a process of acquiring and reporting an IP address by the device 1 in a periodic batch update mode according to an embodiment of the present invention. As shown in FIG. 5, the process is as follows:
  • Step 1 Device 1 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server assigns IP1 to device 1.
  • Step 3 The device 1 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of device 1 and the device status is online.
  • Step 5 The NMS responds to the device to the device 1.
  • FIG. 6 is a schematic diagram of a process of acquiring and reporting an IP address by the device 2 in a periodic batch update mode according to an embodiment of the present invention.
  • the device 2 allocates an IP1 address, and will include
  • the process of reporting the message of the IP1 address to the network management system is as follows: Step 1: Device 2 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server allocates IP1 to device 2.
  • Step 3 The device 2 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of device 2 and the device status is online.
  • Step 5 The NMS responds to the packet to the device 2.
  • Step 1 Device 3 sends an IP request to the DHCP server.
  • Step 2 The DHCP Server assigns IP1 to device 3.
  • Step 3 The device 3 sends the obtained IP address IP1 to the network management system.
  • Step 4 The network management system records the IP address of device 3 and the device status is online.
  • Step 5 The NMS responds to the packet to the device 3.
  • FIG. 8 is a schematic diagram of a process of performing a batch update task in a network management system at a certain time according to an embodiment of the present invention. As shown in FIG. 8, the process is specifically as follows: Start a periodic batch update task, find all devices with the same IP address, and find To device 1, device 2, and device 3, the network management system finds that device 3 is the closest device according to the time, sets the state of device 1 and device 2 offline, and clears its IP address.
  • both states can achieve the purpose of monitoring device status.
  • the real-time update method is executed immediately, and the real-time performance is good, but it exerts great pressure on the system performance;
  • the periodic batch update mode has poor real-time performance, and because it is a batch mode, the system pressure can be greatly reduced.
  • FIG. 9 is a flowchart of a real-time update manner according to an embodiment of the present invention. As shown in FIG. 9, the flow includes the following steps (step S902-step S922):
  • Step S902 the IP1 address is idle.
  • Step S904 DHCP allocates IP1 to device 1.
  • Step S906 The device 1 reports the IP1 address information to the network management system.
  • Step S908 DHCP reclaims the IP1 address.
  • step S910 the DHCP allocates the IP1 address to the device 2.
  • step S912 the device 2 reports the IP1 address information to the network management system.
  • step S914 the network administrator updates the status and address of the device 1.
  • Step S916 DHCP reclaims the IP1 address.
  • step S920 the device 3 reports the IP1 address information to the network management system.
  • step S922 the network administrator updates the status and address of the device 2.
  • FIG. 10 is a flowchart of a periodic batch update manner according to an embodiment of the present invention. As shown in FIG. 10, the flow includes the following steps (step S1002 - step S1020):
  • Step S1002 the IP1 address is idle.
  • step S1004 DHCP allocates IP1 to device 1.
  • step S1006 the device 1 reports the IP1 address information to the network management system.
  • Step S1008 DHCP reclaims the IP1 address.
  • step S1010 DHCP allocates an IP1 address to device 2.
  • step S1012 the device 2 reports the IP1 address information to the network management system.
  • step S1014 the DHCP reclaims the IP1 address.
  • step S1016 DHCP allocates an IP1 address to device 3.
  • step S1018 the device 3 reports the IP1 address information to the network management system.
  • step S1020 the network management system starts the update task, and the status and address of the device 1 and the device 2 are more corresponding to the update method of the device state introduced in the foregoing embodiment.
  • the embodiment provides a device state update device, which is used to implement the foregoing.
  • FIG. 11 is a structural block diagram of an apparatus for updating a device state according to an embodiment of the present invention. As shown in FIG. 11, the device includes: a lookup module 10 and a status update module 21. The structure is described in detail below.
  • the searching module 10 is configured to find multiple devices with the same IP address
  • the status update module 20 is connected to the search module 10, and is configured to keep the device status of the first device of the multiple devices in an online state, and set the device status of the devices other than the first device among the multiple devices. Set to an offline state; wherein, the first device is the latest device that obtains the IP address Ready.
  • the status update module 20 keeps the device status of the device that newly obtained the IP address online, and sets the device status of the other device to the offline status.
  • the invention solves the problem that the device status update is not timely and inaccurate in the related art.
  • the present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline.
  • Ordinary update SQL can achieve state updates.
  • the above search module and status update module can be implemented by hardware such as DSP or CPU.
  • the present embodiment provides a preferred implementation manner, that is, the foregoing search module 10 may include: a trigger sub-unit, configured to receive the device when the device acquires a new IP address.
  • the trigger message is used to trigger a lookup operation of multiple devices having the same new IP address; the first search subunit is configured to search for the same new IP address according to the trigger message. Multiple devices.
  • the status update module 20 may include: a first online holding subunit, configured to set a device status obtained by using the plurality of settings that are found to be an offline status.
  • the present embodiment provides a preferred implementation manner, that is, the foregoing search module 10 may include: a second search sub-unit, configured to periodically search for whether there is a same IP address.
  • the time determining subunit is used to determine when each device obtains the IP address when finding multiple devices with the same IP address.
  • the status update module 20 may include: a second online holding sub-unit, configured to keep the device status of the device that has obtained the latest IP address to the online state according to the determined time of obtaining the IP address by each device; Set subunits to set the device status of other devices to offline.
  • the method and device for updating the device status include, but not limited to, the SNMP protocol, the Tr069 protocol, and the like, which are applicable to the network management protocol for large-scale network element management. It is efficient and simple, and it is suitable for use in massive devices.
  • the device obtains the IP address of the network management system as DHCP. In the case where the DHCP server address pool is small, the smaller the address pool, the more accurate the monitoring status is.

Landscapes

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

Abstract

The present invention discloses a device status updating method and device, said method comprising: searching for a plurality of devices having an identical Internet protocol (IP) address; maintaining an online status for a first device of the plurality of devices, and setting an offline status for all of the plurality of devices except for the first device; wherein, of the plurality of devices, said first device is the device which most recently obtains the IP address.

Description

一种设备状态的更新方法及装置 技术领域  Method and device for updating device state
本发明涉及通信领域, 特别是涉及一种设备状态的更新方法及装置。 背景技术  The present invention relates to the field of communications, and in particular, to a method and apparatus for updating a device state. Background technique
海量设备的网管系统的一大管理难题,就是实时监控全网设备的在线状态, 在常用的网管协议如 Tr069( CPE广域网管理协议)和简单网络管理协议( Simple Network Management Protocol, 简称为 SNMP )中, 一般只是上艮设备上电, 而 不上报设备掉电, 导致系统无法知道设备是否已经离线了, 如果想知道设备的 确切状态, 要对每个设备进行逐个轮询, 设备的数量越多, 需要损耗的系统性 能越多, 因而对系统的性能要求也越高。  A major management problem of the network management system of mass equipment is to monitor the online status of the entire network in real time. In common network management protocols such as Tr069 (CPE WAN Management Protocol) and Simple Network Management Protocol (SNMP). Generally, only the device on the power is powered on, and the device is not powered down. The system cannot know whether the device is offline. If you want to know the exact state of the device, you need to poll each device one by one. The more devices, the more devices. The more system performance that requires loss, the higher the performance requirements of the system.
但实际上, 并非每个设备都需要轮询, 由于上报消息会将设备的状态更新 为在线, 所以不在线状态的设备的状态可以认为是准确的, 如何将设备的在线 状态的及时准确的更新为不在线状态, 这是一个有待解决的问题。 针对相关技 术中设备状态更新不及时不准确问题, 目前尚未提出有效的解决方案。 发明内容  In fact, not every device needs to be polled. Since the status of the device will be updated to online, the status of the device in the offline state can be considered accurate. How to update the online status of the device in time and accurately For the offline status, this is a problem to be solved. In view of the inaccuracy of equipment status update in related technologies, no effective solution has been proposed yet. Summary of the invention
本发明实施例提供了一种设备状态的更新方法及装置, 用以解决上述技术 问题。  The embodiment of the invention provides a method and a device for updating a device state, which are used to solve the above technical problem.
根据本发明的一个方面, 本发明实施例提供了一种设备状态的更新方法, 其中, 该方法包括:  According to an aspect of the present invention, an embodiment of the present invention provides a method for updating a device state, where the method includes:
查找具有相同 IP地址的多个设备;将上述多个设备中的第一设备的设备状 态保持在线状态, 将上述多个设备中除上述第一设备之外的其他设备的设备状 态, 设置为离线状态; 其中, 上述第一设备是最新获得该 IP地址的设备。  Finding a plurality of devices having the same IP address; maintaining the device state of the first device of the plurality of devices online, and setting the device state of the devices other than the first device to offline The first device is the device that obtains the latest IP address.
优选地, 查找具有相同 IP地址的多个设备, 包括: 当设备获取到新的 IP 地址时, 接收到上述设备的触发消息; 其中, 上述触发消息用于触发, 具有相 同的上述新的 IP地址的多个设备的查找操作;根据上述触发消息查找具有相同 的上述新的 IP地址的多个设备。 Preferably, finding a plurality of devices having the same IP address comprises: when the device acquires a new IP Receiving a trigger message of the device, where the trigger message is used to trigger a search operation of multiple devices having the same new IP address; searching for the same new IP address according to the trigger message Multiple devices.
优选地, 将上述多个设备中的第一设备的设备状态保持在线状态, 将上述 其他设备的设备状态设置为离线状态, 包括: 将获取到上述新的 IP地址的设备 的设备状态保持在线状态; 将查找到的上述多个设置的设备状态设置为离线状 态。  Preferably, the device state of the first device in the foregoing multiple devices is kept in an online state, and the device state of the other device is set to an offline state, including: maintaining a device state of the device that obtains the new IP address online. ; Set the device status of the above multiple settings found to be offline.
优选地, 查找具有相同 IP地址的多个设备包括: 周期性查找是否存在具有 相同 IP地址的多个设备; 在查找到具有相同 IP地址的多个设备时, 确定各个 设备获取该 IP地址的时间。  Preferably, searching for the plurality of devices having the same IP address comprises: periodically searching for whether there are multiple devices having the same IP address; and when finding a plurality of devices having the same IP address, determining time for each device to acquire the IP address .
优选地, 将上述多个设备中的第一设备的设备状态保持在线状态, 将上述 其他设备的设备状态设置为离线状态, 包括: 根据确定的各个设备获取 IP地址 的时间, 将最新获取到上述 IP地址的设备的设备状态保持在线状态; 将其他设 备的设备状态设置为离线状态。  Preferably, the device state of the first device is maintained in an online state, and the device state of the other device is set to an offline state, including: according to the determined time for each device to obtain an IP address, the latest acquisition is obtained. The device status of the device with the IP address remains online; the device status of the other device is set to the offline state.
根据本发明的另一方面,本发明还提供了一种设备状态的更新装置, 其中, 该装置包括: 查找模块, 配置为查找具有相同 IP地址的多个设备; 状态更新模 块, 配置为将上述多个设备中的第一设备的设备状态保持在线状态, 将上述多 个设备中除上述第一设备之外的其他设备的设备状态,设置为离线状态; 其中, 上述第一设备是最新获得该 IP地址的设备。  According to another aspect of the present invention, the present invention also provides an apparatus for updating a device state, wherein the device includes: a lookup module configured to search for a plurality of devices having the same IP address; and a status update module configured to The device state of the first device of the plurality of devices is kept in an online state, and the device state of the device other than the first device is set to an offline state; wherein the first device is newly obtained IP address device.
优选地, 上述查找模块包括: 触发子单元, 配置为当设备获取到新的 IP地 址时, 接收到上述设备的触发消息; 其中, 上述触发消息用于触发, 具有相同 的上述新的 IP地址的多个设备的查找操作; 第一查找子单元, 配置为根据上述 触发消息查找具有相同的上述新的 IP地址的多个设备。  Preferably, the foregoing search module includes: a triggering subunit configured to: when the device acquires a new IP address, receive a trigger message of the device; wherein the trigger message is used for triggering, having the same new IP address. A lookup operation of the plurality of devices; the first lookup subunit configured to search for a plurality of devices having the same new IP address as described above according to the trigger message.
优选地, 上述状态更新模块包括: 第一在线保持子单元, 配置为将获取到 上述新的 IP地址的设备的设备状态保持在线状态; 第一离线设置子单元, 配置 为将查找到的上述多个设置的设备状态设置为离线状态。  Preferably, the status update module includes: a first online holding subunit configured to keep a device status of the device that acquires the new IP address in an online state; and a first offline setting subunit configured to find the above multiple The set device status is set to offline.
优选地, 上述查找模块包括: 第二查找子单元, 配置为周期性查找是否存 在具有相同 IP地址的多个设备; 时间确定子单元, 配置为在查找到具有相同 IP 地址的多个设备时, 确定各个设备获取该 IP地址的时间。 Preferably, the foregoing search module includes: a second search subunit configured to periodically search for whether to save In a plurality of devices having the same IP address; the time determining subunit is configured to determine when each device acquires the IP address when finding multiple devices having the same IP address.
优选地, 状态更新模块包括: 第二在线保持子单元, 配置为根据确定的各 个设备获取 IP地址的时间, 将最新获取到上述 IP地址的设备的设备状态保持 在线状态; 第二离线设置子单元, 配置为将其他设备的设备状态设置为离线状 态。  Preferably, the status update module includes: a second online holding sub-unit configured to keep the device status of the device that has recently obtained the IP address in an online state according to the determined time for obtaining the IP address of each device; , configured to set the device status of other devices to offline.
通过本发明, 对于具有相同 IP地址的多个设备, 将最新获得该 IP地址的 设备的设备状态保持在线状态, 将其他设备的设备状态设置为离线状态。 解决 了相关技术中设备状态更新不及时不准确的问题, 本发明实施起来高效简单, 不需要轮询设备,只需要通过统计系统中相同 IP地址的设备就能确定这些设备 的状态为离线状态,普通的 update结构 4匕查询语句( Structured Query Language, 简称为 SQL )就能实现状态的更新。  With the present invention, for a plurality of devices having the same IP address, the device state of the device that newly obtained the IP address is kept online, and the device state of the other device is set to the offline state. The invention solves the problem that the device status update is not timely and inaccurate in the related art. The present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline. The normal update structure 4 Structured Query Language (referred to as SQL) can achieve state update.
上述说明仅是本发明技术方案的概述, 为了能够更清楚了解本发明的技术 手段, 而可依照说明书的内容予以实施, 并且为了让本发明的上述和其它目的、 特征和优点能够更明显易懂, 以下特举本发明的具体实施方式。 附图说明  The above description is only an overview of the technical solutions of the present invention, and the technical means of the present invention can be more clearly understood, and can be implemented in accordance with the contents of the specification, and the above and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below. DRAWINGS
图 1 是根据本发明实施例的设备状态的更新方法的流程图;  1 is a flowchart of a method for updating a device state according to an embodiment of the present invention;
图 2是根据本发明实施例的实时更新方式中设备 1获取及上报 IP地址的 流程示意图;  2 is a schematic flowchart of a device 1 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention;
图 3 是根据本发明实施例的实时更新方式中设备 2获取及上报 IP地址的 流程示意图;  3 is a schematic flowchart of a device 2 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention;
图 4是根据本发明实施例的实时更新方式中设备 3获取及上报 IP地址的 流程示意图;  4 is a schematic flowchart of a device 3 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention;
图 5 是根据本发明实施例的周期批量更新方式中设备 1获取及上报 IP地 址的流程示意图;  FIG. 5 is a schematic flowchart of the device 1 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention;
图 6是根据本发明实施例的周期批量更新方式中设备 2获取及上报 IP地 址的流程示意图; 6 is a device 2 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention; Schematic diagram of the address;
图 7是根据本发明实施例的周期批量更新方式中设备 3获取及上报 IP地 址的流程示意图;  7 is a schematic flowchart of a device 3 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention;
图 8 是根据本发明实施例的在某个时刻网管系统中执行批量更新任务的 流程示意图;  FIG. 8 is a schematic flowchart of performing a batch update task in a network management system at a certain time according to an embodiment of the present invention; FIG.
图 9是根据本发明实施例的实时更新方式流程图;  9 is a flow chart of a real-time update mode according to an embodiment of the present invention;
图 10是根据本发明实施例的周期批量更新方式流程图;  FIG. 10 is a flowchart of a periodic batch update manner according to an embodiment of the present invention; FIG.
图 11 是根据本发明实施例的设备状态的更新装置的结构框图。 具体实施方式  11 is a block diagram showing the structure of an apparatus for updating a device state according to an embodiment of the present invention. detailed description
为了解决现有技术设备状态更新不及时不准确的问题, 本发明提供了一种 设备状态的更新方法及装置, 以下结合附图以及实施例, 对本发明进行进一步 详细说明。 应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不限 定本发明。  In order to solve the problem that the status update of the device in the prior art is not timely and inaccurate, the present invention provides a method and device for updating the state of the device. The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to be limiting.
在监控的设备中, 由于动态主机设置协议 ( Dynamic Host Configuration Protocol , 简称为 DHCP )地址池中互联网协议 ( Internet Protocol , 简称为 IP ) 地址个数的限制, 会导致设备分配到的网管 IP地址会重复利用, 造成网管系统 中相同 IP地址的设备存在, 在本发明的实施方案中, 相同 IP地址的这些设备 中, 最新获得此 IP地址的设备状态为在线, 而之前获得过此 IP的设备状态实 时或者定期批量的设置为离线。  In the monitored device, due to the limitation of the number of Internet Protocol (IP) addresses in the Dynamic Host Configuration Protocol (DHCP) address pool, the IP address of the NMS assigned to the device will be Reuse, the device of the same IP address exists in the network management system. In the embodiment of the present invention, among the devices with the same IP address, the device state that has obtained the latest IP address is online, and the device state that has obtained the IP before. Real-time or regular batch settings are offline.
本实施例提供了一种设备状态的更新方法, 图 1是根据本发明实施例的设 备状态的更新方法的流程图, 如图 1所示, 该方法包括以下步骤(步骤 S102- 步骤 S 104 ):  This embodiment provides a method for updating a device state. FIG. 1 is a flowchart of a method for updating a device state according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps (step S102-step S104) :
步骤 S102, 查找具有相同 IP地址的多个设备;  Step S102, searching for multiple devices having the same IP address;
步骤 S104, 将多个设备中第一设备的设备状态保持为在线状态, 将多个设 备中除上述第一设备之外的其他设备的设备状态设置为离线状态; 其中, 上述 第一设备为所述多个设备中最新获得该 IP地址的设备。 通过上述方法, 对于具有相同 IP地址的多个设备, 将最新获得该 IP地址 的设备的设备状态保持在线状态, 将其他设备的设备状态设置为离线状态。 解 决了相关技术中设备状态更新不及时不准确的问题,本发明实施起来高效简单, 不需要轮询设备,只需要通过统计系统中相同 IP地址的设备就能确定这些设备 的状态为离线状态, 普通的 update SQL就能实现状态的更新。 In step S104, the device state of the first device in the plurality of devices is kept in an online state, and the device state of the devices other than the first device is set to an offline state. The device that newly obtained the IP address among the plurality of devices. Through the above method, for a plurality of devices having the same IP address, the device state of the device that newly obtained the IP address is kept online, and the device state of the other device is set to the offline state. The invention solves the problem that the device status update is not timely and inaccurate in the related art. The present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline. Ordinary update SQL can achieve state updates.
在本发明的实施方案中, 所述第一设备在 DHCP服务器侧获取到新的 IP 地址后, 会以 艮文方式上艮给网管, 网管通常可以采用两种方式来处理:  In the embodiment of the present invention, after the first device obtains a new IP address on the DHCP server side, the first device sends the network management to the network management system. The network management system can usually be processed in two ways:
第一种方式: 实时更新方式。 当所述第一设备上报新 IP地址后, 立即触发 DHCP服务器查找到系统中相同 IP的多个设备,将所述多个设备中除所述第一 设备外的这些设备的状态更新为离线状态, 从而实现设备状态由在线状态到离 线状态的准确监控;  The first way: Real-time update mode. After the first device reports the new IP address, the DHCP server is immediately triggered to find multiple devices of the same IP in the system, and the status of the devices other than the first device is updated to the offline state. , thereby achieving accurate monitoring of the device status from the online state to the offline state;
第二种方式: 周期批量更新方式。 在网管系统启用一个任务, 计算出相同 IP地址中较老的设备后, 批量实现更新离线状态功能, 此方法适用于状态监控 的实时性要求不高的情况, 由于是批量处理, 比第 1种方式的效率要高很多。  The second way: Cycle batch update mode. After the network management system enables a task and calculates the older devices in the same IP address, the offline status update function is implemented in batches. This method is applicable to the case where the real-time performance of the status monitoring is not high, because it is batch processing, compared with the first type. The way is much more efficient.
基于上述第一种方式, 本实施例提供了一种优选实施方式, 即查找具有相 同 IP地址的多个设备包括: 当设备获取到新的 IP地址时, 接收到上述设备的 触发消息; 其中, 上述触发消息用于触发, 具有相同的上述新的 IP地址的多个 设备的查找操作;根据上述触发消息查找具有相同的上述新的 IP地址的多个设 备。  Based on the first mode, the present embodiment provides a preferred implementation manner, that is, the multiple devices having the same IP address are: when the device obtains a new IP address, receiving a trigger message of the device; The trigger message is used to trigger a lookup operation of multiple devices having the same new IP address; and find a plurality of devices having the same new IP address according to the trigger message.
将上述多个设备中的第一设备的设备状态保持在线状态, 将上述其他设备 的设备状态设置为离线状态, 包括: 将获取到上述新的 IP地址的设备的设备状 态保持在线状态;将查找到的上述多个相同 IP的其他设备的设备状态设置为离 线状态。  The device state of the first device in the foregoing multiple devices is kept online, and the device state of the other device is set to the offline state, including: maintaining the device state of the device that obtains the new IP address in an online state; The device status of the other devices of the plurality of the same IPs mentioned above is set to the offline state.
基于上述第一种方式, 本实施例提供了一种优选实施方式, 即查找具有相 同 IP地址的多个设备包括: 周期性查找是否存在具有相同 IP地址的多个设备; 在查找到具有相同 IP地址的多个设备时, 确定各个设备获取该 IP地址的时间。  Based on the foregoing first manner, this embodiment provides a preferred implementation manner, that is, searching for multiple devices having the same IP address includes: periodically searching for whether multiple devices having the same IP address exist; finding the same IP When multiple devices of an address are determined, it is determined when each device acquires the IP address.
将上述多个设备中的第一设备的设备状态保持在线状态, 将上述其他设备 的设备状态设置为离线状态, 包括: 根据确定的各个设备获取 IP地址的时间, 将最新获取到上述 IP地址的设备的设备状态保持在线状态;将其他设备的设备 状态设置为离线状态。 Keeping the device state of the first device among the plurality of devices online, and the other devices are The device status is set to the offline state, including: according to the determined time for each device to obtain an IP address, the device state of the device that has obtained the latest IP address is kept online; and the device state of the other device is set to the offline state.
通过上述介绍的两种优选实施方式, 本实施例达到了以下效果: 高效, 不 需要轮询设备,只需要通过统计系统中相同 IP地址的设备就能确定这些设备的 状态为离线。 简单, 实际的普通的 update SQL语句就能实现状态的更新。 与现 有技术相比较, 现有的技术需要轮询设备, 在设备取到相关的参数才能确定设 备是否在线还是离线, 代价非常大, 本实施例则不需要, 从而节约了成本。  Through the two preferred embodiments described above, the present embodiment achieves the following effects: High efficiency, no need to poll the device, and only need to count the devices of the same IP address in the system to determine that the state of these devices is offline. Simple, actual ordinary update SQL statement can achieve state updates. Compared with the prior art, the existing technology needs to poll the device, and the device can obtain the relevant parameters to determine whether the device is online or offline, which is very expensive, and is not needed in this embodiment, thereby saving cost.
下面分别通过具体实施例对实时更新方式和周期批量更新方式进行详细介 绍, 实时更新方式是指, 当每个设备上报上新 IP后, 会立即触发系统去查找相 同 IP的记录, 如果找到, 则将记录中的 IP地址清空, 状态置为离线。  The real-time update mode and the periodic batch update mode are respectively described in detail by the specific embodiment. The real-time update mode means that when each device reports a new IP, it will immediately trigger the system to find the record of the same IP. If found, then Clear the IP address in the record and set the status to offline.
图 2是根据本发明实施例的实时更新方式中设备 1获取及上报 IP地址的流 程示意图, 如图 2所示, 显示了设备 1分配到 IP1地址, 并将包含 IP1地址的 消息上报给网管系统的过程, 具体如下:  2 is a schematic flowchart of the device 1 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention. As shown in FIG. 2, the device 1 is assigned an IP1 address, and the message including the IP1 address is reported to the network management system. The process is as follows:
步骤 1 , 设备 1向 DHCP Server发送获取 IP请求。  Step 1: Device 1 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IP1给设备 1。  Step 2. The DHCP Server assigns IP1 to device 1.
步骤 3 , 设备 1向网管系统发送获取到的 IP地址 IP1。  Step 3: The device 1 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 1的 IP地址并置设备状态为在线。  Step 4: The network management system records the IP address of device 1 and the device status is online.
步骤 5, 网管回复成功报文给设备 1。  Step 5: The NMS returns a successful packet to the device 1.
图 3是根据本发明实施例的实时更新方式中设备 2获取及上报 IP地址的流 程示意图, 如图 3所示, 显示了 DHCP服务器将 IP1回收后, 设备 2分配到了 IP1 地址, 并将包含 IP1 地址的消息上报给网管系统, 网管系统触发将设备 1 的 IP地址实时清空的过程, 具体如下:  3 is a schematic flowchart of the device 2 acquiring and reporting an IP address in a real-time update mode according to an embodiment of the present invention. As shown in FIG. 3, after the DHCP server recovers IP1, device 2 is assigned an IP1 address, and IP1 is included. The message of the address is reported to the network management system. The network management system triggers the process of clearing the IP address of device 1 in real time, as follows:
步骤 1 , 设备 2向 DHCP Server发送获取 IP请求。  Step 1: Device 2 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IP1给设备 2。  Step 2. The DHCP Server assigns IP1 to device 2.
步骤 3 , 设备 2向网管系统发送获取到的 IP地址 IP1。  Step 3: Device 2 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 2的 IP地址并置设备状态为在线, 同时, 查 找到有相同 IP地址的设备 1 , 将设备 1的 IP地址清空, 并置状态为离线。 步骤 5, 网管回复报文给设备 2。 Step 4: The network management system records the IP address of the device 2 and the device status is online. At the same time, check Find device 1 with the same IP address, clear the IP address of device 1, and set the status to offline. Step 5: The network management replies to the device 2.
明实施例的实时更新方式中  In the real-time update mode of the embodiment
程示意图, 如图 4所示, 显示了 DHCP服务器将 IP1再次回收后, 设备 3分配 到了 IP1地址, 并将包含 IP1地址的消息上报给网管系统, 网管系统触发将设 备 2的 IP地址实时清空的过程, 具体如下: The schematic diagram of the process, as shown in Figure 4, shows that after the DHCP server reclaims the IP1, the device 3 is assigned an IP1 address, and the message containing the IP1 address is reported to the network management system. The network management system triggers the real-time emptying of the IP address of the device 2. The process is as follows:
步骤 1 , 设备 3向 DHCP Server发送获取 IP请求。  Step 1: Device 3 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IPl给设备 3。  Step 2. The DHCP Server assigns IP1 to device 3.
步骤 3, 设备 3向 网管系统发送获取到的 IP地址 IP1。  Step 3: Device 3 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 3的 IP地址并置设备状态为在线, 同时, 查 找到有相同 IP地址的设备 2, 将设备 2的 IP地址清空, 并置状态为离线。  Step 4: The network management system records the IP address of the device 3 and the device status is online. At the same time, the device 2 with the same IP address is found, and the IP address of the device 2 is cleared, and the concatenation status is offline.
步骤 5, 网管回复报文给设备 3, 流程结束。  Step 5: The network management replies to the device 3, and the process ends.
周期批量更新方式是指:系统周期性的查找是否有相同 IP的记录存在, 如 果存在, 系统会根据设备最近联系时间, 将之前联系的设备的 IP地址清空, 状态置为离线。  The periodic batch update mode means that the system periodically searches for records with the same IP. If it exists, the system clears the IP address of the previously contacted device according to the latest contact time of the device, and sets the status to offline.
图 5是根据本发明实施例的周期批量更新方式中设备 1获取及上报 IP地址 的流程示意图, 如图 5所示, 该过程具体如下:  FIG. 5 is a schematic diagram of a process of acquiring and reporting an IP address by the device 1 in a periodic batch update mode according to an embodiment of the present invention. As shown in FIG. 5, the process is as follows:
步骤 1 , 设备 1向 DHCP Server发送获取 IP请求。  Step 1: Device 1 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IPl给设备 1。  Step 2: The DHCP Server assigns IP1 to device 1.
步骤 3 , 设备 1向网管系统发送获取到的 IP地址 IP1。  Step 3: The device 1 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 1的 IP地址并置设备状态为在线。  Step 4: The network management system records the IP address of device 1 and the device status is online.
步骤 5, 网管回复报文给设备 1。  Step 5: The NMS responds to the device to the device 1.
图 6是根据本发明实施例的周期批量更新方式中设备 2获取及上报 IP地址 的流程示意图, 如图 6所示, 显示了 DHCP服务器将 IP1回收后, 设备 2分配 到 IP1地址, 并将包含 IP1地址的消息上报给网管系统的过程, 具体如下: 步骤 1 , 设备 2向 DHCP Server发送获取 IP请求;  FIG. 6 is a schematic diagram of a process of acquiring and reporting an IP address by the device 2 in a periodic batch update mode according to an embodiment of the present invention. As shown in FIG. 6, after the DHCP server recovers IP1, the device 2 allocates an IP1 address, and will include The process of reporting the message of the IP1 address to the network management system is as follows: Step 1: Device 2 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IPl给设备 2。 步骤 3 , 设备 2向网管系统发送获取到的 IP地址 IP1。 Step 2: The DHCP Server allocates IP1 to device 2. Step 3: The device 2 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 2的 IP地址并置设备状态为在线。  Step 4: The network management system records the IP address of device 2 and the device status is online.
步骤 5, 网管回复报文给设备 2。  Step 5: The NMS responds to the packet to the device 2.
图 7是根据本发明实施例的周期批量更新方式中设备 3获取及上报 IP地址 的流程示意图, 如图 7所示, 显示了 DHCP服务器再次将 IP1回收后, 设备 3 分配到 IP1地址, 并将包含 IP1地址的消息上报给网管系统的过程, 具体如下: 步骤 1 , 设备 3向 DHCP Server发送获取 IP请求。  7 is a schematic flowchart of the device 3 acquiring and reporting an IP address in a periodic batch update mode according to an embodiment of the present invention. As shown in FIG. 7, after the DHCP server re-collects IP1, device 3 allocates an IP1 address, and The process of reporting the message containing the IP1 address to the network management system is as follows: Step 1: Device 3 sends an IP request to the DHCP server.
步骤 2, DHCP Server分配 IP1给设备 3。  Step 2. The DHCP Server assigns IP1 to device 3.
步骤 3 , 设备 3向网管系统发送获取到的 IP地址 IP1。  Step 3: The device 3 sends the obtained IP address IP1 to the network management system.
步骤 4, 网管系统记录下设备 3的 IP地址并置设备状态为在线。  Step 4: The network management system records the IP address of device 3 and the device status is online.
步骤 5, 网管回复报文给设备 3。  Step 5: The NMS responds to the packet to the device 3.
图 8是根据本发明实施例的在某个时刻网管系统中执行批量更新任务的流 程示意图, 如图 8所示, 该过程具体如下: 启动周期批量更新任务, 查找所有 相同 IP地址的设备, 查找到设备 1 , 设备 2, 和设备 3, 网管系统发现根据时 间判断设备 3是最近联系设备的 , 将设备 1 和设备 2的状态置为离线, 并清空 其 IP地址。  FIG. 8 is a schematic diagram of a process of performing a batch update task in a network management system at a certain time according to an embodiment of the present invention. As shown in FIG. 8, the process is specifically as follows: Start a periodic batch update task, find all devices with the same IP address, and find To device 1, device 2, and device 3, the network management system finds that device 3 is the closest device according to the time, sets the state of device 1 and device 2 offline, and clears its IP address.
在本实施例介绍的上述实时更新方式和周期批量更新方式中, 两种状态都 能达到监控设备状态的目的。 但是, 实时更新方式立即执行, 实时性好, 但对 系统性能造成较大压力; 周期批量更新方式实时性较差, 由于是批量方式, 能 大大减轻系统压力。  In the above-mentioned real-time update mode and periodic batch update mode introduced in this embodiment, both states can achieve the purpose of monitoring device status. However, the real-time update method is executed immediately, and the real-time performance is good, but it exerts great pressure on the system performance; the periodic batch update mode has poor real-time performance, and because it is a batch mode, the system pressure can be greatly reduced.
图 9是根据本发明实施例的实时更新方式流程图, 如图 9所示, 该流程包 括以下步骤(步骤 S902-步骤 S922 ):  FIG. 9 is a flowchart of a real-time update manner according to an embodiment of the present invention. As shown in FIG. 9, the flow includes the following steps (step S902-step S922):
步骤 S902, IP1地址闲置。  Step S902, the IP1 address is idle.
步骤 S904, DHCP将 IP1分配给设备 1。  Step S904, DHCP allocates IP1 to device 1.
步骤 S906, 设备 1上报 IP1地址信息给网管。  Step S906: The device 1 reports the IP1 address information to the network management system.
步骤 S908, DHCP回收 IP1地址。  Step S908, DHCP reclaims the IP1 address.
步骤 S910, DHCP将 IP1地址分配给设备 2。 步骤 S912, 设备 2上报 IP1地址信息给网管。 In step S910, the DHCP allocates the IP1 address to the device 2. In step S912, the device 2 reports the IP1 address information to the network management system.
步骤 S914, 网管将设备 1的状态和地址更新。  In step S914, the network administrator updates the status and address of the device 1.
步骤 S916, DHCP回收 IP1地址。  Step S916, DHCP reclaims the IP1 address.
步骤 S918 , DHCP将 IP1地址分配给设备 3。  Step S918, DHCP allocates an IP1 address to device 3.
步骤 S920, 设备 3上报 IP1地址信息给网管。  In step S920, the device 3 reports the IP1 address information to the network management system.
步骤 S922, 网管将设备 2的状态和地址更新。  In step S922, the network administrator updates the status and address of the device 2.
图 10是根据本发明实施例的周期批量更新方式流程图, 如图 10所示, 该 流程包括以下步骤(步骤 S1002-步骤 S1020 ):  FIG. 10 is a flowchart of a periodic batch update manner according to an embodiment of the present invention. As shown in FIG. 10, the flow includes the following steps (step S1002 - step S1020):
步骤 S1002, IP1地址闲置。  Step S1002, the IP1 address is idle.
步骤 S1004, DHCP将 IP1分配给设备 1。  In step S1004, DHCP allocates IP1 to device 1.
步骤 S1006, 设备 1上报 IP1地址信息给网管。  In step S1006, the device 1 reports the IP1 address information to the network management system.
步骤 S1008, DHCP回收 IP1地址。  Step S1008, DHCP reclaims the IP1 address.
步骤 S1010, DHCP将 IP1地址分配给设备 2。  In step S1010, DHCP allocates an IP1 address to device 2.
步骤 S1012, 设备 2上报 IP1地址信息给网管。  In step S1012, the device 2 reports the IP1 address information to the network management system.
步骤 S1014, DHCP回收 IP1地址。  In step S1014, the DHCP reclaims the IP1 address.
步骤 S1016, DHCP将 IP1地址分配给设备 3。  In step S1016, DHCP allocates an IP1 address to device 3.
步骤 S1018, 设备 3上报 IP1地址信息给网管。  In step S1018, the device 3 reports the IP1 address information to the network management system.
步骤 S1020, 网管启动更新任务, 批量将设备 1和设备 2的状态和地址更 对应于上述实施例介绍的设备状态的更新方法, 本实施例提供了一种设备 状态的更新装置, 用以实现上述实施例。 图 11是根据本发明实施例的设备状态 的更新装置的结构框图, 如图 11所示, 该装置包括: 查找模块 10和状态更新 模块 21。 下面对该结构进行详细介绍。  In step S1020, the network management system starts the update task, and the status and address of the device 1 and the device 2 are more corresponding to the update method of the device state introduced in the foregoing embodiment. The embodiment provides a device state update device, which is used to implement the foregoing. Example. FIG. 11 is a structural block diagram of an apparatus for updating a device state according to an embodiment of the present invention. As shown in FIG. 11, the device includes: a lookup module 10 and a status update module 21. The structure is described in detail below.
查找模块 10, 用于查找具有相同 IP地址的多个设备;  The searching module 10 is configured to find multiple devices with the same IP address;
状态更新模块 20, 连接至查找模块 10, 用于将上述多个设备中的第一设备 的设备状态保持在线状态, 将上述多个设备中除上述第一设备之外的其他设备 的设备状态, 设置为离线状态; 其中, 上述第一设备是最新获得该 IP地址的设 备。 The status update module 20 is connected to the search module 10, and is configured to keep the device status of the first device of the multiple devices in an online state, and set the device status of the devices other than the first device among the multiple devices. Set to an offline state; wherein, the first device is the latest device that obtains the IP address Ready.
通过上述装置, 对于查找模块 10查找的具有相同 IP地址的多个设备, 状 态更新模块 20将最新获得该 IP地址的设备的设备状态保持在线状态, 将其他 设备的设备状态设置为离线状态。 解决了相关技术中设备状态更新不及时不准 确的问题, 本发明实施起来高效简单, 不需要轮询设备, 只需要通过统计系统 中相同 IP地址的设备就能确定这些设备的状态为离线状态,普通的 update SQL 就能实现状态的更新。  Through the above device, for the plurality of devices having the same IP address searched by the search module 10, the status update module 20 keeps the device status of the device that newly obtained the IP address online, and sets the device status of the other device to the offline status. The invention solves the problem that the device status update is not timely and inaccurate in the related art. The present invention is efficient and simple to implement, and does not need to poll the device, and only needs to count the devices of the same IP address in the system to determine the status of the devices as offline. Ordinary update SQL can achieve state updates.
上述查找模块以及状态更新模块均可以由 DSP或 CPU等硬件实现。  The above search module and status update module can be implemented by hardware such as DSP or CPU.
基于上述本实施例介绍的实时更新方式, 本实施例提供了一种优选实施方 式, 即上述查找模块 10可以包括: 触发子单元, 用于当设备获取到新的 IP地 址时, 接收到上述设备的触发消息; 其中, 上述触发消息用于触发, 具有相同 的上述新的 IP地址的多个设备的查找操作; 第一查找子单元, 用于根据上述触 发消息查找具有相同的上述新的 IP地址的多个设备。  Based on the real-time update mode introduced in the foregoing embodiment, the present embodiment provides a preferred implementation manner, that is, the foregoing search module 10 may include: a trigger sub-unit, configured to receive the device when the device acquires a new IP address. The trigger message is used to trigger a lookup operation of multiple devices having the same new IP address; the first search subunit is configured to search for the same new IP address according to the trigger message. Multiple devices.
优选地, 上述状态更新模块 20可以包括: 第一在线保持子单元, 用于将获 用于将查找到的上述多个设置的设备状态设置为离线状态。  Preferably, the status update module 20 may include: a first online holding subunit, configured to set a device status obtained by using the plurality of settings that are found to be an offline status.
基于上述本实施例介绍的周期批量更新方式, 本实施例提供了一种优选实 施方式, 即上述查找模块 10可以包括: 第二查找子单元, 用于周期性查找是否 存在具有相同 IP地址的多个设备; 时间确定子单元,用于在查找到具有相同 IP 地址的多个设备时, 确定各个设备获取该 IP地址的时间。  Based on the periodic batch update mode introduced in this embodiment, the present embodiment provides a preferred implementation manner, that is, the foregoing search module 10 may include: a second search sub-unit, configured to periodically search for whether there is a same IP address. The time determining subunit is used to determine when each device obtains the IP address when finding multiple devices with the same IP address.
优选地, 上述状态更新模块 20可以包括: 第二在线保持子单元, 用于根据 确定的各个设备获取 IP地址的时间, 将最新获取到上述 IP地址的设备的设备 状态保持在线状态; 第二离线设置子单元, 用于将其他设备的设备状态设置为 离线状态。  Preferably, the status update module 20 may include: a second online holding sub-unit, configured to keep the device status of the device that has obtained the latest IP address to the online state according to the determined time of obtaining the IP address by each device; Set subunits to set the device status of other devices to offline.
从以上的描述中可以看出, 本发明提供的设备状态的更新方法及装置, 包 括但不限于 SNMP协议, Tr069协议等适用于大批量网元管理用的网管协议。 实现高效、 简单, 适用于在海量设备, 设备获取网管 IP地址的方式为 DHCP 方式且 DHCP服务器地址池较小的情况下使用, 地址池越小, 监控状态的效果 越准确。 It can be seen from the above description that the method and device for updating the device status provided by the present invention include, but not limited to, the SNMP protocol, the Tr069 protocol, and the like, which are applicable to the network management protocol for large-scale network element management. It is efficient and simple, and it is suitable for use in massive devices. The device obtains the IP address of the network management system as DHCP. In the case where the DHCP server address pool is small, the smaller the address pool, the more accurate the monitoring status is.
尽管为示例目的, 已经公开了本发明的优选实施例, 本领域的技术人员将 意识到各种改进、 增加和取代也是可能的, 因此, 本发明的范围应当不限于上 述实施例。  While the preferred embodiments of the present invention have been disclosed for purposes of illustration, those skilled in the art will recognize that various modifications, additions and substitutions are possible, and the scope of the invention should not be limited to the embodiments described above.

Claims

权利要求书 claims
1、 一种设备状态的更新方法, 所述方法包括: 1. A device status updating method, the method includes:
查找具有相同互联网协议 IP地址的多个设备; Find multiple devices with the same Internet Protocol IP address;
将所述多个设备中的第一设备的设备状态保持为在线状态, 将所述多个设 备中除所述第一设备之外的其他设备的设备状态设置为离线状态; 其中, 所述 第一设备为所述多个设备中最新获得所述 IP地址的设备。 Maintain the device status of the first device among the plurality of devices as an online state, and set the device status of other devices among the plurality of devices except the first device as an offline state; wherein, the third device A device is the device that obtains the IP address most recently among the multiple devices.
2、 如权利要求 1所述的方法, 其中, 查找具有相同 IP地址的多个设备, 包括: 2. The method of claim 1, wherein searching for multiple devices with the same IP address includes:
当所述第一设备获取到新的 IP地址时,接收到所述第一设备发来的触发消 息; 其中, 所述触发消息用于触发具有相同的所述新的 IP地址的多个设备的查 找操作; When the first device obtains a new IP address, a trigger message sent by the first device is received; wherein, the trigger message is used to trigger multiple devices with the same new IP address. search operation;
根据所述触发消息查找具有相同的所述新的 IP地址的多个设备。 Find multiple devices with the same new IP address according to the trigger message.
3、如权利要求 2所述的方法, 其中, 将所述多个设备中的第一设备的设备 状态保持为在线状态, 将所述其他设备的设备状态设置为离线状态, 包括: 将获取到所述新的 IP地址的第一设备的状态保持为在线状态; 3. The method of claim 2, wherein maintaining the device status of the first device among the plurality of devices as an online state, and setting the device status of the other devices as an offline state includes: obtaining the The status of the first device with the new IP address remains online;
将查找到的所述多个设置的设备状态设置为离线状态。 Set the device status of the found multiple settings to offline status.
4、 如权利要求 1所述的方法, 其中, 查找具有相同 IP地址的多个设备, 包括: 4. The method of claim 1, wherein searching for multiple devices with the same IP address includes:
周期性查找是否存在具有相同 IP地址的多个设备; Periodically look for the presence of multiple devices with the same IP address;
在查找到具有相同 IP地址的多个设备时, 确定各个设备获取该 IP地址的 时间。 When multiple devices with the same IP address are found, determine when each device obtained the IP address.
5、 如权利要求 4所述的方法, 其中, 将所述多个设备中的第一设备的设备 状态保持为在线状态, 将所述其他设备的设备状态设置为离线状态, 包括: 根据确定的各个设备获取 IP地址的时间, 将最新获取到所述 IP地址的设 备的设备状态保持在线状态; 5. The method of claim 4, wherein maintaining the device status of the first device among the plurality of devices as an online state and setting the device status of the other devices as an offline state includes: according to the determined The time at which each device obtains an IP address keeps the device status of the device that has recently obtained the IP address online;
将其他设备的设备状态设置为离线状态。 Set the device status of other devices to offline.
6、 一种设备状态的更新装置, 所述装置包括: 6. A device for updating equipment status. The device includes:
查找模块, 配置为查找具有相同互联网协议 IP地址的多个设备; a discovery module configured to find multiple devices with the same Internet Protocol IP address;
状态更新模块, 配置为将所述多个设备中的第一设备的设备状态保持为在 线状态, 将所述多个设备中除所述第一设备之外的其他设备的设备状态, 设置 为离线状态;其中,所述第一设备为所述多个设备中最新获得该 IP地址的设备。 The status update module is configured to maintain the device status of the first device among the plurality of devices as an online state, and set the device status of other devices among the plurality of devices except the first device as offline. status; wherein the first device is the device that has recently obtained the IP address among the multiple devices.
7、 如权利要求 6所述的装置, 其中, 所述查找模块包括: 7. The device according to claim 6, wherein the search module includes:
触发子单元, 配置为当所述第一设备获取到新的 IP地址时, 接收到所述第 一设备发来的触发消息; 其中, 所述触发消息用于触发具有相同的所述新的 IP 地址的多个设备的查找操作; The triggering subunit is configured to receive a trigger message sent by the first device when the first device obtains a new IP address; wherein the trigger message is used to trigger the new IP address with the same Search operations for multiple devices with addresses;
第一查找子单元,配置为根据所述触发消息查找具有相同的所述新的 IP地 址的多个设备。 The first search subunit is configured to search for multiple devices with the same new IP address according to the trigger message.
8、 如权利要求 7所述的装置, 其中, 所述状态更新模块包括: 8. The device according to claim 7, wherein the status update module includes:
第一在线保持子单元,配置为将获取到所述新的 IP地址的第一设备的状态 保持为在线状态; The first online maintenance subunit is configured to maintain the status of the first device that obtains the new IP address as an online status;
第一离线设置子单元, 配置为将查找到的所述多个设置的设备状态设置为 离线状态。 The first offline setting subunit is configured to set the found device status of the plurality of settings to an offline state.
9、 如权利要求 6所述的装置, 其中, 所述查找模块包括: 9. The device according to claim 6, wherein the search module includes:
第二查找子单元, 配置为周期性查找是否存在具有相同 IP地址的多个设 备; The second search subunit is configured to periodically search whether there are multiple devices with the same IP address;
时间确定子单元, 配置为在查找到具有相同 IP地址的多个设备时, 确定各 个设备获取该 IP地址的时间。 The time determination subunit is configured to determine the time at which each device obtains the IP address when multiple devices with the same IP address are found.
10、 如权利要求 9所述的装置, 其中, 状态更新模块包括: 10. The device of claim 9, wherein the status update module includes:
第二在线保持子单元, 配置为根据确定的各个设备获取 IP地址的时间, 将 最新获取到所述 IP地址的设备的设备状态保持在线状态; The second online maintenance subunit is configured to maintain the device status of the device that has recently obtained the IP address in an online state based on the determined time when each device obtains an IP address;
第二离线设置子单元, 配置为将其他设备的设备状态设置为离线状态。 The second offline setting subunit is configured to set the device status of other devices to an offline state.
PCT/CN2014/078336 2013-08-09 2014-05-23 Device status updating method and device WO2014169879A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310347014.6A CN104348662B (en) 2013-08-09 2013-08-09 A kind of update method and device of equipment state
CN201310347014.6 2013-08-09

Publications (1)

Publication Number Publication Date
WO2014169879A1 true WO2014169879A1 (en) 2014-10-23

Family

ID=51730838

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/078336 WO2014169879A1 (en) 2013-08-09 2014-05-23 Device status updating method and device

Country Status (2)

Country Link
CN (1) CN104348662B (en)
WO (1) WO2014169879A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111245641A (en) * 2019-12-27 2020-06-05 广东睿江云计算股份有限公司 Cloud host CPU and memory modification method
CN110989567B (en) * 2019-12-31 2022-01-25 潍柴动力股份有限公司 Controller writing method, controller and upper computer

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159614A (en) * 2007-10-23 2008-04-09 中兴通讯股份有限公司 Gateway and method of implementing centralized management to equipment
CN101267373A (en) * 2008-04-28 2008-09-17 华为技术有限公司 A method, device and system for terminal to be online again
CN101304363A (en) * 2007-05-12 2008-11-12 华为技术有限公司 Method for managing conversation connection as well as apparatus and system
CN102685607A (en) * 2011-02-11 2012-09-19 索尼公司 Method and apparatus for identifying available IPTV devices on a network

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050029800A (en) * 2003-09-23 2005-03-29 주식회사 신텔정보통신 Network connection control method
US7843821B2 (en) * 2006-12-21 2010-11-30 Oracle America, Inc. Method, apparatus and program product to use factory-defined multiple MAC addresses for virtual NICS
CN103096295B (en) * 2011-10-31 2016-06-01 中兴通讯股份有限公司 User Status update method, system and service server, sip terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101304363A (en) * 2007-05-12 2008-11-12 华为技术有限公司 Method for managing conversation connection as well as apparatus and system
CN101159614A (en) * 2007-10-23 2008-04-09 中兴通讯股份有限公司 Gateway and method of implementing centralized management to equipment
CN101267373A (en) * 2008-04-28 2008-09-17 华为技术有限公司 A method, device and system for terminal to be online again
CN102685607A (en) * 2011-02-11 2012-09-19 索尼公司 Method and apparatus for identifying available IPTV devices on a network

Also Published As

Publication number Publication date
CN104348662B (en) 2019-01-29
CN104348662A (en) 2015-02-11

Similar Documents

Publication Publication Date Title
US10764393B2 (en) Determining a persistent network identity of a networked device
WO2020135575A1 (en) System and method for obtaining network topology, and server
RU2527756C1 (en) Apparatus and method for executing function of dns resolution agent
EP2563062B1 (en) Long connection management apparatus and link resource management method for long connection communication
US9391859B2 (en) Service coordination for a data center
EP3089505A1 (en) Method for processing network service faults, service management system and system management module
US20140344444A1 (en) Recovery of Dynamic Host Configuration Protocol IP Addresses
WO2016177144A1 (en) Network element monitoring method and device
WO2012155615A1 (en) Method, system and related apparatus for implementing rfid network management
WO2013117112A1 (en) Sensor network analyzing intercommunicating platform, sensor network intercommunicating method and system
CN107623752B (en) Network management method and device based on link layer
WO2018010176A1 (en) Method and device for acquiring fault information
JP2004005085A (en) Storage network performance measuring system
WO2014169879A1 (en) Device status updating method and device
US20120324093A1 (en) Real-time data monitoring based on data push
WO2007059667A1 (en) A method for obtaining the network element alarm data
WO2012068833A1 (en) Method and system for collecting alarm and performance of communication device
US10715608B2 (en) Automatic server cluster discovery
US10263864B2 (en) Apparatus and method for collecting adaptive flow statistics data in carrier network
WO2012146104A1 (en) Method, device and system for updating port information
JP2015069282A (en) Information processing device and internal information update method of information processing device
WO2014169547A1 (en) Method and apparatus for processing operation on endpoint peripheral
TWI657680B (en) Method of retrieving network connection and network system
JP2008077293A (en) Network monitor
CN101043357A (en) Automatic discovery method for equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14785873

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14785873

Country of ref document: EP

Kind code of ref document: A1