Method and device for establishing control connection between network element equipment and network management equipment

By obtaining and judging the configuration information of network management equipment, and dynamically establishing or maintaining the management connection between network element equipment and network management equipment, the problems of complex development framework and low development efficiency of existing SNMP agent modules are solved, and more efficient development and equipment management are achieved.

CN119743364APending Publication Date: 2025-04-01SHANGHAI HUANCHUANG NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411974189.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The existing SNMP agent module development framework is complex and inflexible, which leads to difficulty in maintaining code. It is not applicable to network element devices with low hardware environments, has low development efficiency, and the efficiency of adding network element devices to network management systems is also low.

Method used

Provide a method to obtain configuration information of the network management device, determine its effectiveness, and establish or maintain a management connection between the network element device and the network management device based on the judgment results, or rediscover an effective network management device.

Benefits of technology

It lowers the threshold for SNMP agent development, simplifies the workload of developers, improves development efficiency, facilitates code version maintenance, and improves the efficiency of adding network element equipment to the network management system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743364A_ABST
    Figure CN119743364A_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, apparatus and computer program product for establishing a control connection between a network element device and a network management device. The method for establishing a control connection between a network element device and a network management device includes: obtaining configuration information of a first network management device; judging whether the first network management device is valid based on the configuration information of the first network management device, whether the first network management device is valid indicates whether the first network management device can be used to manage the network element device; in response to determining that the first network management device is valid, the network element device is enabled to establish or maintain a management connection with the first network management device; and in response to determining that the first network management device is invalid, the network element device is enabled to rediscover a valid second network management device and establish a management connection with the second network management device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of network management, and in particular to a method, apparatus and computer program product for establishing a control connection between a network element device and a network management device. Background Art

[0002] Each network element device in the network operation and maintenance project needs to support the SNMP protocol to connect to the network management system. Each product development team develops the SNMP agent module in the software version of the network element device, and there is no unified standard. Some core function development will be based on a third-party development framework, but the third-party development framework is relatively complex, not flexible enough, and not convenient for code maintenance. At the same time, some network element devices are not suitable for third-party development frameworks when the hardware environment or hardware configuration is relatively low. In addition, in the current SNMP agent module development framework, if the MIB file database is updated, the code needs to be modified one by one, and the development efficiency is relatively low. In addition, the current SNMP agent development framework manually adds network devices to the network management end. When there are a large number of network element devices that need to be added to the network management end, the efficiency is low.

[0003] Therefore, we hope to provide a framework for SNMP agent development, which can greatly reduce the development threshold, simplify the workload of developers, improve development efficiency, facilitate code version maintenance, and improve the efficiency of adding network element devices to the network management system. Summary of the invention

[0004] One or more embodiments of the present specification provide a method for establishing a control connection between a network element device and a network management device, comprising: obtaining configuration information of a first network management device; judging whether the first network management device is valid based on the configuration information of the first network management device, and whether the first network management device is valid indicates whether the first network management device can be used to manage the network element device; in response to determining that the first network management device is valid, establishing or maintaining a management connection between the network element device and the first network management device; and in response to determining that the first network management device is invalid, enabling the network element device to rediscover a valid second network management device and establish a management connection with the second network management device.

[0005] In some embodiments, in response to determining that the first network management device is invalid, causing the network element device to rediscover a valid second network management device and establish a management connection with the second network management device includes: the network element device sending a first multicast message; in response to receiving the first multicast message, the second network management device sending a second multicast message, the second multicast message including configuration information of the second network management device; the network element device sending identification information of the network element device to the second network management device based on the configuration information of the second network management device; and the second network management device adding the network element device to a management device list of the second network management device based on the identification information of the network element device.

[0006] In some embodiments, the sending of identification information of the network element device to the second network management device by the network element device based on the configuration information of the second network management device includes: the SNMP agent module of the network element device sends Trap information to the network management device based on a discovery trap (Trap) mechanism, and the Trap information includes the identification information of the network element device.

[0007] In some embodiments, in response to determining that the first network management device is valid, establishing or maintaining a management connection between the network element device and the first network management device includes: the SNMP agent module of the network element device sends a Trap message to the network management device based on a heartbeat trap (Trap) mechanism, and the Trap information includes the operating status information of the network element device.

[0008] In some embodiments, the method also includes: the network element device sends authentication information of the network element device to the second network management device based on the configuration information of the second network management device, and the authentication information and the identification information are used by the second network management device to add the network element device to the management device list.

[0009] In some embodiments, judging whether the first network management device is valid based on the configuration information of the first network management device includes: determining whether the first network management device can be accessed by the network element device based on the IP address information of the first network management device.

[0010] One or more embodiments of the present specification also provide an apparatus for establishing a control connection between a network element device and a network management device, comprising: an acquisition module, configured to acquire configuration information of a first network management device; a judgment module, configured to judge whether the first network management device is valid based on the configuration information of the first network management device, and whether the first network management device is valid indicates whether the first network management device can be used to manage the network element device; a connection establishment module, configured to: in response to determining that the first network management device is valid, enable the network element device to establish or maintain a management connection with the first network management device; and in response to determining that the first network management device is invalid, enable the network element device to rediscover a valid second network management device and establish a management connection with the second network management device.

[0011] In some embodiments, the connection establishment module is further configured to: send a first multicast message in response to determining that the first network management device is invalid; receive a second multicast message sent by the second network management device in response to receiving the first multicast message, the second multicast message including configuration information of the second network management device; send identification information of the network element device to the second network management device based on the configuration information of the second network management device, and the second network management device adds the network element device to a management device list of the second network management device based on the identification information of the network element device.

[0012] One or more embodiments of the present specification also provide an electronic device for establishing a control connection between a network element device and a network management device, including a processor and a memory, wherein the memory stores a computer program or a computer executable instruction, and when the computer program or the computer executable instruction is executed by the processor, the method described in any embodiment of the present specification is implemented.

[0013] One or more embodiments of the present specification further provide a computer program product, including a computer program, which can implement the method described in any embodiment of the present specification when at least a portion of the computer program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] This specification will be further explained by way of exemplary embodiments, which will be described in detail by way of the accompanying drawings. The same numbers in the drawings represent the same structures or steps.

[0015] Figure 1 It is a schematic diagram of an application scenario of a network management system according to some embodiments of this specification.

[0016] Figure 2 It is a structural diagram of a network element device according to some embodiments of this specification.

[0017] Figure 3 It is a flowchart of establishing a control connection between a network element device and a network management device according to some embodiments of this specification.

[0018] Figure 4 It is a flowchart of establishing an SNMP agent development framework according to some embodiments of this specification.

[0019] Figure 5 It is a flowchart of converting a MIB file into an executable code file according to some embodiments of this specification.

[0020] Figure 6 It is a schematic diagram of an electronic device used to establish a control connection between a network element device and a network management device according to some embodiments of this specification. DETAILED DESCRIPTION

[0021] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the embodiments will be described in detail below with reference to the accompanying drawings. Obviously, the contents described below are some examples or embodiments of this specification. For ordinary technicians in this field, without paying creative work, the technical solutions or means disclosed in this specification can also be applied to other scenarios based on these technical contents.

[0022] It should be understood that the "system", "device", "unit" and / or "module" used in this specification is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.

