Method and device for establishing network topology, electronic equipment and computer storage medium
By using non-end node devices in the communication network for address transfer and branch vector collection, the topology vector tree is constructed, which solves the network storm and information loss caused by large-scale data transmission in network topology discovery, and realizes efficient address configuration and network topology structure collection.
Patent Information
- Application Number
- CN202510141449.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-13
AI Technical Summary
In a communication network based on the controller-device model, network storms and information loss problems caused by large-scale data transmission during network topology discovery.
Reference address information is obtained through non-end node devices, and address transmission is performed in the network topology through neighbor information exchange, receiving branch vectors collected by the end node devices through address, and building a topology vector tree to establish a network topology.
It realizes that the topology address information is automatically allocated and network topology structure information is collected without the need for a controller to configure each device address separately, avoiding problems caused by large-scale data transmission, and improving address configuration efficiency and network topology discovery efficiency.
Smart Images

Figure CN119996215A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of communication technology, and in particular to a method, device, electronic device, and computer storage medium for establishing a network topology. Background Art
[0002] Currently, in a communication network based on a controller and device model, in order to better establish communication, the controller needs to determine the location of the device to plan communication characteristic parameters.
[0003] Usually, network topology discovery requires the controller to preset or scan the devices and connection boundaries in the network online to obtain network scale and connection information. However, this method will cause a large amount of data information to occupy the transmission bandwidth in the network, and at the same time, large-scale data transmission may cause network storms or devices may receive too much information, resulting in information loss. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to provide a method, device, electronic device and computer storage medium for establishing a network topology, thereby avoiding problems caused by large-scale data transmission during network topology discovery.
[0005] To achieve the above object, an embodiment of the present application provides a method for establishing a network topology, wherein the method for establishing a network topology is applied to a non-terminal node device in the network topology, and includes:
[0006] Acquire reference address information, and perform address delivery in the network topology by exchanging neighbor information based on the reference address information;
[0007] Receiving a branch vector obtained by collecting addresses from at least one end node device in the network topology;
[0008] A topology vector tree is constructed according to the branch vectors, and the topology vector tree is used to establish the network topology.
[0009] In one embodiment, the network topology includes at least one linear topology;
[0010] The linear topology includes a node device, or a plurality of node devices linearly connected via a first port and a second port;
[0011] A node device in the linear topology is connected to the second port or branch port of the non-end node device.
[0012] In one embodiment, at the connection of the linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0013] In one embodiment, the step of performing address delivery in the network topology by exchanging neighbor information based on the reference address information includes:
[0014] generating a data packet based on the reference address information;
[0015] The data packet is sent to the neighboring node device in the network topology through the second port and / or branch port of the non-end node device, so that each of the neighboring node devices transmits the data packet in the network topology by exchanging neighbor information, and topology address information is respectively assigned to all the node devices in the network topology; wherein the neighboring node device is connected to the non-end node device through the first port or the second port, and the topology address information is used to identify the unique position of each of the node devices in the network topology.
[0016] In one embodiment, the topological address information includes location information, and the location information is used to indicate the order of the node devices in the linear topology.
[0017] In one embodiment, the topology address information further includes port information, where the port information is used to indicate a branch port of a second node device in a second linear topology connected to a first linear topology where the first node device is located.
[0018] In one embodiment, the first linear topology and the second linear topology both include the terminal node device, and the device connected to the terminal node device through the first port belongs to the same linear topology or an adjacent linear topology as the terminal node device.
[0019] In one embodiment, the second port of the end node device is not connected to other node devices or the non-end node devices.
[0020] In one embodiment, the device to which the terminal node device is connected through the second port does not belong to the same linear topology as the terminal node device.
[0021] In one embodiment, the step of receiving a branch vector obtained by address collection by at least one end node device in the network topology includes:
[0022] A branch vector is received by at least one end node device in the network topology through collecting n+1 level branch location address, n+1 level branch port information, the number of n level branch devices, and n-1 level branch connection information.
[0023] In one embodiment, the non-end node device has an identifier, and the identifier is used to refer to the topology vector tree.
[0024] In one embodiment, the non-end node device updates the topology vector tree based on a preset period.
[0025] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a method for establishing a network topology, wherein the method for establishing a network topology is applied to a terminal node device in the network topology, and includes:
[0026] Receiving topology address information allocated by non-terminal node devices in the network topology through address transmission;
[0027] Address collection is performed according to the topological address information to obtain branch vectors, and the branch vectors are sent to the non-end node devices so that the non-end node devices construct a topological vector tree according to the branch vectors, and the topological vector tree is used to establish the network topology.
[0028] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a device for establishing a network topology, wherein the device for establishing a network topology is applied to a non-terminal node device in the network topology, including:
[0029] A sending module, the sending module is used to obtain reference address information, and perform address transmission in the network topology by exchanging neighbor information based on the reference address information;
[0030] A receiving module, the receiving module is used to receive a branch vector obtained by address collection by a node device at at least one end of the network topology;
[0031] A processing module is used to construct a topology vector tree according to the branch vectors, and the topology vector tree is used to establish the network topology.
[0032] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a device for establishing a network topology, wherein the device for establishing a network topology is applied to a node device at the end of the network topology, including:
[0033] A receiving module, the receiving module is used to receive topology address information allocated by non-end node devices in the network topology through address transmission;
[0034] A sending module, wherein the sending module is used to collect addresses according to the topological address information to obtain branch vectors, and send the branch vectors to the non-terminal node devices, so that the non-terminal node devices construct a topological vector tree according to the branch vectors, and the topological vector tree is used to establish the network topology.
[0035] In addition, to achieve the above-mentioned purpose, an embodiment of the present application also provides an electronic device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the method for establishing a network topology as described above is implemented.
[0036] In addition, to achieve the above-mentioned purpose, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for establishing a network topology as described above is implemented.
[0037] The embodiment of the present application proposes a method, device, electronic device and computer storage medium for establishing a network topology. In the method for establishing a network topology, reference address information is first obtained by a non-terminal node device, and then the address is transmitted in the network topology by exchanging neighbor information based on the reference address information. This can realize automatic allocation of topological address information for each device in the network topology, without spending a lot of time to configure the address of each device separately through the controller, saving a lot of time and improving the efficiency of address configuration; after completing the automatic address allocation, the non-terminal node device can receive a branch vector obtained by address collection by at least one terminal node device in the network topology, which is equivalent to completing the scanning of the entire network topology and collecting the topological address information of each device in the network topology, and there is no need to collect the address information of each device separately through the controller, avoiding the problems caused by large-scale data transmission in the process of network topology discovery; finally, the non-terminal node device can construct a topology vector tree for establishing the network topology according to the branch vector, and the topology vector tree includes the structural information of the network topology in which the non-terminal node device is located. When an external device needs to obtain information about the network topology, the non-terminal node device can transmit the information about the network topology to the external device through the topology vector tree. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only part of the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A flowchart of a method for establishing a network topology provided in one embodiment of the present application;
[0040] Figure 2 A schematic diagram of a network topology structure involved in a method for establishing a network topology provided in an embodiment of the present application;
[0041] Figure 3 A schematic diagram of the structure of topology address information involved in a method for establishing a network topology provided in one embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of another network topology involved in a method for establishing a network topology provided in an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of another network topology involved in a method for establishing a network topology provided in an embodiment of the present application;
[0044] Figure 6 A schematic diagram of a structure of a terminal node device loop determination involved in a method for establishing a network topology provided in an embodiment of the present application;
[0045] Figure 7 A schematic diagram of the structure of a branch vector involved in a method for establishing a network topology provided in one embodiment of the present application;
[0046] Figure 8 A flowchart of address collection involved in a method for establishing a network topology provided in one embodiment of the present application;
[0047] Fig. 9 A schematic diagram of the structure of a device for establishing a network topology provided in one embodiment of the present application;
[0048] Fig.10 A flowchart of a method for establishing a network topology provided in another embodiment of the present application;
[0049] Fig.11 A schematic diagram of the structure of a device for establishing a network topology provided in another embodiment of the present application;
[0050] Fig.12 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0051] At present, real-time industrial Ethernet communication based on Ethernet is widely used. In the communication network based on the controller and device model, in order to better establish communication, the controller needs to determine the location of the device to plan the communication characteristic parameters.
[0052] Typically, network topology discovery requires the controller to preset or scan the devices and connection boundaries in the network online to obtain network scale and connection information (such as topology). In order to obtain information about each device, a lot of work is required to configure the address of each device individually and obtain the device connection relationship in the network by accessing each device.
[0053] In related technologies, most methods of obtaining device information are to pre-configure device information, search one by one through the controller, or broadcast data with special tags through the controller. After obtaining such directed frames, the target device group replies to inform the controller that the device is in the network, and then uses Ethernet technology to search and configure the devices one by one, and uses standard open protocols such as LLDP (Link Layer Discovery Protocol) and SNMP (Simple Network Management Protocol) to obtain device topology information in the network.
[0054] In various Ethernet-based communication protocols in related technologies (including standard Ethernet protocols), either the controller searches for each device one by one, or multicasts information to check responses to determine the online devices; or the device actively informs the controller, which requires the device to periodically report its online information when it is not connected to the controller. Both methods (controller actively searches, device actively reports information) have the following defects: the more devices there are in the network, the more data information will occupy the transmission bandwidth in the network, and at the same time, large-scale data transmission may cause network storms or devices may receive excessive information, resulting in information loss.
[0055] Network topology discovery is an important step in real-time networks, but there is currently no standard protocol to solve the above problems. Network management protocols in related technologies must provide basic protocol processing agents, which slows down the discovery cycle and requires a lot of work to process information. For example, SNMP scanning requires additional supporting framework support, and SNMP communication requires a large amount of data and complex operations to obtain the current topology.
[0056] In addition, if a problem occurs in a single device or network segment in an Ethernet industrial automation system, the controller needs to explore and configure each new device or device in the network segment one by one after replacing the new device, which means that it takes a lot of time from replacing the device in the network to restoring normal operation.
[0057] Based on this, the embodiments of the present application provide a method, device, electronic device and computer storage medium for establishing a network topology. In the method for establishing a network topology, reference address information is first obtained by a non-terminal node device, and then the address is transmitted in the network topology through neighbor information exchange based on the reference address information. This can realize automatic allocation of topology address information to each device in the network topology, without spending a lot of time to configure the address of each device separately through the controller, saving a lot of time and improving the efficiency of address configuration; after completing the automatic address allocation, the non-terminal node device can receive a branch vector obtained by address collection by at least one terminal node device in the network topology, which is equivalent to completing the scanning of the entire network topology and collecting the topological address information of each device in the network topology, and there is no need to collect the address information of each device separately through the controller, avoiding the problems caused by large-scale data transmission in the process of network topology discovery; finally, the non-terminal node device can construct a topology vector tree for establishing the network topology according to the branch vector, and the topology vector tree includes the structural information of the network topology in which the non-terminal node device is located. When an external device needs to obtain information about the network topology, the non-terminal node device can transmit the information about the network topology to the external device through the topology vector tree.
[0058] The method, device, electronic device and computer storage medium for establishing a network topology provided in the embodiments of the present application are specifically described through the following embodiments. First, the method for establishing a network topology in the embodiments of the present application is described.
[0059] Reference Figure 1 , Figure 1 A flow chart of a method for establishing a network topology provided in an embodiment of the present application is provided. The method for establishing a network topology is applied to non-terminal node devices in the network topology, such as Figure 1 As shown, the method for establishing a network topology provided in this embodiment includes steps S10 to S30:
[0060] Step S10, obtaining reference address information, and performing address transfer in the network topology by exchanging neighbor information based on the reference address information;
[0061] In this embodiment, the network topology is an Ethernet topology structure composed of multiple node devices. The non-end node device serving as the execution subject is a node device in the network topology that is connected to an external device of the network topology. The external device may be a controller or a non-control communication node. When the external device is a controller, the reference address information may be address information transmitted by the controller to the non-end node device. When the external device is a non-control communication node, the reference address information may be address information generated by the non-end node device when detecting that an external device is connected.
[0062] In this embodiment, the process of automatically allocating addresses to each node device in the network topology triggered by a non-end node device is called "address rollout". In this process, the non-end node device will use the reference address information as its own address information in the network topology, and transfer its own address information to at least one neighbor device connected to the non-end node device through neighbor information exchange, so that the neighbor device accumulates fields based on the address information of the non-end node device, thereby realizing automatic allocation of address information to the neighbor device. The periodic interval of neighbor information exchange can be flexibly configured according to actual needs, and can carry invalid or valid topology information fields, which is not limited in this embodiment.
[0063] As an example, assuming that the reference address information of a non-terminal node device is n, then after its neighbor device learns this information, it will configure its own address information as n+1. Similarly, another neighbor device connected to this neighbor device will configure its own address information as n+2, and so on. That is, the non-terminal node device is only the starting point of address transfer. Each neighbor device that has transferred address information through the non-terminal node device will continue to perform the address transfer process to other neighbor devices connected to it until the node devices in the entire network topology have completed the allocation of address information.
[0064] As an example, in this embodiment, after the address information sent by the sending end is received by the receiving end, the receiving end can return its modified new topological address information to the sending end as a neighbor to confirm that the address setting is successful.
[0065] Step S20, receiving a branch vector obtained by address collection by at least one end node device in the network topology;
[0066] In this embodiment, the end node device can be a node device with only one neighbor device in the network topology, that is, after it completes its own address information configuration based on the address information from the forward neighbor device, if no other node devices are added to the network topology, the end node device cannot receive the address information returned from another neighbor device, but the end node device can periodically send the topology address information managed by itself backward. In this way, when a new node device accesses the network topology by connecting to the end node device, the connection link between the two can be quickly configured, and the address information of the new node device in the network topology can also be automatically configured in time, saving a lot of time for configuring the new device separately. At the same time, the new node device will replace its original end node device as the new end node device in the network topology.
[0067] In this embodiment, after the terminal node device completes the address configuration, the process triggered by the terminal node device to describe the connection information between the node devices in the network topology with a smaller amount of information and collect it into the non-terminal node device is called "address collection (Rollin)". This process is equivalent to collecting the connection information between the node devices in the network topology step by step along the path of automatic address allocation until it is returned to the non-terminal node device. Obviously, this process does not require the participation of the controller, which overcomes the defects of the traditional technical means of the controller accessing and collecting information from each device one by one, which is too cumbersome and time-consuming, and too much data information occupies a large amount of transmission bandwidth, significantly improves the efficiency of information collection, and reduces bandwidth pressure.
[0068] In this embodiment, the address collection process can also be implemented by means of neighbor information exchange, that is, the end node device will generate a return data packet based on its own information and connection information with other node devices, and return the return data packet along the address transmission path to the neighbor device connected to the end node device by means of neighbor information exchange, so that the neighbor device also adds its own information and connection information with other node devices to the return data packet, and continues to return the return data packet along the address transmission path until the return data packet reaches the non-end node device that triggered the address transmission. At this time, the return data packet is equivalent to carrying a branch vector of the linear topology where the end node device is located. The branch vector contains the connection information between all node devices in the linear topology with the non-end node device and the end node device as the head and tail. If there are n end node devices in the network topology, the non-end node device can receive n branch vectors through the address collection process.
[0069] Step S30: construct a topology vector tree according to the branch vectors, and the topology vector tree is used to establish a network topology.
[0070] In this embodiment, taking the case where a non-terminal node device receives multiple branch vectors as an example, since each branch vector contains the connection relationship between the non-terminal node device and its neighboring devices, the non-terminal node device itself can be used as the root node device of the topology vector tree. According to each branch vector, multiple branch connections are extended from the root node device to form different branches of the topology vector tree, thereby completing the construction of the topology vector tree.
[0071] As an example, in this embodiment, the topology vector tree can be regarded as a series of strings composed of all branch vectors in the network topology. The topology vector tree may include at least one topology vector subtree, which can be regarded as a group of strings composed of at least one branch vector in the network topology. The branch vector can be implemented by a combination of two-byte numbers and characters. A branch vector is used to mark a linear topology branch in the network topology.
[0072] In some feasible embodiments, the above network topology includes at least one linear topology; the linear topology includes a node device, or multiple node devices linearly connected through a first port and a second port; a node device in a linear topology is connected to a second port or a branch port of a non-end node device.
[0073] In this embodiment, the linear topology includes at least one node device, the first port can be regarded as a primary port or a receiving port, and the second port can be regarded as a secondary port or a sending port, that is, each node device constituting the network topology is equipped with at least two types of ports, a receiving port and a sending port. A linear connection relationship can be established between each node device through the receiving port and the sending port to form a linear topology. In a linear topology composed of multiple node devices linearly connected through the first port and the second port, the first port of the first node device and the second port of the last node device are not connected, so as to prevent the linear topology from becoming a ring topology.
[0074] In this embodiment, the node device may also be equipped with a branch port. In this way, in addition to forming a linear topology through the main port and the secondary port, different node devices belonging to different linear topologies can also establish connections through the branch port to jointly form a tree network topology or a star network topology.
[0075] It should be noted that in this embodiment, the first port of the non-end node device is the port connected to the external device of the network topology. Therefore, when other node devices in the network topology are connected to the non-end node device, they are generally connected to the second port or branch port of the non-end node device.
[0076] As an example, this embodiment provides Figure 2 The schematic diagram of a network topology is shown to help understand the linear topology and the definition of each port. Figure 2In the figure, the network topology includes 7 linear topologies 101, 102, 103, 104, 105, 106 and 107, wherein the linear topology 101 includes node device 1, node device 2, node device 3 and node device 4, the linear topology 102 includes node device 5 and node device 6, the linear topology 103 includes node device 7 and node device 8, the linear topology 104 includes node device 9, node device 10 and node device 11, the linear topology 105 includes node device 12 and node device 13, the linear topology 106 includes node device 14 and node device 15, and the linear topology 107 includes node device 16. It can be seen that the node devices belonging to the same linear topology are connected through the primary and secondary ports. For example, port a is the primary port of node device 8, port b is the secondary port of node device 7, and port c is the branch port of node device 2 or node device 3.
[0077] It is understandable that although Figure 2 Only a network topology including 7 linear topologies is shown in the figure, but the method for establishing a network topology provided in this embodiment can also be applied to a network topology including only 1 linear topology, a network topology including 2 linear topologies, or a network topology including other numbers of linear topologies. Figure 2 It does not represent a restriction on the specific number of linear topologies in the network topology.
[0078] In some feasible embodiments, at the connection of linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0079] It should be noted that, in this embodiment, a network topology may include multiple levels of linear topologies. Taking the first linear topology as a higher-level linear topology and the second linear topology as a lower-level linear topology as an example, the node devices in the linear topology of the previous level can be connected to the node devices in the linear topology of the next level through branch ports. A node device can have multiple branch ports. Different linear topologies formed by node devices extended based on the branch ports of different node devices in the same linear topology belong to the same level. The hierarchical height / upper and lower order of linear topologies of different levels can be defined according to the priority order of information transmission, but it does not mean that there is a difference in the advantages and disadvantages of node devices of different levels.
[0080] As an example, combining Figure 2It can be seen that the linear topology 101 is connected to the linear topology 102 through the node device 2 and the node device 5, and a branch port of the node device 2 is connected to the first port or the second port of the node device 5; the linear topology 101 is connected to the linear topology 103 through the node device 3 and the node device 7, and the branch port of the node device 3 is connected to the first port or the second port of the node device 7; the linear topology 101 is connected to the linear topology 104 through the node device 2 and the node device 9, and another branch port of the node device 2 is connected to the first port or the second port of the node device 9; the linear topology 104 is connected to the linear topology 105 through the node device 10 and the node device 12, and a branch port of the node device 10 is connected to the first port or the second port of the node device 12; the linear topology 104 is connected to the linear topology 106 through the node device 10 and the node device 14, and another branch port of the node device 10 is connected to the first port or the second port of the node device 14; the linear topology 101 is connected to the linear topology 107 through the node device 4 and the node device 16, and the branch port of the node device 4 is connected to the first port or the second port of the node device 16; Figure 2 In the figure, linear topology 101 belongs to the first level, linear topologies 102, 103, 104 and 107 are all linear topologies based on branch port expansion of node devices in linear topology 101, belonging to the second level, linear topologies 105 and 106 are all linear topologies based on branch port expansion of node devices in linear topology 104, belonging to the third level. In addition, the first level can be regarded as the highest level, the second level can be regarded as the next level of the first level, and the third level can be regarded as the next level of the second level, which is not limited in this embodiment.
[0081] In some feasible embodiments, the step of performing address delivery in the network topology by exchanging neighbor information based on the reference address information in the above step S10 may specifically include:
[0082] Step S11, generating a data packet based on the reference address information;
[0083] Step S12, sending the data packet to the neighboring node device in the network topology through the second port and / or branch port of the non-end node device, so that each neighboring node device transmits the data packet in the network topology by exchanging neighbor information, and assigning topology address information to all node devices in the network topology respectively; wherein, the neighboring node device is connected to the non-end node device through the first port or the second port, and the topology address information is used to identify the unique position of each node device in the network topology.
[0084] In this embodiment, the non-end node device will use the reference address information as its own address information in the network topology, package the reference address information with other invalid or valid topology information fields to form a data packet, and transmit the data packet to at least one neighbor device connected to the non-end node device through neighbor information exchange, so that the neighbor device uses the address information of the non-end node device as a reference for field accumulation, thereby realizing automatic allocation of topology address information to the neighbor device based on the data packet. In this process, the neighbor device will also add its own configured address information to the data packet, and continue to transmit the data packet to its own neighbor device until all node devices in the network topology have completed the automatic allocation of topology address information. The periodic interval for neighbor information exchange between node devices in the network topology can be flexibly configured according to actual needs, and this embodiment does not limit this.
[0085] As an example, in this embodiment, the topology address information can be described as a number, a letter, or a combination of the two, so as to form a descriptor that is unique to each node device in the network topology.
[0086] In some feasible embodiments, the above-mentioned topological address information may include location information, and the location information is used to indicate the order of the node devices in the linear topology.
[0087] In this embodiment, taking the case where the network topology only includes one linear topology and the linear topology does not have other branches as an example, since the first port of the non-end node device is connected to the external device of the network topology, when the address is transferred starting from the non-end node device, the non-end node device can be used as the first node device of the linear topology, and its position information is set to 0. The position information of the first node device connected to the non-end node device is accumulated on the basis of the position information of the non-end node device, that is, it is set to 1. The position information of the second node device connected to the first node device is accumulated on the basis of the position information of the first node device, that is, it is set to 2, and so on. Since there is only one linear topology, and the connection method of the linear topology is to establish a linear connection through the first port and the second port, there is no need to identify the ports. The exact position of each node device in the network topology can be clearly seen only through the position information. If there is more than one linear topology in the network topology, and a connection relationship is established between different linear topologies, the topological address information that only contains the position information cannot clearly indicate the position of the node device in the network topology.
[0088] In some feasible embodiments, the above topology address information may further include port information, where the port information is used to indicate a branch port of a second node device in a second linear topology connected to a first linear topology where the first node device is located.
[0089] In this embodiment, in order to clearly describe the exact location of node devices in linear topologies of different levels in the network topology, the topology address information, in addition to the location information mentioned in the above embodiment, also needs to include port information. At the same time, since the connection between different linear topologies is generally established through the branch port of a node device and the first port or the second port of another node device, the port information is used to indicate the branch port to clearly reflect the relative position relationship of the node devices in different linear topologies.
[0090] As an example, see Figure 3 , Figure 3 A schematic diagram of the structure of topological address information is provided. Figure 3 It can be seen that the topological address information carried in the above data packet includes location information 110 and port information 120. For a network topology that only contains a single linear topology, the topological address information only needs to include the location information field. Because a single linear topology does not have an upper or lower level, there is no need for port information to describe such a connection relationship. For multi-level connections, port information is required to describe the connection relationship between each linear topology. Taking a linear topology that is divided into the first level, the second level, and the third level from top to bottom as an example, the port information carried by each node device in the second level indicates a branch port of a node device in the first level. Similarly, the port information carried by each node device in the third level indicates a branch port of a node device in the second level.
[0091] As an example, this embodiment also provides Figure 4 The schematic diagram of another network topology is shown to assist in understanding the above embodiments. Figure 4 In the figure, the network topology includes node devices Dev1 to Dev9. Since Dev1 is connected to the external device CTL of the network topology (this figure mark is equivalent to the abbreviation of Controller, indicating the controller), Dev1 can be regarded as a non-terminal node device of the network topology. Dev1 can start the process of automatic address allocation through the reference address information transmitted by the controller. When not configured, the location information and port information (branch port) of all node devices in the default network topology are 0, and the hierarchical default value is 1.
[0092] When the address transfer process starts from Dev1 and spreads to other locations, it can be allocated according to the path of linear topology set by the node device. Figure 4 Dev1 can form a linear topology with the node devices Dev7 and Dev4 on its upper and lower sides, or can form a linear topology with the node devices Dev2 and Dev3 on its right side. This embodiment takes Dev1, Dev2 and Dev3 forming a linear topology as an example for explanation.
[0093] The first device to be addressed by the non-end node device Dev1 sets its own topological address information to 1, and then transmits the topological address information to subsequent neighbor devices in the linear topology through neighbor information exchange. Each node device (Dev2 to Dev9) will increase the address field of the received forward neighbor's topological address information, and forward the new topological address information to the next neighbor device through its own secondary port; in addition, the node device Dev1 with a branch port in layer 1 will also add the branch port connected to other node devices as port information to the topological address information, and at the same time increase the topological address information by a level, which can be identified by an additional field, and forwarded to the node devices Dev4 and Dev7 in layer 2 by the branch port connected to other linear topologies.
[0094] After receiving the topological address information from the sender, the node device at the receiving end can also transmit the modified new topological address information back to the neighboring device at the sending end to inform the node device at the sending end to confirm that the topological address information of the receiving end has been successfully set. Figure 4 As shown, CTL sends (optional) to Dev1, and Dev1 returns 1 to CTL; Dev1 sends 1 to Dev2, and Dev2 returns 2 to Dev1; Dev2 sends 2 to Dev3, and Dev3 returns 3 to Dev2; Dev1 sends 1(1), 0 to Dev4, and Dev4 returns 1(1), 1 to Dev1; Dev4 sends 1(1), 1 to Dev5, and Dev5 returns 1(1), 2 to Dev4; Dev5 sends 1(1), 2 to Dev6, and Dev6 returns 1(1), 3 to Dev5; Dev1 sends 1(2), 0 to Dev7, and Dev7 returns 1(2), 1 to Dev1; Dev7 sends 1(2), 1 to Dev8, and Dev8 returns 1(2), 2 to Dev7; Dev8 sends 1(1), 2 to Dev9, and Dev9 returns 1(2), 3 to Dev8.
[0095] In this embodiment, for the node devices Dev3, Dev6 and Dev9 at the end of each linear topology, they will periodically send the topological address information they manage to the secondary port. This will enable the disconnected connection link to be quickly and automatically restored when a new node device is connected to the secondary port, so that the newly connected node device can generate its own unique address in the network based on the topological address information provided by the forward device, thereby achieving the effect of quickly accessing the network topology and identifying new node devices.
[0096] In combination with the above embodiments, it can be known that in the process of address transmission, the data packet contains the following information: the order information of the node device in the current linear topology (for example, the second "1" in "1(2),1" indicates the first device in the linear topology); the port information at the connection between the current lower-level linear topology and the previous-level linear topology (for example, "1(2)" in "1(2),1" indicates the second branch port of the node device Dev1 with position information 1). After knowing the above information, the position of a node device in the network topology can be accurately described.
[0097] In addition, as an example, refer to Figure 5 , Figure 5 A structural diagram of another network topology is provided, which shows a situation in which another unknown device (Dev5) is inserted into a known network topology (161 and 162). In this case, the address transfer process mentioned in the above embodiment will not spread through the unknown device or unknown network segment, that is, the address transfer processes of 161 and 162 do not interfere with each other, and a connection will not be established between the two because Dev5 is connected to Dev1 and Dev6 respectively.
[0098] In some feasible embodiments, each of the above-mentioned linear topologies includes a terminal node device, and the device to which the terminal node device is connected through the first port belongs to the same linear topology or an adjacent linear topology as the terminal node device.
[0099] It is understandable that, since the end node device is the starting point for executing the address collection process, it is necessary to first determine which node devices belong to the end node devices. As an example, in the case where there are multiple node devices in a linear topology, the node device at the end of the linear topology is connected to the forward neighbor device only through the first port, so the node device is the node device at the end of the linear topology; in the case where a linear topology only contains one node device, the node device is connected to the branch port of a node device in the adjacent linear topology through the first port, and the node device is the only node device in its linear topology, and can also be regarded as the node device at the end of its linear topology.
[0100] As an example, combining Figure 2 It can be seen that when node device 1 is regarded as a non-end node device, node device 4, node device 6, node device 8, node device 11, node device 13 and node device 15 belong to the end node devices in linear topology 101, linear topology 102, linear topology 103, linear topology 104, linear topology 105 and linear topology 106 respectively, and node device 16 is the only node device in linear topology 107 and is also the end node device in linear topology 107.
[0101] In some feasible embodiments, the second port of the terminal node device is not connected to other node devices or non-terminal node devices.
[0102] In this embodiment, the second port of the terminal node device will not establish a connection with other devices, that is, the simplest way to determine the terminal node device is to detect whether its second port is connected to other devices. Figure 2 The node devices at each end can be determined by observing whether the second port is connected to other devices, wherein node device 4 is connected to node device 16 via a branch port, that is, the second port of node device 4 is not connected to other devices, which meets the judgment basis.
[0103] In some feasible embodiments, the device to which the terminal node device is connected through the second port and the terminal node device do not belong to the same linear topology.
[0104] In this embodiment, even if the second port of the terminal node device establishes a connection with other devices, as long as the node device connected to the second port of the terminal node device is not in the same linear topology as the terminal node device, it will not affect the identification of the terminal node device. In the case that the terminal node device establishes a connection with other devices through the second port, a loop judgment is required. If the node device connected to the terminal node device through the second port is in the same linear topology as the terminal node device, it will obviously cause the linear topology to become a ring topology, which will affect the address collection process.
[0105] It can be seen from the above embodiments that due to the exchange of neighbor information during the address transmission process, the node device in the linear topology serving as the third branch can obtain the connection position with the node device in the linear topology of the first branch. After obtaining the topological address information, the node device also has the ability to determine whether the linear topology is connected to form a loop, that is, it can discover whether there are redundant connections in the network topology.
[0106] As an example, see Figure 6 , assuming that node device a and node device b in the linear topology 170 in the nth level are connected to node device c and node device d in the n+1th level (171 to 173) respectively, then it can be checked whether a loop is formed in the following way:
[0107] In the case where node device c and node device d are connected through the primary and secondary ports, first check whether the topological address information of each node device (a / b) in the linear topology 170 in the nth level of the path and the topological address information of itself (c / d) contain the same path. If so, it means that node device c is connected by node device a, that is, the topological address information in node device c contains the topological address information of node device a. Therefore, it can be inferred that node device c is connected to node device a in the nth level. Similarly, it can be inferred that node device d is connected to node b. Figure 6 The topological address information of node devices a and b comes from a node device at the n-1th layer, and the topological address information of node devices c and d comes from node device a at the nth layer. It can be seen that when the topological address information of node device b connected to node device d is less than n layers and the topological address information less than n layers contained in node device d itself is the same, then it is judged that the node devices a and b connected by node devices c and d are in the same linear topology. Based on this, it can be known that node devices a, b, c, d form a loop.
[0108] When node device c and node device d are connected through a branch port, the information used to describe the n layer in the topological address information of node devices c and d is different, because the topological address information of node devices c and d comes from different node devices, that is, the topological address information of node device c carries the topological address information of node device a in the nth layer, and the topological address information of node device d carries the address information of node device b in the nth layer; therefore, node devices c and d only need to determine whether node devices a and b are node devices connected to the same linear topology to determine whether a loop is formed. Similarly, topological address information less than n layers is obtained from the topological address information of node devices c and d for comparison. If they are the same, it means that a loop has been formed in the nth layer. Otherwise, the same mechanism can be used to continue to search for loop branches in the upper layer (n-1, n-2, etc.).
[0109] In some feasible embodiments, the above step S20 may specifically include:
[0110] Step S21, receiving a branch vector obtained by collecting n+1 level branch location address, n+1 level branch port information, number of n level branch devices, and n-1 level branch connection information from at least one end node device in the network topology.
[0111] In this embodiment, taking a network topology with multiple linear topologies as an example, linear topologies at different levels can be divided into n+1-level branches, n-level branches, and n-1-level branches, wherein the n-level branch can be regarded as the current linear topology, the n+1-level branch can be regarded as the linear topology of the previous level of the n-level branch, and the n-1-level branch can be regarded as the linear topology of the next level of the n-level branch. Figure 7The branch vector obtained by the terminal node device through the address collection process may include the n+1-level branch location address (141), the n+1-level branch port information (142), the number of n-level branch devices (143) and the n-1-level branch connection information (144). Each linear topology branch in the network topology can be identified by a branch vector (e.g., 151, 152, 153), and the entire network topology can be described using a complete branch vector tree (150).
[0112] It should be noted that the n+1 level branch location address (141) and the n+1 level branch port information (142) do not exist for a network topology with only one linear topology, because it has no connection with other branches, so there is no need to identify the previous level in this type of network topology.
[0113] In this embodiment, the address collection process includes collecting various types of structural information and connection information in the network topology, as shown in Table 1 below. During the collection process, a string or tag can be used to identify the n+1 level branch location address, n+1 level branch port information, the number of n level branch devices, and n-1 level branch connection information.
[0114] Table 1
[0115]
[0116] In this embodiment, the address collection process of the automatic scanning topology can be combined with Figure 8 It is understood that when a node device in the network topology finds that the secondary port has no information received, or the received information shows that the connected backward device cannot be added to the current linear connection, it means that the node device is the end node device in the network topology, and the address collection process is triggered from the end node device.
[0117] It can be seen from the above embodiments that in the process of address transmission, each node device is assigned topological address information, so it also knows its own order information in the current linear topology, and thus knows how many node devices are in the current linear topology. At this time, if the current linear topology where the terminal node device is located has no next-level connection, then each terminal node device respectively combines the number of branch devices (y) of its own linear topology plus the n-1-level branch connection information (s) into a branch vector (ys) of the current linear topology and sends it forward to the neighboring device through the main port (for example, in layer 2 (2) Device 1(2),3, device 3 in layer 1, and device 1(1),3 in layer 2(1) send 3s to neighboring devices 1(2),2, device 2, and device 1(1),2 respectively) until the node device receiving the branch vector is connected to other devices at the next level as a branch device (that is, device 1 is connected to device 2, device 1(1),1, and device 1(2),1 respectively). At this time, the connection vectors (3s, 3s, 3s) from all branches need to be merged. Combined with the field description in Table 1 above, the following vector conversion steps can be obtained:
[0118] For layer 1, there are n-1 levels of branch connections in its linear topology, so the n-1 level branch connection information in the branch vector collected by layer 1 needs to be modified to t (that is, 3s transmitted by device 2 is modified to 3t, as shown in the first row of Table 2 below); for the first n-1 level branch layer 2(1) of layer 1 in layer 2, the connected n+1 level branch information must be added with the connected n+1 level branch port information, that is, when 3s in layer 2(1) is forwarded to device 1, since its n+1 level branch position address is 1, the n+1 level branch port information is the connected port 1, and the n+1 level branch device has subsequent ports connected to other n-1 level branches, the branch information of layer 2(1) is The information collected is 1f, 3s, as shown in the second row of Table 2 below; according to the same rule, since the second n-1-level branch layer 2 (2) of layer 1 in layer 2 is the last n-1-level branch connected to the current device 1, the branch information obtained after adding the n+1-level branch location address and n+1-level branch port information is 1e, 3s, as shown in the third row of Table 2 below. At this time, device 1 adds all subsequent connected n-1-level branches in order (for example, from small to large) to the topology vector of the n-level branch, and the topology vector tree of the current network topology can be obtained (3t)-(1f, 3s)-(1e, 3s), as shown in the fourth row of Table 2 below. At this point, the construction of the topology vector tree is completed.
[0119] Table 2
[0120] Layer 1 3s changed to 3t Layer 2(1) 3s changed to 1f,3s Layer 2(2) 3s changed to 1e,3s Topological vector tree (3t)-(1f,3s)-(1e,3s)
[0121] At this time, the information of the topology vector tree may be stored in the device 1 which is a non-terminal node device. The topology vector tree may be provided to the devices in need, and the device 1 itself may also use the topology vector tree to establish the network topology.
[0122] In some feasible embodiments, the non-end node device updates the topology vector tree based on a preset period.
[0123] In this embodiment, since the address collection process is implemented by exchanging neighbor information, it is necessary to periodically transmit and update the current state of the network topology, and update the information of all topology vector trees to non-end node devices for establishing the network topology. It can be understood that the preset period can be flexibly configured according to actual needs, and this embodiment does not limit this.
[0124] In some feasible embodiments, the non-end node device has an identifier, and the identifier is used to refer to the topology vector tree.
[0125] In this embodiment, it should be noted that when there are unknown devices in the entire network topology, according to the principle of address transfer, each known network segment will perform a complete address transfer behavior starting from the node device connected to the unknown device; at this time, the address collection operation is also performed in each separate network segment, triggered by the end node device and the branch vector is collected, and forwarded to the non-end node device of each network segment to complete the construction of the topology vector tree; at this time, each network segment can be collected through the identifier of the non-end node device in each network segment.
[0126] As an example, the identifier of a non-end node device may include at least a MAC address (Media Access Control Address), an IP address (Internet Protocol Address), a topological address, a chassis ID (Identity document, serial number), etc. Other information used to identify or recognize the identity of a non-end node device may also be used as an identifier, but this embodiment does not impose any restrictions on this.
[0127] This embodiment provides a method for establishing a network topology, in which a non-terminal node device first obtains reference address information, and then transmits the address in the network topology based on the reference address information by exchanging neighbor information. This can achieve automatic allocation of topology address information for each device in the network topology, without spending a lot of time to configure the address of each device individually through a controller, saving a lot of time and improving the efficiency of address configuration. After the automatic address allocation is completed, the non-terminal node device can receive a branch vector obtained by address collection by at least one terminal node device in the network topology, which is equivalent to completing the scanning of the entire network topology and collecting the topological address information of each device in the network topology. There is no need to collect the address information of each device individually through the controller, avoiding the problems caused by large-scale data transmission in the process of network topology discovery. Finally, the non-terminal node device can construct a topology vector tree for establishing the network topology based on the branch vector. The topology vector tree includes the structural information of the network topology in which the non-terminal node device is located. When an external device needs to obtain information about the network topology, the non-terminal node device can transmit the information about the network topology to the external device through the topology vector tree.
[0128] In addition, the present application also provides a device for establishing a network topology, referring to Fig. 9 , Fig. 9 A schematic diagram of a structure of a device for establishing a network topology provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, in this embodiment, the device for establishing a network topology is applied to a non-end node device in the network topology, and includes a sending module 10 , a receiving module 20 and a processing module 30 .
[0129] The sending module 10 is used to obtain reference address information, and perform address transmission in the network topology by exchanging neighbor information based on the reference address information;
[0130] The receiving module 20 is used to receive a branch vector obtained by collecting addresses from at least one end node device in the network topology;
[0131] The processing module 30 is used to construct a topology vector tree according to the branch vectors, and the topology vector tree is used to establish a network topology.
[0132] In some possible embodiments, the network topology includes at least one linear topology;
[0133] The linear topology includes a node device, or a plurality of node devices linearly connected via a first port and a second port;
[0134] A node device in a linear topology is connected to a second port or a branch port of a non-end node device.
[0135] In some feasible embodiments, at the connection of linear topologies at adjacent levels, a branch port of a node device in a first linear topology is connected to a first port or a second port of a node device in a second linear topology.
[0136] In some feasible embodiments, the sending module 10 is also used to generate a data packet based on reference address information; the data packet is sent to a neighboring node device in the network topology through the second port and / or branch port of the non-end node device, so that each neighboring node device transmits the data packet in the network topology by exchanging neighbor information, and topology address information is respectively assigned to all node devices in the network topology; wherein the neighboring node device is connected to the non-end node device through the first port or the second port, and the topology address information is used to identify the unique position of each node device in the network topology.
[0137] In some feasible embodiments, the topological address information includes location information, and the location information is used to indicate the order of the node devices in the linear topology.
[0138] In some feasible embodiments, the topology address information further includes port information, where the port information is used to indicate a branch port of a second node device in a second linear topology connected to a first linear topology where the first node device is located.
[0139] In some feasible embodiments, the first linear topology and the second linear topology both include a terminal node device, and the device connected to the terminal node device through the first port belongs to the same linear topology or an adjacent linear topology as the terminal node device.
[0140] In some feasible embodiments, the second port of the end node device is not connected to other node devices or non-end node devices.
[0141] In some feasible embodiments, the device to which the terminal node device is connected through the second port does not belong to the same linear topology as the terminal node device.
[0142] In some feasible embodiments, the receiving module 20 is also used to receive a branch vector obtained by collecting n+1 level branch location address, n+1 level branch port information, number of n level branch devices, and n-1 level branch connection information from at least one end node device in the network topology.
[0143] In some feasible embodiments, the non-end node device has an identifier, and the identifier is used to refer to the topology vector tree.
[0144] In some feasible embodiments, non-end node devices update the topology vector tree based on a preset period.
[0145] The device for establishing a network topology provided in this embodiment and the method for establishing a network topology provided in the above-mentioned embodiment belong to the same technical concept. The technical details not fully described in this embodiment can be referred to any of the above-mentioned embodiments, and this embodiment has the same beneficial effects as executing the above-mentioned method for establishing a network topology applied to non-end node devices.
[0146] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0147] In addition, the present application also provides a method for establishing a network topology, referring to Fig.10 , Fig.10 A schematic diagram of a flow chart of a method for establishing a network topology provided in an embodiment of the present application, wherein the method for establishing a network topology is applied to a terminal node device in a network topology, such as Fig.10 As shown, the method for establishing a network topology provided in this embodiment includes step S100 and step S200:
[0148] Step S100, receiving topology address information allocated by a non-end node device in the network topology through address transmission;
[0149] Step S200, collecting addresses according to topological address information to obtain branch vectors, and sending the branch vectors to non-end node devices, so that the non-end node devices construct a topological vector tree according to the branch vectors, and the topological vector tree is used to establish a network topology.
[0150] It can be understood that the method for establishing a network topology provided in this embodiment is implemented with the terminal node device as the execution subject, and its triggering premise is the address transfer process triggered by the non-terminal node device in the aforementioned embodiment, that is, the method for establishing a network topology provided in this embodiment and applied to the terminal node device in the network topology and the method for establishing a network topology provided in the aforementioned embodiment and applied to the non-terminal node device in the network topology belong to the same technical concept, and the technical details not fully described in this embodiment can be referred to any of the aforementioned embodiments, and this embodiment has the same beneficial effect as executing the method for establishing a network topology provided in the aforementioned embodiments and applied to the non-terminal node device in the network topology.
[0151] In addition, the present application also provides a device for establishing a network topology, referring to Fig.11 , Fig.11 A schematic diagram of a structure of a device for establishing a network topology provided in an embodiment of the present application is shown in FIG. Fig.11As shown, in this embodiment, the device for establishing a network topology is applied to a terminal node device in the network topology, and includes a receiving module 40 and a sending module 50 .
[0152] The receiving module 40 is used to receive topology address information allocated by non-end node devices in the network topology through address transmission;
[0153] The sending module 50 is used to collect addresses according to the topological address information to obtain branch vectors, and send the branch vectors to non-terminal node devices so that the non-terminal node devices construct a topological vector tree according to the branch vectors. The topological vector tree is used to establish a network topology.
[0154] The device for establishing a network topology provided in this embodiment and the method for establishing a network topology provided in the above-mentioned embodiment and applied to a terminal node device in a network topology belong to the same technical concept. The technical details not fully described in this embodiment can be referred to any of the above-mentioned embodiments, and this embodiment has the same beneficial effect as executing the method for establishing a network topology applied to a terminal node device in a network topology.
[0155] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0156] In addition, an embodiment of the present application also provides an electronic device, and the above-mentioned method of establishing a network topology applied to non-end node devices and / or end node devices in the network topology can be executed by a corresponding device for establishing a network topology, and the device for establishing a network topology can be implemented by software and / or hardware and integrated in the electronic device.
[0157] As an example, the electronic device may be a PC (personal computer), a mobile phone, a notebook, a tablet computer, or other terminal device that can be arranged in a network topology to establish an Ethernet connection with other node devices.
[0158] Reference Fig.12 , Fig.12 The hardware structure diagram of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.12As shown, the electronic device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0159] Those skilled in the art will understand that Fig.12 The structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Fig.12 As shown, the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module and a computer program.
[0160] exist Fig.12 In the electronic device shown, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in this embodiment can be set in the electronic device, and the electronic device calls the computer program stored in the memory 1005 through the processor 1001, and executes the method for establishing a network topology provided in any of the above embodiments for non-end node devices or end node devices in the network topology.
[0161] The electronic device proposed in this embodiment and the method for establishing a network topology proposed in the above embodiments and applied to a non-end node device or an end node device in a network topology belong to the same technical concept. The technical details not described in detail in this embodiment can be referred to any of the above embodiments, and this embodiment has the same beneficial effects as executing the method for establishing a network topology.
[0162] In addition, an embodiment of the present application also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method for establishing a network topology provided in any of the above embodiments is implemented.
[0163] In addition, the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the method for establishing a network topology provided in any of the above embodiments.
[0164] The computer program product provided in the present application and the method for establishing a network topology proposed in the above-mentioned embodiment belong to the same technical concept. Compared with the related art, the beneficial effects of the computer program product provided in the present application are the same as the beneficial effects of the method for establishing a network topology provided in the above-mentioned embodiment, which will not be elaborated here.
[0165] It will be appreciated by those skilled in the art that all or some of the steps and systems in the disclosed method above may be implemented as software, firmware, hardware and appropriate combinations thereof. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or a non-transitory medium) and a communication medium (or a temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that may be used to store desired information and may be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0166] In the above description, specific details such as specific system structures, technologies, etc. are proposed for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the embodiments of the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from hindering the description of the embodiments of the present application.
[0167] It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.
[0168] It should also be understood that the references to "one embodiment" or "some embodiments" described in the specification of the embodiments of the present application mean that one or more embodiments of the embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0169] The above is a specific description of some implementation methods of the embodiments of the present application, but the embodiments of the present application are not limited to the above implementation methods. Technical personnel familiar with the field can also make various equivalent modifications or substitutions without violating the spirit of the embodiments of the present application. These equivalent modifications or substitutions are all included in the scope defined by the claims of the embodiments of the present application.
Claims
1. A method for establishing a network topology, characterized in that: The method for establishing a network topology is applied to a non-terminal node device in the network topology, and includes: Acquire reference address information, and perform address delivery in the network topology by exchanging neighbor information based on the reference address information; Receiving a branch vector obtained by collecting addresses from at least one end node device in the network topology; A topology vector tree is constructed according to the branch vectors, and the topology vector tree is used to establish the network topology.
2. The method for establishing a network topology according to claim 1, characterized in that: The network topology includes at least one linear topology; The linear topology includes a node device, or a plurality of node devices linearly connected via a first port and a second port; A node device in the linear topology is connected to the second port or branch port of the non-end node device.
3. The method for establishing a network topology according to claim 2, characterized in that: At the connection of the linear topologies at adjacent levels, the branch port of the node device in the first linear topology is connected to the first port or the second port of the node device in the second linear topology.
4. The method for establishing a network topology according to claim 3, characterized in that: The step of performing address delivery in the network topology by exchanging neighbor information based on the reference address information includes: generating a data packet based on the reference address information; The data packet is sent to the neighboring node device in the network topology through the second port and / or branch port of the non-end node device, so that each of the neighboring node devices transmits the data packet in the network topology by exchanging neighbor information, and topology address information is respectively assigned to all the node devices in the network topology; wherein the neighboring node device is connected to the non-end node device through the first port or the second port, and the topology address information is used to identify the unique position of each of the node devices in the network topology.
5. The method for establishing a network topology according to claim 4, characterized in that: The topology address information includes location information, and the location information is used to indicate the order of the node devices in the linear topology.
6. The method for establishing a network topology according to claim 5, characterized in that: The topology address information further includes port information, where the port information is used to indicate a branch port of a second node device in a second linear topology connected to the first linear topology where the first node device is located.
7. The method for establishing a network topology according to claim 6, characterized in that: The first linear topology and the second linear topology both include the terminal node device, and the device connected to the terminal node device through the first port belongs to the same linear topology or an adjacent linear topology as the terminal node device.
8. The method for establishing a network topology according to claim 7, characterized in that: The step of receiving a branch vector obtained by address collection by a node device at at least one end of the network topology comprises: A branch vector is received by at least one end node device in the network topology through collecting n+1 level branch location address, n+1 level branch port information, the number of n level branch devices, and n-1 level branch connection information.
9. The method for establishing a network topology according to any one of claims 1 to 8, characterized in that: The non-end node device has an identifier, and the identifier is used to refer to the topology vector tree.
10. A method for establishing a network topology, characterized in that: The method for establishing a network topology is applied to a terminal node device in the network topology, and includes: Receiving topology address information allocated by non-terminal node devices in the network topology through address transmission; Address collection is performed according to the topological address information to obtain branch vectors, and the branch vectors are sent to the non-end node devices so that the non-end node devices construct a topological vector tree according to the branch vectors, and the topological vector tree is used to establish the network topology.
11. A device for establishing a network topology, characterized in that: The device for establishing a network topology is applied to a non-terminal node device in the network topology, and includes: A sending module, the sending module is used to obtain reference address information, and perform address transmission in the network topology by exchanging neighbor information based on the reference address information; A receiving module, the receiving module is used to receive a branch vector obtained by address collection by a node device at at least one end of the network topology; A processing module is used to construct a topology vector tree according to the branch vector, and the topology vector tree is used to establish the network topology.
12. A device for establishing a network topology, characterized in that: The device for establishing a network topology is applied to a terminal node device in the network topology, and includes: A receiving module, the receiving module is used to receive topology address information allocated by non-end node devices in the network topology through address transmission; A sending module, the sending module is used to collect addresses according to the topological address information to obtain branch vectors, and send the branch vectors to the non-terminal node devices, so that the non-terminal node devices build a topological vector tree according to the branch vectors, and the topological vector tree is used to establish the network topology.
13. An electronic device, characterized in that: The electronic device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the method for establishing a network topology as described in any one of claims 1 to 9 is implemented, or the method for establishing a network topology as described in claim 10.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for establishing a network topology according to any one of claims 1 to 9 or the method for establishing a network topology according to claim 10 is implemented.
Citation Information
Cited By
Time slot allocation and dormancy control method and system for low-power wireless sensor network
CN120603027A