CN115314914A - Network topology detection method and device, equipment and computer program - Google Patents

Network topology detection method and device, equipment and computer program Download PDF

Info

Publication number
CN115314914A
CN115314914A CN202110496854.3A CN202110496854A CN115314914A CN 115314914 A CN115314914 A CN 115314914A CN 202110496854 A CN202110496854 A CN 202110496854A CN 115314914 A CN115314914 A CN 115314914A
Authority
CN
China
Prior art keywords
zigbee
network
target
zigbee device
address
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
CN202110496854.3A
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.)
China Mobile Communications Group Co Ltd
Original Assignee
China Mobile Communications Group 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 China Mobile Communications Group Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202110496854.3A priority Critical patent/CN115314914A/en
Publication of CN115314914A publication Critical patent/CN115314914A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention relates to the technical field of communication, and discloses a network topology detection method, a network topology detection device, network topology detection equipment and a computer program. The method comprises the steps that a Zi gBee device is determined from a Zi gBee network to serve as a selected device, and the selected device carries out packet capturing to obtain a target address of a secondary Zi gBee device of a target Zi gBee device, so that the topological relation of the Zi gBee network is detected; therefore, the target address of the secondary Zi gBee device of the target Zi gBee device can be obtained at any time in a mode that the selected device actively initiates the inquiry, the obtaining time depends on the selected device, and the network topology detection efficiency is improved; meanwhile, the detection equipment is the ZigBee equipment running in the ZigBee network, and knows the channels of the detection equipment and the surrounding equipment, so that the equipment does not need to be scanned, and the network topology detection efficiency is further improved.

Description

Network topology detection method and device, equipment and computer program
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a network topology detection method, a network topology detection apparatus, a network topology detection device, and a computer program.
Background
Currently, for network topology detection, such as ZigBee network topology detection, extra hardware and software are used for packet capturing, for example, the hardware USB Dongle (wireless USB Dongle) or TelosB bar is used for packet capturing, but the efficiency of packet capturing by using extra hardware and software is relatively low.
Therefore, how to improve the efficiency of network topology detection is an urgent problem to be solved.
Disclosure of Invention
The invention mainly aims to provide a network topology detection method, a network topology detection device, equipment and a computer program, and aims to improve the efficiency of network topology detection.
In order to achieve the above object, the present invention provides a network topology detection method, which includes the following steps:
a selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network;
the selected ZigBee device receives response information sent by the target ZigBee device so as to detect the topological relation of the ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
Optionally, after the step of receiving, by the selected ZigBee device, the response information sent by the target ZigBee device, the network topology detection method further includes:
and replacing the target ZigBee device with the secondary ZigBee device, returning to execute the step of sending an inquiry address request to the target ZigBee device with a known address in the ZigBee network by the selected ZigBee device in the ZigBee network, and circulating until the selected ZigBee device receives the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network.
Optionally, after the step of looping back that the selected ZigBee device receives the target addresses of all other ZigBee devices in the ZigBee network except the selected ZigBee device, the network topology detecting method further includes:
determining the topology type of the ZigBee network according to the target addresses of all the ZigBee devices; wherein the topology type comprises a star network topology, a tree network topology, or a mesh network topology.
Optionally, after the step of looping back that the selected ZigBee device receives the target addresses of all other ZigBee devices in the ZigBee network except the selected ZigBee device, the network topology detecting method further includes:
and the selected equipment sends the target addresses of all the ZigBee equipment to the display equipment, so that the display equipment displays the association relation of each ZigBee equipment in a preset form according to the target addresses of all the ZigBee equipment.
Optionally, after the step of sending an inquiry address request to a target ZigBee device with a known address in the ZigBee network by a selected ZigBee device in the ZigBee network, the network topology detection method further includes:
marking the target ZigBee device;
before the step of returning to execute sending an inquiry address request to a target ZigBee device with a known address in the ZigBee network by a selected ZigBee device in the ZigBee network, the network topology detection method further comprises the following steps:
judging whether the secondary ZigBee device is marked or not;
if not, returning to execute the step that the selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network.
Optionally, before the step of sending an inquiry address request to a target ZigBee device with a known address in the ZigBee network, the method further includes:
receiving a selection instruction;
and selecting one ZigBee device from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction.
Optionally, the step of selecting one ZigBee device from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction includes:
if the selection instruction carries a coordinator identifier, selecting a coordinator matched with the coordinator identifier from all ZigBee devices operating in the ZigBee network as a selected ZigBee device according to the coordinator identifier;
if the selection instruction carries a router identifier, selecting a router matched with the router identifier from all ZigBee devices operating in the ZigBee network as a selected ZigBee device according to the router identifier;
and if the selection instruction carries a terminal identifier, selecting a terminal matched with the terminal identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the terminal identifier.
Optionally, the known address is a network address or a physical address;
if the known address is a network address, the target address is a network address;
and if the known address is a physical address, the target address is a physical address.
In addition, to achieve the above object, the present invention further provides a network topology detecting device applied to a selected ZigBee device in a ZigBee network, the network topology detecting device including:
the transmitting module is used for transmitting an inquiry address request to a target ZigBee device with a known address in the ZigBee network;
the receiving module is used for receiving response information sent by the target ZigBee device so as to detect the topological relation of the ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
In addition, to achieve the above object, the present invention further provides a network topology detecting device, including: a memory, a processor and a network topology detection program stored on the memory and running on the processor, the network topology detection program when executed by the processor implementing the steps of the network topology detection method as above.
Furthermore, to achieve the above object, the present invention also provides a computer program having a network topology detection program stored thereon, which when executed by a processor implements the steps of the network topology detection method as above.
According to the technical scheme provided by the invention, a query address request is sent to a target ZigBee device with a known address in the ZigBee network through a selected ZigBee device in the ZigBee network, and then the selected ZigBee device receives response information sent by the target ZigBee device so as to detect the topological relation of the ZigBee network; the response information comprises a target address of a secondary ZigBee device of the target ZigBee device; the problem of network topology detection inefficiency among the prior art is solved.
That is, according to the technical scheme provided by the invention, one ZigBee device is selected from the ZigBee network as a detection device (i.e., a selected device), and the selected device performs packet capturing to obtain the target address of the secondary ZigBee device of the target ZigBee device, so as to detect the topological relation of the ZigBee network. Therefore, extra software and hardware support is not needed, and therefore the network topology detection cost is reduced; in addition, the target address of the secondary ZigBee device of the target ZigBee device can be obtained at any time in a mode that the selected device actively initiates inquiry, and the obtaining time depends on the selected device, so that the phenomenon of low passive obtaining efficiency through additional software and hardware devices in the prior art is avoided, and the network topology detection efficiency is improved; meanwhile, the detection device is a ZigBee device operating in the ZigBee network, so that the detection device knows the channels of the detection device and the surrounding devices, and does not need to scan all the devices, thereby further improving the network topology detection efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the structures shown in the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a network topology detection device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a network topology detection method according to a first embodiment of the present invention;
FIG. 3 is a flowchart illustrating a network topology detection method according to a second embodiment of the present invention;
FIG. 4 is a flowchart illustrating a network topology detection method according to a third embodiment of the present invention;
fig. 5 is a schematic flow chart of a network topology detection method according to a fourth embodiment of the present invention;
fig. 6 is a flowchart illustrating a fifth embodiment of a network topology detection method according to the present invention;
fig. 7 is a flowchart illustrating a sixth embodiment of a network topology detection method according to the present invention;
fig. 8 is a first structural block diagram of a first embodiment of a network topology detecting device according to the present invention;
fig. 9 is a block diagram of a first embodiment of a network topology detecting device according to the present invention;
fig. 10 is a block diagram of a first embodiment of a network topology detecting device according to the present invention;
fig. 11 is a block diagram of a first embodiment of a network topology detecting apparatus according to the present invention;
fig. 12 is a block diagram of a first embodiment of a network topology detecting apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a network topology detection device in a hardware operating environment according to an embodiment of the present invention.
The network topology detecting device includes: at least one processor 101, a memory 102, and a network topology detection program stored on the memory and executable on the processor, the network topology detection program configured to implement the steps of the network topology detection method of any of the following embodiments.
Processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 101 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 101 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 101 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. The processor 101 may further include an AI (Artificial Intelligence) processor for processing operations related to the network topology detection model training method, so that the network topology detection model training method model may be trained and learned autonomously, thereby improving efficiency and accuracy.
The memory 102 may include one or more computer programs, which may be non-transitory. The memory 102 may also include high speed random access memory, as well as non-volatile memory, such as one or more disk storage network topology detection devices, flash storage network topology detection devices. In some embodiments, the non-transitory computer program in the memory 102 is configured to store at least one instruction for execution by the processor 101 to implement the network topology detection model training method provided by the method embodiments of the present application.
In some examples, the network topology detecting device may further include: a communication interface 103 and at least one peripheral device. The processor 101, memory 102 and communication interface 103 may be connected by buses or signal lines. Various peripheral devices may be connected to communication interface 103 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 104, display screen 105, and power supply 106.
The communication interface 103 can be used to connect at least one peripheral device related to I/O (Input/Output) to the processor 101 and the memory 102. In some embodiments, the processor 101, memory 102, and communication interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 101, the memory 102 and the communication interface 103 may be implemented on a single chip or circuit board, which is not limited in this embodiment.
The Radio Frequency circuit 104 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 104 communicates with the communication network and other communication network topology detection devices via electromagnetic signals. The rf circuit 104 converts an electrical signal into an electromagnetic signal for transmission, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 104 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 104 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 104 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 105 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 105 is a touch display screen, the display screen 105 also has the ability to capture touch signals on or above the surface of the display screen 105. The touch signal may be input to the processor 101 as a control signal for processing. At this point, the display screen 105 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 105 may be one, the front panel of the network topology detection device; in other embodiments, the number of the display screens 105 may be at least two, and the at least two display screens are respectively disposed on different surfaces of the network topology detection device or are in a folding design; in some embodiments, the display screen 105 may be a flexible display screen, disposed on a curved surface or on a folded surface of the network topology detection device. Even further, the display screen 105 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display 105 may be made of LCD (liquid crystal Display), OLED (Organic Light-Emitting Diode), and the like.
The power supply 106 is used for supplying power to various components in the network topology detection device. The power source 106 may be alternating current, direct current, disposable batteries, or rechargeable batteries. When the power source 106 includes a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
Those skilled in the art will appreciate that the architecture shown in fig. 1 does not constitute a limitation of the network topology detecting device and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
Based on the above hardware structure, embodiments of the present invention are proposed.
Referring to fig. 2, fig. 2 is a schematic flow chart of a network topology detection method according to a first embodiment of the present invention, where the network topology detection method includes the following steps:
step S202: a selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network.
It can be understood that the specification in the ZigBee protocol defines three types of devices (also referred to as nodes), each having its own functional requirements; wherein:
coordinator node coordinator: the ZigBee network is responsible for establishing a network, can be configured for receiving and transmitting, is a gathering point of information of each node of the ZigBee network, is a core device of the network, is responsible for constructing, maintaining and managing the network, and realizes data transmission of each node and an upper computer in a serial mode.
Router node Router: the star network does not use a router, and performs path search and path maintenance of data, so that a node can join the network and assist the communication of child nodes to be a relay between a terminal node and a coordinator node, and the communication between the terminal node and the coordinator node is relayed.
Terminal node end device: the terminal node is responsible for receiving and transmitting signals, cannot transmit the signals and is low in power consumption, and the terminal node can be directly connected to the coordinator node or can be connected to the coordinator node through the router node.
The selected device in the embodiment refers to any ZigBee device running in the ZigBee network, and is also called as a detection device, namely the selected device completes network topology detection without additional software and hardware devices; the selected device may be a coordinator, a router, or a terminal, and in practical applications, the selected device may be flexibly adjusted according to a specific application scenario.
In some examples, the coordinator node is heavily loaded; thus, the router node may be selected as the selected device.
In some examples, since a star network does not use routers; accordingly, either the coordinator node or the terminal node may be selected as the selected device.
The target ZigBee device in this embodiment refers to a ZigBee device having a known address in a ZigBee network; the target ZigBee device can be a coordinator, a router or a terminal, and in practical application, the target ZigBee device can be flexibly adjusted according to a specific application scene.
The secondary ZigBee device in the embodiment refers to a ZigBee device mounted at the next stage/layer of the target ZigBee device; the secondary ZigBee device can be a coordinator, a router or a terminal, and in practical application, the secondary ZigBee device actually mounted under the target ZigBee device is used as a standard.
The query address request in this embodiment is what the target address of the secondary ZigBee device for querying the target ZigBee device is, and accordingly, the response information is what the target address of the secondary ZigBee device for replying to the target ZigBee device is specifically. For example, the selected device sends a query address request to the target ZigBee device 1, wherein the secondary ZigBee devices of the target ZigBee device are the ZigBee device 11, the ZigBee device 12, and the secondary ZigBee device 13, respectively, then the query address request is a destination address of the query ZigBee device 11, the ZigBee device 12, and the secondary ZigBee device 13, and the response information includes the destination addresses of the ZigBee device 11, the ZigBee device 12, and the secondary ZigBee device 13.
It can be understood that in the present embodiment, the detection may be performed from a target ZigBee device having a known address in the ZigBee network; therefore, the selected ZigBee device can send an inquiry address request to a target ZigBee device with a known address in the ZigBee network, so that the target address of a secondary ZigBee device of the target ZigBee device is obtained, and the topological relation of the ZigBee network is detected.
In some examples, the known address may be a network address, and then the subsequently acquired target address of the secondary ZigBee device of the target ZigBee device is also the network address. The network address refers to a 16-bit network address, which is allocated after the device joins the ZigBee network and is unique in the ZigBee network, so as to be used for identifying the device and transmitting data in the ZigBee network.
In some examples, the known address may be a physical address, and then the subsequently acquired target address of the secondary ZigBee device of the target ZigBee device is also a physical address. Where physical address refers to a 64-bit IEEE address, a globally unique address, which will follow the life of the device once assigned, is usually set by the manufacturer or at the time of installation, and is maintained and assigned by the IEEE organization.
Step S204: selecting ZigBee equipment to receive response information sent by target ZigBee equipment so as to detect the topological relation of the ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
It can be understood that after a selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device having a known address in the ZigBee network, the target ZigBee device will receive the inquiry address request sent by the selected ZigBee device accordingly; further, the target ZigBee device generates corresponding response information according to the inquiry address request and sends the response information to the selected ZigBee device, and accordingly, the selected ZigBee device receives the response information sent by the target ZigBee device.
It can be understood that several APIs for querying 16-bit network address and 64-bit IEEE address are reserved in the system implemented by the ZigBee protocol:
obtaining the network address of the father node: the agent 16 NLME _ GetCoordShortAddr (void);
obtaining the physical address of the father node: void NLME _ GetCoordExtAddr (byte);
obtaining the network address of the user: the uint16 NLME _ GetShortAddr (void);
get its own physical address: byte NLME _ GetExtAddr (void);
querying the remote device network address according to the known physical address:
afStatus_t ZDP_NwkAddrReq(uint8*IEEEAddress,byte ReqType,byte StartIndex,byte SecurityEnable);
querying the remote device physical address from the known network address:
afStatus_tZDP_IEEEAddrReq(uint16 shortAddr,byte ReqType,byte StartIndex,byte SecurityEnable);
parsing the prototype of the address function:
ZDO_NwkIEEEAddrResp_t*ZDO_ParseAddrRsp(zdoIncomingMsg_t*inMsg)
that is, the reply information in the present embodiment may include other addresses in addition to the target addresses of the secondary ZigBee devices of the target ZigBee devices, and the included other addresses may be of a different type from the known addresses.
In some examples, the reply information comprises a target address of a secondary ZigBee device of the target ZigBee device, and a physical address of the target ZigBee device; wherein the target addresses of the secondary ZigBee devices of the target ZigBee device may be presented in a list form.
In some examples, the reply information includes a target address of a secondary ZigBee device of the target ZigBee device, and a network address of the target ZigBee device.
In some examples, the reply information includes a target address of a secondary ZigBee device of the target ZigBee device, a network address of the target ZigBee device, and a network address of the target ZigBee device.
For example, the following steps are carried out:
if the target ZigBee device with the known network address of 0x0000 is used, the physical address of the target ZigBee device may be obtained by using the API (i.e., ieee addrreq () function) that queries the physical address of the remote device according to the known network address; when a target ZigBee device with a network address of 0x0000 receives an inquiry address request sent by a selected ZigBee device, a corresponding response message is returned, the response message enters a ZDO layer of the selected ZigBee device, an API (namely a ParseAddrRsp () function) for analyzing an address function is called in the ZDO layer to analyze the response message, and the response message contains the network address of the target ZigBee device with the network address of 0x0000 and the physical address of the target ZigBee device with the network address of 0x0000 besides the network address of the ZigBee device at the next stage/layer of the target ZigBee device with the network address of 0x 0000. It can be understood that, in practical applications, the target ZigBee device with the network address 0x0000 is the coordinator.
It should be noted that, in practical applications, the specific address included in the response message may be flexibly adjusted according to a specific application scenario.
In this embodiment, a ZigBee device is selected from the ZigBee network as a detection device (i.e., a selected device), and the selected device performs packet capturing to obtain a target address of a secondary ZigBee device of a target ZigBee device, so as to detect a topological relation of the ZigBee network. Therefore, extra software and hardware support is not needed, and therefore the network topology detection cost is reduced; in addition, the target address of the secondary ZigBee device of the target ZigBee device can be obtained at any time in a mode that the selected device actively initiates inquiry, and the obtaining time depends on the selected device, so that the phenomenon of low passive obtaining efficiency through additional software and hardware devices in the prior art is avoided, and the network topology detection efficiency is improved; meanwhile, the detection device is a ZigBee device operating in the ZigBee network, so that the detection device knows the channels of the detection device and the surrounding devices, and does not need to scan all the devices, thereby further improving the network topology detection efficiency.
Referring to fig. 3, fig. 3 is a schematic flowchart illustrating a network topology detection method according to a second embodiment of the present invention; in this embodiment, after the ZigBee device is selected to receive the response information sent by the target ZigBee device in step S204, the network topology detecting method may further include the following steps:
step S206: and replacing the target ZigBee device with a secondary ZigBee device, returning to step S202, sending an inquiry address request to the target ZigBee device with a known address in the ZigBee network by the selected ZigBee device in the ZigBee network, and circulating until the selected ZigBee device receives the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network.
It can be understood that, in the first embodiment, the details of the selecting ZigBee device sending the query address request to the target ZigBee device with a known address in the ZigBee network and obtaining the target address of the secondary ZigBee device of the target ZigBee device are described above; but the corresponding process is the target address acquisition process of the primary ZigBee device. In the embodiment, the target addresses of all the other ZigBee devices in the ZigBee network except the selected ZigBee device are obtained through hierarchical circulation.
By way of example:
setting a target ZigBee device 1 with a known address in the ZigBee network; wherein, the secondary ZigBee devices mounted under the target ZigBee device 1 are a secondary ZigBee device 11, a secondary ZigBee device 12, and a secondary ZigBee device 13, respectively; through steps S202 to S204 in the first embodiment, the selected ZigBee device can acquire the target addresses of the secondary ZigBee device 11, the secondary ZigBee device 12, and the secondary ZigBee device 13;
further, a secondary ZigBee device 11, a secondary ZigBee device 12, and a secondary ZigBee device 13 are respectively used as target ZigBee devices; the secondary ZigBee devices mounted under the target ZigBee device 11 are a secondary ZigBee device 111 and a secondary ZigBee device 112, respectively, the secondary ZigBee device mounted under the target ZigBee device 12 is a secondary ZigBee device 121, and the secondary ZigBee devices mounted under the target ZigBee device 13 are a secondary ZigBee device 131, a secondary ZigBee device 132, and a secondary ZigBee device 133, respectively; through steps S202-S204 in the first embodiment, the selected ZigBee device can acquire the target addresses of the secondary ZigBee device 111, the secondary ZigBee device 112, the secondary ZigBee device 121, the secondary ZigBee device 131, the secondary ZigBee device 132, and the secondary ZigBee device 133;
and circulating in sequence until the selected ZigBee device receives the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network.
In this embodiment, the target addresses of all the other ZigBee devices in the ZigBee network except the selected ZigBee device can be obtained through hierarchical circulation, so that the topology type of the ZigBee network can be determined subsequently according to the obtained target addresses of all the other ZigBee devices in the ZigBee network except the selected ZigBee device.
Referring to fig. 4, fig. 4 is a schematic flow chart of a network topology detection method according to a third embodiment of the present invention; in this embodiment, after looping back to the step that the selected ZigBee device receives the target addresses of all other ZigBee devices in the ZigBee network except the selected ZigBee device in step S206, the network topology detection method may further include the steps of:
step S208: determining the topology type of the ZigBee network according to the target addresses of all ZigBee devices; wherein the topology type comprises a star network topology, a tree network topology, or a mesh network topology.
It can be understood that specifications in the ZigBee protocol define three types of network topology types; wherein:
star network topology: the system comprises a coordinator node and a series of terminal nodes; it is the simplest of three topologies; each EndDevice can only communicate with the coordinator Co-coordinator node.
Tree network topology: the system comprises a coordinator node, a router node and a terminal node; the Co-coordinator may connect a series of routers and end devices, and the routers of its children nodes may also connect a series of routers and end devices, this feature allowing it to replicate multiple levels.
Mesh network topology: including the Co-coordinator, router and EndDevice series; this topology can constitute a very complex network and has self-organizing, self-healing functionality, which is the same as a tree network topology, but a mesh network topology has more flexible information routing rules and can communicate directly between routing nodes if possible, and furthermore the network can communicate through multiple hops.
In this embodiment, after the step of selecting the target addresses of all the ZigBee devices in the ZigBee network except the selected ZigBee device is performed, the specific topology type of the detected ZigBee network may be determined according to the target addresses of all the ZigBee devices.
In the embodiment, the target addresses of all the other ZigBee devices except the selected ZigBee device in the ZigBee network are obtained through hierarchy circulation, and the topology type of the ZigBee network is determined according to the obtained target addresses of all the other ZigBee devices except the selected ZigBee device in the ZigBee network, so that the detection efficiency is high, and the cost is low.
Referring to fig. 5, fig. 5 is a schematic flowchart illustrating a network topology detection method according to a fourth embodiment of the present invention; in this embodiment, after looping back to the step that the selected ZigBee device receives the target addresses of all other ZigBee devices in the ZigBee network except the selected ZigBee device in step S206, the network topology detection method may further include the steps of:
step S210: the selected equipment sends the target addresses of all the ZigBee equipment to the display equipment, so that the display equipment displays the association relation of each ZigBee equipment in a preset form according to the target addresses of all the ZigBee equipment.
In this embodiment, after the step of receiving the target addresses of all the other ZigBee devices in the ZigBee network except the selected ZigBee device, the selected ZigBee device may send the target addresses of all the ZigBee devices to the display device, so that the display device displays the association relationship of each ZigBee device in a preset form according to the target addresses of all the ZigBee devices, and thus, a user can visually and clearly check what specific topology type of the detected ZigBee network is.
The display device in this embodiment refers to a device having a display function, and may be a server, such as a Linux server, and may be a display platform.
In some examples, the selected ZigBee device may directly send the obtained target addresses of all the ZigBee devices to the display device; thus, the time taken for transmitting the target addresses of all the ZigBee devices is relatively short.
In some examples, the selected ZigBee device may first send the obtained target addresses of all the ZigBee devices to the coordinator, and then the coordinator sends the received target addresses of all the ZigBee devices to the display device; the coordinator transfers the target addresses of all the ZigBee devices, so that the coordinator can acquire the target addresses of all the ZigBee devices and can perform related processing on the target addresses.
The preset form in this embodiment includes, but is not limited to, an image form and a table form, and in practical application, the preset form may be flexibly adjusted according to a specific application scenario.
In the embodiment, the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network are obtained in a hierarchical cycle mode and are sent to the display device, the display device displays the association relation of each ZigBee device in a preset mode according to the target addresses of all the ZigBee devices, the detection efficiency is high, the cost is low, and the display is visual and clear.
Referring to fig. 6, fig. 6 is a schematic flow chart of a network topology detection method according to a fifth embodiment of the present invention; in this embodiment, after the selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network in step S202, the network topology detecting method may further include the following steps:
step S203: marking target ZigBee equipment;
correspondingly, in this embodiment, after the step of returning to execute step S202, in which a selected ZigBee device in the ZigBee network sends a query address request to a target ZigBee device having a known address in the ZigBee network, the network topology detecting method may further include the steps of:
step S205: judging whether the secondary ZigBee device is marked;
if not, returning to step S202, and sending a query address request to a target ZigBee device with a known address in the ZigBee network by the selected ZigBee device in the ZigBee network.
It can be appreciated that the mesh network topology is relatively complex; therefore, in order to avoid the phenomenon of repeated detection in hierarchical circulation, in this embodiment, after a selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device having a known address in the ZigBee network, the target ZigBee device may be marked, and then before detection of the next stage, it is determined whether a secondary ZigBee device is marked. If the secondary ZigBee device is not marked, replacing the target ZigBee device of the upper stage with the secondary ZigBee device, and sending an inquiry address request to the selected ZigBee device; if the secondary ZigBee device is marked, the selected ZigBee device can not need to send a request for inquiring address to the selected ZigBee device.
For example, the following steps are carried out:
setting a target ZigBee device 1 with a known address in the ZigBee network; wherein, the secondary ZigBee devices mounted under the target ZigBee device 1 are a secondary ZigBee device 11, a secondary ZigBee device 12, and a secondary ZigBee device 13, respectively; at this time, the selected ZigBee device sends an inquiry address request to the target ZigBee device 1 so as to obtain target addresses of the secondary ZigBee device 11, the secondary ZigBee device 12 and the secondary ZigBee device 13, and simultaneously mark the secondary ZigBee device 11, the secondary ZigBee device 12 and the secondary ZigBee device 13;
further, whether the secondary ZigBee device 11, the secondary ZigBee device 12, and the secondary ZigBee device 13 are marked or not is judged, and obviously, none of the secondary ZigBee device 11, the secondary ZigBee device 12, and the secondary ZigBee device 13 is marked, and at this time, the secondary ZigBee device 11, the secondary ZigBee device 12, and the secondary ZigBee device 13 are respectively used as target ZigBee devices; wherein, the secondary ZigBee devices mounted under the target ZigBee device 11 are respectively a secondary ZigBee device 111 and a secondary ZigBee device 112, the secondary ZigBee device mounted under the target ZigBee device 12 is a secondary ZigBee device 121, and the secondary ZigBee devices mounted under the target ZigBee device 13 are respectively a secondary ZigBee device 131, a secondary ZigBee device 132, and a secondary ZigBee device 133; at this time, the selected ZigBee device sends an inquiry address request to the target ZigBee device 11, the target ZigBee device 12, and the target ZigBee device 13, respectively, to obtain target addresses of the secondary ZigBee device 111, the secondary ZigBee device 112, the secondary ZigBee device 121, the secondary ZigBee device 131, the secondary ZigBee device 132, and the secondary ZigBee device 133, and simultaneously marks the secondary ZigBee device 111, the secondary ZigBee device 112, the secondary ZigBee device 121, the secondary ZigBee device 131, the secondary ZigBee device 132, and the secondary ZigBee device 133;
and circulating in sequence until the selected ZigBee device receives the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network.
In the embodiment, after the selected ZigBee device sends the inquiry address request to the target ZigBee device with the known address in the ZigBee network, the selected ZigBee device marks the target ZigBee device at the same time, and then whether the target ZigBee device is detected or not is judged according to the mark, so that the phenomenon of repeated detection during hierarchy circulation can be avoided, and the network topology detection efficiency is further improved.
Referring to fig. 7, fig. 7 is a schematic flowchart illustrating a network topology detection method according to a sixth embodiment of the present invention; in this embodiment, before the step S202 of sending an inquiry address request to a target ZigBee device with a known address in the ZigBee network by a selected ZigBee device in the ZigBee network, the network topology detection method may further include the following steps:
step S200: receiving a selection instruction;
step S201: and selecting one ZigBee device from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction.
In this embodiment, before the selected ZigBee device sends the query address request to the target ZigBee device having a known address in the ZigBee network, a selection instruction issued by the user may be received, and then one ZigBee device is selected from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the received selection instruction.
The following three cases are distinguished in this example:
in the first situation, if the selection instruction carries a coordinator identifier, a coordinator matched with the coordinator identifier is selected from all ZigBee devices operating in the ZigBee network as a selected ZigBee device according to the coordinator identifier; that is, it is the case one that the coordinator is the selected ZigBee device.
In case two, if the selection instruction carries the router identification, selecting a router matched with the router identification from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the router identification; that is, in case two, the router is used as the selected ZigBee device.
If the selection instruction carries the terminal identifier, selecting a terminal matched with the terminal identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the terminal identifier; that is, in case three, the terminal is used as the selected ZigBee device.
In the embodiment, one ZigBee device is selected from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction issued by the user, the selection of the selected ZigBee device is more flexible, and the selection instruction can be issued at any time to adjust the selected ZigBee device.
In addition, referring to fig. 8, an embodiment of the present invention further provides a network topology detecting device applied to a selected ZigBee device in a ZigBee network based on the network topology detecting method, where the network topology detecting device may include:
a sending module 801, configured to send an inquiry address request to a target ZigBee device with a known address in a ZigBee network;
a receiving module 802, configured to receive response information sent by a target ZigBee device, so as to detect a topological relation of a ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
In some examples, referring to fig. 9, the network topology detecting apparatus may further include:
and the replacing module 803 is used for replacing the target ZigBee device with the secondary ZigBee device, returning to the step of executing the step that the sending module 801 sends an inquiry address request to the target ZigBee device with a known address in the ZigBee network, and circulating to the receiving module 802 for receiving the target addresses of all the ZigBee devices except the selected ZigBee device in the ZigBee network.
In some examples, referring to fig. 10, the network topology detecting apparatus may further include:
a determining module 804, configured to determine a topology type of the ZigBee network according to target addresses of all ZigBee devices; wherein the topology type comprises a star network topology, a tree network topology, or a mesh network topology.
The sending module 801 is further configured to send the target addresses of all the ZigBee devices to the display device, so that the display device displays the association relationship of each ZigBee device in a preset form according to the target addresses of all the ZigBee devices.
In some examples, referring to fig. 11, the network topology detecting apparatus may further include:
a marking module 805, configured to mark a target ZigBee device;
the judging module 806 is configured to judge whether the secondary ZigBee device is marked, and if not, return to the step of the sending module 801 sending the inquiry address request to the target ZigBee device with a known address in the ZigBee network.
In some examples, referring to fig. 12, the network topology detecting apparatus may further include:
a receiving module 802, further configured to receive a selection instruction;
a selecting module 807, configured to select one ZigBee device from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction.
If the selection instruction carries a coordinator identifier, the selection module 807 selects a coordinator matched with the coordinator identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the coordinator identifier;
if the selection instruction carries a router identifier, the selection module 807 selects a router matched with the router identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the router identifier;
if the selection instruction carries a terminal identifier, the selection module 807 selects a terminal matched with the terminal identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the terminal identifier.
It should be noted that the network topology detecting apparatus in this embodiment may further optionally include other corresponding modules to implement the steps of the network topology detecting method.
The network topology detecting device of the present invention adopts all the technical solutions of all the embodiments of the above network topology detecting method, so that at least all the beneficial effects brought by the technical solutions of all the embodiments of the above network topology detecting method are achieved, and no further description is given here.
In addition, the present embodiment also provides a computer program, in which a network topology detection program is stored, and the network topology detection program, when executed by a processor, implements the steps of the network topology detection method as described above.
The computer program includes volatile or nonvolatile, removable or non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, computer program modules or other data. Computer programs include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically erasable Programmable Read-Only Memory), flash Memory or other Memory technology, CD-ROM (Compact Disc Read-Only Memory), digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage, or any other medium which can be used to store the desired information and which can be accessed by a computer.
It will be apparent to those skilled in the art that all or some of the steps, systems, functional modules/units in an integrated cooker, in the methods disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof. In a hardware implementation, the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, one physical component may have multiple functions, or one function or step may be performed by several physical components in cooperation. Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application specific integrated circuit.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A network topology detection method is characterized by comprising the following steps:
a selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network;
the selected ZigBee device receives response information sent by the target ZigBee device so as to detect the topological relation of the ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
2. The network topology detection method of claim 1, wherein after the step of the selected ZigBee device receiving the reply information transmitted by the target ZigBee device, the network topology detection method further comprises:
and replacing the target ZigBee device with the secondary ZigBee device, returning to execute the step that the selected ZigBee device in the ZigBee network sends an inquiry address request to the target ZigBee device with a known address in the ZigBee network, and circulating to the selected ZigBee device to receive the target addresses of all other ZigBee devices except the selected ZigBee device in the ZigBee network.
3. The network topology detection method of claim 2, wherein said cycling to after the step of said selected ZigBee device receiving destination addresses of all ZigBee devices in the ZigBee network other than said selected ZigBee device further comprises:
determining the topology type of the ZigBee network according to the target addresses of all the ZigBee devices; wherein the topology type comprises a star network topology, a tree network topology, or a mesh network topology.
4. The network topology detection method of claim 2, wherein said cycling to after the step of said selected ZigBee device receiving destination addresses of all ZigBee devices in the ZigBee network other than said selected ZigBee device further comprises:
and the selected equipment sends the target addresses of all the ZigBee equipment to the display equipment, so that the display equipment displays the association relation of each ZigBee equipment in a preset form according to the target addresses of all the ZigBee equipment.
5. The network topology detection method of claim 2, wherein after the step of a selected ZigBee device in the ZigBee network sending an inquiry address request to a target ZigBee device having a known address in the ZigBee network, the network topology detection method further comprises:
marking the target ZigBee device;
before the step of returning and executing that the selected ZigBee device in the ZigBee network sends a request of inquiring address to the target ZigBee device with known address in the ZigBee network, the method also comprises the following steps:
judging whether the secondary ZigBee device is marked or not;
if not, returning to the step of executing the step that the selected ZigBee device in the ZigBee network sends an inquiry address request to a target ZigBee device with a known address in the ZigBee network.
6. The network topology detection method of any of claims 1-5, characterized in that prior to the step of a selected ZigBee device in the ZigBee network sending a request for an Inquiry address to a target ZigBee device with a known address in the ZigBee network, the network topology detection method further comprises:
receiving a selection instruction;
and selecting one ZigBee device from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the selection instruction.
7. The network topology detection method of claim 6, wherein said step of selecting one ZigBee device as a selected ZigBee device from all ZigBee devices operated in the ZigBee network according to the selection instruction comprises:
if the selection instruction carries a coordinator identifier, selecting a coordinator matched with the coordinator identifier from all ZigBee devices operating in the ZigBee network as a selected ZigBee device according to the coordinator identifier;
if the selection instruction carries a router identification, selecting a router matched with the router identification from all ZigBee devices operating in the ZigBee network as a selected ZigBee device according to the router identification;
and if the selection instruction carries a terminal identifier, selecting a terminal matched with the terminal identifier from all ZigBee devices operating in the ZigBee network as the selected ZigBee device according to the terminal identifier.
8. The method of network topology detection according to any of claims 1-5, characterized in that said known address is a network address or a physical address;
if the known address is a network address, the target address is a network address;
and if the known address is a physical address, the target address is a physical address.
9. A network topology detection device, applied to a selected ZigBee device in a ZigBee network, is characterized in that the network topology detection device comprises:
the transmitting module is used for transmitting an inquiry address request to a target ZigBee device with a known address in the ZigBee network;
the receiving module is used for receiving response information sent by the target ZigBee device so as to detect the topological relation of the ZigBee network; wherein the reply information includes a target address of a secondary ZigBee device of the target ZigBee device.
10. A network topology detecting device, characterized in that the network topology detecting device comprises: memory, a processor and a network topology detection program stored on the memory and running on the processor, the network topology detection program when executed by the processor implementing the steps of the network topology detection method according to any of claims 1-8.
11. A computer program, characterized in that the computer program has stored thereon a network topology detection program which, when being executed by a processor, carries out the steps of the network topology detection method according to any of claims 1-8.
CN202110496854.3A 2021-05-07 2021-05-07 Network topology detection method and device, equipment and computer program Pending CN115314914A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110496854.3A CN115314914A (en) 2021-05-07 2021-05-07 Network topology detection method and device, equipment and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110496854.3A CN115314914A (en) 2021-05-07 2021-05-07 Network topology detection method and device, equipment and computer program

