Automatic routing method based on equipment connection relation

By constructing a business chain and a deep recursive expansion algorithm, the accuracy and adaptability issues of path calculation between network devices are solved, automatic path finding and reachability verification are realized, and the accuracy and adaptability of path search are improved.

CN121603383APending Publication Date: 2026-03-03BEIJING SCISTOR TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511826933.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently calculate paths between network devices in complex topologies, leading to path configuration errors or conflicts. This is especially true in multi-input multi-output structures, where simple graph search algorithms cannot accurately determine path validity.

Method used

The business chain is constructed by acquiring device information to build a topology and port-level directed graph. Combining the internal structure and connection relationships of the devices, a deep recursive graph search algorithm is used to automatically calculate port paths, thereby achieving automatic port-level pathfinding and reachability verification.

Benefits of technology

It enables the automatic generation of reachable port sets without manual intervention after changes in device model or topology, improving the accuracy and adaptability of path search, reducing maintenance difficulty, and adapting to changes in network topology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603383A_ABST
    Figure CN121603383A_ABST
Patent Text Reader

Abstract

The invention discloses an automatic routing method based on an equipment connection relation, and relates to the technical field of communication network management. The method comprises the following steps: firstly, establishing a topological structure for all devices, verifying an initial port based on a routing task, and performing reachability check on each device after verification is passed; the method comprises the following steps: constructing a neighbor node set for a current port by taking a starting port as a starting point in a path finding process, carrying out recursive expansion and topological structure traversing based on neighbor nodes, and when the neighbor nodes are expanded to be consistent with a target port, storing the neighbor nodes into a candidate path set to obtain a service chain. According to the method and the device, full-path automatic exploration from the starting port to the target port is realized, the network topology change can be automatically adapted, the problem that port adaptation needs to be performed by manual operation is solved, and the algorithm has higher adaptability and expansibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication network management technology, and in particular to an automatic pathfinding method based on device connection relationships. Background Technology

[0002] Currently, path configuration between network devices (such as optical cross-connectors, WSS, and switches) mostly relies on manual configuration or static table-driven methods, which are difficult to adapt to path changes under complex topologies. When there are many devices and complex port connections, traditional methods struggle to efficiently calculate reachable paths from input ports to output ports, easily leading to path configuration errors or conflicts. Especially when devices have multiple-input multiple-output (MIMO) structures (such as 1×32 or 32×32), the reachability of port connections depends on the internal structural rules of the device, and simple graph search algorithms cannot accurately determine path validity. Therefore, there is an urgent need for a method that can automatically calculate port paths based on device connection relationships and structural characteristics. Summary of the Invention

[0003] To address the aforementioned issues, this invention provides the concept of a service chain. By constructing a service chain within the system, a clear and visual view of the connection relationships between network devices is provided, facilitating user management and allowing for customized configuration according to user needs. Based on user configuration, an automatic routing method and system based on device connection relationships are implemented. This method automatically calculates feasible paths for ports based on port connection relationships and the internal structure of the devices, achieving port-level automatic routing and reachability verification.

[0004] An automatic pathfinding method based on device connectivity includes the following steps:

[0005] Step 1: Retrieve all device information from the database and construct the topology.

[0006] Device information includes port information, device type, and port connection relationships for all devices. Each connection relationship is represented by a UnitConnection structure, which contains fields such as starting device number, starting port, target device number, and target port.

[0007] Construct a port-level directed graph based on port connectivity. Each port is considered a node, and the connectivity is considered a directed edge.

[0008] Step 2: The upper-layer business system issues a routing task and inputs the starting port information. The port is then verified. If the verification passes, Step 3 is executed. If any verification fails, an error message is returned and the routing process is terminated.

[0009] The verification includes:

[0010] (1) Verify the validity of the parameters of the port, including the online status of the device, the usage status of the port, and whether the port is occupied or under maintenance.

[0011] (2) Verify whether the port is a valid port that can be used as the starting point of the service based on the topology and port attributes;

[0012] Step 3: Based on the device type of each device, establish a reachability matrix between ports within the device, and perform a reachability check on the device containing the starting port.

[0013] Based on the internal routing model of each device, an reachability matrix between internal ports is established, specifically as follows:

[0014] For a 1×32 device: the input port can be connected to any output port;

[0015] For 32×32 devices: any input port can be connected to any output port;

[0016] For directional devices: only some ports have routing mapping relationships.

[0017] Determine if a valid internal connectivity exists within the device where the starting port is located. If it does, the device is reachable; otherwise, it is unreachable, and the system terminates the current path calculation and records the reason for the error.

[0018] Step 4: Query the neighboring nodes of the node where the current port is located, and determine whether each neighboring node meets the starting condition. If so, sort the neighboring nodes according to the heuristic sorting rules and build a neighboring node list; otherwise, remove the corresponding neighboring nodes.

[0019] Ports that do not meet the starting point conditions include those with interrupted connections, those that are not reachable from the business, or those that do not comply with the policy filtering rules.

[0020] Neighbor nodes include two categories: physical topology neighbor nodes, which come from network connection relationships; and internal routable nodes, which are a set of internally reachable nodes dynamically calculated based on the internal switching structure of the device (such as 1×32, 32×32, matrix structure, etc.).

[0021] Step 5: Traverse the topology using the graph search algorithm, recursively expand the neighboring nodes of the current node, and repeat the reachability verification, neighbor filtering, and cache update processes from Step 3 to Step 5. When the port of the expanded search node matches the target port, record the current path as a candidate path.

[0022] The specific process of obtaining candidate paths through recursive expansion is as follows:

[0023] 1. Initialization Phase

[0024] The system receives the starting port and the destination port, creates a path list currentPath, and creates a visited port set visited to avoid duplication and loops.

[0025] 2. Add the starting node

[0026] Add the starting port to the current path and add it to the visited set.

[0027] 3. Initiate recursive expansion

[0028] Starting from the initial port, the system calls a recursive function to expand the list of neighboring nodes centered on the current port. For each reachable next-hop port, it checks whether each reachable port is already in the visited list. If so, the port is skipped; otherwise, the reachable port is added to the path and the visited list, and the recursive function is called again for that reachable port. The above checking process is repeated to continue expanding the path downwards until all expansions of the current port are completed.

[0029] 4. After all expansions on the current port are complete, perform a backtracking on the current path:

[0030] Remove the port from currentPath and clear it from visited, so that the expansion of the next port is not affected;

[0031] 5. Determine if the target port has been reached.

[0032] If the port at the end of the extension is the same as the target port, it is considered that the destination has been reached, and the current path is completely copied and saved as a candidate path.

[0033] 6. Repeated expansion – backtracking process

[0034] The recursive mechanism ensures that the search can be expanded down the topology level by level, while maintaining the correctness and acyclicity of the path through backtracking, until all possible paths have been enumerated.

[0035] Step 6: When the preset maximum search depth or the upper limit of the number of candidate paths is reached, the system stops expanding and returns the set of currently found paths, thus obtaining the complete routing path.

[0036] The advantages and beneficial effects of this invention are as follows:

[0037] 1. This invention can dynamically generate a set of reachable ports by reading the internal structure of the device from the database, without requiring cumbersome manual operations to adapt to changes in device model or type, making the algorithm more adaptable and scalable.

[0038] 2. This invention employs a deep recursive expansion method, progressively expanding all neighboring ports (including physically connected neighbors and internal structural neighbors) of each port to achieve automatic exploration of the entire path from the starting port to the target port. This mechanism eliminates the need for manual maintenance of path rules, significantly improving maintainability and search accuracy.

[0039] 3. Since the equipment structure and connection relationships are derived from dynamic data, this invention can automatically adapt to changes in network topology without the need for repeated manual modeling. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the business chain connection obtained by the method of the present invention;

[0041] Figure 2 This is a flowchart illustrating the automatic pathfinding method based on device connection relationships of the present invention. Detailed Implementation

[0042] The following will be referred to Figure 1 and Figure 2 As shown in the accompanying drawings and embodiments, the present invention will be further described in detail.

[0043] The automatic pathfinding method based on device connectivity includes the following steps:

[0044] Step 1: Retrieve all device information from the database and construct the topology.

[0045] Retrieve port information, device type, and port connection relationships for all devices from the database. Each connection relationship is represented by a UnitConnection structure, which includes fields such as starting device number, starting port, target device number, and target port.

[0046] A port-level directed graph is constructed based on device connection information. Each port is considered a node, and the connection relationship is considered a directed edge. The resulting topology graph is stored in memory for path searching.

[0047] Step 2: When the upper-layer business system issues a service and inputs the starting port information, the device management system first verifies the validity of the input parameters.

[0048] The legitimacy verification includes, but is not limited to, checking the device's online status, port usage status, and whether the port is occupied or under maintenance. Simultaneously, the system determines whether the port is a legitimate starting point for the service based on the topology and port attributes. If any verification fails, the system immediately returns an error message and terminates the current routing process.

[0049] Step 3: After the input parameters pass the verification, the system performs a reachability check on the device where the starting point is located.

[0050] The system determines whether a valid internal connectivity exists between the source port and the destination port within the same device based on the device's internal routing model (such as 1×32, 32×32, fixed mapping, or freely cross-connection structure). If the path is deemed unreachable, the system directly prunes the current path, terminates the calculation, and records the reason for the anomaly.

[0051] For each device, establish an internal routing model based on its device type (e.g., 1×32, 32×32) and determine the reachability matrix between the internal ports of the device:

[0052] For a 1×32 device: the input port can be connected to any output port;

[0053] For 32×32 devices: any input port can be connected to any output port;

[0054] For directional devices: only some ports have routing mapping relationships.

[0055] Step 4: After all the starting point verifications pass, the system queries the list of neighboring nodes of the node where the current port is located from the topology database.

[0056] Neighbor nodes include two types:

[0057] • Physical topology neighbor ports: derived from network connectivity, such as direct fiber optic connections.

[0058] • Internal routable ports: A set of internally reachable ports dynamically calculated based on the device's internal switching structure (e.g., 1×32, 32×32, matrix structure, etc.).

[0059] This ensures that the search process follows the actual network topology and fully matches the actual routable capabilities of the device's internal structure.

[0060] After acquiring all neighbor nodes, the system will sort the neighbor nodes according to preset heuristic sorting rules (such as link priority, remaining resources, device load, etc.). Based on the sorted neighbor nodes, the system will recursively identify the neighbor nodes that can reach the specified target port. There may be multiple neighbor nodes that can be routed to the target port, but only the first one is selected in order.

[0061] Meanwhile, neighboring nodes that do not meet the starting point conditions (such as those with interrupted connections, non-service reachable directions, or ports that do not conform to policy filtering rules) are removed to reduce invalid search branches.

[0062] Step 5: Based on the starting input port and the target output port, the system recursively expands the neighboring nodes of the current node using depth-first search (DFS) or other graph search algorithms, and repeats the reachability verification, neighbor filtering, and cache update processes from steps 3 to 5. When the port of a searched node matches the target port, the system records the current path as a candidate path.

[0063] If the preset maximum search depth or the upper limit of the number of candidate paths is reached, the system stops expanding and returns the set of paths that have been found.

[0064] The pseudocode is as follows:

[0065] void dfs(PortNode current, PortNode target, List <portnode>path, List<List <portnode>> result) { if(current.equals(target)) { result.add(new ArrayList<>(path)); return;} for (PortNode next: graph.get(current)) { if (!path.contains(next) && isReachable(current, next)) { path.add(next); dfs(next, target, path, result); path.remove(path.size() - 1);}}}boolean isReachable(PortNode from, PortNode to) { Device device = getDeviceByPort(from); returndevice.supportsRouting(from, to);} < / portnode> < / portnode>

[0066] The supportsRouting(from, to) method dynamically determines the internal connectivity based on the device's structural model.

[0067] The specific process of obtaining candidate paths through recursive expansion is as follows:

[0068] 1. Initialization Phase

[0069] The system receives the starting port and the destination port, establishes a path list `currentPath`, and creates a visited port set `visited` to avoid duplication and loops. Note: The received starting port and destination port are actually sets of actual device IDs and port IDs, obtained as integer values ​​using the following algorithm:

[0070] public static short encode(short deviceId, short portId) { if (deviceId < 0 || deviceId > 255 || portId < 0|| portId > 255) { throw new IllegalArgumentException("deviceId and portId must be in 0~255");}return (short) ((deviceId << 8) | (portId & 0xFF));}

[0071] 2. Add the starting node

[0072] Add the starting port to the current path and add it to the visited set.

[0073] 3. Initiate recursive expansion

[0074] The system calls a recursive function to expand all reachable next-hop ports based on the current port and its neighboring node set. The port reachability criteria are as follows: input and output ports within a device can be arbitrarily routed; for example, the output port of device A can output from any other output port. Different devices can only be routed according to their actual physical connections. For example, if output port 1 of device A is connected to input port 2 of device B, then during the routing process, only the path from output port 1 of device A to input port 2 of device B can be found.

[0075] During each node expansion process, the system caches the current device's internal reachability pairs (input port to output port mappings) and verified subpath results in memory. When the same device or port pair is encountered in subsequent routing processes, it checks whether it has already been used to avoid reusing the same port of the same device.

[0076] In addition, the system introduces a variety of pruning mechanisms during the search process, including loop detection, depth limit control, and candidate path number limit control, to ensure that the algorithm can still be executed efficiently under large-scale topologies.

[0077] The system performs the following steps for each neighboring port of the current port:

[0078] • Check if the port is already in the visited list to avoid loops.

[0079] • If not visited, add it to the path and access set.

[0080] • Call the recursive function again on that port to continue extending the path downwards.

[0081] • After all expansions on the current port are complete, perform a backtracking on the current path:

[0082] Remove the port from currentPath and clear it from visited, so that the expansion of the next port is not affected.

[0083] 4. Determine if the target port has been reached.

[0084] If a port in the recursive extension matches the target port, then the destination is considered reached. The target port here is the port that the system initially received input from the user or other system. In other words, it is necessary to determine whether the specified port of the specified device has been reached, and to copy and save the current path completely as a valid path.

[0085] 5. Repeated expansion-backtracking process

[0086] The recursive mechanism ensures that the search can be expanded down the topology level by level, while maintaining the correctness and acyclicity of the path through backtracking, until all possible paths have been enumerated.

[0087] Step 6: For each path in the search results, verify the connection status of each port and the online status of the device in turn; if any node is unavailable, remove that path.

[0088] Step 7: Output all valid paths and the device and port sequences contained in the paths to form a business chain for the upper-layer system to configure, verify or display.

[0089] In Example 1, a business chain constructed using the method of the present invention is as follows: Figure 1 As shown.

[0090] In Example 2, when the upper-layer system provides a starting point of A1:IN1 and an ending point of A3:OUT9, the path table unit_connection data is constructed according to the following table:

[0091] Fields Field meaning chain_id Business Chain ID src_unit_id Source Physical Unit ID src_port_type Source physical unit port type, where 1 indicates input and 2 indicates output. src_port Source physical unit port ID dst_unit_id Target physical unit ID dst_port_type Target physical unit port type, where 1 indicates input and 2 indicates output. dst_port_id Target physical unit port ID status Connection status value: 0 indicates the connection is idle, 1 indicates it is occupied. Initialize both to 0.

[0092] According to the connection diagram, the connection relationships between individual devices do not need to be saved; only the connection relationships between devices need to be saved, such as:

[0093] src_unit_id=1, src_port_type=2, src_port=1, dst_unit_id=2, dst_port_type=1, dst_port_id=1, status=0. Different connection relationships are distinguished based on the business chain ID. The current data indicates that output port 1 of physical unit ID 1 (A1) is connected to input port 1 of physical unit ID 2 (B1), and the current connection status is idle. Construct the complete connection relationship data based on the example.

[0094] The path given according to the calculation steps of this invention should be:

[0095] A1:IN1 → A1:OUT1 → B1:IN1 → B1:OUT1 → C1:IN1 → C1:OUT1 → A1:IN39 → A1:OUT9.

Claims

1. An automatic pathfinding method based on device connection relationships, characterized in that, Includes the following steps: Step 1: Retrieve all device information from the database and construct the topology. Step 2: The upper-layer business system issues a routing task and inputs the starting port information. The port is then verified. If the verification passes, Step 3 is executed. If any verification fails, an error message is returned and the routing process is terminated. Step 3: Based on the device type of each device, establish a reachability matrix between ports within the device, and perform a reachability check on the device containing the starting port. Determine if there is a valid internal connectivity relationship within the device where the starting port is located. If so, it means the path is reachable; otherwise, it is determined to be unreachable, and the system directly terminates the current path calculation and records the reason for the error. Step 4: Query the neighboring nodes of the node where the current port is located, and determine whether each neighboring node meets the starting condition. If so, sort the neighboring nodes according to the heuristic sorting rules and build a neighboring node list. Otherwise, remove the corresponding neighbor node; Step 5: Traverse the topology using the graph search algorithm, recursively expand the neighboring nodes of the current node, and repeat the reachability verification, neighbor filtering, and cache update process from Step 3 to Step 5. When the port of the expanded search node matches the target port, record the current path as a candidate path. The specific process of obtaining candidate paths through recursive expansion is as follows: (1) Initialization phase The system receives the starting port and the destination port, establishes a path list currentPath, and establishes a visited port set visited to avoid duplication and loops; (2) Add the starting node Add the starting port to the current path and add it to the visited set; (3) Initiate recursive expansion Starting from the initial port, the system calls a recursive function to expand the list of neighboring nodes centered on the current port. For each reachable next-hop port, it checks whether each reachable port is already in the visited list. If so, the port is skipped; otherwise, the reachable port is added to the path and the visited list, and the recursive function is called again for that reachable port. The above checking process is repeated to continue expanding the path downwards until all expansions of the current port are completed. (4) After all extensions of the current port are completed, perform backtracking on the current path: Remove the port from currentPath and clear it from visited, so that the expansion of the next port is not affected; (5) Determine whether the target port has been reached. If the port at the end of the extension is the same as the target port, it is considered that the destination has been reached, and the current path is completely copied and saved as a candidate path; (6) Repeated expansion-backtracking process The recursive mechanism ensures that the search can be expanded down the topology level by level, while maintaining the correctness and acyclicity of the path through backtracking, until all possible paths have been enumerated; Step 6: When the preset maximum search depth or the upper limit of the number of candidate paths is reached, the system stops expanding and returns the set of currently found paths, thus obtaining the complete routing path.

2. The automatic pathfinding method based on device connection relationship according to claim 1, characterized in that, The verification of the starting port includes: (1) Verify the validity of the parameters of the starting port, including the online status of the device, the usage status of the port, and whether the port is occupied or under maintenance. (2) Verify whether the port is a valid port that can be used as the starting point of the service based on the topology and port attributes.

3. The automatic pathfinding method based on device connection relationship according to claim 1, characterized in that, Based on the internal routing model of each device, an reachability matrix between internal ports is established, specifically as follows: For a 1×32 device: the input port can be connected to any output port; For 32×32 devices: any input port can be connected to any output port; For directional devices: establish an reachability matrix for ports with routing mapping relationships.

4. The automatic pathfinding method based on device connection relationship according to claim 1, characterized in that, Neighbor nodes fall into two categories: physical topology neighbor nodes, which are derived from network connectivity; and internal routable nodes, which are a set of internally reachable nodes dynamically calculated based on the device's internal switching structure.