Device port connection relationship establishment method, device, electronic device and storage medium

By sending message requests to the target address segment of the device port to be audited on the server, collecting and processing traffic message information, and generating device port connection relationships, the problem of time-consuming and labor-consuming troubleshooting and line maintenance in the existing technology is solved, and efficient fault location and processing is achieved.

CN115242619BActive Publication Date: 2025-04-11CHINA TELECOM CORP LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210710335.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-22
Publication Date
2025-04-11
Estimated Expiration
2042-06-22

AI Technical Summary

Technical Problem

In the prior art, troubleshooting and line maintenance require gradual on-site inspection, which consumes a lot of manpower and material resources, and delays the troubleshooting time.

Method used

By sending a message request for the specified protocol to the target address segment of the device port to be audited on the server, traffic message information is collected, the IP address and physical address of each port are extracted, and the device port connection relationship is generated, and the device port is marked in the device port topology.

Benefits of technology

It realizes the search and recording of data of unmanaged equipment, splicing with data of network-managed equipment, generating full topological network resources, allowing fault location through the full topological network, saving manpower and material resources, and improving troubleshooting and processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115242619B_ABST
    Figure CN115242619B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, electronic device and storage medium for establishing a device port connection relationship. The method includes: after the server sends a message request of a specified protocol to the target address segment corresponding to the acquired device port to be audited, collecting the flow message information corresponding to the target address segment; extracting and processing the flow message information to obtain the IP address and physical address corresponding to each port in the device port to be audited; sending the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to 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 marking the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. The present application can facilitate line fault troubleshooting and improve fault troubleshooting efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Internet data communication technology, and in particular to a method, device, electronic device and storage medium for establishing a device port connection relationship. Background Art

[0002] At present, enterprise computer rooms have been deployed in large enterprises, governments, schools and other places. The maintenance and management of network resources mainly rely on system data and network management systems. In actual situations, there are problems such as lack of maintenance of computer rooms, stacking of equipment in computer rooms, lack of network topology, and mismatch between data and on-site equipment, which greatly hinder the operation and maintenance of computer rooms and troubleshooting. In particular, some equipment cannot be managed online. Management and maintenance personnel cannot understand the location of unmanageable equipment, design cascade status and other information, and cannot clearly understand the network topology. When a fault occurs, line maintenance needs to be carried out on site step by step, which consumes a lot of manpower and material resources and delays troubleshooting time. Summary of the invention

[0003] The technical problem to be solved by the embodiments of the present application is to provide a method, device, electronic device and storage medium for establishing a device port connection relationship, so as to solve the technical problem in the prior art that when a fault occurs and line maintenance is performed, on-site step-by-step investigation is required, which consumes a lot of manpower and material resources and delays the fault handling time.

[0004] 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, comprising:

[0005] After the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited, the flow message information corresponding to the target address segment is collected;

[0006] Extract and process the traffic message information to obtain the IP address and physical address corresponding to each port in the device to be audited;

[0007] The port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port are sent to the server, so that the server generates the device port connection relationship corresponding to the device port to be audited based on the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port, and marks the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.

[0008] Optionally, the collecting the traffic message information corresponding to the target address segment includes:

[0009] After the mirror switch is connected to the port of the device to be audited, a target port identifier of the target port input by the user is obtained;

[0010] Message information is collected from the mirror port of the mirror switch to obtain flow message information including the target port identifier.

[0011] Optionally, the sending of 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 includes:

[0012] Generate a port QR code corresponding to each port according to the port identifier of each port, the IP address and the physical address corresponding to each port;

[0013] Scan the port QR code to send the port identifier of each port in the device to be audited and the IP address and physical address corresponding to each port to the server.

[0014] 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, comprising:

[0015] Get the target address segment corresponding to the port of the device to be audited;

[0016] According to the target address segment, sending a message request of a specified protocol to an IP address in the target address segment;

[0017] Obtaining 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;

[0018] 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;

