CN115242619A - Device port connection relationship establishment method, device, electronic device and storage medium - Google Patents
Device port connection relationship establishment method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN115242619A CN115242619A CN202210710335.7A CN202210710335A CN115242619A CN 115242619 A CN115242619 A CN 115242619A CN 202210710335 A CN202210710335 A CN 202210710335A CN 115242619 A CN115242619 A CN 115242619A
- Authority
- CN
- China
- Prior art keywords
- port
- address
- audited
- equipment
- target
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000012545 processing Methods 0.000 claims abstract description 19
- 238000012550 audit Methods 0.000 claims description 28
- 238000004590 computer program Methods 0.000 claims description 16
- 238000013024 troubleshooting Methods 0.000 abstract description 5
- 238000012423 maintenance Methods 0.000 description 16
- 238000010586 diagram Methods 0.000 description 13
- 230000008569 process Effects 0.000 description 13
- 239000000463 material Substances 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 239000000284 extract Substances 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 238000012217 deletion Methods 0.000 description 2
- 230000037430 deletion Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
Images
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/06—Management of faults, events, alarms or notifications
- H04L41/0677—Localisation of faults
-
- 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/12—Discovery or management of network topologies
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
Description
技术领域technical field
本申请涉及互联网数据通信技术领域,特别是涉及一种设备端口连接关系建立方法、装置、电子设备及存储介质。The present application relates to the technical field of Internet data communication, and in particular, to a method, apparatus, electronic device and storage medium for establishing a device port connection relationship.
背景技术Background technique
当前大型企业、政府、学校等多种场所内均已部署企业机房,对网络资源的维护管理主要依赖于系统资料及网管系统。在实际情况中,存在机房缺乏维护、机房设备堆叠、网络拓扑缺失、资料与现场设备对应不上等情况,给机房的运营维护,故障排查带来极大阻碍。特别是部分设备存在不可网管的情况,管理维护人员无法了解不可网管设备的设备位置、设计级联情况等信息,无法明确网络拓扑,出现故障进行线路维护时需现场逐步排查,耗费了大量的人力物力,且耽误故障处理时间。At present, enterprise computer rooms have been deployed in various places such as large enterprises, governments, and schools. The maintenance and management of network resources mainly rely on system data and network management systems. In practice, there are situations such as lack of maintenance in the equipment room, stacking of equipment in the equipment room, lack of network topology, and incompatibility between data and field equipment, which greatly hinders the operation, maintenance and troubleshooting of the equipment room. In particular, some devices cannot be managed by the network. The management and maintenance personnel cannot know the information such as the location of the devices that cannot be managed, the design cascading, etc., and cannot clarify the network topology. material resources, and delay the troubleshooting time.
发明内容SUMMARY OF THE INVENTION
本申请实施例所要解决的技术问题是提供一种设备端口连接关系建立方法、装置、电子设备及存储介质,以解决现有技术中出现故障进行线路维护时需现场逐步排查,耗费了大量的人力物力,且耽误故障处理时间的技术问题。The technical problem to be solved by the embodiments of the present application is to provide a device port connection relationship establishment method, device, electronic device and storage medium, so as to solve the problem that in the prior art, when a fault occurs in the line maintenance, it needs to be checked step by step on site, which consumes a lot of manpower material resources, and technical problems that delay troubleshooting time.
第一方面,本申请实施例提供了一种设备端口连接关系建立方法,应用于稽核终端,包括:In a first aspect, an embodiment of the present application provides a method for establishing a device port connection relationship, which is applied to an audit terminal, including:
在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集所述目标地址段对应的流量报文信息;After the server sends a packet request of the specified protocol to the acquired target address segment corresponding to the port of the device to be audited, collects the traffic packet information corresponding to the destination address segment;
对所述流量报文信息进行提取处理,得到所述待稽核设备端口内每个端口对应的IP地址和物理地址;Extracting and processing the traffic message information to obtain an IP address and a physical address corresponding to each port in the port of the device to be audited;
将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器,以由所述服务器根据所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。Send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server, so that the server can use the port identifier of each port in the port of the device to be audited according to the port identifier of the device to be audited. , the IP address and physical address corresponding to each port, generate the device port connection relationship corresponding to the device port to be audited, and mark the device port connection relationship corresponding to the device port to be audited in the device port topology structure and the physical address.
可选地,所述采集所述目标地址段对应的流量报文信息,包括:Optionally, the collecting the traffic packet information corresponding to the target address segment includes:
在镜像交换机接入所述待稽核设备端口之后,获取用户输入的目标端口的目标端口标识;After the mirror switch is connected to the port of the device to be audited, obtain the target port identifier of the target port input by the user;
对所述镜像交换机的镜像口进行报文信息采集,以得到包含所述目标端口标识的流量报文信息。Packet information is collected on the mirror port of the mirror switch to obtain flow packet information including the target port identifier.
可选地,所述将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器,包括:Optionally, sending the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server, including:
根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述每个端口对应的端口二维码;Generate a port two-dimensional code corresponding to each port according to the port identifier of each port, the IP address and physical address corresponding to each port;
扫描所述端口二维码,以将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器。Scan the port two-dimensional code to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server.
第二方面,本申请实施例提供了一种设备端口连接关系建立方法,应用于服务器,包括:In a second aspect, an embodiment of the present application provides a method for establishing a device port connection relationship, which is applied to a server, including:
获取待稽核设备端口对应的目标地址段;Obtain the target address segment corresponding to the port of the device to be audited;
根据所述目标地址段,向所述目标地址段内的IP地址发送指定协议的报文请求;According to the target address segment, send a message request of the specified protocol to the IP address in the target address segment;
获取由稽核终端发送的所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址;Obtain the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port sent by the audit terminal;
根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系;Generate the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port, the IP address and the physical address corresponding to each port;
在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。The device port connection relationship and the physical address corresponding to the device port to be audited are marked in the device port topology structure.
可选地,在所述获取由稽核终端发送的所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址之后,还包括:Optionally, after obtaining the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port sent by the auditing terminal, the method further includes:
删除所述稽核终端上传的IP地址中出现次数大于次数阈值的IP地址。Delete the IP addresses whose occurrence times are greater than the threshold of times among the IP addresses uploaded by the audit terminal.
可选地,所述根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系,包括:Optionally, generating the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port, the IP address and the physical address corresponding to each port, including:
根据所述待稽核设备端口内目标端口对应的IP地址,获取所述目标端口下的终端数量;Obtain the number of terminals under the target port according to the IP address corresponding to the target port in the port of the device to be audited;
根据所述终端数量,生成所述目标端口对应的设备端口连接关系。According to the number of terminals, a device port connection relationship corresponding to the target port is generated.
可选地,所述根据所述终端数量,生成所述目标端口对应的设备端口连接关系,包括:Optionally, generating the device port connection relationship corresponding to the target port according to the number of terminals includes:
在所述终端数量为1时,生成所述目标端口对应的下挂单个终端的连接关系;When the number of terminals is 1, generating a connection relationship of a single terminal connected to the target port corresponding to the target port;
在所述终端数量均大于所述待稽核设备端口的其它端口时,生成所述目标端口对应的设备上联端口的连接关系;When the number of the terminals is greater than other ports of the device port to be audited, generating a connection relationship of the device uplink port corresponding to the target port;
在所述终端数量大于1,且非最大值时,生成所述目标端口对应的端口下挂网络设备的连接关系。When the number of terminals is greater than 1 and is not the maximum value, a connection relationship of a network device connected to a port corresponding to the target port is generated.
第三方面,本申请实施例提供了一种设备端口连接关系建立装置,应用于稽核终端,包括:In a third aspect, an embodiment of the present application provides an apparatus for establishing a device port connection relationship, which is applied to an audit terminal, including:
报文信息采集模块,用于在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集所述目标地址段对应的流量报文信息;A packet information collection module, configured to collect traffic packet information corresponding to the target address segment after the server sends a packet request of the specified protocol to the acquired target address segment corresponding to the port of the device to be audited;
IP地址获取模块,用于对所述流量报文信息进行提取处理,得到所述待稽核设备端口内每个端口对应的IP地址和物理地址;The IP address obtaining module is used for extracting and processing the traffic message information to obtain the IP address and physical address corresponding to each port in the port of the device to be audited;
IP地址发送模块,用于将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器,以由所述服务器根据所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。The IP address sending module is configured to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server, so that the server can send the port of the device to be audited according to the port of the device to be audited. The port identifier of each port, the IP address and physical address corresponding to each port, generate the device port connection relationship corresponding to the device port to be audited, and mark the device port corresponding to the device port to be audited in the device port topology structure. Port connection relationship and the physical address.
可选地,所述报文信息采集模块包括:Optionally, the packet information collection module includes:
目标端口标识获取单元,用于在镜像交换机接入所述待稽核设备端口之后,获取用户输入的目标端口的目标端口标识;a target port identifier acquisition unit, configured to acquire the target port identifier of the target port input by the user after the mirror switch is connected to the device port to be audited;
流量报文信息获取单元,用于对所述镜像交换机的镜像口进行报文信息采集,以得到包含所述目标端口标识的流量报文信息。A flow packet information acquisition unit, configured to collect packet information on the mirroring port of the mirroring switch, so as to obtain the flow packet information including the target port identifier.
可选地,所述IP地址发送模块包括:Optionally, the IP address sending module includes:
端口二维码生成单元,用于根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述每个端口对应的端口二维码;A port two-dimensional code generation unit, configured to generate a port two-dimensional code corresponding to each port according to the port identifier of each port, the corresponding IP address and physical address of each port;
IP地址发送单元,用于扫描所述端口二维码,以将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器。The IP address sending unit is configured to scan the port two-dimensional code to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server.
第四方面,本申请实施例提供了一种设备端口连接关系建立装置,应用于服务器,包括:In a fourth aspect, an embodiment of the present application provides an apparatus for establishing a device port connection relationship, which is applied to a server and includes:
目标地址段获取模块,用于获取待稽核设备端口对应的目标地址段;The target address segment obtaining module is used to obtain the target address segment corresponding to the port of the device to be audited;
报文请求发送模块,用于根据所述目标地址段,向所述目标地址段内的IP地址发送指定协议的报文请求;A message request sending module, configured to send a message request of a specified protocol to the IP address in the target address segment according to the target address segment;
端口标识获取模块,用于获取由稽核终端发送的所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址;a port identification acquisition module, configured to acquire the port identification of each port in the port of the device to be audited, the IP address and the physical address corresponding to each port sent by the audit terminal;
连接关系生成模块,用于根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系;A connection relationship generation module, configured to generate a device port connection relationship corresponding to the device port to be audited according to the port identifier of each port, the IP address and physical address corresponding to each port;
连接关系标记模块,用于在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。A connection relationship marking module, configured to mark the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.
可选地,所述装置还包括:Optionally, the device further includes:
IP地址删除模块,用于删除所述稽核终端上传的IP地址中出现次数大于次数阈值的IP地址。The IP address deletion module is used to delete the IP addresses whose occurrence times are greater than the threshold of times among the IP addresses uploaded by the audit terminal.
可选地,所述连接关系生成模块包括:Optionally, the connection relationship generating module includes:
IP数量获取单元,用于根据所述待稽核设备端口内目标端口对应的IP地址,获取所述目标端口下的终端数量;An IP quantity acquiring unit, configured to acquire the number of terminals under the target port according to the IP address corresponding to the target port in the port of the device to be audited;
连接关系生成单元,用于根据所述终端数量,生成所述目标端口对应的设备端口连接关系。A connection relationship generating unit, configured to generate a device port connection relationship corresponding to the target port according to the number of terminals.
可选地,所述连接关系生成单元包括:Optionally, the connection relationship generating unit includes:
第一连接关系生成子单元,用于在所述终端数量为1时,生成所述目标端口对应的下挂单个终端的连接关系;a first connection relationship generating subunit, configured to generate a connection relationship of a single terminal attached to the target port corresponding to the target port when the number of terminals is 1;
第二连接关系生成子单元,用于在所述终端数量均大于所述待稽核设备端口的其它端口时,生成所述目标端口对应的设备上联端口的连接关系;a second connection relationship generating subunit, configured to generate a connection relationship of the device uplink port corresponding to the target port when the number of the terminals is greater than other ports of the device port to be audited;
第三连接关系生成子单元,用于在所述终端数量大于1,且非最大值时,生成所述目标端口对应的端口下挂网络设备的连接关系。The third connection relationship generating subunit is configured to generate the connection relationship of the network device connected to the port corresponding to the target port when the number of the terminals is greater than 1 and not the maximum value.
第五方面,本申请实施例提供了一种电子设备,包括:In a fifth aspect, an embodiment of the present application provides an electronic device, including:
处理器、存储器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述程序时实现上述任一项所述的设备端口连接关系建立方法。A processor, a memory, and a computer program stored on the memory and executable on the processor, when the processor executes the program, the method for establishing a device port connection relationship described in any one of the above is implemented.
第六方面,本申请实施例提供了一种计算机可读存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行上述任一项所述的设备端口连接关系建立方法。In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, when an instruction in the storage medium is executed by a processor of an electronic device, the electronic device can perform the device port connection described in any of the above Relationship building methods.
与现有技术相比,本申请实施例包括以下优点:Compared with the prior art, the embodiments of the present application include the following advantages:
本申请实施例中,通过在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集目标地址段对应的流量报文信息,对流量报文信息进行提取处理,得到待稽核设备端口内每个端口对应的IP地址和物理地址,将待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址发送至所述服务器,以由服务器根据待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位,无需维护人员在现场对线路逐步排查,节省了人力物力,同时,提高了故障排查和处理的效率。In the embodiment of the present application, after the server sends a packet request of the specified protocol to the obtained target address segment corresponding to the port of the device to be audited, the server collects the traffic packet information corresponding to the target address segment, and extracts the traffic packet information. Obtain the IP address and physical address corresponding to each port in the port of the device to be audited, and send the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port to the server, and the server will be based on The port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port, generate the device port connection relationship corresponding to the port of the device to be audited, and mark the device corresponding to the port of the device to be audited in the device port topology structure. Port connection relationship and physical address. In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. When the fault is located, the fault can be located directly through the full-topology network, without the need for maintenance personnel to check the line step by step on site, saving manpower and material resources, and at the same time improving the efficiency of fault checking and processing.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not limiting of the present application.
附图说明Description of drawings
图1为本申请实施例提供的一种设备端口连接关系建立方法的步骤流程图;1 is a flowchart of steps of a method for establishing a device port connection relationship provided by an embodiment of the present application;
图2为本申请实施例提供的另一种设备端口连接关系建立方法的步骤流程图;2 is a flowchart of steps of another method for establishing a device port connection relationship provided by an embodiment of the present application;
图3为本申请实施例提供的一种设备端口连接关系建立流程的示意图;3 is a schematic diagram of a process for establishing a device port connection relationship according to an embodiment of the present application;
图4为本申请实施例提供的一种设备端口连接关系建立装置的结构示意图;4 is a schematic structural diagram of an apparatus for establishing a device port connection relationship according to an embodiment of the present application;
图5为本申请实施例提供的另一种设备端口连接关系建立装置的结构示意图;FIG. 5 is a schematic structural diagram of another device port connection relationship establishing apparatus provided by an embodiment of the present application;
图6为本申请实施例提供的一种电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本申请作进一步详细的说明。In order to make the above objects, features and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and specific embodiments.
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the embodiments of this application and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
参照图1,示出了本申请实施例提供的一种设备端口连接关系建立方法的步骤流程图,该设备端口连接关系建立方法可以应用于稽核终端,如图1所示,该设备端口连接关系建立方法可以包括以下步骤:Referring to FIG. 1, a flowchart of steps of a method for establishing a device port connection relationship provided by an embodiment of the present application is shown. The method for establishing a device port connection relationship can be applied to an audit terminal. As shown in FIG. 1, the device port connection relationship The establishment method can include the following steps:
步骤101:在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集所述目标地址段对应的流量报文信息。Step 101: After the server sends a packet request of a specified protocol to the acquired target address segment corresponding to the port of the device to be audited, collects traffic packet information corresponding to the destination address segment.
本申请实施例可以应用于稽核终端,即执行主体为稽核终端。该稽核终端可以用于进行流量报文信息的采集、预处理以及信息上传等操作。The embodiments of the present application can be applied to an audit terminal, that is, the execution subject is an audit terminal. The audit terminal can be used to collect, pre-process and upload traffic packet information.
目标地址段是指在进行需要待稽核设备端口所包含的IP地址段,例如,在对某个小区内的某栋楼进行终端IP的统计时,可以预先得知该栋楼内的所有端口,即待稽核设备端口,根据待稽核设备端口就可以得知该栋楼内所有终端设备的一个IP地址段范围。The target address segment refers to the IP address segment included in the port of the device to be audited. For example, when statistics on the terminal IP of a building in a certain community are performed, all ports in the building can be known in advance. That is, the port of the device to be audited. According to the port of the device to be audited, an IP address range of all terminal devices in the building can be known.
在获取到待稽核设备端口对应的目标地址段之后,可以先由服务器向待稽核设备端口对应的目标地址段内的IP地址发送指定协议(如UDP(User Datagram Protocol,用户数据报协议)等)的报文请求,进而,可以由稽核终端采集目标地址段对应的流量报文信息。After obtaining the target address segment corresponding to the port of the device to be audited, the server can first send a specified protocol (such as UDP (User Datagram Protocol, User Datagram Protocol), etc.) to the IP address in the target address segment corresponding to the port of the device to be audited. Then, the audit terminal can collect the traffic packet information corresponding to the target address segment.
在实际应用中,目标地址段内的IP地址对应的终端可能处于下线状态,本实施例通过服务器向目标地址段内各IP地址下发一个特定协议的报文请求,可以促使该地址段内的终端激活,以避免出现采集的终端数据不完整的情况。In practical applications, the terminal corresponding to the IP address in the target address segment may be offline. In this embodiment, the server sends a message request of a specific protocol to each IP address in the target address segment, which can prompt the To avoid the situation that the collected terminal data is incomplete.
在具体实现中,在进行流量报文信息采集时,可以将镜像交换机接入待稽核设备端口,然后通过稽核终端采集镜像交换机上镜像口处的流量报文信息,具体地,可以结合下述具体实现方式进行详细描述。In the specific implementation, when collecting traffic packet information, the mirror switch can be connected to the port of the device to be audited, and then the traffic packet information at the mirror port on the mirror switch can be collected through the audit terminal. The implementation is described in detail.
在本申请的一种具体实现方式中,上述步骤101可以包括:In a specific implementation manner of the present application, the
子步骤A1:在镜像交换机接入所述待稽核设备端口之后,获取用户输入的目标端口的目标端口标识。Sub-step A1: After the mirror switch is connected to the port of the device to be audited, acquire the target port identifier of the target port input by the user.
在本实施例中,在由服务器向目标地址段发送指定协议的报文请求之后,可以由工作人员将镜像交换机接入待稽核设备端口,具体地,待稽核设备端口为连接线端口,可以由工作人员将连接线端口接入到镜像交换机的插口内,以实现二者的通信。In this embodiment, after the server sends a packet request of the specified protocol to the target address segment, the staff can connect the mirror switch to the port of the device to be audited. Specifically, the port of the device to be audited is a connection line port, which can be configured by The staff will connect the cable port to the socket of the mirror switch to realize the communication between the two.
在镜像交换机接入待稽核设备端口之后,可以获取用户输入的目标端口的目标端口标识。After the mirror switch is connected to the port of the device to be audited, the target port identifier of the target port input by the user can be obtained.
可以理解地,在稽核终端内还预先安装有稽核APP(Application,应用程序),在进行流量报文信息采集时,并非一次全部性采集,而是由用户在稽核APP的页面内输入待采集的目标端口的目标端口标识,每次仅采集该目标端口标识对应的流量报文信息。具体地,可以在稽核终端的稽核APP上选取端口数量和端口标识(如端口号等)等信息,选择对应端口对获取的信息进行抓包分析,获取其端口对应特定报文。It is understandable that an auditing APP (Application) is also pre-installed in the auditing terminal. When the traffic packet information is collected, it is not collected all at once, but the user enters the data to be collected on the page of the auditing APP. The target port identifier of the target port. Only the traffic packet information corresponding to the target port identifier is collected each time. Specifically, information such as the number of ports and port identifiers (such as port numbers, etc.) can be selected on the auditing APP of the auditing terminal, and a corresponding port can be selected to capture and analyze the obtained information, and obtain specific packets corresponding to the port.
在获取到用户输入的目标端口的目标端口标识之后,执行子步骤A2。After acquiring the target port identifier of the target port input by the user, sub-step A2 is performed.
子步骤A2:对所述镜像交换机的镜像口进行报文信息采集,以得到包含所述目标端口标识的流量报文信息。Sub-step A2: Collect packet information on the mirroring port of the mirroring switch to obtain flow packet information including the target port identifier.
在获取到用户输入的目标端口的目标端口标识之后,可以通过稽核终端对镜像交互机的镜像口进行报文信息的采集,以得到包含目标端口标识的流量报文信息。After obtaining the target port identifier of the target port input by the user, the audit terminal can collect packet information on the mirroring port of the mirroring switch to obtain the traffic packet information including the target port identifier.
在采集到目标地址段对应的流量报文信息之后,执行步骤102。After the traffic packet information corresponding to the target address segment is collected,
步骤102:对所述流量报文信息进行提取处理,得到所述待稽核设备端口内每个端口对应的IP地址和物理地址。Step 102: Extract the flow packet information to obtain an IP address and a physical address corresponding to each port in the port of the device to be audited.
在采集到目标地址段对应的流量报文信息之后,可以对流量报文信息进行提取处理,以得到待稽核设备端口内每个端口对应的IP地址和物理地址。After the traffic packet information corresponding to the target address segment is collected, the traffic packet information can be extracted and processed to obtain the IP address and physical address corresponding to each port in the port of the device to be audited.
在具体实现中,在得到流量报文信息之后,可以根据特定报文类型、发送服务器IP地址、端口号对抓取的流量报文信息进行过滤,以过滤掉无用的报文,如用户隐私报文等,并对剩余的流量报文信息进行提取处理,以得到待稽核端口内每个端口对应的IP地址和物理地址。In the specific implementation, after obtaining the traffic packet information, the captured traffic packet information can be filtered according to the specific packet type, sending server IP address, and port number to filter out useless packets, such as user privacy reports. The remaining traffic packet information is extracted and processed to obtain the IP address and physical address corresponding to each port in the port to be audited.
在对流量报文信息进行提取处理得到待稽核端口内每个端口对应的IP地址和物理地址之后,执行步骤103。After the IP address and physical address corresponding to each port in the port to be audited are obtained by extracting the traffic packet information,
步骤103:将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器,以由所述服务器根据所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。Step 103: Send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server, so that the server can use the port of the device to be audited according to each port in the port of the device to be audited. The port identifier, IP address and physical address corresponding to each port, generate the device port connection relationship corresponding to the device port to be audited, and mark the device port connection relationship corresponding to the device port to be audited in the device port topology structure and the physical address.
在对流量报文信息进行提取处理得到待稽核端口内每个端口对应的IP地址之后,可以由稽核终端将待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址发送给服务器,以由服务器根据待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址,进而在设备端口拓扑结构中即补入了不可网管设备。After extracting and processing the traffic packet information to obtain the IP address corresponding to each port in the port to be audited, the audit terminal can extract the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port. Send it to the server, so that the server can generate the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port, and put it in the device port topology structure. The device port connection relationship and physical address corresponding to the device port to be audited are marked, and the unmanageable device is added to the device port topology structure.
本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位。In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. , fault location can be performed directly through the full-topology network.
在本实施例中,为了减少工作人员的工作量,在向服务器发送数据时,可以生成每个端口对应的二维码,通过扫码方式进行数据发送,具体地,可以结合下述具体实现方式进行详细描述。In this embodiment, in order to reduce the workload of the staff, when sending data to the server, a two-dimensional code corresponding to each port can be generated, and the data can be sent by scanning the code. Specifically, the following specific implementation methods can be combined. Describe in detail.
在本申请的一种具体实现方式中,上述步骤103可以包括:In a specific implementation manner of the present application, the
子步骤B1:根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述每个端口对应的端口二维码。Sub-step B1: Generate a port two-dimensional code corresponding to each port according to the port identifier of each port, the IP address and physical address corresponding to each port.
在本实施例中,在得到每个端口对应的IP地址和物理地址之后,可以遍历每个端口,根据每个端口的端口标识、对应的IP地址和物理地址生成每个端口对应的端口二维码。In this embodiment, after obtaining the IP address and physical address corresponding to each port, each port can be traversed, and a two-dimensional port corresponding to each port can be generated according to the port identifier, corresponding IP address and physical address of each port. code.
在生成每个端口对应的端口二维码之后,执行子步骤B2。After the port two-dimensional code corresponding to each port is generated, sub-step B2 is performed.
子步骤B2:扫描所述端口二维码,以将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器。Sub-step B2: Scan the port two-dimensional code to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server.
在生成每个端口对应的端口二维码之后,可以扫描端口二维码,以将待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址发送至服务器。具体地,可以由工作人员启动稽核APP的扫码界面,以对端口二维码进行扫码处理,完成进行信息录入至后台的操作。After generating the port QR code corresponding to each port, you can scan the port QR code to send the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port to the server. Specifically, the staff can start the code scanning interface of the audit APP to scan the QR code of the port to complete the operation of entering information into the background.
本申请实施例通过生成每个端口二维码进行信息发送的方式,可以避免人工录入出现错误的情况发生,同时,可以大大降低工作人员的劳动量,提高信息录入效率。By generating a two-dimensional code for each port and sending information in the embodiment of the present application, errors in manual input can be avoided, and at the same time, the workload of staff can be greatly reduced, and the efficiency of information input can be improved.
本申请实施例提供的设备端口连接关系建立方法,通过在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集目标地址段对应的流量报文信息,对流量报文信息进行提取处理,得到待稽核设备端口内每个端口对应的IP地址和物理地址,将待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址发送至所述服务器,以由服务器根据待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位,无需维护人员在现场对线路逐步排查,节省了人力物力,同时,提高了故障排查和处理的效率。The method for establishing a device port connection relationship provided by the embodiment of the present application collects the traffic packet information corresponding to the target address segment after the server sends a packet request of the specified protocol to the acquired destination address segment corresponding to the port of the device to be audited. The packet information is extracted and processed to obtain the IP address and physical address corresponding to each port in the port of the device to be audited, and the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port are sent to the Describe the server, so that the server generates the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port, and marks the device port topology structure. The device port connection relationship and physical address corresponding to the device port to be audited. In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. When the fault is located, the fault can be located directly through the full-topology network, without the need for maintenance personnel to check the line step by step on site, saving manpower and material resources, and at the same time improving the efficiency of fault checking and processing.
参照图2,示出了本申请实施例提供的一种设备端口连接关系建立方法的步骤流程图,该设备端口连接关系建立方法可以应用于服务器,如图2所示,该设备端口连接关系建立方法可以包括以下步骤:Referring to FIG. 2, a flowchart of steps of a method for establishing a device port connection relationship provided by an embodiment of the present application is shown. The method for establishing a device port connection relationship can be applied to a server. As shown in FIG. 2, the device port connection relationship is established. The method may include the following steps:
步骤201:获取待稽核设备端口对应的目标地址段。Step 201: Obtain the target address segment corresponding to the port of the device to be audited.
本申请实施例可以应用于服务器,即执行主体为服务器。The embodiments of the present application may be applied to a server, that is, the execution subject is the server.
目标地址段是指在进行需要待稽核设备端口所包含的IP地址段,例如,在对某个小区内的某栋楼进行终端IP的统计时,可以预先得知该栋楼内的所有端口,即待稽核设备端口,根据待稽核设备端口就可以得知该栋楼内所有终端设备的一个IP地址段范围。The target address segment refers to the IP address segment included in the port of the device to be audited. For example, when statistics on the terminal IP of a building in a certain community are performed, all ports in the building can be known in advance. That is, the port of the device to be audited. According to the port of the device to be audited, an IP address range of all terminal devices in the building can be known.
在对待稽核设备端口进行设备的统计时,可以待稽核设备端口对应的目标地址段。When performing device statistics on the port of the device to be audited, the target address segment corresponding to the port of the device to be audited can be used.
在获取到待稽核设备端口对应的目标地址段之后,执行步骤202。After acquiring the target address segment corresponding to the port of the device to be audited,
步骤202:根据所述目标地址段,向所述目标地址段内的IP地址发送指定协议的报文请求。Step 202: According to the target address segment, send a packet request of a specified protocol to the IP address in the target address segment.
在获取到待稽核设备端口对应的目标地址段之后,可以根据目标地址段,向目标地址段内的IP地址发送指定协议(如UDP协议等)的报文请求。After obtaining the target address segment corresponding to the port of the device to be audited, a packet request of a specified protocol (such as UDP protocol, etc.) can be sent to the IP address in the target address segment according to the target address segment.
在实际应用中,目标地址段内的IP地址对应的终端可能处于下线状态,本实施例通过服务器向目标地址段内各IP地址下发一个特定协议的报文请求,可以促使该地址段内的终端激活,以避免出现采集的终端数据不完整的情况。In practical applications, the terminal corresponding to the IP address in the target address segment may be offline. In this embodiment, the server sends a message request of a specific protocol to each IP address in the target address segment, which can prompt the To avoid the situation that the collected terminal data is incomplete.
在根据目标地址段向目标地址段内的IP地址发送指定协议的报文请求之后,执行步骤203。Step 203 is executed after sending the packet request of the specified protocol to the IP address in the target address segment according to the target address segment.
步骤203:获取由稽核终端发送的所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址。Step 203: Obtain the port identifier of each port in the port of the device to be audited, the IP address and the physical address corresponding to each port, which are sent by the audit terminal.
在根据目标地址段向目标地址段内的IP地址发送指定协议的报文请求之后,可以由稽核终端进行流量报文信息的采集,并对采集的流量报文信息进行提取操作,以得到每个端口对应的IP地址和物理地址,以由稽核终端将每个端口的端口标识、对应的IP地址和物理地址以扫码方式发送给服务器,具体地过程可以参照上述实施例的描述,本实施例在此不再加以赘述。After sending a packet request of the specified protocol to the IP address in the target address segment according to the destination address segment, the audit terminal can collect the traffic packet information, and extract the collected traffic packet information to obtain each The IP address and physical address corresponding to the port, so that the audit terminal will send the port identifier, corresponding IP address and physical address of each port to the server by scanning a code. The specific process can refer to the description of the above embodiment. It will not be repeated here.
服务器可以获取由稽核终端发送的待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,以进行后续的操作。The server can obtain the port identifier of each port in the port of the device to be audited, and the IP address and physical address corresponding to each port sent by the audit terminal, so as to perform subsequent operations.
步骤204:根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系。Step 204: Generate a device port connection relationship corresponding to the device port to be audited according to the port identifier of each port, the IP address and the physical address corresponding to each port.
在服务器获取到由稽核终端发送的待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址之后,还可以删除稽核终端上传的IP地址中出现次数大于次数阈值的IP地址,如IP地址出现次数大于2次的IP地址等。After the server obtains the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port sent by the auditing terminal, it can also delete the IP addresses uploaded by the auditing terminal whose number of occurrences is greater than the threshold. Addresses, such as IP addresses with more than two occurrences of IP addresses.
可以根据每个端口的端口标识、每个端口对应的IP地址和物理地址生成待稽核设备端口对应的设备端口连接关系。在本示例中,可以根据每个端口下的终端数量,生成每个端口对应的设备端口连接关系,具体地,可以结合下述具体实现方式进行详细描述。The device port connection relationship corresponding to the device port to be audited can be generated according to the port identifier of each port, the IP address and physical address corresponding to each port. In this example, a device port connection relationship corresponding to each port may be generated according to the number of terminals under each port, and specifically, a detailed description may be given in conjunction with the following specific implementation manners.
在本申请的一种具体实现方式中,上述步骤204可以包括:In a specific implementation manner of the present application, the
子步骤C1:根据所述待稽核设备端口内目标端口对应的IP地址,获取所述目标端口下的终端数量。Sub-step C1: Acquire the number of terminals under the target port according to the IP address corresponding to the target port in the port of the device to be audited.
在本示例中,目标端口是指待稽核设备端口内的某个端口,例如,待稽核设备端口包括:端口1、端口2和端口3,可以将端口1作为目标端口,也可以将端口2作为目标端口,还可以将端口3作为目标端口等等。In this example, the target port refers to a port in the port of the device to be audited. For example, the ports of the device to be audited include: port 1, port 2, and port 3. Port 1 can be used as the target port, or port 2 can be used as the target port. The destination port, you can also use port 3 as the destination port, and so on.
在获取到待稽核设备端口内每个端口的端口标识和对应的IP地址之后,可以获取待稽核设备端口内目标端口对应的IP地址和物理地址,并根据该IP地址和物理地址获取目标端口下的终端数量,即明确目标端口下挂了几个终端,若为一个IP地址,则表示该目标端口下挂接了一个终端,若为多个IP地址,则表示该目标端口下挂接了多个终端等。After obtaining the port identifier and corresponding IP address of each port in the port of the device to be audited, you can obtain the IP address and physical address corresponding to the target port in the port of the device to be audited, and obtain the target port according to the IP address and physical address. The number of terminals connected to the target port, that is, how many terminals are connected to the target port. If it is one IP address, it means that one terminal is connected to the target port. If there are multiple IP addresses, it means that there are many terminals connected to the target port. terminal, etc.
可以理解地,在实际生活中,由于一个终端可能配备了多个IP地址,本实施例通过获取IP地址和物理地址作为终端的索引,可以使得获取的终端数量更加准确。Understandably, in real life, since a terminal may be equipped with multiple IP addresses, in this embodiment, by acquiring the IP address and the physical address as an index of the terminal, the acquired number of terminals can be more accurate.
在获取到目标端口下的终端数量之后,执行子步骤C2。After the number of terminals under the target port is obtained, sub-step C2 is performed.
子步骤C2:根据所述终端数量,生成所述目标端口对应的设备端口连接关系。Sub-step C2: Generate a device port connection relationship corresponding to the target port according to the number of terminals.
在获取到目标端口下的终端数量之后,可以根据IP数量,生成目标端口对应的设备端口连接关系,具体地,可以包括以下三种连接关系:After the number of terminals under the target port is obtained, the device port connection relationship corresponding to the target port can be generated according to the IP number. Specifically, the following three connection relationships can be included:
1、在终端数量为1时,生成目标端口对应的下挂单个终端的连接关系;1. When the number of terminals is 1, the connection relationship of a single terminal connected to the target port corresponding to the target port is generated;
2、在目标端口的终端数量均大于待稽核设备端口的其它端口时,生成目标端口对应的设备上联端口的连接关系;2. When the number of terminals on the target port is greater than other ports of the device port to be audited, the connection relationship of the device uplink port corresponding to the target port is generated;
3、在目标端口的终端数量大于1,且非最大值时,生成目标端口对应的端口下挂网络设备的连接关系。3. When the number of terminals on the target port is greater than 1 and is not the maximum value, a connection relationship of the network device connected to the port corresponding to the target port is generated.
步骤205:在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。Step 205: Mark the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.
在得到待稽核设备端口对应的设备端口连接关系之后,即可以在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。After obtaining the device port connection relationship corresponding to the device port to be audited, the device port connection relationship and physical address corresponding to the device port to be audited can be marked in the device port topology structure.
对于本方案的执行过程可以参照图3所示,首先,可以服务器向目标地址段发送UDP协议的报文请求,然后由待稽核设备采集镜像设备(如镜像交换机)的镜像端口流量,通过遍历端口抓包分析的方式生成每个端口对应的二维码,之后通过稽核用PC扫码上传端口信息至服务器。该过程中现场人员单边操作,1人即可完成设备稽核任务,数据后台自动化分析,无需采用巡线仪等工具,无需多工作面多人员配合,极大节省人力物力成本。For the implementation process of this solution, please refer to Figure 3. First, the server can send a UDP protocol message request to the target address segment, and then the device to be audited collects the mirror port traffic of the mirror device (such as a mirror switch), and traverses the port by traversing the port. The QR code corresponding to each port is generated by means of packet capture and analysis, and then the port information is uploaded to the server by scanning the code with a PC for auditing. In this process, the on-site personnel operate unilaterally, and one person can complete the equipment audit task, and the data is automatically analyzed in the background. There is no need to use tools such as line detectors, and there is no need for the cooperation of multiple work surfaces and multiple personnel, which greatly saves manpower and material costs.
本申请实施例提供的设备端口连接关系建立方法,通过获取待稽核设备端口对应的目标地址段,根据目标地址段,向目标地址段内的IP地址发送指定协议的报文请求,获取由稽核终端发送的待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,根据每个端口的端口标识、每个端口对应IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位,无需维护人员在现场对线路逐步排查,节省了人力物力,同时,提高了故障排查和处理的效率。The method for establishing a device port connection relationship provided by the embodiment of the present application is to obtain the target address segment corresponding to the port of the device to be audited, and according to the target address segment, send a message request of a specified protocol to the IP address in the target address segment, and obtain the information from the audit terminal. The port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port are sent, and the corresponding IP address and physical address of each port are generated according to the port identifier of each port, the corresponding IP address and physical address of each port. Device port connection relationship, mark the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. When the fault is located, the fault can be located directly through the full-topology network, without the need for maintenance personnel to check the line step by step on site, saving manpower and material resources, and at the same time improving the efficiency of fault checking and processing.
参照图4,示出了本申请实施例提供的一种设备端口连接关系建立装置的结构示意图,该设备端口连接关系建立装置可以应用于稽核终端,如图4所示,该设备端口连接关系建立装置可以包括以下模块:Referring to FIG. 4 , a schematic structural diagram of an apparatus for establishing a device port connection relationship provided by an embodiment of the present application is shown. The device port connection relationship establishing apparatus can be applied to an audit terminal. As shown in FIG. 4 , the device port connection relationship is established. The apparatus may include the following modules:
报文信息采集模块410,用于在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集所述目标地址段对应的流量报文信息;The message information collection module 410 is configured to collect the traffic message information corresponding to the target address segment after the server sends a message request of the specified protocol to the acquired target address segment corresponding to the port of the device to be audited;
IP地址获取模块420,用于对所述流量报文信息进行提取处理,得到所述待稽核设备端口内每个端口对应的IP地址和物理地址;The IP address obtaining module 420 is configured to extract and process the traffic packet information to obtain the IP address and physical address corresponding to each port in the port of the device to be audited;
IP地址发送模块430,用于将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器,以由所述服务器根据所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。The IP address sending module 430 is configured to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server, so that the server can use the device to be audited according to the device to be audited. The port identifier of each port in the port, the IP address and physical address corresponding to each port, generate the device port connection relationship corresponding to the device port to be audited, and mark the device port corresponding to the device port to be audited in the device port topology structure. Device port connection relationship and the physical address.
可选地,所述报文信息采集模块包括:Optionally, the packet information collection module includes:
目标端口标识获取单元,用于在镜像交换机接入所述待稽核设备端口之后,获取用户输入的目标端口的目标端口标识;a target port identifier acquisition unit, configured to acquire the target port identifier of the target port input by the user after the mirror switch is connected to the device port to be audited;
流量报文信息获取单元,用于对所述镜像交换机的镜像口进行报文信息采集,以得到包含所述目标端口标识的流量报文信息。A flow packet information acquisition unit, configured to collect packet information on the mirroring port of the mirroring switch, so as to obtain the flow packet information including the target port identifier.
可选地,所述IP地址发送模块包括:Optionally, the IP address sending module includes:
端口二维码生成单元,用于根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述每个端口对应的端口二维码;A port two-dimensional code generation unit, configured to generate a port two-dimensional code corresponding to each port according to the port identifier of each port, the corresponding IP address and physical address of each port;
IP地址发送单元,用于扫描所述端口二维码,以将所述待稽核设备端口内每个端口的端口标识与每个端口对应的IP地址和物理地址发送至所述服务器。The IP address sending unit is configured to scan the port two-dimensional code to send the port identifier of each port in the port of the device to be audited and the IP address and physical address corresponding to each port to the server.
本申请实施例提供的设备端口连接关系建立装置,通过在服务器向获取的待稽核设备端口对应的目标地址段发送指定协议的报文请求之后,采集目标地址段对应的流量报文信息,对流量报文信息进行提取处理,得到待稽核设备端口内每个端口对应的IP地址和物理地址,将待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址发送至所述服务器,以由服务器根据待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,并在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位,无需维护人员在现场对线路逐步排查,节省了人力物力,同时,提高了故障排查和处理的效率。The device port connection relationship establishment device provided by the embodiment of the present application collects the traffic packet information corresponding to the target address segment after the server sends a packet request of the specified protocol to the target address segment corresponding to the acquired device port to be audited, and analyzes the traffic flow. The packet information is extracted and processed to obtain the IP address and physical address corresponding to each port in the port of the device to be audited, and the port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port are sent to the Describe the server, so that the server generates the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port, and marks the device port topology structure. The device port connection relationship and physical address corresponding to the device port to be audited. In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. When the fault is located, the fault can be located directly through the full-topology network, without the need for maintenance personnel to check the line step by step on site, saving manpower and material resources, and at the same time improving the efficiency of fault checking and processing.
参照图5,示出了本申请实施例提供的一种设备端口连接关系建立装置的结构示意图,该设备端口连接关系建立装置可以应用于服务器,如图5所示,该设备端口连接关系建立装置可以包括以下模块:Referring to FIG. 5 , a schematic structural diagram of an apparatus for establishing a device port connection relationship provided by an embodiment of the present application is shown. The device port connection relationship establishing apparatus can be applied to a server. As shown in FIG. 5 , the device port connection relationship establishing apparatus is used. The following modules can be included:
目标地址段获取模块510,用于获取待稽核设备端口对应的目标地址段;A target address segment obtaining module 510, configured to obtain a target address segment corresponding to the port of the device to be audited;
报文请求发送模块520,用于根据所述目标地址段,向所述目标地址段内的IP地址发送指定协议的报文请求;A message request sending module 520, configured to send a message request of a specified protocol to the IP address in the target address segment according to the target address segment;
端口标识获取模块530,用于获取由稽核终端发送的所述待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址;a port identification acquiring module 530, configured to acquire the port identification of each port in the port of the device to be audited, the IP address and the physical address corresponding to each port, which are sent by the auditing terminal;
连接关系生成模块540,用于根据每个端口的端口标识、每个端口对应的IP地址和物理地址,生成所述待稽核设备端口对应的设备端口连接关系;The connection relationship generation module 540 is used to generate the device port connection relationship corresponding to the device port to be audited according to the port identifier of each port, the corresponding IP address and physical address of each port;
连接关系标记模块550,用于在设备端口拓扑结构中标记所述待稽核设备端口对应的设备端口连接关系和所述物理地址。The connection relationship marking module 550 is configured to mark the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.
可选地,所述装置还包括:Optionally, the device further includes:
IP地址删除模块,用于删除所述稽核终端上传的IP地址中出现次数大于次数阈值的IP地址。The IP address deletion module is used to delete the IP addresses whose occurrence times are greater than the threshold of times among the IP addresses uploaded by the audit terminal.
可选地,所述连接关系生成模块包括:Optionally, the connection relationship generating module includes:
IP数量获取单元,用于根据所述待稽核设备端口内目标端口对应的IP地址,获取所述目标端口下的终端数量;An IP quantity acquiring unit, configured to acquire the number of terminals under the target port according to the IP address corresponding to the target port in the port of the device to be audited;
连接关系生成单元,用于根据所述终端数量,生成所述目标端口对应的设备端口连接关系。A connection relationship generating unit, configured to generate a device port connection relationship corresponding to the target port according to the number of terminals.
可选地,所述连接关系生成单元包括:Optionally, the connection relationship generating unit includes:
第一连接关系生成子单元,用于在所述终端数量为1时,生成所述目标端口对应的下挂单个终端的连接关系;a first connection relationship generating subunit, configured to generate a connection relationship of a single terminal attached to the target port corresponding to the target port when the number of terminals is 1;
第二连接关系生成子单元,用于在所述终端数量均大于所述待稽核设备端口的其它端口时,生成所述目标端口对应的设备上联端口的连接关系;a second connection relationship generating subunit, configured to generate a connection relationship of the device uplink port corresponding to the target port when the number of the terminals is greater than other ports of the device port to be audited;
第三连接关系生成子单元,用于在所述终端数量大于1,且非最大值时,生成所述目标端口对应的端口下挂网络设备的连接关系。The third connection relationship generating subunit is configured to generate the connection relationship of the network device connected to the port corresponding to the target port when the number of the terminals is greater than 1 and not the maximum value.
本申请实施例提供的设备端口连接关系建立装置,通过获取待稽核设备端口对应的目标地址段,根据目标地址段,向目标地址段内的IP地址发送指定协议的报文请求,获取由稽核终端发送的待稽核设备端口内每个端口的端口标识、每个端口对应的IP地址和物理地址,根据每个端口的端口标识、每个端口对应IP地址和物理地址,生成待稽核设备端口对应的设备端口连接关系,在设备端口拓扑结构中标记待稽核设备端口对应的设备端口连接关系和物理地址。本申请实施例通过服务器向目标地址段发送报文请求,可以实现对不可网管设备数据的查找和记录,并与可网管设备数据进行拼接,生成全拓扑网络资源,进而可以在出现故障进行线路维护时,可以直接通过全拓扑网络进行故障定位,无需维护人员在现场对线路逐步排查,节省了人力物力,同时,提高了故障排查和处理的效率。The device port connection relationship establishment device provided in the embodiment of the present application obtains the target address segment corresponding to the device port to be audited, and sends a message request of the specified protocol to the IP address in the target address segment according to the target address segment, and obtains the information from the audit terminal. The port identifier of each port in the port of the device to be audited, the IP address and physical address corresponding to each port are sent, and the corresponding IP address and physical address of each port are generated according to the port identifier of each port, the corresponding IP address and physical address of each port. Device port connection relationship, mark the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. In the embodiment of the present application, the server sends a message request to the target address segment, which can realize the search and record of the data of the unmanageable device, and splicing it with the data of the network-manageable device to generate a full-topology network resource, and then can perform line maintenance in the event of a fault. When the fault is located, the fault can be located directly through the full-topology network, without the need for maintenance personnel to check the line step by step on site, saving manpower and material resources, and at the same time improving the efficiency of fault checking and processing.
本申请实施例还提供了一种电子设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现上述设备端口连接关系建立方法。Embodiments of the present application further provide an electronic device, including: a memory, a processor, and a computer program stored on the memory and running on the processor, where the computer program is implemented when executed by the processor The above-mentioned method for establishing a device port connection relationship.
图6示出了本发明实施例的一种电子设备600的结构示意图。如图6所示,电子设备600包括中央处理单元(CPU)601,其可以根据存储在只读存储器(ROM)602中的计算机程序指令或者从存储单元608加载到随机访问存储器(RAM)603中的计算机程序指令,来执行各种适当的动作和处理。在RAM603中,还可存储电子设备600操作所需的各种程序和数据。CPU601、ROM602以及RAM603通过总线604彼此相连。输入/输出(I/O)接口605也连接至总线604。FIG. 6 shows a schematic structural diagram of an
电子设备600中的多个部件连接至I/O接口605,包括:输入单元606,例如键盘、鼠标、麦克风等;输出单元607,例如各种类型的显示器、扬声器等;存储单元608,例如磁盘、光盘等;以及通信单元609,例如网卡、调制解调器、无线通信收发机等。通信单元609允许电子设备600通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。Various components in the
上文所描述的各个过程和处理,可由处理单元601执行。例如,上述任一实施例的方法可被实现为计算机软件程序,其被有形地包含于计算机可读介质,例如存储单元608。在一些实施例中,计算机程序的部分或者全部可以经由ROM602和/或通信单元609而被载入和/或安装到电子设备600上。当计算机程序被加载到RAM603并由CPU601执行时,可以执行上文描述的方法中的一个或多个动作。The various processes and processes described above may be performed by the
本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现设备端口连接关系建立方法。Embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, implements a method for establishing a device port connection relationship.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments may be referred to each other.
本领域内的技术人员应明白,本申请实施例的实施例可提供为方法、装置、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the embodiments of the present application may be provided as methods, apparatuses, or computer program products. Accordingly, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本申请实施例是参照根据本申请实施例的方法、终端(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The embodiments of the present application are described with reference to the flowcharts and/or block diagrams of the methods, terminals (systems), and computer program products according to the embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing terminal to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing terminal produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal to operate in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端上,使得在计算机或其他可编程终端上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer-implemented process such that an The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.
尽管已描述了本申请实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本申请实施例范围的所有变更和修改。Although the preferred embodiments of the embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once the basic inventive concepts are known. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the embodiments of the present application.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端中还存在另外的相同要素。Finally, it should also be noted that in this document, relational terms such as first and second are used only to distinguish one entity or operation from another, and do not necessarily require or imply these entities or that there is any such actual relationship or sequence between operations. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or terminal that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or terminal. Without further limitation, an element defined by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article or terminal that includes the element.
以上对本申请所提供的一种设备端口连接关系建立方法、一种设备端口连接关系建立装置、一种电子设备和一种计算机可读存储介质,进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。A method for establishing a device port connection relationship, an apparatus for establishing a device port connection relationship, an electronic device, and a computer-readable storage medium provided by the present application have been described above in detail. The principles and embodiments of the application have been described, and the descriptions of the above examples are only used to help understand the method and the core idea of the application; There will be changes in the scope of application. To sum up, the content of this specification should not be construed as a limitation on the application.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210710335.7A CN115242619A (en) | 2022-06-22 | 2022-06-22 | Device port connection relationship establishment method, device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210710335.7A CN115242619A (en) | 2022-06-22 | 2022-06-22 | Device port connection relationship establishment method, device, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115242619A true CN115242619A (en) | 2022-10-25 |
Family
ID=83669657
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210710335.7A Pending CN115242619A (en) | 2022-06-22 | 2022-06-22 | Device port connection relationship establishment method, device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115242619A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998018306A2 (en) * | 1996-10-28 | 1998-05-07 | Switchsoft Systems, Inc. | Method and apparatus for generating a network topology |
US6697338B1 (en) * | 1999-10-28 | 2004-02-24 | Lucent Technologies Inc. | Determination of physical topology of a communication network |
KR20080052861A (en) * | 2006-12-08 | 2008-06-12 | 한국전자통신연구원 | IP topology management system using IP topology automatic discovery and its method |
CN108055207A (en) * | 2017-10-26 | 2018-05-18 | 北京天元创新科技有限公司 | A kind of network topology cognitive method and device |
CN110838930A (en) * | 2018-08-16 | 2020-02-25 | 中国移动通信集团浙江有限公司 | Method and device for generating business logic topology |
CN111865684A (en) * | 2020-07-17 | 2020-10-30 | 国网湖南省电力有限公司 | Automatic discovery method for local area network topology |
CN112039693A (en) * | 2020-08-17 | 2020-12-04 | 烽火通信科技股份有限公司 | System and method for managing home networking network topology |
-
2022
- 2022-06-22 CN CN202210710335.7A patent/CN115242619A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998018306A2 (en) * | 1996-10-28 | 1998-05-07 | Switchsoft Systems, Inc. | Method and apparatus for generating a network topology |
US6697338B1 (en) * | 1999-10-28 | 2004-02-24 | Lucent Technologies Inc. | Determination of physical topology of a communication network |
KR20080052861A (en) * | 2006-12-08 | 2008-06-12 | 한국전자통신연구원 | IP topology management system using IP topology automatic discovery and its method |
CN108055207A (en) * | 2017-10-26 | 2018-05-18 | 北京天元创新科技有限公司 | A kind of network topology cognitive method and device |
CN110838930A (en) * | 2018-08-16 | 2020-02-25 | 中国移动通信集团浙江有限公司 | Method and device for generating business logic topology |
CN111865684A (en) * | 2020-07-17 | 2020-10-30 | 国网湖南省电力有限公司 | Automatic discovery method for local area network topology |
CN112039693A (en) * | 2020-08-17 | 2020-12-04 | 烽火通信科技股份有限公司 | System and method for managing home networking network topology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114584401B (en) | Tracing system and method for large-scale network attack | |
CN108989136B (en) | Service end-to-end performance monitoring method and device | |
CN109600317B (en) | Method and device for automatically identifying traffic and extracting application rules | |
CN103248512B (en) | The generation method and system of application layer topological structure in communication network | |
CN107579876A (en) | A method and device for automatic detection and analysis of asset increment | |
CN103546343B (en) | The network traffics methods of exhibiting of network traffic analysis system and system | |
CN101197736A (en) | A wireless network element device monitoring system and monitoring method thereof | |
CN112788145A (en) | Cross-domain functional security anomaly detection tracing method based on non-embedded probe | |
CN113238536B (en) | An industrial control system network vulnerability identification method, device and related equipment | |
US10523549B1 (en) | Method and system for detecting and classifying networked devices | |
CN117370286A (en) | Cloud platform-based data storage method, system and equipment | |
CN110011860A (en) | An Android application identification method based on network traffic analysis | |
CN114611576B (en) | Accurate identification method for terminal equipment in power grid | |
CN105656730A (en) | Network application quick discovery method and system based on TCP data packet | |
CN113297148B (en) | Method, device and equipment for collecting service log data and readable storage medium | |
CN103763150B (en) | Data collecting system | |
CN115242619A (en) | Device port connection relationship establishment method, device, electronic device and storage medium | |
CN105991353A (en) | Fault location method and device | |
JP2010239392A (en) | System, device and program for controlling service disabling attack | |
CN108540471A (en) | Mobile application clustering network flow method, computer readable storage medium and terminal | |
CN101478406A (en) | Method for real-time monitoring network operation behavior of remote user | |
JP2013243534A (en) | Delay time evaluation device and method for evaluating delay time | |
CN111614611B (en) | A network security audit method and device for grid embedded terminal | |
CN110855602B (en) | IoT cloud platform event identification method and system | |
CN114579961A (en) | Sensitive data identification method based on multi-industry detection rules and related 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 |