[0023] Unless otherwise specified, technical terms used in this specification to describe components, elements, etc. do not refer to the singular, but may also include the plural. Generally speaking, terms such as "include", "comprise", etc. only indicate that the steps, elements, or components that have been clearly identified are included, and these steps, elements, and components do not constitute an exclusive list, such as the method or device described may also include other steps or components.

[0024] Flowcharts are used in this specification to illustrate the operation steps performed by the device or system of the relevant embodiments, but unless otherwise specified, the order used to describe these steps should not be understood as a limitation on the order in which the steps are performed. A person of ordinary skill in the art can adjust the order in which these steps are performed based on the knowledge and information conveyed by the embodiments of this specification, and the adjustment includes but is not limited to swapping the order, merging multiple steps, and splitting a certain step.

[0025] Figure 1It is a schematic diagram of an application scenario of a network management system according to some embodiments of the present specification.

[0026] The network management system can be used in scenes with a large number of network element devices, such as buildings, campuses, parks, warehouses, factories, and hotels. The application scene 100 of the network management system can include a network element device 110 , a network management system 120 , and a network 130 .

[0027] The network element device 110 is a key hardware component in the network, such as a wireless controller (AC), a gateway, a server (e.g., an AAA server), a proxy dialing device, an anti-proxy device, a router (e.g., a wireless access point AP), a switch, an optical transmission device, etc. Figure 1 The network element devices 110 may include network element devices 110-1, 110-2, 110-3, etc. The network element devices managed by the network management system and the network management system are connected to the same network.

[0028] The network management system 120 is a software solution for monitoring, managing and optimizing computer networks and their resources, enabling network administrators to effectively control network operations, identify and troubleshoot faults, analyze traffic patterns and optimize network performance. The network management system 120 can be used for fault management, performance management, configuration management, security management, billing management, etc. of the network element device 110. For example, fault management can include real-time identification of faults and anomalies of network element devices in the network and notification of administrators through email, SMS, etc. Performance management can include real-time monitoring of performance indicators of network element devices, such as bandwidth, latency, traffic, load, CPU utilization, memory utilization, connection success rate, packet loss rate, jitter, throughput, error rate, etc. Configuration management can include managing the configuration of network element devices, for example, managing configuration parameters. Different network element devices can have different or the same configuration parameters. For example, the configuration parameters of a router can include interface configuration, routing protocol configuration, access control list, etc. The configuration parameters of a switch can include VLAN configuration, spanning tree protocol, port channel, etc. The configuration parameters of an AP can include SSID configuration, encryption and authentication configuration, power settings, etc. The same configuration parameters can include time and date configuration, device authentication configuration, etc. Security management can be used to manage and monitor user access to network resources, for example, by collecting and analyzing network activity logs to detect security threats. Billing management can be used to track network usage. NMS can also include a database for storing network configuration, performance, logs, and events. NMS can also include a user interface to provide access and operation of all system functions.

[0029] The network management system 120 includes a network management device 122 and a storage device 124. The network management device 122 is a component in the network management system 120 for computing and analyzing, and is responsible for data processing and business logic.

[0030] The network management system 120 and the network element device 110 both support the Simple Network Management Protocol (SNMP). The network management system 120 and the network element device 110 communicate with each other through SNMP. The network element device 110 supports an SNMP agent so that the network management system can manage the network element device. The network management system is also called an SNMP management terminal.

[0031] SNMP agent is a software module running on network element device 110 (such as network element devices such as routers, switches, servers, etc.), also known as SNMP agent module. SNMP agent can be configured to collect various information of network element device 110 (such as performance data, configuration parameters, operation status, etc. of network element device). For example, SNMP agent can respond to receiving data acquisition request (such as GET operation request, GETNEXT operation request, etc.) from network management device 122, and send the requested data in the data acquisition request to network management device 122. For example, in an enterprise network, SNMP agent on router can collect information such as interface traffic and CPU usage, so that network administrator can remotely monitor the operation of router. For another example, in a campus network, SNMP agent on router can collect the number of online users and online terminals on each AP. SNMP agent can also receive management operation request (such as SET operation request) from network management device 122 in network management system 120, and perform operations such as modifying corresponding configuration parameters on network element device. For another example, the SNMP agent on the network element device may send TRAP information to the network management device 122 to provide the network management system 120 with the operation status information, device identification information, etc. of the network element device 110 .

[0032] SNMP agents use MIB files to determine what information should be collected and how to organize the information. The development framework of SNMP agents helps to implement the SNMP protocol in software, allowing developers to build, operate and manage SNMP agents. The development framework of SNMP agents can include Net-SNMP, Python SNMP Libraries, Java SNMP Libraries, etc. Some embodiments of the present application provide a development framework for SNMP agents, see Figure 4 and 5 Detailed instructions in.

[0033] Any network element device 110 may include a processor and a memory. The memory may include computer instructions, for example, an executable file corresponding to an SNMP agent. The processor may execute computer instructions (for example, program code) and execute the method for accessing a network element device to a network management system or the method for developing an SNMP agent as described in this specification. Computer instructions may include routines, programs, objects, components, data structures, processes, modules, and functions for executing specific functions described in this application. The processor may process data obtained from a memory, a terminal, and / or any other component. For example, the processor (for example, an SNMP agent module) of the network element device 110 may obtain configuration information of a network management device 122, and determine whether the network management device 122 is valid based on the configuration information of the network management device; in response to determining that the network management device is valid, it is determined that the network management device manages the network element device, that is, a management connection is established with the network management device; in response to determining that the network management device is invalid, the network element device 110 rediscovers a valid network management device, and determines that the network element device is managed by the newly discovered valid network management device, that is, a management connection is established with the newly discovered network management device.

[0034] In some embodiments, the SNMP agent module may be executed or implemented by a processor of the network element device.

[0035] In some embodiments, the processor may include one or more hardware processors, such as a microcontroller, a microprocessor, a reduced instruction set computer (RISC), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a central processing unit (CPU), a graphics processing unit (GPU), a physical processing unit (PPU), a microcontroller unit, a digital signal processor (DSP), a field programmable gate array (FPGA), an advanced RISC system (ARM), a programmable logic device (PLD), any circuit or processor capable of performing one or more functions, or any combination thereof.

[0036] Figure 2 It is a structural schematic diagram of an apparatus for establishing a control connection between a network element device and a network management device according to some embodiments of this specification.

[0037] like Figure 2 As shown, in some embodiments, the device 200 may include an acquisition module 202 , a determination module 204 , a connection establishment module 206 , and a discovery module 208 .

[0038] The acquisition module 202 may acquire configuration information of the network management device. The configuration information of the network management device may include an IP address, a subnet mask, a default gateway, and the like.

[0039] In some embodiments, the network management device sends the configuration information of the network management device to the network element device through multicast discovery. For example, the network management device can send multicast messages periodically or regularly, and the multicast messages include the configuration information of the network management device. The network element device (for example, SNMP agent) can receive the multicast message sent by the network management device, obtain the configuration information of the network management device, and save it to the storage device in the network element device.

[0040] In some embodiments, the acquisition module 202 of the network element device can send request information to the network management device through multicast discovery to obtain the configuration information of the network management device. For example, the network element device can periodically or regularly send multicast messages, and the multicast messages include a request to obtain the configuration information of the network management device. The network management device can receive the multicast message sent by the network management device and respond. For example, the network management device can send a multicast message, and the multicast message contains the configuration information of the network management device. The network element device can obtain the configuration information of the network management device and save it to a storage device in the network element device.

[0041] The determination module 204 may determine whether the network management device is valid.

[0042] Determining whether a network management device is valid refers to determining whether the network management device can be used to manage the network element device. If the network management device is valid, the network management device can be used to manage the network element device. In response to determining that the network management device is valid, if the network element device has not been added to the management device list of the network management device, the network element device can send device identification information to the network management device so that the network management device can add it to the management device list; if the network element device has been added to the management device list of the network management device, the network element device can send device operation status information to the network management device so that the network management device can determine whether the management connection between the network element device and the network management device is maintained.

[0043] If the network management device is invalid, the network management device cannot be used to manage the network element device. In response to determining that the network management device is invalid, the network element device can rediscover the network management device so that the new network management device adds it to the management device list.

[0044] The connection establishing module 206 is configured to establish or maintain a management connection between the network element device and the network management device in response to determining that the network management device is valid.

[0045] If the network element device has not been added to the management device list of the network management device (i.e., the network element device and the network management device have not established a management connection), the connection establishment module 206 may send device identification information to the network management device so that the network management device can add it to the management device list of the network management device. If the network element device has been added to the management device list of the network management device (i.e., the network element device and the network management device have established a management connection), the connection establishment module 206 may send device operation status information to the network management device so that the network management device can determine whether the management connection between the network element device and the network management device is maintained, so as to maintain the management connection between the network element device and the network management device.

[0046] In response to determining that the network management device is invalid, the discovery module 208 rediscovers a valid network management device and establishes a management connection between the network element device and the newly discovered valid network management device.

[0047] If the network management device is invalid, it can be considered that the network management device cannot manage the network element device.

[0048] The discovery module 208 can send a multicast message. If a new network management device receives the multicast message sent by the network element device, in response, the network management device can send another multicast message to the network element device to send the configuration information of the network management device to the network element device, such as the IP address, TRAP address, etc. The discovery module 208 receives the configuration information sent by the new network management device and sends the configuration information to the acquisition module 202. The judgment module 204 can judge whether the new network management device is valid. If the new network management device is valid, the connection establishment module 206 can send the identification information of the network element device to the new network management device. In some embodiments, if the network element device does not receive a response from the network management device, the network element device can periodically send multicast messages until a response (e.g., a multicast message) is received from the new network management device.

[0049] Figure 3 It is a schematic diagram of a process of establishing a control connection between a network element device and a network management device according to some embodiments of this specification. In some embodiments, process 300 can be executed by an SNMP agent module in a network element device or by an electronic device 600.

[0050] Step 302: The SNMP agent in the network element device obtains configuration information of a network management device (also referred to as a first network management device).

[0051] The configuration information of the network management device may include IP address, subnet mask, default gateway, etc.

[0052] In some embodiments, the network management device sends the configuration information of the network management device to the network element device through multicast discovery. For example, the network management device can send multicast messages periodically or regularly, and the multicast messages include the configuration information of the network management device. The network element device (for example, SNMP agent) can receive the multicast message sent by the network management device, obtain the configuration information of the network management device, and save it to the storage device in the network element device.

[0053] In some embodiments, the network element device may send request information to the network management device through multicast discovery to obtain the configuration information of the network management device. For example, the network element device may send a multicast message periodically or regularly, and the multicast message includes a request to obtain the configuration information of the network management device. The network management device may receive the multicast message sent by the network management device and respond. For example, the network management device may send a multicast message, and the multicast message includes the configuration information of the network management device. The network element device may obtain the configuration information of the network management device and save it to a storage device in the network element device.

[0054] In some embodiments, the network element device may send a request to the network management device based on the SNMP protocol to obtain configuration information of the network management device.

[0055] In some embodiments, the network management device may provide an API endpoint, and the network element device may make an API call through the HTTP / HTTPS protocol to obtain configuration information of the network management device.

[0056] In some embodiments, the network element device may access the network management device through a remote terminal such as SSH or Telnet to retrieve configuration information.

[0057] In some embodiments, the network element device may obtain configuration information of the network management device through a configuration synchronization protocol (eg, NETCONF or RESTCONF).

[0058] In some embodiments, the network management device may periodically export configuration information to a specific storage location or file server for access by the network element device.

[0059] In some embodiments, the network element device (eg, SNMP agent) may check or identify whether the configuration information of the network management device is stored in its storage device.

[0060] Step 304: The SNMP agent in the network element device determines whether the network management device is valid based on the configuration information of the network management device.

[0061] Determining whether the network management device is valid refers to determining whether the network management device can be used to manage the network element device. For example, determining whether the network management device is valid includes determining whether the link between the network element device and the network management device is connected, that is, the network element device and the network management device can access each other.

[0062] If the network management device is valid, the network management device can be used to manage the network element device. In response to determining that the network management device is valid, step 306 is executed. For example, if the network element device has not been added to the management device list of the network management device, the network element device can send device identification information to the network management device so that the network management device can add it to the management device list; if the network element device has been added to the management device list of the network management device, the network element device can send device operation status information to the network management device so that the network management device can determine whether the management connection between the network element device and the network management device is maintained. See step 306 for a detailed description.

[0063] If the network management device is invalid, the network management device cannot be used to manage the network element device. In response to determining that the network management device is invalid, step 308 is executed. For example, the network element device can rediscover the network management device so that the new network management device adds it to the management device list. See step 308 for a detailed description.

[0064] In some embodiments, determining whether the network management device is valid includes determining whether the network management device is accessible to the network element device.

[0065] For example, the configuration information of the network management device may include an IP address, and determining whether the network management device has been accessed by the network element device includes determining whether the IP address of the network management device can be accessed by the network element device. For a further example, the SNMP agent of the network element device may confirm whether the network management device is reachable by sending a request to the IP address of the network management device. If the IP address of the network management device can be accessed by the network element device, the network management device is considered to be valid. For a further example, determining whether the network management device is valid includes determining whether the link between the network element device and the network management device is connected. The ping command may be used to verify whether the link between the network element device and the network management device is connected. The network element device may determine whether the network management device is reachable by sending an ICMP Echo request to the IP address of the network management device. If the network management device is reachable, a response from the network management device will be received, indicating that the network link between the network element device and the network management device is unobstructed, that is, the network management device is valid; if a timeout occurs or no response is received from the network management device, it indicates that the network link between the network element device and the network management device is not unobstructed, that is, the network management device is invalid.

[0066] In some embodiments, if it is determined that the network management device can be accessed by the network element device, determining whether the network management device is valid further includes determining whether the IP address of the network management device matches the subnet mask and the default gateway to ensure that the network management device can communicate with the network element device. If the IP address of the network management device matches the subnet mask and the default gateway, the network management device is considered to be valid.

[0067] In some embodiments, if it is determined that the network management device can be accessed by the network element device, determining whether the network management device is valid further includes determining whether the IP address of the network management device is blocked or filtered by other network element devices (e.g., a firewall). If the IP address of the network management device is not blocked or filtered by other network element devices, the network management device is considered to be valid.

