A method, apparatus, electronic device and storage medium for constructing a network topology
By building an end-to-end three-layer topology model, integrating the elements of the physical layer, logic layer and application layer, the problem of protocol layer independence in traditional network operations is solved, and the integration of multi-level network topology is realized, which facilitates network operation and path positioning.
Patent Information
- Application Number
- CN202211077856.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-05
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2042-09-05
AI Technical Summary
The elements of different protocol layers in traditional network operations are independent of each other, unable to adapt to diversified routing and layer two network structures, lacking an effective integration mechanism, and it is difficult to obtain end-to-end network connection relationships.
By building an end-to-end three-layer topology model, we obtain the features of the physical layer, logic layer and application layer, determine that these elements are directed graph vertices and edges, construct an adjacency matrix, integrate the application layer, logic layer and physical layer, and realize multi-level network topology integration.
It realizes effective correlation between multi-protocol levels, and builds a multi-level, end-to-end topological system integration, which facilitates the designated network element positioning association paths at any level in network operations, and supports differentiated planning of network operations and rapid fault positioning.
Smart Images

Figure CN115550189B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network communication technologies, and in particular, to a network topology construction method, a network topology construction device, an electronic device, and a storage medium. Background Art
[0002] When a network operates, such as an IP (Internet Protocol) network, it is necessary to start from a certain layer of the network and associate information at different layers. For example, obtain the user information carried based on a certain device; obtain the actual physical routing situation based on two segments of addresses. However, in traditional network operations, the elements of different protocol layers are independent of each other, and mainly target the connection relationships between network devices. Only the connection relationships between physical devices are obtained, relying on specific three-layer routing protocol technologies, and it cannot adapt to diverse routing and two-layer network structures such as policy routing and LSP (Layered Service Provider). There is a lack of an effective integration mechanism between different protocol layers. Summary of the Invention
[0003] In view of the above problems, embodiments of the present invention are proposed to provide a network topology construction method, a network topology construction device, an electronic device, and a storage medium that overcome the above problems or at least partially solve the above problems.
[0004] In one aspect of the present invention, embodiments of the present invention disclose a network topology construction method, which is applied to an end-to-end three-layer topology model. The end-to-end three-layer topology model includes a physical layer, a logical layer, and an application layer. The network topology construction method includes:
[0005] Obtain physical layer elements, logical layer elements, and application layer elements. The physical layer elements include physical entity objects and physical entity relationships. The logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints. The application layer elements include application entity objects, application entity relationships, and application entity constraints.
[0006] Determine the physical entity objects, the logical entity objects, and the application entity objects as directed graph vertices, determine the physical entity relationships, the logical entity relationships, the logical entity constraints, the application entity relationships, and the application entity constraints as directed graph edges, and construct an adjacency matrix.
[0007] Construct a network topology based on the adjacency matrix.
[0008] Optionally, the steps of determining the physical entity object, the logical entity object, and the application entity object as the vertices of a directed graph, determining the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as the edges of the directed graph, and constructing an adjacency matrix include:
[0009] Construct a physical path set matrix based on the physical entity object and the physical entity relationship;
[0010] Construct a logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix;
[0011] Construct an application path set matrix based on the application entity object, the application entity relationship, the application entity constraint, and the logical path set matrix;
[0012] Determine the application path set matrix as the adjacency matrix.
[0013] Optionally, the steps of constructing a logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix include:
[0014] Determine a forwarding path matrix based on the logical entity object and the logical entity relationship;
[0015] Calculate the intersection of the forwarding path matrix and the physical path set matrix to obtain a logical topology matrix;
[0016] Construct a logical entity relationship based on the logical entity object and the logical entity constraint, and determine a logical constraint matrix;
[0017] Add the logical topology matrix and the logical constraint matrix to obtain a logical path set matrix.
[0018] Optionally, the steps of constructing an application path set matrix based on the application entity object, the application entity relationship, the application entity constraint, and the logical path set matrix include:
[0019] Determine an application relationship matrix based on the application entity object and the application entity relationship;
[0020] Assign the logical path set matrix to the application relationship matrix;
[0021] Determine an application constraint matrix based on the application entity object and the application entity constraint; [[ID=4y1]]
[0022] Add the assigned application relationship matrix and the application constraint matrix to obtain an application path set matrix.
[0023] Optionally, the network topology construction method further includes:
[0024] Decompose the adjacency matrix to obtain unidirectional paths;
[0025] Determine a target path according to the unidirectional paths;
[0026] Perform data transmission based on the target path.
[0027] Optionally, the step of determining a target path according to the unidirectional paths includes:
[0028] For any one of the unidirectional paths, perform reachability judgment on the unidirectional path;
[0029] When the unidirectional path is reachable, determine the unidirectional path as a reachable path;
[0030] Determine a target path according to the reachable path.
[0031] Optionally, the reachable path includes multiple reachable sub-paths, and the reachable sub-paths correspond to priority weight values; the step of determining a target path according to the reachable path includes:
[0032] Compare the same-hop reachable sub-paths of different reachable paths, and judge whether the priority weight values corresponding to the reachable sub-paths are the same;
[0033] When the priority weight values corresponding to the reachable sub-paths are the same, increment the hop count, and based on the incremented hop count, execute the step of comparing the same-hop reachable sub-paths of different reachable paths and judging whether the priority weight values corresponding to the reachable sub-paths are the same;
[0034] When the priority weight values corresponding to the reachable sub-paths are different, sort the reachable sub-paths in descending order based on the priority weight values corresponding to the reachable sub-paths, and determine the reachable path where the reachable sub-path ranked first is located as the target path.
[0035] In the second aspect of the present invention, an embodiment of the present invention further discloses a network topology construction device, which is applied to an end-to-end three-layer topology model. The end-to-end three-layer topology model includes a physical layer, a logical layer, and an application layer; the network topology construction device includes:
[0036] An acquisition module, configured to acquire physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints;
[0037] A construction module, configured to determine the physical entity object, the logical entity object, and the application entity object as directed graph vertices, determine the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as directed graph edges, and construct an adjacency matrix;
[0038] A construction module, configured to construct a network topology according to the adjacency matrix.
[0039] In a third aspect of the present invention, an embodiment of the present invention further discloses an electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the steps of the network topology construction method described above are implemented.
[0040] In a fourth aspect of the present invention, an embodiment of the present invention further discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the network topology construction method described above are implemented.
[0041] Embodiments of the present invention include the following advantages:
[0042] Embodiments of the present invention obtain physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints; determine the physical entity object, the logical entity object, and the application entity object as directed graph vertices, determine the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as directed graph edges, and construct an adjacency matrix; construct a network topology according to the adjacency matrix. By integrating the three-layer topology model structure of the end-to-end network in a graph theory manner, the application layer, the logical layer, and the physical layer are integrated, effectively associating multiple protocol layers, and constructing a multi-level, end-to-end topology system integration; in actual network operation, when specifying network elements at any level, the mapping relationship of the three-layer topology can be used to locate the associated end-to-end path elements at each level, facilitating network operation. Description of the Drawings
[0043] Figure 1 is a flowchart of the steps of an embodiment of a network topology construction method of the present invention;
[0044] Figure 2 is a flowchart of the steps of another embodiment of a network topology construction method of the present invention;
[0045] Figure 3 is a schematic diagram of an example of a network topology construction method of the present invention;
[0046] Figure 4 This is a path diagram of an example of a network topology construction method of the present invention. Figure 1 ;
[0047] Figure 5 This is a path diagram of an example of a network topology construction method of the present invention. Figure 2 ;
[0048] Figure 6 This is a path diagram of an example of a network topology construction method of the present invention. Figure 3 ;
[0049] Figure 7 This is a path diagram of an example of a network topology construction method of the present invention. Figure 4 ;
[0050] Figure 8 It is a structural block diagram of an embodiment of a network topology construction device of the present invention. DETAILED DESCRIPTION
[0051] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0052] Reference Figure 1 , shows a step flow chart of an embodiment of a network topology construction method of the present invention, the network topology construction method is applied to an end-to-end three-layer topology model, and the end-to-end three-layer topology model includes a physical layer, a logical layer and an application layer.
[0053] In an embodiment of the present invention, an end-to-end three-layer topology model is defined to include three protocol layers, specifically a physical layer, a logical layer, and an application layer. The three protocol layers of the end-to-end three-layer topology model correspond to the seven protocol layers of the OSI (Open System Interconnection Reference Model). Referring to Table 1, the application layer, presentation layer, session layer, and transport layer in the OSI seven-layer model are defined as application layers in the end-to-end three-layer model; the network layer and data link layer in the OSI seven-layer model are defined as logical layers in the end-to-end three-layer model; and the physical layer in the OSI seven-layer model is defined as the physical layer in the end-to-end three-layer model. Among them, the application layer is used to describe the application path from the client to the server. The logical layer is used to describe the logical forwarding path. The physical layer is used to describe the terminal application path.
[0054]
[0055] Table 1
[0056] The network topology construction method specifically may include the following steps:
[0057] Step 101, obtain physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints;
[0058] Obtain physical layer elements, logical layer elements, and application layer elements from a preset data storage address. The data storage address may be the storage space address of itself or the data storage space address of a third party, and the embodiments of the present invention do not limit this. For the data storage addresses of the physical layer elements, logical layer elements, and application layer elements, they may be the same data storage address, that is, the physical layer elements, logical layer elements, and application layer elements are stored within the same storage space range; at this time, obtain the physical layer elements, logical layer elements, and application layer elements from one data storage address simultaneously. They may also be multiple data storage addresses, that is, the physical layer elements, logical layer elements, and application layer elements are stored in different storage spaces; at this time, obtain the physical layer elements, logical layer elements, and application layer elements from multiple data storage addresses respectively.
[0059] Specifically, the physical layer elements may include physical entity objects and physical entity relationships. The physical entity object is the actual physical device in the physical layer. The physical entity relationship is the set of physical connection relationships between physical entities.
[0060] Specifically, the logical layer elements may include logical entity objects, logical entity relationships, and logical entity constraints. The logical entity object is the entity object in the logical layer. The logical entity relationship is the set of logical connection relationships of the logical entity object. The logical entity constraint is the set of access restriction relationships of the logical entity object during the forwarding process.
[0061] Specifically, the application layer elements may include application entity objects, application entity relationships, and application entity constraints. The application entity object is the entity object in the application layer. The application entity relationship is the set of connection relationships of the application entity object in the application layer. The application entity constraint is the set of access restriction relationships of the application entity object during the transmission process.
[0062] Step 102, determine that the physical entity object, the logical entity object, and the application entity object are the vertices of a directed graph, determine that the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint are the edges of the directed graph, and construct an adjacency matrix;
[0063] In an embodiment of the present invention, based on the graph theory, each entity object among the physical entity objects, logical entity objects, and application entity objects in the physical layer - logical layer - application layer is regarded as a directed graph vertex (directed graph endpoint) in a directed graph. Each of the physical entity relationships, logical entity relationships, logical entity constraints, application entity relationships, and application entity constraints in the physical layer - logical layer - application layer is regarded as a directed graph edge in the directed graph. Connecting the directed graph vertices and the directed graph edges forms a complete directed graph, and the adjacency matrix is an array of the connection relationships between the vertices of the directed graph. Connecting the directed graph vertices and the directed graph edges to form a directed graph is equivalent to constructing the adjacency matrix.
[0064] Step 103, construct a network topology according to the adjacency matrix.
[0065] After constructing the adjacency matrix, the connection relationships corresponding to the physical entity objects, logical entity objects, and application entity objects can be determined through the adjacency matrix. The physical layer elements, logical layer elements, and application layer elements in the end - to - end three - layer topology model are organically connected through the element relationships in the array of the adjacency matrix to construct a network topology.
[0066] In an embodiment of the present invention, by obtaining the physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints; determining that the physical entity objects, the logical entity objects, and the application entity objects are directed graph vertices, determining that the physical entity relationships, the logical entity relationships, the logical entity constraints, the application entity relationships, and the application entity constraints are directed graph edges, constructing an adjacency matrix; constructing a network topology according to the adjacency matrix. By integrating the end - to - end network three - layer topology model structure through the graph theory method, the application layer, logical layer, and physical layer are integrated, realizing the effective association between multiple protocol layers, and constructing a multi - level, end - to - end topology system integration; such that in actual network operation, when specifying any network element at a certain level, the mapping relationship of the three - layer topology can be used to locate the associated end - to - end path elements at each level, facilitating network operation.
[0067] Refer to Figure 2 , which shows a flowchart of the steps of an embodiment of a network topology construction method of the present invention. The network topology construction method is applied to an end - to - end three - layer topology model, and the end - to - end three - layer topology model includes a physical layer, a logical layer, and an application layer. The network topology construction method may specifically include the following steps:
[0068] Step 201, obtain physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints;
[0069] In the embodiments of the present invention, referring to Table 2, the physical elements include physical entity objects and physical entity relationships. Among them, the physical entity object is a terminal entity device, which may include a terminal (E1) and a network device (E2). In practical applications, the terminal (E1) may be a client device, a server device, etc.; the network device (E2) may be a hub, a switch, a router, etc. The physical entity relationship is the connection relationship of the terminal entity device, which may include the interconnection relationship (R1) between the terminal and the network device and the interconnection relationship (R2) of the network device.
[0070] The logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints. Among them, the logical entity object is a service logic entity, which may include a service entity (E’1) and a forwarding entity (E’2). In practical applications, the service entity (E’1) is a set A of terminal IP addresses and a set B of terminal MAC addresses; the forwarding entity (E’2) is a logical port, such as an IP sub-interface, a VLAN (Virtual Local Area Network) virtual interface, an aggregation port, etc. The logical entity relationship is the connection logic relationship of the service logic entity, which may include the dependency (R’1) between the service entity and the forwarding entity, the forwarding relationship (R’2) between the forwarding entities based on a specific service entity, and the reachability (R’3) of the forwarding path between the service entities. In practical applications, the dependency (R’1) between the service entity and the forwarding entity may be described by a VLAN channel, etc.; the forwarding relationship (R’2) between the forwarding entities based on a specific service entity may be described by IP routing, a two- or three-layer VPN (Virtual Private Network) tunnel, NAT (Network Address Translation), etc. The logical entity constraint is the limiting condition of the service logic entity in the access policy, which may include the access control policy (C′) for the service entity in the network layer and the link layer. In practical applications, the access control policy (C’) for the service entity in the network layer and the link layer is the access control based on the IP address (segment) (ip ∈ A) and the access control based on the MAC address (segment) (mac ∈ B).
[0071] The application layer elements include application entity objects, application entity relationships, and application entity constraints. Specifically, the application entity object is an application-side entity device, which may include a client (E”1) and a server (E”2). In practical applications, the client (E”1) can be a PC (Personal Computer) terminal, a mobile phone terminal, a sensor, a cash register, etc.; the server (E”2) can be a server, a website, a mobile phone APP (Application), an Internet of Things platform, etc. The application entity relationship is the connection logic relationship between application entity objects, which may include the path reachability (R”) of the applications of the client and the server. In practical applications, the path reachability (R”) of the applications of the client and the server can be described by the set of logical paths from the client to the server. The application entity constraint is the limiting condition of the application entity object in the access policy, which may include the access control policy (C”) based on the transport layer and above. In practical applications, the access control policy (C”) based on the transport layer and above is the access control based on the TCP (Transmission Control Protocol) / UDP (User Data Protocol) port number, the access control based on the domain name, etc.
[0072]
[0073] Table 2
[0074] For the above physical layer elements, logical layer elements, and application layer elements, they can be determined through the channels of network digital asset collection, physical topology, logical topology, and application topology.
[0075] For network digital asset collection, relevant parameters of network devices can be collected based on the SNMP (Simple Network Management Protocol), and network digital assets such as network device tables, terminal tables, routing tables, IP address tables, ARP (Address Resolution Protocol) tables, MAC address tables, VLAN tables, access control lists, etc. can be obtained through data integration, analysis, and calculation as logical layer elements and application layer elements.
[0076] The physical topology is determined based on the calculation of the second and third layer physical topologies. The second and third layer terminals and network devices can be considered as physical entity objects E1 and E2 in the physical layer elements. Through the second layer physical topology calculation, the MAC address table of the gateway's downstream devices is traversed to calculate the interconnection relationship between the terminal and the second layer device, as well as the interconnection relationship between the second layer devices. And through the third layer physical topology calculation, the ARP address table and IP address table are traversed based on the next hop information in the routing table to calculate the interconnection relationship between the terminal and the gateway, as well as the interconnection relationship between the third layer devices. With the gateway as the connection point, the second layer physical topology and the third layer physical topology are integrated to obtain a complete physical topology for the physical layer. The interconnection relationship between the terminal and the second layer device, and the interconnection relationship between the terminal and the gateway are determined as physical entity relationship R1, and the interconnection relationship between the second layer devices, the interconnection relationship between the third layer devices, and the interconnection relationship between the second and third layer devices are determined as physical entity relationship R2.
[0077] The logical topology is determined based on Layer 2 and Layer 3 logical topology calculations. The terminal's IP address (segment) / MAC address (segment) is determined as logical entity object E'1, and the Layer 2 and Layer 3 logical ports are determined as logical entity object E'2. Through Layer 2 logical topology calculations, the VLAN table is traversed to generate VLAN channels from the terminal to the Layer 2 logical port, as well as VLAN channels between Layer 2 ports. Through Layer 3 logical topology calculations, the logical port is associated with the physical port of its logical entity object. The IP address of the logical port is traversed through the policy routing table and IP routing table to calculate routing channels from the terminal to the Layer 3 logical port, as well as routing channels between Layer 3 logical ports. The VLAN channel from the terminal to the Layer 2 logical port and the routing channels between the terminal and the Layer 3 logical port are determined as logical entity relationship R'1. The VLAN channel between the Layer 2 logical ports and the VLAN channel between the Layer 3 logical ports are determined as logical entity relationship R'2. The combination of logical entity relationship R'1 and logical entity relationship R'2 forms logical entity relationship R'3. Access control at the network and link layers of the OSI model is defined as logical entity constraint C'.
[0078] The application topology is determined based on the client and server ports and protocols. By integrating the server's domain name and protocol port information, and overlaying the access control policies of the transport layer and above on the logical path, the complete application topology from client to server is obtained. The client is identified as application entity object E″1, and the server as application entity object E″2. The logical path is the application entity relationship R″, and the access control policies of the transport layer and above are the application entity constraints C″.
[0079] After determining the physical layer elements, logical layer elements and application layer elements, the physical layer elements, logical layer elements and application layer elements may be stored in a designated address and obtained from the designated address.
[0080] Step 202: Determine the physical entity object, the logical entity object, and the application entity object as the vertices of a directed graph, determine the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as the edges of the directed graph, and construct an adjacency matrix;
[0081] It should be noted that for a directed graph G = (v, e), where v is the set of vertices of the directed graph and e is the set of edges of the directed graph (i.e., the set of ordered pairs of elements in v), the corresponding adjacency matrix of the directed graph is:
[0082] C = [c ij m×n ,
[0083] where i and j are non - zero positive integers.
[0084] In the embodiments of the present invention, the physical entity object, the logical entity object, and the application entity object can be used as the vertices of the directed graph, that is, as the elements in v. After merging the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint, they are determined as the elements in the edges of the directed graph, that is, e. Then, a complete directed graph is formed based on the vertices and edges of the directed graph, and the corresponding critical matrix of the directed graph is constructed.
[0085] Specifically, the step of determining the physical entity object, the logical entity object, and the application entity object as the vertices of the directed graph, determining the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as the edges of the directed graph, and constructing an adjacency matrix may include the following sub - steps:
[0086] Sub - step S2021: Construct a physical path set matrix according to the physical entity object and the physical entity relationship;
[0087] In the embodiments of the present invention, the construction of the directed graph can be first carried out for the physical layer. Taking the physical entity object as the vertex and the physical entity relationship as the edge of the directed graph to determine the directed graph. Since the physical entity relationship includes the interconnection relationship between the terminal and the network device and the interconnection relationship between network devices, and in the physical layer, the terminal and the network device are connected through physical relays, the two relationships need to be added together to obtain a complete directed graph, that is, the two relationships are added together to construct a complete physical path set matrix. Among them, when (v i , v J ) ∈ e, that is, there is an interconnection physical relay between network devices or from the terminal to the network device, then the matrix term r ij = 1, otherwise it is 0. And the matrix is a numerical representation of the connection, that is, the physical path set matrix is PhyPath = R1 + R2.
[0088] Sub-step S2022: Construct a logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix.
[0089] For the logical layer, it depends on the physical layer. After obtaining the physical path set matrix, it can be incorporated into the construction of the logical layer. The logical entity object can be used as vertices, and the logical entity relationship and logical entity constraint as edges to construct a directed graph. By combining with the directed graph of the physical layer (i.e., the physical path set matrix), a complete directed graph of the logical layer is constructed, and the corresponding logical path set matrix is obtained.
[0090] Further, the step of constructing the logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix may include the following sub-steps:
[0091] Sub-step S20221: Determine the forwarding path matrix based on the logical entity object and the logical entity relationship.
[0092] In practical applications, a directed graph can be constructed with the logical entity object as the vertices of the directed graph and the logical entity relationship as the edges of the directed graph to obtain the corresponding matrix, i.e., the forwarding path matrix. Specifically, in the logical layer, the business entity is a set of IP addresses or MAC addresses of terminals or servers. The forwarding entity is the logical interface of network devices. The business entity depends on the directly connected forwarding entity, and the forwarding entities will forward data according to the target address of a specific business entity. There are many business entities in the network, and a specific business entity refers to the two-end business entities from end a to end b. It can be assumed that when (v i , v J ) ∈ e, that is, there is a logical interconnection relationship between forwarding entities or between a forwarding entity and a business entity, then r′ ij = 1, otherwise 0, to obtain the matrix R’1 of the dependence between the business entity and the forwarding entity and the matrix R’2 of the forwarding relationship between the forwarding entities based on a specific business entity. And the path reachability is jointly determined by the dependence and forwarding relationship between the business entity and the forwarding entity, that is, the path reachability matrix R′3 is the combination of R’1 and R'2, and the forwarding path matrix should satisfy the reachability, that is, the forwarding path matrix is the path reachability matrix R′3 = R’1 + R’2.
[0093] Sub-step S20222: Calculate the intersection of the forwarding path matrix and the physical path set matrix to obtain the logical topology matrix.
[0094] Since the forwarding path can only be actually sent when there is a physical path, there is a situation where the forwarding path lacks a corresponding physical path, and a complete logical topology requires substantial forwarding paths to form. Therefore, the intersection of the forwarding path matrix and the physical path set matrix can be calculated, and this intersection is determined as the logical topology matrix, that is, the logical topology matrix LogiTopo = PhyPath ∩ R′3.
[0095] Sub-step S20223, construct logical entity relationships based on the logical entity objects and the logical entity constraints, and determine the logical constraint matrix;
[0096] In the embodiment of the present invention, the logical entity objects can be used as the vertices of a directed graph, and the logical entity constraints as the edges of the directed graph, obtaining a directed graph of logical entity constraints, where control is based on IP or MAC addresses. According to the access control list, if access is denied, then the matrix entry c′ ij =-1 in the direction of the destination IP of the device, otherwise it is 0. Determine the logical constraint matrix C′ corresponding to the directed graph. It should be noted that in business entities, not all constraint conditions are necessarily satisfied. Therefore, business entities can be decomposed to obtain multiple separate logical constraint sub-matrices, and the complete logical constraint matrix is obtained through the integration of multiple logical constraint sub-matrices.
[0097] Sub-step S20224, add the logical topology matrix and the logical constraint matrix to obtain the logical path set matrix.
[0098] In the topology of the logical layer, both entity connections and entity constraints exist simultaneously. Therefore, the logical topology matrix and the logical constraint matrix need to be added together to obtain the complete logical path set matrix, that is, the logical path set matrix LogiPath = LogiTopo + C′.
[0099] Sub-step S2023, construct an application path set matrix based on the application entity objects, the application entity relationships, the application entity constraints, and the logical path set matrix;
[0100] In the embodiment of the present invention, the application entity objects can be used as the vertices of a directed graph, and the application entity relationships and the application entity constraints respectively form directed graph edges to obtain a directed graph, and the corresponding adjacency matrix is obtained; and on the basis of this adjacency matrix, combined with the logical path set matrix, the application path set matrix is obtained.
[0101] Furthermore, the step of constructing an application path set matrix based on the application entity objects, the application entity relationships, the application entity constraints, and the logical path set matrix may include the following sub-steps:
[0102] Sub-step S20231: Determine the application relationship matrix according to the application entity object and the application entity relationship.
[0103] In the embodiment of the present invention, first, the application entity object is used as the directed graph vertex, and the application entity relationship is used as the directed graph edge to form a directed graph, and the application relationship matrix R″ corresponding to the directed graph is determined.
[0104] Sub-step S20232: Assign the logical path set matrix to the application relationship matrix.
[0105] Since the application entity relationship between application entity objects is based on the logical path, that is, the logical path set corresponds to the application entity relationship. The logical path set matrix can be assigned to the application relationship matrix, that is, the application relationship matrix R″ = LogiPath.
[0106] Sub-step S20233: Determine the application constraint matrix according to the application entity object and the application entity constraint.
[0107] In the embodiment of the present invention, the application entity object can also be used as the directed graph vertex, and the application entity constraint can be used as the directed graph edge to form a directed graph. Among them, by performing protocol port or domain name access control at the transport layer and above, according to the access control list, if access is denied, then the matrix item c″ in the direction of the device to the destination port or domain name ij = -1, otherwise it is 0, and the matrix of the directed graph is determined, that is, the application constraint matrix is determined.
[0108] Sub-step S20234: Add the assigned application relationship matrix and the application constraint matrix to obtain the application path set matrix.
[0109] Since there are both forwarding constraint conditions and application entity relationships in the application layer, therefore, the complete topology of the application layer is composed of these two parts together. The assigned application relationship matrix and the application constraint matrix can be added to obtain the application path set matrix, that is, the application path set matrix AppPath = R″ + C″.
[0110] Sub-step S2024: Determine that the application path set matrix is the adjacency matrix.
[0111] The application path set matrix is obtained by associating and merging various elements in the three-layer protocol layer. Therefore, it can be determined that the application path set matrix is the connection relationship array structure of the network topology structure, that is, the application path set matrix is used as the adjacency matrix of the network topology structure.
[0112] Step 203: Construct the network topology according to the adjacency matrix.
[0113] After determining the adjacency matrix, which represents the connection relationships among nodes in the network topology, the network topology can be constructed based on the connection relationships in the adjacency matrix. That is, the adjacency matrix is the union of reachable paths.
[0114] Step 204: Decompose the adjacency matrix to obtain unidirectional paths.
[0115] After constructing the network topology, when data transmission is to be performed using this network, the adjacency matrix can be decomposed, that is, the union of all reachable paths is decomposed into multiple independent unidirectional paths.
[0116] Specifically, based on the principle of topological sorting, in the adjacency matrix, the starting vertex of a specified path is the starting point of the traffic direction; the vertices with an in-degree of 0 among the non-starting vertices are deleted; these two steps are repeated until there are no vertices with an in-degree of 0, and a unidirectional path is obtained. Then, repeat the steps of determining the unidirectional path to decompose all unidirectional paths from the adjacency matrix.
[0117] Step 205: Determine the target path according to the unidirectional paths.
[0118] After obtaining multiple unidirectional paths, due to the limitations of the path priority or path reachability corresponding to each unidirectional path, therefore, the target path can be determined from the multiple unidirectional paths according to the path priority or path reachability of the unidirectional paths.
[0119] Specifically, the step of determining the target path according to the unidirectional paths may include the following sub-steps:
[0120] Sub-step S2051: For any one of the unidirectional paths, judge the reachability of the unidirectional path.
[0121] For one of the multiple unidirectional paths, judge the reachability of this unidirectional path. Specifically, it can be determined whether the vertices of this unidirectional path are the same as the preset vertices, and whether the head and tail vertices can be connected through any endpoints between the two ends.
[0122] Sub-step S2052: When the unidirectional path has reachability, determine the unidirectional path as a reachable path.
[0123] When the head and tail vertices of this unidirectional path are connected through any endpoints between the two ends, it means that this unidirectional path is reachable, this unidirectional path meets the reachability, and determine this unidirectional path as a reachable path.
[0124] Sub-step S2053: Determine the target path according to the reachable path.
[0125] The obtained reachable paths indicate that these reachable paths all correspond to complete transmission links for transmission; furthermore, the priorities of the reachable paths can be judged to determine the target path.
[0126] Furthermore, the reachable paths include multiple reachable sub-paths, and the reachable sub-paths correspond to priority weight values; the step of determining the target path according to the reachable paths includes:
[0127] Sub-step S20531: Compare the same-hop reachable sub-paths of different reachable paths to judge whether the priority weight values corresponding to the reachable sub-paths are the same;
[0128] In practical applications, a single reachable path has multiple reachable sub-paths, and each hop of the reachable sub-path will be affected by performance overhead, routing policies, etc., so that each hop of the reachable sub-path has different priority weight values. In practical applications, the priority can be assigned to each hop of the reachable sub-path in the unidirectional path in advance according to the priority. The higher the weight value, the higher the priority.
[0129] According to the traffic direction, for the same hop count, compare the same-hop reachable sub-paths of different reachable paths to judge whether the priority weight values corresponding to the reachable sub-paths are the same.
[0130] Sub-step S20532: When the priority weight values corresponding to the reachable sub-paths are the same, increment the hop count, and based on the incremented hop count, execute the step of comparing the same-hop reachable sub-paths of different reachable paths to judge whether the priority weight values corresponding to the reachable sub-paths are the same;
[0131] When the priority weight values corresponding to the reachable sub-paths of each reachable path are the same at this hop count, that is, they have the same priority, it is impossible to determine the reachable path with a higher priority as the target path. The hop count can be incremented by one, and then the priority weight values of the reachable sub-paths of the next hop count can be compared again for round-robin comparison until the priority weight values are different.
[0132] Sub-step S20533: When the priority weight values corresponding to the reachable sub-paths are different, sort the reachable sub-paths in descending order based on the priority weight values corresponding to the reachable sub-paths, and determine the reachable path where the reachable sub-path ranked first is located as the target path.
[0133] When, at the same hop count, the priority weight values corresponding to the reachable sub-paths of the same hop in all reachable paths are different, that is, the priorities of the reachable sub-paths at this hop count will be different. The reachable sub-paths can be sorted in descending order according to the size of the priority weight values, and the reachable path where the first reachable sub-path after sorting is located is determined as the target path. Among them, when there are two or more reachable sub-paths whose corresponding priority weight values are all the first in the descending order, the priority weight values corresponding to the reachable sub-paths of the next hop count of these reachable sub-paths can be compared separately until the priority weight value of the first reachable sub-path only corresponds to one reachable sub-path, and the reachable path where this reachable sub-path is located is determined as the target path. That is, through round-robin comparison, it is screened out that the priority of a certain hop in a reachable path is higher than the priority of the corresponding hop count in other reachable paths, and this reachable path is preferentially selected as the target path.
[0134] Step 206, perform data transmission based on the target path.
[0135] After obtaining the target path, use this target path for data transmission to implement the network transmission function.
[0136] In the embodiment of the present invention, by obtaining physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints; determining the physical entity objects, the logical entity objects, and the application entity objects as the vertices of the directed graph, and determining the physical entity relationships, the logical entity relationships, the logical entity constraints, the application entity relationships, and the application entity constraints as the edges of the directed graph to construct an adjacency matrix; constructing a network topology based on the adjacency matrix; decomposing the adjacency matrix to obtain one-way paths; determining a target path based on the one-way paths; and performing data transmission based on the target path. By abstracting network elements and integrating the overall topology according to the graph theory method independent of the protocol, the specific network architecture and network protocol method are loosely coupled, and differential calculations can be realized by combining network characteristics such as route aggregation and route priority. On this basis, global policy rules are integrated to realize the overall analysis of the whole network configuration policy; the application, logical, and physical layers are integrated to realize the effective association between multiple protocol layers, and a multi-level, end-to-end topology system integration is constructed. In actual network operation, only by specifying network elements at any level, the mapping relationship of the three-level topology can be used; the associated end-to-end path elements at each level can be located, which is convenient for realizing functions such as application-differentiated network overall planning, service risk assessment, and fast fault location analysis starting from application requirements in the later IP network operation process.
[0137] To enable those skilled in the art to better understand the embodiments of the present invention, the embodiments of the present invention will be described below through an example:
[0138] Referring to Figure 3 , a schematic diagram showing an example of a network topology construction method of the present invention is shown;
[0139] 1. Definition of three network layers and classification definition of basic elements
[0140] This part can refer to the above embodiments. The end-to-end three-layer topology model includes three protocol layers, namely the physical layer, the logical layer, and the application layer. The elements of the physical layer include terminal entity devices and physical entity relationships. The terminal entity devices are terminals (E1) and network devices (E2); the physical entity relationships are the interconnection relationship between the terminal and the network device (R1) and the interconnection relationship between network devices (R2). The elements of the logical layer include logical entity objects, logical entity relationships, and logical entity constraints. The logical entity objects are service entities (E’1) and forwarding entities (E’2); the logical entity relationships are the dependency between the service entity and the forwarding entity (R’1), the forwarding relationship between forwarding entities based on a specific service entity (R’2), and the reachability of the forwarding path between service entities (R’3); the logical entity constraints are access control policies (C′) for service entities in the network layer and the link layer. The elements of the application layer include application entity objects, application entity relationships, and application entity constraints.
[0141] 2. Integration and association of elements of the three network layers
[0142] Taking Figure 4 as an example for illustration, where a is the client, b is the server, A, B, C, D, and E are switch / router devices, and the connection lines represent the existence of physical relays between both ends. The traffic direction is taken as from a to b. According to this topological relationship, there are 7 points in the directed graph, and a 7x7 adjacency matrix can be constructed.
[0143] Assume that the IP segment of service entity a is a, and the IP segment of service entity b is b. Service entities or forwarding entities with physical interconnection relationships are considered to be associated with each other. An access control list is configured on device D: specifically, the control list rejects the source IP included in the a1 (a1 ∈ a) segment and accesses the destination IP included in the b1 (b1 ∈ b) segment.
[0144] In the application layer, there are access control conditions based on protocol port numbers or domain names, rejecting the data that meets the conditions from being forwarded to C via device E.
[0145] First, integrate the elements of the physical layer.
[0146] From Figure 4 of the figure, the matrices of R1 and R2 can be obtained:
[0147]
[0148] The matrix of the physical path set is the sum of the matrices of R1 and R2, that is:
[0149]
[0150] That is, based on the matrix of the physical path set, a directed graph as shown in Figure 5 is obtained, and this directed graph shows the physical layer topology between vertices.
[0151] After completing the physical layer topology, the topology of the logical layer is constructed based on the physical layer topology.
[0152] The relationship adjacency matrix R′1 between the service entities and forwarding entities in the logical layer and the forwarding relationship adjacency matrix R′2 between the forwarding entities based on specific service entities are:
[0153]
[0154] The forwarding path matrix is the sum of R′1 and R′2, and we can get:
[0155]
[0156] The actually existing logical topology adjacency matrix is the intersection of the forwarding path matrix and the physical path set matrix, that is:
[0157]
[0158] Based on the foregoing application layer constraint conditions, the logical constraint matrix can be obtained as:
[0159]
[0160]
[0161] Adding the logical topology matrix and the logical constraint matrix, the logical path set matrix is obtained:
[0162]
[0163] Based on this logical path set matrix, Figure 6 , the topology structure of the logical layer can be obtained. Among them, the left side is the directed graph corresponding to the service entity not meeting the logical layer access constraints, and the right side is the directed graph corresponding to the service entity meeting the logical layer access constraints.
[0164] Finally, calculating the application layer topology based on the logical layer topology, the adjacency matrix corresponding to the topology of the entire network is obtained.
[0165] The application relationship matrix is the same as the logical path set matrix, that is, the application relationship matrix is:
[0166] R″ = LogiPath
[0167] According to the application layer constraint conditions, the constraint adjacency matrix is as follows:
[0168]
[0169]
[0170] By adding the application relationship matrix and the application constraint matrix, the application path set matrix can be obtained as follows:
[0171]
[0172] 3. Decomposition of the application layer path set (application path set matrix)
[0173] Taking the application path set that does not meet the logic layer constraints but meets the application layer constraints as an example for path decomposition, and then combining with the preset weight value of each sub-path, the directed graph can be obtained Figure 7 as follows.
[0174] By sorting and decomposing the application paths, 3 application paths can be obtained, which are respectively
[0175] Path 1: a → A → B → C → b;
[0176] Path 2: a → A → D → C → b;
[0177] Path 3: a → A → E;
[0178] By performing path reachability judgment, it can be known that Path 1 and Path 2 are reachable paths, and Path 3 is an unreachable path.
[0179] Then, calculate the priorities of Path 1 and Path 2. Comparing the weights of the first edges passed by Path 1 and Path 2, both are 1; then comparing the weights of the second edges passed by Path 1 and Path 2, the weight of the second edge of Path 1 is 2, and the weight of the second edge of Path 2 is 3. Therefore, Path 2 is preferentially selected. Determine Path 2 as the target path for data transmission.
[0180] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequence, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential for the embodiments of the present invention.
[0181] Refer to Figure 8, showing a structural block diagram of an embodiment of a network topology construction device of the present invention. The network topology construction device is applied to an end-to-end three-layer topology model, and the end-to-end three-layer topology model includes a physical layer, a logical layer, and an application layer; the network topology construction device may specifically include the following modules:
[0182] An acquisition module 801, configured to acquire physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints;
[0183] A construction module 802, configured to determine the physical entity objects, the logical entity objects, and the application entity objects as directed graph vertices, determine the physical entity relationships, the logical entity relationships, the logical entity constraints, the application entity relationships, and the application entity constraints as directed graph edges, and construct an adjacency matrix;
[0184] A construction module 803, configured to construct a network topology according to the adjacency matrix.
[0185] In an optional embodiment of the present invention, the construction module 802 includes:
[0186] A first matrix construction sub-module, configured to construct a physical path set matrix according to the physical entity objects and the physical entity relationships;
[0187] A second matrix construction sub-module, configured to construct a logical path set matrix according to the logical entity objects, the logical entity relationships, the logical entity constraints, and the physical path set matrix;
[0188] A third matrix construction sub-module, configured to construct an application path set matrix according to the application entity objects, the application entity relationships, the application entity constraints, and the logical path set matrix;
[0189] A determination sub-module, configured to determine the application path set matrix as the adjacency matrix.
[0190] In an optional embodiment of the present invention, the second matrix construction sub-module includes:
[0191] A first matrix determination unit, configured to determine a forwarding path matrix according to the logical entity objects and the logical entity relationships;
[0192] A first calculation unit, configured to calculate the intersection of the forwarding path matrix and the physical path set matrix to obtain a logical topology matrix;
[0193] A second matrix determination unit, configured to construct a logical entity relationship based on the logical entity object and the logical entity constraint, and determine a logical constraint matrix;
[0194] A first matrix addition module, configured to add the logical topology matrix and the logical constraint matrix to obtain a logical path set matrix.
[0195] In an optional embodiment of the present invention, the third matrix construction sub-module includes:
[0196] A third matrix determination unit, configured to determine an application relationship matrix based on the application entity object and the application entity relationship;
[0197] An assignment unit, configured to assign the logical path set matrix to the application relationship matrix;
[0198] A fourth matrix determination unit, configured to determine an application constraint matrix based on the application entity object and the application entity constraint;
[0199] A second matrix addition module, configured to add the assigned application relationship matrix and the application constraint matrix to obtain an application path set matrix.
[0200] In an optional embodiment of the present invention, the network topology construction device further includes:
[0201] A decomposition module, configured to decompose the adjacency matrix to obtain a unidirectional path;
[0202] A target path determination module, configured to determine a target path based on the unidirectional path;
[0203] A transmission module, configured to perform data transmission based on the target path.
[0204] In an optional embodiment of the present invention, the target path determination module includes:
[0205] A judgment sub-module, configured to perform reachability judgment on any one of the unidirectional paths;
[0206] A reachable path determination sub-module, configured to determine the unidirectional path as a reachable path when the unidirectional path has reachability;
[0207] A target path determination sub-module, configured to determine a target path based on the reachable path.
[0208] ]>In an optional embodiment of the present invention, the reachable path includes multiple reachable sub-paths, and the reachable sub-paths correspond to priority weight values; the target path determination sub-module includes:
[0209] A judgment unit, configured to compare the same-hop reachable sub-paths of different reachable paths, and judge whether the priority weight values corresponding to the reachable sub-paths are the same;
[0210] An update unit, configured to, when the priority weight values corresponding to the reachable sub-paths are the same, increment the hop count, and based on the incremented hop count, perform the step of comparing the same-hop reachable sub-paths of different reachable paths to judge whether the priority weight values corresponding to the reachable sub-paths are the same;
[0211] A target path determination unit, configured to, when the priority weight values corresponding to the reachable sub-paths are different, sort the reachable sub-paths in descending order based on the priority weight values corresponding to the reachable sub-paths, and determine the reachable path where the reachable sub-path ranked first is located as the target path.
[0212] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the partial description of the method embodiment.
[0213] An embodiment of the present invention further provides an electronic device, including:
[0214] A processor and a storage medium, where the storage medium stores a computer program executable by the processor. When the electronic device runs, the processor executes the computer program to perform the method according to any one of the embodiments of the present invention. The specific implementation manners and technical effects are similar to those of the method embodiment, and will not be described in detail here.
[0215] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it performs the method according to any one of the embodiments of the present invention. The specific implementation manners and technical effects are similar to those of the method embodiment, and will not be described in detail here.
[0216] Each embodiment in this specification is described in a progressive manner. The key points of each embodiment are the differences from other embodiments. The same or similar parts among the embodiments may be referred to each other.
[0217] Those skilled in the art should understand that the embodiments of the present invention may be provided as a method, a device, or a computer program product. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0218] Embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal devices generate means for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0219] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including instruction means, and the instruction means implement the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0220] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device, so that a series of operation steps are executed on the computer or other programmable terminal device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or means for implementing the functions specified in multiple blocks.
[0221] Although the preferred embodiments of the embodiments of the present invention have been described, those skilled in the art can make additional changes and modifications to these embodiments once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed as including the preferred embodiments and all changes and modifications falling within the scope of the embodiments of the present invention.
[0222] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or terminal device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or terminal device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
[0223] The above has introduced in detail a network topology construction method, device, electronic device and storage medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A method for constructing a network topology, characterized in that, Applied to an end-to-end three-layer topology model, the end-to-end three-layer topology model includes a physical layer, a logical layer, and an application layer. The end-to-end three-layer topology model has a corresponding relationship with the OSI seven-layer model. Among them, the application layer in the end-to-end three-layer topology model corresponds to the application layer, presentation layer, session layer, and transport layer in the OSI seven-layer model. The application layer in the end-to-end three-layer topology model is used to depict the application path from the client to the server; the logical layer in the end-to-end three-layer topology model corresponds to the network layer and data link layer in the OSI seven-layer model. The logical layer in the end-to-end three-layer topology model is used to depict the logical forwarding path; the physical layer in the end-to-end three-layer topology model corresponds to the physical layer in the OSI seven-layer model. The physical layer in the end-to-end three-layer topology model is used to depict the terminal application path and physical connection; The network topology construction method includes: Obtain physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints; Determine the physical entity objects, logical entity objects, and application entity objects as directed graph vertices, determine the physical entity relationships, logical entity relationships, logical entity constraints, application entity relationships, and application entity constraints as directed graph edges, and construct an adjacency matrix; Construct a network topology based on the adjacency matrix; The step of determining the physical entity objects, logical entity objects, and application entity objects as directed graph vertices, determining the physical entity relationships, logical entity relationships, logical entity constraints, application entity relationships, and application entity constraints as directed graph edges, and constructing an adjacency matrix includes: constructing a physical path set matrix based on the physical entity objects and the physical entity relationships; constructing a logical path set matrix based on the logical entity objects, logical entity relationships, logical entity constraints, and the physical path set matrix; constructing an application path set matrix based on the application entity objects, application entity relationships, application entity constraints, and the logical path set matrix; determining the application path set matrix as the adjacency matrix; The step of constructing an application path set matrix based on the application entity objects, application entity relationships, application entity constraints, and the logical path set matrix includes: determining an application relationship matrix based on the application entity objects and the application entity relationships; assigning the logical path set matrix to the application relationship matrix; determining an application constraint matrix based on the application entity objects and the application entity constraints; adding the assigned application relationship matrix to the application constraint matrix to obtain the application path set matrix.
2. The method according to claim 1, wherein The steps of determining the physical entity object, the logical entity object, and the application entity object as the vertices of a directed graph, determining the physical entity relationship, the logical entity relationship, the logical entity constraint, the application entity relationship, and the application entity constraint as the edges of the directed graph, and constructing an adjacency matrix include: Construct a physical path set matrix based on the physical entity object and the physical entity relationship; Construct a logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix; Construct an application path set matrix based on the application entity object, the application entity relationship, the application entity constraint, and the logical path set matrix; Determine the application path set matrix as the adjacency matrix.
3. The method according to claim 2, characterized in that, The steps of constructing a logical path set matrix based on the logical entity object, the logical entity relationship, the logical entity constraint, and the physical path set matrix include: Determine a forwarding path matrix based on the logical entity object and the logical entity relationship; Calculate the intersection of the forwarding path matrix and the physical path set matrix to obtain a logical topology matrix; Construct a logical entity relationship based on the logical entity object and the logical entity constraint, and determine a logical constraint matrix; Add the logical topology matrix and the logical constraint matrix to obtain a logical path set matrix; The steps of constructing an application path set matrix based on the application entity object, the application entity relationship, the application entity constraint, and the logical path set matrix include: Determine an application relationship matrix based on the application entity object and the application entity relationship; Assign the logical path set matrix to the application relationship matrix; Determine an application constraint matrix based on the application entity object and the application entity constraint; Add the assigned application relationship matrix and the application constraint matrix to obtain an application path set matrix.
4. The method according to claim 1, wherein The network topology construction method further includes: Decompose the adjacency matrix to obtain a unidirectional path; Determine a target path based on the unidirectional path; Perform data transmission based on the target path.
5. The method according to claim 4, characterized in that The steps of determining a target path based on the unidirectional path include: For any one of the unidirectional paths, perform reachability judgment on the unidirectional path; When the unidirectional path has reachability, determine the unidirectional path as a reachable path; Determine a target path based on the reachable path.
6. The method according to claim 5, characterized in that, The reachable path includes multiple reachable sub-paths, and the reachable sub-paths correspond to priority weight values; the steps of determining a target path based on the reachable path include: Compare the same-hop reachable sub-paths of different reachable paths, and judge whether the priority weight values corresponding to the reachable sub-paths are the same; When the priority weight values corresponding to the reachable sub-paths are the same, increment the hop count, and based on the incremented hop count, execute the step of comparing the same-hop reachable sub-paths of different reachable paths and judging whether the priority weight values corresponding to the reachable sub-paths are the same; When the priority weight values corresponding to the reachable sub-paths are different, sort the reachable sub-paths in descending order based on the priority weight values corresponding to the reachable sub-paths, and determine the reachable path where the reachable sub-path ranked first is located as the target path.
7. A network topology construction device, characterized in that, Applied to an end-to-end three-layer topology model, the end-to-end three-layer topology model includes a physical layer, a logical layer, and an application layer; the end-to-end three-layer topology model has a corresponding relationship with the OSI seven-layer model, where the application layer in the end-to-end three-layer topology model corresponds to the application layer, presentation layer, session layer, and transport layer in the OSI seven-layer model, and the application layer in the end-to-end three-layer topology model is used to depict the application path from the client to the server; the logical layer in the end-to-end three-layer topology model corresponds to the network layer and data link layer in the OSI seven-layer model, and the logical layer in the end-to-end three-layer topology model is used to depict the logical forwarding path; the physical layer in the end-to-end three-layer topology model corresponds to the physical layer in the OSI seven-layer model, and the physical layer in the end-to-end three-layer topology model is used to depict the terminal application path and physical connection. The network topology construction device includes: An acquisition module, configured to acquire physical layer elements, logical layer elements, and application layer elements; the physical layer elements include physical entity objects and physical entity relationships, the logical layer elements include logical entity objects, logical entity relationships, and logical entity constraints, and the application layer elements include application entity objects, application entity relationships, and application entity constraints. A construction module, configured to determine the physical entity objects, the logical entity objects, and the application entity objects as directed graph vertices, determine the physical entity relationships, the logical entity relationships, the logical entity constraints, the application entity relationships, and the application entity constraints as directed graph edges, and construct an adjacency matrix. The construction module includes; A first matrix construction sub-module, configured to construct a physical path set matrix according to the physical entity objects and the physical entity relationships. A second matrix construction sub-module, configured to construct a logical path set matrix according to the logical entity objects, the logical entity relationships, the logical entity constraints, and the physical path set matrix. A third matrix construction sub-module, configured to construct an application path set matrix according to the application entity objects, the application entity relationships, the application entity constraints, and the logical path set matrix. A determination sub-module, configured to determine the application path set matrix as the adjacency matrix. The third matrix construction sub-module includes: A third matrix determination unit, configured to determine an application relationship matrix according to the application entity objects and the application entity relationships. An assignment unit, configured to assign values to the application relationship matrix using the logical path set matrix. A fourth matrix determination unit, configured to determine an application constraint matrix according to the application entity objects and the application entity constraints. A second matrix addition module, configured to add the assigned application relationship matrix and the application constraint matrix to obtain an application path set matrix. A construction module, configured to construct a network topology according to the adjacency matrix.
8. An electronic device, characterized in that, Comprising a processor, a memory, and a computer program stored on the memory and capable of running on the processor, the steps of the network topology construction method according to any one of claims 1 to 6 are implemented when the computer program is executed by the processor.
9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and the steps of the network topology construction method according to any one of claims 1 to 6 are implemented when the computer program is executed by the processor.
Citation Information
Patent Citations
Compiler for and method of software defined networking, storage and compute determining physical and virtual resources
US20170310574A1