CN113825200A - LoRa-based half-duplex multi-frequency ad hoc network method and device - Google Patents

LoRa-based half-duplex multi-frequency ad hoc network method and device Download PDF

Info

Publication number
CN113825200A
CN113825200A CN202111397971.0A CN202111397971A CN113825200A CN 113825200 A CN113825200 A CN 113825200A CN 202111397971 A CN202111397971 A CN 202111397971A CN 113825200 A CN113825200 A CN 113825200A
Authority
CN
China
Prior art keywords
node
data
request packet
route
packet information
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.)
Granted
Application number
CN202111397971.0A
Other languages
Chinese (zh)
Other versions
CN113825200B (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.)
Casc Shenzhou Technology Development Co ltd
Original Assignee
Casc Shenzhou Technology Development 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 Casc Shenzhou Technology Development Co ltd filed Critical Casc Shenzhou Technology Development Co ltd
Priority to CN202111397971.0A priority Critical patent/CN113825200B/en
Publication of CN113825200A publication Critical patent/CN113825200A/en
Application granted granted Critical
Publication of CN113825200B publication Critical patent/CN113825200B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Abstract

The application discloses a LoRa-based half-duplex multi-frequency ad hoc network method and device, and relates to the field of communication. The method caches data to be sent, a destination address of the data and a service type and packs routing request packets, wherein each field in the routing request packets is consistent with a routing protocol. And sending the routing request packet to the intermediate node after packaging the routing request packet, and meanwhile controlling to start the first timer. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted. And adding a reverse route pointing to the source node according to the route request packet information, judging whether an intermediate node receiving the route request packet is a destination node or not, determining whether the route request packet is discarded or not according to the judgment result, and switching all the nodes to a service channel corresponding to the source node ID in the route establishment process. Therefore, the method can effectively solve the problem of communication speed.

Description

