CN116633800A - Method, device, equipment and medium for constructing network topology - Google Patents

Method, device, equipment and medium for constructing network topology Download PDF

Info

Publication number
CN116633800A
CN116633800A CN202310709988.8A CN202310709988A CN116633800A CN 116633800 A CN116633800 A CN 116633800A CN 202310709988 A CN202310709988 A CN 202310709988A CN 116633800 A CN116633800 A CN 116633800A
Authority
CN
China
Prior art keywords
network
equipment
matrix
constructing
sets
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310709988.8A
Other languages
Chinese (zh)
Inventor
章小敏
李勇
万志宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Tianrongxin Network Security Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Original Assignee
Zhuhai Tianrongxin Network Security Technology Co ltd
Beijing Topsec Technology Co Ltd
Beijing Topsec Network Security Technology Co Ltd
Beijing Topsec Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Tianrongxin Network Security Technology Co ltd, Beijing Topsec Technology Co Ltd, Beijing Topsec Network Security Technology Co Ltd, Beijing Topsec Software Co Ltd filed Critical Zhuhai Tianrongxin Network Security Technology Co ltd
Priority to CN202310709988.8A priority Critical patent/CN116633800A/en
Publication of CN116633800A publication Critical patent/CN116633800A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/14Network analysis or design
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies

Abstract

The embodiment of the disclosure relates to a method, a device, equipment and a medium for constructing a network topology, wherein the method comprises the following steps: acquiring network attribute information of each network device included in a current network segment, wherein the number of the network devices is a plurality of network devices; constructing a plurality of device sets based on the survival time in the network attribute information of each network device; and carrying out matrixing treatment on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation. By adopting the technical scheme, after the plurality of equipment sets are constructed for the network attribute information of the plurality of network equipment in the current network segment, the topological relation among the network equipment is determined by carrying out matrixing processing on the plurality of equipment sets, so that the calculation efficiency of the topological relation determination can be improved, the labor cost and the time cost are reduced, and the efficiency of constructing the network topological relation is further improved.

Description

