Port exception processing method and device of network equipment and storage medium

CN116781379BActive Publication Date: 2026-09-11INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310842787.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-10
Publication Date
2026-09-11
Estimated Expiration
2043-07-10

AI Technical Summary

Technical Problem

[0005]本申请的主要目的在于提供一种网络设备的端口异常处理方法、装置及存储介质,以解决相关技术中网络设备的端口出现异常时,换绑端口设备的效率较低的问题

Benefits of technology

[0014]This application employs the following steps: obtaining network device logs and determining whether the network device has any abnormal issues based on the logs. These abnormal issues include at least one of the following: the network device's port is not bound to a port device, or the network device's port is rebound to a different port device. If the network device has an abnormal issue, a preset code is obtained from the logs, and the physical address of the network device's port is extracted from the preset code. The type of the port device is determined by the physical address. If the port device type is type one, the physical address is bound to the port device. If the port device type is type two, the port device is authenticated. This solves the problem of low efficiency in rebinding port devices when a network device port is abnormal in related technologies. By automatically determining whether a port is abnormal through network device logs and rebinding the port device when an abnormality occurs, the efficiency of rebinding port devices is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116781379B_ABST
    Figure CN116781379B_ABST
Patent Text Reader

Abstract

The application discloses a network device port exception processing method and device and a storage medium. It relates to the field of financial technology. The method comprises the following steps: acquiring the log of a network device, and determining whether the network device has an abnormal problem based on the log, wherein the abnormal problem at least comprises one of the following: a port of the network device is not bound to a port device and the port of the network device is bound to a wrong port device; in the case that the network device has an abnormal problem, acquiring a preset code in the log, and extracting the physical address of the port of the network device in the preset code; determining the type of the port device through the physical address, binding the physical address to the port device in the case that the type of the port device is a first type; and performing identity authentication on the port device in the case that the type of the port device is a second type. Through the application, the problem that the efficiency of the wrong port device is low when the port of the network device is abnormal in the related art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a method, apparatus, and storage medium for handling port anomalies in a network device. Background Technology

[0002] In related technologies, within large enterprise network environments, to ensure security, each port of the enterprise's network devices needs to be bound to the port device via MAC address (Media Access Control Address) or authenticated. MAC address binding is widely used for devices that do not support authentication, such as printers, banknote counters, and surveillance intercoms. When replacing a device that does not support authentication, the following steps are required to restore network connectivity: First, the network cable of the device without authentication needs to be unplugged and plugged in, and the logs need to be checked to locate the network device port corresponding to the information point. Then, network maintenance personnel check the logs on the network device, unbind the MAC address of the old device on the original port, and then bind the MAC address of the new device to that port.

[0003] However, the methods for connecting devices that do not support authentication to the network in the relevant technologies have the following drawbacks: First, when there are multiple network devices in the network environment, network maintenance personnel need to check logs on multiple network devices to locate and replace the port of the device, or use cable tracing instruments to determine the port of the device to be replaced, which will consume a lot of time. Second, there is a certain technical entry threshold for troubleshooting personnel. If the troubleshooting personnel do not have certain network knowledge or are not familiar with the enterprise's network topology, the time required for troubleshooting will also increase, and there may even be situations where a lot of time is spent but the wrong network node is found or the problem cannot be found. The time required for MAC binding of network device ports using the above methods depends on the knowledge level and proficiency of network administrators, and there is no guarantee that there will be no errors in operation.

[0004] There is currently no effective solution to the problem of low efficiency in switching port devices when a network device's port malfunctions. Summary of the Invention

[0005] The main objective of this application is to provide a method, apparatus, and storage medium for handling port anomalies in network devices, in order to solve the problem of low efficiency in switching port devices when a port of a network device malfunctions in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a method for handling port anomalies in a network device is provided. The method includes: acquiring logs of the network device and determining whether the network device has any anomalies based on the logs, wherein the anomalies include at least one of the following: the network device's port is not bound to a port device and the network device's port has been rebound to a port device; if the network device has an anomaly, acquiring a preset code from the logs and extracting the physical address of the network device's port from the preset code; determining the type of the port device through the physical address; if the port device type is a first type, binding the physical address to the port device; if the port device type is a second type, authenticating the port device.

