CN112423362B - Method and device for establishing neighbor relation in ad hoc network - Google Patents

Method and device for establishing neighbor relation in ad hoc network Download PDF

Info

Publication number
CN112423362B
CN112423362B CN202011080493.6A CN202011080493A CN112423362B CN 112423362 B CN112423362 B CN 112423362B CN 202011080493 A CN202011080493 A CN 202011080493A CN 112423362 B CN112423362 B CN 112423362B
Authority
CN
China
Prior art keywords
equipment
network
hop
neighbor
previous
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.)
Active
Application number
CN202011080493.6A
Other languages
Chinese (zh)
Other versions
CN112423362A (en
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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN202011080493.6A priority Critical patent/CN112423362B/en
Publication of CN112423362A publication Critical patent/CN112423362A/en
Application granted granted Critical
Publication of CN112423362B publication Critical patent/CN112423362B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/02Communication route or path selection, e.g. power-based or shortest path routing
    • H04W40/12Communication route or path selection, e.g. power-based or shortest path routing based on transmission quality or channel quality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • 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

Abstract

The application discloses a method and a device for establishing a neighbor relation in an ad hoc network. If the method determines that the ad hoc network does not have the previous hop equipment which establishes the previous hop connection with the network equipment of the ad hoc network, the method acquires the signal intensity of each channel of the network equipment of the ad hoc network and sends broadcast information; if the previous hop equipment exists, a neighbor alternative table of the network equipment is established according to the broadcast information received in a preset time period and sent by other network equipment without the previous hop equipment; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment. The method determines the optimal neighbor equipment of the network equipment by comparing the received signal strength indication of the previous hop equipment with the received signal strength indication of the network equipment, thereby realizing the establishment of the neighbor relation according to the signal strength of the network equipment.

Description

Method and device for establishing neighbor relation in ad hoc network
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for establishing a neighbor relation in an ad hoc network.
Background
In the ad hoc network of the chain network shown in fig. 1, a neighbor relationship needs to be established between adjacent devices in a handshake or configuration manner, because an air interface message has a broadcast attribute and data message propagation has directionality, when receiving a data message sent by at least one acquisition terminal, a relay 1 needs to add its own address and the address of a next-hop relay 2 to the header of the data message before forwarding, and when forwarding the data message, the relay 2 only receives the message sent to itself and forwards the message to the next-hop relay 3, and so on, and finally transmits the transmitted data message to a cloud platform (or "server"). Therefore, when the relay transmits the data packet, it needs to know the address of its own previous hop device (or called "previous hop device") and the address of its own next hop device (or called "next hop device"), and when the base station transmits the data packet to the server, it needs to know the address of its own previous hop device (or called "previous hop device") for filtering and forwarding. For example, the relay or the relay and the base station may perform a self-discovery and self-networking process through a preset control message, as shown in fig. 2, an ad hoc network mechanism in which a current relay sends a real-name or anonymous connection request to a next-hop device (relay or base station), if a certain next-hop device is in an undiscovered state, the current relay continuously sends the anonymous or real-name connection request to the next-hop device, and after receiving the connection request, the next-hop device performs a connection response on the current relay that sends the connection request, so as to establish a neighbor relationship between the current relay and the next-hop device. Because the current relay and the next hop device store respective addresses, the current relay only sends a connection request to the next hop node according to the stored address of the next hop device, and the next hop device only receives the connection request sent by the current relay according to the stored address of the current relay.
However, this mechanism does not consider the signal strength problem, for example, the signal strength of the connection request received by the next-hop device from the current relay is weak, the next-hop device will also perform connection response to the current relay, and establish a neighbor relationship, which will result in that the neighbor relationship established between relays may not be the optimal neighbor relationship.
Disclosure of Invention
The embodiment of the application provides a method and a device for establishing a neighbor relation in an ad hoc network, which solve the problems in the prior art and realize the establishment of the neighbor relation according to the signal strength of network equipment.
In a first aspect, a method for establishing a neighbor relation in an ad hoc network is provided, where the method is applied to at least two network devices of the ad hoc network, where the at least two network devices include at least one relay device and a base station connected to a server, and the method may include:
determining whether a previous hop device establishing previous hop connection with the self network device exists in the ad hoc network;
if the last hop equipment does not exist, acquiring the signal intensity of each channel of the network equipment and sending broadcast information; the broadcast information comprises an equipment identifier of the network equipment, a path length value between the network equipment and the server and the signal strength of each channel of the network equipment;
if the previous hop equipment exists, establishing a neighbor alternative table of the network equipment according to broadcast information received in a preset time period and sent by other network equipment without the previous hop equipment; each table entry of the neighbor alternative table of the own network device comprises the corresponding relation and the existence duration of the device identification, the Received Signal Strength Indication (RSSI) of other network devices without the previous hop device; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment.
In one possible implementation, after transmitting the broadcast information, the method further comprises:
if a neighbor relation establishing request sent by the previous hop device is received, wherein the neighbor relation establishing request comprises a device identifier of the previous hop device, a path length value between the previous hop device and the server, signal strength of each channel of the previous hop device and a neighbor alternative table established by the previous hop device, determining a path length value between the network device and the server according to the path length value between the previous hop device and the server, and determining a communication channel communicated with the previous hop device according to the signal strength of each channel of the network device and the signal strength of the corresponding channel of the previous hop device;
sending a neighbor relation establishment response to the previous hop equipment, and stopping sending broadcast information; the neighbor relation establishing response comprises the equipment identification of the network equipment, the signal strength of each channel of the network equipment and the communication channel between the previous hop equipment and the network equipment.
In one possible implementation, determining a path length value of the previous-hop device according to the path length value between the previous-hop device and the server includes:
adding the path length value between the previous hop equipment and the server to a preset numerical value to obtain a new path length value;
and determining the new path length value as the path length value between the network equipment and the server.
In one possible implementation, determining a communication channel with the previous-hop device according to the signal strength of each channel of the own network device and the signal strength of the corresponding channel of the previous-hop device includes:
adding the signal intensity of each channel in the network equipment of the user to the signal intensity of the corresponding channel of the previous hop equipment to obtain the signal intensity sum of each channel;
and determining the signal strength of each channel and the minimum signal strength and the corresponding channel thereof as a communication channel for the last-hop equipment to communicate with the network equipment.
In one possible implementation, after creating the neighbor list of the own network device according to the broadcast information received within the preset time period and sent by the other network devices without the previous-hop device, the method further includes:
if the RSSI which is greater than the signal strength of the preset backup device exists in the neighbor alternative table, determining other network devices which are not provided with the previous hop device and correspond to the RSSI which is greater than the signal strength of the preset backup device as backup devices of the network devices;
sending a main/standby establishing request carrying the equipment identifier of the network equipment to the backup equipment so that the backup equipment sends a main/standby establishing response carrying the equipment identifier of the backup equipment;
and receiving the main/standby establishing response.
In one possible implementation, before determining the next-hop device of the own network device according to the neighbor candidate table of the own network device and the stored neighbor candidate table of the previous-hop device, the method further includes:
deleting the RSSI which is greater than the signal strength of the preset backup equipment in the neighbor alternative list to obtain a neighbor list;
selecting RSSI (received signal strength indicator) within a preset neighbor signal strength range in the neighbor list;
and determining the maximum RSSI in the selected RSSIs as the target RSSI.
In one possible implementation, determining a next-hop device of the self network device according to the neighbor list of the self network device and the stored neighbor list of the previous-hop device includes:
determining the device identifier of other network devices corresponding to the target RSSI and without the previous hop of device as an alternative device identifier;
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and having no previous hop device as the next hop devices of the network devices;
and if the candidate device identifier does not exist in the neighbor candidate table of the previous-hop device, determining other network devices corresponding to the candidate device identifier and without the previous-hop device as the next-hop devices of the network devices.
In one possible implementation, the method further comprises:
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is not less than the target RSSI, removing the candidate device identifier from the neighbor candidate table of the network device to obtain a new neighbor candidate table of the network device.
In one possible implementation, the method further comprises:
if the last hop equipment exists and the broadcast information sent by other network equipment without the last hop equipment is not received within the preset time period, sending a terminal equipment confirmation request carrying the equipment identification of the server to the server so that the server matches the configured terminal equipment identification with the equipment identification of the network equipment, and if the matching is successful, returning a terminal equipment confirmation response carrying the terminal equipment confirmation indication.
In one possible implementation, before establishing the neighbor relation with the next-hop device, the method further includes:
and sending an equipment verification request carrying the equipment identifier of the next hop equipment to the server so that the server matches the equipment identifier of the next hop equipment with the registered equipment identifier, and if the matching is successful, returning an equipment verification response carrying a legal equipment identifier indication.
In one possible implementation, the method further comprises:
and if the last hop equipment does not exist, receiving broadcast information sent by other network equipment except the own network equipment.
In a second aspect, a method for establishing a neighbor relation in an ad hoc network is provided, and is applied to at least two network devices of the ad hoc network, where the at least two network devices include at least one relay device and a base station connected to a server, and the apparatus includes: the device comprises a determining unit, an obtaining unit, a sending unit, a creating unit and a establishing unit;
the determining unit is configured to determine whether a previous-hop device that establishes a previous-hop connection with a network device to which the determining unit belongs exists in the ad hoc network;
the acquiring unit is configured to acquire the signal strength of each channel of the network device to which the acquiring unit belongs if it is determined that the previous hop device does not exist;
the sending unit is used for sending broadcast information; the broadcast information comprises a device identification of the network device to which the broadcast information belongs, a path length value between the network device to which the broadcast information belongs and the server, and signal strength of each channel of the network device to which the broadcast information belongs;
the creating unit is configured to create a neighbor alternative table of the network device to which the creating unit belongs according to broadcast information received within a preset time period and sent by other network devices that do not have the previous hop device if the previous hop device is determined to exist; each table entry of the neighbor alternative table of the network device to which the table entry belongs comprises the corresponding relation and the existence duration of the device identification, the Received Signal Strength Indication (RSSI) of other network devices without the previous hop device;
the determining unit is further configured to determine a next hop device of the network device to which the determining unit belongs according to the neighbor candidate table of the network device to which the determining unit belongs and the stored neighbor candidate table of the previous hop device;
the establishing unit is used for establishing a neighbor relation with the next hop equipment.
In one possible implementation, the apparatus further comprises: a stopping unit;
the determining unit is further configured to determine, if a neighbor relation establishment request sent by the previous hop device is received, where the neighbor relation establishment request includes a device identifier of the previous hop device, a path length value between the previous hop device and the server, a signal strength of each channel of the previous hop device, and a neighbor candidate table created by the previous hop device, a path length value between the network device to which the determining unit belongs and the server according to the path length value between the previous hop device and the server, and determine, according to the signal strength of each channel of the network device to which the determining unit belongs and the signal strength of the corresponding channel of the previous hop device, a communication channel for communicating with the previous hop device;
the sending unit is further configured to send a neighbor relation establishment response to the previous-hop device; the neighbor relation establishing response comprises the equipment identification of the network equipment to which the neighbor relation establishing response belongs, the signal intensity of each channel of the network equipment to which the neighbor relation establishing response belongs and the communication channel of the previous hop equipment and the network equipment to which the neighbor relation establishing response belongs;
the stopping unit is used for stopping sending the broadcast information.
In one possible implementation, the determining unit is specifically configured to add a preset numerical value to a path length value between the previous-hop device and the server to obtain a new path length value; and determining the new path length value as the path length value between the network equipment to which the new path length value belongs and the server.
In one possible implementation, the determining unit is further specifically configured to add the signal strength of each channel in the network device to which the determining unit belongs to the signal strength of the corresponding channel of the previous-hop device, so as to obtain a signal strength sum of each channel; and determining the signal strength of each channel and the minimum signal strength and the corresponding channel thereof as the communication channel for the last hop of equipment to communicate with the network equipment to which the last hop of equipment belongs.
In one possible implementation, the apparatus further comprises a receiving unit;
the determining unit is further configured to determine, if it is determined that the RSSI larger than the signal strength of the preset backup device exists in the neighbor candidate table, other network devices, which do not have the previous hop device and correspond to the RSSI larger than the signal strength of the preset backup device, as backup devices of network devices to which the other network devices belong;
the sending unit is further configured to send a primary/secondary establishment request carrying an equipment identifier of the network equipment to which the sending unit belongs to the backup equipment, so that the backup equipment sends a primary/secondary establishment response carrying the equipment identifier of the backup equipment;
the receiving unit is configured to receive the primary/standby establishment response.
In one possible implementation, the apparatus further includes a deleting unit and a selecting unit;
the deleting unit is configured to delete the RSSI in the neighbor candidate table that is greater than the signal strength of the preset backup device, so as to obtain a neighbor list;
the selecting unit is used for selecting the RSSI within the preset neighbor signal strength range in the neighbor list;
the determining unit is further configured to determine a maximum RSSI among the selected RSSIs as a target RSSI.
In one possible implementation, the determining unit is further configured to determine, as an alternative device identifier, a device identifier of another network device corresponding to the target RSSI and having no previous hop device;
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and having no previous hop device as the next hop device of the network device to which the other network devices belong;
and if the candidate device identifier does not exist in the neighbor candidate table of the previous-hop device, determining other network devices corresponding to the candidate device identifier and having no previous-hop device as the next-hop devices of the network devices to which the other network devices belong.
In one possible implementation, the apparatus further comprises a removing unit;
and the removing unit is configured to remove the candidate device identifier from the neighbor candidate table of the network device to which the candidate device identifier belongs to obtain a new neighbor candidate table of the network device to which the candidate device identifier belongs, if the candidate device identifier exists in the neighbor candidate table of the previous-hop device and the RSSI corresponding to the candidate device identifier is not less than the target RSSI.
In one possible implementation, the sending unit is further configured to send, to the server, an end point device confirmation request carrying a device identifier of the end point device if it is determined that the previous hop device exists and broadcast information sent by other network devices that do not exist within the preset time period is not received, so that the server matches the configured end point device identifier with the device identifier of the network device to which the end point device belongs, and if the matching is successful, return an end point device confirmation response carrying an end point device confirmation instruction.
In one possible implementation, the sending unit is further configured to send, to the server, an apparatus authentication request carrying an apparatus identifier of the next hop apparatus, so that the server matches the apparatus identifier of the next hop apparatus with a registered apparatus identifier, and if matching is successful, return an apparatus authentication response carrying an indication of a valid apparatus identifier.
In one possible implementation, the apparatus further includes a broadcast information receiving unit;
and the broadcast information receiving unit is used for receiving the broadcast information sent by other network equipment except the network equipment to which the broadcast information receiving unit belongs if the previous hop equipment does not exist.
In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above first aspects.
In the method for establishing a network neighbor in an ad hoc network provided by the embodiment of the invention, if it is determined that a previous hop device establishing a previous hop connection with a network device of the ad hoc network does not exist, the signal intensity of each channel of the network device of the ad hoc network is obtained, and broadcast information is sent; the broadcast information comprises the equipment identification of the network equipment, the path length value between the network equipment and the server and the signal strength of each channel of the network equipment; if the previous hop equipment exists, a neighbor alternative table of the network equipment is established according to the broadcast information received in a preset time period and sent by other network equipment without the previous hop equipment; each table entry of the neighbor alternative table of the network device comprises the corresponding relation and the existence duration of the device identification and the received signal strength indication of other network devices without the previous hop device; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment. The method determines the optimal neighbor device by comparing the received signal strength indication of the previous hop device with the received signal strength indication of the network device, thereby realizing the establishment of the neighbor relation according to the signal strength of the network device.
Drawings
Fig. 1 is a schematic structural diagram of an ad hoc network provided;
FIG. 2 is a flow chart of a networking method of an ad hoc network;
fig. 3 is a network architecture diagram of a method for establishing a neighbor relationship in an ad hoc network according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a method for establishing a neighbor relation in an ad hoc network according to an embodiment of the present invention;
fig. 5 is a schematic flowchart of another method for establishing a neighbor relation in an ad hoc network according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram illustrating establishment of a neighbor relation in an ad hoc network according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without any creative effort belong to the protection scope of the present application.
The method for establishing the neighbor relation in the ad hoc network provided by the embodiment of the invention can be applied to the network architecture shown in fig. 3, and comprises a server, at least two network devices and at least one acquisition terminal.
The acquisition terminal is used for acquiring the data message and sending the data message to the network equipment;
the network equipment is used for receiving and transmitting the data message to the server. The network device includes at least one relay device and a base station connected to a server.
In the network architecture, communication connections (or "non-established connections") are not established between the relay devices and the base station, and the neighbor relation establishing process is a process of establishing communication connections between the relay devices and the base station.
With reference to the ad hoc network structure shown in fig. 1, the order of establishing the neighbor relationship in the present application is to establish the neighbor relationship of the base station, such as the communication connection between the base station and the relay 3, then establish the neighbor relationship of the relay 3, such as the communication connection between the relay 3 and the relay 2, then establish the neighbor relationship of the relay 2, such as the communication connection between the relay 2 and the relay 1, and finally establish the communication connection between the relay 1 and the acquisition device.
The communication connection may be a communication connection based on LORA (Long Range) technology. The LORA is one of Low-Power Wide-Area Network (LPWAN) communication technologies, and is an ultra-long-distance wireless transmission scheme based on a spread spectrum technology. The scheme changes the prior compromise consideration mode of transmission distance and power consumption, provides a simple system which can realize long distance, long battery life and large capacity for users, and further expands the sensing network. The LORA technology has the characteristics of long distance, low power consumption (long battery life), multiple nodes and low cost. The LORA network mainly comprises a terminal (which can be internally provided with an LORA module), a gateway (or called a base station) and a server, and application data can be transmitted in a bidirectional mode. Generally speaking, transmission rate, operating frequency band and network topology are three major factors affecting the network. The choice of network topology is determined by the transmission distance requirements and the number of nodes required by the system.
Alternatively, the default distance between neighboring devices in the network topology may be set between 2km and 7 km.
It should be noted that the server may be an application server or a cloud server; the acquisition Terminal may be a User Equipment (UE) such as a Mobile phone, a smart phone, a laptop, a digital broadcast receiver, a Personal Digital Assistant (PDA), a tablet computer (PAD), a handheld device, a vehicle-mounted device, a wearable device, a computing device or other processing device connected to a wireless modem, a Mobile Station (MS), a Mobile Terminal (Mobile Terminal), etc. The terminal has the capability to communicate with one or more core networks via a Radio Access Network (RAN).
In this embodiment, before executing the process of establishing the neighbor relationship, at least one acquisition terminal, at least one relay device, and a base station need to register on a server, so that the server stores a device identifier, such as a physical address (mac), of a corresponding device, so as to perform validity authentication on the corresponding device by using the stored device identifier later, where a specific registration process is the prior art, and details of the embodiment of the present invention are not described herein.
The terminal device identifier of the end point device may be configured in the server, and the end point device may be configured manually, or may be a relay device that is farthest from the server and closest to the acquisition terminal in at least one relay device.
Because the base station establishes communication connection with the server, the base station can store the address of the server, and the base station can receive the information of the server.
And respectively configuring an initial path length value hop between each network device, namely each relay device and the base station, and the server, wherein the initial hop of each relay device is 99, and the initial hop of the base station is 1. And, a fixed broadcast channel may be set for each relay device, respectively.
Each network device, that is, each relay device or base station, performs its own channel scanning to obtain the signal strength of each channel.
After the channel scanning, each relay device continues to perform periodic broadcast on its respective broadcast channel, and after each period of broadcast, continues to monitor broadcast information for several periods, for example, 5 periods, and receives broadcast information sent by other network devices except its own network device, where each broadcast information may include a device identifier of the corresponding relay device, such as a mac address, a path length value hop between the corresponding relay device and the server, and a signal strength of each channel of the corresponding relay device.
The preferred embodiments of the method for establishing a neighbor relation in the present application are described below with reference to the drawings of the specification, and it should be understood that the preferred embodiments described herein are only for illustrating and explaining the present invention, and are not intended to limit the present invention, and that the embodiments and features in the embodiments in the present application may be combined with each other without conflict.
Fig. 4 is a flowchart illustrating a method for establishing a neighbor relation in an ad hoc network according to an embodiment of the present invention. The method is applied to at least two network devices of an ad hoc network, wherein the at least two network devices comprise at least one relay device and a base station connected with a server, and as shown in fig. 4, the method may include:
step 410, determining whether to create a neighbor alternative table according to whether the network device of the ad hoc network has a previous hop device.
The self network equipment is a base station or any relay equipment. If the own network equipment is the base station, the previous hop equipment is the server, and if the own network equipment is any relay equipment, the previous hop equipment is the base station or other relay equipment except the own network equipment.
In specific implementation, whether a previous hop device establishing previous hop connection with the network device of the self exists is judged in the ad hoc network.
(1) If the last hop equipment does not exist, acquiring the signal intensity of each channel of the network equipment obtained by channel scanning, and sending broadcast information;
the broadcast information may include a device identifier of the network device, a path length value between the network device and the server, and signal strength of each channel of the network device;
optionally, after sending the broadcast information, the network device itself may receive a neighbor relation establishment request sent by the previous-hop device; the neighbor relation establishment request may include a device identifier of the previous-hop device, a path length value between the previous-hop device and the server, signal strengths of channels of the previous-hop device, and a neighbor candidate table created by the previous-hop device.
And determining the path length value between the network equipment and the server according to the path length value between the previous hop equipment and the server, and determining a communication channel for communicating with the previous hop equipment according to the signal strength of each channel of the network equipment and the signal strength of the corresponding channel of the previous hop equipment.
In a specific implementation, the network device may add the path length value of the previous hop device to a preset value to obtain a new path length value, and determine the new path length value as the path length value between the network device and the server.
For example, taking the preset value as 1 and the previous hop device as the base station as an example, the own network device is a relay device, and the initial path length value between the relay device and the server is 99. After the base station determines the relay device as a next hop device, the path length value between the network device and the server is the initial path length value 1 of the base station, and is added to 1 to obtain a new path length value of 2, and the network device determines the new path length value 2 as the path length value between the network device and the server, that is, the new path length value 2 replaces the initial path length value of the network device.
The network equipment adds the signal intensity of each channel with the signal intensity of the corresponding channel of the previous hop equipment to obtain the signal intensity sum of each channel; and the obtained signal strength of each channel is added to the minimum signal strength and the corresponding channel. A communication channel is determined for communication with a last hop device. The self network device may store the neighbor list of the previous-hop device and the device identifier of the previous-hop device.
Therefore, the neighbor relation establishment request carries the signal strength of each channel of the previous-hop device, the channel negotiation can be carried out with the previous-hop device, and the channel with the minimum signal strength is used as a communication channel, so that channel interference in the communication process is avoided.
Then, sending a neighbor relation establishment response to the previous hop equipment, and stopping sending broadcast information; the neighbor relation establishing response may include the device identifier of the network device, the signal strength of each channel of the network device, and the communication channel between the previous hop device and the network device.
Optionally, if it is determined that the previous-hop device does not exist, broadcast information sent by other network devices except the own network device may also be received.
(2) If the previous hop equipment exists, establishing a neighbor alternative table of the network equipment according to broadcast information which is received within a preset time period and is sent by other network equipment without the previous hop equipment;
each entry of the neighbor candidate table of the own network device may include a correspondence between a device identifier and a Received Signal Strength Indication (RSSI) of another network device where the previous hop device does not exist, and an existence duration of the neighbor candidate table. The existence duration is used for limiting the existence time of the corresponding neighbor alternative table so as to ensure that the unneeded neighbor alternative table is cleared regularly and the content space is released.
In one embodiment, the RSSI of broadcast information of other network devices where no previous hop device exists is obtained. If a plurality of pieces of broadcast information of one relay device exist in the received broadcast information, the obtained RSSI is an average value of the RSSI corresponding to the plurality of pieces of broadcast information.
And creating a neighbor alternative table according to the corresponding relation between the device identification of other network devices without the previous hop device and the corresponding RSSI. As shown in table 1.
TABLE 1
Device identification of other network devices RSSI
Mac_a Rssi_1
Mac_b Rssi_2
Mac_c Rssi_3
Mac_d Rssi_4
In table 1, the device identifier Mac _ a of another network device without the previous-hop device corresponds to the Rssi _ 1;
the device identification Mac _ b of other network devices without the previous hop device corresponds to the Rssi _ 2;
the device identification Mac _ c of other network devices without the previous hop of device corresponds to the Rssi _ 3;
the device identification Mac _ d of the other network device where the last hop device does not exist corresponds to Rssi _ 4.
Step 420, determining the next hop device of the network device according to the neighbor candidate table of the network device and the stored neighbor candidate table of the previous hop device.
Determining the maximum RSSI in the neighbor alternative table as a target RSSI, and determining other network equipment corresponding to the target RSSI and without the previous hop equipment as equipment identification of the network equipment as alternative equipment identification;
in specific implementation, in order to avoid signal interference between relay devices close to each other, a backup device of its own network device may be screened from the neighbor candidate table, including:
comparing the RSSI in the neighbor alternative table with the RSSI of the signal strength of the preset backup device;
if the RSSI which is greater than the signal strength of the preset backup device exists in the neighbor alternative table, determining other network devices which are not provided with the previous hop device and correspond to the RSSI which is greater than the signal strength of the preset backup device as backup devices of the network devices;
sending a main/standby establishing request carrying the equipment identifier of the network equipment to the backup equipment;
the standby network equipment determines the self network equipment as the main and standby network equipment according to the received main and standby establishing request, and sends a main and standby establishing response to the self network equipment, wherein the main and standby establishing response comprises an equipment identifier of the standby network equipment so as to establish a main and standby relation.
And then, deleting the RSSI which is larger than the signal intensity of the preset backup device in the neighbor alternative list, namely deleting the backup device of the network device in the neighbor alternative list to obtain a neighbor list.
And selecting the RSSI within the preset neighbor signal strength range in the neighbor list, and determining the maximum RSSI in the selected RSSIs as the target RSSI.
For example, the RSSI greater than the signal strength of the preset backup device in table 1 is RSSI _1, and after the relevant entry of the RSSI _1 is deleted, among RSSI _2, RSSI _3, and RSSI _4, RSSI _2 and RSSI _4 are the RSSI within the preset neighbor signal strength range, so the neighbor list only includes the corresponding relationship between RSSI _2 and Mac _ b and the corresponding relationship between RSSI _4 and Mac _ d, and if RSSI _2 is greater than RSSI _4, RSSI _2 is the target RSSI.
It should be noted that the preset neighbor signal strength range [ a, b ] and the signal strength c of the preset backup device may be configured manually by a technician according to an actual environment, or may be obtained by calculating a configured distance and a transmission power between network devices according to a free space loss algorithm.
In particular, since the default distance between deployed neighboring devices is typically between 2km and 7km, the distance can be adjusted by configuration. The default distance between the deployed standby device and the main device is usually 500m, and the example is that the transmission power is 20 dbm.
The formula for the free space loss algorithm can be expressed as: r =32.4+20 log (D) +20 log (F);
wherein R is space loss, F is frequency, and unit Mhz; d is distance in km.
According to the above formula, the corresponding distance value is substituted to obtain the corresponding value of a, b, c:
a=20-32.4-20*log(7)-20*log(F);
b=20-32.4-20*log(2)-20*log(F);
c=20-32.4-20*log(0.5)-20*log(F)。
then, determining the device identifier of other network devices corresponding to the target RSSI and without the previous hop device as an alternative device identifier;
further, if the candidate device identifier exists in the neighbor candidate table of the previous-hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and not having the previous-hop device as the next-hop devices of the network devices, which can ensure the maximum strength of the signals transmitted between the determined next-hop devices and the network devices;
and if the neighbor candidate table of the previous-hop device does not have the candidate device identifier, determining other network devices corresponding to the candidate device identifier and not having the previous-hop device as the next-hop devices of the network devices.
Or, if the network device itself has the previous-hop device but does not store the neighbor candidate table of the previous-hop device, it indicates that the network device itself may be the base station, and at this time, determines other network devices corresponding to the candidate device identifier and not having the previous-hop device as the next-hop devices of the network device itself.
If the neighbor candidate table of the previous hop device has the candidate device identifier and the RSSI corresponding to the candidate device identifier is not less than the target RSSI, the candidate device identifier is removed from the neighbor candidate table of the own network device to obtain a new neighbor candidate table of the own network device, and the new target RSSI in the new neighbor candidate table is determined by returning.
Therefore, after the neighbor alternative table is established through the RSSI, the neighbor alternative table of the previous hop device is compared with the neighbor alternative table of the previous hop device to obtain the neighbor device with stronger self received signal strength, the problem that the neighbor device is searched without considering the signal strength in the prior art is solved, and the accuracy of determining the optimal neighbor device is improved.
In a possible embodiment, if it is determined that the previous hop device exists and the broadcast information sent by other network devices without the previous hop device is not received within a preset time period, an end point device confirmation request may be sent to the server, where the end point device confirmation request may include a device identifier of its own network device;
the server matches the configured terminal equipment identification with the received equipment identification of the network equipment of the server;
if the matching is successful, sending a destination device confirmation response to the self network device, where the destination device confirmation response may include an indication that the self network device is a destination device of the destination device.
If the matching fails, the process of establishing the neighbor relation is ended.
Step 430, establishing a neighbor relation with the next hop device.
To ensure the validity of the neighbor device, before performing this step, a device authentication request carrying the device identification of the next hop device may be sent to the server;
the server matches the received equipment identifier of the next hop equipment with the registered equipment identifier;
if the matching is successful, returning a device verification response carrying the indication of the legal device identifier;
and if the matching fails, returning a device verification response carrying the indication of the illegal device identifier, and removing the device identifier from the neighbor alternative table to obtain a new neighbor alternative table of the network device so as to re-determine a new next-hop device.
A neighbor relation establishment request sent to a next hop device; the neighbor relation establishing request may include a device identifier of the self network device, a path length value between the self network device and the server, signal strength of each channel of the self network device, and a neighbor candidate table created by the self network device.
And the next hop equipment determines the path length value between the next hop equipment and the server according to the path length value in the neighbor relation establishment request, determines a communication channel according to the signal strength of each channel and the signal strength of the corresponding channel in the neighbor relation establishment request, feeds back a neighbor relation establishment response, and stops sending the broadcast information. The neighbor relation establishment response includes the device identification of the next hop device, the signal strength of each channel of the next hop device, and the communication channel for communicating with itself.
In the embodiment of the invention, after receiving the confirmation response of the terminal equipment sent by the server, the network equipment can broadcast the configured communication channel;
the acquisition terminal receives the communication channel and determines the communication channel as a communication channel of the acquisition terminal so as to realize communication with the network equipment of the acquisition terminal through the communication channel.
Optionally, the end point device confirmation response sent by the server may include a terminal identifier of the pre-configured collection terminal;
the self network equipment sends the configured communication channel to the corresponding acquisition terminal according to the terminal identification of the acquisition terminal, and determines the communication channel as the self communication channel so as to realize the communication with the current network equipment through the communication channel.
It is understood that the next hop device is determined as the new self network device to establish connection, and the step 410 is executed to establish the ad hoc network.
In an example, a flow diagram of another method for establishing a neighbor relation in an ad hoc network according to an embodiment of the present invention is provided. As shown in fig. 5, the execution subject is a self network device, and the method may include:
step S501, judging whether a previous hop device establishing previous hop connection with the network device exists;
if not, executing step S502;
if yes, go to step S507;
step S502, acquiring the signal intensity of each channel of the network equipment;
step S503, sending broadcast information;
the broadcast information comprises the equipment identification of the network equipment, the path length value between the network equipment and the server and the signal strength of each channel of the network equipment;
step S504, a neighbor relation establishment request sent by the previous hop equipment is received.
The neighbor relation establishing request comprises a device identification of the previous hop device, a path length value between the previous hop device and the server, signal strength of each channel of the previous hop device and a neighbor alternative table created by the previous hop device.
Step S505, determining a path length value between the own network device and the server, and a communication channel for communicating with the previous hop device.
And determining a path length value between the network equipment and the server according to the path length value between the previous hop equipment and the server, and determining a communication channel for communicating with the previous hop equipment according to the signal strength of each channel of the network equipment and the signal strength of a corresponding channel of the previous hop equipment.
Step S506, a neighbor relation establishment response is sent to the previous hop device, and a neighbor relation is established with the previous hop device.
Step S507, detecting whether broadcast information sent by other network devices without the previous hop device is received within a preset time period;
if yes, go to step S508;
if not, executing step S517;
and step S508, a neighbor alternative table of the self network equipment is created.
Step S509, detecting whether RSSI (received signal strength indicator) which is larger than the signal strength of the preset backup equipment exists in the neighbor list;
if yes, go to step 510;
if not, go to step 511;
step S510, deleting the RSSI in the neighbor list that is greater than the signal strength of the preset backup device to obtain a neighbor list.
Step S511, selecting a target RSSI from the neighbor list, and determining the device identifier of the other network device corresponding to the target RSSI, where the previous hop device does not exist, as the candidate device identifier.
Specifically, in the neighbor list, the maximum RSSI in the RSSI within the preset neighbor signal strength range is determined as the target RSSI, and the device identifier of the other network device corresponding to the target RSSI and having no previous hop device is determined as the alternative device identifier.
Step S512, detecting whether the neighbor candidate list of the previous hop device has a candidate neighbor device identifier;
if yes, go to step S513;
if not, go to step S514;
step S513, detecting whether the RSSI corresponding to the candidate neighbor device identification in the neighbor candidate table of the previous hop device is smaller than the target RSSI;
if yes, go to step S514;
if not, go to step S518;
step S514, determining other network devices corresponding to the candidate device identifier and having no previous hop device as next hop devices of the own network device.
Step S515, sending a device verification request carrying the device identifier of the next hop device to the server, and determining the validity of the neighbor device.
If yes, go to step S516;
if not, go to step S518;
and step S516, establishing a neighbor relation with the next hop equipment.
And sending a neighbor relation establishment request to the next hop of equipment, and receiving a neighbor relation establishment response sent by the neighbor equipment.
And step S517, confirming that the equipment is the terminal equipment, and broadcasting the configured communication channel.
And sending a destination device confirmation request to the server, and receiving a destination device confirmation response sent by the server.
And broadcasting the configured communication channel so that the acquisition terminal communicates with the current network equipment through the communication channel.
Step S518, removing the candidate device identifier from the neighbor candidate table of the network device itself to obtain a new neighbor candidate table of the network device itself, and returning to execute step S510.
In the method for establishing a network neighbor in an ad hoc network provided by the embodiment of the invention, if it is determined that a previous hop device establishing a previous hop connection with a network device of the ad hoc network does not exist, the signal intensity of each channel of the network device of the ad hoc network is obtained, and broadcast information is sent; the broadcast information comprises the equipment identification of the network equipment, the path length value between the network equipment and the server and the signal strength of each channel of the network equipment; if the last hop of equipment is determined to exist, a neighbor alternative table of the network equipment is established according to broadcast information received in a preset time period and sent by other network equipment without the last hop of equipment; each table entry of the neighbor alternative table of the network device comprises the corresponding relation between the device identification and the RSSI of other network devices without the previous hop device and the existing time length of the table entry; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment. The method determines the optimal neighbor equipment of the network equipment by comparing the RSSI of the previous hop equipment with the RSSI of the network equipment, thereby realizing the establishment of the neighbor relation according to the signal strength of the network equipment.
Corresponding to the foregoing method, an embodiment of the present invention further provides an apparatus for establishing a neighbor relation in an ad hoc network, where as shown in fig. 6, the apparatus is applied to at least two network devices in the ad hoc network, where the at least two network devices include at least one relay device and a base station connected to a server, and the apparatus includes: a determining unit 601, an obtaining unit 602, a sending unit 603, a creating unit 604 and a establishing unit 605;
a determining unit 601, configured to determine whether a previous-hop device that establishes a previous-hop connection with a network device to which the self belongs exists in the ad hoc network;
an obtaining unit 602, configured to obtain, if it is determined that the previous hop device does not exist, signal strength of each channel of a network device to which the previous hop device belongs;
a transmitting unit 603 configured to transmit broadcast information; the broadcast information comprises a device identification of the network device to which the broadcast information belongs, a path length value between the network device to which the broadcast information belongs and the server, and signal strength of each channel of the network device to which the broadcast information belongs;
a creating unit 604, configured to create, if it is determined that the previous-hop device exists, a neighbor candidate table of a network device to which the creating unit belongs according to broadcast information received in a preset time period and sent by other network devices that do not have the previous-hop device; each table entry of the neighbor alternative table of the network device to which the table entry belongs comprises the device identification, the corresponding relation of the RSSI and the existence duration of other network devices without the previous hop device;
a determining unit 601, configured to determine a next-hop device of the network device to which the determining unit belongs according to the neighbor candidate table of the network device to which the determining unit belongs and the stored neighbor candidate table of the previous-hop device;
an establishing unit 605, configured to establish a neighbor relationship with the next hop device.
In one possible implementation, the apparatus further comprises: a stopping unit 606;
a determining unit 601, further configured to determine, if a neighbor relation establishment request sent by the previous hop device is received, where the neighbor relation establishment request includes a device identifier of the previous hop device, a path length value between the previous hop device and the server, signal strengths of channels of the previous hop device, and a neighbor candidate table created by the previous hop device, a path length value between a network device to which the network device belongs and the server according to the path length value between the previous hop device and the server, and determine, according to the signal strength of each channel of the network device to which the network device belongs and the signal strength of a corresponding channel of the previous hop device, a communication channel for communicating with the previous hop device;
a sending unit 603, configured to send a neighbor relation establishment response to the previous-hop device; the neighbor relation establishing response comprises the equipment identification of the network equipment to which the neighbor relation establishing response belongs, the signal strength of each channel of the network equipment to which the neighbor relation establishing response belongs and the communication channel of the last hop equipment and the network equipment to which the neighbor relation establishing response belongs;
a stopping unit 606 for stopping the transmission of the broadcast information.
In a possible implementation, the determining unit 601 is specifically configured to add a preset value to the path length value between the previous-hop device and the server to obtain a new path length value; and determining the new path length value as the path length value between the network equipment to which the new path length value belongs and the server.
In one possible implementation, the determining unit 601 is further specifically configured to add the signal strength of each channel in the network device to which the determining unit belongs and the signal strength of the corresponding channel of the previous-hop device, so as to obtain a signal strength sum of each channel; and determining the signal intensity of each channel and the minimum signal intensity and the corresponding channel thereof as a communication channel for the last hop of equipment to communicate with the network equipment to which the last hop of equipment belongs.
In one possible implementation, the apparatus further includes a receiving unit 607;
the determining unit 601 is further configured to determine, if it is determined that the RSSI larger than the signal strength of the preset backup device exists in the neighbor candidate table, another network device, which does not have the previous hop device and corresponds to the RSSI larger than the signal strength of the preset backup device, as a backup device of a network device to which the other network device belongs;
a sending unit 603, further configured to send a primary/secondary setup request carrying an apparatus identifier of a network apparatus to which the backup apparatus belongs to the backup apparatus, so that the backup apparatus sends a primary/secondary setup response carrying the apparatus identifier of the backup apparatus;
a receiving unit 607, configured to receive the primary/standby establishment response.
In one possible implementation, the apparatus further comprises a deleting unit 608 and a selecting unit 609;
a deleting unit 608, configured to delete the RSSI in the neighbor candidate table that is greater than the signal strength of the preset backup device, so as to obtain a neighbor list;
a selecting unit 609, configured to select an RSSI in a preset neighbor signal strength range in the neighbor list;
the determining unit 601 is further configured to determine a maximum RSSI of the selected RSSIs as the target RSSI.
In one possible implementation, the determining unit 601 is further configured to determine, as the alternative device identifier, a device identifier of another network device corresponding to the target RSSI and having no previous hop device;
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and not having the previous hop device as the next hop devices of the network devices to which the other network devices belong;
and if the candidate device identifier does not exist in the neighbor candidate table of the previous-hop device, determining other network devices corresponding to the candidate device identifier and having no previous-hop device as the next-hop devices of the network devices to which the other network devices belong.
In one possible implementation, the apparatus further comprises a removing unit 610;
a removing unit 610, configured to remove the candidate device identifier from the neighbor candidate table of the network device to which the candidate device identifier belongs to obtain a new neighbor candidate table of the network device to which the candidate device identifier belongs if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is not less than the target RSSI.
In a possible implementation, the sending unit 603 is further configured to send, to the server, an end point device confirmation request carrying an end point device identifier if it is determined that the previous-hop device exists and the broadcast information sent by other network devices that do not exist in the previous-hop device is not received within the preset time period, so that the server matches the configured end point device identifier with the device identifier of the network device to which the server belongs, and if the matching is successful, return an end point device confirmation response carrying an end point device confirmation instruction.
In a possible implementation, the sending unit 603 is further configured to send, to the server, an apparatus authentication request carrying the apparatus identifier of the next-hop apparatus, so that the server matches the apparatus identifier of the next-hop apparatus with the registered apparatus identifier, and if the matching is successful, return an apparatus authentication response carrying an indication of a valid apparatus identifier.
In one possible implementation, the apparatus further includes a broadcast information receiving unit 611;
a broadcast information receiving unit 611, configured to receive broadcast information sent by other network devices except the network device to which the broadcast information belongs if it is determined that the previous-hop device does not exist.
The functions of each functional unit of the apparatus for establishing a neighbor relation in an ad hoc network provided in the above embodiments of the present invention may be implemented by the above method steps, and therefore, detailed working processes and beneficial effects of each unit in the apparatus for establishing a neighbor relation in an ad hoc network provided in the embodiments of the present invention are not repeated herein.
An embodiment of the present invention further provides an electronic device, as shown in fig. 7, including a processor 710, a communication interface 720, a memory 730, and a communication bus 740, where the processor 710, the communication interface 720, and the memory 730 complete mutual communication through the communication bus 740.
A memory 730 for storing a computer program;
the processor 710, when executing the program stored in the memory 730, implements the following steps:
determining whether a previous hop device establishing previous hop connection with the self network device exists in the ad hoc network;
if the last hop equipment does not exist, acquiring the signal intensity of each channel of the network equipment and sending broadcast information; the broadcast information comprises an equipment identifier of the network equipment, a path length value between the network equipment and the server and the signal strength of each channel of the network equipment;
if the previous hop equipment exists, establishing a neighbor alternative table of the network equipment according to broadcast information received in a preset time period and sent by other network equipment without the previous hop equipment; each table entry of the neighbor alternative table of the own network device comprises the device identification, the corresponding relation of the RSSI and the existence duration of other network devices without the previous hop device; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment.
In one possible implementation, after transmitting the broadcast information, the method further comprises:
if a neighbor relation establishing request sent by the previous hop device is received, wherein the neighbor relation establishing request comprises a device identifier of the previous hop device, a path length value between the previous hop device and the server, signal strength of each channel of the previous hop device and a neighbor alternative table created by the previous hop device, determining a path length value between the network device and the server according to the path length value between the previous hop device and the server, and determining a communication channel communicated with the previous hop device according to the signal strength of each channel of the network device and the signal strength of the corresponding channel of the previous hop device;
sending a neighbor relation establishment response to the previous hop equipment, and stopping sending broadcast information; the neighbor relation establishing response comprises the equipment identification of the network equipment, the signal strength of each channel of the network equipment and the communication channel between the previous hop equipment and the network equipment.
In one possible implementation, determining a path length value of the previous-hop device according to the path length value between the previous-hop device and the server includes:
adding the path length value between the previous hop equipment and the server to a preset numerical value to obtain a new path length value;
and determining the new path length value as a path length value between the network equipment and the server.
In one possible implementation, determining a communication channel with the previous-hop device according to the signal strength of each channel of the own network device and the signal strength of the corresponding channel of the previous-hop device includes:
adding the signal intensity of each channel in the network equipment of the user to the signal intensity of the corresponding channel of the previous hop equipment to obtain the signal intensity sum of each channel;
and determining the signal intensity of each channel and the minimum signal intensity and the corresponding channel thereof as a communication channel for the last hop of equipment to communicate with the network equipment of the last hop of equipment.
In one possible implementation, after creating the neighbor list of the own network device according to the broadcast information received within the preset time period and sent by the other network devices without the previous-hop device, the method further includes:
if the RSSI which is greater than the signal strength of the preset backup device exists in the neighbor alternative table, determining other network devices which are not provided with the previous hop device and correspond to the RSSI which is greater than the signal strength of the preset backup device as backup devices of the network devices;
sending a main/standby establishing request carrying the equipment identifier of the network equipment to the backup equipment so that the backup equipment sends a main/standby establishing response carrying the equipment identifier of the backup equipment;
and receiving the main/standby establishing response.
In one possible implementation, before determining the next-hop device of the self network device according to the neighbor candidate table of the self network device and the stored neighbor candidate table of the previous-hop device, the method further includes:
deleting the RSSI which is greater than the signal strength of the preset backup equipment in the neighbor alternative list to obtain a neighbor list;
selecting RSSI (received signal strength indicator) within a preset neighbor signal strength range in the neighbor list;
and determining the maximum RSSI in the selected RSSIs as the target RSSI.
In one possible implementation, determining a next-hop device of the self network device according to the neighbor candidate table of the self network device and the stored neighbor candidate table of the previous-hop device includes:
determining the device identifier of other network devices corresponding to the target RSSI and without the previous hop device as an alternative device identifier;
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and having no previous hop device as the next hop devices of the network devices;
and if the candidate device identifier does not exist in the neighbor candidate table of the previous-hop device, determining other network devices corresponding to the candidate device identifier and without the previous-hop device as the next-hop devices of the network devices.
In one possible implementation, the method further comprises:
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is not less than the target RSSI, removing the candidate device identifier from the neighbor candidate table of the network device to obtain a new neighbor candidate table of the network device.
In one possible implementation, the method further comprises:
if the last hop equipment exists and the broadcast information sent by other network equipment without the last hop equipment is not received within the preset time period, sending a terminal equipment confirmation request carrying the equipment identification of the server to the server so that the server matches the configured terminal equipment identification with the equipment identification of the network equipment, and if the matching is successful, returning a terminal equipment confirmation response carrying the terminal equipment confirmation indication.
In one possible implementation, before establishing the neighbor relation with the next-hop device, the method further includes:
and sending an equipment verification request carrying the equipment identifier of the next hop equipment to the server so that the server matches the equipment identifier of the next hop equipment with the registered equipment identifier, and if the matching is successful, returning an equipment verification response carrying a legal equipment identifier indication.
In one possible implementation, the method further comprises:
and if the last hop equipment does not exist, receiving broadcast information sent by other network equipment except the own network equipment.
The aforementioned communication bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
Since the implementation manner and the beneficial effects of the problem solving of each device of the electronic device in the above embodiment can be realized by referring to each step in the embodiment shown in fig. 4, detailed working processes and beneficial effects of the electronic device provided by the embodiment of the present invention are not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is further provided, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer is caused to execute the method for establishing a neighbor relation in an ad hoc network according to any one of the above embodiments.
In another embodiment of the present invention, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute the method for establishing a neighbor relation in an ad hoc network according to any one of the above embodiments.
As will be appreciated by one of skill in the art, the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all changes and modifications that fall within the true scope of the embodiments of the present application.
It is apparent that those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the embodiments of the present application and their equivalents, the embodiments of the present application are also intended to include such modifications and variations.

Claims (14)

1. A method for establishing a neighbor relation in an ad hoc network is applied to at least two network devices of the ad hoc network, wherein the at least two network devices comprise at least one relay device and a base station connected with a server, and the method comprises the following steps:
determining whether a previous hop device establishing previous hop connection with the self network device exists in the ad hoc network;
if the last hop equipment does not exist, acquiring the signal intensity of each channel of the network equipment and sending broadcast information; the self network equipment receives a neighbor relation establishment request sent by the previous hop equipment, sends a neighbor relation establishment response to the previous hop equipment and stops sending broadcast information; the broadcast information comprises an equipment identifier of the network equipment, a path length value between the network equipment and the server and the signal strength of each channel of the network equipment; the neighbor relation establishing response comprises a device identification of the network device, signal intensity of each channel of the network device and communication channels of the previous hop device and the network device;
if the previous hop equipment exists, establishing a neighbor alternative table of the network equipment according to broadcast information received in a preset time period and sent by other network equipment without the previous hop equipment; each table entry of the neighbor alternative table of the own network device comprises the corresponding relation and the existence duration of the device identification, the Received Signal Strength Indication (RSSI) of other network devices without the previous hop device; determining the next hop equipment of the network equipment according to the neighbor alternative table of the network equipment and the stored neighbor alternative table of the previous hop equipment; and establishing a neighbor relation with the next hop equipment.
2. The method as claimed in claim 1, wherein after receiving the neighbor relation establishment request sent by the previous hop device, the method further comprises:
determining a path length value between the network equipment and the server according to the path length value between the previous hop equipment and the server, and determining a communication channel for communicating with the previous hop equipment according to the signal strength of each channel of the network equipment and the signal strength of a corresponding channel of the previous hop equipment;
the neighbor relation establishing request includes a device identifier of the previous hop device, a path length value between the previous hop device and the server, signal strength of each channel of the previous hop device, and a neighbor candidate table created by the previous hop device.
3. The method of claim 2, wherein determining the path length value of the previous hop device according to the path length value between the previous hop device and the server comprises:
adding the path length value between the previous hop device and the server to a preset numerical value to obtain a new path length value;
and determining the new path length value as the path length value between the network equipment and the server.
4. The method of claim 2, wherein determining the communication channel with the previous-hop device according to the signal strength of each channel of the own network device and the signal strength of the corresponding channel of the previous-hop device comprises:
adding the signal intensity of each channel in the network equipment of the user to the signal intensity of the corresponding channel of the previous hop equipment to obtain the signal intensity sum of each channel;
and determining the signal intensity of each channel and the minimum signal intensity and the corresponding channel thereof as a communication channel for the last hop of equipment to communicate with the network equipment of the last hop of equipment.
5. The method of claim 1, wherein after creating the neighbor list of the own network device according to the broadcast information transmitted by the other network devices which do not have the previous hop device and received within a preset time period, the method further comprises:
if the RSSI which is larger than the signal strength of the preset backup device exists in the neighbor alternative table, determining other network devices which are corresponding to the RSSI which is larger than the signal strength of the preset backup device and do not have the previous hop device as backup devices of the network devices;
sending a main/standby establishing request carrying the equipment identifier of the network equipment to the backup equipment so that the backup equipment sends a main/standby establishing response carrying the equipment identifier of the backup equipment;
and receiving the main/standby establishing response.
6. The method of claim 5, wherein determining that the next-hop device of the own network device is ahead of the own network device is based on the neighbor candidate table of the own network device and the stored neighbor candidate table of the previous-hop device, the method further comprising:
deleting the RSSI which is greater than the signal strength of the preset backup equipment in the neighbor alternative list to obtain a neighbor list;
selecting RSSI (received signal strength indicator) within a preset neighbor signal strength range in the neighbor list;
and determining the maximum RSSI in the selected RSSIs as the target RSSI.
7. The method of claim 6, wherein determining the next-hop device of the self network device from the neighbor candidate table of the self network device and the stored neighbor candidate table of the previous-hop device comprises:
determining the device identifier of other network devices corresponding to the target RSSI and without the previous hop device as an alternative device identifier;
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is smaller than the target RSSI, determining other network devices corresponding to the candidate device identifier and having no previous hop device as the next hop devices of the network devices;
and if the candidate device identifier does not exist in the neighbor candidate table of the previous-hop device, determining other network devices corresponding to the candidate device identifier and without the previous-hop device as the next-hop devices of the network devices.
8. The method of claim 7, wherein the method further comprises:
if the candidate device identifier exists in the neighbor candidate table of the previous hop device and the RSSI corresponding to the candidate device identifier is not less than the target RSSI, removing the candidate device identifier from the neighbor candidate table of the network device to obtain a new neighbor candidate table of the network device.
9. The method of claim 1, wherein the method further comprises:
if the last hop equipment exists and the broadcast information sent by other network equipment without the last hop equipment is not received in the preset time period, sending a terminal equipment confirmation request carrying the equipment identification of the terminal equipment to the server so that the server matches the configured terminal equipment identification with the equipment identification of the network equipment, and if the matching is successful, returning a terminal equipment confirmation response carrying a terminal equipment confirmation indication.
10. The method of claim 1, wherein prior to establishing the neighbor relation with the next-hop device, the method further comprises:
and sending an equipment verification request carrying the equipment identifier of the next hop equipment to the server so that the server matches the equipment identifier of the next hop equipment with the registered equipment identifier, and if the matching is successful, returning an equipment verification response carrying a legal equipment identifier indication.
11. The method of any one of claims 1-10, wherein the method further comprises:
and if the last hop equipment does not exist, receiving broadcast information sent by other network equipment except the own network equipment.
12. An apparatus for establishing a neighbor relation in an ad hoc network, wherein the apparatus is applied to at least two network devices of the ad hoc network, and the at least two network devices include at least one relay device and a base station connected to a server, the apparatus comprising: the device comprises a determining unit, an obtaining unit, a sending unit, a creating unit and a establishing unit;
the determining unit is configured to determine whether a previous-hop device that establishes a previous-hop connection with the self network device exists in the ad hoc network;
the acquiring unit is configured to acquire the signal strength of each channel of the network device if it is determined that the previous hop device does not exist;
the sending unit is used for sending broadcast information; the self network equipment receives a neighbor relation establishment request sent by the previous hop equipment, sends a neighbor relation establishment response to the previous hop equipment and stops sending broadcast information; the broadcast information comprises a device identifier of the network device, a path length value between the network device and the server, and signal strength of each channel of the network device; the neighbor relation establishing response comprises a device identification of the network device, signal intensity of each channel of the network device and communication channels of the previous hop device and the network device;
the creating unit is configured to create a neighbor alternative table of the network device according to broadcast information received within a preset time period and sent by other network devices that do not have the previous hop device, if it is determined that the previous hop device exists; each table entry of the neighbor alternative table of the own network device comprises the corresponding relation and the existence duration of the device identification, the Received Signal Strength Indication (RSSI) of other network devices without the previous hop device;
the determining unit is further configured to determine a next hop device of the network device according to the neighbor candidate table of the network device and the stored neighbor candidate table of the previous hop device;
the establishing unit is used for establishing a neighbor relation with the next hop equipment.
13. An electronic device, characterized in that the electronic device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1-11 when executing a program stored on a memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-11.
CN202011080493.6A 2020-10-10 2020-10-10 Method and device for establishing neighbor relation in ad hoc network Active CN112423362B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011080493.6A CN112423362B (en) 2020-10-10 2020-10-10 Method and device for establishing neighbor relation in ad hoc network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011080493.6A CN112423362B (en) 2020-10-10 2020-10-10 Method and device for establishing neighbor relation in ad hoc network

Publications (2)

Publication Number Publication Date
CN112423362A CN112423362A (en) 2021-02-26
CN112423362B true CN112423362B (en) 2023-03-24

Family

ID=74854416

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011080493.6A Active CN112423362B (en) 2020-10-10 2020-10-10 Method and device for establishing neighbor relation in ad hoc network

Country Status (1)

Country Link
CN (1) CN112423362B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207572A (en) * 2007-12-14 2008-06-25 北京科技大学 Method for clustering vehicle mounted Ad hoc network based on signal strength
CN101394356A (en) * 2008-10-29 2009-03-25 北京大学 Route establishing method and device for mobile Ad hoc network
WO2009157985A2 (en) * 2008-06-27 2009-12-30 Silver Spring Networks, Inc. Route and link evaluation in wireless mesh communications networks
US8094637B1 (en) * 2008-12-01 2012-01-10 Marvell International Ltd. Avoiding mesh path discovery in wireless mesh networks
CN104023404A (en) * 2014-06-25 2014-09-03 山东师范大学 Channel allocation method based on number of neighbors
CN105898818A (en) * 2016-06-23 2016-08-24 广州大学 Wireless sensor network based negotiation routing algorithm
CN106888490A (en) * 2015-12-16 2017-06-23 中兴通讯股份有限公司 The method for routing and device of a kind of wireless self-networking
CN110167098A (en) * 2018-02-14 2019-08-23 维沃移动通信有限公司 A kind of method for building up of neighborhood, wireless relay and network side node
CN110461006A (en) * 2019-08-15 2019-11-15 普联技术有限公司 Reduce WLAN interference method, device and terminal device
CN111263379A (en) * 2020-02-19 2020-06-09 深圳市共进电子股份有限公司 Method for establishing backhaul station connection, network device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207572A (en) * 2007-12-14 2008-06-25 北京科技大学 Method for clustering vehicle mounted Ad hoc network based on signal strength
WO2009157985A2 (en) * 2008-06-27 2009-12-30 Silver Spring Networks, Inc. Route and link evaluation in wireless mesh communications networks
CN101394356A (en) * 2008-10-29 2009-03-25 北京大学 Route establishing method and device for mobile Ad hoc network
US8094637B1 (en) * 2008-12-01 2012-01-10 Marvell International Ltd. Avoiding mesh path discovery in wireless mesh networks
CN104023404A (en) * 2014-06-25 2014-09-03 山东师范大学 Channel allocation method based on number of neighbors
CN106888490A (en) * 2015-12-16 2017-06-23 中兴通讯股份有限公司 The method for routing and device of a kind of wireless self-networking
CN105898818A (en) * 2016-06-23 2016-08-24 广州大学 Wireless sensor network based negotiation routing algorithm
CN110167098A (en) * 2018-02-14 2019-08-23 维沃移动通信有限公司 A kind of method for building up of neighborhood, wireless relay and network side node
CN110461006A (en) * 2019-08-15 2019-11-15 普联技术有限公司 Reduce WLAN interference method, device and terminal device
CN111263379A (en) * 2020-02-19 2020-06-09 深圳市共进电子股份有限公司 Method for establishing backhaul station connection, network device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"基于复合中继的车载自组织网络数据传输算法";刘期烈等;《重庆邮电大学学报(自然科学版)》;20170215(第01期);第0-1节 *
"无线传感网的一种邻居搜索方法";韩磊等;《计算机技术与发展》;20110331(第03期);全文 *

Also Published As

Publication number Publication date
CN112423362A (en) 2021-02-26

Similar Documents

Publication Publication Date Title
JP5859716B1 (en) Adaptive channel reuse mechanism in communication networks
US20170135104A1 (en) Dedicated backhaul for whole home coverage
JP6040466B2 (en) Communication control method, user equipment, network server, and system
US20120021689A1 (en) Signaling method and device for mitigating interference in m2m communication system
JP2001189971A (en) Communication method in mobile communication system and mobile station
EP3364670B1 (en) Signal strength measurement method and device
US11638226B2 (en) Method and device for processing synchronization signal block information and communication device
CN110445511B (en) Self-adaptive synchronous frequency hopping method and device, wireless AP and communication system
US8897715B2 (en) Cognitive radio
CN108370548B (en) Method and terminal device for service discovery in Neighbor Awareness Network (NAN)
CN107666686B (en) Method for transmitting data and relay node
CN113259864B (en) Narrow-band communication method, interphone, equipment, storage medium and ad hoc network system
WO2018120102A1 (en) Beam selection method, apparatus and system
WO2020228454A1 (en) Communication method and related product
US20170303096A1 (en) Terminal device and communication method
CN112544107A (en) CGI reporting procedure for NR cells without SIB1
CN111246398B (en) Low-energy-consumption communication method, device and system and storage medium
CN112423362B (en) Method and device for establishing neighbor relation in ad hoc network
CN105657774B (en) Method and system for establishing self-adaptive core forwarding network in wireless self-organizing network
CN104661282A (en) Ad-hoc network access, data transmission and construction method
JP4153544B2 (en) Method and apparatus for reducing the average time required for a communication unit to connect to a communication network
US11632716B2 (en) Wireless communication method used in wireless communication device and wireless communication device
CN112637923B (en) Node confirmation method and device, computer equipment and storage medium
KR20140111827A (en) Method for interference management based on cooperation of peripheral idle devices
CN112312390A (en) Neighbor discovery method and system

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
GR01 Patent grant
GR01 Patent grant