[0068] In some embodiments, if it is determined that the network management device can be accessed by the network element device, determining whether the network management device is valid includes determining whether the allocation method of the IP address of the network management device meets the requirements of the network design and whether the lease has expired. If the IP address of the network management device meets the requirements of the network design and the lease has not expired, the network management device is considered to be valid.

[0069] In some embodiments, if it is determined that the network management device can be accessed by the network element device, determining whether the network management device is effective includes determining to evaluate the function, performance, reliability, etc. of the network management device. For example, evaluating the function of the network management device includes determining whether the network management device supports the SNMP protocol, whether it can manage the configuration changes of the network element device, etc. Evaluating the performance of the network management device includes evaluating the response time and data processing capabilities of the network management device. Evaluating the reliability of the network management device includes evaluating the operating time of the network management device, whether it can continue to operate stably for a long time, and the fault recovery capability. When the evaluation results of the function, performance, reliability, etc. of the network management device meet the requirements of the network element device, the network management device can be considered to be effective.

[0070] Step 306: In response to determining that the network management device is valid, establish or maintain a management connection between the network element device and the network management device.

[0071] The management connection refers to connecting the network element device to the network management device to allow the network management device to monitor, manage and configure the network element device.

[0072] If the network management device is valid, it can be considered that the network management device is able to manage the network element device.

[0073] If the network element device has not been added to the management device list of the network management device (that is, the network element device and the network management device have not established a management connection), the network element device can send device identification information to the network management device so that the network management device can add it to the management device list of the network management device. For example, after determining that the network management device is valid, the SNMP agent can send the network element device's identification information, authentication information (for example, key) and other information (called discovery TRAP information) to the network management device through the discovery trap (TRAP) mechanism. The discovery TRAP mechanism refers to a notification sent by the network element device to the network management device through SNMP to inform the network management device of a certain type of event or state change. The network management device receives the discovery TRAP information sent from the network element device, reads the network element device's identification information, authentication information (for example, key) and other information in the TRAP information, and can add the network element device to the management device list of the network management device to facilitate subsequent management of the network element device.

[0074] If the network element device has been added to the management device list of the network management device (i.e., a management connection has been established between the network element device and the network management device), the network element device can send device operation status information to the network management device so that the network management device can determine whether the management connection between the network element device and the network management device is maintained, so as to maintain the management connection between the network element device and the network management device.

[0075] The operation status information of the network element device may include information indicating that the operation status of the network element device is normal. The operation status information may include a signal indicating that the network element device remains active and online. The network management device may receive and process the operation status information of the network element device and monitor the network element device.

[0076] The operating status information of the network element device includes the identification, timestamp, operating status, performance indicators and other information of the network element device.

[0077] In some embodiments, the SNMP agent may send the operating status information of the network element device to the network management device through the heartbeat TRAP mechanism. The heartbeat trap (TRAP) mechanism refers to the periodic information sent by the network element device to the network management device through the SNMP (Simple Network Management Protocol), which is used to monitor the availability and health status of the network element device, and to ensure that the network element device is operating normally and maintaining communication with the network management system. For example, the time interval for sending the heartbeat TRAP (for example, 5 minutes, 10 minutes, 15 minutes, etc.) can be configured on the network element device. The operating status information of the network element device sent by the SNMP agent to the network management device can also be called TRAP information. The SNMP agent can send the TRAP information of the network element device to the network management device after each time interval. When the network management device does not receive the heartbeat TRAP information of the network element device within the expected time (for example, after the time interval), the network management device can determine that the network element device may be offline or faulty, and trigger an alarm.

[0078] In some embodiments, before the SNMP agent sends the running status information of the network element device to the network management device, the network element device needs to be configured. For example, the TRAP function can be configured on the network element device and enabled. For another example, the time interval for sending the heartbeat TRAP can be configured on the network element device. For another example, the IP address of the network management device can be configured on the network element device.

[0079] Step 308: In response to determining that the network management device is invalid, the SNMP agent rediscovers a valid network management device (also called a second network management device) and establishes a management connection between the network element device and the newly discovered valid network management device.

[0080] If the network management device is invalid, it can be considered that the network management device cannot manage the network element device.

[0081] The network element device can send a multicast message (i.e., a first multicast message). If a new network management device receives the multicast message sent by the network element device, in response, the network management device can send another multicast message (i.e., a second multicast message) to the network element device to send the configuration information of the network management device to the network element device, such as an IP address, a TRAP address, etc. The SNMP agent will send the identification information of the network element device to the new network management device after receiving the configuration information sent by the new network management device. In some embodiments, if the network element device does not receive a response from the network management device, the network element device can periodically send multicast messages until a response (e.g., a multicast message) is received from the new network management device.

[0082] In some embodiments, the SNMP agent can further determine whether the new network management device is valid. If it is determined that the new network management device is valid, the identification information of the network element device can be sent to the valid network management device, so that the valid network management device adds the network element device to its management device list to establish a management connection with the new network management device.

[0083] After a management connection is established between a new network management device and a network element device, when the SNMP agent determines that the status of the network element device has changed, such as device restart, interface disconnection, or other failures, the SNMP agent can send a TRAP message to the network management device to inform the network management device of the occurrence of the event.

[0084] In some embodiments, after a management connection is established between a new network management device and a network element device, the SNMP agent may periodically send the operating status information of the network element device to the network management device. For example, the SNMP agent may periodically send the operating status information of the network element device to the new network management device through a heartbeat TRAP mechanism. When the new network management device does not receive the heartbeat TRAP information of the network element device within the expected time (for example, after a time interval), the new network management device may determine that the network element device may be offline or faulty, and trigger an alarm.

[0085] According to the method for establishing a control connection between a network element device and a network management device provided in some embodiments of the present application, the SNMP management end (i.e., the network management device) listens to the management end address sent to the network element device through multicast discovery, and the network element device discovers the SNMP management end by itself, which facilitates the dynamic management of large-scale device lists. At the same time, the private device discovery mechanism and the security parameter settings related to the device hardware information (for example, key information) further enhance security.

[0086] Figure 4 It is a flowchart of establishing an SNMP agent development framework according to some embodiments of this specification. Figure 4 The steps can be performed by the electronic device 600.

[0087] Step 402: Generate a MIB file.

[0088] MIB (Management Information Base) is a collection of managed objects that defines the structure and content of various information of network element devices that can be accessed through the SNMP protocol. MIB files describe the rules that must be followed for data exchange between network management devices and network element devices. For example, the MIB file can specify which data of the SNMP agent network element device can be accessed by the network management system, as well as the format and meaning of this data. For example, when the network management device sends a query request to the SNMP agent, the SNMP agent will search and return the corresponding information according to the definition in the MIB file. For example, if the network management device requests to obtain the interface status information of the device, the SNMP agent will find the OID and data format corresponding to the interface status in the MIB file, and then obtain the information from the network element device and return it to the network management device in the format specified in the MIB file.

[0089] A MIB file can describe the status and performance of multiple different types of network element devices.

[0090] The MIB file uses a tree-like structure called an Object Identifier (OID) tree. The MIB file includes root nodes, intermediate nodes, and leaf nodes. The root node and intermediate nodes can also be called non-leaf nodes.