[0007] Optionally, determining whether a network device has an abnormal problem based on logs includes: determining whether the log contains a preset code; if the log does not contain the preset code, determining that the network device does not have an abnormal problem; if the log contains the preset code, calculating the similarity between the preset code and the target code; determining whether the similarity between the preset code and the target code is greater than or equal to a first similarity threshold; if the similarity between the preset code and the target code is greater than or equal to the first similarity threshold, determining that the network device has an abnormal problem; if the similarity between the preset code and the target code is less than the first similarity threshold, determining that the network device does not have an abnormal problem.

[0008] Optionally, determining the type of port device by physical address includes: obtaining all recorded physical addresses in the database and calculating the similarity between each recorded physical address and the physical address to obtain a set of similarities; determining the minimum similarity in the set of similarities and determining the recorded physical address corresponding to the minimum similarity as the target physical address; and determining the type of port device based on the device manufacturer to which the target physical address belongs.

[0009] Optionally, before determining the recorded physical address corresponding to the minimum similarity as the target physical address, the method further includes: determining whether the minimum similarity is less than or equal to a second similarity threshold; if the minimum similarity is less than or equal to the second similarity threshold, performing the step of determining the recorded physical address corresponding to the minimum similarity as the target physical address; if the minimum similarity is greater than the second similarity threshold, determining the type of the port device as a pending type, and issuing a first prompt message, wherein the first prompt message is used to prompt the user to determine the actual type of the port device of the pending type.

[0010] Optionally, determining the type of port device based on the device manufacturer to which the target physical address belongs includes: identifying multiple types of target port devices manufactured by the device manufacturer, obtaining the information code for each type of target device, and obtaining a set of information codes, wherein the target port device is a device manufactured by the device manufacturer; determining the target information code of the target physical address, and determining the type of the target port device corresponding to the target information code in the set of information codes as the type of port device.

[0011] Optionally, binding a physical address to a port device includes: reading the device number of a port device in the binding queue and the physical address of the port to be bound at preset time intervals, wherein the binding queue includes the device numbers of all port devices of the first type and the physical addresses of the ports to be bound; and binding the device number and physical address in the log of the network device.

[0012] Optionally, authenticating the port device includes: authenticating the port device through a network access control protocol; after authenticating the port device, the method further includes: issuing a second prompt message if authentication fails, wherein the second prompt message is used to indicate that the port device authentication has failed.

[0013] To achieve the above objectives, according to another aspect of this application, a port anomaly handling apparatus for a network device is provided. The apparatus includes: a first acquisition unit, configured to acquire logs of the network device and determine whether the network device has an anomaly based on the logs, wherein the anomaly includes at least one of the following: the network device's port is not bound to a port device and the network device's port is rebound to a port device; a second acquisition unit, configured to acquire a preset code from the logs and extract the physical address of the network device's port from the preset code when the network device has an anomaly; a determination unit, configured to determine the type of the port device through the physical address, and bind the physical address to the port device if the port device type is a first type; and an authentication unit, configured to authenticate the port device if the port device type is a second type.

[0014] This application employs the following steps: obtaining network device logs and determining whether the network device has any abnormal issues based on the logs. These abnormal issues include at least one of the following: the network device's port is not bound to a port device, or the network device's port is rebound to a different port device. If the network device has an abnormal issue, a preset code is obtained from the logs, and the physical address of the network device's port is extracted from the preset code. The type of the port device is determined by the physical address. If the port device type is type one, the physical address is bound to the port device. If the port device type is type two, the port device is authenticated. This solves the problem of low efficiency in rebinding port devices when a network device port is abnormal in related technologies. By automatically determining whether a port is abnormal through network device logs and rebinding the port device when an abnormality occurs, the efficiency of rebinding port devices is improved. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0016] Figure 1 This is a flowchart of a method for handling port anomalies in a network device according to an embodiment of this application;

[0017] Figure 2 This is a schematic diagram of a port anomaly handling system for a network device according to an embodiment of this application;

[0018] Figure 3 This is a schematic diagram of a port anomaly handling device for a network device according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0023] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.

[0024] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a method for handling port anomalies in a network device according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0025] Step S101: Obtain the logs of the network device and determine whether there are any abnormal problems in the network device based on the logs. The abnormal problems include at least one of the following: the port of the network device is not bound to a port device and the port of the network device is rebound to a port device.

[0026] Specifically, the network device can be a switch in the enterprise's network topology. An anomaly refers to a problem where the network device becomes inaccessible due to a change in the MAC address of its port. Specific examples include a port not being bound to a specific device or a port being re-bound. The network device's logs are retrieved by entering a command to view the device logs. A text similarity algorithm is used to determine if the logs contain code corresponding to the anomaly, thus determining whether the network device has an anomaly based on the logs.

[0027] Step S102: In the event of an abnormal problem with the network device, obtain the preset code in the log and extract the physical address of the network device's port from the preset code.

[0028] Specifically, the physical address is also known as the MAC address. If the log contains a code corresponding to the abnormal problem, that is, a preset code, it indicates that the network device has an abnormal problem. If the log does not contain a code corresponding to the abnormal problem, it indicates that the network device does not have an abnormal problem. In the case of an abnormal problem in the network device, the preset code in the log is obtained, and the physical address of the network device's port is extracted from the preset code.

[0029] Step S103: Determine the type of port device by physical address. If the type of port device is the first type, bind the physical address to the port device.

[0030] Specifically, a MAC address is a unique identifier for a Network Interface Controller (NIC). A MAC address is a 6-byte number, typically represented in hexadecimal. A MAC address is used to uniquely identify a network device within a local area network (LAN), such as a computer, mobile phone, or router. MAC addresses are assigned by the manufacturer during device production, ensuring that different devices have unique MAC addresses. Therefore, the type of port device can be identified through its MAC address, enabling network management and security control of that device. Port device types include computers that support authentication and devices that do not, such as printers, banknote counters, and surveillance intercoms. The first type can be port devices that do not support authentication. For this type of port device, binding the MAC address to the port device resolves the issue of network connectivity problems caused by changes in the MAC address of the network device's port.

[0031] Step S104: If the port device is of type 2, authenticate the port device.

[0032] Specifically, the second type can be a port device that supports authentication, such as a computer. For the second type of port device, the problem of network connectivity failure caused by the change of the MAC address of the network device's port is solved by entering the Dot1x authentication command into the network device, that is, by authenticating the port device.

[0033] It's important to note that Dot1x authentication (IEEE 802.1X authentication) is a network access control (NAC) protocol used to authenticate and authorize device access on a local area network (LAN) or wireless local area network (WLAN). It provides a mechanism that allows network administrators to control which devices can connect to the network and authenticate devices before they can connect. In Dot1x authentication, client devices (such as computers, mobile phones, tablets, etc.) need to provide valid credentials (usually a username and password) to authenticate with the network switch or wireless access point. If authentication is successful, the client device is granted network access and assigned to a specific virtual local area network (VLAN) or access control list (ACL). If authentication fails, the client device is denied network access.

[0034] It should be noted that after resolving all port anomalies for the current network device, the logs of the next network device are retrieved every minute, and the process of determining whether there are any anomalies on the ports of that network device is repeated. If there are, the port device is bound to a physical address or authentication is performed. If the last network device in the network topology has been retrieved, the process starts again from the first network device and loops to determine whether there are any anomalies on the network devices in the entire network topology.

[0035] The network device port anomaly handling method provided in this application embodiment obtains the network device's logs and determines whether the network device has any anomalies based on the logs. The anomalies include at least one of the following: the network device's port is not bound to a port device, or the network device's port is rebound to a different port device. If the network device has an anomaly, a preset code is obtained from the logs, and the physical address of the network device's port is extracted from the preset code. The type of the port device is determined by the physical address. If the port device type is a first type, the physical address is bound to the port device. If the port device type is a second type, the port device is authenticated. This solves the problem of low efficiency in rebinding port devices when a network device port is abnormal in related technologies. By automatically determining whether a port is abnormal through the network device's logs and rebinding the port device when an anomaly occurs, the efficiency of rebinding port devices is improved.