LoRa-based half-duplex multi-frequency ad hoc network method and device
Technical Field
The application relates to the field of communication, in particular to a LoRa-based half-duplex multi-frequency ad hoc network method and device.
Background
With the development of the technology, the communication technology is widely applied, the LoRa technology is a low-power-consumption long-distance wireless communication technology, and the LoRa technology conforms to the development characteristics of the internet of things, so that the LoRa technology is a trend of the internet at present.
Compared with the internet of things method based on cellular communication, the LoRa modulation technology uses a technology combining spread spectrum modulation and forward error correction. At present, two networking modes are available based on the LoRa technology, wherein one mode is networking by one channel, but the method reduces the network throughput performance; the other method is to perform networking by using a multi-channel communication mac (media Access control) technology, and although the problem of network throughput performance is solved, the problem that the communication rate cannot be guaranteed due to channel competition among nodes exists.
Therefore, how to solve the problem that the communication rate cannot be guaranteed due to the inter-node channel competition of the LoRa in the distributed scenario is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a LoRa-based half-duplex multi-frequency ad hoc network method and device, which can effectively improve the communication rate.
In order to solve the above technical problem, the present application provides a low ra half-duplex multi-frequency ad hoc network method, which is applied to a source node, where the source node includes a first timer implemented by software or hardware, and the method includes:
judging whether data needs to be sent or not;
if data need to be sent, caching a destination address, a service type and the data of the node data; the node data is data to be sent;
generating a corresponding route request packet and packaging the route request packet and data to form route request packet information; wherein, each field in the routing request grouping information is consistent with the routing protocol;
sending routing request packet information to the intermediate node;
controlling to start a first timer;
and if the route reply packet is not received after the preset time length is exceeded, the route request packet information is retransmitted.
Preferably, the route request packet information is transmitted through channel 0.
In order to solve the above technical problem, the present application further provides a multi-frequency ad hoc network method based on LoRa half-duplex, which is applied to an intermediate node, where the intermediate node includes a second timer implemented by software or hardware, and the method includes:
receiving routing request grouping information sent by a source node;
and judging whether the node is a destination node according to the destination address in the routing request packet information, and determining whether to discard the routing request packet information according to the judgment result.
Preferably, the determining whether the node is a destination node according to the destination node address in the routing request packet information, and determining whether to discard the routing request packet information according to the determination result includes:
if the node is a destination node, discarding the routing request packet information, generating and sending routing reply packet information to the upper-level node, and starting a second timer by the destination node;
if the node is not the destination node, comparing the serial number of the routing request packet information with the serial number from the same source node;
and if the sequence number of the routing request packet information is larger than the sequence number from the same source node, adding 1 to the hop count field in the routing request packet information and forwarding the routing request packet information.
Preferably, the method further comprises the following steps:
receiving route reply packet information;
acquiring a route reply packet according to the route reply packet information, and judging whether the route reply packet is a preset packet or not;
if the route reply packet is a preset packet, generating and feeding back a switching request packet message;
judging whether the node receiving the route reply packet information is a source node or not according to the route reply packet information;
and if the node receiving the route reply packet information is the source node, discarding the route reply packet information and switching to a service channel corresponding to the source node identity identification number.
In order to solve the above technical problem, the present application further provides a LoRa-based half-duplex multi-frequency ad hoc network method, applied to a route, including: in the establishing process, all nodes are switched to the service channel corresponding to the source node identification number.
Preferably, the method further comprises the following steps:
if a certain node does not receive the switching request packet information in the data sending process, the service data is retransmitted;
if the node still receives a switching request packet message after receiving and forwarding the last packet to the next node in the data sending process, the completion of the transmission of the round of service data is confirmed and the node is switched to the channel 0 for channel interception.
In order to solve the above technical problem, the present application further provides a multi-frequency ad hoc network device based on LoRa half-duplex, which is applied to a source node, and includes:
the judging module is used for judging whether data need to be sent;
the cache module is used for caching the destination address, the service type and the data of the node data if the data needs to be sent; the node data is data to be sent;
the generating module is used for generating a corresponding routing request packet and packaging the routing request packet and data to form routing request packet information; wherein, each field in the routing request grouping information is consistent with the routing protocol;
a sending module, configured to send routing request packet information to an intermediate node;
and the control module is used for controlling the starting of the first timer.
In order to solve the above technical problem, the present application further provides a multi-frequency ad hoc network device based on LoRa half-duplex, including:
a memory for storing a computer program;
and the processor is used for realizing the steps of the LoRa-based half-duplex multi-frequency ad hoc network when executing a computer program.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the semi-duplex multi-frequency ad hoc network based on LoRa are implemented.
According to the LoRa-based half-duplex multi-frequency ad hoc networking method, data to be sent, a destination address of the data and a service type are cached, and routing request packets are grouped and packaged to form routing request packet information, wherein each field in the routing request packet information is consistent with a routing protocol. And sending the routing request grouping information to the intermediate node, packaging the routing request grouping and the data to enable the routing request grouping and the data to be sent in a more targeted mode, and meanwhile controlling to start the first timer. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted so as to improve the working efficiency. The method improves the throughput of the network by simultaneously working a plurality of channels, adds a reverse route pointing to a source node according to route request grouping information, judges whether an intermediate node receiving the route request grouping is a destination node or not, determines whether to discard the route request grouping information according to the judgment result, and can release resources if discarding the route request grouping information, thereby avoiding the waste of resources. It can be seen that each source node works on the physical channel corresponding to its ID during data communication, and does not need to share and compete with other nodes for a channel, so that its information transmission on the data traffic channel can reach the theoretical upper limit of the LoRa protocol, thereby solving the problem that the communication rate cannot be guaranteed due to inter-node channel competition in the distributed scenario for LoRa.
In addition, this application still provides a based on loRa half-duplex multifrequency is from network deployment device, and beneficial effect is the same as above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings needed for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of a LoRa-based half-duplex multi-frequency ad hoc network method according to an embodiment of the present disclosure;
fig. 2 is a channel contention flow chart of the DCF mechanism provided in the present application;
fig. 3 is a flowchart of a LoRa-based half-duplex multi-frequency ad hoc network method according to another embodiment of the present application;
fig. 4 is a diagram of an apparatus for a LoRa-based half-duplex multi-frequency ad hoc network method according to another embodiment of the present application;
fig. 5 is a communication flow chart of each node provided in the embodiment of the present application, in which
Figure 384572DEST_PATH_IMAGE001
For the transit nodes of the flow chart, it is indicated that the locations marked with the same labels are connected together.
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 the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a LoRa-based half-duplex multi-frequency ad hoc network method and device. In the prior art, a technique of combining spread spectrum modulation and forward error correction is adopted, and the technique increases the communication range and the link reliability. Networking modes based on the LoRa technology are two, one of the networking modes is a channel for networking, but the method reduces the network throughput performance; and secondly, networking is performed by using a multi-channel communication MAC (media Access control) technology, although the problem of network throughput performance is solved, no communication rate is guaranteed, the method provides a LoRa-based half-duplex multi-frequency self-networking method, and the problem of communication rate guarantee is effectively solved by using cross-layer optimization design through LoRa-half-duplex multi-channel method design and introduction of DCF multiple Access and AODV routing protocols.
In order that those skilled in the art will better understand the disclosure, the following detailed description will be given with reference to the accompanying drawings.
Implementation mode one
Fig. 1 is a flowchart of a method for multi-frequency ad hoc networking based on LoRa half-duplex provided in an embodiment of the present application, and as shown in fig. 1, an embodiment is applied to a source node, where the source node includes a first timer implemented by software or hardware, and the method includes:
s2: and judging whether data needs to be sent.
In specific implementation, each node consists of an upper computer, a LoRa communication module, a memory and power supply equipment. Since different LoRa protocol chips are different in working frequency point and channel number, an SX1278 chip is selected as a preferred embodiment in the present application, and it should be noted that no specific limitation is made in the specific implementation.
There are 32 channels based on the SX1278 chip, which are denoted as channel 0 to channel 31, where in the present application, channel 0 is used as a signaling channel for carrying route establishment information, and the remaining 31 channels are used as data traffic channels for carrying data communication of each device.
After each node is powered on and parameter initialization is completed, the node starts to work according to task needs, and it should be noted that parameters in the parameter initialization include: the Identity Document (ID) of each node clears the cache and the timer, and completes the register configuration of the LoRa protocol chip, so that all the nodes work in a signaling channel, namely a channel 0, and are in a channel monitoring mode; where the allowable range of ID numbers is No. 1 to No. 31, each node is different.
S3: if data need to be sent, caching the destination address, the service type and the data of the node data.
In specific implementation, after all preparation works are completed, aiming at task needs, when data to be sent exists in a certain node, the upper computer stores the destination address, the service type and the data of the data into a cache queue. It should be noted that the cache manner is not particularly limited.
Fig. 2 is a channel contention flow chart of the DCF mechanism provided in the present application, and as shown in fig. 2, in a multi-channel multiple access technical scheme, one of channels is a control channel, and the other channels are data channels, and all nodes in a network operate in an Ad-Hoc mode. If some node has data to send, the Route Request (RREQ) packet information is sent on the control channel. The nodes in the application are divided into source nodes, destination nodes and intermediate nodes; a source node is a node in a communication protocol that generates data packets; the destination node is the node to which the data packet is destined; an intermediate node is a node that appears on a route between a source node and a destination node. The RREQ grouping information carries the currently available data channel information of the source node, if the destination node receives the RREQ grouping and the available data channel set is intersected with the available channel of the source node, the destination node sends Routing Reply (RREP) grouping information, after receiving the RREP grouping information, the source node sends the data grouping, the destination node prepares to receive data after sending the RREP grouping information, and after successful receiving, the destination node sends a switching request (ACK) grouping on the data channel to complete one-time data transmission.
Further, there may be collision caused by simultaneous transmission of multiple nodes on the control channel, and both the transmission condition and the processing method after collision both conform to the DCF rule in the 802.11 protocol, i.e. obey the binary back-off process. According to the 802.11 protocol, before sending the RREQ packet, the node enters a backoff procedure after a channel free DIFS (Distributed Inter-frame Spacing) or eifs (extended Inter frame space) Distributed Inter-frame gap. Randomly selecting an integer to be placed into a backoff timer within the backoff time [0, CW-1], and subtracting 1 from a backoff counter every time slot if a channel is idle; if the channel is busy, the backoff counter stops decrementing by 1. And after the channel is idle again for DIFS or EIFS distributed interframe space, the backoff timer continues to be decreased by 1 every time an idle space passes, and when the value of the backoff timer is decreased to 0, the node sends the RREQ packet. The method does not need to share and compete with other nodes for the channel so as to improve the communication rate during transmission.
S4: generating a corresponding route request packet and packaging the route request packet and data to form route request packet information; wherein, each field in the routing request packet information is consistent with the routing protocol.
After the buffering is completed, a corresponding Route Request (RREQ) packet is generated and is packaged with data to form route request packet information, it should be noted that the packaging manner is not specifically limited, as a preferred embodiment, each field in the RREQ packet information in the present application is consistent with a routing protocol (AODV), that is, the RREQ packet information includes information such as a sequence number, a destination address, and a hop count field that are larger than those before.
S5: and sending the routing request packet information to the intermediate node.
In a specific implementation, the packaged RREQ packet information is sent out through a LoRa signaling channel, i.e., channel 0.
S6: and controlling to start a first timer.
In specific implementation, the upper computer starts a first timer while sending out the data of the RREQ packet, and the first timer is used for calculating the data sending time of the RREQ packet.
S7: and if the route reply packet is not received after the preset time length is exceeded, the route request packet information is retransmitted.
In specific implementation, the first timer is started while the RREQ packet information is sent, at the moment, the first timer starts to calculate the sending time length of the RREQ packet information, corresponding route reply is received after the sending is completed, and the RREQ packet is sent again if the route reply is not received after the preset time length is exceeded.
Therefore, according to the LoRa half-duplex multi-frequency ad hoc network method, data to be sent, a destination address of the data and a service type are cached, and routing request packets are grouped and packaged, wherein each field in the routing request packets is consistent with a routing protocol. And after the routing request packet is packaged, the routing request packet is sent to the intermediate node, the routing request packet is packaged to be sent in a more targeted mode, and meanwhile, the first timer is controlled to be started. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted so as to improve the working efficiency. The method improves the throughput of the network by the simultaneous working of a plurality of channels, judges whether an intermediate node receiving a routing request packet is a destination node or not according to routing request packet information, determines whether to discard the routing request packet or not according to the judgment result, and can release resources if the routing request packet is discarded, thereby avoiding the waste of resources. It can be seen that each source node works on a physical channel corresponding to its ID when performing data communication, and the present application also adopts a multi-channel multiple access technical scheme, all nodes in the network work in a point-to-point (Ad-Hoc) mode, and the sending conditions and the processing method after collision both conform to the DCF rule in the 802.11 protocol, i.e. obey a binary backoff process, and do not need to share and compete with other nodes, so that the information transmission of the data traffic channel can reach the theoretical upper limit of the LoRa protocol, thereby solving the problem that the communication rate cannot be guaranteed due to inter-node channel competition in the distributed scenario of LoRa.
Second embodiment
According to the above embodiment, after the route request packet is packaged, the second embodiment needs to send its data to other nodes, so as a preferred embodiment, the route request packet information is sent out through the channel 0.
In specific implementation, after each node is powered on and parameter initialization is completed, the node starts to work according to task needs, and it should be noted that parameters in the parameter initialization include: clearing the ID number of each node, a cache and a timer, and completing the register configuration of an LoRa protocol chip, so that all the nodes work on a channel 0 and are in a channel interception mode; after all preparation works are finished, aiming at task needs, when data needing to be sent exist in the nodes, the upper computer stores the destination address, the service type and the data of the data into a cache queue. After buffering is complete, the corresponding RREQ packet will be generated and packaged and its data sent out over channel 0. Therefore, when the preparation work is started, the cache can be emptied to release resources, so that the waste of network resources is avoided, the channel is in the interception mode, the operation of the next instruction can be started at any time, and the communication rate of the subsequent system during work is also ensured.
Third embodiment
Fig. 3 is a flowchart of a method for multi-frequency ad hoc networking based on LoRa half-duplex according to another embodiment of the present application, and as shown in fig. 3, a third embodiment is applied to an intermediate node, where the intermediate node includes a second timer implemented by software or hardware, and includes:
s8: data of a route request packet transmitted by a source node is received.
In a specific implementation, according to the above embodiment, after the route request packet is packetized, it is transmitted through channel 0, the RREQ packet information is received by the intermediate node, and the received RREQ packet information is analyzed.
S9: and judging whether the node is a destination node according to the destination address in the routing request packet information, and determining whether to discard the routing request packet information according to the judgment result.
In a specific implementation, whether the node, namely the node receiving the RREQ packet, is the destination node or the intermediate node is judged according to the address of the destination node in the RREQ packet. If the node is an intermediate node, the RREQ grouping information is reserved; if the node is the destination node, the RREQ packet message is discarded and a Route Reply (RREP) is generated.
Therefore, the method for multi-frequency ad hoc networking based on LoRa half-duplex receives data of RREQ grouping, adds a reverse route pointing to a source node according to RREQ grouping information, judges whether an intermediate node receiving the RREQ grouping is a destination node or not, determines whether the RREQ grouping is discarded or not according to the judgment result to release network resources, prevents resource waste caused by excessive use of the resources, and switches all the nodes to a service channel corresponding to a source node ID in the route establishment process. Therefore, the method adopts a mode of simultaneously working a plurality of channels, can improve the network throughput performance, can save network resources and effectively solve the problem of communication rate.
Embodiment IV
According to the above-described embodiment, the destination address is obtained by analyzing data of the RREQ packet, and as a preferred embodiment, the fourth embodiment determines whether the node is the destination node according to the destination node address in the route request packet, and determines whether to discard the route request packet according to the determination result includes:
if the node is a destination node, discarding the routing request packet information, generating and sending routing reply packet information to the upper-level node, and starting a second timer by the destination node;
if the node is not the destination node, comparing the serial number of the routing request packet information with the serial number from the same source node;
and if the sequence number of the routing request packet information is larger than the sequence number from the same source node, adding 1 to the hop count field in the routing request packet information, forwarding the routing request packet information, generating and sending a routing reply to the upper-level node, and starting a second timer by the destination node.
In a specific implementation, if the node is determined to be the destination node, the RREQ packet is discarded, the RREP packet is generated and sent to the previous node through the LoRa module and the reverse route, and the second timer is started. Since the RREP packet is transmitted to the upper node, if the ACK packet is not received at the expiration of the timer, the RREP packet is transmitted to the upper node again. If the number of times of retransmitting the RREP packet reaches the upper limit of the preset number of times, the RREP packet is stopped being transmitted, the reliability of the system can be enhanced by performing feedback on the upper-level node, and if the feedback is not received, the RREP packet is retransmitted, so that the working efficiency of the system is improved.
If the node is determined to be the intermediate node, judging whether the RREQ serial number is larger than the serial number from the same source node before; if the RREQ sequence number is larger than the previous sequence number from the same source node, the hop count field in the RREQ packet needs to be added with 1, and the RREQ packet is forwarded outwards continuously.
Therefore, a destination address is obtained through information analysis of the RREQ packet, and whether a node receiving the RREQ packet is an intermediate node or a destination node is judged according to the destination address of the RREQ packet; if the node is not the destination node, namely the intermediate node, comparing the sequence number of the RREQ packet with the sequence number from the same source node; if the node is the destination node, the RREQ packet is discarded to release the network resources, and resource waste caused by excessive use of the resources is prevented.
Fifth embodiment
According to the above embodiment, since the RREP packet is sent to other nodes through the LoRa module, it should be first determined whether the RREP packet is sent to this node, as a preferred embodiment, the fifth implementation further includes:
receiving route reply packet information;
acquiring a route reply packet according to the route reply packet information, and judging whether the route reply packet is a preset packet or not;
if the route reply packet is a preset packet, generating and feeding back a switching request packet message;
judging whether the node receiving the route reply packet information is a source node or not according to the route reply packet information;
and if the node receiving the route reply packet information is the source node, discarding the route reply packet information and switching to a service channel corresponding to the source node identity identification number.
In specific implementation, if the RREP packet is received, whether the RREP packet is a preset packet is judged according to RREP packet information; and if the RREP packet is not a preset packet, directly discarding the RREP packet.
If the RREP packet is a preset packet, whether the RREP packet is a source node is judged, and if the RREP packet is not the source node, a switching request (ACK) packet is generated and fed back to the node which sends the RREP packet so as to facilitate receiving confirmation. After receiving the node confirming the ACK packet, stopping the timer related to the RREP packet and switching to the channel corresponding to the ID number of the source node to wait for receiving data, and then starting a data service receiving timer. If the timer expires and the data and the service of the source node are not received, the round of receiving process is terminated, the channel returns to the channel 0 again for channel interception, and the next RREP grouping is waited.
If the node is a source node, the node directly discards the RREP grouping information to release resources, thereby avoiding network resource waste, and directly switches to a service channel corresponding to an ID number after ACK information is sent for receiving confirmation, and an upper computer sends out the service data cached in a data queue through the service channel of an LoRa module along an established route.
Sixth embodiment
According to the above embodiment, the sixth embodiment is applied to routing, and includes: in the process of establishing, all nodes are switched to the service channel corresponding to the source node ID.
In a specific implementation, in the process of establishing the route, all nodes on the route are switched to a data channel corresponding to the source node ID, for example: the source node has an ID number of 5 and switches to channel 5. Therefore, the source node can send the service data along the route through the data channel, after each node on the route receives the service data, an ACK packet is sent to the node of the previous stage through the data channel for receiving confirmation, and the reliability of the system can be enhanced by feeding back the node of the previous stage. If the service data packets of the source node are more, each intermediate node can only feed back one ACK packet after receiving all the service data sent by the source node, and then forward the cached service data to reduce the channel overhead, and only one ACK packet is fed back, so that the resource can be saved while the convenience and the simplicity are realized.
Seventh embodiment
According to the above embodiment, there may be a node that does not receive ACK packet information during data transmission, so as to be a preferred embodiment, the seventh implementation manner further includes:
if a certain node does not receive the switching request packet information in the data sending process, the service data is retransmitted;
if the node still receives a switching request packet message after receiving and forwarding the last packet to the next node in the data sending process, the completion of the transmission of the round of service data is confirmed and the node is switched to the channel 0 for channel interception.
In a specific implementation, if a certain node does not receive the ACK packet information in the data transmission process, the service data is uploaded again. And if the number of times of uploading reaches the preset number of times of uploading and the ACK packet information is not received, determining that the channel is interrupted, stopping the round of data receiving by the node, returning to the channel 0 again for channel monitoring, and waiting for the next RREQ packet.
It should be noted that the source node carries the expected number of packets to be sent and the current packet count in the service data to be sent, and after the intermediate node successfully receives the last packet information, the intermediate node forwards the last packet information to the next node and then receives ACK packet information to ensure reliable communication, so that the node has completed the service data transmission task of this round, and switches to channel 0 to perform channel sensing to wait for the next RREQ packet, so as to start the next task at any time.
In the above embodiment, a detailed description is given to a method for multi-frequency ad hoc network based on LoRa half-duplex, and the present application also provides a corresponding embodiment of a multi-frequency ad hoc network based on LoRa half-duplex. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
Embodiment eight
The first implementation mode of the LoRa-based half-duplex multi-frequency ad hoc network method can be implemented based on computer software, and the first implementation mode is a description mode of the first implementation mode of the device based on the LoRa-based half-duplex multi-frequency ad hoc network method, and the second implementation mode of the LoRa-based half-duplex multi-frequency ad hoc network device is applied to a source node and includes:
the judging module is used for judging whether data need to be sent;
the cache module is used for caching the destination address, the service type and the data of the node data if the data needs to be sent; the node data is data to be sent;
the generating module is used for generating a corresponding routing request packet and packaging the routing request packet and data to form routing request packet information; wherein, each field in the routing request grouping information is consistent with the routing protocol;
a sending module, configured to send routing request packet information to an intermediate node;
and the control module is used for controlling the starting of the first timer.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Therefore, according to the LoRa-based half-duplex multi-frequency ad hoc network device, data to be sent, a destination address of the data and a service type are cached, and routing request packets are grouped and packaged, wherein each field in the routing request packets is consistent with a routing protocol. And after the routing request packet is packaged, the routing request packet is sent to the intermediate node, the routing request packet is packaged to be sent in a more targeted mode, and meanwhile, the first timer is controlled to be started. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted so as to improve the working efficiency. The method improves the throughput of the network by simultaneously working a plurality of channels, adds a reverse route pointing to a source node according to route request grouping information, judges whether an intermediate node receiving the route request grouping is a destination node or not, determines whether to discard the route request grouping according to the judgment result, and can release resources if discarding the route request grouping, thereby avoiding the waste of resources. Therefore, the method can effectively solve the problem of communication speed.
Ninth embodiment
Fig. 4 is a structural diagram of a LoRa-based half-duplex multi-frequency ad hoc network device according to another embodiment of the present application, and as shown in fig. 4, the LoRa-based half-duplex multi-frequency ad hoc network device includes:
a memory 20 for storing a computer program;
a processor 21, configured to execute the computer program to implement the steps of the LoRa-based half-duplex multi-frequency ad hoc network method as mentioned in the above embodiments.
The LoRa-based half-duplex multi-frequency ad-hoc network device provided by this embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, or a desktop computer.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 21 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor for processing a calculation operation related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the LoRa-based half-duplex multi-frequency ad hoc network method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like. The data 203 may include, but is not limited to, data related to a LoRa-based half-duplex multi-frequency ad hoc networking process, and the like.
In some embodiments, the LoRa-based half-duplex multi-frequency ad-hoc network device may further include a display screen 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the configuration shown in fig. 4 does not constitute a limitation of the LoRa-based half-duplex multi-frequency ad-hoc network device and may include more or fewer components than those shown.
The LoRa half-duplex based multi-frequency ad hoc network device provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the LoRa half-duplex based multi-frequency ad hoc network method can be realized: caching data to be sent, a destination address of the data and a service type, and packaging routing request packets in a grouping manner, wherein each field in the routing request packets is consistent with a routing protocol. And sending the routing request packet to the intermediate node after packaging the routing request packet, and meanwhile controlling to start the first timer. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted. And adding a reverse route pointing to the source node according to the route request packet information, judging whether an intermediate node receiving the route request packet is a destination node or not, determining whether the route request packet is discarded or not according to the judgment result, and switching all the nodes to a service channel corresponding to the source node ID in the route establishment process. Therefore, the method can effectively solve the problem of communication speed.
Detailed description of the preferred embodiment
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program, which when executed by a processor implements the steps described in the above-described method embodiments (which may be a method corresponding to a source node side, a method corresponding to an intermediate node side, a method corresponding to a routing side, or a method corresponding to a source node, an intermediate node side, and a routing side).
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The computer-readable storage medium provided in the embodiment of the present application stores a computer program, and when the program is executed by a processor, the method can implement the steps of the LoRa-based half-duplex multi-frequency ad hoc network method: caching data to be sent, a destination address of the data and a service type, and packaging routing request packets in a grouping manner, wherein each field in the routing request packets is consistent with a routing protocol. And after the routing request packet is packaged, the routing request packet is sent to the intermediate node, the routing request packet is packaged to be sent in a more targeted mode, and meanwhile, the first timer is controlled to be started. And if the route reply is not received after the preset time length is exceeded, the route request packet is retransmitted so as to improve the working efficiency. The method improves the throughput of the network by simultaneously working a plurality of channels, adds a reverse route pointing to a source node according to route request grouping information, judges whether an intermediate node receiving the route request grouping is a destination node or not, determines whether to discard the route request grouping according to the judgment result, and can release resources if discarding the route request grouping, thereby avoiding the waste of resources. It can be seen that each source node works on the physical channel corresponding to its ID during data communication, and does not need to share and compete with other nodes for a channel, so that its information transmission on the data traffic channel can reach the theoretical upper limit of the LoRa protocol, thereby solving the problem that the communication rate cannot be guaranteed due to inter-node channel competition in the distributed scenario for LoRa.
Description of the invention
In practical application, the semi-duplex multi-frequency ad hoc networking method based on LoRa is completed by the source node, the intermediate node and the routing function claimed by the present invention, as shown in fig. 5, a communication flow diagram of each node provided for the embodiment of the present application is shown, and in fig. 5, each node is composed of an upper computer, a LoRa communication module, a memory and a power supply device. Since different LoRa protocol chips are different in working frequency point and channel number, an SX1278 chip is selected as a preferred embodiment in the present application, and it should be noted that no specific limitation is made in the specific implementation.
There are 32 channels based on the SX1278 chip, which are denoted as channel 0 to channel 31, where in the present application, channel 0 is used as a signaling channel for carrying route establishment information, and the remaining 31 channels are used as data traffic channels for carrying data communication of each device.
After each node is powered on and parameter initialization is completed, the nodes start to work according to task requirements, register configuration of an LoRa protocol chip is completed, and all the nodes are switched to a signaling channel, namely all the nodes work in a channel 0 and are in a channel interception mode. After all preparation works are finished, whether data need to be sent or RREQ grouping information needs to be received is judged according to task needs, if data which need to be sent exist in a certain node, the node serves as a source node to work, the working process refers to the working process of the source node, and the upper computer stores the destination address, the service type and the data of the data into a cache queue. The source node will send the RREQ packet and start the RREP packet timer, if the RREP packet is received or the timing expires, the RREP packet timer is cleared and an ACK packet is sent as feedback. If the ACK packet is not received, judging whether the current retransmission times is the maximum retransmission times; if the retransmission times do not exceed the preset maximum retransmission times, adding 1 to the retransmission times and retransmitting the data packet; and if the retransmission times reach the preset maximum retransmission times, switching to the signaling channel and keeping in a channel interception mode. If the ACK packet is received, it is determined whether all data packets have been sent, and if not, the above steps are repeated, which is not described herein.
The node receiving the RREQ grouping information in the networking process is an intermediate node, and the working process of the intermediate node is the working process of the intermediate node. After receiving the data of the RREQ packet sent by the source node, the intermediate node analyzes the data to obtain the destination node address of the RREQ packet, and judges whether the node receiving the route request packet is the destination node or not according to the destination node address. If the node is the destination node, discarding the RREQ packet and generating a RREP packet; if the node is not a destination node, namely an intermediate node, the RREQ packet is reserved, the sequence number of the route request packet is compared with the sequence number from the same source node, if the sequence number of the RREQ packet is larger than the sequence number of the source node, the hop number field of the RREQ packet is added with 1, the RREQ packet is continuously forwarded, and meanwhile, a timer is started; if not, whether the RREP/RREQ packet is received or the timer expires is judged. Judging whether an RREP/RREQ packet is received or a timer expires; and if the ACK packet is received, feeding back the ACK packet to the source node, switching to a data traffic channel to be in a channel sensing mode at the moment, and starting a timer. As can be seen, each time an RREQ/RREP packet is sent, an ACK packet is fed back, and whether the ACK packet is received or not is judged, and if not, whether the retransmission times exceed the preset maximum retransmission times is judged; if not, adding 1 to the retransmission times and retransmitting the data packet; if so, switching to the signaling channel and waiting for the next data transmission again, and repeating the steps, which is not described herein.
The method and the device for multi-frequency ad hoc network based on LoRa half-duplex provided by the present application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present application without departing from the principle of the present application, and such improvements and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A half-duplex multi-frequency ad hoc network method based on LoRa is characterized in that the method is applied to a source node, and the source node contains a first timer realized by software or hardware, and the method comprises the following steps:
judging whether data needs to be sent or not;
if data need to be sent, caching a destination address, a service type and the data of the node data; wherein the node data is data to be transmitted;
generating a corresponding route request packet and packaging the route request packet and data to form route request packet information; wherein, each field in the routing request grouping information is consistent with a routing protocol;
sending the routing request packet information to an intermediate node;
controlling to start the first timer;
and if the route reply packet is not received after the preset time length is exceeded, the route request packet information is retransmitted.
2. The LoRa-based half-duplex multi-frequency ad hoc network method of claim 1, wherein the routing request packet information is transmitted through channel 0.
3. A half-duplex multi-frequency ad hoc network method based on LoRa is characterized in that the method is applied to an intermediate node, and a second timer realized by software or hardware is contained in the intermediate node, and the method comprises the following steps:
receiving routing request grouping information sent by a source node;
and judging whether the node is a destination node according to the destination address in the routing request packet information, and determining whether to discard the routing request packet information according to the judgment result.
4. The method of claim 3, wherein determining whether the node is a destination node according to a destination address in the route request packet information, and determining whether to discard the route request packet information according to a determination result comprises:
if the node is the destination node, discarding the routing request packet information, generating and sending routing reply packet information to the upper-level node, and starting the second timer by the destination node;
if the node is not the destination node, comparing the sequence number of the routing request packet information with the sequence number from the same source node;
and if the serial number of the routing request packet information is larger than the serial number from the same source node, adding 1 to the hop count field in the routing request packet information and forwarding the routing request packet information.
5. The LoRa-based half-duplex multi-frequency ad hoc network method of claim 3, further comprising:
receiving route reply packet information;
acquiring a route reply packet according to the route reply packet information, and judging whether the route reply packet is a preset packet or not;
if the route reply packet is a preset packet, generating and feeding back a switching request packet message;
judging whether the node receiving the route reply packet information is the source node or not according to the route reply packet information;
and if the node receiving the route reply packet information is the source node, discarding the route reply packet information and switching to a service channel corresponding to the source node identity identification number.
6. A LoRa-based half-duplex multi-frequency ad hoc network method is applied to routing and comprises the following steps: in the establishing process, all nodes are switched to the service channel corresponding to the source node identification number.
7. The LoRa-based half-duplex multi-frequency ad hoc network method of claim 6, further comprising:
if some node does not receive the switching request grouping information in the data sending process, the service data is retransmitted;
and if the node still receives the switching request packet information after receiving and forwarding the last packet to the next node in the data sending process, confirming that the transmission of the round of service data is finished and switching to a channel 0 for channel interception.
8. The utility model provides a based on loRa half-duplex multifrequency is from network deployment device which characterized in that is applied to the source node, includes:
the judging module is used for judging whether data need to be sent;
the cache module is used for caching the destination address, the service type and the data of the node data if the data needs to be sent; wherein the node data is data to be transmitted;
the generating module is used for generating a corresponding routing request packet and packaging the routing request packet and data to form routing request packet information; wherein, each field in the routing request grouping information is consistent with a routing protocol;
a sending module, configured to send the routing request packet information to an intermediate node;
and the control module is used for controlling the starting of the first timer.
9. The utility model provides a based on loRa half-duplex multifrequency is from network deployment device which characterized in that includes:
a memory for storing a computer program;
a processor for implementing the method of any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202111397971.0A 2021-11-24 2021-11-24 LoRa-based half-duplex multi-frequency ad hoc network method and device Active CN113825200B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111397971.0A CN113825200B (en) 2021-11-24 2021-11-24 LoRa-based half-duplex multi-frequency ad hoc network method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111397971.0A CN113825200B (en) 2021-11-24 2021-11-24 LoRa-based half-duplex multi-frequency ad hoc network method and device

Publications (2)

Publication Number Publication Date
CN113825200A true CN113825200A (en) 2021-12-21
CN113825200B CN113825200B (en) 2022-03-11

Family

ID=78919738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111397971.0A Active CN113825200B (en) 2021-11-24 2021-11-24 LoRa-based half-duplex multi-frequency ad hoc network method and device

Country Status (1)

Country Link
CN (1) CN113825200B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116634589A (en) * 2023-07-25 2023-08-22 杭州微联智控科技有限公司 Method for receiving and transmitting reliable messages of half-duplex LoRa network

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040203820A1 (en) * 2002-04-29 2004-10-14 Harris Corporation Allocating channels in a mobile ad hoc network
US20060067283A1 (en) * 2004-09-28 2006-03-30 Jungmin So Method and apparatus for channel assignment within ad-hoc communication system
CN101674634A (en) * 2009-10-14 2010-03-17 南京邮电大学 Multichannel based reactive routing method in cognitive radio system
CN102932866A (en) * 2012-07-06 2013-02-13 北京邮电大学 Opportunistic routing mechanism applicable to multi-radio-frequency multi-channel Ad hoc network
US20180183832A1 (en) * 2016-12-22 2018-06-28 Kung-Wei Chang Security routing system for use in iot apparatus
CN113766598A (en) * 2020-06-03 2021-12-07 株洲信通智能科技有限公司 Wireless communication relay method for mine

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040203820A1 (en) * 2002-04-29 2004-10-14 Harris Corporation Allocating channels in a mobile ad hoc network
US20060067283A1 (en) * 2004-09-28 2006-03-30 Jungmin So Method and apparatus for channel assignment within ad-hoc communication system
CN101674634A (en) * 2009-10-14 2010-03-17 南京邮电大学 Multichannel based reactive routing method in cognitive radio system
CN102932866A (en) * 2012-07-06 2013-02-13 北京邮电大学 Opportunistic routing mechanism applicable to multi-radio-frequency multi-channel Ad hoc network
US20180183832A1 (en) * 2016-12-22 2018-06-28 Kung-Wei Chang Security routing system for use in iot apparatus
CN113766598A (en) * 2020-06-03 2021-12-07 株洲信通智能科技有限公司 Wireless communication relay method for mine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HSIANG-YU HUANG等: "《A Lora-Based Optimal Path Routing Algorithm for Smart Grid》", 《IEEE 2018 TWELFTH INTERNATIONAL CONFERENCE ON SENSING TECHNOLOGY(ICST)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116634589A (en) * 2023-07-25 2023-08-22 杭州微联智控科技有限公司 Method for receiving and transmitting reliable messages of half-duplex LoRa network
CN116634589B (en) * 2023-07-25 2023-10-20 杭州微联智控科技有限公司 Method for receiving and transmitting reliable messages of half-duplex LoRa network

Also Published As

Publication number Publication date
CN113825200B (en) 2022-03-11

Similar Documents

Publication Publication Date Title
US20230262668A1 (en) Fast wireless local area network communication method and apparatus using multiple transfer rate partitioning and cooperative transmission
TWI387256B (en) Method and apparatus for improving transmission time interval bundling
JP6646738B2 (en) Data transmission method, terminal and RAN device
CN108307547A (en) A kind of method and device of determining discontinuous reception configuration information
CN103260229B (en) The method of data transmission is carried out based on the MAC protocol for wireless sensor networks predicted and feed back
CN106576279A (en) Multi-communication-mode transmission method and apparatus
JP2016514400A (en) Data transmission and reception method and device
CN113825200B (en) LoRa-based half-duplex multi-frequency ad hoc network method and device
CN106549737A (en) A kind of data transmission method and device
KR20220118528A (en) Multi-link communication method, apparatus and system
CN104378315A (en) Method and device for CAPWAP tunnel data package transmission
Papadopoulos et al. Enhancing ContikiMAC for bursty traffic in mobile sensor networks
Misic et al. Avoiding the bottlenecks in the MAC layer in 802.15. 4 low rate WPAN
CN105208671B (en) The implementation method of high channel utilization rate H-MAC agreements for wireless sensor network
WO2016125775A1 (en) Control device, communication device, control method and program
CN110661550B (en) Method, device, storage medium and electronic equipment for forwarding message in HPLC communication link
CN107371118B (en) Communication method and device
KR101238577B1 (en) Method and apparatus of selecting backoff counter in wireless mesh network having plural relay nodes and computer program product thereof
CN106576375B (en) Data transmission method and terminal
CN108737119B (en) Data transmission method, device and system
CN108476428B (en) Method and network node for handling signals transmitted from a wireless device
WO2008012789A1 (en) Method for reduced latency wireless communication having reduced latency and increased range and handoff performance between different transmitting stations
KR101737788B1 (en) System and method for packet transmission
Chou et al. A priority contention window mechanism for ad hoc network
CN107509247A (en) The multiple access method and system of spatial data transmission

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