[0091] Non-leaf nodes are responsible for organizing network element devices in layers. For example, the device information, interface information, and protocol information of network element devices are grouped to form a branch of the tree structure. Non-leaf nodes can include iso, org, dod, and internet. Non-leaf nodes have unique OIDs, which are used to navigate the MIB tree and help locate specific leaf nodes. Non-leaf nodes do not store data and are used to organize and standardize the hierarchical structure of the MIB.

[0092] Leaf nodes are used to identify specific management objects. Each managed object has a unique position in this tree and is identified by OID. Management objects can include performance monitoring objects, fault management objects, or configuration management objects. Performance monitoring objects can include performance parameters or indicators, such as bandwidth, latency, traffic, load, CPU utilization, memory utilization, connection success rate, packet loss rate, jitter, throughput, error rate, etc. Configuration management objects can include configuration parameters. Different network element devices can have different or the same configuration parameters. For example, the configuration parameters of a router can include interface configuration, routing protocol configuration, access control list, etc. The configuration parameters of a switch can include VLAN configuration, port start and stop status, etc. The configuration parameters of an AP can include SSID configuration, encryption and authentication configuration, power settings, etc. The objects of fault management include various types of statistical data. For example, for a network interface, a leaf node can include ifDescr (description information of the interface), ifType (type of the interface), ifOperStatus (current operation status of the interface), and ifOctets (number of bytes received through the interface). Through the ifOctets node, broadband usage or traffic statistics can be calculated. IfOperStatus can be used to diagnose network faults.

[0093] In some embodiments, types of leaf nodes may also include SCALAR nodes, TABLE nodes, and TRAP nodes.

[0094] The TABLE node (i.e., table node) is used in the MIB file to define the structure of an SNMP retrievable table. An SNMP retrievable table is used to describe a method with associated information rows (such as an interface list, a routing table, etc.). An SNMP retrievable table in the MIB file includes a table object, a table entry object, and one or more column objects.

[0095] The TABLE node includes an Entry node. The Entry node is usually associated with a table structure, represents a single row entry in the table structure, and defines the column attributes contained in each row.

[0096] SCALAR nodes (i.e. scalar nodes) are used in MIB files to represent single text values, such as strings, numbers, or Boolean values. Scalar nodes are basic data units that cannot be divided. In other words, scalar nodes have no child nodes or next-level hierarchical structures.

[0097] TRAP nodes are used to define SNMP notifications that network element devices can send to inform network management devices that specific events have occurred. TRAP nodes define the name, OID (object identifier), variable binding, and trigger conditions of the TRAP in the MIB file. The MIB file can also include the data type of each OID. Each OID has a specific data type, such as INTEGER, OCTET STRING, OBJECT IDENTIFIER, Gauge, Counter, etc. The data type determines the format of the data or status stored in the leaf node.

[0098] Step 404, automatically convert the MIB file into a code file.

[0099] The code file may be a C language code. The MIB file may be converted into a code file by a C language program.

[0100] The process of converting a MIB file to a code file involves converting the node definitions in the MIB file into a format that can be used by an SNMP agent or directly integrated into a data structure in a program. The code file can be used to enable an SNMP agent to query or set the management objects defined in the MIB file.

[0101] In some embodiments, converting a MIB file into a code file includes the following steps: reading the MIB file; parsing the node name in the MIB file to determine the node type; performing macro definitions based on different node types; generating initialization registration functions based on nodes of different node types; and generating hook functions. For a detailed description of converting a MIB file into a code file, please refer to the specification. Figure 5 Detailed description.

[0102] Add hook functions for accessing / modifying MIB node data in the code file to improve the code file.

[0103] Hook Function is used to provide a mechanism to allow custom code to be inserted at predefined points in code files, so that program functions can be dynamically extended or modified when the program is running without directly modifying the core logic of the program. Hook function provides a way to add additional logic based on standard SNMP operations.

[0104] The SNMP agent can obtain network element device data through standard SNMP operations, which include GET, GETNEXT, GETBULK, SET, TRAP, etc.

[0105] The GET operation is used to retrieve the current value of a specific management object from a network element device. For example, a network management device can send a GET operation request containing an object identifier (OID); the SNMP agent returns the current value of the OID. For example, the SNMP agent can obtain the current CPU usage, interface status, etc. of a network element device through a GET operation.

[0106] The GETNEXT operation is used to traverse the MIB file and obtain the next object in the MIB tree one by one. For example, the network management device requests a starting OID, and the SNMP agent returns the next OID and the corresponding value. For example, the SNMP agent can traverse the table data based on the GETNEXT operation, such as obtaining an interface list.

[0107] The GETBULK operation is used to obtain multiple management objects in batches to reduce the number of network communications. For example, a network management device can specify multiple consecutive management objects to respond to, and the SNMP agent returns the current values ​​of multiple management objects.

[0108] The SET operation is used to set the value of a managed object on a network element device. For example, a network management device sends a request containing the target OID and the new value, and the SNMP agent attempts to set the value.

[0109] TRAP operation is used for network element devices to actively send asynchronous notifications to network management devices to inform them of status changes or failures. TRAP operation is triggered by network element devices, such as port shutdown and device restart.

[0110] The hook functions may include hook functions for GET operation, GETNEXT operation, GETBULK operation, SET operation, TRAP operation, etc.

[0111] Hook functions can be used to add custom data retrieval functions based on GET operations. For example, when a GET operation request is received, a hook function can be used to execute custom data retrieval or processing logic before the SNMP agent returns the value corresponding to the GET operation request to meet the need to obtain data from other sources (for example, databases or real-time calculations).

[0112] Hook functions can be used to add verification and update functions based on SET operations. For example, when a SET operation request is received, the hook function can be used to verify data and perform necessary update steps before setting the configuration parameters to new values.

[0113] The hook function can be used to add conditional trigger notification functions based on the TRAP operation. For example, when certain events or conditions are met (such as when the temperature exceeds a threshold or the interface status changes), the TRAP message can be generated and sent to the network management device through the hook function condition trigger.

[0114] In C or C++ language, users can add custom logic inside the function of processing requests (for example, GET operation request, SET operation request, TRAP operation request, etc.) in the code file, which can be used as a hook function.

[0115] Step 406: Generate a data acquisition method.

[0116] Different standard SNMP operations have corresponding data acquisition methods. For example, if it is a GET operation, a GETNEXT operation, and a GETBULK operation, the data acquisition method may include using an inter-process communication mechanism, a message communication mechanism, a cache service mechanism, etc. For another example, if it is a SET operation, the data acquisition method may include using a command call mechanism, etc. For another example, if it is a TRAP operation, the data acquisition method may include using a file sharing, a command call mechanism, etc.

[0117] In some embodiments, the device data acquisition method may be determined by a configuration file of the network element device.

[0118] Step 408 , compile the code file to generate a computing device executable file to form an SNMP agent development framework and integrate the data acquisition method into the SNMP agent development framework.

[0119] The object code file can be assembled by a compiler to generate assembly code, which can be further converted into machine code by an assembler. The machine code is specified by the instruction set architecture (ISA) of the processor, such as x86, ARM, i.e., executable files.

[0120] The computing device may be a processor in a network element device.