[0036] Optionally, in the network device port anomaly handling method provided in this application embodiment, determining whether a network device has an anomaly based on logs includes: determining whether the logs contain preset code; if the logs do not contain preset code, determining that the network device does not have an anomaly; if the logs contain preset code, calculating the similarity between the preset code and target code; determining whether the similarity between the preset code and target code is greater than or equal to a first similarity threshold; if the similarity between the preset code and target code is greater than or equal to the first similarity threshold, determining that the network device has an anomaly; and if the similarity between the preset code and target code is less than the first similarity threshold, determining that the network device does not have an anomaly.

[0037] Specifically, the preset code could be "%PORT_SECURITY-2-PSECURE_VIOLATION:Securityviolation occurred, caused by MAC address lc83.412e.41d4 on interfaceGigabitEthernet 0 / 36." If the preset code is not present in the log, it indicates that the network device is not experiencing any abnormalities. However, since there are similar codes in the log and discrepancies between the read log and the network device, the presence of the preset code in the log suggests a possible abnormality in the network device. Further text similarity algorithms are needed to determine if an abnormality exists. Because the log format is relatively fixed, the data after the comma in the preset code can be excluded from the text similarity algorithm. The MAC address is the MAC address of the currently inserted network device, and the port is the port number of the inserted network device. The data from the % to the comma in the preset code is divided into T1, T2, T3, ..., T... using spaces as delimiters. n The correct code representing the exception, i.e., the target code, is also divided into B1, B2, B3, ..., B using spaces as separators. n Then, the similarity between the preset code and the target code is calculated using the Jaccard similarity algorithm. The calculation formula is as follows:

[0038]

[0039] Here, J(T,B) represents the similarity between the preset code and the target code. The first similarity threshold can be set to 0.9. If the similarity between the preset code and the target code exceeds the first similarity threshold, it indicates that the network device has an abnormal problem. If the similarity between the preset code and the target code is less than the first similarity threshold, it indicates that the network device does not have an abnormal problem. By determining whether the network device has an abnormal problem, it is possible to determine whether the network device needs maintenance.

[0040] After obtaining the physical address in the preset code, the type of port device can be optionally determined based on the physical address. In the port anomaly handling method for network devices provided in this application embodiment, determining the type of port device by physical address includes: obtaining all recorded physical addresses in the database and calculating the similarity between each recorded physical address and the physical address to obtain a set of similarities; determining the minimum similarity in the set of similarities and determining the recorded physical address corresponding to the minimum similarity as the target physical address; and determining the type of port device based on the device manufacturer to which the target physical address belongs.

[0041] Specifically, the company's database contains unique identifiers for the physical addresses of port devices manufactured by all current equipment manufacturers. For example, the physical addresses of all port devices manufactured by equipment manufacturer xxx will contain a code corresponding to equipment manufacturer xxx. MAC addresses starting with dcae.52, 782b.cb, etc., indicate port devices from equipment manufacturer a. Port devices manufactured by equipment manufacturer a are computers, not printers or other devices that require binding. Addresses starting with 98df.82, ecc8.9c, etc., indicate port devices from equipment manufacturer b. Port devices manufactured by equipment manufacturer b are monitoring devices. Since MAC addresses are globally unique, and the first six bits are assigned to different manufacturers by IEEE, the type of port device can be determined by the physical address. When determining the type of port device using the physical address in the preset code, the similarity between each recorded physical address and the physical address in the preset code is calculated to determine the most likely manufacturer to which the port device belongs. For example, the ASCII values ​​of the first six bits of the MAC address of the port device in the preset code are recorded sequentially as A1, A2, A3, A4, A5, A6. At the same time, the first six bits of each recorded physical address in the database are converted to ASCII values ​​and recorded sequentially as W. i1 W i2 W i3 W i4 W i5 W i6 The similarity between each recorded physical address and other physical addresses is calculated using the Euclidean distance algorithm. The calculation formula is as follows:

[0042]

[0043] Where i represents the number of physical addresses already included in the database, and d represents the number of physical addresses already included in the database. i That is, the similarity between each recorded physical address and other physical addresses is taken from all d. i The lowest similarity score is used as the target physical address. Then, the type of port device is determined based on the device manufacturer to which the target physical address belongs. The type of port device is then used to determine whether to bind the port device to a physical address or perform authentication.

[0044] Optionally, in the port anomaly handling method for network devices provided in this application embodiment, before determining the recorded physical address corresponding to the minimum similarity as the target physical address, the method further includes: determining whether the minimum similarity is less than or equal to a second similarity threshold; if the minimum similarity is less than or equal to the second similarity threshold, performing the step of determining the recorded physical address corresponding to the minimum similarity as the target physical address; if the minimum similarity is greater than the second similarity threshold, determining the type of the port device as a pending type, and issuing a first prompt message, wherein the first prompt message is used to prompt the user to determine the actual type of the port device of the pending type.

[0045] Specifically, since a company's database may not contain the physical addresses of some device manufacturers, there may be situations where the manufacturer corresponding to the physical address in the preset code cannot be determined based on the already recorded physical addresses. A second similarity threshold is set to determine whether a recorded physical address corresponding to the physical address in the preset code exists in the database. If the minimum similarity is less than or equal to the second similarity threshold, it means that a recorded physical address corresponding to the physical address in the preset code exists in the database, and the step of determining the recorded physical address corresponding to the minimum similarity as the target physical address is then executed. If the minimum similarity is greater than the second similarity threshold, it means that a recorded physical address corresponding to the physical address in the preset code does not exist in the database, and a first prompt message is issued to prompt the user to determine the actual type of the port device to be determined. Setting a second similarity threshold avoids errors in determining the type of port device based on the similarity between recorded physical addresses and physical addresses.

[0046] Optionally, in the port anomaly handling method for network devices provided in this application embodiment, determining the type of port device based on the device manufacturer to which the target physical address belongs includes: determining multiple types of target port devices produced by the device manufacturer, and obtaining the information code of each type of target device to obtain a set of information codes, wherein the target port device is a device produced by the device manufacturer; determining the target information code of the target physical address, and determining the type of the target port device corresponding to the target information code in the set of information codes as the type of port device.

[0047] Specifically, the information code can be ASCII (American Standard Code for Information Interchange). Each equipment manufacturer may produce more than one type of port device. Therefore, after determining the corresponding equipment manufacturer based on the physical address, it is necessary to further determine which type of port device produced by that equipment manufacturer. For example, equipment manufacturer C produces two types of target port devices: walkie-talkies and printers. By comparing the information codes corresponding to the walkie-talkies and printers with the target information codes of the target physical address, the type of target port device is determined to be the type of port device.

[0048] The problem of network connectivity failure caused by changes in the MAC address of a network device's port can be solved by binding the device number of a port device to its physical address. Optionally, in the port anomaly handling method for network devices provided in this application embodiment, binding the physical address to the port device includes: reading the device number of a port device and the physical address of the port to be bound in the binding queue at preset time intervals, wherein the binding queue includes the device numbers of all port devices of the first type and the physical addresses of the ports to be bound; and binding the device number and physical address in the log of the network device.

[0049] Specifically, the preset time period can be one minute, and the queue to be bound can be a queue containing the device numbers of all port devices of type 1 that have encountered abnormal problems, as determined by the logs, along with the physical addresses of the ports to be bound. Due to changes in the port MAC address, the current port may not be bound to a port device or may need to be rebound. By rebinding the physical address in the logs with the device number of the port device, network connectivity of the port device in the local area network topology is achieved.

[0050] To address the issue of network connectivity failure caused by changes in the MAC address of a network device's port, the method for handling port anomalies provided in this application embodiment includes, optionally, authenticating the port device via a network access control protocol. After authenticating the port device, the method further includes, if authentication fails, issuing a second prompt message, wherein the second prompt message is used to indicate that the port device authentication has failed.

[0051] Specifically, network access control protocols can use Dot1x authentication. In Dot1x authentication, port devices (such as computers, mobile phones, tablets, etc.) need to provide valid identity credentials, such as usernames and passwords, to authenticate with the network device. If authentication is successful, the port device will be granted network access and assigned to a specific Virtual Local Area Network (VLAN) or Access Control List (ACL). If authentication fails, the port device will be denied network access. If authentication fails, a secondary message will be issued to indicate that authentication has failed.

[0052] According to another embodiment of this application, a port anomaly handling system for a network device is also provided. Figure 2 This is a schematic diagram of a port anomaly handling system for a network device according to an embodiment of this application. Figure 2 As shown, the system includes:

[0053] Server 201: By collecting logs from downstream switches and using deep learning algorithms running on the server, it determines whether there are network connectivity issues or device types caused by port binding or authentication problems on downstream switches, and sends relevant commands to downstream switches to modify their configurations.

[0054] Router 202: Used to connect server 201 and network device 203 for network communication.

[0055] Maintenance Terminal 203: Used for performing personalized changes to the server.

[0056] Network device 204: A downstream switch connected to the server, used to receive server commands for binding and authentication, as well as to periodically upload relevant logs to the server.

[0057] Port device 205: Devices used by users, such as computers, printers, and banknote counters.

[0058] The network device port anomaly handling system provided in this application embodiment binds the MAC address of monitoring devices such as printers, banknote counters, and walkie-talkies when port devices 205 are replaced. This eliminates the need for technicians to unbind the old device's MAC address and bind the new one, and also eliminates the need for personnel to locate the specific port of a network device using a cable-finding instrument. The system only requires server 201 to determine if network device 204 has a network connectivity problem due to port binding or authentication issues. If so, server 201 automatically obtains the device type of port device 205 and automatically binds the MAC address or performs authentication based on the device type. This not only improves the efficiency of technicians but also enhances the convenience of device replacement operations without compromising device access security. It reduces the workload of technicians, increases efficiency, lowers the professional requirements for technicians, and allows for timely MAC address binding on network devices.

[0059] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0060] This application also provides a port anomaly handling device for a network device. It should be noted that this port anomaly handling device can be used to execute the port anomaly handling method for a network device provided in this application. The following describes the port anomaly handling device for a network device provided in this application.

[0061] Figure 3 This is a schematic diagram of a port anomaly handling device for a network device according to an embodiment of this application. Figure 3 As shown, the device includes:

[0062] The first acquisition unit 301 is used to acquire the logs of the network device and determine whether there are any abnormal problems in the network device based on the logs. The abnormal problems include at least one of the following: the port of the network device is not bound to a port device and the port of the network device is rebound to a port device.

[0063] The second acquisition unit 302 is used to acquire a preset code in the log and extract the physical address of the network device's port from the preset code when there is an abnormal problem with the network device.

[0064] The determining unit 303 is used to determine the type of the port device by the physical address, and bind the physical address to the port device when the type of the port device is the first type.

[0065] Authentication unit 304 is used to authenticate the port device when the port device type is type 2.

[0066] The network device port anomaly handling device provided in this application embodiment acquires the network device logs through a first acquisition unit 301 and determines whether there is an anomaly problem in the network device based on the logs. The anomaly problem includes at least one of the following: the network device port is not bound to a port device and the network device port is rebound to a port device. The second acquisition unit 302, when the network device has an anomaly problem, acquires a preset code in the logs and extracts the physical address of the network device port from the preset code. The determination unit 303 determines the type of the port device through the physical address. If the port device type is a first type, the physical address is bound to the port device. The authentication unit 304, if the port device type is a second type, performs identity authentication on the port device. This solves the problem of low efficiency in rebinding port devices when the network device port is abnormal in related technologies. By automatically determining whether the port is abnormal through the network device logs and rebinding the port device when an abnormality occurs, the efficiency of rebinding port devices is improved.

[0067] Optionally, in the port anomaly handling device for network devices provided in this application embodiment, the first acquisition unit 301 includes: a first judgment module, used to judge whether the log contains a preset code; if the log does not contain the preset code, determine that the network device does not have an anomaly; a calculation module, used to calculate the similarity between the preset code and the target code if the log contains the preset code; a second judgment module, used to judge whether the similarity between the preset code and the target code is greater than or equal to a first similarity threshold; a first determination module, used to determine that the network device has an anomaly if the similarity between the preset code and the target code is greater than or equal to the first similarity threshold; and a second determination module, used to determine that the network device does not have an anomaly if the similarity between the preset code and the target code is less than the first similarity threshold.