[0019] 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.

[0020] Optionally, after obtaining 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, the method further includes:

[0021] Delete the IP addresses uploaded by the audit terminal whose number of occurrences is greater than the number threshold.

[0022] 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 includes:

[0023] According to the IP address corresponding to the target port in the port of the device to be audited, the number of terminals under the target port is obtained;

[0024] According to the number of terminals, a device port connection relationship corresponding to the target port is generated.

[0025] Optionally, generating a device port connection relationship corresponding to the target port according to the number of terminals includes:

[0026] When the number of terminals is 1, a connection relationship of a single terminal connected to the target port is generated;

[0027] When the number of terminals is greater than other ports of the device port to be audited, a connection relationship of the device uplink port corresponding to the target port is generated;

[0028] When the number of terminals is greater than 1 and is not a maximum value, a connection relationship between a network device connected to the port corresponding to the target port is generated.

[0029] In a third aspect, an embodiment of the present application provides a device for establishing a device port connection relationship, which is applied to an audit terminal, including:

[0030] A message information collection module, used to collect flow message information corresponding to the target address segment after the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited;

[0031] An IP address acquisition module is used to extract and process the flow message information to obtain the IP address and physical address corresponding to each port in the device to be audited;

[0032] The IP address sending module is used to send the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to the server, so that the server can generate the device port connection relationship corresponding to the device port to be audited based on the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port, and mark the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.

[0033] Optionally, the message information collection module includes:

[0034] A target port identifier obtaining unit, used to obtain a target port identifier of a target port input by a user after the mirror switch is connected to the port of the device to be audited;

[0035] The flow packet information acquisition unit is used to collect packet information from the mirror port of the mirror switch to obtain the flow packet information including the target port identifier.

[0036] Optionally, the IP address sending module includes:

[0037] A port QR code generating unit, used to generate a port QR code corresponding to each port according to the port identifier of each port, the IP address and the physical address corresponding to each port;

[0038] The IP address sending unit is used to scan the port QR 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.

[0039] In a fourth aspect, an embodiment of the present application provides a device for establishing a device port connection relationship, which is applied to a server, including:

[0040] The target address segment acquisition module is used to obtain the target address segment corresponding to the port of the device to be audited;

[0041] A message request sending module, used to send a message request of a specified protocol to an IP address in the target address segment according to the target address segment;

[0042] A port identification acquisition module, used to acquire the port identification 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;

[0043] A connection relationship generating module, used for generating 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;

[0044] The connection relationship marking module is used 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.

[0045] Optionally, the device further comprises:

[0046] The IP address deletion module is used to delete the IP addresses uploaded by the audit terminal whose number of occurrences is greater than a threshold number.

[0047] Optionally, the connection relationship generating module includes:

[0048] An IP quantity acquisition unit, configured to acquire the number of terminals under the target port according to the IP address corresponding to the target port in the device port to be audited;

[0049] A connection relationship generating unit is used to generate a device port connection relationship corresponding to the target port according to the number of terminals.

[0050] Optionally, the connection relationship generating unit includes:

[0051] A first connection relationship generating subunit, configured to generate a connection relationship of a single terminal connected to the target port when the number of the terminals is 1;

[0052] A second connection relationship generating subunit is used to generate a connection relationship of the device uplink port corresponding to the target port when the number of the terminals is greater than the other ports of the device port to be audited;

[0053] The third connection relationship generating subunit is used to generate a connection relationship of a network device connected to the port corresponding to the target port when the number of the terminals is greater than 1 and is not a maximum value.

[0054] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0055] A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above-mentioned methods for establishing a device port connection relationship when executing the program.

[0056] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute any of the above-mentioned methods for establishing a device port connection relationship.

[0057] Compared with the prior art, the embodiments of the present application have the following advantages:

[0058] In the embodiment of the present application, after the server sends a message request of the specified protocol to the target address segment corresponding to the acquired port of the device to be audited, the flow message information corresponding to the target address segment is collected, and the flow message 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 server, so that the server generates the device port connection relationship corresponding to the port of the device 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 marks the device port connection relationship and physical address corresponding to the port of the device 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 recording of the data of the unmanageable device, and splice it with the data of the manageable device to generate the full topology network resources, and then when the line maintenance occurs, the fault location can be directly carried out through the full topology network, without the need for maintenance personnel to step by step check the line on site, saving manpower and material resources, and at the same time, improving the efficiency of fault troubleshooting and processing.

[0059] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 A flowchart of a method for establishing a device port connection relationship provided in an embodiment of the present application;

[0061] Figure 2 A flowchart of another method for establishing a device port connection relationship provided in an embodiment of the present application;

[0062] Figure 3 A schematic diagram of a device port connection relationship establishment process provided in an embodiment of the present application;

[0063] Figure 4 A schematic diagram of the structure of a device for establishing a device port connection relationship provided in an embodiment of the present application;

[0064] Figure 5 A schematic diagram of the structure of another device port connection relationship establishment apparatus provided in an embodiment of the present application;

[0065] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0067] 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. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0068] Reference Figure 1 , shows a flow chart of the steps of a method for establishing a device port connection relationship provided by an embodiment of the present application, and the method for establishing a device port connection relationship can be applied to an audit terminal, such as Figure 1 As shown, the device port connection relationship establishment method may include the following steps:

[0069] Step 101: After the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited, the server collects the flow message information corresponding to the target address segment.

[0070] The embodiment 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 perform operations such as collecting, preprocessing and uploading flow message information.

[0071] The target address segment refers to the IP address segment included in the port of the device to be audited. For example, when counting the terminal IPs of a building in a community, all the ports in the building, that is, the ports of the device to be audited, can be known in advance. Based on the ports of the device to be audited, the IP address segment range of all terminal devices in the building can be obtained.

[0072] After obtaining the target address segment corresponding to the port of the device to be audited, the server can first send a message request of a specified protocol (such as UDP (User Datagram Protocol), etc.) to the IP address in the target address segment corresponding to the port of the device to be audited, and then the audit terminal can collect the traffic message information corresponding to the target address segment.

[0073] In actual applications, the terminals corresponding to the IP addresses 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 terminals in the address segment to activate and avoid incomplete terminal data collection.

[0074] In a specific implementation, when collecting flow packet information, the mirror switch can be connected to the port of the device to be audited, and then the flow packet information at the mirror port on the mirror switch can be collected through the audit terminal. Specifically, it can be described in detail in combination with the following specific implementation method.

[0075] In a specific implementation of the present application, the above step 101 may include:

[0076] Sub-step A1: After the mirror switch is connected to the port of the device to be audited, a target port identifier of the target port input by the user is obtained.

[0077] In this embodiment, after the server sends a message request of a 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 connecting line port, and the staff can connect the connecting line port to the socket of the mirror switch to achieve communication between the two.

[0078] 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.

[0079] It is understandable that an audit APP (Application) is pre-installed in the audit terminal. When collecting traffic message information, it is not collected all at once, but the user enters the target port identifier of the target port to be collected in the page of the audit APP, and only the traffic message information corresponding to the target port identifier is collected each time. Specifically, you can select information such as the number of ports and port identifiers (such as port numbers, etc.) on the audit APP of the audit terminal, select the corresponding port to capture and analyze the obtained information, and obtain the specific message corresponding to the port.

[0080] After the target port identifier of the target port input by the user is obtained, sub-step A2 is executed.

[0081] Sub-step A2: collecting message information from the mirror port of the mirror switch to obtain flow message information including the target port identifier.

[0082] After obtaining the target port identifier of the target port input by the user, the audit terminal can collect message information from the mirror port of the mirror interaction machine to obtain flow message information including the target port identifier.

[0083] After the traffic message information corresponding to the target address segment is collected, step 102 is executed.