[0121] The executable file and the data acquisition method can be loaded into the memory of the processor of the network element device so as to be called and executed by the processor to realize the function of the SNMP agent.

[0122] Through some embodiments of the present application, the SNMP agent module does not need to be developed from scratch for software development of different network element devices. It only needs to define the MIB file, use the conversion tool and supplement the business logic. This can greatly reduce the development threshold, simplify the workload of developers, improve development efficiency, and facilitate code version maintenance. In the mainstream SNMP agent development framework (for example, Net-SNMP), due to the need to apply to different types of network element devices, a wealth of tools and library functions are provided to implement SNMP agents, managers, and trap receiving functions, which will cause the SNMP agent development framework to occupy more resources and cannot be applied to small network element devices. However, the SNMP agent development framework in this application only retains the core functions, does not rely on third-party libraries, and implements the agent end with the native SNMP protocol. It is lighter and more efficient, occupies almost no resources, and is also suitable for small network element devices, such as AP / routers.

[0123] Figure 5 It is a schematic diagram of a process of converting a MIB file into a code file executable by SNMP code according to some embodiments of this specification. In some embodiments, process 500 can be executed by an electronic device 600.

[0124] Step 502, read the MIB file line by line.

[0125] Step 504, parse the node name in the MIB file. In some embodiments, the node name in the MIB file can be parsed according to the camel case nomenclature. Each node has a name (i.e., a tag name) for identifying the specific meaning of the node in the MIB file. The elements of the node definition in the MIB file include OID, name, data type (e.g., INTEGER, OBJECTSTRING, SEQUENCE), access rights, current standard status, detailed text description of the node use or function, index of the table, etc. The elements of the node can be defined or described by using OBJECT IDENTIFIER, OBJECT TYPE, SEQUENCE OF, SEQUENCE, NOTIFICATION-TYPE, TRAP-TYPE, ENTRY, ENTRY OF, etc. OBJECTIDENTIFIER is used to define the OID of the node, and OBJECT TYPE, SEQUENCE OF, SEQUENCE, NOTIFICATION-TYPE, TRAP-TYPE, ENTRY, ENTRY OF are used to describe the type, access rights, and data type (e.g., INTEGER, STRING, etc.) of the management object represented by the node. The steps of extracting the node name in the MIB file include identifying the definition line in the MIB file, identifying the node name through definitions such as OBJECT TYPE, SEQUENCE OF, SEQUENCE, NOTIFICATION-TYPE, TRAP-TYPE, ENTRY, ENTRY OF, etc., determining the location of the node through OBJECT IDENTIFIER, and using tools or libraries to parse and extract the node name.

[0126] Step 506, determine the node type based on the node name. For example, the node type can be determined based on the key elements in the node name. The node type can include leaf nodes and non-leaf nodes. Leaf nodes can also include SCALAR nodes, TABLE nodes, and TRAP nodes. For detailed descriptions of leaf nodes and non-leaf nodes, please refer to the specification. Figure 4 Detailed description.

[0127] If a node is defined by OBJECT-TYPE, it is a leaf node, directly associated with a data attribute (such as integer, string, etc.), and is retrievable or settable. If a node is only extended by OBJECTIDENTIFIER without OBJECT-TYPE, it is a non-leaf node, and its main function is to serve as a branch of the subtree structure.

[0128] If the node is a leaf node and is defined by OBJECT-TYPE without involving SEQUENCE or Entry, the node is a SCALAR node; if the node contains SEQUENCE (including SEQUENCE OF) or Entry definition (including EntryOF) and is defined by OBJECT-TYPE, the node is a TABLE node.

[0129] If the node is a leaf node and is defined with the NOTIFICATION-TYPE keyword, then the node is a TRAP node.

[0130] In response to determining that the current node is a non-leaf node, steps 5061-5065 may be executed.

[0131] In step 5061, in response to determining that the current node is a non-leaf node, the OID macro definition of the node can be generated layer by layer according to the MIB tree structure. For example, the OID of the node in the MIB file can be converted into a C / C++ macro definition (i.e., an OID macro definition). The macro definition is a preprocessing instruction in the C / C++ language. By converting the OID of the node in the MIB file into a C / C++ macro definition, a reusable identifier can be created in the code, so that developers can more conveniently reference these OIDs through the OID macro definition when implementing SNMP agent-related functions.

[0132] In step 5062, it can be determined whether the current node is the previous non-leaf node of the leaf node. If the current node is not the previous non-leaf node of the leaf node, it can return to step 502 and read the next line of the MIB file; if the current node is the previous non-leaf node of the leaf node, step 5063 can be executed. Determining whether the current node is the previous non-leaf node of the leaf node is to determine whether the subordinate node of the current non-leaf node is a leaf node. If the subordinate node of the current non-leaf node is a leaf node, it is necessary to return to step 502, that is, read the next line of MIB file content. If the subordinate node of the current non-leaf node is not a leaf node, that is, the subordinate node of the current non-leaf node is still a non-leaf node, then execute the next step 5063.

[0133] In step 5063, a macro definition of a table structure (e.g., an ID and name of the table structure) and a field list of a cache data structure are generated. Elements of a node definition in a MIB file include an OID, a node name, a node data type (e.g., INTEGER, OBJECT STRING, SEQUENCE), access rights, current standard status, a detailed text description of the node's purpose or function, a table index, and the like.

[0134] Nodes are usually containers for some management objects, such as table structures or table objects. Non-leaf nodes do not hold data directly, but realize complex data structures by combining other management objects (for example, leaf nodes). Leaf nodes hold data and realize complex data structures by being combined with other management objects. In languages ​​such as C or C++, for table structures of non-leaf nodes or leaf nodes, it is necessary to define the table structure as a specific macro, i.e., macro definition. For example, the name of the table structure, the ID of the table structure, the index of the table structure, etc. are macro-defined. The table structure includes multiple entries, each entry consists of multiple columns, including multiple column objects, each column object has its own OID. The OID of the table structure may include the root OID, table OID, entry OID, and column OID. The root OID is the identifier of the branch in the MIB file where the definition and naming table is located. The table OID is the object identifier, which represents the entire table structure. The entry OID defines an entry in the table structure and is used to specify the entry for index search in the table structure. The column OID is used to define the column object in the entry. The cell (i.e., field) in the table structure can be identified by combining the index and the column OID. For each column in each entry, the specific field of the specific entry can be accessed through the index. The ID of the table structure is formed by each OID and organized in a hierarchical system.

[0135] When processing the data structure in the MIB file, it is necessary to map the table structure defined in the MIB file to the data structure in the C / C++ language. The data structure is used to represent each entry (i.e. each row) in the table structure. The data structure is represented as a structure in the C / C++ language. The field list of the data structure is used to identify the index of each entry in the table structure, which is used to query or identify a specific entry. The field list of the cached data structure is to cache the index of each entry in the table structure, which is used for the SNMP agent to index each entry in the table structure during operation.

[0136] In step 5064, a data structure definition may be generated. Generating a data structure definition is to convert the nodes defined in the MIB file (i.e., the definition of the managed object) into a data structure definition in the C / C++ language, i.e., mapping the SNMP agent management data to the application.