[0068] Optionally, in the port anomaly handling apparatus for network devices provided in this application embodiment, the determining unit 303 includes: an acquisition module, used to acquire all recorded physical addresses in the database and calculate the similarity between each recorded physical address and a physical address to obtain a set of similarities; a third determining module, used to determine the minimum similarity in the set of similarities and determine the recorded physical address corresponding to the minimum similarity as the target physical address; and a fourth determining module, used to determine the type of port device based on the device manufacturer to which the target physical address belongs.

[0069] Optionally, in the port anomaly handling device for network devices provided in this application embodiment, the device further includes: a judgment unit, used to judge whether the minimum similarity is less than or equal to a second similarity threshold; an execution unit, used to execute the step of determining the recorded physical address corresponding to the minimum similarity as the target physical address when the minimum similarity is less than or equal to the second similarity threshold; and a prompting unit, used to determine the type of the port device as a pending type when the minimum similarity is greater than the second similarity threshold, and issue a first prompting message, wherein the first prompting message is used to prompt the user to determine the actual type of the port device of the pending type.

[0070] Optionally, in the port anomaly handling device for network devices provided in this application embodiment, the fourth determining module includes: a first determining submodule, used to determine multiple types of target port devices produced by the equipment manufacturer, and obtain the information code of each type of target device to obtain a set of information codes, wherein the target port device is a device produced by the equipment manufacturer; a second determining submodule, used to determine the target information code of the target physical address, and determine the type of the target port device corresponding to the target information code in the set of information codes as the type of port device.

[0071] Optionally, in the port anomaly handling device for network devices provided in this application embodiment, the determining unit 303 includes: a reading module, used to read the device number and physical address of the port to be bound from the port device in the binding queue at preset time intervals, wherein the binding queue includes the device numbers and physical addresses of all port devices of the first type; and a binding module, used to bind the device number and physical address in the log of the network device.

[0072] Optionally, in the port anomaly handling device for network devices provided in this application embodiment, the authentication unit 304 includes: an authentication module, used to authenticate the port device through a network access control protocol; after authenticating the port device, the device further includes: a prompting module, used to issue a second prompting message if authentication fails, wherein the second prompting message is used to prompt that the port device authentication has failed.

[0073] The port anomaly handling device of the network device includes a processor and a memory. The first acquisition unit 301, the second acquisition unit 302, the determination unit 303 and the authentication unit 304 mentioned above are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.

[0074] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can improve the efficiency of port switching.

[0075] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0076] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a method for handling port anomalies in a network device.

[0077] This invention provides a processor for running a program, wherein the program executes a method for handling port anomalies of a network device during runtime.

[0078] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. For example... Figure 4 As shown, electronic device 401 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring the network device's logs and determining whether the network device has any abnormal problems based on the logs. The abnormal problems include at least one of the following: the network device's port is not bound to a port device, or the network device's port has been re-bound to a port device. If the network device has an abnormal problem, acquiring a preset code from the logs and extracting the physical address of the network device's port from the preset code; determining the port device type through the physical address; if the port device type is type one, binding the physical address to the port device; if the port device type is type two, authenticating the port device. The device in this document can be a server, PC, PAD, mobile phone, etc.

[0079] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program with the following method steps: obtaining the logs of a network device and determining whether there is an abnormal problem with the network device based on the logs, wherein the abnormal problem includes at least one of the following: the network device's port is not bound to a port device and the network device's port is rebound to a port device; if the network device has an abnormal problem, obtaining a preset code in the logs and extracting the physical address of the network device's port from the preset code; determining the type of the port device through the physical address, and if the port device type is a first type, binding the physical address to the port device; if the port device type is a second type, authenticating the port device.

[0080] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0081] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0082] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0083] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0084] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0085] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0086] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0087] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0088] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied 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.