Publications (1)

Publication Number Publication Date
CN115314914A true CN115314914A (en) 2022-11-08

Family

ID=83853112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110496854.3A Pending CN115314914A (en) 2021-05-07 2021-05-07 Network topology detection method and device, equipment and computer program

Country Status (1)

Country Link
CN (1) CN115314914A (en)

Similar Documents

Publication Publication Date Title
CN109417691B (en) Bluetooth cluster online upgrading method and device
CN110032512B (en) Debugging method of small program, related equipment and terminal
CN111830844B (en) Intelligent equipment control method and device and intelligent home control panel
CN111739275B (en) Control method, control device, control equipment and storage medium for dual-mode communication
KR20120046547A (en) The method of determining group owner in peer to peer network and the device thereof
CN104955073A (en) Exchanging configuration information wirelessly
CN106924977A (en) Modular system, topology identification method, apparatus and system
CN105306318A (en) Intelligent scene configuration method and device and server
CN106104507A (en) The docking station management operation different because of supplier
CN105430636A (en) SIM card management method and system
CN112269842A (en) Information processing method and device, storage medium and computer equipment
CN107645789A (en) The method, apparatus and system of networking
CN105530684B (en) Network access method, device and system
CN113179215B (en) Networking communication method, system, node device, storage medium and electronic device
WO2021218317A1 (en) Network reentry method for mobile terminal after network disconnection, and related device
CN107484214B (en) Internet of things access point frequency point selection method and device
CN107071849B (en) Method and device for electing cluster head node
CN104703211A (en) A virtualization accessing method and apparatus
CN116782317A (en) Roaming guide method, device, equipment, storage medium and system
CN115314914A (en) Network topology detection method and device, equipment and computer program
KR101574767B1 (en) System and method for detect for ble device
CN112152850B (en) Internet of things equipment management method based on flash connection protocol and service terminal
CN104244172A (en) Information interaction method and device
CN116782255A (en) Same-frequency subnet fusion method and device, communication node and storage medium
CN113838463A (en) Information transmission method and device, electronic equipment and storage medium

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