Topological relationship generation method and device, computer equipment, readable storage medium and program product

By automatically obtaining and generating the topological relationships of the network architecture from the database, the problem of inefficient network topology management in the existing technology is solved, and more efficient and accurate network management is achieved.

CN119474236APending Publication Date: 2025-02-18CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411670861.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

Existing network topology management methods rely on manual maintenance or simple network scanning tools, resulting in inefficiency and difficulty in monitoring and managing complex cloud architectures in real time.

Method used

Provide a topological relationship generation method, by determining the target time, automatically obtaining node relationship data of each entity in the network architecture from the database, including its own node label and parent node label, and automatically generate topological relationships based on these data.

Benefits of technology

By automatically generating topological relationships, manual participation in management is reduced, efficiency and accuracy are improved, and errors caused by manual maintenance are reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474236A_ABST
    Figure CN119474236A_ABST
Patent Text Reader

Abstract

The invention relates to a topological relation generation method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: determining target time for generating a topological relation corresponding to a network architecture; acquiring node relation data of each entity in the network architecture at the target time from a database; the node relation data comprises a self node label and a father node label corresponding to the self node label; and generating a topological relation corresponding to the network architecture at the target time according to the node label of each entity and the corresponding father node label. By adopting the method, the topological relation can be automatically generated, manual management is reduced, the efficiency is improved, and meanwhile, errors caused by manual maintenance are reduced, so that the accuracy of the topological relation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device, computer-readable storage medium and computer program product for generating a topological relationship. Background Art

[0002] Network topology management aims to help users understand and monitor the operation of the entire cloud architecture in real time and intuitively by building and managing the network topology structure, thereby assisting operation and maintenance personnel to quickly locate and analyze faults and improve the efficiency and accuracy of network management.

[0003] With the development of cloud computing and virtualization technology, network topology has become more and more complex. Existing network topology management usually relies on manual maintenance or simple network scanning tools, which is time-consuming and labor-intensive, resulting in low efficiency. Summary of the invention

[0004] Based on this, it is necessary to provide a topological relationship generation method, apparatus, computer device, computer-readable storage medium and computer program product that can improve efficiency in order to solve the above technical problems.

[0005] In a first aspect, the present application provides a method for generating a topological relationship, the method comprising:

[0006] Determine the target time for generating the topological relationship corresponding to the network architecture;

[0007] Obtaining node relationship data of each entity in the network architecture of the target time from a database; the node relationship data includes a node label of the entity and a parent node label corresponding to the node label of the entity;

[0008] According to the own node label of each entity and the corresponding parent node label, a topological relationship corresponding to the network architecture at the target time is generated.

[0009] In one of the embodiments, before acquiring the own node label and the corresponding parent node label of each entity in the network architecture of the target time from the database, the method further includes:

[0010] Obtaining the own node label and the corresponding parent node label of each entity in the network architecture at different times;

[0011] The node label of each entity in the network architecture corresponding to each time and the corresponding parent node label are stored in a database.

[0012] In one embodiment, each of the entities corresponds to a collection and transmission component; the obtaining of the own node label and the corresponding parent node label of each entity in the network architecture at different times includes:

[0013] At each time, obtaining the own node label and the corresponding parent node label of the entity through at least one of the acquisition and transmission components;

[0014] The own node label and the corresponding parent node label of each entity are obtained by configuring the transmission path of each acquisition transmission component.

[0015] In one of the embodiments, obtaining the entity's own node label and the corresponding parent node label through at least one of the acquisition and transmission components includes:

[0016] Creating at least one acquisition process through an application layer protocol, wherein the acquisition process is used for the acquisition transmission component corresponding to each of the entities to obtain the node label of the entity;

[0017] A scanning process of the collection process is created through a network protocol, and the scanning process is used to obtain the upper and lower connected entities and the corresponding label information of each of the entities, and send the upper and lower connected entities and the corresponding label information of each of the entities to the collection process; the collection process is used to determine the own node label and the corresponding parent node label according to the upper and lower connected entities and the corresponding label information of each of the entities.

[0018] In one embodiment, the entity includes a virtual entity; the acquiring the own node label and the corresponding parent node label of the entity through at least one of the acquisition and transmission components includes:

[0019] Acquire a target physical entity where the virtual entity is created;

[0020] Taking the target physical entity as the parent node label corresponding to the own node label;

[0021] The self node label and the corresponding parent node label of the virtual entity are obtained through the acquisition and transmission component of the virtual entity.

[0022] In one embodiment, the method further comprises:

[0023] When a change in an entity in the network architecture is detected, the changed entity is determined as a target entity;

[0024] Obtaining the new own node label and the corresponding new parent node label through the acquisition transmission component corresponding to the target entity;

[0025] By configuring the transmission path of the acquisition transmission component corresponding to each of the target entities, a new self-node label and a corresponding new parent node label of each of the target entities are obtained;

[0026] The self node label of the target entity in the database is replaced with the new self node label; and the corresponding parent node label is replaced with the new parent node label.

[0027] In a second aspect, the present application further provides a topological relationship generating device, characterized in that the device comprises:

[0028] A time determination module, used to determine the target time for generating a topological relationship corresponding to the network architecture;

[0029] A first acquisition module is used to acquire node relationship data of each entity in the network architecture of the target time from a database; the node relationship data includes a node label of the entity and a parent node label corresponding to the node label of the entity;

[0030] A generation module is used to generate a topological relationship corresponding to the network architecture at the target time according to the own node label of each entity and the corresponding parent node label.

[0031] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.

[0033] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.

[0034] The above-mentioned topological relationship generation method, device, computer equipment, computer-readable storage medium and computer program product, since the accurate node relationship data of each entity is stored in the database, after determining the target time, the self-node label of each entity and the parent node label corresponding to the self-node label can be automatically read from the database according to the target time; the corresponding topological relationship can be automatically generated according to the self-node label and the parent node label of the target time, and the node label of the cloud architecture at any time can automatically generate the corresponding topological relationship. By automatically generating the topological relationship, manual participation in management is reduced, efficiency is improved, and the accuracy of the topological relationship is improved by reducing errors caused by manual maintenance. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0036] FIG1 is an application environment diagram of a topology relationship generating method in one embodiment;

[0037] FIG2 is a schematic diagram of a process of generating a topological relationship in one embodiment;

[0038] FIG3 is a schematic diagram of a topological relationship under a cloud network architecture in one embodiment;

[0039] FIG4 is a schematic diagram of a topological relationship under a cloud network architecture in another embodiment;

[0040] FIG5 is a schematic diagram of a process of obtaining and storing own node labels and parent node labels in one embodiment;

[0041] FIG6 is a schematic diagram of a process of obtaining a node label and a parent node label in one embodiment;

[0042] FIG7 is a schematic diagram of a process of obtaining a node label and a parent node label in another embodiment;

[0043] FIG8 is a schematic diagram of adding a tenant system to collect node labels in a cloud network architecture in one embodiment;

[0044] FIG9 is a schematic diagram of a process of obtaining a own node label and a parent node label in another embodiment;

[0045] FIG10 is a schematic diagram of a flow chart of a method for generating a topological relationship in another embodiment;

[0046] FIG11 is a structural block diagram of a topological relationship generating device in one embodiment;

[0047] FIG. 12 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The topological relationship generation method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the cloud architecture 102 communicates with the server 104 through the network. Cloud architecture refers to how all components and functions required to build a cloud are connected so as to be delivered to an online platform for application operation. The cloud architecture includes several entities, including physical entities and virtual entities. Physical entities include but are not limited to switches, physical hosts, physical disks, etc.; virtual entities include but are not limited to virtual machines, virtual network elements, cloud disks, etc. Server 104 determines the target time for generating the topological relationship corresponding to the network architecture; obtains the node relationship data of each entity in the network architecture at the target time from the database; the node relationship data includes its own node label and the parent node label corresponding to its own node label; according to the own node label of each entity and the corresponding parent node label, the topological relationship corresponding to the network architecture at the target time is generated. Server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0050] In an exemplary embodiment, as shown in FIG2 , a method for generating a topology relationship is provided, and the method is applied to the server in FIG1 as an example for explanation, and includes the following steps S202 to S206 . Among them:

[0051] Step S202, determining a target time for generating a topological relationship corresponding to the network architecture.

[0052] Among them, network architecture refers to the structural design of the network, including the combination of hardware, software, protocols and services. The topological relationship in the network architecture describes the connection method and mutual position relationship between network devices (such as computers, routers, switches, etc.). Common topological relationships include star topology, bus topology, ring topology, tree topology, mesh topology, and hybrid topology.

[0053] As shown in Figure 3, the topological relationship under a typical cloud network architecture includes two types of topological relationships. Network topological relationship: For example, there is a network communication connection relationship between switches, physical hosts, virtual machines, and virtual network elements. For example, physical hosts are connected to switches, and virtual machines and virtual network elements are connected to physical hosts. Physical resource topological relationship: For example, virtual machines are built on physical hosts, cloud disks are built on physical disks, and applications are deployed on virtual machines.

[0054] Optionally, the server determines a target time for generating a topological relationship corresponding to the network architecture, wherein the target time may be a target time point or a target time period.

[0055] Step S204, obtaining node relationship data of each entity in the network architecture at the target time from the database; the node relationship data includes the own node label and the parent node label corresponding to the own node label.

[0056] Optionally, before obtaining the node relationship data of each entity in the network architecture at the target time from the database, the node relationship data of the corresponding entities in the network architecture at different times are obtained by pre-deploying an acquisition and transmission component exporter in each entity, and stored in the database.

[0057] The network topology relationship and the physical resource topology relationship can both be regarded as parent-child relationships. As shown in Figure 3, the parent node of the access switch is the core switch; the parent node of the physical host is the access switch; the parent node of the virtual network element is the physical host; the parent node of the virtual machine is the physical host; the parent node of the physical disk is the physical host; the parent node of the cloud disk is the physical disk and the virtual machine; the parent node of the application is the virtual machine.

[0058] Optionally, the server obtains node relationship data of each entity in the network architecture at the target time from the database; the node relationship data includes the own node label and the parent node label corresponding to the own node label. For example, the parent node of an access switch is the core switch. The own node label and the corresponding parent node label corresponding to the access switch can be recorded as [entity {own node label, parent node label}], such as accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}, where accessSwitch represents the access switch entity, ip represents the access switch's own node label, and coreSwitchIp ​​represents the parent node label of the access switch's own node label. The database can be a time series database. A time series database (TSDB for short) is a database management system specifically used to store, process and analyze time series data. A time series database is a specific type of database whose design goal is to efficiently store, query and analyze time-tagged data.

[0059] Optionally, the target time can be the current time point or the current time period; it can also be a historical time point or a historical time period. According to the corresponding target time, the server reads the own node label and the corresponding parent node label of each entity in the network architecture at the target time from the database. Assuming that the current time is T and the target time is T, the database records that there are n entities in the network architecture at time T, as well as the own node labels and corresponding parent node labels of n entities. The target time is (T-1), and the database records that there are (nm) entities in the network architecture at (T-1), as well as the own node labels and corresponding parent node labels of (nm) entities. Among them, n and m are both positive integers, and n is greater than or equal to m.

[0060] Step S206, generating a topological relationship corresponding to the network architecture at the target time according to the node label of each entity and the corresponding parent node label.

[0061] The topological relationship may be represented by a topological diagram. The topological relationship may be shown in FIG4. Each entity includes a "name and a corresponding Internet Protocol Address".

[0062] Optionally, the server generates a topological relationship corresponding to the network architecture at the target time based on the node label of each entity and the corresponding parent node label. For example, when the target time is T, a topological graph of n entities is generated. For another example, when the target time is (T-1), a topological graph of (nm) entities is generated.

[0063] Optionally, the server generates a topological relationship corresponding to the network architecture at the target time based on the node label and the corresponding parent node label of each entity, including: randomly reading the node label and the corresponding parent node label of a candidate entity from all entities; obtaining the node label and the corresponding parent node label of the corresponding first upstream entity based on the parent node label; continuing to obtain the node label and the corresponding parent node label of the corresponding second upstream entity based on the parent node label of the first upstream entity, until a certain upstream entity does not have a parent node label. Match the parent node label of any entity based on the node label of the candidate entity, and if the match is successful, the entity is the first downstream entity of the candidate entity, until the node label of a downstream entity matches the parent node label of the upstream entity.

[0064] In the above-mentioned topological relationship generation method, since the accurate node relationship data of each entity is stored in the database, after determining the target time, the node label of each entity and the parent node label corresponding to the node label can be automatically read from the database according to the target time; the corresponding topological relationship is automatically generated according to the node label and parent node label of the target time, and the node label of the cloud architecture at any time can be used to automatically generate the corresponding topological relationship. By automatically generating topological relationships, manual participation in management is reduced, efficiency is improved, and errors caused by manual maintenance are reduced, thereby improving the accuracy of topological relationships. Since the topological relationship can be generated from the node relationship data corresponding to any time recorded in the database, the flexibility of topological relationship display is also improved.

[0065] In an exemplary embodiment, as shown in FIG5 , before obtaining the node label and the corresponding parent node label of each entity in the network architecture of the target time from the database, the process further includes: Steps S502 to S504 . Among them:

[0066] Step S502, obtaining the own node label and the corresponding parent node label of each entity in the network architecture at different times.

[0067] Here, time can be either a period of time or a point in time.

[0068] Optionally, before obtaining the self-node label and the corresponding parent node label of each entity in the network architecture at the target time from the database, the server obtains the self-node label and the corresponding parent node label of each entity in the network architecture at different times. For example, there are three entities in the network architecture at time T. The self-node label and the corresponding parent node label corresponding to each entity are as follows:

[0069] Entity 1 (core switch) coreSwitch{ip='196.128.3.20'}

[0070] Entity 2 (access switch) accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}

[0071] Entity 3 (access switch) accessSwitch{ip='196.128.3.22',coreSwitchIp='196.128.3.20'}

[0072] For example, there are four entities in the network architecture at time (T-1). The node label and parent node label of each entity are as follows:

[0073] Entity 1 (core switch) coreSwitch{ip='196.128.3.20'}

[0074] Entity 2 (access switch) accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}

[0075] Entity 3 (access switch) accessSwitch{ip='196.128.3.22',coreSwitchIp='196.128.3.20'}

[0076] Entity 4 (physical host) host{ip='196.128.2.1',accessSwitchIp='196.128.3.20'}

[0077] For another example, the corresponding node label and parent node label of each entity in the network architecture are obtained as follows:

[0078] coreSwitch{ip='196.128.3.20'}

[0079] accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}

[0080] accessSwitch{ip='196.128.3.22',coreSwitchIp='196.128.3.20'}

[0081] host{ip='196.128.2.1',accessSwitchIp='196.128.3.20'}

[0082] slb{ip='172.20.1.1',hostIp='196.128.2.1'}

[0083] vm{ip='172.20.1.2',hostIp='196.128.2.1',slbIp='172.20.1.1'}

[0084] vm{ip='172.20.1.3',hostIp='196.128.2.1',slbIp='172.20.1.1'}

[0085] app{name='testApp1',vmIp='172.20.1.3'}

[0086] app{name='testApp2',vmIp='172.20.1.3'}

[0087] Step S504, storing the node label and the corresponding parent node label of each entity in the network architecture corresponding to each time into the database.

[0088] Optionally, the server records the timestamp of the node label and the corresponding parent node label of each entity in the network architecture corresponding to each time, and stores them in the database.

[0089] Table 1 Entity parent-child relationship table

[0090]

[0091] In this embodiment, by storing accurate node data at different times in the database, the efficiency and accuracy of generating the topological relationship are guaranteed.

[0092] In the above embodiment, as shown in FIG6 , each entity corresponds to a collection and transmission component; obtaining the own node label and the corresponding parent node label of each entity in the network architecture at different times includes: steps S602 to S604. Among them:

[0093] Step S602: for each time, the entity's own node label and the corresponding parent node label are obtained through at least one acquisition and transmission component.

[0094] In actual applications, the corresponding collection and transmission component exporter is deployed in advance for each entity, such as switch exporter, physical host exporter, physical disk exporter, virtual machine exporter, cloud disk exporter, virtual network element exporter, and application exporter; tenants can also provide tenant-level exporters. Exporter function definition: Start reporting node labels when the entity is created or joins the virtualization management system; stop reporting node labels when the entity is destroyed or exits the virtualization management system; after the physical location of the entity changes (such as virtual machine migration), the node label can be reported according to the new location; the node label reported by each exporter must include its own label and parent node label.

[0095] Optionally, a scheduled task is set, and at each time, the server obtains the entity's own node label and the corresponding parent node label through at least one collection and transmission component.

[0096] Optionally, when an entity changes, start or stop reporting node labels. For example, when an entity is created or joins a virtualization management system, start reporting node labels; when an entity is destroyed or exits a virtualization management system, stop reporting node labels; when an entity's physical location changes (such as virtual machine migration), report node labels according to the new location and record the timestamp of the change.

[0097] Step S604: Acquire the own node label and the corresponding parent node label of each entity by configuring the transmission path of each acquisition transmission component.

[0098] Optionally, the server obtains the node labels and corresponding parent node labels of all entities through a collection component such as prometheus by configuring the transmission path of each collection transmission component. The collection component such as prometheus can be deployed in the cloud. After the server collects the node labels and corresponding parent node labels of all entities through a collection component such as prometheus, it stores the node labels and corresponding parent node labels of each entity in the network architecture in the database.

[0099] In this embodiment, accurate node labels are automatically obtained through the collection and transmission component, and each entity maintains its own collection and transmission component exporter to accurately output topological relationships, thereby reducing errors caused by manual maintenance and improving the accuracy of the topology.

[0100] Continuing from the above embodiment, as shown in FIG7 , obtaining the entity's own node label and the corresponding parent node label through at least one acquisition and transmission component includes: Step S702 to Step S704. Among them:

[0101] Step S702: at least one collection process is created through the application layer protocol, and the collection process is used for the collection transmission component corresponding to each entity to obtain its own node label.

[0102] Optionally, the server creates at least one collection process through the application layer protocol snmp, and the collection process is used for the collection transmission component corresponding to each entity to obtain its own node label. For example, the switch Exporter can implement the collection process of the switch's own node label based on the snmp technology.

[0103] Step S704, create a scanning process of the collection process through the network protocol, the scanning process is used to obtain the upper and lower connected entities of each entity and the corresponding label information, and send the upper and lower connected entities of each entity and the corresponding label information to the collection process; the collection process is used to determine its own node label and the corresponding parent node label according to the upper and lower connected entities of each entity and the corresponding label information.

[0104] Optionally, the server creates a scanning process of the collection process through the network protocol. The scanning process is used to obtain the upper and lower connected entities of each entity and the corresponding label information, and send the upper and lower connected entities of each entity and the corresponding label information to the collection process; the collection process is used to determine its own node label and the corresponding parent node label according to the upper and lower connected entities of each entity and the corresponding label information. Another scanning process is started to obtain the upper and lower connected entities of the switch through the Link Layer Discovery Protocol (LLDP) technology and the Simple Network Management Protocol (SNMP) Simple Network Management Protocol technology. In order to adapt to the adjustment of physical equipment, it can be scanned regularly to obtain the latest upper and lower connected entities in time. The scanning process notifies the collection process of the upper connected entity through file communication or other means, and the collection process can add the parent node label to its own node label. For example, the parent node of an access switch is the core switch. The switch can be accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}, where ip represents the node label of the switch itself, and coreSwitchIp ​​represents the node label of the upstream entity, that is, the parent node label.

[0105] Optionally, as shown in FIG8 , entities in the tenant system can also be added under the cloud network architecture. When the server obtains the node label and parent node label of each entity through the collection and transmission component Exporter of each entity in the cloud architecture, all entities of the tenant system can also be added to the cloud architecture. For example, all entities of the tenant system include but are not limited to virtual machines vm, server load balancing slb, applications, etc.

[0106] The collection of all entity node labels of the tenant system includes two situations: determination during tenant configuration and determination during tenant deployment.

[0107] Determine the parent-child node relationship during tenant configuration: When a tenant adds a virtual machine to an SLB, it needs to be operated through the tenant console. At this time, the tenant console service can obtain the relationship between the SLB and the virtual machine. In network management, the virtual machine is a child node of the SLB. The tenant console service sends the relationship between the virtual machine and the SLB to the virtual machine exporter through the http service. The virtual machine exporter can add the parent node label to its own monitoring indicators. For example, the indicator of a virtual machine can be vm{ip='172.20.1.2',hostIp='196.128.2.1',slbIp='172.20.1.1'}, where ip represents the virtual machine itself, hostIp represents the physical machine it belongs to is 196.128.2.1, and slb represents the SLB it joins. The parent node of the virtual machine in physical facilities is the physical machine, and the parent node in network management is slb.

[0108] Determine the parent-child node relationship when tenants deploy: When tenants deploy, you can determine which virtual machine an application is deployed on. Tenants manage their own application Exporter and output the node label of the application. The node label of an application can be app{name='testApp1',vmIp='172.20.1.3'}, where name represents the application itself and vmIp represents the virtual machine where it is located.

[0109] In this embodiment, the node label and the corresponding parent node label of each entity in the network architecture can be accurately obtained through the collection thread of the collection transmission component and the scanning thread of the collection thread.

[0110] In an embodiment parallel to the above embodiment, as shown in FIG9 , the entity includes a virtual entity; obtaining the entity's own node label and the corresponding parent node label through at least one acquisition and transmission component includes: steps S902 to S906. Among them:

[0111] Step S902, obtaining the target physical entity where the virtual entity is to be created.

[0112] Optionally, when a virtual machine needs to be created, the virtualization scheduling service first determines on which physical machine the virtual machine is to be created through inventory management, and then calls the virtualization service to create the virtual machine. After the creation is successful, the physical machine to which the virtual machine belongs is clarified. Therefore, the server obtains the target physical entity where the virtual entity is created.

[0113] Step S904: Use the target physical entity as the parent node label corresponding to its own node label.

[0114] Optionally, the target physical entity is used as the parent node label corresponding to its own node label. The server sends the parent-child relationship between the virtual machine and the physical machine to the virtual machine Exporter through the http service.

[0115] Step S906: Acquire the virtual entity's own node label and the corresponding parent node label through the collection and transmission component of the virtual entity.

[0116] Optionally, the virtual machine exporter can add the parent node label to its own node label. For example, the indicator of a virtual machine can be vm{ip='172.20.1.2',hostIp='196.128.2.1',slbIp='172.20.1.1'}, where ip represents the virtual machine itself and hostIp represents the physical machine 196.128.2.1 to which it belongs.

[0117] In this embodiment, the node label of the virtual entity itself and the corresponding parent node label are automatically obtained through the collection and transmission component corresponding to the virtual entity, which can reduce manual participation, improve efficiency and improve accuracy.

[0118] In an exemplary embodiment, as shown in FIG10 , the topological relationship generation method includes steps S1002 to S1008 .

[0119] Step S1002: When a change in an entity in the network architecture is detected, the changed entity is determined as a target entity.

[0120] Optionally, when the server detects that an entity is created in the network architecture or added to a virtualization management system, the entity or virtualization management system is used as the target entity. When the server detects that the physical location of an entity has changed, the entity is determined as the target entity. For example, when a virtual machine is migrated, the virtual machine is used as the target entity.

[0121] Step S1004: Obtain a new own node label and a corresponding new parent node label through the collection and transmission component corresponding to the target entity.

[0122] Optionally, the server obtains a new self-node label and a corresponding new parent node label through a collection and transmission component corresponding to the target entity.

[0123] Step S1006: acquiring a new self-node label and a corresponding new parent node label of each target entity by configuring a transmission path of a collection transmission component corresponding to each target entity.

[0124] Optionally, the server obtains the own node labels and corresponding parent node labels of all entities through a collection component such as prometheus by configuring the transmission path of each collection transmission component. The collection component such as prometheus can be deployed in the cloud. The server collects the new own node label and the corresponding new parent node label of each target entity through a collection component such as prometheus.

[0125] Step S1008: Replace the target entity's own node label in the database with a new own node label; and replace the corresponding parent node label with a new parent node label.

[0126] Optionally, the server replaces the target entity's own node label in the database with a new own node label; replaces the corresponding parent node label with the new parent node label, and records the collection time. The node label retention time can also be adjusted according to business needs to save disk resources.

[0127] In this embodiment, entity changes are detected in a timely manner, and only the node labels of the changed entities are updated, thereby reducing the amount of generation calculations and improving efficiency.

[0128] In an exemplary embodiment, for each time, the server creates at least one collection process through the application layer protocol snmp, and the collection process is used for the collection transmission component Exporter corresponding to each entity to obtain its own node label. For example, the switch Exporter can implement the collection process of the switch's own node label based on the snmp technology. The server creates a scanning process of the collection process through the network protocol, and the scanning process is used to obtain the upper and lower connected entities of each entity and the corresponding label information, and send the upper and lower connected entities of each entity and the corresponding label information to the collection process; the collection process is used to determine its own node label and the corresponding parent node label according to the upper and lower connected entities of each entity and the corresponding label information. In addition, a scanning process is started to obtain the upper and lower connected entities of the switch through the Link Layer Discovery Protocol (LLDP) technology and the Simple Network Management Protocol (SNMP) Simple Network Management Protocol technology. In order to adapt to the adjustment of physical devices, it can be scanned regularly to obtain the latest upper and lower connected entities in time. The scanning process notifies the collection process of the upper connected entity through file communication or other means, and the collection process can put the parent node label on its own node label, for example, the parent node of an access switch is a core switch. The switch can be accessSwitch{ip='196.128.3.21',coreSwitchIp='196.128.3.20'}, where ip represents the node label of the switch itself, and coreSwitchIp ​​represents the node label of the upstream entity, that is, the parent node label.

[0129] You can also determine the parent-child node relationship when the tenant is deployed: When the tenant is deployed, you can determine which virtual machine an application is deployed on. The tenant manages his own application Exporter and outputs the node label of the application. The node label of an application can be app{name='testApp1',vmIp='172.20.1.3'}, where name represents the application itself and vmIp represents the virtual machine where it is located.

[0130] The node label of each entity in the network architecture corresponding to each time and the corresponding parent node label are stored in a database.

[0131] When the server detects that an entity is created or added to a virtualization management system in the network architecture, the entity or virtualization management system is used as the target entity. After the server detects that the physical location of an entity has changed, the server determines the entity as the target entity. For example, if a virtual machine is migrated, the virtual machine is used as the target entity. The server obtains the new self-node label and the corresponding new parent node label through the collection and transmission component corresponding to the target entity. The server obtains the self-node labels and corresponding parent node labels of all entities through collection components such as prometheus by configuring the transmission path of each collection and transmission component. Among them, collection components such as prometheus can be deployed in the cloud. The server collects the new self-node label and the corresponding new parent node label of each target entity through collection components such as prometheus. The server replaces the self-node label of the target entity in the database with the new self-node label; replaces the corresponding parent node label with the new parent node label, and records the collection time.

[0132] When a change in an entity in the network architecture is detected, the changed entity is determined as the target entity; the new own node label and the corresponding new parent node label are obtained through the acquisition and transmission component corresponding to the target entity; the new own node label and the corresponding new parent node label of each target entity are obtained by configuring the transmission path of the acquisition and transmission component corresponding to each target entity; the own node label of the target entity in the database is replaced with the new own node label; and the corresponding parent node label is replaced with the new parent node label.

[0133] The server determines the target time for generating the topological relationship corresponding to the network architecture, where the target time can be a target time point or a target time period. Assuming that the current time is T and the target time is T, the database records that there are n entities in the network architecture at time T, as well as the self-node labels and corresponding parent node labels of n entities. At the target time T, randomly read the self-node label and corresponding parent node label of a candidate entity from all entities; obtain the self-node label and corresponding parent node label of the corresponding first upstream entity according to the parent node label; continue to obtain the self-node label and corresponding parent node label of the corresponding second upstream entity according to the parent node label of the first upstream entity, until a certain upstream entity does not have a parent node label. Match the parent node label of any entity according to the self-node label of the candidate entity. If the match is successful, the entity is the first downstream entity of the candidate entity, until the self-node label of a downstream entity matches the parent node label of the upstream entity, thereby generating a topological graph of n entities. Using the timeliness of prometheus indicators, the current topology and the topology at a specified historical moment can be displayed. If the target time is (T-1), a topological graph of (nm) entities is generated.

[0134] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0135] Based on the same inventive concept, the embodiment of the present application also provides a topological relationship generation device for implementing the topological relationship generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more topological relationship generation device embodiments provided below can refer to the limitations of the topological relationship generation method above, and will not be repeated here.

[0136] In an exemplary embodiment, as shown in FIG11 , a topology relationship generating device is provided, including: a time determination module 1101, a first acquisition module 1102 and a generation module 1103, wherein:

[0137] The time determination module 1101 is used to determine the target time for generating the topological relationship corresponding to the network architecture.

[0138] The first acquisition module 1102 is used to acquire node relationship data of each entity in the network architecture at the target time from the database; the node relationship data includes the own node label and the parent node label corresponding to the own node label.

[0139] The generation module 1103 is used to generate a topological relationship corresponding to the network architecture at the target time according to the node label of each entity and the corresponding parent node label.

[0140] In an exemplary embodiment, the topological relationship generating device further includes:

[0141] The second acquisition module is used to obtain the own node label and the corresponding parent node label of each entity in the network architecture at different times.

[0142] The storage module is used to store the node label and the corresponding parent node label of each entity in the network architecture corresponding to each time in the database.

[0143] In an exemplary embodiment, each entity corresponds to a collection and transmission component; the second acquisition module includes:

[0144] The first acquisition unit is used to acquire the entity's own node label and the corresponding parent node label through at least one acquisition and transmission component at each time.

[0145] The second acquisition unit is used to acquire the own node label and the corresponding parent node label of each entity by configuring the transmission path of each acquisition transmission component.

[0146] In an exemplary embodiment, the first acquisition unit includes:

[0147] The collection subunit is used to create at least one collection process through the application layer protocol, and the collection process is used for the collection transmission component corresponding to each entity to obtain its own node label.

[0148] The scanning subunit is used to create a scanning process of the collection process through the network protocol. The scanning process is used to obtain the upper and lower connected entities of each entity and the corresponding label information, and send the upper and lower connected entities of each entity and the corresponding label information to the collection process; the collection process is used to determine its own node label and the corresponding parent node label according to the upper and lower connected entities of each entity and the corresponding label information.

[0149] In an exemplary embodiment, the entity includes a virtual entity; the first acquisition unit further includes:

[0150] The first acquisition subunit is used to acquire a target physical entity where the virtual entity is created.

[0151] The parent node determines the child unit, which is used to take the target physical entity as the parent node label corresponding to its own node label.

[0152] The second acquisition subunit is used to acquire the virtual entity's own node label and the corresponding parent node label through the collection and transmission component of the virtual entity.

[0153] In an exemplary embodiment, the topological relationship generating device further includes:

[0154] The detection module is used to determine the changed entity as the target entity when a change is detected in the entity in the network architecture.

[0155] The third acquisition module is used to acquire a new own node label and a corresponding new parent node label through a collection and transmission component corresponding to the target entity.

[0156] The fourth acquisition module is used to acquire a new self-node label and a corresponding new parent node label of each target entity by configuring a transmission path of a collection transmission component corresponding to each target entity.

[0157] The replacement module is used to replace the self-node label of the target entity in the database with a new self-node label; and replace the corresponding parent node label with a new parent node label.

[0158] Each module in the above-mentioned topological relationship generating device can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.

[0159] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG12. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store node label data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for generating a topological relationship is implemented.

[0160] Those skilled in the art will understand that the structure shown in FIG. 12 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0161] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0162] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0163] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0164] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0165] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0166] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating a topological relationship, characterized in that: The method comprises: Determine the target time for generating the topological relationship corresponding to the network architecture; Obtaining node relationship data of each entity in the network architecture of the target time from a database; the node relationship data includes a node label of the entity and a parent node label corresponding to the node label of the entity; According to the own node label of each entity and the corresponding parent node label, a topological relationship corresponding to the network architecture at the target time is generated.

2. The method according to claim 1, characterized in that Before acquiring the own node label and the corresponding parent node label of each entity in the network architecture of the target time from the database, the method further includes: Obtaining the own node label and the corresponding parent node label of each entity in the network architecture at different times; The node label of each entity in the network architecture corresponding to each time and the corresponding parent node label are stored in a database.

3. The method according to claim 2, characterized in that Each of the entities corresponds to a collection and transmission component; the obtaining of the own node label and the corresponding parent node label of each entity in the network architecture at different times includes: At each time, obtaining the own node label and the corresponding parent node label of the entity through at least one of the acquisition and transmission components; The own node label and the corresponding parent node label of each entity are obtained by configuring the transmission path of each acquisition transmission component.

4. The method according to claim 3, characterized in that The acquiring, through at least one of the acquisition and transmission components, the own node label of the entity and the corresponding parent node label includes: Creating at least one acquisition process through an application layer protocol, wherein the acquisition process is used for the acquisition transmission component corresponding to each of the entities to obtain the node label of the entity; A scanning process of the collection process is created through a network protocol, and the scanning process is used to obtain the upper and lower connected entities and the corresponding label information of each of the entities, and send the upper and lower connected entities and the corresponding label information of each of the entities to the collection process; the collection process is used to determine the own node label and the corresponding parent node label according to the upper and lower connected entities and the corresponding label information of each of the entities.

5. The method according to claim 3, characterized in that: The entity includes a virtual entity; and obtaining the own node label and the corresponding parent node label of the entity through at least one of the acquisition and transmission components includes: Acquire a target physical entity where the virtual entity is created; Taking the target physical entity as the parent node label corresponding to the own node label; The self node label and the corresponding parent node label of the virtual entity are obtained through the acquisition and transmission component of the virtual entity.

6. The method according to any one of claims 2 to 5, characterized in that: The method further comprises: When a change in an entity in the network architecture is detected, the changed entity is determined as a target entity; Obtaining the new own node label and the corresponding new parent node label through the acquisition transmission component corresponding to the target entity; By configuring the transmission path of the acquisition transmission component corresponding to each of the target entities, a new self-node label and a corresponding new parent node label of each of the target entities are obtained; The self node label of the target entity in the database is replaced with the new self node label; and the corresponding parent node label is replaced with the new parent node label.

7. A topological relationship generating device, characterized in that: The device comprises: A time determination module, used to determine the target time for generating a topological relationship corresponding to the network architecture; A first acquisition module is used to acquire node relationship data of each entity in the network architecture of the target time from a database; the node relationship data includes a node label of the entity and a parent node label corresponding to the node label of the entity; A generation module is used to generate a topological relationship corresponding to the network architecture at the target time according to the own node label of each entity and the corresponding parent node label.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.