[0084] Step 102: extract and process the flow message information to obtain the IP address and physical address corresponding to each port in the device to be audited.

[0085] After the flow packet information corresponding to the target address segment is collected, the flow packet information can be extracted and processed to obtain the IP address and physical address corresponding to each port in the device to be audited.

[0086] In the specific implementation, after obtaining the traffic message information, the captured traffic message information can be filtered according to the specific message type, sending server IP address, and port number to filter out useless messages, such as user privacy messages, etc., and the remaining traffic message information can be extracted and processed to obtain the IP address and physical address corresponding to each port in the port to be audited.

[0087] After the flow message information is extracted and processed to obtain the IP address and physical address corresponding to each port in the port to be audited, step 103 is executed.

[0088] Step 103: Send the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to the server, so that the server generates the device port connection relationship corresponding to the device port to be audited based on the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port, and marks the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.

[0089] After extracting and processing the traffic message information to obtain the IP address corresponding to each port in the port to be audited, the audit terminal can send the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port to the server, so that the server can generate the device port connection relationship corresponding to the device port to be audited based on the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port, and mark the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure, thereby supplementing the unmanageable device in the device port topology structure.

[0090] The embodiment of the present application sends a message request to the target address segment through the server, which can realize the search and recording of the data of the unmanageable device, and splice it with the data of the manageable device to generate a full-topology network resource. Then, when a fault occurs and line maintenance is performed, the fault can be directly located through the full-topology network.

[0091] In this embodiment, in order to reduce the workload of the staff, when sending data to the server, a QR code corresponding to each port can be generated, and the data can be sent by scanning the code. Specifically, it can be described in detail in combination with the following specific implementation method.

[0092] In a specific implementation of the present application, the above step 103 may include:

[0093] Sub-step B1: Generate a port QR code corresponding to each port according to the port identifier of each port, the IP address and the physical address corresponding to each port.

[0094] In this embodiment, after obtaining the IP address and physical address corresponding to each port, each port can be traversed to generate a port QR code corresponding to each port according to the port identifier, corresponding IP address and physical address of each port.

[0095] After generating the port QR code corresponding to each port, perform sub-step B2.

[0096] Sub-step B2: Scan the port QR code to send the port identifier of each port in the device to be audited and the IP address and physical address corresponding to each port to the server.

[0097] After generating the port QR code corresponding to each port, the port QR code can be scanned to send the port ID of each port in the device port 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 port QR code and complete the operation of entering the information into the background.

[0098] The embodiment of the present application can avoid the occurrence of errors in manual input by generating a QR code for each port to send information. At the same time, it can greatly reduce the workload of staff and improve the efficiency of information input.

[0099] The method for establishing a device port connection relationship provided in the embodiment of the present application, after the server sends a message request of the specified protocol to the target address segment corresponding to the acquired device port to be audited, collects the flow message information corresponding to the target address segment, extracts and processes the flow message information, obtains the IP address and physical address corresponding to each port in the device port to be audited, sends the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port to 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 connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. The embodiment of the present application sends a message request to the target address segment by the server, so as to realize the search and recording of the data of the unmanageable device, and splice it with the data of the manageable device to generate the full topology network resources, so that when a fault occurs and the line is maintained, the fault location can be directly performed through the full topology network, without the need for maintenance personnel to gradually check the line on site, saving manpower and material resources, and at the same time, improving the efficiency of fault troubleshooting and processing.

[0100] Reference Figure 2 , shows a flow chart of the steps of a method for establishing a device port connection relationship provided by an embodiment of the present application, and the method for establishing a device port connection relationship can be applied to a server, such as Figure 2 As shown, the device port connection relationship establishment method may include the following steps:

[0101] Step 201: Obtain the target address segment corresponding to the port of the device to be audited.

[0102] The embodiments of the present application can be applied to a server, that is, the execution subject is a server.

