A kind of LORA relaying ad hoc network method
Technical field
The invention belongs to wireless narrowband communication technique fields, and in particular to a kind of LORA relaying ad hoc network method.
Background technique
Traditional wireless narrowband networking, be all it is static, non-dynamic, communication range is low, fixed, spends a large amount of
Time carry out the state of maintenance network topology, the increase or deletion of node lead to network oscillation, cause to communicate unavailable.
LORA is one of LPWAN communication technology, is that one kind that Setech company of the U.S. uses and promotes is based on spread spectrum
The overlength distance wireless transmission scheme of technology.This scheme changes the compromise consideration side about transmission range and power consumption in the past
Formula provides one kind for user and is simply able to achieve remote, long battery life, large capacity system, and then extends sensing network.
LORA technology have remote, low-power consumption (battery life is long), multinode, low cost characteristic.
LORA network is mainly by terminal (built-in LORA module), gateway (or base station), the part Server and Yun Si group
At can transmitted in both directions using data.It is, in general, that transmission rate, working frequency range and network topology are to influence sensing network
Three principal elements.Wherein, the selection of network topology is to require the number of nodes needed with system to determine by transmission range
's.
Therefore, research and utilization LORA technology realizes dynamic group net, increases communication distance, and endpoint node has mobility, moves
It is significantly that state, which adds or deletes endpoint node without influencing network performance,.
Summary of the invention
The invention proposes one kind to be able to achieve dynamic group net, increases communication distance, and endpoint node has mobility, dynamically adds
Add or delete endpoint node and relays ad hoc network method without influencing the LORA of network performance.
The present invention adopts the following technical scheme that solution above-mentioned technical problem:
A kind of LORA relaying ad hoc network method, the ad hoc network are made of gateway node, relay node and endpoint node, from
The working condition of networking is divided into networking stage and stage of communication;
The relay node address and endpoint node address being arranged according to host computer in networking stage, gateway node are broadcasted
Networking, relay node continue to E-Packet after receiving the broadcasting packet;Endpoint node receives the broadcasting packet and then reports respectively certainly
Body nodal information generates endpoint node network topology to gateway node, relay node or other adjacent end nodes;Relay node
Gateway own node information, other relay node information and endpoint node information are collected respectively, report the endpoint node being collected into
Information generates relay network topology to gateway node;Gateway node collects relay node information and endpoint node information, generates net
Close network topology;
In stage of communication, gateway searches Optimization route according to endpoint node address, by gateway network topology, then sends report
Text;If there is relay node in Optimization route, then relay node E-Packets according to relay network topology;Endpoint node receives this
Message according to destination-address judgement is replied after one's own message, and replying routing can choose through gateway, logical
Cross the through gateway of relaying or by the through gateway of other endpoint nodes.
The relay node is also possible to the endpoint node for having relay function.
The stage of communication, for the message that gateway node is sent, the priority of relay forwarding is forwarded greater than endpoint node
Priority.
The reply of the endpoint node preferentially presses backtracking, for backtracking link if routing has multilevel relay
Poor signal quality situation selects neighbouring relay node or endpoint node to forward.
Advantages of the present invention:
1, the various nodes composition of high abstraction networking, is divided into gateway node, relay node and endpoint node, gateway section
Point is necessary node, and relay node is inessential node, and endpoint node is necessary node, and endpoint node is provided simultaneously with relay forwarding
Function can effectively supplement the influence that endpoint node mobility brings network topology change, realize dynamic group net, increase communication
Distance.
2, optimization group network process, dynamic increase or delete endpoint node, do not influence other endpoint nodes and gateway node is logical
Letter, not will lead to network oscillation and leads to not communicate.
3, this ad hoc network has increasingly automated, relay node address and endpoint node address need to be only arranged to net
Close, be not necessarily to other configurations, can be obtained by upper computer software endpoint node information and under issue a command to endpoint node carry out it is double
To communication.
Detailed description of the invention
A kind of Fig. 1 data flowchart of LORA relaying ad hoc network method of the present invention.
Specific embodiment
Embodiment 1
As shown in Figure 1, a kind of LORA relays ad hoc network method, the state of the ad hoc network is divided into group net state and normal work
State due to the mobility of endpoint node, therefore sets 30 seconds as a cycle, and 0-2 seconds are networking stage, the 3-30 seconds normal opens that are positive
Letter stage, above-mentioned period can according to circumstances adjust.
The LORA relaying ad hoc network is made of gateway node, relay node and endpoint node.
Gateway node: necessary node has leading position, has active networking function and period networking function, generates net
Network topology is closed, normal communication periods inquire endpoint node data function.
Relay node: inessential node, in networking stage, report gateway own node information, Tandem Gateway node it is wide
Casting text;Gateway, other relay node information are collected, the information of endpoint node is collected, generates relay network topology;Normal communication
Stage according to relay network topology, E-Packets.
Endpoint node: necessary node reports own node information to save to gateway node, relaying respectively in networking stage
Point and other neighbours' endpoint nodes generate endpoint node network topology;In normal communication periods, in addition to reporting data,
Also have the function of forward gateway node, relay node and other endpoint node messages.
Specific step is as follows for ad hoc network method of the present invention:
1, upper computer software setting relay node address, endpoint node address, frequency point channel are to gateway.
2, the relay node address and endpoint node address that gateway is arranged according to upper computer software carry out broadcast networking.
3, the broadcasting packet of step 2 issues all relay node and endpoint node, and relay node continues to forward the broadcast
Message, endpoint node receive the broadcasting packet and then report own node information to relay node, and last relay node handle is collected into
Endpoint node information reporting to gateway node, so far gateway network topology, relay network topology and endpoint node network topology
Building is completed.
4, gateway carries out transmitting order to lower levels or query information according to end address, according to gateway network topology, searches best road
By then sending message.
5, for the message described in step 4, the priority of relay forwarding is greater than the priority of endpoint node forwarding, it is preferential in
After forwarding.
6, endpoint node receives the message that destination address is oneself, is replied, and routing can choose through gateway, pass through
It relays through gateway or backtracking is preferentially pressed, for original for multilevel relay situation by the through gateway of other endpoint nodes
Road returns to link signal quality difference situation, and neighbouring relay node or endpoint node is selected to forward.
Embodiment 2
A kind of LORA relaying ad hoc network method, LORA relaying ad hoc network are made of gateway node and endpoint node.
Specific step is as follows:
1, upper computer software setting endpoint node address, frequency point channel are to gateway.Endpoint node has relay function.
2, gateway carries out broadcast networking according to the endpoint node address that upper computer software is arranged.
3, the broadcasting packet of step 2 issues all endpoint nodes, and the endpoint node for making to relay continues to E-Packet, end
Node receives the broadcasting packet and then reports own node info gateway or other endpoint nodes for making to relay, and generates endpoint node net
Network topology;The endpoint node information reporting being collected into gateway node, is collected endpoint node by the endpoint node for making to relay respectively
Information, gateway node information, other endpoint nodes for making to relay, generate relay network topology;Gateway node collects endpoint node
The endpoint node information that information and work relay generates gateway network topology;
4, gateway carries out transmitting order to lower levels or query information according to end address, according to gateway network topology, searches best road
By then sending message.
5, for the message described in step 4, the priority of relay forwarding is greater than the priority of endpoint node forwarding, it is preferential in
After forwarding.
6, endpoint node receives the message that destination address is oneself, is replied, and routing can choose through gateway, pass through
Other endpoint nodes go directly gateway, for multilevel relay situation, backtracking are preferentially pressed, for backtracking link signal quality
Poor situation selects neighbouring relay node or endpoint node to forward.
The present embodiment endpoint node has relay function, is used as relay node.