[0089] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for handling port anomalies in a network device, characterized in that, include: Obtain the logs of the network device and determine whether there are any abnormal problems in the network device based on the logs. The abnormal problems include at least one of the following: the port of the network device is not bound to a port device and the port of the network device is rebound to a port device. In the event of the aforementioned abnormality in the network device, a preset code is obtained from the log, and the physical address of the network device's port is extracted from the preset code. The type of the port device is determined by the physical address. If the type of the port device is the first type, the physical address is bound to the port device. The process of determining the type of the port device by the physical address includes: obtaining all the physical addresses recorded in the database, calculating the similarity between each recorded physical address and the physical address, and obtaining a set of similarity scores; determining the minimum similarity score in the set of similarity scores, and determining the recorded physical address corresponding to the minimum similarity score as the target physical address; and determining the type of the port device based on the device manufacturer to which the target physical address belongs. If the port device is of type two, the port device is authenticated.

2. The method according to claim 1, characterized in that, Determining whether the network device has any abnormal issues based on the logs includes: Determine whether the log contains preset code; If the preset code is not included in the log, it is determined that the network device does not have the aforementioned abnormal problem. If the log contains the preset code, calculate the similarity between the preset code and the target code; Determine whether the similarity between the preset code and the target code is greater than or equal to a first similarity threshold; If the similarity between the preset code and the target code is greater than or equal to the first similarity threshold, it is determined that the network device has the abnormal problem. If the similarity between the preset code and the target code is less than the first similarity threshold, it is determined that the network device does not have the abnormal problem.

3. The method according to claim 1, characterized in that, Before determining the recorded physical address corresponding to the minimum similarity as the target physical address, the method further includes: Determine whether the minimum similarity is less than or equal to the second similarity threshold; If the minimum similarity is less than or equal to the second similarity threshold, the step of determining the recorded physical address corresponding to the minimum similarity as the target physical address is executed. If the minimum similarity is greater than the second similarity threshold, the type of the port device is determined to be a pending type, and a first prompt message is issued, wherein the first prompt message is used to prompt the user to determine the actual type of the port device of the pending type.

4. The method according to claim 1, characterized in that, Determining the type of the port device based on the device manufacturer to which the target physical address belongs includes: Identify multiple types of target port devices manufactured by the equipment manufacturer, and obtain the information code for each type of target device to obtain a set of information codes, wherein the target port device is a device manufactured by the equipment manufacturer; Determine the target information code of the target physical address, and determine the type of the target port device corresponding to the target information code in the set of information codes as the type of the port device.

5. The method according to claim 1, characterized in that, Binding the physical address to the port device includes: The device number and physical address of the port to be bound are read from the waiting queue at preset time intervals. The waiting queue includes the device numbers and physical addresses of all port devices of the first type. The device number and the physical address are bound in the logs of the network device.

6. The method according to claim 1, characterized in that, Authentication of the port device includes: The port device is authenticated using a network access control protocol. After authenticating the port device, the method further includes: If authentication fails, a second prompt message is issued, which indicates that the port device authentication has failed.

7. A port anomaly handling device for a network device, characterized in that, include: The first acquisition unit is used to acquire the logs of the network device and determine whether there is an abnormal problem in the network device based on the logs. The abnormal problem includes at least one of the following: the port of the network device is not bound to a port device and the port of the network device is rebound to a port device. The second acquisition unit is used to acquire a preset code in the log when the network device has the abnormal problem, and extract the physical address of the port of the network device from the preset code; A determining unit is configured to determine the type of the port device through the physical address, and bind the physical address to the port device if the type of the port device is a first type. The determining unit includes: an acquisition module, used to acquire all recorded physical addresses in the database and calculate the similarity between each recorded physical address and the physical address to obtain a set of similarities; a third determining module, used to determine the minimum similarity in the set of similarities and determine the recorded physical address corresponding to the minimum similarity as the target physical address; and a fourth determining module, used to determine the type of the port device based on the device manufacturer to which the target physical address belongs. An authentication unit is used to authenticate the port device if the port device is of type two.

8. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute the port anomaly handling method of the network device according to any one of claims 1 to 6.

9. An electronic device, characterized in that, The device includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the port anomaly handling method of the network device according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Access control method, access equipment and system

    CN102137109A