A method and system for building system architecture topology in real time

By real-time scanning the network connection between the system and external systems or technical components, the system topology relationship is constructed, which solves the problem of difficult monitoring of architecture corruption in the evolution of business systems, and enables accurate understanding of system interactions and architecture monitoring.

CN116016196BActive Publication Date: 2024-10-11SICHUAN XW BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211605125.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-14
Publication Date
2024-10-11
Estimated Expiration
2042-12-14

AI Technical Summary

Technical Problem

As business systems continue to evolve, it is difficult to know exactly which external systems or technical components the system interacts with and whether the architecture has become corrupted.

Method used

By scanning the network connections between the system and external systems or technical components in real time based on Linux commands, we build topological relationships between systems and systems and between systems and technical components. We use the configuration management database to store the configuration information of IT architecture equipment and store it in the virtual environment. Execute the scanning script on the machine to obtain the network connection and process collection, update the network connection collection, and construct the resource nodes and access relationships of the network topology.

Benefits of technology

It realizes real-time understanding of the interaction between the system and external systems or technical components, promptly grasps whether the system architecture is corrupted, and provides an accurate display of system topology relationships.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016196B_ABST
    Figure CN116016196B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for constructing a system architecture topology in real time, constructing a configuration management database, executing a monitoring script command on each virtual machine to obtain a network connection and a process set, assembling the network connection and process set of each virtual machine to obtain a network connection set R1; querying the name of the system to which each IP belongs from the configuration management database, and updating the network connection in the network connection set R1 to obtain a network connection set R2; searching for connections whose local port types are client ports and server ports, respectively, constructing a resource node set V of the network topology and an edge set E of the resource access relationship; and displaying the topological relationship of the resource nodes on a page. This solution scans the network connections existing between the system and external systems or technical components in real time, and constructs the topological relationship between the system and the system, and between the system and the technical components; it is convenient to timely and accurately know which external systems or technical components the system is interacting with, and to understand whether the system architecture has been corrupted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a method and system for constructing a system architecture topology in real time. Background Art

[0002] A business system is usually deployed on multiple servers in the form of a cluster. During system operation, it will interact with other external business systems and technical components. As the business system continues to evolve, it is difficult for us to accurately know which external systems or technical components the system is interacting with and whether the architecture has been corrupted. Summary of the invention

[0003] The technical problem to be solved by the present invention is: as the business system continues to evolve, it is difficult for us to accurately know which external systems or technical components the system is interacting with, and whether the architecture has been corrupted. The purpose of the present invention is to provide a method and system for building a system architecture topology in real time, which scans the network connections between a system and external systems or technical components in real time based on Linux commands, and builds the topological relationship between systems and systems, and between systems and technical components.

[0004] The present invention is achieved through the following technical solutions:

[0005] This solution provides a method for building a system architecture topology in real time, including:

[0006] Build a configuration management database to store configuration information of all devices in the IT architecture, including virtual machines occupied by the system and their IP addresses;

[0007] Execute the scanning script on each virtual machine to obtain the network connection and process set, and assemble the network connection and process set of each virtual machine to obtain the network connection set R1;

[0008] Query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2;

[0009] Update each network connection in the network connection set R2, and record the updated network connection set R2 in the network connection database; respectively search for connections whose local port types are client ports and server ports, and construct a resource node set V of the network topology and an edge set E of resource access relations;

[0010] Display the topological relationship of resource nodes on the page.

[0011] Working principle of this solution: As business systems continue to evolve, it is difficult for us to accurately know which external systems or technical components the system is interacting with, and whether the architecture has been corrupted. The purpose of the present invention is to provide a method and system for building a system architecture topology in real time. Based on Linux commands, the network connections between a system and external systems or technical components are scanned in real time, and the topological relationships between systems and systems, and between systems and technical components are built, so as to timely and accurately know which external systems or technical components the system is interacting with, and to understand whether the system architecture has been corrupted.

[0012] A further optimization scheme is that the network connection and process set includes: a process set L obtained by executing a scanning process script, a network connection five-tuple set M obtained by executing a network connection scanning script, and a listening port set N obtained by executing a network listening port script.

[0013] A further optimization scheme is that the process set L includes the attributes: ip, cmd, pid and processType;

[0014] The network connection quintuple set M includes attributes: localIp, localPort, foreignIp, foreignPort and pid;

[0015] The listening port set N includes attributes pid and port.

[0016] A further optimization scheme is that the method for obtaining the network connection set R1 includes:

[0017] S1: According to the pid of the network connection, find the process Li with the same pid in the process set L and get its process type T;

[0018] S2: According to the pid and localPort of the network connection, find out whether there is a record with the same pid and localPort in the listening port set N. If so, the current localPort is the server port of the network connection, otherwise the current localPort is the client port of the network connection;

[0019] S3: Update the network connection quintuple set M according to the process type and listening port type obtained by S1 and S2.

[0020] A further optimization scheme is that the method for updating each network connection in the network connection set R2 includes:

[0021] In the network connection set R2, for each network connection, use its localIp and localPort to update the foreignProcessType of other network connections whose foreignIp is equal to localIp and whose foreignPort is equal to localPort to localProcessType.

[0022] A further optimization scheme is that the construction method of the resource node set V of the network topology and the edge set E of the resource access relationship includes:

[0023] T1: Search the network connections whose local port types are client ports and server ports in the network connection set R2, build resource nodes based on the application name and process type, and determine the resource node access relationship based on the port type access relationship between the resource nodes;

[0024] T2: Merge the same resource nodes and edges to obtain a unique resource node set V and resource node access relationship set E.

[0025] The present solution also provides a system for constructing a system architecture topology in real time, which is used to implement the method for constructing a system architecture topology in real time described in the above solution, including:

[0026] A construction module is used to construct a configuration management database, which is used to store configuration information of all devices in the IT architecture, including information such as virtual machines occupied by the system and their IP addresses;

[0027] An execution module, used for executing a scanning script on each virtual machine to obtain a network connection and a process set, and assembling the network connection and process set of each virtual machine to obtain a network connection set R1;

[0028] The first operation module is used to query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2;

[0029] The second operation module is used to update each network connection in the network connection set R2 and record the updated network connection set R2 in the network connection database; respectively search for connections whose local port types are client ports and server ports, and construct a resource node set V of the network topology and an edge set E of resource access relations;

[0030] The display module is used to display the topological relationship of resource nodes on the page.

[0031] A further optimization scheme is that the first operation module is an architecture topology construction server, and the architecture topology construction server queries the name of the system to which each IP belongs from the configuration management database, and updates the network connection in the network connection set R1, obtains the network connection set R2, and writes the network connection set R2 into the configuration management database.

[0032] A further optimization scheme is that the network connection and process set includes: a process set L obtained by executing a process scanning script, a network connection quintuple set M obtained by executing a network connection scanning script, and a listening port set N obtained by executing a network listening port script.

[0033] A further optimization scheme is that the process set L includes the attributes: ip, cmd, pid and processType;

[0034] The network connection quintuple set M includes the attributes: localIp, localPort, foreignIp, foreignPort and pid; the listening port set N includes the attributes pid and port.

[0035] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0036] The present invention provides a method and system for building a system architecture topology in real time. The solution is based on Linux commands to scan the network connections between a system and external systems or technical components in real time, and build topological relationships between systems and systems, and between systems and technical components. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without creative work. In the drawings:

[0038] Figure 1 A flowchart of a method for building a system architecture topology in real time;

[0039] Figure 2 This is a schematic diagram of the original network connection. DETAILED DESCRIPTION

[0040] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0041] Example 1

[0042] This embodiment provides a method for constructing a system architecture topology in real time, such as Figure 1 As shown, including:

[0043] Build a configuration management database to store the configuration information of all devices in the IT architecture. The configuration information includes information such as the virtual machines occupied by the system and their IP addresses. For example, an order service is order-service, and the deployment business process occupies 1 virtual machine host, and the IP addresses are: 10.4.40.1; 1 database virtual machine host, IP: 10.4.40.3; 1 nginx virtual machine host, IP: 10.4.40.5.

[0044] Execute a scanning script on each virtual machine to obtain a network connection and a process set, and assemble the network connection and process set of each virtual machine to obtain a network connection set R1; the network connection and process set includes: a process set L obtained by executing a scanning process script command, a network connection quintuple set M obtained by executing a network connection scanning script command, and a listening port set N obtained by executing a network listening port script command.

[0045] The process set L includes the following attributes: IP, cmd, pid and processType;

[0046] The network connection quintuple set M includes attributes: localIp, localPort, foreignIp, foreignPort and pid;

[0047] The listening port set N includes attributes pid and port.

[0048] The method for obtaining the network connection set R1 includes:

[0049] S1: According to the pid of the network connection, find the process Li with the same pid in the process set L and get its process type T;

[0050] S2: According to the pid and localPort of the network connection, find out whether there is a record with the same pid and localPort in the listening port set N. If so, the current localPort is the server port of the network connection, otherwise the current localPort is the client port of the network connection; for example: for the network connection L at 10.4.40.1, the listening port with pid 10001 is 8080 in N, that is, 8080 is the server port, and the other localPorts are client ports.

[0051] S3: Update the network connection quintuple set M according to the process type and listening port type obtained by S1 and S2.

[0052] For example, the network connection of 10.4.40.1 is updated as follows:

[0053]

[0054] Similarly, the network connection of 10.4.40.3 is updated to:

[0055]

[0056] Similarly, the network connection of 10.4.40.5 is updated to:

[0057]

[0058] This embodiment executes the scanning process script command on the above virtual host;

[0059] 10.4.40.1 Get a process set L:

[0060]

[0061] Network connection quintuple set M:

[0062] localIp localPort foreiginIp foreignPort pid 10.4.40.1 12345 10.4.40.3 3306 10001 10.4.40.1 8080 10.4.40.5 12346 10001

[0063] Listening port set N:

[0064] port pid 8080 10001

[0065] 10.4.40.3 Get a process set L:

[0066]

[0067] Network connection quintuple set M:

[0068] localIp localPort foreiginIp foreignPort pid 10.4.40.3 3306 10.4.40.3 12345 10003

[0069] Listening port set N:

[0070] port pid 3306 10003

[0071] 10.4.40.5 Get a process set L:

[0072] ip cmd pid processType 10.4.40.5 / opt / jdk / bin / java–jar order-server.jar 10001 java

[0073] Network connection quintuple set M:

[0074] localIp localPort foreiginIp foreignPort pid 10.4.40.5 12346 10.4.40.1 8080 10001

[0075] Listening port set N:

[0076] port pid 80 10005

[0077] Query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2;

[0078] For example:

[0079]

[0080]

[0081] Update each network connection in the network connection set R2. In the network connection set R2, use the localIp of each network connection to update the foreignPort; use the localPort of each network connection to update the foreignPort; and use the localProcessType of each network connection to update the foreignProcessType.

[0082]

[0083] and record the updated network connection set R2 in the configuration management database; respectively search for connections whose local port types are client ports and server ports, and construct a resource node set V of the network topology and an edge set E of resource access relations;

[0084] Display the topological relationship of resource nodes on the page.

[0085] The method for updating each network connection in the network connection set R2 includes:

[0086] The method for constructing the resource node set V of the network topology and the edge set E of the resource access relationship includes:

[0087] In the network connection set R2, a network connection whose local port type is a client type is searched, and a resource node is constructed based on the application name and process type. The resource node access relationship is determined based on the port type access relationship between the resource nodes.

[0088] For example:

[0089]

[0090] First connection:

[0091] Resource nodes and access relationships: V1:<order-service,java> ->V2:<order-service,mysql>

[0092] Second connection:

[0093] Resource nodes and access relationships: V3:<order-service,nginx> ->V4:<order-service,java>

[0094] In R2, find the network connection whose local port type is server type.

[0095]

[0096] For example:

[0097] First connection:

[0098] Resource nodes and access relationships: V5:<order-service,java> <-V6:<order-service,mysql>

[0099] Second connection:

[0100] Resource nodes and access relationships: V7:<order-service,mysql> <-V8:<order-service,java>

[0101] Step 6.3: Merge the same resource nodes and edges to obtain a unique resource node set V and resource node access relationship set E:

[0102] For example: V = {<order-service,java> ,<order-service,mysql> ,<order-service,nginx>

[0103] }

[0104] E={<order-service,java> -><order-service,mysql> ,<order-service,nginx> -><order-service,java>}

[0105] Merge the same resource nodes and edges to obtain a unique resource node set V and resource node access relationship set E:

[0106] For example: V = {<order-service,java> ,<order-service,mysql> ,<order-service,nginx>

[0107] }

[0108] E={<order-service,java> -><order-service,mysql> ,<order-service,nginx> -><order-service,java>}.

[0109] Example 2

[0110] This embodiment provides a system for constructing a system architecture topology in real time, which is used to implement the method for constructing a system architecture topology in real time described in the previous embodiment, including:

[0111] A construction module is used to construct a configuration management database, which is used to store configuration information of all devices in the IT architecture, including information such as virtual machines occupied by the system and their IP addresses;

[0112] An execution module, used to execute a scanning script on each virtual machine to obtain a process and a network connection set, and assemble the network connection and process set of each virtual machine to obtain a network connection set R1;

[0113] The first operation module is used to query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2;

[0114] The second operation module is used to update each network connection in the network connection set R2 and record the updated network connection set R2 in the configuration management database; respectively search for connections whose local port types are client ports and server ports, and construct a resource node set V and an edge set E of resource access relations of the network topology;

[0115] The display module is used to display the topological relationship of resource nodes on the page.

[0116] The first operation module is an architecture topology construction server, which queries the name of the system to which each IP belongs from the configuration management database, updates the network connection in the network connection set R1, obtains the network connection set R2, and writes the network connection set R2 into the configuration management database.

[0117] The network connection and process set includes: a process set L obtained by executing a scanning process script command, a network connection five-tuple set M obtained by executing a network connection scanning script command, and a listening port set N obtained by executing a network listening port script command.

[0118] The process set L includes the attributes: ip, cmd, pid and processType;

[0119] The network connection quintuple set M includes attributes: localIp, localPort, foreignIp, foreignPort and pid;

[0120] The listening port set N includes attributes pid and port.

[0121] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for building system architecture topology in real time, It is characterized in that include: Build a configuration management database to store the configuration information of all devices in the IT architecture, including the virtual machine resources occupied by the system and its IP address; Execute the scanning script on each virtual machine to obtain the network connection and process set, and assemble the network connection and process set of each virtual machine to obtain the network connection set R1; The network connection and process set includes: a process set L obtained by executing a process scanning script, a network connection five-tuple set M obtained by executing a network connection scanning script, and a listening port set N obtained by executing a network listening port scanning script; The process set L includes the attributes: ip, cmd, pid and processType; The network connection quintuple set M includes attributes: localIp, localPort, foreignIp, foreignPort and pid; The listening port set N includes attributes pid and port; The method for obtaining the network connection set R1 includes: S1: According to the pid of the network connection, find the process Li with the same pid in the process set L and get its process type T; S2: According to the pid and localPort of the network connection, find out whether there is a record with the same pid and localPort in the listening port set N. If so, the current localPort is the server port of the network connection, otherwise the current localPort is the client port of the network connection; S3: Update the network connection five-tuple set M according to the process type and listening port type obtained by S1 and S2; Query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2; Update each network connection in the network connection set R2, and record the updated network connection set R2 in the network connection database; search for connections whose local port types are client ports and server ports in the network connection database, and construct a resource node set V of the network topology and an edge set E of resource access relations; The method for constructing the resource node set V of the network topology and the edge set E of the resource access relationship includes: T1: Search the network connections whose local port types are client ports and server ports in the network connection set R2, build resource nodes based on the application name and process type, and determine the resource node access relationship based on the port type access relationship between the resource nodes; T2: Merge the same resource nodes and edges to obtain a unique resource node set V and resource node access relationship set E; Display the topological relationship of resource nodes on the page.

2. A method for constructing a system architecture topology in real time according to claim 1, It is characterized in that The method for updating each network connection in the network connection set R2 includes: For each network connection, use its localIp and localPort, and update the foreignProcessType of other network connections whose foreignIp is equal to localIp and foreignPort is equal to localPort to localProcessType.

3. A system for building system architecture topology in real time, It is characterized in that The method for implementing the real-time construction system architecture topology of claim 1 or 2 comprises: A construction module is used to construct a configuration management database, which is used to store configuration information of all devices in the IT architecture, including information such as virtual machines occupied by the system and their IP addresses; An execution module, used for executing a scanning script on each virtual machine to obtain a network connection and a process set, and assembling the network connection and process set of each virtual machine to obtain a network connection set R1; The first operation module is used to query the name of the system to which each IP belongs from the configuration management database, and update the network connection in the network connection set R1 to obtain the network connection set R2; The second operation module is used to update each network connection in the network connection set R2 and record the updated network connection set R2 in the network connection database; search for connections whose local port types are client ports and server ports in the network connection database, and construct a resource node set V and an edge set E of resource access relations of the network topology; The display module is used to display the topological relationship of resource nodes on the page.

4. A system for constructing a system architecture topology in real time according to claim 3, It is characterized in that The first operation module is an architecture topology construction server, which queries the name of the system to which each IP belongs from the configuration management database, updates the network connection in the network connection set R1, obtains the network connection set R2, and writes the network connection set R2 into the network connection database.

5. A system for constructing system architecture topology in real time according to claim 3, It is characterized in that The network connection and process set includes: a process set L obtained by executing a scanning process script, a network connection five-tuple set M obtained by executing a network connection scanning script, and a listening port set N obtained by executing a network listening port script.

6. A system for constructing system architecture topology in real time according to claim 5, It is characterized in that The process set L includes the attributes: ip, cmd, pid and processType; The network connection quintuple set M includes attributes: localIp, localPort, foreignIp, foreignPort and pid; The listening port set N includes attributes pid and port.