CN111585815B - Port data acquisition method and device - Google Patents
Port data acquisition method and device Download PDFInfo
- Publication number
- CN111585815B CN111585815B CN202010388876.3A CN202010388876A CN111585815B CN 111585815 B CN111585815 B CN 111585815B CN 202010388876 A CN202010388876 A CN 202010388876A CN 111585815 B CN111585815 B CN 111585815B
- Authority
- CN
- China
- Prior art keywords
- ports
- network
- data
- network element
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 40
- 238000004891 communication Methods 0.000 claims abstract description 28
- 238000004590 computer program Methods 0.000 claims description 18
- 230000004044 response Effects 0.000 claims description 15
- 230000005540 biological transmission Effects 0.000 claims description 11
- 230000003993 interaction Effects 0.000 abstract description 3
- 230000007246 mechanism Effects 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 101150073458 DOT1 gene Proteins 0.000 description 1
- 101100278332 Dictyostelium discoideum dotA gene Proteins 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000008569 process Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/02—Standardisation; Integration
- H04L41/0213—Standardised network management protocols, e.g. simple network management protocol [SNMP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0823—Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The application provides a port data acquisition method and device, wherein the method comprises the following steps: collecting equipment data of network element equipment according to the network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address; determining a virtual interface network address as a network communication address according to the physical address in the equipment data; establishing connection with the network element equipment according to the network communication address; based on simple network management protocol SNMP, collecting port data of the network element equipment can solve the problems that in the related art, query conditions are required to be agreed between the network management equipment and the network element equipment, so that compatibility of the network management equipment is reduced, the network element equipment needs a certain customization, and under the condition that the network element equipment does not need customization, a network address of a virtual interface is selected for communication based on a physical address, the port data is collected based on an original mechanism of SNMP, and the cost of order-of-magnitude network interaction of the number of the virtual interfaces is reduced.
Description
Technical Field
The application relates to the technical field of data acquisition, in particular to a port data acquisition method and device.
Background
With the continuous development of communication technology, large enterprises and government institutions access more and more network devices, and the network topology structure is more and more complex. In order to realize efficient and accurate operation and maintenance management, the network topology structure model of the current local area network is automatically acquired, and the method has great significance on operation and maintenance work.
The existing network topology top-level device is usually a frame slot type or stacked network element device, which has two characteristics, namely a plurality of virtual interfaces and a plurality of ports. Currently, network management devices acquire network management protocols of network element devices, usually a simple network management protocol (Simple Network Management Protocol, abbreviated as SNMP) is used, which can provide a minimum network management function protocol.
However, when SNMP is used to collect port data, the number of interactive messages is an integer multiple of the product of the number of virtual interfaces and the number of ports, which is low in efficiency. Therefore, under the condition that the performance of the network management equipment is affected by the specification of the collected port data, the method has important significance in rapidly collecting the port data.
In the related art, a method for acquiring data with conditions in SNMP is proposed, query conditions of a proposed data record are encoded in network management equipment, decoding is performed at a network element end, data filtering is performed according to the query conditions, and a first data record is returned.
The above scheme has the following defects: firstly, query conditions are required to be agreed between network management equipment and network element equipment, so that the compatibility of the network management equipment is reduced; and secondly, a module for processing the query condition is required to be added on the network element equipment, which brings a certain customized load to manufacturers of the network element equipment.
Aiming at the problems that the query condition is required to be agreed between the network management equipment and the network element equipment in the related technology, thereby reducing the compatibility of the network management equipment and enabling the network element equipment to be customized to a certain extent, no solution is proposed yet.
Disclosure of Invention
The embodiment of the application provides a port data acquisition method and device, which at least solve the problems that in the related art, query conditions are required to be agreed between network management equipment and network element equipment, so that the compatibility of the network management equipment is reduced, and the network element equipment needs to be customized to a certain extent.
According to an embodiment of the present application, there is provided a port data acquisition method including:
collecting equipment data of network element equipment according to the network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
establishing connection with the network element equipment according to the network communication address;
based on simple network management protocol SNMP, collecting port data of the network element equipment.
Optionally, based on a simple network management protocol SNMP, collecting port data of the network element device includes:
sending the acquisition operation GetBulk request of the SNMP to the network element equipment, wherein the GetBulk request carries data attributes and acquires the number of the requested ports at one time;
and receiving a response message returned by the network element equipment, wherein the response message carries port data corresponding to the data attribute and the actual port number of the primary acquisition reply.
Optionally, before sending the SNMP get operation getblock request to the network element device, the method further includes:
acquiring the data attribute;
and determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment.
Optionally, determining the number of ports of the one acquisition request according to the number of acquired ports and the number of physical ports of the network element device includes:
comparing the number of the acquired ports with the number of the physical ports, wherein the initial value of the number of the acquired ports is 0;
if the number of the acquired ports is smaller than the number of the physical ports, determining that the number of the ports to be requested of the data attribute is the difference value between the number of the physical ports and the number of the acquired ports;
comparing the number of the ports to be requested with the maximum number of the ports acquired once of the data attribute;
if the number of the ports to be requested is larger than the maximum number of the ports acquired once, determining that the number of the ports requested once is the maximum number of the ports acquired once;
and if the number of the ports to be requested is smaller than or equal to the maximum number of the ports, determining the number of the ports to be requested of the one acquisition request as the number of the ports to be requested.
Optionally, before comparing the number of ports to be requested with the maximum number of ports of one acquisition of the data attribute, the method further includes:
acquiring the maximum occupied byte number of the data attribute;
and determining the maximum port number acquired at one time as the ratio of the preset maximum transmission unit occupied byte number to the maximum occupied byte number of the data attribute.
Optionally, after receiving the response message returned by the network element device, the method further includes:
and updating the number of the acquired ports to be the sum of the actual number of the ports recovered by one acquisition and the number of the acquired ports.
According to another embodiment of the present application, there is also provided a port data acquisition apparatus including:
the first acquisition module is used for acquiring equipment data of the network element equipment according to the network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
the determining module is used for determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
the connection establishment module is used for establishing connection with the network element equipment according to the network communication address;
and the second acquisition module is used for acquiring the port data of the network element equipment based on a simple network management protocol SNMP.
Optionally, the second acquisition module includes:
a sending submodule, configured to send a getblock request for the SNMP acquisition operation to the network element device, where the getblock request carries a data attribute, and collects the number of ports of the request at a time;
and the receiving sub-module is used for receiving a response message returned by the network element equipment, wherein the response message carries port data corresponding to the data attribute and the actual port number of the primary acquisition reply.
Optionally, the apparatus further comprises:
an acquisition sub-module for acquiring the data attribute;
and the determining submodule is used for determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment.
Optionally, the determining submodule includes:
the first comparison unit is used for comparing the number of the acquired ports with the number of the physical ports, wherein the initial value of the number of the acquired ports is 0;
the first determining unit is used for determining that the number of ports to be requested of the data attribute is the difference value between the number of the physical ports and the number of the acquired ports if the number of the acquired ports is smaller than the number of the physical ports;
the second comparison unit is used for comparing the number of the ports to be requested with the maximum number of the ports acquired once of the data attribute;
the second determining unit is configured to determine that the number of ports requested by the primary acquisition is the maximum number of ports acquired by the primary acquisition if the number of ports to be requested is greater than the maximum number of ports acquired by the primary acquisition;
and the third determining unit is used for determining the port number of the one acquisition request as the port number to be requested if the port number to be requested is smaller than or equal to the maximum port number.
Optionally, the apparatus further comprises:
an obtaining unit, configured to obtain a maximum occupied byte number of the data attribute;
and the fourth determining unit is used for determining the maximum port number acquired at one time as the ratio of the preset maximum transmission unit occupied byte number to the maximum occupied byte number of the data attribute.
Optionally, the apparatus further comprises:
and the updating sub-module is used for updating the number of the acquired ports into the sum of the actual number of the ports recovered by one acquisition and the number of the acquired ports.
According to a further embodiment of the application, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the application, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
According to the application, the device data of the network element device are collected according to the network segment address, wherein the device data comprise: physical address, number of physical ports, virtual interface network address; determining a virtual interface network address as a network communication address according to the physical address in the equipment data; establishing connection with the network element equipment according to the network communication address; based on a simple network management protocol SNMP, the port data of the network element equipment are acquired, the problem that in the related art, query conditions are required to be agreed between the network management equipment and the network element equipment, so that the compatibility of the network management equipment is reduced, the network element equipment needs a certain customization is solved, under the condition that the network element equipment does not need customization, a network address of a virtual interface is selected for communication based on a physical address, the port data are acquired based on an original mechanism of the SNMP, and the cost of order-of-magnitude network interaction of the number of the virtual interfaces is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a port data acquisition method according to an embodiment of the present application;
FIG. 2 is a flow chart of a port data acquisition method according to an embodiment of the application;
FIG. 3 is a flow chart of SNMP based rapid acquisition port data according to an embodiment of the present application;
FIG. 4 is a flow chart of a method of port data acquisition for a single data attribute according to an embodiment of the present application;
fig. 5 is a block diagram of a port data acquisition device according to an embodiment of the present application.
Detailed Description
The application will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
Example 1
The method according to the first embodiment of the present application may be implemented in a mobile terminal, a computer terminal or a similar computing device. Taking a mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of a mobile terminal according to an embodiment of the present application, where, as shown in fig. 1, the mobile terminal 10 may include one or more (only one is shown in fig. 1) processors 102 (the processors 102 may include, but are not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input/output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1 or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program of application software and a module, such as a computer program corresponding to a message receiving method in an embodiment of the present application, and the processor 102 executes the computer program stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. The specific examples of networks described above may include wireless networks provided by the communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for collecting port data running on the mobile terminal or the network architecture is provided, and fig. 2 is a flowchart of a method for collecting port data according to an embodiment of the present application, as shown in fig. 2, where the flowchart includes the following steps:
step S202, collecting equipment data of network element equipment according to a network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
step S204, determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
step S206, establishing connection with the network element equipment according to the network communication address;
step S208, collecting the port data of the network element equipment based on a simple network management protocol SNMP.
Through the steps S202 to S208, the problem that in the related art, query conditions are required to be agreed between network management equipment and network element equipment, so that compatibility of the network management equipment is reduced, and certain customization is required for the network element equipment is solved.
In the embodiment of the present application, the step S208 may specifically include:
sending the acquisition operation GetBulk request of the SNMP to the network element equipment, wherein the GetBulk request carries data attributes and acquires the number of the requested ports at one time;
and receiving a response message returned by the network element equipment, wherein the response message carries port data corresponding to the data attribute and the actual port number of the primary acquisition reply.
In an alternative embodiment, the data attribute is acquired before sending an acquisition operation getblock request of the SNMP to the network element device; determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment, and specifically comparing the acquired port number with the physical port number, wherein the initial value of the acquired port number is 0; if the number of the acquired ports is smaller than the number of the physical ports, determining that the number of the ports to be requested of the data attribute is the difference value between the number of the physical ports and the number of the acquired ports; comparing the number of the ports to be requested with the maximum number of the ports acquired once of the data attribute; if the number of the ports to be requested is larger than the maximum number of the ports acquired once, determining that the number of the ports requested once is the maximum number of the ports acquired once; and if the number of the ports to be requested is smaller than or equal to the maximum number of the ports, determining the number of the ports to be requested of the one acquisition request as the number of the ports to be requested.
Further, before comparing the number of ports to be requested with the maximum number of ports acquired once of the data attribute, acquiring the maximum occupied byte number of the data attribute; and determining the maximum port number acquired at one time as the ratio of the preset maximum transmission unit occupied byte number to the maximum occupied byte number of the data attribute.
In another optional embodiment, after receiving the response message returned by the network element device, the number of acquired ports is updated to be the sum of the actual number of ports in the one-time acquisition reply and the number of acquired ports.
Embodiments of the present application will be described below with reference to specific examples.
Fig. 3 is a flowchart of SNMP based rapid acquisition port data according to an embodiment of the present application, as shown in fig. 3, comprising:
step S301, collecting device data of the network element device at one time by using a GetRequest method of SNMP according to the network segment address, wherein the device data comprises: the physical address dot1 dBaseBridgedAddress, the physical port number dot1dBaseNumPorts, the virtual interface network address ipadEntAddr.
Step S302, selecting a network address from the ipatentdaddr in step S301 as the network communication address of the next step according to the physical address.
Step S303, collecting port data by using the network communication address in step S302 and using the GetBulk method of SNMP, wherein the data attributes required to be collected are as follows: port index ifIndex (length 1-5), port description ifDescr (length 0-255), port status ifOperStatu (length 1), port maximum transfer unit ifMtu (length 1-5), port receive byte number ifInOctes (length 1-10).
The mechanism of collection is that the port data corresponding to the data attribute may be sequentially performed, and fig. 4 is a flowchart of a method for collecting port data with a single data attribute according to an embodiment of the present application, as shown in fig. 4, including:
s401, calculating the maximum number N of ports acquired by a single attribute at one time according to the maximum occupied byte number of the port attribute.
S402, initializing the number NTotal of the ports acquired by a single attribute to be 0, the number NReq of the actual ports acquired at one time to be 0, and the number NRes of the actual ports acquired at one time to be recovered to be 0.
S403, comparing NTotal with the physical port number (obtained from the device level data) of the network element device, and if NTotal < dot1dBaseNumPorts, executing step S404, otherwise, ending the acquisition process of the attribute and requesting the next port attribute.
S404, calculating the number nReq of the required request ports is calculated by the following method:
nReq=dot1dBaseNumPorts-NTotal。
s405, comparing nReq with the maximum number N of ports acquired by a single attribute, if nReq > N, executing step S406, otherwise executing step S407.
S406, the actual port number NReq of the one-time acquisition request is adjusted to N.
S407, determining NReq as nReq;
s408, getblock using SNMP requests NReq port data.
S409, the actual number of the port collected data returned by the receiving network element equipment is NRes, the NTotal accumulated value is calculated, the NTotal accumulated value is the sum of the previous NTotal and NRes, and step S403 is executed.
According to the embodiment of the application, based on the physical address, the network address of one virtual interface is selected for communication, so that the cost of order-of-magnitude network interaction of the number of the virtual interfaces is reduced; based on SNMP, the actual physical port number of the network element equipment is acquired, the maximum port number of the single attribute is dynamically calculated, the port data is rapidly acquired based on the maximum port number, and the efficiency of acquiring the port data is improved. The original GetBulk method based on SNMP not only improves the compatibility of network management equipment, but also does not need to customize network element equipment.
Example 2
According to another embodiment of the present application, there is further provided a port data acquisition apparatus, and fig. 5 is a block diagram of the port data acquisition apparatus according to an embodiment of the present application, as shown in fig. 5, including:
a first collecting module 52, configured to collect device data of a network element device according to a network segment address, where the device data includes: physical address, number of physical ports, virtual interface network address;
a determining module 54, configured to determine a virtual interface network address as a network communication address according to the physical address in the device data;
a connection establishment module 56, configured to establish a connection with the network element device according to the network communication address;
a second collection module 58 is configured to collect port data of the network element device based on a simple network management protocol SNMP.
Optionally, the second acquisition module 58 includes:
a sending submodule, configured to send a getblock request for the SNMP acquisition operation to the network element device, where the getblock request carries a data attribute, and collects the number of ports of the request at a time;
and the receiving sub-module is used for receiving a response message returned by the network element equipment, wherein the response message carries port data corresponding to the data attribute and the actual port number of the primary acquisition reply.
Optionally, the apparatus further comprises:
an acquisition sub-module for acquiring the data attribute;
and the determining submodule is used for determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment.
Optionally, the determining submodule includes:
the first comparison unit is used for comparing the number of the acquired ports with the number of the physical ports, wherein the initial value of the number of the acquired ports is 0;
the first determining unit is used for determining that the number of ports to be requested of the data attribute is the difference value between the number of the physical ports and the number of the acquired ports if the number of the acquired ports is smaller than the number of the physical ports;
the second comparison unit is used for comparing the number of the ports to be requested with the maximum number of the ports acquired once of the data attribute;
the second determining unit is configured to determine that the number of ports requested by the primary acquisition is the maximum number of ports acquired by the primary acquisition if the number of ports to be requested is greater than the maximum number of ports acquired by the primary acquisition;
and the third determining unit is used for determining the port number of the one acquisition request as the port number to be requested if the port number to be requested is smaller than or equal to the maximum port number.
Optionally, the apparatus further comprises:
an obtaining unit, configured to obtain a maximum occupied byte number of the data attribute;
and the fourth determining unit is used for determining the maximum port number acquired at one time as the ratio of the preset maximum transmission unit occupied byte number to the maximum occupied byte number of the data attribute.
Optionally, the apparatus further comprises:
and the updating sub-module is used for updating the number of the acquired ports into the sum of the actual number of the ports recovered by one acquisition and the number of the acquired ports.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Example 3
Embodiments of the present application also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, collecting equipment data of network element equipment according to a network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
s2, determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
s3, establishing connection with the network element equipment according to the network communication address;
s4, based on a simple network management protocol SNMP, collecting port data of the network element equipment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Example 4
An embodiment of the application also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, collecting equipment data of network element equipment according to a network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
s2, determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
s3, establishing connection with the network element equipment according to the network communication address;
s4, based on a simple network management protocol SNMP, collecting port data of the network element equipment.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present application and is not intended to limit the present application, but various modifications and variations can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present application should be included in the protection scope of the present application.
Claims (7)
1. A method for port data acquisition, comprising:
collecting equipment data of network element equipment according to the network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
establishing connection with the network element equipment according to the network communication address;
based on a simple network management protocol SNMP, collecting port data of the network element equipment comprises the following steps: sending the acquisition operation GetBulk request of the SNMP to the network element equipment, wherein the GetBulk request carries data attributes and acquires the number of the requested ports at one time; receiving a response message returned by the network element equipment, wherein the response message carries port data corresponding to the data attribute and the actual port number of the primary acquisition reply;
wherein, before sending the SNMP get operation getblock request to the network element device, the method further includes:
acquiring the data attribute;
and determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment.
2. The method of claim 1, wherein determining the number of ports of the one acquisition request based on the number of acquired ports and the number of physical ports of the network element device comprises:
comparing the number of the acquired ports with the number of the physical ports, wherein the initial value of the number of the acquired ports is 0;
if the number of the acquired ports is smaller than the number of the physical ports, determining that the number of the ports to be requested of the data attribute is the difference value between the number of the physical ports and the number of the acquired ports;
comparing the number of the ports to be requested with the maximum number of the ports acquired once of the data attribute;
if the number of the ports to be requested is larger than the maximum number of the ports acquired once, determining that the number of the ports requested once is the maximum number of the ports acquired once;
and if the number of the ports to be requested is smaller than or equal to the maximum number of the ports, determining the number of the ports to be requested of the one acquisition request as the number of the ports to be requested.
3. The method of claim 2, wherein prior to comparing the number of ports to be requested to the maximum number of ports for one acquisition of the data attribute, the method further comprises:
acquiring the maximum occupied byte number of the data attribute;
and determining the maximum port number acquired at one time as the ratio of the preset maximum transmission unit occupied byte number to the maximum occupied byte number of the data attribute.
4. The method according to claim 2, wherein after receiving the response message returned by the network element device, the method further comprises:
and updating the number of the acquired ports to be the sum of the actual number of the ports recovered by one acquisition and the number of the acquired ports.
5. A port data acquisition device, comprising:
the first acquisition module is used for acquiring equipment data of the network element equipment according to the network segment address, wherein the equipment data comprises: physical address, number of physical ports, virtual interface network address;
the determining module is used for determining a virtual interface network address as a network communication address according to the physical address in the equipment data;
the connection establishment module is used for establishing connection with the network element equipment according to the network communication address;
the second acquisition module is used for acquiring port data of the network element equipment based on a simple network management protocol SNMP;
wherein, the second acquisition module includes: a sending submodule, configured to send a getblock request for the SNMP acquisition operation to the network element device, where the getblock request carries a data attribute, and collects the number of ports of the request at a time;
a receiving sub-module, configured to receive a response message returned by the network element device, where the response message carries port data corresponding to the data attribute and an actual port number of a primary acquisition reply;
wherein the apparatus further comprises:
an acquisition sub-module for acquiring the data attribute;
and the determining submodule is used for determining the port number of the one-time acquisition request according to the acquired port number of the data attribute and the physical port number of the network element equipment.
6. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to execute the method of any of claims 1 to 4 when run.
7. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010388876.3A CN111585815B (en) | 2020-05-09 | 2020-05-09 | Port data acquisition method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010388876.3A CN111585815B (en) | 2020-05-09 | 2020-05-09 | Port data acquisition method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111585815A CN111585815A (en) | 2020-08-25 |
CN111585815B true CN111585815B (en) | 2023-11-03 |
Family
ID=72112176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010388876.3A Active CN111585815B (en) | 2020-05-09 | 2020-05-09 | Port data acquisition method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111585815B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112564957B (en) * | 2020-12-01 | 2022-05-17 | 武汉绿色网络信息服务有限责任公司 | Method and device for acquiring running data of virtual network element |
CN115348334B (en) * | 2021-05-13 | 2023-10-27 | 中移(上海)信息通信科技有限公司 | Data analysis method and device and related equipment |
CN115442268B (en) * | 2022-08-30 | 2023-06-09 | 烽火通信科技股份有限公司 | Network element port state detection and positioning system and method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004071014A1 (en) * | 2003-02-06 | 2004-08-19 | Fujitsu Limited | Snmp proxy agent and management information relay method |
CN101202751A (en) * | 2006-12-13 | 2008-06-18 | 国际商业机器公司 | System and method for providing SNMP data for virtual networking devices |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6385197B1 (en) * | 1999-07-09 | 2002-05-07 | Allied Telesyn International Corp. | Virtual port trunking method and apparatus |
US20070086449A1 (en) * | 2005-10-18 | 2007-04-19 | Aten International Co., Ltd | System and method for remote management |
JP2008219279A (en) * | 2007-03-01 | 2008-09-18 | Toshiba Corp | Network monitoring method and network monitoring system |
CN101340340B (en) * | 2007-07-31 | 2012-07-11 | 杭州华三通信技术有限公司 | Access point configuring management method and access controller |
CN103368764B (en) * | 2012-04-10 | 2018-05-04 | 中兴通讯股份有限公司 | The implementation method and Network Management System of a kind of virtual network |
CN105071945B (en) * | 2015-06-26 | 2019-04-23 | 国网山东省电力公司济南供电公司 | A kind of network terminal address batch binding method based on switch technology |
-
2020
- 2020-05-09 CN CN202010388876.3A patent/CN111585815B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2004071014A1 (en) * | 2003-02-06 | 2004-08-19 | Fujitsu Limited | Snmp proxy agent and management information relay method |
CN101202751A (en) * | 2006-12-13 | 2008-06-18 | 国际商业机器公司 | System and method for providing SNMP data for virtual networking devices |
Also Published As
Publication number | Publication date |
---|---|
CN111585815A (en) | 2020-08-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111585815B (en) | Port data acquisition method and device | |
CN110312279B (en) | Network data monitoring method and device | |
CN112822646B (en) | Message processing method and device, electronic equipment and computer readable storage medium | |
WO2021073392A1 (en) | Data subscription method, apparatus and system | |
CN105450479A (en) | Method and apparatus for monitoring module | |
CN114391234B (en) | Data acquisition method and device, modbus system and storage medium | |
CN110087226B (en) | Flow statistical method and device, storage medium and electronic device | |
CN101860454B (en) | Network performance data processing method and device thereof | |
CN112422485B (en) | Communication method and device of transmission control protocol | |
CN114741261A (en) | Distributed link tracking method, device, equipment and storage medium | |
CN111884938A (en) | Router information acquisition method and device | |
CN112311686B (en) | Data processing method and device, electronic equipment and storage medium | |
CN107784006B (en) | Data processing method and device | |
CN112769923A (en) | Method, device and storage medium for monitoring network equipment performance index in big data scene | |
CN112491583A (en) | Data acquisition and analysis method and device | |
CN113194045A (en) | Data flow analysis method and device, storage medium and processor | |
US11606274B1 (en) | Method for operations of virtual machines in monitoring cloud activities, system, and device applying the method | |
CN112165465B (en) | Data processing method and device for outgoing third-party platform and electronic device | |
CN116760795B (en) | Network address translation NAT gateway equipment, message processing method and device | |
CN114666313B (en) | Parameter acquisition method, server, terminal and readable storage medium | |
CN114189565B (en) | Head area restoration system, method and related equipment | |
CN112769889B (en) | Service data pushing method and device, storage medium and electronic device | |
WO2024093851A1 (en) | Internet of things device heartbeat detection method and system, and communication apparatus | |
CN117278568A (en) | Cross-regional network communication method, server and storage medium | |
CN114339826A (en) | Performance data file generation method and device, storage medium and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |