Novel metropolitan area network multi-rule three-layer circuit automatic discovery method and device
By employing a highly configurable three-layer circuit auto-discovery method in new metropolitan area networks, and combining forward and reverse rules for port filtering and pairing, the problems of single rules and insufficient data stability in existing technologies are solved. This enables circuit discovery and management in multiple scenarios, improving the degree of automation and data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-04-14
AI Technical Summary
Existing three-layer circuit discovery methods suffer from problems such as single rules, limited coverage scenarios, lack of customization capabilities, insufficient idempotency and data stability, inadequate processing of derived circuits, and high dependence on manual intervention in new metropolitan area networks and carrier networks. They cannot meet the automatic discovery needs in complex network environments with multiple scenarios.
It adopts a unified, scalable, and highly configurable approach, collects basic data of network device ports, performs port filtering and pairing by combining forward and reverse rules, processes public and private network address ports in groups, sets circuit direction, fills in circuit information, and constructs derived circuits. It supports automatic discovery of various circuit scenarios and uses a unique and stable primary key system to ensure the idempotency of discovery results and data consistency.
It implements a unified circuit discovery framework for multiple scenarios, supports dual-ended circuits, single-ended circuits and port alias circuits, has a multi-dimensional port filtering and intelligent matching mechanism, generates a unique and stable circuit primary key, reduces manual intervention, and improves the degree of automation and the integrity and stability of circuit management.
Smart Images

Figure CN121864665A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of new metropolitan area networks and operator networks, and in particular to a new method and apparatus for automatic discovery of multi-rule three-layer circuits in metropolitan area networks. Background Technology
[0002] In existing new metropolitan area networks and carrier networks, three-layer network topology discovery mainly relies on the collection of device port information, including IP address, subnet mask, port status and port alias, and obtains interface information and routing table data from network devices through SNMP (Simple Network Management Protocol) or similar management protocols to determine the connectivity and subnet relationships between devices, thereby generating a network topology map.
[0003] Existing Layer 3 circuit discovery methods typically use IP address and subnet mask matching to determine whether ports or devices belong to the same logical subnet. This is then combined with interface type, device attributes, and direct connection information in the routing table to infer Layer 3 links or potential connections between devices. Some network management tools and systems can automatically discover network devices and their port relationships through SNMP polling, IP address scanning, or ARP table analysis, and draw Layer 2 / 3 topologies, providing basic data for network management, bandwidth monitoring, and topology analysis.
[0004] However, existing three-layer circuit discovery methods have the following problems:
[0005] 1. Limited rules and limited coverage: Existing solutions can usually only handle one scenario of dual-ended or single-ended circuits, and it is difficult to take into account port aliases or special ports such as sub-interface circuits, which cannot meet the automatic discovery needs in complex network environments with multiple scenarios.
[0006] 2. Lack of customization capabilities: The configuration flexibility of circuit direction, name, alias and circuit attributes is low, and it is impossible to customize the circuit construction logic according to user needs.
[0007] 3. Insufficient idempotency and data stability: The generation of circuit primary keys lacks a unified mechanism, and multiple discovery results are prone to duplicate records, data conflicts, or loss of historical traffic, affecting the data reliability of the network management system.
[0008] 4. Insufficient processing of derivative circuits: The processing of sub-interface ports is relatively simple, and it is usually impossible to automatically generate main interface circuits, resulting in incomplete main interface circuit information.
[0009] 5. High reliance on manual intervention: Some operations, such as adding, modifying and deleting circuits, still require manual confirmation or maintenance, resulting in low automation levels and limited management efficiency and accuracy. Summary of the Invention
[0010] To address the aforementioned problems with existing three-layer circuit discovery methods, this invention provides a unified, scalable, and highly configurable novel multi-rule three-layer circuit automatic discovery method and apparatus for metropolitan area networks. This method can automatically handle different types of circuit scenarios, flexibly construct circuit directions and attributes, and ensure idempotent consistency of discovery results through a stable primary key system. This further improves the degree of automation, reduces labor costs, and enhances the integrity and stability of circuit management.
[0011] To achieve the above objectives, the present invention adopts the following technical solution:
[0012] In one embodiment of the present invention, a novel method for automatic discovery of multi-rule Layer 3 circuits in metropolitan area networks is proposed, the method comprising:
[0013] Collect basic port data of all devices on the network and store it in a unified database;
[0014] Ports are queried based on forward rules, and then further filtered based on reverse rules; the forward rules are used to determine candidate ports, including device attributes, port attributes, and network attributes.
[0015] Available ports are grouped into two categories based on their address range: public network address ports and private network address ports. Within each group, ports are paired up in sequence.
[0016] The two paired ports are assigned circuit directions based on the device attribute level or port IP size, and circuit information is filled in. After the circuit information is filled in, the circuit attributes are determined based on the regular expressions of the device names at both ends, the regular expressions of the port aliases, and the attributes of the devices at both ends, thereby realizing dual-ended circuit discovery.
[0017] The newly discovered circuit is compared with existing circuits according to the logic of adding, modifying, and deleting, as well as the operation switches. After automatic or manual confirmation, it is entered into the database and a historical record is generated.
[0018] Furthermore, the method also includes:
[0019] For cases where the main interface port does not have an IP address or has not been collected, a derivative circuit is constructed.
[0020] Furthermore, the method for constructing the derived circuit is as follows:
[0021] Determine whether the two ports obtained from the pairing are sub-interface ports. If so, remove the sub-interface port numbers of the two ports, and then search for the main interface ports of the two ports in the database according to the device ID and the main interface name.
[0022] If two main interface ports are found, a new circuit is formed. If the IP addresses of the two ports of the new circuit do not exist, the new circuit is a derivative circuit.
[0023] Furthermore, the public network address ports are grouped according to IP address type and subnet mask; the private network address ports are grouped according to the network to which the device belongs, IP address type and subnet mask when the cross-domain filtering function is enabled; and grouped according to IP address type and subnet mask when the cross-domain filtering function is not enabled.
[0024] Furthermore, the method also includes:
[0025] After completing the discovery of dual-ended circuits, single-ended circuit discovery is performed on the remaining ports that cannot be matched to the other end.
[0026] Furthermore, the method also includes:
[0027] The local port alias is filtered from the available ports using a local port alias conditional regular expression;
[0028] Search for peer device and port information from the local port aliases using regular expressions for capturing peer device names and peer port names;
[0029] If the peer device and port information can be found, then import it into the database;
[0030] If the peer device and port information are not found, the device name and port name of both the local and peer devices are entered to achieve port alias circuit discovery.
[0031] In one embodiment of the present invention, a novel automatic discovery device for multi-rule three-layer circuits in metropolitan area networks is also proposed, the device comprising:
[0032] The port information collection module is used to collect basic port data of all devices on the network and store it in a unified database.
[0033] The port filtering module is used to query ports according to forward rules and then further filter ports according to reverse rules; the forward rules are used to determine candidate ports, including device attributes, port attributes and network attributes;
[0034] The port pairing module is used to group available ports into two categories based on their address range: public network address ports and private network address ports. Within each group, ports are paired in sequence.
[0035] The circuit construction module is used to set the circuit direction of the two paired ports according to the device attribute level or port IP size, and fill in the circuit information. After the circuit information is filled in, the circuit attribute is determined according to the regular expression of the device name at both ends, the regular expression of the port alias, and the attributes of the devices at both ends, thereby realizing dual-end circuit discovery; for the case where the main interface port does not have an IP address or has not been collected, a derivative circuit is constructed.
[0036] The circuit comparison and database module is used to compare the newly discovered circuit with existing circuits according to the comparison logic of adding, modifying, and deleting, as well as the operation switches. After automatic or manual confirmation, the circuit is added to the database and a historical record is generated.
[0037] Furthermore, after completing the discovery of dual-ended circuits, the device performs single-ended circuit discovery for the remaining ports that cannot be matched with the other end.
[0038] Furthermore, the device filters out local port aliases from the available ports using a local port alias conditional regular expression;
[0039] Search for peer device and port information from the local port aliases using regular expressions for capturing peer device names and peer port names;
[0040] If the peer device and port information can be found, then import it into the database;
[0041] If the peer device and port information are not found, the device name and port name of both the local and peer devices are entered to achieve port alias circuit discovery.
[0042] In one embodiment of the present invention, a computer device is also proposed, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it realizes the aforementioned novel metropolitan area network multi-rule three-layer circuit automatic discovery.
[0043] In one embodiment of the present invention, a computer-readable storage medium is also proposed, which stores a computer program that performs automatic discovery of a novel metropolitan area network multi-rule three-layer circuit.
[0044] Beneficial effects:
[0045] 1. A unified circuit discovery framework for multiple scenarios: It supports three types of scenarios: dual-ended circuits, single-ended circuits, and port alias circuits, and has a clear execution order and dependency relationship.
[0046] 2. Multi-dimensional port filtering and intelligent matching mechanism: Combining multiple conditions such as device range, port range, status, port description regular expression and IP / subnet relationship, it can achieve accurate port filtering and highly reliable automatic port pairing.
[0047] 3. Unique and stable circuit primary key generation mechanism: A structured unique ID is generated through IP, port information and rules to achieve idempotency of multiple discovery and avoid circuit duplication or deletion.
[0048] 4. Flexible and configurable circuit construction capabilities: Supports flexible definition of port direction, circuit name concatenation, and circuit attribute judgment through multiple rule tables, which can be dynamically adjusted according to business needs.
[0049] 5. Automated circuit attribute recognition capability: Based on conditions such as device attributes, port aliases, and device names, circuit attribute matching is performed to improve classification accuracy and support expansion.
[0050] 6. Controllable filtering mechanism for unknown circuits: It is configurable whether to filter unknown circuits, so that the device can flexibly make trade-offs between integrity and accuracy.
[0051] 7. Automatic / semi-automatic optional data entry strategy: Supports three types of switches: automatic addition, automatic modification, and automatic deletion. Combined with field update rules, it enables precise control of data entry behavior and reduces the risk of accidental operation.
[0052] 8. Circuit history record and manual confirmation mechanism: Supports historical data retention and manual confirmation processes to improve traceability and engineering controllability.
[0053] 9. Automatic construction capability of derivative circuits from sub-interface to main interface: Automatically identify the sub-interface structure and generate the corresponding main interface circuit, improving the completeness of discovery.
[0054] 10. Port alias reverse lookup capability for peer devices: Use port alias regular expressions to reverse lookup the peer device and port information from the collected data, solving the circuit construction problem in scenarios with missing data. Attached Figure Description
[0055] Figure 1 This is a schematic diagram of the process of the novel metropolitan area network multi-rule three-layer circuit automatic discovery method of the present invention;
[0056] Figure 2 This is a schematic diagram of the structure of the novel metropolitan area network multi-rule three-layer circuit automatic discovery device of the present invention;
[0057] Figure 3 This is a schematic diagram of the computer device structure of the present invention. Detailed Implementation
[0058] The principles and spirit of the present invention will now be described with reference to several exemplary embodiments. It should be understood that these embodiments are provided merely to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. Rather, these embodiments are provided to make this disclosure more thorough and complete, and to fully convey the scope of this disclosure to those skilled in the art.
[0059] Those skilled in the art will recognize that embodiments of the present invention can be implemented as an apparatus, device, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0060] According to an embodiment of the present invention, a novel multi-rule Layer 3 circuit automatic discovery method for metropolitan area networks (MANs) is proposed. This method introduces a unified system for port filtering, port pairing, circuit construction, and circuit attribute judgment. It utilizes various composable rules (such as IP matching, port alias regular expressions, port description extraction, sub-interface-to-main-interface derivation, direction determination rules, circuit name and alias concatenation rules, and circuit attribute identification rules) as new core technologies to support the automatic generation of stable and unique circuit identifiers under multiple scenarios, thereby ensuring the idempotency and data consistency of the discovery results. Simultaneously, by providing flexible parameterized configurations for each stage, users can customize circuit direction, circuit attributes, circuit construction methods, and database entry strategies as needed, significantly enhancing the adaptability and controllability of Layer 3 circuit discovery. Therefore, this new solution, with "multi-rule collaboration + high configurability" as its core approach, effectively overcomes the problems of insufficient scenario coverage, rule rigidity, data instability, and low automation in existing technologies, achieving a stable, accurate, and scalable automated circuit discovery and management process in complex network environments.
[0061] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.
[0062] This invention addresses the problem of automatic discovery of Layer 3 circuits in new metropolitan area networks by proposing a multi-rule customizable discovery method based on port data. The method supports three core discovery scenarios: dual-ended circuit discovery, single-ended circuit discovery, and port alias discovery. Dual-ended circuit discovery is largely similar to single-ended circuit discovery in terms of rule definition, but dual-ended circuits must have two ports with IP information. For single-ended circuits, after dual-ended discovery is completed, the remaining ports that cannot be matched with the counterpart can be discovered; only single-ended ports are recorded along with their circuit attributes.
[0063] The method supports the joint definition of multiple discovery rules. When different rules discover the same circuit, only the result from the earlier rule definition is retained, ensuring data consistency and idempotency. The three-layer circuit discovery method operates in a timed scheduling manner, and the specific discovery interval can be set according to the field port information acquisition program.
[0064] Since the discovery logic of two-ended circuits is relatively complex and basically covers the discovery logic of the other two rules, this invention will focus on two-ended circuit discovery in detail. Its core workflow includes port information collection, port screening, port pairing, circuit construction, and circuit comparison and database entry. Single-ended circuit discovery and port alias discovery are briefly supplemented on this basis.
[0065] Figure 1 This is a schematic diagram of the flowchart of the novel metropolitan area network multi-rule three-layer circuit automatic discovery method of the present invention. For example... Figure 1As shown, the specific steps are as follows:
[0066] S1. Port Information Acquisition: The device described in this invention sends acquisition commands to network devices through a data acquisition module to obtain basic port data. The acquired data includes basic device information, port name, port alias, port speed, port IP address, port status, and port type. After acquisition, all basic port data is stored in a unified database, providing foundational data support for subsequent port selection, pairing, and circuit construction.
[0067] S2. Port Filtering: After the basic port data collection is completed, the timed scheduling module (an open-source framework XXL-JOB) periodically initiates requests to this device, and then formally enters the process described in this invention. First, ports are queried from the database according to the forward rules in Table 1 below, carrying the corresponding device information. The forward rules are used to determine candidate ports, including device attributes, port attributes, and network attributes. After obtaining the query results, ports need to be further filtered according to the reverse rules. The specific rules are shown in Table 1 below:
[0068]
[0069] Table 1
[0070] S3. Port Pairing: After port filtering is completed, the device of this invention groups the available ports according to IP address type and subnet mask for circuit port pairing. The pairing logic is divided into two categories based on the address range of the ports: public network address ports and private network address ports, as detailed below:
[0071] 1. Public IP address and port pairing
[0072] Public IP address ports are first grouped according to IP address type (IPv4 or IPv6) and subnet mask. Ports within each group must meet the following conditions:
[0073] (1) The IP types are consistent, either all IPv4 or all IPv6;
[0074] (2) The masks are consistent;
[0075] (3) The IP addresses are sorted in ascending order.
[0076] Within each group, the available ports are paired sequentially. The pairing criteria are as follows:
[0077] (1) The IP addresses of the two ports are not exactly the same;
[0078] (2) The two ports are located in the same subnet;
[0079] (3) The two ports are of the same type, both being physical ports or logical ports.
[0080] For example, for a set of ports A, B, C, D, and E, first determine whether A and B can form a circuit. If they do not meet the conditions, then continue to determine whether B and C can form a circuit. If B and C meet the conditions, then the circuit is constructed. The next step is to directly determine whether D and E can be paired.
[0081] 2. Private network address and port pairing
[0082] The pairing logic for private network addresses and ports is similar to that for public network ports, but the grouping conditions are different:
[0083] (1) When the “Filter Cross-Domain Circuits” function is enabled, the ports are grouped according to the network, IP type and mask of the device. The network, IP type and mask of the devices in each group are the same, and the IP addresses are sorted from smallest to largest.
[0084] (2) When the “Filter Cross-Domain Circuits” function is not enabled, it will be grouped according to IP type and subnet mask, just like public network ports.
[0085] By adjusting the grouping field, private network address ports can be configured into circuit port pairs within the same network or across networks as needed, meeting users' customized requirements.
[0086] S4. Circuit Construction: After port pairing is completed, the device of this invention sets the circuit direction based on the two paired ports, that is, determines which port is end A and which port is end B. Typically, the rule for determining end A is based on the network layer of the device to which the port belongs or the port's IP address. Specific rules are as follows; one of the two rules must be selected, or both can be configured:
[0087] 1. Device attribute rules: Prioritize determining the device attribute level to which the port belongs, and use the device port with the higher attribute level as port A;
[0088] 2. IP address size rule: If the device attribute level is the same, the smaller port IP address will be designated as port A (IPv4 and IPv6 are handled separately).
[0089] After the ports at both ends of the circuit are determined, the device will fill in the circuit information, including the circuit name and alias. The alias is an attribute of the circuit, used for user-friendly identification, easy to remember and recognize; it is generally a Chinese name. The rules for concatenating the name and alias can include the names of the devices at both ends, port names, port speeds, and transmission circuit codes, and the field order and concatenation characters can be customized according to user needs.
[0090] The configuration items in the circuit construction are shown in Table 2 below:
[0091]
[0092] Table 2
[0093] After filling in the circuit information, the circuit attributes need to be determined. The determination criteria include six conditions: regular expressions for the names of the devices at both ends, regular expressions for port aliases, and the attributes of the devices at both ends. Circuits that meet all conditions will be identified as having the corresponding circuit attributes; circuits that do not meet any conditions will be identified as unknown circuits. Users can choose to enable the "Filter Unknown Circuits" function to discard unidentified circuits or retain them for subsequent processing. The circuit attribute determination rules are shown in Table 3 below:
[0094]
[0095] Table 3
[0096] Furthermore, this invention supports the construction of derivative circuits, primarily for situations where the main interface port lacks an IP address or has not been collected. The main interface refers to a physically existing port on a network device or a logical interface created by the system and managed as a single entity; it is the primary basic channel for data flow into or out of the device, such as physical ports and bundled ports. A sub-interface is a virtual logical interface created on top of a main interface (physical or logical); it is not an independent physical or logical entity but exists entirely dependent on its main interface. A main interface can create multiple sub-interfaces. Examples include GigabitEthernet0 / 0 / 1.10 and Eth-Trunk1.20. The specific method is as follows:
[0097] 1. First, build a general circuit based on the sub-interface ports (build the circuit completely according to the previous circuit construction steps).
[0098] 2. Determine whether the ports at both ends are sub-interface ports. If so, remove the sub-interface port number (e.g., ".001" in XXXX.001), and then search for the main interface port in the database according to the device ID and the main interface name.
[0099] The port after removing the sub-interface port number is the main interface. The circuit formed by the sub-interface port as the two ends is called the sub-interface circuit. After removing the sub-interface port numbers of the two ends while retaining the device information at both ends, the corresponding circuit formed is the main interface circuit.
[0100] Since the IP address of the main interface port may not be collected, in order to distinguish it from ordinary circuits, this type of circuit that does not contain IP information at both ends is called a derivative circuit.
[0101] 3. If the two main interface ports are found, a new circuit is formed. The IP addresses of the two ports of this circuit may not exist, so it is called a derived circuit. Otherwise, if they are not found, they are discarded directly.
[0102] 4. When the "Filter Sub-interface" function is enabled, the sub-interface circuit will be discarded, and only the derived circuit and ordinary circuit will be retained to participate in subsequent steps.
[0103] The unique identifier ID for all circuits is generated by MD5 encryption of the A-end device ID and the A-end port name to ensure the uniqueness and consistency of the circuit in multiple discovery processes, and to avoid data loss or upper-layer dependency errors caused by changes in the primary key due to abnormal port status or failure to collect data.
[0104] This method uses the device IDs and port names at both ends to determine duplicates for all discovered circuits, preventing the same port from being repeatedly constructed into multiple circuits and ensuring the accuracy and consistency of the discovery results.
[0105] S5. Circuit Comparison and Storage: After completing the circuit construction, the device of this invention compares the discovered circuit results with all circuits in the current circuit table (the table storing the previous discovery results), using the circuit primary key as the comparison basis. The comparison logic is as follows:
[0106] Addition processing: Circuits that do not exist in the current circuit table but are found in this discovery result will be automatically added to the current circuit table according to the configuration;
[0107] Deletion process: Circuits that exist in the current circuit table but are not found in this discovery result will be deleted according to the configuration;
[0108] Modification process: For circuits that exist in both the current circuit table and the results of this discovery, the field will be updated according to the "Circuit Field Update Definition" in Table 4 below. The update operation will only be performed if the field has changed and the "Automatic Modification" switch is turned on, in order to avoid unnecessary duplicate updates.
[0109] This method provides three operation switches: automatic addition, automatic modification, and automatic deletion. Only when the corresponding switch is enabled will the corresponding operation be performed directly on the current circuit table; otherwise, the operation will be recorded in the discovery results table, requiring manual review and confirmation by the user before execution. Circuits manually confirmed by the user will be marked as "Manual Circuits," and subsequent modifications or deletions will require user confirmation. Furthermore, circuits added or imported through the page will also be marked as Manual Circuits and maintained by the user to ensure circuit validity.
[0110]
[0111] Table 4
[0112] After completing the database operation, this invention transfers the original circuit data into the circuit history table, which facilitates subsequent review and troubleshooting, and ensures data traceability and security.
[0113] Through the above comparison and database entry logic and rules, this invention can achieve efficient and controllable synchronization between circuit discovery results and the current circuit table, avoiding duplicate updates and misoperations, while ensuring the integrity, traceability and user controllability of circuit data.
[0114] In this invention, the novel metropolitan area network (MAN) Layer 3 circuit automatic discovery mainly includes three core discovery scenarios: two-ended circuit discovery, single-ended circuit discovery, and port alias circuit discovery. Two-ended circuit discovery is the core scenario, as described in detail above. To fully cover the content of this invention, the other two scenarios are briefly described below.
[0115] Single-ended circuit discovery scenario: Compared to double-ended circuits, single-ended circuits lack the B-end device and port, therefore port pairing logic is not involved in the single-ended circuit discovery process. During the circuit construction phase, only the circuit information needs to be filled in based on the A-end port; there is no need to adjust the orientation of the ports at both ends. The circuit attribute judgment stage also relies solely on the A-end conditions; the remaining logic is similar to that of double-ended circuits. To avoid data conflicts caused by repeatedly discovering the same port, single-ended circuit discovery is always performed after double-ended circuit discovery is completed, ensuring the accuracy and completeness of the discovery results.
[0116] Port alias circuit discovery scenario: The logic for port alias circuit discovery is relatively independent and simple. Each port alias circuit discovery rule can be configured with local port alias conditional regular expressions, peer device name capture regular expressions, and peer port name capture regular expressions. Within the port range configured for the dual-end circuit (i.e., the available ports filtered in step two; only ports that meet the filtering conditions can undergo alias discovery), available ports are first filtered using the local port alias conditional regular expressions. Then, peer device name capture regular expressions and peer port name capture regular expressions are used to obtain peer information from the local port aliases. If peer device and port information can be found in the collected data, it is added to the database; otherwise, only the device and port names of the local and peer ends are entered. This logic can flexibly discover circuits that rely on port aliases, achieving supplementary circuit identification.
[0117] By combining the above three scenarios, this invention can cover the discovery needs of single-ended, double-ended, and alias port circuits, ensuring the automated discovery and management of three-layer circuits under multiple rules and scenarios, while avoiding duplicate discovery, data conflicts and omissions, and improving the accuracy, completeness and operability of the discovery results.
[0118] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0119] Based on the same inventive concept, this invention also proposes a novel automatic discovery device for multi-rule three-layer circuits in metropolitan area networks. The implementation of this device can refer to the implementation of the method described above, and repeated details will not be repeated. The term "module" used below can refer to a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0120] Figure 2 This is a schematic diagram of the structure of the novel metropolitan area network multi-rule three-layer circuit automatic discovery device of the present invention. Figure 2 As shown, the device includes:
[0121] The port information acquisition module 101 is used to collect basic port data of all network devices and store it in a unified database.
[0122] The port filtering module 102 is used to query ports according to forward rules and then further filter ports according to reverse rules; the forward rules are used to determine candidate ports, including device attributes, port attributes and network attributes;
[0123] The port pairing module 103 is used to group available ports into two categories, public network address ports and private network address ports, according to the address range to which the ports belong, and to pair the ports in each group in sequence to form a circuit.
[0124] The circuit construction module 104 is used to set the circuit direction of the two paired ports according to the device attribute level or port IP size, and fill in the circuit information. After the circuit information is filled in, the circuit attribute is determined according to the regular expression of the device name at both ends, the regular expression of the port alias, and the attributes of the devices at both ends, thereby realizing dual-end circuit discovery; for the case where the main interface port does not have an IP address or has not been collected, a derivative circuit is constructed.
[0125] The circuit comparison and storage module 105 is used to compare the newly discovered circuit with existing circuits according to the comparison logic of adding, modifying and deleting and operation switches, and store it in the database and generate historical records after automatic or manual confirmation.
[0126] After completing the discovery of dual-ended circuits, the device performs single-ended circuit discovery for the remaining ports that cannot be matched with the other end.
[0127] The device filters out local port aliases from the available ports using local port alias conditional regular expressions; it searches for peer device and port information from the local port aliases using peer device name capture regular expressions and peer port name capture regular expressions; if the peer device and port information is found, it is added to the database; if the peer device and port information is not found, the device name and port name of both the local and peer ends are entered, thereby realizing port alias circuit discovery.
[0128] It should be noted that although several modules of the novel metropolitan area network multi-rule three-layer circuit automatic discovery device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of the present invention, the features and functions of two or more modules described above can be embodied in one module. Conversely, the features and functions of one module described above can be further divided and embodied by multiple modules.
[0129] Based on the aforementioned inventive concept, such as Figure 3 As shown, the present invention also proposes a computer device 200, including a memory 210, a processor 220, and a computer program 230 stored in the memory 210 and executable on the processor 220. When the processor 220 executes the computer program 230, it implements the aforementioned novel metropolitan area network multi-rule three-layer circuit automatic discovery method.
[0130] Based on the aforementioned inventive concept, the present invention also proposes a computer-readable storage medium storing a computer program that executes the aforementioned novel metropolitan area network multi-rule three-layer circuit automatic discovery method.
[0131] This invention proposes a novel multi-rule three-layer circuit automatic discovery method and device for metropolitan area networks. By employing flexible rule settings and combining port data from network devices, it automatically discovers existing dual-ended circuits, single-ended circuits, and port alias circuits in the network, and automatically constructs circuit information (including circuit name, circuit alias, circuit attributes, circuit bandwidth, end devices, and port data). This allows for dynamic identification and updating of the entire network's circuit information, enabling administrators to conveniently and efficiently grasp the network interconnection status and providing basic configuration data for upper-layer topology functions, traffic monitoring, and other functions.
[0132] While the spirit and principles of the invention have been described with reference to several specific embodiments, it should be understood that the invention is not limited to the disclosed specific embodiments, and the division of aspects does not imply that features in these aspects cannot be combined for benefit; such division is merely for ease of description. The invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.
[0133] Regarding the limitation of the scope of protection of this invention, those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solution of this invention are still within the scope of protection of this invention.
Claims
1. A novel method for automatic discovery of multi-rule Layer 3 circuits in metropolitan area networks, characterized in that, The method includes: Collect basic port data of all devices on the network and store it in a unified database; Ports are queried based on forward rules, and then further filtered based on reverse rules; the forward rules are used to determine candidate ports, including device attributes, port attributes, and network attributes. Available ports are grouped into two categories based on their address range: public network address ports and private network address ports. Within each group, ports are paired up in sequence. The two paired ports are assigned circuit directions based on the device attribute level or port IP size, and circuit information is filled in. After the circuit information is filled in, the circuit attributes are determined based on the regular expressions of the device names at both ends, the regular expressions of the port aliases, and the attributes of the devices at both ends, thereby realizing dual-ended circuit discovery. The newly discovered circuit is compared with existing circuits according to the logic of adding, modifying, and deleting, as well as the operation switches. After automatic or manual confirmation, it is entered into the database and a historical record is generated.
2. The novel metropolitan area network multi-rule three-layer circuit automatic discovery method according to claim 1, characterized in that, The method further includes: For cases where the main interface port does not have an IP address or has not been collected, a derivative circuit is constructed.
3. The novel metropolitan area network multi-rule three-layer circuit automatic discovery method according to claim 2, characterized in that, The method for constructing the derived circuit is as follows: Determine whether the two ports obtained from the pairing are sub-interface ports. If so, remove the sub-interface port numbers of the two ports, and then search for the main interface ports of the two ports in the database according to the device ID and the main interface name. If two main interface ports are found, a new circuit is formed. If the IP addresses of the two ports of the new circuit do not exist, the new circuit is a derivative circuit.
4. The novel metropolitan area network multi-rule layer three circuit automatic discovery method according to claim 1, characterized in that, The public network address ports are grouped according to IP address type and subnet mask; the private network address ports are grouped according to the network to which the device belongs, IP address type and subnet mask when the cross-domain filtering function is enabled; and grouped according to IP address type and subnet mask when the cross-domain filtering function is not enabled.
5. The novel metropolitan area network multi-rule layer three circuit automatic discovery method according to claim 1, characterized in that, The method further includes: After completing the discovery of dual-ended circuits, single-ended circuit discovery is performed on the remaining ports that cannot be matched to the other end.
6. The novel metropolitan area network multi-rule layer three circuit automatic discovery method according to claim 1, characterized in that, The method further includes: The local port alias is filtered from the available ports using a local port alias conditional regular expression; Search for peer device and port information from the local port aliases using regular expressions for capturing peer device names and peer port names; If the peer device and port information can be found, then import it into the database; If the peer device and port information are not found, the device name and port name of both the local and peer devices are entered to achieve port alias circuit discovery.
7. A novel automatic discovery device for multi-rule three-layer circuits in metropolitan area networks, characterized in that, The device includes: The port information collection module is used to collect basic port data of all devices on the network and store it in a unified database. The port filtering module is used to query ports according to forward rules and then further filter ports according to reverse rules; the forward rules are used to determine candidate ports, including device attributes, port attributes and network attributes; The port pairing module is used to group available ports into two categories based on their address range: public network address ports and private network address ports. Within each group, ports are paired in sequence. The circuit construction module is used to set the circuit direction of the two paired ports according to the device attribute level or port IP size, and fill in the circuit information. After the circuit information is filled in, the circuit attribute is determined according to the regular expression of the device name at both ends, the regular expression of the port alias, and the attributes of the devices at both ends, thereby realizing dual-end circuit discovery; for the case where the main interface port does not have an IP address or has not been collected, a derivative circuit is constructed. The circuit comparison and database module is used to compare the newly discovered circuit with existing circuits according to the comparison logic of adding, modifying, and deleting, as well as the operation switches. After automatic or manual confirmation, the circuit is added to the database and a historical record is generated.
8. The novel metropolitan area network multi-rule three-layer circuit automatic discovery device according to claim 7, characterized in that, After completing the discovery of dual-ended circuits, the device performs single-ended circuit discovery for the remaining ports that cannot be matched with the other end.
9. The novel metropolitan area network multi-rule three-layer circuit automatic discovery device according to claim 7, characterized in that, The device filters out local port aliases from the available ports using a local port alias conditional regular expression; Search for peer device and port information from the local port aliases using regular expressions for capturing peer device names and peer port names; If the peer device and port information can be found, then import it into the database; If the peer device and port information are not found, the device name and port name of both the local and peer devices are entered to achieve port alias circuit discovery.
10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1-6.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that performs the method according to any one of claims 1-6.