[0103] The target address segment refers to the IP address segment included in the port of the device to be audited. For example, when counting the terminal IPs of a building in a community, all the ports in the building, that is, the ports of the device to be audited, can be known in advance. Based on the ports of the device to be audited, the IP address segment range of all terminal devices in the building can be obtained.

[0104] When taking statistics of the device ports to be audited, the target address segment corresponding to the device ports to be audited may be used.

[0105] After the target address segment corresponding to the port of the device to be audited is obtained, step 202 is executed.

[0106] Step 202: According to the target address segment, a message request of a specified protocol is sent to an IP address in the target address segment.

[0107] After obtaining the target address segment corresponding to the port of the device to be audited, a message 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.

[0108] In actual applications, the terminals corresponding to the IP addresses 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 terminals in the address segment to activate and avoid incomplete terminal data collection.

[0109] After sending a message request of the specified protocol to the IP address in the target address segment according to the target address segment, step 203 is executed.

[0110] Step 203: 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.

[0111] After sending a message request of the specified protocol to the IP address within the target address segment according to the target address segment, the audit terminal can collect the traffic message information and perform extraction operations on the collected traffic message information to obtain the IP address and physical address corresponding to each port, and the audit terminal can send the port identifier, corresponding IP address and physical address of each port to the server in a scan code manner. The specific process can refer to the description of the above embodiment, and this embodiment will not be repeated here.

[0112] 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.

[0113] 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.

[0114] After the server obtains the port identifier of each port in the audited device port sent by the audit terminal, the IP address and physical address corresponding to each port, it can also delete the IP addresses uploaded by the audit terminal that appear more than the number threshold, such as IP addresses that appear more than 2 times.

[0115] 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, the device port connection relationship corresponding to each port can be generated according to the number of terminals under each port. Specifically, it can be described in detail in combination with the following specific implementation method.

[0116] In a specific implementation of the present application, the above step 204 may include:

[0117] Sub-step C1: According to the IP address corresponding to the target port in the device port to be audited, the number of terminals under the target port is obtained.

[0118] In this example, the target port refers to a port within the ports 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, port 2 can be used as the target port, port 3 can be used as the target port, and so on.

[0119] After obtaining the port identifier and corresponding IP address of each port in the device to be audited, the IP address and physical address corresponding to the target port in the device to be audited can be obtained, and the number of terminals under the target port can be obtained based on the IP address and physical address, that is, how many terminals are connected to the target port. If there is one IP address, it means that one terminal is connected to the target port. If there are multiple IP addresses, it means that multiple terminals are connected to the target port, and so on.

[0120] It is understandable that in real life, since a terminal may be equipped with multiple IP addresses, this embodiment can make the number of terminals obtained more accurate by obtaining the IP address and the physical address as the index of the terminal.

[0121] After obtaining the number of terminals under the target port, sub-step C2 is executed.

[0122] Sub-step C2: generating a device port connection relationship corresponding to the target port according to the number of terminals.

[0123] After obtaining the number of terminals under the target port, the device port connection relationship corresponding to the target port can be generated according to the number of IPs. Specifically, the following three connection relationships can be included:

[0124] 1. When the number of terminals is 1, a connection relationship of a single terminal connected to the target port is generated;

[0125] 2. When the number of terminals of the target port is greater than other ports of the device port to be audited, a connection relationship of the device uplink port corresponding to the target port is generated;

[0126] 3. When the number of terminals of 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.

[0127] 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.

[0128] After obtaining the device port connection relationship corresponding to the device port to be audited, the device port connection relationship and the physical address corresponding to the device port to be audited can be marked in the device port topology structure.

[0129] For the implementation process of this plan, please refer to Figure 3 As shown, 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), generates a QR code corresponding to each port by traversing the port packet capture analysis, and then uploads the port information to the server by scanning the code with the audit PC. In this process, the on-site personnel operate unilaterally, and one person can complete the equipment audit task. The data background is automatically analyzed without the use of tools such as line patrol instruments, and there is no need for multiple work surfaces and multiple personnel to cooperate, which greatly saves manpower and material costs.

[0130] The method for establishing a device port connection relationship provided in the embodiment of the present application obtains the target address segment corresponding to the device port to be audited, sends a message request of the specified protocol to the IP address in the target address segment according to the target address segment, obtains the port identifier of each port in the device port to be audited sent by the audit terminal, the IP address and physical address corresponding to each port, generates 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 physical address corresponding to each port, and marks the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. The embodiment of the present application sends a message request to the target address segment through the server, which can realize the search and recording of the data of the unmanageable device, and splices it with the data of the manageable device to generate the full topology network resources, and then when the line maintenance is performed in the event of a fault, the fault location can be directly performed through the full topology network, without the need for maintenance personnel to step by step check the line on site, saving manpower and material resources, and at the same time, improving the efficiency of fault detection and processing.

[0131] Reference Figure 4 , shows a schematic diagram of the structure of a device port connection relationship establishment device provided in an embodiment of the present application, the device port connection relationship establishment device can be applied to an audit terminal, such as Figure 4 As shown, the device port connection relationship establishment device may include the following modules:

[0132] The message information collection module 410 is used to collect the flow message information corresponding to the target address segment after the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited;

[0133] The IP address acquisition module 420 is used to extract and process the flow message information to obtain the IP address and physical address corresponding to each port in the device port to be audited;

[0134] The IP address sending module 430 is used to send the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to the server, so that the server can generate the device port connection relationship corresponding to the device port to be audited based on the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port, and mark the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure.

[0135] Optionally, the message information collection module includes:

[0136] A target port identifier obtaining unit, used to obtain a target port identifier of a target port input by a user after the mirror switch is connected to the port of the device to be audited;

[0137] The flow packet information acquisition unit is used to collect packet information from the mirror port of the mirror switch to obtain the flow packet information including the target port identifier.

[0138] Optionally, the IP address sending module includes:

[0139] A port QR code generating unit, used to generate a port QR code corresponding to each port according to the port identifier of each port, the IP address and the physical address corresponding to each port;

[0140] The IP address sending unit is used to scan the port QR 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.

[0141] The device for establishing a device port connection relationship provided in the embodiment of the present application, after the server sends a message request of the specified protocol to the target address segment corresponding to the acquired device port to be audited, collects the flow message information corresponding to the target address segment, extracts and processes the flow message information, obtains the IP address and physical address corresponding to each port in the device port to be audited, sends the port identifier of each port in the device port to be audited, the IP address and physical address corresponding to each port to 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 connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. The embodiment of the present application sends a message request to the target address segment by the server, so as to realize the search and recording of the data of the unmanageable device, and splice it with the data of the manageable device to generate the full topology network resources, so that when a fault occurs and the line is maintained, the fault location can be directly performed through the full topology network, without the need for maintenance personnel to gradually check the line on site, saving manpower and material resources, and at the same time, improving the efficiency of fault troubleshooting and processing.

[0142] Reference Figure 5 , shows a schematic diagram of the structure of a device port connection relationship establishment device provided in an embodiment of the present application, the device port connection relationship establishment device can be applied to a server, such as Figure 5 As shown, the device port connection relationship establishment device may include the following modules:

[0143] The target address segment acquisition module 510 is used to acquire the target address segment corresponding to the port of the device to be audited;

[0144] A message request sending module 520, configured to send a message request of a specified protocol to an IP address in the target address segment according to the target address segment;

[0145] The port identification acquisition module 530 is used to acquire the port identification 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;

[0146] The connection relationship generating 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 IP address and the physical address corresponding to each port;

[0147] The connection relationship marking module 550 is used 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.

[0148] Optionally, the device further comprises:

[0149] The IP address deletion module is used to delete the IP addresses uploaded by the audit terminal whose number of occurrences is greater than a threshold number.

[0150] Optionally, the connection relationship generating module includes:

[0151] An IP quantity acquisition unit, configured to acquire the number of terminals under the target port according to the IP address corresponding to the target port in the device port to be audited;

[0152] A connection relationship generating unit is used to generate a device port connection relationship corresponding to the target port according to the number of terminals.

[0153] Optionally, the connection relationship generating unit includes:

[0154] A first connection relationship generating subunit, configured to generate a connection relationship of a single terminal connected to the target port when the number of the terminals is 1;

[0155] A second connection relationship generating subunit is used to generate a connection relationship of the device uplink port corresponding to the target port when the number of the terminals is greater than the other ports of the device port to be audited;

[0156] The third connection relationship generating subunit is used to generate a connection relationship of a network device connected to the port corresponding to the target port when the number of the terminals is greater than 1 and is not a maximum value.

[0157] The device for establishing a device port connection relationship provided in the embodiment of the present application obtains the target address segment corresponding to the device port to be audited, sends a message request of a specified protocol to the IP address in the target address segment according to the target address segment, obtains the port identifier of each port in the device port to be audited sent by the audit terminal, the IP address and physical address corresponding to each port, generates 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, and marks the device port connection relationship and physical address corresponding to the device port to be audited in the device port topology structure. The embodiment of the present application sends a message request to the target address segment through the server, which can realize the search and recording of the data of the unmanageable device, and splices it with the data of the manageable device to generate the full topology network resources, and then when the line maintenance is performed in the event of a fault, the fault location can be directly performed through the full topology network, without the need for maintenance personnel to step by step check the line on site, saving manpower and material resources, and at the same time, improving the efficiency of fault troubleshooting and processing.

[0158] An embodiment of the present application also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the above-mentioned method for establishing a device port connection relationship when executed by the processor.

[0159] Figure 6 FIG. 6 is a schematic diagram showing the structure of an electronic device 600 according to an embodiment of the present invention. Figure 6 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or computer program instructions loaded from a storage unit 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0160] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, a microphone, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0161] The various processes and processing described above may be performed by the processing unit 601. For example, the method of any of the above embodiments may be implemented as a computer software program, which is tangibly contained in a computer-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more actions in the method described above may be performed.

[0162] An embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements a method for establishing a device port connection relationship when the program is executed by a processor.

[0163] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0164] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt 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.) containing computer-usable program code.

[0165] 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 should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0166] 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 specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0167] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal so that a series of operating steps are executed on the computer or other programmable terminal to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable terminal. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0168] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0169] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or terminal including the elements.

[0170] The above is a detailed introduction to a method for establishing a device port connection relationship, a device for establishing a device port connection relationship, an electronic device and a computer-readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for establishing a device port connection relationship, applied to an audit terminal, characterized in that: include: After the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited, the flow message information corresponding to the target address segment is collected; Extract and process the traffic message information to obtain the IP address and physical address corresponding to each port in the device to be audited; Sending the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to 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 connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure; The device port connection relationship corresponding to the target port is generated by the server according to the number of terminals under the target port. The connection relationship of the single terminal connected to the target port is generated by the server when the number of terminals is 1. The connection relationship of the device uplink port corresponding to the target port is generated by the server when the number of terminals at the target port is greater than other ports of the device port to be audited. The connection relationship of the network device connected to the port corresponding to the target port is generated by the server when the number of terminals at the target port is greater than 1 and is not a maximum value. The number of terminals under the target port is obtained by the server according to the IP address and physical address corresponding to the target port in the device port to be audited. The collecting of traffic message information corresponding to the target address segment includes: After the mirror switch is connected to the port of the device to be audited, a target port identifier of the target port input by the user is obtained; Message information is collected from the mirror port of the mirror switch to obtain flow message information including the target port identifier.

2. The method according to claim 1, characterized in that The step of 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 includes: Generate a port QR code corresponding to each port according to the port identifier of each port, the IP address and the physical address corresponding to each port; Scan the port QR code to send the port identifier of each port in the device to be audited and the IP address and physical address corresponding to each port to the server.

3. A method for establishing a device port connection relationship, applied to a server, characterized in that: include: Get the target address segment corresponding to the port of the device to be audited; According to the target address segment, sending a message request of a specified protocol to an IP address in the target address segment; Obtaining 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; 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; Marking the device port connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure; The generating of 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 includes: According to the IP address and physical address corresponding to the target port in the port of the device to be audited, the number of terminals under the target port is obtained; Generating a device port connection relationship corresponding to the target port according to the number of terminals; The generating, according to the number of terminals, a device port connection relationship corresponding to the target port includes: When the number of terminals is 1, a connection relationship of a single terminal connected to the target port is generated; When the number of terminals is greater than other ports of the device port to be audited, a connection relationship of the device uplink port corresponding to the target port is generated; When the number of terminals is greater than 1 and is not a maximum value, a connection relationship between a network device connected to the port corresponding to the target port is generated.

4. The method according to claim 3, characterized in that After obtaining 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, the method further includes: Delete the IP addresses uploaded by the audit terminal whose number of occurrences is greater than the number threshold.

5. A device for establishing a device port connection relationship, applied to an audit terminal, characterized in that: include: A message information collection module, used to collect flow message information corresponding to the target address segment after the server sends a message request of a specified protocol to the target address segment corresponding to the port of the device to be audited; An IP address acquisition module is used to extract and process the flow message information to obtain the IP address and physical address corresponding to each port in the device to be audited; An IP address sending module, used for sending the port identifier of each port in the device port to be audited and the IP address and physical address corresponding to each port to the server, so that the server generates a 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 connection relationship and the physical address corresponding to the device port to be audited in the device port topology structure; The device port connection relationship corresponding to the target port is generated by the server according to the number of terminals under the target port. The connection relationship of the single terminal connected to the target port is generated by the server when the number of terminals is 1. The connection relationship of the device uplink port corresponding to the target port is generated by the server when the number of terminals at the target port is greater than other ports of the device port to be audited. The connection relationship of the network device connected to the port corresponding to the target port is generated by the server when the number of terminals at the target port is greater than 1 and is not a maximum value. The number of terminals under the target port is obtained by the server according to the IP address and physical address corresponding to the target port in the device port to be audited. Wherein, the message information collection module includes: A target port identifier obtaining unit, used to obtain a target port identifier of a target port input by a user after the mirror switch is connected to the port of the device to be audited; The flow packet information acquisition unit is used to collect packet information from the mirror port of the mirror switch to obtain the flow packet information including the target port identifier.

6. A device for establishing a device port connection relationship, applied to a server, characterized in that: include: The target address segment acquisition module is used to obtain the target address segment corresponding to the port of the device to be audited; A message request sending module, used to send a message request of a specified protocol to an IP address in the target address segment according to the target address segment; A port identification acquisition module, used to acquire the port identification 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; A connection relationship generating module, used for generating 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; A connection relationship marking module, used 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; The connection relationship generation module includes: An IP quantity acquisition unit, configured to acquire the number of terminals under the target port according to the IP address and physical address corresponding to the target port in the device port 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; The connection relationship generating unit comprises: A first connection relationship generating subunit, configured to generate a connection relationship of a single terminal connected to the target port when the number of the terminals is 1; A second connection relationship generating subunit is used to generate a connection relationship of the device uplink port corresponding to the target port when the number of the terminals is greater than the other ports of the device port to be audited; The third connection relationship generating subunit is used to generate a connection relationship of a network device connected to the port corresponding to the target port when the number of the terminals is greater than 1 and is not a maximum value.

7. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for establishing a device port connection relationship according to any one of claims 1 to 4 when executing the program.

8. A computer-readable storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the method for establishing a device port connection relationship according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for generating service logic topology

    CN110838930A

  • Method for automatically discovering network topology of local area network

    CN111865684A

  • Method and apparatus for generating a network topology

    WO1998018306A2