A network topology construction method, device, equipment and medium

By acquiring the attribute information of network devices, constructing a device set, and performing matrix processing, and using XOR calculation to determine the topology relationship, the problem of low efficiency in network topology construction in existing technologies is solved, and efficient determination of network topology relationship is achieved.

CN116633800BActive Publication Date: 2026-02-10ZHUHAI TIANRONGXIN NETWORK SECURITY TECH CO LTD +3
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310709988.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-14
Publication Date
2026-02-10
Estimated Expiration
2043-06-14

AI Technical Summary

Technical Problem

In existing technologies, when constructing network topology through active probing, the efficiency of determining the topological relationships of network devices is low, resulting in low efficiency in network topology construction.

Method used

Obtain network attribute information of each network device in the current network segment, construct a device set based on the time to live, determine the topology relationship through matrix processing, use XOR calculation instead of matrix multiplication, and determine the upper and lower level topology relationship based on the maximum matching principle.

Benefits of technology

It improves the computational efficiency of determining network topology relationships, reduces labor and time costs, and increases the efficiency of network topology construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633800B_ABST
    Figure CN116633800B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a network topology construction method and device, equipment and medium, wherein the method comprises: obtaining network attribute information of each network device included in a current network segment, the number of network devices being a plurality; based on the survival time in the network attribute information of each network device, constructing a plurality of device sets; performing matrix processing on the plurality of device sets to determine the topology relationship of each network device, and constructing the network topology of the current network segment based on the topology relationship. By using the above technical solution, after constructing a plurality of device sets from the network attribute information of a plurality of network devices in the current network segment, the topology relationship between the network devices is determined by matrix processing on the plurality of device sets, which can improve the calculation efficiency of topology relationship determination, reduce the labor cost and time cost, and thus improve the efficiency of network topology relationship construction.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of network, and particularly relates to a network topology construction method and device, equipment and medium. BACKGROUND

[0002] With the development of Internet of Things technology, the number of devices in the Internet is increasing, which leads to the increasing complexity of network topology constituted by the devices. In order to clearly show and reasonably utilize network resources, it is necessary to sort out and construct the network topology.

[0003] Network devices in the network topology are usually added manually, and this way is time-consuming and inefficient, and there is a fault tolerance rate. In order to solve the above problems, the related technology constructs the network topology by active detection method, but the efficiency of determining the topology relationship of the network devices is low, which further leads to the low efficiency of constructing the network topology. SUMMARY

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a network topology construction method, device, equipment and medium.

[0005] The present disclosure provides a network topology construction method, which comprises:

[0006] Obtaining network attribute information of each network device included in a current network segment, the number of network devices being multiple;

[0007] Constructing multiple device sets based on the survival time in the network attribute information of each network device;

[0008] Matrix processing the multiple device sets, determining the topology relationship of each network device, and constructing the network topology of the current network segment based on the topology relationship.

[0009] The present disclosure also provides a network topology construction device, which comprises:

[0010] An acquisition module is configured to obtain network attribute information of each network device included in a current network segment, the number of network devices being multiple;

[0011] A set module is configured to construct multiple device sets based on the survival time in the network attribute information of each network device;

[0012] A construction module is configured to matrix process the multiple device sets, determine the topology relationship of each network device, and construct the network topology of the current network segment based on the topology relationship.

[0013] The embodiment of the present disclosure further provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used for reading the executable instructions from the memory and executing the instructions to realize the network topology construction method provided by the embodiment of the present disclosure.

[0014] The embodiment of the present disclosure further provides a computer readable storage medium, which stores a computer program for executing the network topology construction method provided by the embodiment of the present disclosure.

[0015] The technical solution provided by the embodiment of the present disclosure has the following advantages compared with the prior art: the network topology construction method provided by the embodiment of the present disclosure acquires network attribute information of each network device included in the current network segment, and the number of network devices is multiple; multiple device sets are constructed based on the survival time in the network attribute information of each network device; the multiple device sets are processed in matrix form to determine the topology relationship of each network device, and the network topology of the current network segment is constructed based on the topology relationship. By using the above technical solution, after constructing multiple device sets from the network attribute information of multiple network devices in the current network segment, the topology relationship between network devices is determined by processing the multiple device sets in matrix form, which can improve the calculation efficiency of topology relationship determination, reduce the labor cost and time cost, and further improve the efficiency of network topology relationship construction. BRIEF DESCRIPTION OF DRAWINGS

[0016] The accompanying drawings incorporated in the specification and constituting a part thereof illustrate embodiments consistent with the present disclosure and serve to explain the principles of the present disclosure together with the specification.

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0018] Figure 1 A flowchart of a network topology construction method provided by the embodiment of the present disclosure is shown in the figure.

[0019] Figure 2 A schematic diagram of matrix processing provided by the embodiment of the present disclosure is shown in the figure.

[0020] Figure 3 A flowchart of another network topology construction method provided by the embodiment of the present disclosure is shown in the figure.

[0021] Figure 4 A structure diagram of a network topology construction system provided by the embodiment of the present disclosure is shown in the figure.

[0022] Figure 5 A schematic diagram of a network topology construction apparatus provided in an embodiment of this disclosure;

[0023] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0024] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0025] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0026] In related technologies, network topology is constructed through active probing. However, the use of queuing to process data when determining the topological relationships of network devices can lead to slow data processing and low efficiency, resulting in low efficiency in network topology construction. To address these issues, this disclosure provides a method for constructing a network topology, which will be described below with reference to specific embodiments.

[0027] Figure 1 This is a flowchart illustrating a method for constructing a network topology according to an embodiment of the present disclosure. This method can be executed by a network topology construction device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes:

[0028] Step 101: Obtain the network attribute information of each network device included in the current network segment. There are multiple network devices.

[0029] The current network segment can be the network segment currently undergoing network topology construction, and may include one or more network segments. The type of the current network segment is not limited; for example, the current network segment can be a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), etc. The network device can be a device in the current network segment that connects nodes such as servers and terminals to form an information communication network. In this embodiment of the disclosure, the network device can include various types of devices, such as virtual machines, switches, routers, etc.

[0030] The network attribute information can be related attribute information of the network device when performing information communication. The network attribute information can include various information, for example, the network attribute information can include a port, a protocol, an Internet Protocol (IP) address, and Trace information, and the Trace information can include a Time To Live (TTL).

[0031] The network topology construction apparatus can scan all network devices in the current network segment by using an active probe model, obtain network attribute information of each network device, and store the network attribute information of each network device in a database for subsequent use.

[0032] In step 102, a plurality of device sets are constructed based on the Time To Live in the network attribute information of each network device.

[0033] The Time To Live can be used to limit the time for which a data packet of a network device exists in the network. A device set can be a set including a plurality of network devices.

[0034] In some embodiments, constructing a plurality of device sets based on the Time To Live in the network attribute information of each network device includes: for a plurality of network devices, combining network devices with the same Time To Live to obtain a corresponding device set, and obtaining a plurality of device sets.

[0035] After obtaining the network attribute information of each network device included in the current network segment, the network topology construction apparatus can place network devices with the same Time To Live in a plurality of network devices in a device set based on the Time To Live of each network device, and further obtain a plurality of device sets, each device set corresponding to a Time To Live.

[0036] In some embodiments, each device set is stored in a key-value pair manner, the key representing the Time To Live corresponding to the current device set, and the value representing a plurality of network devices included in the current device set.

[0037] In the key-value pair, the key is a keyword, and the value is a value. The embodiments of the present disclosure can create a key-value pair set, each key-value pair corresponding to a device set, the keyword in each key-value pair storing the Time To Live of the corresponding device set, and the value storing all network devices of the corresponding device set, which can be represented in an array form. In addition, different Time To Lives of the current network segment can also be stored in an array. By storing in a key-value pair manner, the data has the advantages of fast query speed, large amount of stored data, and support for high concurrency.

[0038] In step 103, the plurality of device sets are subjected to matrix processing to determine the topology relationship of each network device, and the network topology of the current network segment is constructed based on the topology relationship.

[0039] Matrix processing can be understood as treating the set of devices as a matrix for matrix calculations. Topology can be understood as the hierarchical connections between different network devices. Network topology can be a layout of connections representing the topological relationships between multiple network devices, and can be represented in the form of a graph.

[0040] For example, Figure 3 The flowchart illustrates another method for constructing a network topology provided in this embodiment. In one feasible implementation, step 103, "performing matrix processing on multiple device sets to determine the topological relationships of each network device," may include the following steps:

[0041] Step 301: Sort the multiple device sets in ascending order of survival time, and extract the two adjacent device sets from the multiple device sets to obtain multiple device set pairs.

[0042] The network topology construction device can first arrange the device sets in ascending order according to their lifespan. Then, it can extract two adjacent device sets as device set pairs in ascending order of lifespan, thus obtaining multiple device set pairs.

[0043] Step 302: Using the matrix multiplication rule, perform XOR calculation on the two matrices corresponding to the two device sets included in each device set to obtain the relation matrix.

[0044] The XOR operation can be a logical operation, where the rule is that if two values ​​are the same, it is true; if they are different, it is false. A relation matrix can be a matrix composed of multiple values ​​representing the hierarchical topological relationships between different network devices.

[0045] Optionally, the relationship matrix is ​​obtained by performing an XOR operation on the two matrices corresponding to the two device sets included in each device set pair using matrix multiplication rules. This includes: constructing two corresponding matrices for each device set pair; performing an XOR operation on the two matrices corresponding to each device set pair using matrix multiplication rules and determining the number of consecutive 1s in the XOR operation result to obtain the relationship matrix. In the relationship matrix, each calculation result represents the data value of the hierarchical topology relationship between the two network devices.

[0046] Optionally, the network attribute information also includes IP addresses. For each device set pair, two corresponding matrices are constructed, including: transposing the IP addresses of each network device included in the first device set in each device set pair into the column form of the matrix to obtain the first matrix, and using the IP addresses of each network device included in the second device set as the horizontal form of the matrix to obtain the second matrix.

[0047] The network topology construction device can construct two matrices for each pair of device sets, which can be represented as a first device set and a second device set. Specifically, the IP addresses of all network devices in the first device set can be transposed as the column expression to obtain the first matrix, and the IP addresses of all network devices in the second device set can be directly used as the horizontal expression to obtain the second matrix. That is, the first matrix contains only one column expression, and the second matrix contains only one horizontal expression. For the first and second matrices, matrix multiplication rules are applied, but XOR calculation is used instead of multiplication, and the number of consecutive 1s in the XOR result is determined. The result is a relation matrix, which includes multiple calculation results, each representing a data value indicating the hierarchical topology relationship between two network devices.

[0048] For example, suppose a set of devices includes a first set of devices with TTL = i and a second set of devices with TTL = i+1, where i is greater than or equal to 0 and less than the largest TTL. Then, transpose the IP addresses of each network device in TTL = i into a matrix to obtain the first matrix. Keep the IP addresses of each network device in TTL = i+1 unchanged as the horizontal expression of the matrix to obtain the second matrix. Expand using the matrix multiplication rules, but replace multiplication with XOR and determine the number of consecutive 1s in the XOR calculation result to obtain the relation matrix between the first matrix and the second matrix.

[0049] For example, suppose the first set of devices with TTL=2 includes three network devices with IP addresses 10.7.109.47, 10.7.109.31, and 10.7.109.2, and the second set of devices with TTL=1 includes one network device with IP address 10.7.109.1, then the first matrix can be represented as follows: The second matrix can be represented as [10.7.109.1]. The first and second matrices are expanded using the matrix multiplication rules, but the XOR operation is used instead of multiplication for calculation, and is represented as follows.

[0050] When performing an XOR operation on two IP addresses, you can first convert each IP address into its corresponding 32-bit binary number, and then perform the XOR operation bit by bit. The result of the XOR operation is then determined by the number of consecutive 1s in the result. For example, if 10.7.109.2 ⊆ 10.7.109.1, the binary number converted to 10.7.109.2 is 00001010000001110110110100000010, and the binary number converted to 10.7.109.1 is 00001010000001110110110100000001, the XOR result is 1111111111111111111111111111100, and the number of consecutive 1s is 30. Therefore, the result in the third column of the relation matrix is ​​30.

[0051] For example, Figure 2 This is a schematic diagram of a matrix processing method provided in an embodiment of the present disclosure, such as... Figure 2 As shown in the figure, this embodiment of the present disclosure illustrates the processing procedure for each pair of devices, where the two matrices corresponding to the two device sets are processed using matrix multiplication rules but with XOR operations instead of multiplication. Figure 2 The first matrix is ​​a 5x1 matrix, the second matrix is ​​a 1x5 matrix, and the resulting relation matrix is ​​a 5x5 matrix. The first value in the first matrix is ​​XORed with each value in the second matrix to obtain the calculation results in the first row of the relation matrix. This process is repeated to obtain the calculation results in each row of the relation matrix.

[0052] Step 303: Determine the corresponding hierarchical topology relationship based on the relationship matrix of each device set pair.

[0053] In this embodiment of the disclosure, determining the corresponding hierarchical topology relationship based on the relationship matrix of each set of devices may include: based on the relationship matrix of each set of devices, using the maximum matching principle to locate the two network devices corresponding to the largest data value in the relationship matrix that have a hierarchical topology relationship.

[0054] The network topology construction device locates the maximum data value in the relation matrix of each device set pair according to the maximum matching principle. The two network devices corresponding to the maximum data value have a hierarchical topology relationship. The hierarchical topology relationship of each device set pair is located by sampling in the above manner.

[0055] The network topology construction device can determine the topological relationships between different network devices by performing matrix processing on multiple sets of devices. Then, the network topology can be constructed based on the topological relationships and subsequently stored in a database and memory.

[0056] The network topology construction scheme provided in this disclosure involves obtaining network attribute information of multiple network devices within the current network segment; constructing multiple device sets based on the lifespan of each network device's network attribute information; performing matrix processing on the multiple device sets to determine the topological relationships between the network devices; and constructing the network topology of the current network segment based on these topological relationships. By employing this technical solution, after constructing multiple device sets from the network attribute information of multiple network devices within the current network segment, and then performing matrix processing on these multiple device sets to determine the topological relationships between the network devices, the computational efficiency of topology relationship determination can be improved, reducing manual and time costs, thereby enhancing the efficiency of network topology relationship construction.

[0057] For example, Figure 4 This is a schematic diagram of the structure of a network topology construction system provided in an embodiment of this disclosure, as shown below. Figure 4 As shown in the figure, an exemplary network topology construction system can be implemented through the above-mentioned network topology construction method. Specifically, the network topology construction system may include an active detection module 401, a preprocessing module 402, a data processing module 403, a database processing module 404, and a topology interface module 405. The arrows in the figure indicate the data flow direction that these modules can communicate with each other.

[0058] The active detection module 401 can be used to perform the above step 101, that is, to scan devices in one or more network segments and obtain network attribute information such as port, protocol, IP, trace, etc. of each network device in the network segment, and store the network attribute information of each network device in the database. After the database is completed, the data processing module is notified to process the scanned information.

[0059] The preprocessing module 402 can be used to perform step 102 above, that is, after the active probing process is completed, it reads the Trace information and IP information from the network attribute information of the network device from the library. The Trace information includes the TTL value of the current network device. A key-value set is created, where the key is the TTL value and the value represents an array of network devices with the same TTL value. All network devices with the same TTL value in the library are placed in a network device set and stored in an array. Then, the data is placed into the key-value set. Different TTL value sets are also stored in arrays. The arrays of network devices included in the current set are sorted from smallest to largest by comparing TTL values.

[0060] The data processing module 403 executes step 103 above, which involves sequentially extracting two network device sets, TTL=i and TTL=i+1, from the preprocessing results, where i is greater than or equal to 0 and less than the maximum TTL. Then, the IP addresses of each network device in the TTL=i set are transposed into a matrix, resulting in one matrix. The IP addresses of each network device in the TTL=i+1 set remain unchanged and are used as the matrix for another matrix. Following the matrix multiplication principle, the matrix is ​​expanded using the matrix multiplication rules, but with XOR instead of multiplication. The two matrices are then calculated to achieve the effect of calculating the subnet mask, i.e., calculating the data values ​​of the hierarchical topology relationship between two network devices, resulting in a relationship matrix. After obtaining the subnet mask matrix (which is the aforementioned relationship matrix), the topology relationship of the network devices in the TTL=i and TTL=i+1 sets can be quickly located in each row of the matrix according to the longest matching principle. This process is repeated cyclically until the maximum TTL value is reached.

[0061] The database processing module 404 can store the data in the database asynchronously after the data processing module has finished processing, while a copy of the result is stored in memory at the same time.

[0062] The topology interface module 405 is used to provide an interface (Application Programming Interface, API) for modifying network topology. When a topology structure that needs to be manually corrected occurs, the manually set data needs to be sent to the data processing module for algorithm processing first. After the processing is completed, the result is asynchronously stored in the database, and at the same time, the processing result is returned to the calling interface.

[0063] The network topology construction system of this disclosure employs various modules that cooperate with each other. During network topology construction, an active scanning program can proactively detect interconnected network devices and perform preliminary data cleaning on the detected response data before storing it in a database. Data can then be extracted from the database, matrix-processed, and processed using matrix multiplication, replacing multiplication with XOR. Based on the maximum matching principle, the topological relationships between upper and lower level devices are obtained. After processing, the data is stored in the database, and users can perform operations such as adding, deleting, modifying, and querying topology nodes on the gateway interface. The use of matrix concepts and XOR instead of multiplication requires only one execution and can derive data values ​​between upper and lower level topologies. Then, based on the maximum matching principle, the topological relationships between upper and lower levels can be established, which is more efficient than traditional loop calculation methods, reducing the manual and time costs of network topology construction and improving its efficiency and adaptability.

[0064] Figure 5This is a schematic diagram of a network topology construction apparatus provided in an embodiment of this disclosure. The apparatus can be implemented by software and / or hardware and is generally integrated into an electronic device. For example... Figure 5 As shown, the device includes:

[0065] The acquisition module 501 is used to acquire network attribute information of each network device included in the current network segment, wherein the number of network devices is multiple;

[0066] The collection module 502 is used to construct multiple device collections based on the lifespan information of each network device in the network attribute information;

[0067] The construction module 503 is used to perform matrix processing on the multiple device sets, determine the topological relationship of each network device, and construct the network topology of the current network segment based on the topological relationship.

[0068] Optionally, the collection module 502 is used for:

[0069] For multiple network devices, network devices with the same lifespan are grouped together to obtain a corresponding device set, resulting in multiple device sets.

[0070] Optionally, building module 503 includes:

[0071] The extraction unit is used to sort the multiple device sets in ascending order of survival time, and extract the pairwise adjacent device sets from the multiple device sets to obtain multiple device set pairs;

[0072] The matrix unit is used to perform an XOR operation on the two matrices corresponding to the two device sets in each device set using the matrix multiplication rule to obtain the relation matrix.

[0073] A relation unit is used to determine the corresponding hierarchical topological relationship based on the relation matrix of each of the device set pairs.

[0074] Optionally, matrix units are used for:

[0075] For each pair of device sets, construct two corresponding matrices;

[0076] Using the matrix multiplication rules, the XOR operation is performed on the corresponding two matrices for each set of devices, and the number of consecutive 1s in the XOR operation result is determined to obtain a relation matrix. In the relation matrix, each calculation result represents the data value of the hierarchical topology relationship between two network devices.

[0077] Optionally, relational units are used for:

[0078] Based on the relationship matrix of each set of devices, the maximum matching principle is used to locate the two network devices with a hierarchical topology relationship corresponding to the largest data value in the relationship matrix.

[0079] Optionally, the network attribute information also includes IP addresses, and the matrix unit is used for:

[0080] The first matrix is ​​obtained by transposing the IP addresses of each network device in the first device set into the column form of the matrix, and the second matrix is ​​obtained by taking the IP addresses of each network device in the second device set as the horizontal form of the matrix.

[0081] Optionally, each set of devices is stored in key-value pairs, where the key represents the lifespan of the current set of devices and the value represents the multiple network devices included in the current set of devices.

[0082] The network topology construction apparatus provided in this disclosure can execute the network topology construction method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of executing the method.

[0083] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Figure 6 As shown, the electronic device 600 includes one or more processors 601 and memory 602.

[0084] The processor 601 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 600 to perform desired functions.

[0085] The memory 602 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 601 may execute the program instructions to implement the network topology construction method of the embodiments of this disclosure described above and / or other desired functions. Various contents such as input signals, signal components, and noise components may also be stored in the computer-readable storage medium.

[0086] In one example, the electronic device 600 may also include an input device 603 and an output device 604, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0087] In addition, the input device 603 may also include, for example, a keyboard, a mouse, etc.

[0088] The output device 604 can output various information to the outside, including determined distance information, direction information, etc. The output device 604 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0089] Of course, for the sake of simplicity, Figure 6 Only some of the components of the electronic device 600 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 600 may include any other suitable components depending on the specific application.

[0090] In addition to the methods and devices described above, embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform the network topology construction method provided in the embodiments of this disclosure.

[0091] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0092] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the network topology construction method provided in embodiments of this disclosure.

[0093] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0094] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0095] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for constructing a network topology, characterized in that, include: Obtain network attribute information of each network device included in the current network segment, wherein there are multiple network devices; Based on the survival time in the network attribute information of each network device, multiple device sets are constructed; The multiple device sets are matrixed to determine the topological relationships of each network device, and the network topology of the current network segment is constructed based on the topological relationships. The step of performing matrix processing on the multiple device sets to determine the topological relationships of each network device includes: The multiple device sets are sorted in ascending order of survival time, and the device sets that are adjacent to each other are extracted to obtain multiple device set pairs; By using matrix multiplication rules, the two matrices corresponding to the two device sets included in each device set are subjected to XOR calculation to obtain the relation matrix; The corresponding hierarchical topological relationships are determined based on the relationship matrix of each set of devices.

2. The method according to claim 1, characterized in that, Based on the lifespan information of each network device in its network attribute information, multiple device sets are constructed, including: For multiple network devices, network devices with the same lifespan are grouped together to obtain a corresponding device set, resulting in multiple device sets.

3. The method according to claim 1, characterized in that, Using matrix multiplication rules, the two matrices corresponding to the two device sets included in each device set are subjected to XOR operation to obtain the relation matrix, including: For each pair of device sets, construct two corresponding matrices; Using the matrix multiplication rules, the XOR operation is performed on the corresponding two matrices for each set of devices, and the number of consecutive 1s in the XOR operation result is determined to obtain a relation matrix. In the relation matrix, each calculation result represents the data value of the hierarchical topology relationship between two network devices.

4. The method according to claim 3, characterized in that, Determining the corresponding hierarchical topological relationships based on the relationship matrix of each set of devices includes: Based on the relationship matrix of each set of devices, the maximum matching principle is used to locate the two network devices with a hierarchical topology relationship corresponding to the largest data value in the relationship matrix.

5. The method according to claim 3, characterized in that, The network attribute information also includes IP addresses. For each of the device sets, two corresponding matrices are constructed, including: The first matrix is ​​obtained by transposing the IP addresses of each network device in the first device set into the column form of the matrix, and the second matrix is ​​obtained by taking the IP addresses of each network device in the second device set as the horizontal form of the matrix.

6. The method according to any one of claims 1-5, characterized in that, Each set of devices is stored in key-value pairs, where the key represents the lifespan of the current set of devices, and the value represents the multiple network devices included in the current set of devices.

7. A network topology construction apparatus, characterized in that, include: The acquisition module is used to acquire network attribute information of each network device included in the current network segment, wherein there are multiple network devices; The collection module is used to construct multiple device collections based on the lifespan information of each network device in the network attribute information; A construction module is used to perform matrix processing on the multiple device sets, determine the topological relationship of each network device, and construct the network topology of the current network segment based on the topological relationship; The building module includes: The extraction unit is used to sort the multiple device sets in ascending order of survival time, and extract the pairwise adjacent device sets from the multiple device sets to obtain multiple device set pairs; The matrix unit is used to perform an XOR operation on the two matrices corresponding to the two device sets in each device set using the matrix multiplication rule to obtain the relation matrix. A relation unit is used to determine the corresponding hierarchical topological relationship based on the relation matrix of each of the device set pairs.

8. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the network topology construction method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for executing the network topology construction method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Network topology detection method and device

    CN110430080A