[0137] In step 5065, a Scalar type initial registration function can be generated. The initialization registration function is used to initialize and register the management objects in the MIB file. Initializing and registering the management objects in the MIB file includes allocating and initializing memory for the management objects, setting initial values, and registering the management objects in the SNMP agent so that they can be accessed in the network management session. The initialization registration function includes an initialization function and a registration function. The initialization function is used to initialize the management objects in the MIB file, for example, initializing memory for the management objects, setting initial values, etc. The registration function is used to register the management objects in the SNMP agent so that the SNMP agent request can be processed. For example, an initialization function and a registration function can be created for a table structure. The initialization function can allocate the initial required memory for the table structure.

[0138] In response to determining that the current node is a non-TABLE node and a non-TRAP leaf node, steps 5081 and 5063-5065 may be executed. In step 5081, it may be determined that the current node is a SCALAR node. For a SCALAR node, the steps of steps 5063-5065 may be referred to for processing the SCALAR node.

[0139] In response to determining that the current node is a TABLE node, steps 5082-5088 may be executed.

[0140] In step 5082, in response to determining that the current node is a TABLE node, a macro definition of a table structure corresponding to the current node is generated. For more descriptions of the macro definition of the table structure, reference may be made to step 5063. For example, generating a macro definition of a table structure includes generating a macro definition of a name of the table structure, an ID of the table structure, and the like.

[0141] In step 5083, read the next-level Entry node of the current node. If the current node is a TBALE node, the current node is a collection object, which is a collection of similar management objects. The TBALE node contains one or more entry nodes (i.e., Entry nodes) to represent entries. Each entry represents an instance (i.e., a row) in the table structure and contains one or more column objects.

[0142] In step 5084, the macro definition of the OID of the Entry node and the field list of the cache data structure are generated. For the generation of the OID macro definition, please refer to the description of step 5061. For the field list of the cache data structure, please refer to the detailed description in 6063.

[0143] In step 5085, the TBALE node is read in a loop. After each TABLE node is read, steps 5083 and 5084 are executed to generate the OID macro definition of the Entry node of the read TABLE node.

[0144] In step 5086, add the node information such as field, type, permission, comment, etc. to the cache data structure field list. The node information such as field, type, permission, comment, etc. can be set or defined in the MIB file in advance. As mentioned above, the elements of the node definition in the MIB file include OID, node name, data type (e.g., INTEGER, OBJECTSTRING, SEQUENCE), access permission, current standard status, detailed text description of node use or function, table index, etc. In addition to macro definition of table structure and OID, it is also necessary to add information such as data type, access permission, table index (i.e., field), detailed text description of node use or function (i.e., comment) to the cache data structure field list.

[0145] In step 5087 , a data structure definition may be generated; for a detailed description of generating the data structure definition, reference may be made to step 5064 .

[0146] In step 5088, a TABLE type initial registration function may be generated. For a detailed description of the initial registration function, reference may be made to the specific description in step 5065.

[0147] In response to determining that the node is a TRAP leaf node, steps 5101-5104 may be executed.

[0148] In step 5101, an OID macro definition is generated. For detailed description of generating the OID macro definition, please refer to step 5061.

[0149] In step 5102, the field list of the TRAP information corresponding to the TRAP node is checked. The TRAP node is used to actively notify the network management device of the occurrence of certain specific events, which are related to the device status or statistical information of the network element device. The management object corresponding to the TRAP node includes variables such as the device status or statistical information of the network element device that can be read and written by the SNMP protocol. The management object provides context information in the TRAP information, including state objects (for example, port status, CPU usage, etc.), configuration objects (for example, the routing table of the router, etc.), and statistical objects (for example, traffic statistics, number of connections, etc.). The instance change values ​​of these objects are the contents obtained or set in the SNMP agent request. When the management object reaches a certain threshold or condition, a TRAP event can be triggered, TRAP information is generated, and the TRAP information is sent to the network management device. The TRAP information includes the current value of the management object or a table composed of the current value of the management object, so that the status or statistical information of the network element device can be provided in the TRAP information for the network management device to analyze. The field list contained in the management object corresponding to the TRAP node can be used to index the table structure.

[0150] The field list contained in the TRAP message defines the fields that need to be reported in the report event, for example, including additional information of the TRAP message. The additional information of the TRAP message can contain more context information, such as the current interface traffic statistics, which interface is disconnected, etc. The accuracy of the TRAP message sent can be ensured by checking the field list contained in the management object.

[0151] In step 5103, a function for sending TRAP information is generated. A function for sending TRAP information can be generated based on the field list included in the management object corresponding to the TRAP node, so that the TRAP information can be sent through the function.

[0152] In 5104, processing is completed.

[0153] In step 512, a hook function for accessing or modifying data is generated. The types of hook functions include access type hook functions and modification type hook functions. The access type hook function is used to define a method for acquiring data. The modification type hook function is used to define a method for modifying data. The hook function can be defined in a data structure. When the data in the data structure is read, the access type hook function is triggered to read the data through the data acquisition method defined by the access type hook function. When the data in the data structure is modified (for example, added, removed, etc.), the modification type hook function is triggered to modify the data through the data modification method defined by the modification type hook function.

[0154] In some embodiments, hook functions can be used to add verification, logging, notification, and other functions when data is accessed or modified.

[0155] Based on the process of converting the MIB file into a computer executable code in this application, in the development of SNMP agent software for different network element devices, the SNMP agent module does not need to be developed from scratch. It only needs to define the MIB file and use the method shown in process 500 to realize the conversion of the MIB file into a computer executable code. This can greatly reduce the development threshold, simplify the workload of developers, improve development efficiency, and facilitate code version maintenance. The maintenance of the code version only requires the maintenance of the MIB file, and then the maintained MIB file is converted into code through the method shown in process 500, without the need to maintain the code.

[0156] Figure 6 Schematic diagram of an electronic device used to establish a control connection between a network element device and a network management device according to some embodiments of this specification. Figure 6As shown, the electronic device 600 includes a processor 602 and a memory 604. The memory is used to store a program of a method for establishing a control connection between a network element device and a network management device. After the electronic device is powered on and runs the program for establishing a control connection between the network element device and the network management device through the processor, the following steps are performed: obtaining the configuration information of the first network management device, and determining whether the network management device is valid based on the configuration information of the first network management device; in response to determining that the first network management device is valid, establishing a management connection between the network element device and the first network management device; in response to determining that the first network management device is invalid, the network element device rediscovers a valid second network management device, and establishes a management connection between the network element device and the newly discovered second network management device.

[0157] In some embodiments, the memory is used to store a program for establishing a method for developing an SNMP agent framework. After the electronic device is powered on and the processor runs the program for establishing an SNMP agent development framework, the following steps are performed: generating a MIB file, converting the MIB file into a code file, generating a data acquisition method, and compiling the code file to generate a computing device executable file to form an SNMP agent and integrating the data acquisition method into the SNMP agent.

[0158] An embodiment of the present application provides a computer-readable storage medium storing a program for a method of establishing a control connection between a network element device and a network management device. The program is executed by a processor to perform the following steps: obtaining configuration information of a first network management device, and determining whether the network management device is valid based on the configuration information of the first network management device; in response to determining that the first network management device is valid, establishing a management connection between the network element device and the first network management device; in response to determining that the first network management device is invalid, the network element device rediscovers a valid second network management device, and establishes a management connection between the network element device and the newly discovered second network management device.

[0159] An embodiment of the present application provides a computer-readable storage medium storing a program for a method of establishing an SNMP agent development framework. The program is executed by a processor to perform the following steps: generate an MIB file, convert the MIB file into a code file, generate a data acquisition method, and compile the code file to generate a computing device executable file to constitute an SNMP agent and integrate the data acquisition method into the SNMP agent.

[0160] Some embodiments of the present specification also provide a computer program product, including a computer program. When at least part of the computer program is executed by a processor, the present specification can be implemented. Figure 3-5In some embodiments, the computer program product may only involve computer instructions, which may be carried by a storage medium or a processing device. In other embodiments, the computer program product may also be a storage medium or a processing device containing the aforementioned computer instructions. The processing device may include one or more processors and a storage medium.

[0161] In some embodiments, the processor may be a combination of one or more of the following processors: a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a programmable logic controller (PLC), a reduced instruction set computer (RISC), and a microprocessor.

[0162] In some embodiments, the storage medium may include a combination of one or more of the following: a mass storage, a removable storage, a volatile read-write memory, and a read-only memory (ROM). Exemplary mass storage may include a magnetic disk, an optical disk, a solid-state hard disk, and the like. Exemplary removable storage may include a flash disk, a floppy disk, an optical disk, a memory card, a compressed hard disk, a magnetic tape, and the like. Exemplary volatile read-write memory may include a random access memory (RAM). Exemplary random access memory may include a dynamic random access memory (DRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), a static random access memory (SRAM), a thyristor random access memory (T-RAM), and a zero capacitance memory (Z-RAM), and the like. Exemplary read-only memory may include a masked read-only memory (MROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM), and a digital multifunction hard disk read-only memory, and the like.

[0163] Although the present application is disclosed as above with a preferred embodiment, it is not intended to limit the present application. Any person skilled in the art may make possible changes and modifications without departing from the spirit and scope of the present application. Therefore, the scope of protection of the present application shall be subject to the scope defined by the claims of the present application. For example, the wireless access device 700 also includes one or more input / output interfaces, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (flash RAM). The memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be a computer-readable instruction, a data structure, a module of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), random access memory (RAM) of other attributes, read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage media or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include non-transitory media such as modulated data signals and carrier waves.

[0164] For more information about each module, see Figure 2 The relevant description of will not be repeated here. It should be understood that Figure 2 The system and its modules shown can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software, or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will understand that the above methods and systems can be implemented using computer executable instructions and / or control codes contained in a processor, such as a disk, CD or DVD-ROM, etc., and such codes are provided in a carrier medium or a memory of a programmable device. The system and its modules of this specification can not only be implemented by hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above hardware circuits and software (e.g., firmware).

[0165] It should be noted that the above description of the system and its modules is only for convenience of description and does not limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules without deviating from this principle to form a subsystem connected to other modules. Or some modules may be split to obtain more modules or multiple units under the module. Such variations are all within the scope of the disclosure of this specification.

[0166] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) The SNMP management end (i.e., the network management device) discovers the management end address sent to the network element device through multicast, and the network element device discovers the SNMP management end by itself, which is convenient for dynamically managing a large-scale device list. At the same time, the private device discovery mechanism and the security parameter settings related to the device hardware information (e.g., key information) further enhance security; (2) For the SNMP software development of different network element devices, the SNMP agent module does not need to be developed from scratch. It only needs to define the MIB file, use the conversion tool and supplement the business logic (e.g., hook function), which can greatly reduce the development threshold, simplify the workload of developers, improve development efficiency, and facilitate code version maintenance; (3) The development of the SNMP agent module does not rely on third-party libraries, which is easy to port to various hardware platform environments; (4) The native SNMP protocol implements the agent end, which is lighter and more efficient, occupies almost no resources, and is also suitable for small network element devices, such as AP / router, etc. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.

[0167] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are taught in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.

Claims

1. A method for establishing a control connection between a network element device and a network management device, characterized in that: include: Obtaining configuration information of a first network management device; Determining whether the first network management device is valid based on the configuration information of the first network management device, where whether the first network management device is valid indicates whether the first network management device can be used to manage network element devices; In response to determining that the first network management device is valid, enabling the network element device to establish or maintain a management connection with the first network management device; as well as In response to determining that the first network management device is invalid, the network element device is enabled to rediscover a valid second network management device and establish a management connection with the second network management device.

2. The method according to claim 1, characterized in that In response to determining that the first network management device is invalid, causing the network element device to rediscover a valid second network management device and establish a management connection with the second network management device includes: The network element device sends a first multicast message; In response to receiving the first multicast message, the second network management device sends a second multicast message, where the second multicast message includes configuration information of the second network management device; The network element device sends identification information of the network element device to the second network management device based on the configuration information of the second network management device; and The second network management device adds the network element device to the management device list of the second network management device based on the identification information of the network element device.

3. The method according to claim 2, characterized in that The sending, by the network element device, the identification information of the network element device to the second network management device based on the configuration information of the second network management device includes: The SNMP agent module of the network element device sends Trap information to the network management device based on a discovery trap (Trap) mechanism, and the Trap information includes identification information of the network element device.

4. The method according to claim 1, characterized in that In response to determining that the first network management device is valid, enabling the network element device to establish or maintain a management connection with the first network management device includes: The SNMP agent module of the network element device sends Trap information to the network management device based on a heartbeat trap (Trap) mechanism, and the Trap information includes the operation status information of the network element device.

5. The method according to claim 2, characterized in that: The method further comprises: The network element device sends authentication information of the network element device to the second network management device based on the configuration information of the second network management device. The authentication information and the identification information are used by the second network management device to add the network element device to the management device list.

6. The method according to claim 1, characterized in that Determining whether the first network management device is valid based on the configuration information of the first network management device includes: Determine whether the first network management device can be accessed by the network element device based on the IP address information of the first network management device.

7. A device for establishing a control connection between a network element device and a network management device, comprising: An acquisition module, configured to acquire configuration information of a first network management device; a judgment module configured to judge whether the first network management device is valid based on the configuration information of the first network management device, wherein whether the first network management device is valid indicates whether the first network management device can be used to manage network element devices; The connection establishment module is configured as follows: In response to determining that the first network management device is valid, enabling the network element device to establish or maintain a management connection with the first network management device; as well as In response to determining that the first network management device is invalid, the network element device is enabled to rediscover a valid second network management device and establish a management connection with the second network management device.

8. The device according to claim 7, characterized in that The connection establishment module is further configured to: In response to determining that the first network management device is invalid, sending a first multicast message; receiving a second multicast message sent by the second network management device in response to receiving the first multicast message, wherein the second multicast message includes configuration information of the second network management device; The identification information of the network element device is sent to the second network management device based on the configuration information of the second network management device. The second network management device adds the network element device to the management device list of the second network management device based on the identification information of the network element device.

9. An electronic device for establishing a control connection between a network element device and a network management device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program or a computer executable instruction, and when the computer program or the computer executable instruction is executed by the processor, the method according to any one of claims 1 to 6 is implemented.

10. A computer program product, characterized in that The invention comprises a computer program, and when at least a part of the computer program is executed by a processor, the method according to any one of claims 1 to 6 can be implemented.