Method, device, equipment and medium for constructing network topology
Technical Field
The disclosure relates to the field of network technologies, and in particular, to a method, a device, equipment and a medium for constructing a network topology.
Background
With the development of internet of things technology, the number of devices in the internet is increasing, which results in the network topology formed by the devices becoming more and more complex. In order to clearly reveal and reasonably utilize network resources, network topology needs to be combed and constructed.
Network devices are usually added manually in network topology, and this way has long processing time and low efficiency, and at the same time, fault tolerance rate exists. In order to solve the above-mentioned problems, in the related art, a network topology is constructed by an active probing method, but the efficiency in determining the topology relationship of the network device is low, which results in low construction efficiency of the network topology.
Disclosure of Invention
In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, an apparatus, a device, and a medium for constructing a network topology.
The embodiment of the disclosure provides a method for constructing a network topology, which comprises the following steps:
acquiring network attribute information of each network device included in a current network segment, wherein the number of the network devices is a plurality of network devices;
constructing a plurality of device sets based on the survival time in the network attribute information of each network device;
and carrying out matrixing processing on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation.
The embodiment of the disclosure also provides a device for constructing the network topology, which comprises:
the acquisition module is used for acquiring network attribute information of each network device included in the current network segment, wherein the number of the network devices is a plurality of network devices;
the aggregation module is used for constructing a plurality of device aggregates based on the survival time in the network attribute information of each network device;
the construction module is used for carrying out matrixing processing on the plurality of equipment sets, determining the topological relation of each network equipment and constructing the network topology of the current network segment based on the topological relation.
The embodiment of the disclosure also provides an electronic device, which comprises: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement a method for constructing a network topology according to an embodiment of the present disclosure.
The embodiments of the present disclosure also provide a computer-readable storage medium storing a computer program for executing the method of constructing a network topology as provided by the embodiments of the present disclosure.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages: according to the construction scheme of the network topology, which is provided by the embodiment of the disclosure, network attribute information of each network device in a current network segment is acquired, and the number of the network devices is multiple; constructing a plurality of device sets based on the survival time in the network attribute information of each network device; and carrying out matrixing treatment on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation. By adopting the technical scheme, after the plurality of equipment sets are constructed for the network attribute information of the plurality of network equipment in the current network segment, the topological relation among the network equipment is determined by carrying out matrixing processing on the plurality of equipment sets, so that the calculation efficiency of the topological relation determination can be improved, the labor cost and the time cost are reduced, and the efficiency of constructing the network topological relation is further improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a flow chart of a method for constructing a network topology according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a matrixing process provided in an embodiment of the present disclosure;
fig. 3 is a flow chart of another method for constructing a network topology according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a system for constructing a network topology according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a device for constructing a network topology according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein; it will be apparent that the embodiments in the specification are only some, but not all, embodiments of the disclosure.
In the related art, a network topology is built through an active detection mode, but when the topological relation of network equipment is determined, data is processed through a queue mode, so that the data processing is slow, the efficiency is low, and the building efficiency of the network topology is low. In order to solve the above-mentioned problems, the embodiments of the present disclosure provide a method for constructing a network topology, and the method is described below with reference to specific embodiments.
Fig. 1 is a flow chart of a method for constructing a network topology according to an embodiment of the present disclosure, where the method may be performed by a device for constructing a network topology, and the device may be implemented by using software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 1, the method includes:
step 101, obtaining network attribute information of each network device included in the current network segment, where the number of network devices is multiple.
The current network segment may be a network segment currently performing network topology construction, may include one or more network segments, and is not limited in type, for example, the current network segment may be a local area network, a metropolitan area network, a wide area network, or the like. The network device may be a device in the current network segment that connects nodes such as a server and a terminal to form an information communication network, and in the embodiment of the present disclosure, the network device may include multiple types of devices, such as a virtual machine, a switch, a router, and the like.
The network attribute information may be related attribute information when the network device performs information communication, and may include various information, for example, the network attribute information may include a port, a protocol, an IP address (Internet Protocol Address), route Trace (Trace) information, and the like, and the route Trace information may include Time To Live (TTL).
The construction device of the network topology can scan all network devices in the current network segment by utilizing the active detection model, acquire the network attribute information of each network device, and store the network attribute information of each network device into a database for later use.
Step 102, constructing a plurality of device sets based on the survival time in the network attribute information of each network device.
The time-to-live may be used to limit the time that a packet of one network device is present in the network. The device set may be a set comprising a plurality of network devices.
In some embodiments, constructing a plurality of device sets based on time-to-live in network attribute information for each network device includes: and combining the network devices with the same survival time for a plurality of network devices to obtain corresponding device sets to obtain a plurality of device sets.
After obtaining the network attribute information of each network device included in the current network segment, the network topology constructing apparatus may place the network devices with the same survival time in the plurality of network devices in one device set based on the survival time of each network device, so as to obtain a plurality of device sets, where each device set corresponds to one survival time.
In some embodiments, each device set is stored in a key value pair, the key representing a time-to-live corresponding to the current device set, the value representing a plurality of network devices included in the current device set.
Wherein, in the key-value pair (key-value), key is a key and value is a value. The embodiment of the disclosure can create a key value pair set, each key value pair corresponds to one device set, each key value pair key word stores the survival time of the corresponding device set, and all network devices of the corresponding device set are stored in values and can be characterized in an array form. Also, the different survival times included in the current network segment may be stored in an array. Through key value pair mode storage, the data has the advantages of high inquiry speed, large data storage quantity, high concurrency support and the like.
And 103, carrying out matrixing processing on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation.
The matrixing process is understood to be a process of calculating a matrix by using each device set as a matrix. The topology relationship can be understood as a connection relationship of upper and lower levels between different network devices. The network topology may be a connection structure layout, which may be characterized in the form of a graph, that characterizes the topological relationships between a plurality of network devices.
For example, fig. 3 is a flowchart of another method for constructing a network topology according to an embodiment of the present disclosure, in a possible implementation manner, the feature "matrixing a plurality of device sets to determine a topology relationship of each network device" in step 103 may include the following steps:
step 301, sorting the multiple device sets according to the survival time from small to large, and extracting every two adjacent device sets in the multiple device sets to obtain multiple device set pairs.
Aiming at a plurality of equipment sets, the construction device of the network topology can firstly arrange the equipment sets according to the survival time of each equipment set from small to large; and then sequentially extracting two adjacent device sets as device set pairs according to the sequence from the smaller survival time to the larger survival time, so that a plurality of device set pairs can be obtained.
And 302, performing exclusive nor calculation on two matrixes corresponding to the two device sets included in each device set pair by utilizing a matrix multiplication rule to obtain a relation matrix.
The nor calculation may be a logical operation whose algorithm is true for both values and false for the difference. The relationship matrix may be a matrix of a plurality of values characterizing the upper and lower level topological relationships between different network devices.
Optionally, performing a union or calculation on two matrices corresponding to two device sets included in each device set pair by using a matrix multiplication rule to obtain a relationship matrix, including: constructing two corresponding matrixes for two device sets included in each device set pair; and carrying out exclusive nor calculation on the two corresponding matrixes of each equipment set by utilizing a matrix multiplication rule, and determining the number of continuous 1 for exclusive nor calculation results to obtain a relation matrix, wherein each calculation result in the relation matrix represents a data value of the upper-level topological relation between two network equipment.
Optionally, the network attribute information further includes an IP address, and for two device sets included in each device set pair, constructing two corresponding matrices, including: the method comprises the steps of transposing the IP addresses of the network devices included in a first device set in each device set into columns of a matrix to obtain a first matrix, and transversing the IP addresses of the network devices included in a second device set into a second matrix.
The construction device of the network topology can construct two device sets included in each device set pair into two matrixes, the two device sets can be expressed as a first device set and a second device set, in the specific construction, a first matrix can be obtained by transposing the IP addresses of all network devices included in the first device set into columns of the matrixes, and a second matrix can be obtained by directly taking the IP addresses of all network devices included in the second device set as the horizontal of the matrixes, namely the first matrix only comprises one column, and the second matrix only comprises one horizontal. For the first matrix and the second matrix, a matrix multiplication rule is utilized, but a same or calculation is used for replacing multiplication, and the number of continuous 1 s is determined for the same or calculation result, so that the calculation result is a relation matrix, wherein the relation matrix comprises a plurality of calculation results, and each calculation result represents a data value of an upper-level topological relation between two network devices.
For example, assume that a device set pair includes a first device set with ttl=i and a second device set with ttl=i+1, where i is greater than or equal to 0 and i is less than the maximum TTL, then transpose each network device IP address in ttl=i into a column of a matrix to obtain a first matrix, hold each network device IP address in ttl=i+1 unchanged as a horizontal of the matrix to obtain a second matrix, and develop the matrix multiplication rule, but replace multiplication with an exclusive nor mode and determine the number of consecutive 1 for the exclusive nor calculation result, so as to obtain a relationship matrix of the first matrix and the second matrix.
For example, assuming that three network devices are included in the first device set with ttl=2, IP addresses 10.7.109.47, 10.7.109.31, and 10.7.109.2, respectively, and one network device is included in the second device set with ttl=1, IP address 10.7.109.1, the first matrix may be expressed asSecond matrix canDenoted as [10.7.109.1 ]]The first matrix and the second matrix are developed using matrix multiplication rules, but are calculated by the same or method instead of multiplication, expressed as
When the two IP addresses are subjected to the exclusive nor calculation, the two IP addresses may be converted into corresponding 32bit binary numbers respectively, and then the exclusive nor calculation may be performed according to the bits to obtain an exclusive nor calculation result, and the number of consecutive 1 s of the exclusive nor calculation result is determined to be the final calculation result, for example, 10.7.109.2 l0.7.109.1, the binary number converted by 10.7.109.2 is 00001010000001110110110100000010, the binary number converted by 10.7.109.1 is 00001010000001110110110100000001, the exclusive nor calculation result is 111111111111111111111111111100, and the number of consecutive 1 s is 30, that is, the calculation result of the third column in the relation matrix is 30.
Exemplary, fig. 2 is a schematic diagram of matrixing processing provided in the embodiment of the present disclosure, as shown in fig. 2, which illustrates a processing procedure of multiplying two matrices corresponding to two device sets in each device set pair by using a matrix multiplication rule but replacing multiplication by a same or method in the embodiment of the present disclosure, where a first matrix in fig. 2 is a matrix of 5*1, a second matrix is a matrix of 1*5, an obtained relationship matrix is a matrix of 5*5, and the first value in the first matrix is respectively equal to or calculated with each value in the second matrix, so as to obtain each calculation result of the first row in the relationship matrix, and sequentially calculate, so as to obtain each calculation result of each row in the relationship matrix.
Step 303, determining corresponding upper and lower level topological relations based on the relation matrix of each device set pair.
In the embodiment of the present disclosure, determining a corresponding upper and lower level topological relationship based on a relationship matrix of each device set pair may include: based on the relation matrix of each device set pair, the maximum matching principle is utilized to position that two network devices corresponding to the maximum data value in the relation matrix have upper and lower topological relations.
The construction device of the network topology aims at a relation matrix of each equipment set pair, a maximum data value is positioned in the relation matrix according to a maximum matching principle, two network equipment corresponding to the maximum data value have upper and lower topological relations, and each equipment set pair is used for positioning the upper and lower topological relations in the mode.
The device for constructing the network topology can determine the topological relation of different network devices by carrying out matrixing processing on a plurality of device sets, can construct the network topology according to the topological relation, and can store the network topology into a database and a memory.
According to the construction scheme of the network topology, which is provided by the embodiment of the disclosure, network attribute information of each network device in a current network segment is acquired, and the number of the network devices is multiple; constructing a plurality of device sets based on the survival time in the network attribute information of each network device; and carrying out matrixing treatment on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation. By adopting the technical scheme, after the plurality of equipment sets are constructed for the network attribute information of the plurality of network equipment in the current network segment, the topological relation among the network equipment is determined by carrying out matrixing processing on the plurality of equipment sets, so that the calculation efficiency of the topological relation determination can be improved, the labor cost and the time cost are reduced, and the efficiency of constructing the network topological relation is further improved.
Fig. 4 is a schematic structural diagram of a system for constructing a network topology according to an embodiment of the present disclosure, and as shown in fig. 4, an exemplary system for constructing a network topology is shown, through which the above method for constructing a network topology may be implemented, where a specific system for constructing a network topology may include an active detection module 401, a preprocessing module 402, a data processing module 403, a repository processing module 404, and a topology interface module 405, and arrows in the figure indicate directions of data flows that may be communicated with each other between the modules.
The active probing module 401 may be configured to perform the above step 101, that is, scan devices in one or more network segments, obtain network attribute information such as a port, a protocol, an IP, a trace, etc. of each network device in the network segment, store the network attribute information of each network device in a database, and notify the data processing module to process the scanned information after the repository is completed.
The preprocessing module 402 may be configured to execute the step 102, that is, after the active probing process is completed, read Trace information and IP information in network attribute information of the network device from a library, where the Trace information includes a TTL value of the current network device. Creating a key-value set, wherein a key is a TTL value, the value represents an array of a network device set with the same TTL value, placing all network devices with the same TTL value in a library in the network device set and storing the network devices with the array, then placing data in the key-value set, storing different TTL value sets with the array, and arranging the arrays of the network devices included in the current set from small to large in a mode that the TTL value is taken as a comparison object.
The data processing module 403 is configured to execute the above step 103, that is, sequentially take out two network device sets of ttl=i and ttl=i+1 from the preprocessing result, where i is greater than or equal to 0 and i is less than the maximum TTL, then transpose the IP address of each network device in the network device set of ttl=i into the column form of the matrix to obtain a matrix, keep the IP address of each network device in the network device set of ttl=i+1 unchanged as the column form of the matrix to obtain another matrix, develop according to the multiplication thinking of the matrix by using the matrix multiplication rule, but replace multiplication by the same or mode to calculate the two matrices, so as to achieve the effect of calculating the subnet mask, that is, calculate the data value of the upper and lower topological relationship between the two network devices, and obtain the relationship matrix. The matrix of the subnet mask, that is, the relationship matrix, is obtained), the topology relationship of the network devices in the set of ttl=i and ttl=i+1 can be quickly located according to the longest matching principle in each row in the matrix, and the topology relationship is circularly and sequentially processed according to the algorithm until the maximum TTL value is finished.
The repository processing module 404 may store the data into the database in an asynchronous manner after the data processing module processes the data, while the results are stored in a memory.
The topology interface module 405 is configured to provide an interface (Application Programming Interface, API) for modifying a network topology, when a topology structure requiring manual correction occurs, it is required to transmit manually set data to the data processing module to perform algorithm processing first, and after the processing is completed, asynchronously store a result in the database, and at the same time return a processing result to the calling interface.
When the network topology is built, network equipment in interconnection can be actively detected through an active scanning program, detected response data are subjected to primary data cleaning and then stored in a library, then data can be extracted from the library, matrix processing is performed on the data, then the matrix multiplication thought is utilized to process the data in a same or a mode instead of multiplication, the topology connection of upper and lower equipment is obtained based on the maximum matching principle, the data are stored in a database after the processing is completed, and the data are supported on a gateway interface, so that a user can perform operations such as adding, deleting, modifying and the like on topology nodes. The method is characterized in that the concept of a matrix is utilized, multiplication is replaced by an exclusive OR mode, the algorithm is only needed to be executed once, the data value between the upper level topology and the lower level topology can be obtained, then the topology relation between the upper level topology and the lower level topology can be established according to the principle of maximum matching, the method is more efficient than the traditional cyclic calculation mode, the labor cost and the time cost generated by network topology construction are reduced, and the efficiency and the adaptability of the network topology construction are improved.
Fig. 5 is a schematic structural diagram of a network topology construction apparatus according to an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in an electronic device. As shown in fig. 5, the apparatus includes:
an obtaining module 501, configured to obtain network attribute information of each network device included in a current network segment, where the number of the network devices is a plurality of network devices;
a collection module 502, configured to construct a plurality of device collections based on the survival time in the network attribute information of each of the network devices;
a construction module 503, configured to perform matrixing processing on the multiple device sets, determine a topology relationship of each network device, and construct a network topology of the current network segment based on the topology relationship.
Optionally, the aggregation module 502 is configured to:
and combining the network devices with the same survival time for a plurality of network devices to obtain a corresponding device set to obtain a plurality of device sets.
Optionally, the constructing module 503 includes:
the extraction unit is used for sequencing the plurality of equipment sets according to the survival time from small to large, and extracting every two adjacent equipment sets in the plurality of equipment sets to obtain a plurality of equipment set pairs;
the matrix unit is used for carrying out the same or calculation on two matrixes corresponding to the two equipment sets included in each equipment set pair by utilizing a matrix multiplication rule to obtain a relation matrix;
and the relation unit is used for determining corresponding upper and lower topological relations based on the relation matrix of each equipment set pair.
Optionally, the matrix unit is configured to:
constructing two corresponding matrixes for two equipment sets included in each equipment set pair;
and carrying out exclusive nor calculation on the two corresponding matrixes of each equipment set by utilizing a matrix multiplication rule, and determining the number of continuous 1 for exclusive nor calculation results to obtain a relation matrix, wherein each calculation result in the relation matrix represents a data value of an upper-level topological relation between two network equipment.
Optionally, the relationship unit is configured to:
based on the relation matrix of each equipment set pair, positioning that two network equipment corresponding to the maximum data value in the relation matrix has an upper-lower topological relation by utilizing the maximum matching principle.
Optionally, the network attribute information further includes an IP address, and the matrix unit is configured to:
the IP addresses of the network devices included in the first device set in the device set pair are transposed into columns of a matrix to obtain a first matrix, and the IP addresses of the network devices included in the second device set are used as horizontal of the matrix to obtain a second matrix.
Optionally, each device set is stored in a key value mode, the key words represent survival time corresponding to the current device set, and the values represent a plurality of network devices included in the current device set.
The device for constructing the network topology provided by the embodiment of the disclosure can execute the method for constructing the network topology provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. As shown in fig. 6, the electronic device 600 includes one or more processors 601 and memory 602.
The processor 601 may be a Central Processing Unit (CPU) or other form of processing unit having data processing and/or instruction execution capabilities and may control other components in the electronic device 600 to perform desired functions.
The memory 602 may include one or more computer program products that 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 (cache), and the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, and the like. One or more computer program instructions may be stored on the computer readable storage medium that can be executed by the processor 601 to implement the method of constructing a network topology and/or other desired functions of the embodiments of the present disclosure described above. Various contents such as an input signal, a signal component, a noise component, and the like may also be stored in the computer-readable storage medium.
In one example, the electronic device 600 may further include: input device 603 and output device 604, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
In addition, the input device 603 may also include, for example, a keyboard, a mouse, and the like.
The output device 604 may output various information to the outside, including the determined distance information, direction information, and the like. The output means 604 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, etc.
Of course, only some of the components of the electronic device 600 that are relevant to the present disclosure are shown in fig. 6, with components such as buses, input/output interfaces, etc. omitted for simplicity. In addition, the electronic device 600 may include any other suitable components depending on the particular application.
In addition to the methods and apparatus described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the method of constructing a network topology provided by embodiments of the present disclosure.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium, on which computer program instructions are stored, which when executed by a processor, cause the processor to perform the method of constructing a network topology provided by the embodiments of the present disclosure.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for constructing a network topology, comprising:
acquiring network attribute information of each network device included in a current network segment, wherein the number of the network devices is a plurality of network devices;
constructing a plurality of device sets based on the survival time in the network attribute information of each network device;
and carrying out matrixing processing on the plurality of equipment sets, determining the topological relation of each network equipment, and constructing the network topology of the current network segment based on the topological relation.
2. The method of claim 1, wherein constructing a plurality of device sets based on the time-to-live in the network attribute information for each of the network devices comprises:
and combining the network devices with the same survival time for a plurality of network devices to obtain a corresponding device set to obtain a plurality of device sets.
3. The method of claim 1, wherein matrixing the plurality of device sets to determine a topology for each of the network devices comprises:
sorting the plurality of equipment sets according to the survival time from small to large, and extracting every two adjacent equipment sets in the plurality of equipment sets to obtain a plurality of equipment set pairs;
performing exclusive nor calculation on two matrixes corresponding to the two equipment sets included in each equipment set pair by utilizing a matrix multiplication rule to obtain a relation matrix;
and determining corresponding upper and lower topological relations based on the relation matrix of each equipment set pair.
4. A method according to claim 3, wherein the performing a union or calculation on two matrices corresponding to two device sets included in each of the device set pairs using a matrix multiplication rule to obtain a relationship matrix comprises:
constructing two corresponding matrixes for two equipment sets included in each equipment set pair;
and carrying out exclusive nor calculation on the two corresponding matrixes of each equipment set by utilizing a matrix multiplication rule, and determining the number of continuous 1 for exclusive nor calculation results to obtain a relation matrix, wherein each calculation result in the relation matrix represents a data value of an upper-level topological relation between two network equipment.
5. The method of claim 4, wherein determining the corresponding upper and lower level topological relationship based on the relationship matrix for each of the device set pairs comprises:
based on the relation matrix of each equipment set pair, positioning that two network equipment corresponding to the maximum data value in the relation matrix has an upper-lower topological relation by utilizing the maximum matching principle.
6. The method of claim 4, wherein the network attribute information further includes an IP address, and constructing two corresponding matrices for two device sets included in each device set pair includes:
the IP addresses of the network devices included in the first device set in the device set pair are transposed into columns of a matrix to obtain a first matrix, and the IP addresses of the network devices included in the second device set are used as horizontal of the matrix to obtain a second matrix.
7. The method of any of claims 1-6, wherein each of the device sets is stored in a key value pair, a key representing a corresponding time-to-live for a current device set, and a value representing a plurality of network devices included in the current device set.
8. A network topology constructing apparatus, comprising:
the acquisition module is used for acquiring network attribute information of each network device included in the current network segment, wherein the number of the network devices is a plurality of network devices;
the aggregation module is used for constructing a plurality of device aggregates based on the survival time in the network attribute information of each network device;
the construction module is used for carrying out matrixing processing on the plurality of equipment sets, determining the topological relation of each network equipment and constructing the network topology of the current network segment based on the topological relation.
9. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method for constructing a network topology according to any one of the preceding claims 1-7.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the method of constructing a network topology according to any of the preceding claims 1-7.
CN202310709988.8A 2023-06-14 2023-06-14 Method, device, equipment and medium for constructing network topology Pending CN116633800A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310709988.8A CN116633800A (en) 2023-06-14 2023-06-14 Method, device, equipment and medium for constructing network topology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310709988.8A CN116633800A (en) 2023-06-14 2023-06-14 Method, device, equipment and medium for constructing network topology

Publications (1)

Publication Number Publication Date
CN116633800A true CN116633800A (en) 2023-08-22

Family

ID=87641820

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310709988.8A Pending CN116633800A (en) 2023-06-14 2023-06-14 Method, device, equipment and medium for constructing network topology

Country Status (1)

Country Link
CN (1) CN116633800A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117354164A (en) * 2023-12-05 2024-01-05 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117354164A (en) * 2023-12-05 2024-01-05 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure
CN117354164B (en) * 2023-12-05 2024-02-20 长沙先度科技有限公司 Automatic generation method of Ethernet topology structure

Similar Documents

Publication Publication Date Title
CN108984155B (en) Data processing flow setting method and device
CN105224606A (en) A kind of disposal route of user ID and device
CN112052404B (en) Group discovery method, system, equipment and medium of multi-source heterogeneous relation network
CN108008936B (en) Data processing method and device and electronic equipment
JPWO2019241422A5 (en)
CN116633800A (en) Method, device, equipment and medium for constructing network topology
CN109783805B (en) Network community user identification method and device and readable storage medium
US20220005546A1 (en) Non-redundant gene set clustering method and system, and electronic device
CN109561163B (en) Method and device for generating uniform resource locator rewriting rule
CN111143359A (en) Query statement generation method and device
US10339151B2 (en) Creating federated data source connectors
CN108549688B (en) Data operation optimization method, device, equipment and storage medium
CN108170602B (en) Test case generation method and device, terminal and computer readable medium
US11762730B2 (en) Selection of outlier-detection programs specific to dataset meta-features
JP2007034878A (en) Information processing method, information processor, and information processing program
CN109710633B (en) Method and device for determining man-in-middle information and intelligent terminal
CN107644103B (en) Method and system for storing traceable information source information
CN105677827B (en) A kind of acquisition methods and device of list
CN115033616A (en) Data screening rule verification method and device based on multi-round sampling
CN114611039A (en) Asynchronous loading rule analysis method and device, storage medium and electronic equipment
CN114064125A (en) Instruction analysis method and device and electronic equipment
CN114047926A (en) Method, device and equipment for converting array calculation expression language and storage medium
CN111723246B (en) Data processing method, device and storage medium
CN113536762A (en) JSON text comparison method and device
CN112380418B (en) Data processing method and system based on web crawler and cloud platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination