Disclosure of Invention
The embodiment of the application provides a network access method of a terminal, a communication method of the terminal and a base station and related equipment, which at least solve the problem that LoRaWAN in the prior art is difficult to consider low power consumption and real-time performance of the terminal.
According to an aspect of the present application, there is also provided a network access method of a terminal, the method being implemented based on the terminal, the method comprising:
after the network access request information is reported to the base station, a preset monitoring time window is opened, and whether the base station issues a first preamble or not is monitored, wherein the first preamble is a wireless signal transmitted before the base station transmits network access response information responding to the network access request information;
And if the first lead code is monitored, opening a data receiving window to receive the network access response information transmitted by the base station, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
In some of these embodiments, when the data receiving window is opened to receive the network access response information transmitted by the base station (20), the method further includes:
If the first preamble is not monitored in the monitoring time window or the network access response information is not received in the data receiving window, based on a preset monitoring time interval, the monitoring time window is opened periodically to monitor whether the base station transmits the first preamble.
In some of these embodiments, before periodically opening the listening time window to monitor whether the base station has issued the first preamble, the method further includes:
periodically opening the monitoring time window to monitor whether the base station transmits a second preamble, wherein the second preamble is a wireless signal transmitted before the base station transmits uplink channel test information responding to the network access request information;
If the second preamble is monitored, the data receiving window is opened to receive the uplink channel test information, and downlink channel test information responding to the uplink channel test information is reported to the base station, so that the base station transmits the network access response information after receiving the downlink channel test information.
In some of these embodiments, further comprising:
Reporting the network access request information to a relay gateway, forwarding the network access request information to the base station by the relay gateway, opening the monitoring time window, and monitoring whether the relay gateway issues a third preamble, wherein the relay gateway is further used for receiving network access response information which is issued by the base station and responds to the network access request information, and the third preamble is a wireless signal which is transmitted by the relay gateway before forwarding the network access response information to the terminal;
and if the third preamble is monitored, opening the data receiving window to receive the network access response information forwarded by the relay gateway.
In some embodiments, the relay gateway is internally provided with a routing table, wherein the routing table is generated according to the triplet information of different terminals, and when the network access request information is reported to the relay gateway, the method further comprises:
And reporting the triplet information belonging to the terminal to the relay gateway so that the relay gateway forwards the network access request information to the base station based on the triplet information and the routing table.
In some embodiments, the base station stores a triplet information list, and the triplet information list stores triplet information of different terminals, and before periodically opening the monitoring time window to monitor whether the base station issues the first preamble, the method further includes:
Reporting the triplet information belonging to the terminal to the base station, so that the base station judges whether the triplet information belongs to the triplet information list or not, if yes, the first preamble is issued to the terminal, and if not, the second preamble is issued to the terminal.
In some embodiments, the step of reporting the network access request information to the base station by the terminal includes:
and based on a preset broadcasting time interval, broadcasting the network access request information to the base station periodically so as to open the monitoring time window after broadcasting is finished and monitor whether the base station issues the first preamble.
In some embodiments, the data receiving window comprises a first data receiving window and a second data receiving window, and the duration of the listening time window is smaller than the duration of the first data receiving window and the duration of the second data receiving window, and when the data receiving window is opened to receive the network access response information transmitted by the base station, the method further comprises:
and if the network access response information is received in the first data receiving window, reporting the first positive feedback information of the received network access response information to the base station, and closing the second data receiving window.
In some embodiments, when the data receiving window is opened to receive the network access response information transmitted by the base station, the method further includes:
If the network access response information is not received in the first data receiving window, opening the second data receiving window, and if the network access response information is received in the second data receiving window, reporting second positive feedback information of the network access response information to the base station;
If the network access response information is not received in the second data receiving window, based on a preset monitoring time interval, the monitoring time window is opened periodically to monitor whether the base station issues the first preamble.
In some embodiments, a transmission time length of the base station transmitting the first preamble is set to a first transmission time length, a transmission time length of the base station transmitting the second preamble is set to a second transmission time length, and a time length of the relay gateway transmitting the third preamble is set to a third transmission time length, where the first transmission time length, the second transmission time length, and the third transmission time length are all longer than a time length of the listening time interval.
According to another aspect of the present application, there is also provided a communication method between a terminal and a base station, the communication method being implemented after the terminal completes network access based on the network access method of the terminal, the method including:
after the uplink data information is reported to the base station, a preset monitoring time window is opened, and whether the base station issues a fourth preamble or not is monitored, wherein the fourth preamble is a wireless signal transmitted before the base station transmits downlink data information responding to the uplink data information;
And if the fourth preamble is monitored, opening the data receiving window to receive the downlink data information transmitted by the base station, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
In some embodiments, when the data receiving window is opened to receive the downlink data information transmitted by the base station, the method further includes:
if the fourth preamble is not monitored in the monitoring time window or the downlink data information is not received in the data receiving window, the monitoring time window is opened periodically to monitor whether the base station issues the fourth preamble or not based on a preset monitoring time interval.
In some of these embodiments, the method further comprises:
Reporting the uplink data information to a relay gateway, forwarding the uplink data information to the base station by the relay gateway, opening the monitoring time window, and monitoring whether the relay gateway issues a fifth preamble, wherein the relay gateway is further used for receiving downlink data information which is issued by the base station and responds to the uplink data information, and the fifth preamble is a wireless signal transmitted by the relay gateway before forwarding the downlink data information to the terminal;
And if the fifth preamble is monitored, opening the data receiving window to receive the downlink data information forwarded by the relay gateway.
In some embodiments, the relay gateway is internally provided with a routing table, wherein the routing table is generated according to the triplet information of different terminals, and when the uplink data information is reported to the relay gateway, the method further comprises:
Reporting the triplet information belonging to the terminal to the relay gateway, so that the relay gateway forwards the uplink data information to the base station based on the triplet information and the routing table.
In some embodiments, the step of reporting uplink data information to the base station includes:
and based on a preset broadcasting time interval, broadcasting the uplink data information to the base station periodically so as to open the monitoring time window after the broadcasting is finished and monitor whether the base station issues the fourth preamble.
In some embodiments, the data receiving window includes a first data receiving window and a second data receiving window, and the duration of the listening time window is smaller than the duration of the first data receiving window and the second data receiving window, and when the data receiving window is opened to receive the downlink data information transmitted by the base station, the method further includes:
and if the downlink data information is received in the first data receiving window, reporting third positive feedback information of the received downlink data information to the base station, and closing the second data receiving window.
In some embodiments, when the data receiving window is opened to receive the downlink data information transmitted by the base station, the method further includes:
If the downlink data information is not received in the first data receiving window, opening the second data receiving window, and receiving the downlink data information by the second data receiving window;
if the downlink data information is received in the second data receiving window, reporting fourth positive feedback information of the received downlink data information to the base station;
And if the downlink data information is not received in the second data receiving window, based on a preset monitoring time interval, periodically opening the monitoring time window to monitor whether the base station issues the fourth preamble.
In some embodiments, a transmission duration of the base station transmitting the fourth preamble is set to a fourth transmission duration, and a duration of the relay gateway transmitting the fifth preamble is set to a fifth transmission duration, where the fourth transmission duration and the fifth transmission duration are both longer than the duration of the listening interval.
According to another aspect of the present application, there is also provided a network access method of a terminal, the method being implemented based on a base station, the method comprising:
Receiving network access request information reported by a terminal;
And transmitting a first preamble to the terminal, wherein the first preamble is a wireless signal transmitted before transmitting network access response information responding to the network access request information to the terminal, so that the terminal opens a data receiving window to receive the network access response information transmitted by the base station (20) after monitoring the first preamble in an open monitoring time window, and the duration of the monitoring time window is smaller than that of the data receiving window.
In some of these embodiments, when the terminal opens a data reception window to receive the network access response information transmitted by the base station (20), the method further includes:
if the terminal does not monitor the first preamble in the monitoring time window or does not receive the network access response information in the data receiving window, based on a preset monitoring time interval, periodically opening the monitoring time window to monitor whether the base station issues the first preamble.
In some of these embodiments, before transmitting the first preamble to the terminal, the method further comprises:
Transmitting a second preamble to the terminal, wherein the second preamble is a wireless signal transmitted before uplink channel test information responding to the network access request information is transmitted to the terminal, the terminal periodically opens the monitoring time window to monitor whether the base station transmits the second preamble or not, and if the second preamble is monitored, opens the data receiving window to receive the uplink channel test information;
And receiving downlink channel test information which is reported by the terminal and responds to the uplink channel test information, and transmitting the first preamble to the terminal after receiving the downlink channel test information.
In some embodiments, the terminal reports the network access request information to a relay gateway, and when the relay gateway forwards the network access request information to the base station, the method further includes:
and receiving the network access request information forwarded by the relay gateway from the terminal, and transmitting network access response information responding to the network access request information to the relay gateway so as to transmit a third lead code to the terminal through the relay gateway, wherein the third lead code is a wireless signal transmitted by the relay gateway before forwarding the network access response information to the terminal, so that the terminal can open the data receiving window to receive the network access response information forwarded by the relay gateway after monitoring the third lead code.
In some embodiments, the base station stores a triplet information list, the triplet information list stores triplet information of different terminals, and before transmitting the second preamble to the terminals, the method further includes:
receiving the triplet information which belongs to the terminal and is reported by the terminal;
And judging whether the triplet information belongs to the triplet information list, if so, issuing the first preamble to the terminal, and if not, issuing the second preamble to the terminal.
In some embodiments, the data receiving window comprises a first data receiving window and a second data receiving window, and the duration of the listening time window is smaller than the duration of the first data receiving window and the second data receiving window, the method further comprises:
And receiving first positive feedback information reported by the terminal, wherein the first positive feedback information is feedback information of the network access response information received by the terminal in the first data receiving window.
In some of these embodiments, the method further comprises:
and receiving second positive feedback information reported by the terminal, wherein the second positive feedback information is feedback information that the terminal does not receive the network access response information in the first data receiving window and receives the network access response information in the opened second data receiving window.
In some embodiments, a transmission duration of transmitting the first preamble to the terminal is a first transmission duration, a transmission duration of transmitting the second preamble to the terminal is a second transmission duration, and a duration of transmitting the third preamble by the relay gateway is set to a third transmission duration, where the first transmission duration, the second transmission duration, and the third transmission duration are all longer than a duration of the listening time interval.
According to another aspect of the present application, there is also provided a communication method between a terminal and a base station, the communication method being implemented by the base station after the terminal completes network access based on the network access method of the terminal, the method comprising:
Receiving uplink data information reported by the terminal;
Transmitting a fourth preamble to the terminal, wherein the fourth preamble is a wireless signal transmitted before the base station transmits downlink data information in response to the uplink data information, so that the terminal opens a data receiving window to receive the downlink data information after monitoring the fourth preamble in the opened monitoring time window;
the duration of the monitoring time window is smaller than the duration of the data receiving window.
In some embodiments, when the terminal opens the data receiving window to receive the downlink data information, the method further includes:
And if the fourth preamble is not monitored in the monitoring time window or the downlink data information is not received in the data receiving window, periodically opening the monitoring time window to monitor the fourth preamble based on a preset monitoring time interval.
In some of these embodiments, the method further comprises:
Receiving the uplink data information from the terminal forwarded by a relay gateway, and transmitting downlink data information responding to the uplink data information to the relay gateway so as to transmit a fifth preamble to the terminal through the relay gateway, wherein the fifth preamble is a wireless signal transmitted by the relay gateway before forwarding the downlink data information to the terminal; and the terminal opens the data receiving window to receive the downlink data information forwarded by the relay gateway after the terminal monitors the fifth preamble in the opened monitoring time window.
In some embodiments, the data receiving window comprises a first data receiving window and a second data receiving window, and the duration of the listening time window is smaller than the duration of the first data receiving window and the second data receiving window, the method further comprises:
And receiving third positive feedback information reported by the terminal, wherein the third positive feedback information is information fed back by the terminal after receiving the downlink data information in the first data receiving window.
In some of these embodiments, the method further comprises:
and receiving fourth positive feedback information reported by the terminal, wherein the fourth positive feedback information is information fed back after the terminal does not receive the downlink data information in the first data receiving window and receives the downlink data information in the opened second data receiving window.
According to another aspect of the application, a terminal is further provided, and the terminal completes network access by adopting the network access method of the terminal.
According to another aspect of the present application, there is also provided a communication apparatus of a terminal and a base station, the communication apparatus being provided to the terminal, the communication apparatus being configured to implement the communication method of the terminal and the base station, the communication apparatus including:
the monitoring module is used for opening a preset monitoring time window after the uplink data information is reported to the base station, and monitoring whether the base station transmits a fourth preamble or not, wherein the fourth preamble is a wireless signal transmitted before the base station transmits downlink data information responding to the uplink data information;
and the window opening module is used for opening the data receiving window to receive the downlink data information transmitted by the base station if the monitoring module monitors the fourth preamble, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
According to another aspect of the present application, there is also provided a base station, which confirms that the terminal is network-connected by adopting the network-connection method of the terminal.
According to another aspect of the present application, there is also provided a communication apparatus of a terminal and a base station, the communication apparatus being provided at the base station, the communication apparatus being configured to implement the communication method of the terminal and the base station, the communication apparatus comprising:
the receiving module is used for receiving uplink data information reported by the terminal;
And the transmitting module is used for transmitting a fourth preamble to the terminal, wherein the fourth preamble is a wireless signal transmitted before the base station transmits downlink data information in response to the uplink data information, so that the terminal opens a data receiving window to receive the downlink data information after monitoring the fourth preamble in the opened monitoring time window, and the duration of the monitoring time window is smaller than that of the data receiving window.
According to another aspect of the present application, there is also provided a communication system including:
A terminal provided with a communication device of the terminal and a base station;
and the base station is provided with a communication device between the terminal and the base station, and the terminal is in communication connection with the base station.
In some of these embodiments, further comprising:
and the relay gateway is connected between the terminal and the base station and used for forwarding communication information between the terminal and the base station.
In some of these embodiments, the relay gateway comprises:
A solar power supply module;
The processor is connected with the solar power supply module;
The data transceivers are respectively connected with the processor, and the data transceivers are also connected with the solar power supply module.
According to another aspect of the present application, there is also provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method steps of:
after the network access request information is reported to the base station, a preset monitoring time window is opened, and whether the base station issues a first preamble or not is monitored, wherein the first preamble is a wireless signal transmitted before the base station transmits network access response information responding to the network access request information;
And if the first lead code is monitored, opening a data receiving window to receive the network access response information transmitted by the base station, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
According to another aspect of the present application, there is also provided a computer readable storage medium storing a computer program which, when executed by a processor, performs the method steps of:
after the network access request information is reported to the base station, a preset monitoring time window is opened, and whether the base station issues a first preamble or not is monitored, wherein the first preamble is a wireless signal transmitted before the base station transmits network access response information responding to the network access request information;
And if the first lead code is monitored, opening a data receiving window to receive the network access response information transmitted by the base station, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
According to another aspect of the present application there is also provided a computer program product comprising a computer program which, when executed by a processor, carries out the method steps of:
after the network access request information is reported to the base station, a preset monitoring time window is opened, and whether the base station issues a first preamble or not is monitored, wherein the first preamble is a wireless signal transmitted before the base station transmits network access response information responding to the network access request information;
And if the first lead code is monitored, opening a data receiving window to receive the network access response information transmitted by the base station, wherein the duration of the monitoring time window is smaller than that of the data receiving window.
In the embodiment of the application, after the terminal reports the relevant information to the base station, the monitoring time window is immediately opened to monitor the preamble transmitted by the base station before the base station transmits the effective data such as the network access response information, if the preamble is monitored to open the data receiving window to receive the effective data, the downlink data can be received in real time, the real-time performance is high, if the preamble is not monitored, the data receiving window does not need to be opened to receive the data, and more power consumption is not caused by continuous window opening.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is illustrated in the flowcharts, in some cases the steps illustrated or described may be performed in an order other than that illustrated herein.
Generally, the LoRa network system is composed of a terminal 10, a base station 20 and a server. The terminal 10 has a LoRa network connection capability and accesses the LoRa network. Depending on the application scenario in which the LoRa network is deployed, the terminal 10 may include different electronic devices, for example, when the LoRa network is applied to the agricultural field, the terminal 10 may include a water valve or a fan, etc. The base station 20, also called gateway GateWay or concentrator in the LoRa network, has wireless connection convergence functions, including providing access to the LoRa network for the terminal 10, forwarding data from the server or terminal 10, and enabling data interaction between the terminal 10 and the server. The server may comprise a server or a cluster of servers for performing task processing based on data acquired from the base station 20 or the terminal 10 and for controlling the operation mode and the operation state of the base station 20 or the terminal 10. Most of terminal 10 equipment in the agricultural field is arranged in mountain areas with remote environment or inconvenient power supply, so that low power consumption of the terminal 10 equipment and downlink control equipment is required, and meanwhile, the requirements that uplink reporting and downlink control are timely and too large time delay cannot be achieved are met. However, the application related to the downlink control of the lorewan network currently applied to the agricultural scenario cannot form a good protocol mechanism to achieve both low power consumption and real-time performance due to the power consumption problem of the terminal 10.
In view of the above problems, a first embodiment of the present invention provides a network access method of a terminal 10, which is implemented based on the terminal 10, as shown in fig. 1, and includes the steps of:
Step S111, after reporting the network access request information to the base station 20, opening a preset monitoring time window, and monitoring whether the base station 20 issues a first preamble, wherein the first preamble is a wireless signal transmitted before the base station 20 transmits the network access response information in response to the network access request information. The preamble is a regular radio signal that informs the radio receiver (e.g., terminal 10 in the embodiment of the present invention) that the following radio signal contains valid information (e.g., network access response information). Next, in order to make the network access request information received by the base station 20 legal, the terminal 10 also needs to transmit a preamble before sending the network access request information, and the base station 20 first analyzes the preamble reported by the terminal 10, and considers that the network access request information of the terminal 10 is legal if the preamble is correct. The preamble of the terminal 10 and the first preamble issued by the base station 20 are constrained in the corresponding communication protocol file in advance, the preamble reported by the terminal 10 may be identical to or different from the preamble issued by the base station 20, and in general, the sensitivity of the terminal 10 to wake up is related to the number of bits of the preamble (where wake up refers to that the terminal 10 starts to receive data after listening to the agreed preamble), for example, the number of bits is more, the higher the accuracy of the terminal 10 to wake up is, the more difficult the wake up is, and if the number of bits is less, the easier the wake up is, but the easier the wake up is, so long as the base station 20 is ensured to recognize that the received information is legal according to the preamble reported by the terminal 10 when the preamble is actually designed, and the preamble issued by the base station 20 is ensured that the terminal 10 can be wake up and cannot be awakened by mistake.
Step S112, if the first preamble is monitored, opening a data receiving window to receive the network access response information transmitted by the base station 20, wherein the duration of the monitoring time window is smaller than that of the data receiving window. Therefore, the terminal 10 according to the embodiment of the present invention does not need to continuously open the data receiving window, and only needs to first monitor the wireless signal (the first preamble) transmitted by the base station 20 with a monitoring time window that is longer than the data receiving window, and only opens the data receiving window to receive data when the wireless signal is monitored, so that the real-time performance is high. If no wireless signal is received, the data receiving window does not need to be opened, and in order to obtain lower power consumption, the embodiment of the invention sets the window opening time length of the monitoring time window of the terminal 10 to be smaller than the time length of the data receiving window, so that the extra power consumption caused by continuous window opening is avoided. In the embodiment of the invention, because the maximum data packet window of the spreading factor SF12 in the LoRa network is about 500ms and error redundancy is added, the embodiment of the invention designs the duration of the data receiving window to be 1S, the duration of the monitoring time window is set to be 2ms (unit millisecond), and only the power consumption of opening the monitoring time window of 2ms is consumed under the condition of not receiving data, thereby avoiding more power consumption for continuously windowing.
It can be seen that, after reporting the relevant information to the base station 20, the terminal 10 in the embodiment of the present invention immediately opens the preamble transmitted by the monitoring base station 20 before transmitting the effective data, such as the network access response information, and if the preamble is monitored, opens the data receiving window to receive the effective data, thereby being capable of receiving the downlink data in real time, and having high real-time performance. If the window is not opened, the data receiving window is not required to be opened to receive the data, and more power consumption is not caused by continuous window opening. Compared with the prior communication mode, the embodiment of the invention can simultaneously consider the use requirements of low power consumption and real-time performance of the terminal 10. And is particularly suitable for the terminal 10 equipment which is arranged in mountain areas with remote environments or inconvenient power supply in the agricultural field. Compared with the ClassA mode in the existing LoRaWAN network communication, the real-time performance is higher. The terminal 10 in the class a mode only opens two short downlink receiving windows after the uplink data packet is sent, and the delay is large, so that the network server cannot wake up the terminal 10 in real time. However, in the embodiment of the present invention, the wireless signal of the base station 20 may be received through the set listening time window, and the wireless signal receiving terminal 10 is awakened to receive data, thereby ensuring the real-time performance of the downlink control. In contrast to the ClassB mode, the terminal 10 operating in the ClassB mode uses a periodically opened reception window to receive downlink data transmitted from the base station 20, but the data reception window in the ClassB mode is opened regardless of whether or not data is received. However, in the embodiment of the present invention, the terminal 10 opens the data receiving window only after receiving the wireless signal, so that the real-time performance is ensured and the power consumption is lower compared with the class b mode. The design goals of the base station 20 meeting the data acquisition and control low latency requirements and the terminal 10 meeting the control low latency and low power consumption requirements are achieved.
In step S112, when the data receiving window is opened to receive the network access response information transmitted by the base station 20, the method provided by the embodiment of the present invention further includes, if the first preamble is not monitored in the monitoring time window, or the network access response information is not received in the data receiving window, periodically opening, based on a preset monitoring time interval, whether the monitoring time window monitors whether the base station 20 issues the first preamble. That is, when the terminal 10 in the embodiment of the present invention monitors no wireless signal for the first time, the terminal 10 opens the monitoring time window again to monitor after a preset monitoring time interval until the terminal 10 is awakened and automatically executes a preset broadcast or pass-through task. Therefore, the data receiving window is not opened before the terminal 10 is awakened, and the use requirements of low power consumption and real-time performance are met. The preset listening time interval may be set to one second, so that the terminal 10 can listen to the preamble every second, where the listening time period is 2ms (i.e. the listening time window is 2 ms) until the terminal 10 is awakened and the end side autonomously and transparently transmits the task execution instruction, immediately replies acknowledgement ACK after the instruction is issued, and based on the preset listening time interval again, periodically opens the listening time window to whether the base station 20 issues the preamble.
The base station 20 also needs to authenticate the reliability of the uplink and downlink channels with the terminal 10 before confirming whether to access the network based on the access request information uploaded by the terminal 10. In this regard, before the listening base station 20 periodically opens the listening time window to determine whether the first preamble is issued, as shown in fig. 2, the method provided by the embodiment of the present invention further includes the following steps:
Step S121, periodically opening a listening time window to monitor whether the base station 20 issues a second preamble, wherein the second preamble is a wireless signal transmitted before the base station 20 transmits uplink channel test information in response to the network access request information. Wherein the second preamble may be the same preamble as the first preamble, and "first" and "second" herein are merely for convenience of description and representation that the valid data transmitted by the base station 20 after the preamble is different.
Step S122, if the second preamble is monitored, the data receiving window is opened to receive the uplink channel test information, and the downlink channel test information responding to the uplink channel test information is reported to the base station 20, so that the base station 20 transmits the network access response information after receiving the downlink channel test information. Similarly, in order for the base station 20 to receive the downlink channel test information reported by the terminal 10 and to be legal, the terminal 10 needs to carry a section of preamble when sending the downlink channel test information, and the base station 20 first analyzes the preamble reported by the terminal 10, and if the preamble is correct, the downlink channel test information reported by the terminal 10 is considered to be legal.
In the network Access process of the terminal 10 in the embodiment of the present invention, the terminal 10 reports the network Access request information (Access Confirm), and after receiving the network Access request information, the base station 20 (i.e. the gateway GateWay) issues uplink channel test information to the terminal 10 (Up Channel Confirm). The terminal 10 monitors the second preamble, opens the data receiving window to receive the uplink channel test information issued by the base station 20, and immediately replies to the downlink channel test information (Down Channel Confirm), if the information content of the downlink channel test information is set to be "RSSIup +66666666", RSSIup is the signal size of the uplink channel test information, and waits for the base station 20 to reply to the acknowledgement command. The base station 20 receives the downlink channel test information reported by the terminal 10, and confirms that the uplink and downlink channels are reliable, and then the network access response information issued to the terminal 10 is network access success confirmation information (NET ACCESS Confirm), for example, the information content of the network access success confirmation information can be set to be 66666666 (the content can be set arbitrarily, and the embodiment of the invention is not limited only here), and if the uplink and downlink channels are not reliable, the network access response information issued to the terminal 10 is network access failure information 77778888. In the embodiment of the present invention, if the signal size of the downlink channel test information reaches the base station 20 and is smaller than the preset signal size, the base station 20 may consider that the uplink and downlink channels with the terminal 10 are unreliable, and the network access response information to be issued to the terminal 10 is the network access failure information, that is, the downlink channel test information received by the base station 20 is a weak signal, for example, the signal size RSSI value is smaller than-135 dBm (dBm unit is milliwatt decibel) and is considered to be unreliable. In addition, the base station 20 is not reliable and does not allow the terminal 10 to access the network as long as it does not receive the downlink channel test information.
In the smart agriculture field, since the terminal 10 is mostly located in a mountain area with remote environment or inconvenient power supply, and is usually far away from the base station 20, in order to break through the coverage distance of the LoRa network in a field scene such as a plain scene, and the mountain scene needs to reach a low-lying place through the LoRa mesh (mesh is one of key technologies for solving the communication problem of the last kilometer), the network access method provided in the embodiment of the invention further includes that the terminal 10 reports the network access request information to the relay gateway 30, the relay gateway 30 forwards the network access request information to the base station 20, and opens a monitoring time window to monitor whether the relay gateway 30 issues a third preamble, wherein the relay gateway 30 is further configured to receive the network access response information issued by the base station 20 and responding to the network access request information, and the third preamble is a wireless signal transmitted by the relay gateway 30 before forwarding the network access response information to the terminal 10. If the terminal 10 monitors the third preamble, the data receiving window is opened to receive the network access response information forwarded by the relay gateway 30. The third preamble may be the same preamble as the first preamble, the second preamble, etc. According to the embodiment of the invention, the relay gateway 30 forwards the network access communication information between the terminal 10 and the base station 20, so that the base station 20 can be ensured to receive the network access request information of the terminal 10 which cannot be received normally or is difficult to receive, and thus a field scene such as a plain scene can break through the coverage distance of a LoRa network, a mountain scene can reach the terminal 10 in a low-lying place, the low power consumption and the real-time performance of the terminal 10 are both considered, and the communication coverage is wider.
In the embodiment of the present invention, a routing table is set in the trunking gateway 30, and the routing table is generated according to the triplet information of different terminals 10, where the triplet information includes the information such as productKey, deviceName and DEVICESECRET of the terminals 10. When the terminal 10 reports the network access request information to the relay gateway 30, the network access method provided by the embodiment of the invention further includes that the terminal 10 reports the own triplet information to the relay gateway 30, so that the relay gateway 30 forwards the network access request information to the base station 20 based on the triplet information and the routing table. Specifically, the following illustrates the routing algorithm of the relay gateway 30 in the embodiment of the present invention, for example, after the first terminal 10, the second terminal 10, and the third terminal 10 are disposed, the first terminal 10, the second terminal 10, and the third terminal 10 begin to report access request information to the base station 20, respectively, where the access request information of the first terminal 10, the second terminal 10, and the third terminal 10 may be received by the base station 20, when the base station 20 receives the access request information of one terminal 10 (such as the third terminal 10), the signal RSSI value of the third terminal 10 is greater than-110 dBm (the value may be adjusted according to different usage scenarios), the triplet information of the third terminal 10 is stored in the server local to the base station 20, the signal RSSI value is less than-110 dBm (the value may be adjusted according to different usage scenarios), the access request information of the weak signal terminal 10 is received by the relay gateway 30, and when the base station 20 receives the access request information of the one terminal 10 (such as the third terminal 10), the signal RSSI value of the triplet information is greater than-110 dBm (the value may be adjusted according to different usage scenarios), the signal RSSI value of the terminal 10 is less than-110 dBm (the value may be adjusted according to different usage scenarios), the terminal 10 is the weak signal terminal 10, and the signal 10 is received by the base station 10, and the signal 10 is received by the relay gateway 10, and the signal 10 is transmitted to the second signal 10 by the second terminal 10. Meanwhile, the relay gateway 30 also stores the triplet information sent by the first terminal 10 and the second terminal 10 and forms a routing table, so that the relay gateway 30 forwards subsequent data packets of the first terminal 10 and the second terminal 10, and the base station 20 receives the data packets of the third terminal 10 and the first terminal 10 and the second terminal 10 forwarded by the relay gateway 30 and forms a stable data forwarding mechanism.
In the embodiment of the present invention, the base station 20 stores a triplet information list, and the triplet information list stores triplet information of different terminals 10. Before the terminal 10 periodically opens the listening time window to monitor whether the base station 20 issues the first preamble, the network access method further includes reporting the triplet information belonging to the terminal 10 to the base station 20, so that the base station 20 determines whether the triplet information belongs to the triplet information list, if yes, issues the first preamble to the terminal 10, and realizes local network access. If not, a second preamble is issued to the terminal 10. That is, the terminal 10 in the embodiment of the present invention can access the network based on ABP, which is referred to as Activation by Personalization in english (i.e., ABP access is a personalized activation access mode). ABP network access is to pre-record triplet information of the terminal 10 in a server of the base station 20 in advance, after the base station 20 receives network access request information of the terminal 10 and demodulates the triplet information, the triplet information is compared with the locally stored triplet information, if the triplet information belongs to the pre-recorded triplet information, the base station 20 considers that the terminal 10 is legal, and can immediately reply network access confirmation information to the terminal 10, so that the terminal 10 is allowed to access the network. If the received triplet information of the current terminal 10 does not belong to the triplet information in the pre-record, the terminal 10 is considered illegal, and the data information of the subsequent terminal 10 will not be networked and demodulated.
In the embodiment of the present invention, in order to keep the terminal 10 alive, the terminal 10 can report data without the base station 20 performing ACK acknowledgement (ACK is an acknowledgement character, english is called ACKnowledge Character), and the step of reporting the network access request information to the base station 20 by the terminal 10 in step S111 includes:
Based on a preset broadcasting time interval, broadcasting network access request information to the base station 20 periodically so as to open a monitoring time window after broadcasting is finished, and monitoring whether the base station 20 issues the first preamble. The preset broadcasting time interval is set to, for example, 1 hour, 2 hours, etc., so that the terminal 10 can broadcast the related data information to the base station 20 after one broadcasting time interval.
In the embodiment of the invention, the data receiving window comprises a first data receiving window (RX 1) and a second data receiving window (RX 2), and the duration of the monitoring time window is smaller than that of the first data receiving window (RX 1) and the second data receiving window (RX 2), for example, the duration of the monitoring time window is set to be 2ms, and the duration of the first data receiving window (RX 1) and the duration of the second data receiving window (RX 2) are set to be 1s meeting the data receiving requirement. When the terminal 10 opens the data receiving window to receive the network access response information transmitted by the base station 20, the network access method provided in the embodiment of the present invention further includes reporting the first positive feedback information of the received network access response information to the base station 20 and closing the second data receiving window (RX 2) if the network access response information is received in the first data receiving window (RX 1). Therefore, the terminal 10 can not only receive data in real time, but also close redundant data receiving windows in time after receiving the data, so that the terminal 10 has lower power consumption under the condition of completing the same task instruction.
Next, when the terminal 10 opens the data receiving window to receive the network access response information transmitted by the base station 20, if the network access response information is not received in the first data receiving window (RX 1), the second data receiving window (RX 2) is opened, and if the network access response information is received in the second data receiving window (RX 2), the second positive feedback information of the network access response information is reported to the base station 20, and therefore, when the first data receiving window (RX 1) does not receive the information, the second data receiving window (RX 2) is opened to receive the downlink data of the base station 20. If the network access response information is not received in the second data receiving window (RX 2), the listening time window is opened periodically based on a preset listening time interval to determine whether the first preamble is issued by the listening base station 20. Until the terminal 10 monitors the preamble of the base station 20 and further receives the data packet issued by the base station 20 in time.
In the embodiment of the present invention, in order to ensure that the base station 20 as the wake-up party can wake up the terminal 10 of the wake-up party normally every time, the duration of the base station 20 transmitting the preamble should be longer or slightly longer than the time interval for the wake-up party to wake up. If the transmission duration of the first preamble transmitted by the base station 20 is set to be the first transmission duration, the transmission duration of the second preamble transmitted by the base station 20 is set to be the second transmission duration, the duration of the third preamble transmitted by the relay gateway 30 is set to be the third transmission duration, and the first transmission duration, the second transmission duration and the third transmission duration are all longer than the duration of the listening interval. This ensures that the terminal 10 will wake up normally each time.
The above description describes how the terminal 10 can achieve network access under the condition of considering both low power consumption and real-time performance, in order to ensure that the terminal 10 can also consider the use requirements of low power consumption and real-time performance in the process of communicating with the base station 20, the second embodiment of the present invention further provides a communication method between the terminal 10 and the base station 20, where the communication method is implemented after the terminal 10 completes network access based on the network access method of the terminal 10 provided by the first embodiment of the present invention, as shown in fig. 3, the communication method includes the following steps:
Step S211, after reporting the uplink data information to the base station 20, opening a preset monitoring time window, and monitoring whether the base station 20 issues a fourth preamble, wherein the fourth preamble is a wireless signal transmitted before the base station 20 transmits the downlink data information in response to the uplink data information. In order for the uplink data information received by the base station 20 to be legal, the terminal 10 also needs to transmit a preamble before transmitting the uplink data information, and the base station 20 first analyzes the preamble reported by the terminal 10, and considers that the uplink data information of the terminal 10 is legal if the preamble is correct. Both the preamble of the terminal 10 and the fourth preamble issued by the base station 20 may be constrained in advance in the corresponding communication protocol file, where the fourth preamble is the same as the first preamble, the second preamble, etc. in the first embodiment of the present invention. Secondly, the preamble reported by the terminal 10 may be the same as or different from the preamble issued by the base station 20, and when the preamble is actually designed, the base station 20 is only required to ensure that the received uplink data information is legal according to the preamble reported by the terminal 10, and the preamble issued by the base station 20 can ensure that the terminal 10 can be awakened and cannot be awakened by mistake.
Step S212, if the fourth preamble is monitored, a data receiving window is opened to receive the downlink data information transmitted by the base station 20, wherein the duration of the monitoring time window is smaller than that of the data receiving window. Therefore, the terminal 10 according to the embodiment of the present invention does not need to continuously open the data receiving window, only needs to first monitor the wireless signal (the fourth preamble) transmitted by the base station 20 with a monitoring time window that is longer than the data receiving window, and opens the data receiving window to receive the downlink data information transmitted by the base station 20 when the wireless signal is monitored, so that the real-time downlink control is high. If no wireless signal is received, the data receiving window does not need to be opened, and in order to obtain lower power consumption, the embodiment of the invention sets the window opening time length of the monitoring time window of the terminal 10 to be smaller than the time length of the data receiving window, so that the extra power consumption caused by continuous window opening is avoided. In the embodiment of the invention, the maximum data packet window of the spreading factor SF12 in the LoRa network is about 500ms, and error redundancy is added, so that the embodiment of the invention can set the duration of the data receiving window to be 1S, and the duration of the monitoring time window to be 2ms, thereby only consuming the power consumption of opening the monitoring time window of 2ms under the condition of not receiving data, and avoiding more power consumption for continuously opening the window.
Therefore, after reporting the relevant information to the base station 20, the terminal 10 in the embodiment of the present invention immediately opens the preamble transmitted by the monitoring base station 20 before transmitting the effective data, such as the network access response information, and if the preamble is monitored, opens the data receiving window to receive the effective data, thereby being capable of receiving the downlink data information transmitted by the base station 20 in real time, and having high real-time performance. If the window is not opened, the data receiving window is not required to be opened to receive the data, and more power consumption is not caused by continuous window opening. Compared with the existing communication mode, the communication method provided by the embodiment of the invention can simultaneously satisfy the communication requirements of low power consumption and real-time performance of the terminal 10, and is particularly suitable for terminal 10 equipment arranged in mountain areas with remote environments or inconvenient power supply in the agricultural field. Compared with the ClassA mode in the existing LoRaWAN network communication, the real-time performance is higher, the terminal 10 in the ClassA mode only opens two short downlink receiving windows after the uplink data packet is sent, the time delay is larger, and the network server cannot wake up the terminal 10 in real time. However, in the embodiment of the present invention, the wireless signal of the base station 20 may be received through the set listening time window, and the wireless signal receiving terminal 10 is awakened to receive data, thereby ensuring the real-time performance of the downlink control. Compared with the ClassB mode, the terminal 10 working in the ClassB mode uses a receiving window which is opened periodically to receive downlink data issued by the base station 20, but the data receiving window in the ClassB mode is opened no matter whether the data is received or not, but the terminal 10 in the embodiment of the invention opens the data receiving window only after receiving the obtained wireless signal, so that compared with the ClassB mode, the real-time performance is ensured, and the power consumption is lower. Therefore, the communication method provided by the embodiment of the invention can enable the base station 20 to meet the requirements of data acquisition and low time delay control and the terminal 10 to meet the design targets of low time delay control and low power consumption.
In step S212, when the data receiving window is opened to receive the downlink data information transmitted by the base station 20, the communication method provided by the embodiment of the present invention further includes, if the fourth preamble is not monitored in the listening time window or the downlink data information is not received in the data receiving window, periodically opening the listening time window based on a preset listening time interval, whether the listening base station 20 issues the fourth preamble. That is, when the terminal 10 in the embodiment of the present invention monitors no wireless signal for the first time, the terminal 10 opens the monitoring time window again to monitor after a preset monitoring time interval until the terminal 10 is awakened and automatically executes a preset broadcast or pass-through task. Therefore, the data receiving window is not opened before the terminal 10 is awakened, and the use requirements of low power consumption and real-time performance are met. The preset listening time interval may be set to one second, so that the terminal 10 may listen to the preamble every second, and the listening duration of each time may be set to 2ms (i.e., the listening time window is 2 ms), until the terminal 10 is awakened by itself and the end side autonomously and transparently transmits the task execution instruction, immediately replies acknowledgement ACK after the instruction is issued, and based on the preset listening time interval again, periodically opens the listening time window to whether the base station 20 issues the preamble.
In the smart agriculture field, since the terminal 10 is mostly located in a remote environment or a mountain area where power supply is inconvenient, and is usually far away from the base station 20, in order to break through the coverage distance of the LoRa network in a field scene such as a plain scene, and enable the communication between the terminal 10 and the base station 20 to reach a low-lying place in the mountain area scene, the communication method in the embodiment of the present invention further includes that the terminal 10 reports uplink data information to the relay gateway 30, the relay gateway 30 forwards the uplink data information to the base station 20, and opens a listening time window, and monitors whether the relay gateway 30 issues a fifth preamble, where the relay gateway 30 is further configured to receive downlink data information in response to the uplink data information sent by the base station 20, and the fifth preamble is a wireless signal transmitted by the relay gateway 30 before forwarding the downlink data information to the terminal 10. If the terminal 10 monitors the fifth preamble, the data receiving window is opened to receive the downlink data information forwarded by the relay gateway 30.
Therefore, the embodiment of the invention forwards the uplink and downlink communication information between the terminal 10 and the base station 20 through the relay gateway 30, so that the base station 20 can be ensured to receive the uplink data information of the terminal 10 which is difficult to receive normally, and the communication distance between the terminal 10 and the base station 20 in a field scene such as a plain scene can break through the LoRa network coverage distance, and the mountain scene can touch the terminal 10 reaching the low-lying place, thereby achieving the low power consumption and real-time performance of the terminal 10 and having wider communication coverage.
In the embodiment of the present invention, a routing table is set in the trunking gateway 30, and the routing table is generated according to the triplet information of different terminals 10, where the triplet information includes the information such as productKey, deviceName and DEVICESECRET of the terminals 10. When the terminal 10 reports the uplink data information to the relay gateway 30, the communication method in the embodiment of the present invention further includes that the terminal 10 reports the triplet information belonging to itself to the relay gateway 30, so that the relay gateway 30 forwards the uplink data information of the terminal 10 to the base station 20 based on the triplet information and the routing table. Normal communication between the terminal 10 and the base station 20 in a field scene such as a plain scene and a mountain topography low-lying place scene is realized.
In the embodiment of the present invention, in order to keep-alive the terminal 10, the terminal 10 can report data without the base station 20 performing ACK acknowledgement (ACK is an acknowledgement character, english is called ACKnowledge Character), and in step S211, the step of reporting uplink data information to the base station 20 by the terminal 10 includes broadcasting the uplink data information to the base station 20 periodically based on a preset broadcasting time interval, so as to open a listening time window after broadcasting is finished, and monitor whether the fourth preamble is issued by the base station 20. The preset broadcasting time interval is set to, for example, 1 hour, 2 hours, etc., so that the terminal 10 can broadcast the relevant data information to the base station 20 after one broadcasting time interval, thereby achieving the keep-alive design goal of the terminal 10.
In the embodiment of the invention, the data receiving window comprises a first data receiving window (RX 1) and a second data receiving window (RX 2), and the duration of the monitoring time window is smaller than that of the first data receiving window (RX 1) and the second data receiving window (RX 2), for example, the duration of the monitoring time window is set to be 2ms, and the duration of the first data receiving window (RX 1) and the duration of the second data receiving window (RX 2) are set to be 1s meeting the data receiving requirement. When the terminal 10 opens the data receiving window to receive the downlink data information transmitted by the base station 20, the communication method further includes reporting third positive feedback information of the downlink data information to the base station 20 and closing the second data receiving window (RX 2) if the downlink data information is received in the first data receiving window (RX 1). Therefore, the communication method provided by the invention not only ensures that the terminal 10 can receive the downlink data information issued by the base station 20 in real time, but also can close the redundant data receiving window in time after receiving the downlink data information, so that the terminal 10 can realize lower power consumption under the condition of completing the same task instruction.
Next, when the terminal 10 opens the data reception window to receive the downlink data information transmitted from the base station 20, if the terminal 10 does not receive the downlink data information in the first data reception window (RX 1), the terminal opens the second data reception window (RX 2) and receives the downlink data information in the second data reception window (RX 2). If the downlink data information is received in the second data receiving window (RX 2), the fourth positive feedback information of the received downlink data information is reported to the base station 20. If downlink data information is not received in the second data reception window (RX 2), the listening base station 20 periodically opens the listening time window based on a preset listening time interval, if the fourth preamble is issued. Until the terminal 10 monitors the preamble of the base station 20 and further receives the downlink data information issued by the base station 20 in time, the communication between the terminal 10 and the base station 20 is completed.
In order to ensure that the base station 20 serving as the wake-up party can wake up the terminal 10 of the wake-up party normally every time, the duration of the base station 20 transmitting the preamble should be longer than or slightly longer than the wake-up time interval of the wake-up party. If the transmission duration of the fourth preamble transmitted by the base station 20 is set to be the fourth transmission duration, and when the duration of the fifth preamble transmitted by the relay gateway 30 is set to be the fifth transmission duration, both the fourth transmission duration and the fifth transmission duration are longer than the duration of the listening time interval, for example, the listening time interval is 1s, the fourth transmission duration and the fifth transmission duration may be set to be 1.001 seconds, so as to ensure that the terminal 10 can be woken up by the base station 20 to receive the data issued by the base station 20 normally.
The third embodiment of the present invention further provides a network access method of the terminal 10, which is implemented based on the base station 20, as shown in fig. 4, and includes the following steps:
Step S311, receiving the network access request information reported by the terminal 10. In order to make the network access request information received by the base station 20 legal, the terminal 10 also needs to transmit a section of preamble before sending the network access request information, the base station 20 first analyzes the preamble reported by the terminal 10, and if the preamble is correct, the network access request information of the terminal 10 is considered legal, so that the terminal 10 is allowed to access the network.
Step S312, a first preamble is transmitted to the terminal 10, wherein the first preamble is a wireless signal transmitted before the network access response information responding to the network access request information is transmitted to the terminal 10, so that the terminal 10 opens a data receiving window to receive the network access response information transmitted by the base station 20 after the first preamble is monitored in an open monitoring time window, and the duration of the monitoring time window is smaller than that of the data receiving window. Therefore, the terminal 10 according to the embodiment of the present invention does not need to continuously open the data receiving window, and only needs to first monitor the wireless signal (the first preamble) transmitted by the base station 20 with a monitoring time window that is longer than the data receiving window, and only opens the data receiving window to receive data when the wireless signal is monitored, so that the real-time performance is high. If no wireless signal is received, the data receiving window does not need to be opened, and in order to obtain lower power consumption, the embodiment of the invention sets the window opening time length of the monitoring time window of the terminal 10 to be smaller than the time length of the data receiving window, so that the extra power consumption caused by continuous window opening is avoided. The power consumption of the base station 20 downlink control related terminal 10 is lower, the real-time performance is better, and the base station 20 controls the time delay to be low while meeting the requirement of data acquisition.
In the embodiment of the present invention, when the terminal 10 opens the data receiving window to receive the network access response information transmitted by the base station 20, the network access method further includes, if the terminal 10 does not monitor the first preamble in the monitoring time window or does not receive the network access response information in the data receiving window, periodically opening the monitoring time window based on a preset monitoring time interval, whether the monitoring base station 20 issues the first preamble. So that the base station 20 needs to communicate the network access response information to the terminal 10 in time when the network access response information is transmitted, so that the control delay of the base station 20 is low.
The base station 20 also needs to authenticate the reliability of the uplink and downlink channels with the terminal 10 before confirming whether to access the network based on the access request information uploaded by the terminal 10. The base station 20 performs the following method steps when the base station 20 performs the network access method, as shown in fig. 5, before transmitting the first preamble to the terminal 10:
Step S321, a second preamble is transmitted to the terminal 10, wherein the second preamble is a wireless signal transmitted before the base station 20 transmits uplink channel test information in response to the network access request information to the terminal 10, the terminal 10 periodically opens a monitoring time window to monitor whether the base station 20 transmits the second preamble, and if the second preamble is monitored, opens a data receiving window to receive the uplink channel test information.
Step S322, receiving the downlink channel test information reported by the terminal 10 and responding to the uplink channel test information, transmitting a first preamble to the terminal 10 after receiving the downlink channel test information, and transmitting network access response information to inform whether the terminal 10 can access the network after the terminal 10 receives the first preamble.
In the network Access process of the terminal 10 in the embodiment of the present invention, after receiving the network Access request information (Access Confirm) reported by the terminal 10, the base station 20 issues uplink channel test information to the terminal 10 (Up Channel Confirm). The terminal 10 monitors the second preamble, opens the data receiving window to receive the uplink channel test information issued by the base station 20, and immediately replies to the downlink channel test information (Down Channel Confirm), if the information content of the downlink channel test information is set to be "RSSIup +66666666", RSSIup is the signal size of the uplink channel test information, and waits for the base station 20 to reply to the acknowledgement command. If the base station 20 receives the downlink channel test information reported by the terminal 10 and confirms that the uplink and downlink channels are reliable, the network access response information issued to the terminal 10 is network access success confirmation information (NET ACCESS Confirm), for example, the information content of the network access success confirmation information can be set to be 66666666 (the content can be set arbitrarily and is not limited uniquely here), and if the base station 20 confirms that the uplink and downlink channels are unreliable, the network access response information issued to the terminal 10 is network access failure information "77778888". In the embodiment of the present invention, if the signal size of the downlink channel test information reaches the base station 20 and is smaller than the preset signal size, the base station 20 may consider that the uplink and downlink channels with the terminal 10 are unreliable, and the network access response information to be issued to the terminal 10 is the network access failure information, that is, the downlink channel test information received by the base station 20 is a weak signal, for example, the signal size RSSI value is smaller than-135 dBm (dBm unit is milliwatt decibel) and is considered to be unreliable. In addition, the base station 20 is not reliable and does not allow the terminal 10 to access the network as long as it does not receive the downlink channel test information.
The terminal 10 reports the network access request information to the relay gateway 30, and when the relay gateway 30 forwards the network access request information to the base station 20, the base station 20 further includes steps of receiving the network access request information forwarded by the relay gateway 30 from the terminal 10, and transmitting network access response information responding to the network access request information to the relay gateway 30, so as to transmit a third preamble to the terminal 10 through the relay gateway 30, wherein the third preamble is a wireless signal transmitted by the relay gateway 30 before forwarding the network access response information to the terminal 10, so that after the terminal 10 monitors the third preamble, opening a data receiving window to receive the network access response information forwarded by the relay gateway 30. The third preamble may be a preamble that the base station 20 issues to the relay gateway 30 and is forwarded to the terminal 10 by the relay gateway 30, or may be a preamble that the relay gateway 30 directly transmits to the terminal 10 with good constraint in advance, as long as the terminal 10 can be awakened, and the embodiment of the present invention is not limited only to the direct sender of the third preamble. According to the embodiment of the invention, the relay gateway 30 forwards the network access communication information between the base station 20 and the terminal 10, so that the base station 20 can be ensured to receive the network access request information of the terminal 10 which cannot be received normally or is difficult to receive, and therefore, a land scene such as a plain scene can break through the coverage distance of a LoRa network, and a mountain scene can be contacted with the terminal 10 in a low-lying place, and the communication coverage of the base station 20 is ensured to be wider.
In the embodiment of the present invention, the base station 20 stores a triplet information list, and the triplet information list stores triplet information of different terminals 10. Before the base station 20 transmits the second preamble to the terminal 10, the network access method further includes that the base station 20 receives the triplet information belonging to the terminal 10 and reported by the terminal 10, then judges whether the triplet information belongs to the triplet information list, if yes, the first preamble is issued to the terminal 10, and local network access of the terminal 10 is achieved. If not, a second preamble is issued to the terminal 10. That is, the base station 20 in the embodiment of the present invention can ensure that the terminal 10 is logged on based on ABP, which is called Activation by Personalization (i.e., the ABP is logged on in a personalized activation mode). ABP network access is to pre-record triplet information of the terminal 10 in a server of the base station 20 in advance, after the base station 20 receives network access request information of the terminal 10 and demodulates the triplet information, the triplet information is compared with the locally stored triplet information, if the triplet information belongs to the pre-recorded triplet information, the base station 20 considers that the terminal 10 is legal, and can immediately reply network access confirmation information to the terminal 10, so that the terminal 10 is allowed to access the network. If the received triplet information of the current terminal 10 does not belong to the triplet information in the pre-record, the terminal 10 is considered illegal, and the data information of the subsequent terminal 10 will not be networked and demodulated.
In the embodiment of the invention, the data receiving window comprises a first data receiving window (RX 1) and a second data receiving window (RX 2), and the duration of the monitoring time window is smaller than that of the first data receiving window (RX 1) and the second data receiving window (RX 2). The network access method in the embodiment of the present invention further includes that the base station 20 receives first positive feedback information reported by the terminal 10, where the first positive feedback information is feedback information of network response information received by the terminal 10 in the first data receiving window (RX 1). Next, the base station 20 will also receive the second positive feedback information reported by the terminal 10, where the second positive feedback information is feedback information that the terminal 10 has not received the network access response information in the first data receiving window (RX 1) and has received the network access response information in the opened second data receiving window (RX 2).
To ensure that the base station 20 acting as the wake-up party will wake up the wake-up party terminal 10 normally each time, the time the base station 20 transmits the preamble should be greater or slightly greater than the time interval the wake-up party wakes up. Specifically, the transmission duration of the base station 20 for transmitting the first preamble to the terminal 10 is set to be the first transmission duration, the transmission duration of the base station 20 for transmitting the second preamble to the terminal 10 is set to be the second transmission duration, and the duration of the relay gateway 30 for transmitting the third preamble is set to be the third transmission duration, where the first transmission duration, the second transmission duration, and the third transmission duration are all longer than the duration of the listening time interval. Thereby ensuring that the base station 20 or the relay gateway 30 can wake up the terminal 10 normally every time, and ensuring the timeliness of the downlink control of the base station 20.
The fourth embodiment of the present invention further provides a communication method between the terminal 10 and the base station 20, where the communication method is implemented by the base station 20 after the terminal 10 completes network access based on the network access method of the terminal 10 provided in the first embodiment of the present invention, and the network access method of the terminal 10 is specifically please refer to the content provided in the first embodiment of the present invention, and the embodiments of the present invention are not repeated herein. As shown in fig. 6, the communication method provided by the embodiment of the invention includes the following steps:
Step S411, receiving the uplink data information reported by the terminal 10. In order for the uplink data information received by the base station 20 to be legal, the terminal 10 also needs to transmit a preamble before transmitting the uplink data information, and the base station 20 first analyzes the preamble reported by the terminal 10, and considers that the uplink data information of the terminal 10 is legal if the preamble is correct.
Step S412, a fourth preamble is transmitted to the terminal 10, where the fourth preamble is a wireless signal transmitted before the base station 20 transmits the downlink data information in response to the uplink data information, so that the terminal 10 opens a data receiving window to receive the downlink data information after listening to the fourth preamble in the open listening time window. Wherein the duration of the listening time window is less than the duration of the data receiving window.
Therefore, the terminal 10 controlled by the base station 20 in the embodiment of the present invention does not need to continuously open the data receiving window, only needs to first monitor the wireless signal (the fourth preamble) transmitted by the base station 20 in a monitoring time window with a time length smaller than that of the data receiving window, and opens the data receiving window to receive the downlink data information transmitted by the base station 20 when the wireless signal is monitored, so that the real-time performance of downlink control is high. If no wireless signal is received, the data receiving window does not need to be opened, and in order to obtain lower power consumption, the embodiment of the invention sets the window opening time length of the monitoring time window of the terminal 10 to be smaller than the time length of the data receiving window, so that the extra power consumption caused by continuous window opening is avoided.
When the terminal 10 opens the data receiving window to receive the downlink data information, if the terminal 10 does not monitor the fourth preamble in the monitoring time window or does not receive the downlink data information in the data receiving window, the terminal periodically opens the monitoring time window to monitor the fourth preamble based on a preset monitoring time interval. That is, in the embodiment of the present invention, when the terminal 10 under the control of the base station 20 monitors no wireless signal for the first time, the monitoring time window is opened again to monitor after a preset monitoring time interval until the base station 20 wakes up the terminal 10 to enable the terminal 10 to automatically execute a preset broadcast or pass-through task. Therefore, the data receiving window of the terminal 10 will not be opened before the base station 20 wakes up the terminal 10, thereby realizing the use requirements of low power consumption and real-time performance of the terminal 10 related to the downlink control of the base station 20. The preset listening time interval may be set to one second, so that the terminal 10 may listen to the preamble every second, and the listening duration of each time may be set to 2ms (i.e., the listening time window is 2 ms), until the base station 20 wakes up the terminal 10 to enable the terminal 10 to autonomously transmit the task instruction, and after the instruction of the base station 20 is issued, the terminal 10 immediately replies acknowledgement ACK and periodically opens the listening time window to monitor whether the base station 20 issues the preamble based on the preset listening time interval again.
In order to break through the coverage distance of the LoRa network by the communication distance between the base station 20 and the terminal 10 in a field scene, such as a plain scene, and enable the base station 20 to touch the terminal 10 in a low-lying scene in a mountain area, the communication method in the embodiment of the invention further includes that the base station 20 receives uplink data information from the terminal 10 forwarded by the relay gateway 30, and sends downlink data information in response to the uplink data information to the relay gateway 30, so as to send a fifth preamble to the terminal 10 through the relay gateway 30, wherein the fifth preamble is a wireless signal transmitted by the relay gateway 30 before forwarding the downlink data information to the terminal 10. The terminal 10 opens the data receiving window to receive the downlink data information forwarded by the relay gateway 30 after listening to the fifth preamble in the opened listening time window. Therefore, the base station 20 can cover the terminal 10 equipment in more remote places, and the requirements of data acquisition and downlink control in different area environments are met.
Wherein the data reception window of the terminal 10 includes a first data reception window (RX 1) and a second data reception window (RX 2), and the duration of the listening time window is smaller than the duration of the first data reception window (RX 1) and the second data reception window (RX 2). The communication method in the embodiment of the present invention further includes that the base station 20 receives third positive feedback information reported by the terminal 10, where the third positive feedback information is information fed back after the terminal 10 receives the downlink data information in the first data receiving window (RX 1). Next, the base station 20 receives fourth positive feedback information reported by the terminal 10, where the fourth positive feedback information is information fed back after the terminal 10 does not receive downlink data information in the first data receiving window (RX 1) and receives downlink data information in the opened second data receiving window (RX 2).
The fifth embodiment of the present invention further provides a terminal 10, where the terminal 10 completes network access by adopting the network access method of the terminal 10 provided by the first embodiment of the present invention. The network access method of the terminal 10 is specifically referred to the content provided in the first embodiment of the present invention, and the embodiments of the present invention are not described herein again.
The sixth embodiment of the present invention further provides a communication device of the terminal 10 and the base station 20, as shown in fig. 7, where the communication device is disposed on the terminal 10, and the communication device is used to implement the communication method of the terminal 10 and the base station 20 provided by the second embodiment of the present invention, and the communication device includes a listening module 11 and a window opening module 12. The monitoring module 11 is configured to open a preset monitoring time window after reporting the uplink data information to the base station 20, and monitor whether the base station 20 issues a fourth preamble, where the fourth preamble is a wireless signal transmitted before the base station 20 transmits the downlink data information in response to the uplink data information. If the listening module 11 listens to the fourth preamble, the window opening module 12 is configured to open a data receiving window to receive downlink data information transmitted by the base station 20, where a duration of the listening time window is less than a duration of the data receiving window.
When the window opening module 12 opens the data receiving window to receive the downlink data information transmitted by the base station 20, if the monitoring module 11 does not monitor the fourth preamble in the monitoring time window, or the window opening module 12 does not receive the downlink data information in the data receiving window, the monitoring module 11 periodically opens the monitoring time window based on a preset monitoring time interval, whether the monitoring base station 20 issues the fourth preamble. That is, when the terminal 10 in the embodiment of the present invention monitors that no wireless signal is monitored by the monitoring module 11 for the first time, the monitoring time window is opened again to monitor after a preset monitoring time interval, until the terminal 10 is awakened and automatically executes a preset broadcast or pass-through task. Therefore, the window opening module 12 can not receive the window before the terminal 10 is awakened, and the use requirements of low power consumption and real-time performance are met. The preset listening time interval in the listening module 11 may be set to one second, so that the listening module 11 of the terminal 10 may listen to the preamble every second, and the listening duration of each time may be set to 2ms (i.e., the listening time window is 2 ms), until the terminal 10 is awakened and the end side autonomously and transparently transmits the task instruction, and immediately replies acknowledgement ACK after the instruction is issued and based on the preset listening time interval again, the listening module 11 periodically opens the listening time window to monitor whether the base station 20 issues the preamble.
In the smart agriculture field, since the terminal 10 is mostly installed in a mountain area with remote environment or inconvenient power supply, and is usually far away from the base station 20, in order to break through the coverage distance of the LoRa network in a field scene such as a plain scene, and the mountain area scene can reach a low-lying place, the communication device in the embodiment of the invention also communicates with the relay gateway 30, the terminal 10 reports uplink data information to the relay gateway 30, the relay gateway 30 forwards the uplink data information to the base station 20, the terminal 10 opens a listening time window through the listening module 11, and listens whether the relay gateway 30 issues a fifth preamble, where the relay gateway 30 is further configured to receive downlink data information sent by the base station 20 and responding to the uplink data information, and the fifth preamble is a wireless signal transmitted by the relay gateway 30 before forwarding the downlink data information to the terminal 10. If the listening module 11 listens to the fifth preamble, the terminal 10 opens a data receiving window through the window opening module 12 to receive the downlink data information forwarded by the relay gateway 30.
Therefore, in the embodiment of the present invention, the relay gateway 30 forwards the uplink and downlink communication information between the communication device and the base station 20, which are disposed in the terminal 10, so that the base station 20 can be ensured to receive the uplink data information of the terminal 10 which is normally difficult to receive, so that the communication distance between the terminal 10 and the base station 20 in a field scene, such as a plain scene, can break through the LoRa network coverage distance, and the mountain scene can reach the terminal 10 in a low-lying place, thereby achieving a wider communication coverage while considering the low power consumption and real-time performance of the terminal 10.
In the embodiment of the present invention, a routing table is set in the trunking gateway 30, and the routing table is generated according to the triplet information of different terminals 10, where the triplet information includes the information such as productKey, deviceName and DEVICESECRET of the terminals 10. When the terminal 10 reports the uplink data information to the relay gateway 30, the terminal 10 reports the triplet information belonging to itself to the relay gateway 30, so that the relay gateway 30 forwards the uplink data information of the terminal 10 to the base station 20 based on the triplet information and the routing table. Normal communication between the terminal 10 and the base station 20 in a field scene such as a plain scene and a mountain topography low-lying place scene is realized.
In the embodiment of the present invention, in order to keep-alive the terminal 10, the terminal 10 can report the data without the base station 20 performing ACK acknowledgement (ACK is an acknowledgement character, english is called ACKnowledge Character), and the step of reporting the uplink data information to the base station 20 by the terminal 10 includes the terminal 10 broadcasting the uplink data information to the base station 20 periodically based on a preset broadcasting time interval, so as to open a listening time window after broadcasting is finished, and monitor whether the base station 20 issues the fourth preamble. The preset broadcasting time interval is set to, for example, 1 hour, 2 hours, etc., so that the terminal 10 can broadcast the relevant data information to the base station 20 after one broadcasting time interval, thereby achieving the keep-alive design goal of the terminal 10.
In the embodiment of the present invention, the data receiving window in the window opening module 12 includes a first data receiving window (RX 1) and a second data receiving window (RX 2), and the duration of the listening time window is smaller than the duration of the first data receiving window (RX 1) and the second data receiving window (RX 2), for example, the duration of the listening time window is set to 2ms, and the duration of the first data receiving window (RX 1) and the second data receiving window (RX 2) are set to 1s that meets the data receiving requirement. When the terminal 10 opens the data receiving window through the window opening module 12 to receive the downlink data information transmitted by the base station 20, if the window opening module 12 receives the downlink data information in the first data receiving window (RX 1), reporting third positive feedback information of the downlink data information to the base station 20, and closing the second data receiving window (RX 2). Therefore, the communication method provided by the invention not only ensures that the terminal 10 can receive the downlink data information issued by the base station 20 in real time, but also can close the redundant data receiving window in time after receiving the downlink data information, so that the terminal 10 can realize lower power consumption under the condition of completing the same task instruction.
Next, when the terminal 10 opens the data receiving window through the window opening module 12 to receive the downlink data information transmitted by the base station 20, if the window opening module 12 does not receive the downlink data information in the first data receiving window (RX 1), the second data receiving window (RX 2) is opened, and the downlink data information is received by the second data receiving window (RX 2). If the downlink data information is received in the second data receiving window (RX 2), the fourth positive feedback information of the received downlink data information is reported to the base station 20. If no downlink data information is received in the second data receiving window (RX 2), the listening module 11 periodically opens the listening time window to determine whether the fourth preamble is issued by the base station 20 based on a preset listening time interval. Until the terminal 10 monitors the preamble of the base station 20 and further receives the downlink data information issued by the base station 20 in time, the communication between the terminal 10 and the base station 20 is completed.
In order to ensure that the base station 20 serving as the wake-up party can wake up the terminal 10 of the wake-up party normally every time, the duration of the base station 20 transmitting the preamble should be longer than or slightly longer than the wake-up time interval of the wake-up party. If the transmission duration of the fourth preamble transmitted by the base station 20 is set to be the fourth transmission duration, and when the duration of the fifth preamble transmitted by the relay gateway 30 is set to be the fifth transmission duration, both the fourth transmission duration and the fifth transmission duration are longer than the duration of the listening time interval, for example, the listening time interval is 1s, the fourth transmission duration and the fifth transmission duration may be set to be 1.001 seconds, so as to ensure that the terminal 10 can be woken up by the base station 20 to receive the data issued by the base station 20 normally.
The seventh embodiment of the present invention further provides a base station 20, where the base station 20 confirms that the terminal 10 is connected to the network by using the network connection method of the terminal 10 provided by the third embodiment of the present invention, and the network connection method of the terminal 10 is specifically referred to the content provided by the third embodiment of the present invention, and the embodiments of the present invention are not repeated herein.
As shown in fig. 8, the eighth embodiment of the present invention further provides a communication device for a terminal 10 and a base station 20, where the communication device is disposed on the base station 20, and the communication device is used to implement the communication method for the terminal 10 and the base station 20 provided by the fourth embodiment of the present invention, and the communication device includes a receiving module 21 and a transmitting module 22. The receiving module 21 is configured to receive uplink data information reported by the terminal 10. The transmitting module 22 is configured to transmit a fourth preamble to the terminal 10, where the fourth preamble is a wireless signal transmitted before the base station 20 transmits downlink data information in response to the uplink data information, so that the terminal 10 opens a data receiving window to receive the downlink data information after listening to the fourth preamble in an open listening time window, where a duration of the listening time window is less than a duration of the data receiving window.
Therefore, the terminal 10 controlled by the base station 20 in the embodiment of the present invention does not need to continuously open the data receiving window, only needs to first monitor the wireless signal (the fourth preamble) transmitted by the base station 20 in a monitoring time window with a time length smaller than that of the data receiving window, and opens the data receiving window to receive the downlink data information transmitted by the base station 20 when the wireless signal is monitored, so that the real-time performance of downlink control is high. If no wireless signal is received, the data receiving window does not need to be opened, and in order to obtain lower power consumption, the embodiment of the invention sets the window opening time length of the monitoring time window of the terminal 10 to be smaller than the time length of the data receiving window, so that the extra power consumption caused by continuous window opening is avoided.
When the terminal 10 opens the data receiving window to receive the downlink data information, if the terminal 10 does not monitor the fourth preamble in the monitoring time window or does not receive the downlink data information in the data receiving window, the terminal periodically opens the monitoring time window to monitor the fourth preamble based on a preset monitoring time interval. That is, in the embodiment of the present invention, when the terminal 10 under the control of the base station 20 monitors no wireless signal for the first time, the monitoring time window is opened again to monitor after a preset monitoring time interval until the base station 20 wakes up the terminal 10 to enable the terminal 10 to automatically execute a preset broadcast or pass-through task. Therefore, the data receiving window of the terminal 10 will not be opened before the base station 20 wakes up the terminal 10, thereby realizing the use requirements of low power consumption and real-time performance of the terminal 10 related to the downlink control of the base station 20. The preset listening time interval may be set to one second, so that the terminal 10 may listen to the preamble every second, and the listening duration of each time may be set to 2ms (i.e., the listening time window is 2 ms), until the base station 20 wakes up the terminal 10 to enable the terminal 10 to autonomously transmit the task instruction, and after the instruction of the base station 20 is issued, the terminal 10 immediately replies acknowledgement ACK and periodically opens the listening time window to monitor whether the base station 20 issues the preamble based on the preset listening time interval again.
In order to break through the coverage distance of the LoRa network by the communication distance between the base station 20 and the terminal 10 in the field scene, such as the plain scene, and enable the base station 20 to touch the terminal 10 in the low-lying scene of the mountain area, the base station 20 further receives the uplink data information forwarded from the terminal 10 by the relay gateway 30 through the receiving module 21, and transmits the downlink data information in response to the uplink data information to the relay gateway 30 through the transmitting module 22, so as to transmit a fifth preamble code to the terminal 10 through the relay gateway 30, where the fifth preamble code is a wireless signal transmitted by the relay gateway 30 before forwarding the downlink data information to the terminal 10. The terminal 10 opens the data receiving window to receive the downlink data information forwarded by the relay gateway 30 after listening to the fifth preamble in the opened listening time window. Therefore, the base station 20 can cover the terminal 10 equipment in more remote places, and the requirements of data acquisition and downlink control in different area environments are met.
Wherein the data reception window of the terminal 10 includes a first data reception window (RX 1) and a second data reception window (RX 2), and the duration of the listening time window is smaller than the duration of the first data reception window (RX 1) and the second data reception window (RX 2). The base station 20 in the embodiment of the present invention further receives, through the receiving module 21, third positive feedback information reported by the terminal 10, where the third positive feedback information is information fed back after the terminal 10 receives the downlink data information in the first data receiving window (RX 1). Next, the base station 20 receives, through the receiving module 21, fourth positive feedback information reported by the terminal 10, where the fourth positive feedback information is fed back after the terminal 10 has not received the downlink data information in the first data receiving window (RX 1) and has received the downlink data information in the opened second data receiving window (RX 2).
The ninth embodiment of the present invention also provides a communication system including a terminal 10 and a base station 20, wherein the terminal 10 is provided with the communication apparatus of the terminal 10 and the base station 20 provided by the sixth embodiment of the present invention. The base station 20 is provided with communication means of the terminal 10 and the base station 20 according to the eighth embodiment of the present invention.
After the terminal 10 realizes network access based on the network access method provided in the first embodiment of the present invention, communication between the terminal 10 and the base station 20 is realized based on the communication method between the terminal 10 and the base station 20 provided in the second embodiment of the present invention. In the communication process, after the terminal 10 reports the uplink data information to the base station 20, the terminal 10 immediately opens a preset monitoring time window through the monitoring module 11, and monitors whether the base station 20 issues the fourth preamble. The fourth preamble is a wireless signal transmitted before the transmitting module 22 of the base station 20 transmits the downlink data information in response to the uplink data information. In order for the base station 20 to confirm that the uplink data information of the terminal 10 received through the receiving module 21 is legal, the terminal 10 also needs to transmit a preamble before transmitting the uplink data information. After receiving the preamble reported by the terminal 10, the receiving module 21 of the base station 20 first analyzes the preamble, and if the preamble is correct, then considers that the uplink data information subsequently reported by the terminal 10 is legal, and receives the uplink data information through the receiving module 21. If the monitoring module 11 of the terminal 10 monitors the fourth preamble, the window opening module 12 opens a data receiving window to receive the downlink data information transmitted by the base station 20, where the duration of the monitoring time window is smaller than the duration of the data receiving window. Therefore, the terminal 10 according to the embodiment of the present invention does not need to continuously open the data receiving window, only needs to first monitor the wireless signal (the fourth preamble) transmitted by the base station 20 with a monitoring time window that is longer than the data receiving window, and opens the data receiving window to receive the downlink data information transmitted by the base station 20 when the wireless signal is monitored, so that the real-time downlink control is high. If no wireless signal is received, the data receiving window does not need to be opened, and extra power consumption caused by continuous window opening is avoided. The other steps of the terminal 10 and the base station 20 for communicating with each other by using the communication devices respectively provided are specifically referred to the contents of the sixth and eighth embodiments of the present invention, and the embodiments of the present invention are not described herein again.
Specifically, when the terminal 10 communicates with the base station 20 based on the communication method between the terminal 10 and the base station 20 provided by the second embodiment of the present invention and the base station 20, for convenience of description, the embodiment of the present invention defines the communication method between the terminal 10 and the base station 20 as LoRaLAM modes different from three modes of Class a, class B and Class C in the current LoRaWAN, and LoRaLAM modes include a periodic broadcast sub-mode and an over-the-air wake-up sub-mode of broadcasting state information of the terminal 10 by default, and the terminal 10 in the periodic broadcast sub-mode does not need to perform ACK acknowledgement by a gateway, so as to keep the terminal 10 alive, and the interval of the wake-up period of the terminal 10 in the periodic broadcast sub-mode may be set to 1 hour, 2 hours, or ten minutes, twenty minutes, or the like, which is specifically set according to the actual low power consumption requirement. In the air wake-up sub-mode of LoRaLAM mode, the terminal 10 can be set to monitor the preamble from the base station 20 once every second, the monitoring duration can be set to 2ms (i.e. the duration of the monitoring time window) until the terminal is woken up and the terminal side autonomously and transparently transmits the task execution instruction, and immediately replies acknowledgement ACK to the base station 20 after the instruction is issued and enters LoRaLAM mode again, i.e. the terminal 10 can be periodically woken up by the base station 20 in LoRaLAM mode.
In particular implementations, all terminals 10 may be powered on and join the LoRa network as terminals 10 that employ a Class a mode. The application of the terminal 10 may then decide to switch the terminal 10 to LoRaLAM mode. Since the terminal 10 has no specific message telling the server of the base station 20 that it is the terminal 10 configured with LoRaLAM mode, the application program at the server end needs to configure the corresponding mechanism to obtain the corresponding classification of the terminal 10, and specifically, support of LoRaLAM mode can be added in the LoRa network protocol of the network management platform, as shown in fig. 9, and classification of LoRaLAM mode is configured in the physical layer of the LoRa network protocol.
As shown in fig. 10, in the network Access process of the terminal 10 in the embodiment of the present invention, the terminal 10 reports the network Access request information (Access Confirm), and after receiving the network Access request information, the base station 20 (i.e. the gateway GateWay) issues uplink channel test information to the terminal 10 (Up Channel Confirm). The terminal 10 monitors the second preamble as the wake-up word, opens the data receiving window to receive the uplink channel test information issued by the base station 20, and immediately replies to the downlink channel test information (Down Channel Confirm), if the information content of the downlink channel test information is set to be "RSSIup +66666666", RSSIup is the signal size of the uplink channel test information, and waits for the base station 20 to reply to the acknowledgement command. The base station 20 receives the downlink channel test information reported by the terminal 10, and confirms that the uplink and downlink channels are reliable, and then the network access response information issued to the terminal 10 is network access success confirmation information (NET ACCESS Confirm), for example, the information content of the network access success confirmation information can be set to be 66666666 (the content can be set arbitrarily, and the embodiment of the invention is not limited only here), and if the uplink and downlink channels are not reliable, the network access response information issued to the terminal 10 is network access failure information 77778888. In the embodiment of the present invention, if the signal size of the downlink channel test information reaches the base station 20 and is smaller than the preset signal size, the base station 20 also considers that the uplink and downlink channels with the terminal 10 are unreliable, and the network access response information to be issued to the terminal 10 is the network access failure information, that is, the downlink channel test information received by the base station 20 is a weak signal, for example, the signal size RSSI value is smaller than-135 dBm (dBm unit is milliwatt decibel) and is considered to be unreliable. In addition, the base station 20 is not reliable and does not allow the terminal 10 to access the network as long as it does not receive the downlink channel test information.
Second, the terminal 10 in the embodiment of the present invention can access the network based on ABP, which is referred to as Activation by Personalization (i.e., ABP access is a personalized activation access mode). ABP network access is to pre-record triplet information of the terminal 10 in a server of the base station 20 in advance, after the base station 20 receives network access request information of the terminal 10 and demodulates the triplet information, the triplet information is compared with the locally stored triplet information, if the triplet information belongs to the pre-recorded triplet information, the base station 20 considers that the terminal 10 is legal, and can immediately reply network access confirmation information to the terminal 10, so that the terminal 10 is allowed to access the network. If the received triplet information of the current terminal 10 does not belong to the triplet information in the pre-record, the terminal 10 is considered illegal, and the data information of the subsequent terminal 10 will not be networked and demodulated.
The terminals 10 in all areas need to access the network through wireless transceiving requests, and channel test is performed through uplink and downlink channel test management of the base station 20, after the test is passed, the base station 20 issues acknowledgement information to the terminals 10, and the terminals 10 start to broadcast periodically in a periodic broadcast sub-mode after receiving the acknowledgement information.
In fig. 10, unicast is a point-to-point communication between the base station 20 and the terminal 10 in the same network, and when the wake-up word is not the wake-up word issued by the base station 20 to the terminal 10, i.e. unicast is irrelevant, the terminal 10 continues to periodically monitor the wake-up word preamble, and when unicast is relevant, (i.e. the wake-up word is the wake-up word issued by the base station 20 to the terminal 10), the terminal 10 opens a data receiving window to receive the valid data information issued by the base station 20. Multicasting is the communication of a base station 20 with a part of terminals 10 concerned with its data within the reach of the same network, i.e. multicasting. When the wake-up word preamble is multicast transmitted by the base station 20, the terminal 10 opens a data receiving window to receive the valid data information issued by the base station 20.
The communication system further comprises a relay gateway 30, the relay gateway 30 being connected between the terminal 10 and the base station 20 for forwarding communication information between the terminal 10 and the base station 20. If the base station 20 cannot receive the broadcast of the terminal 10 or any one of the acknowledgement messages reported to the base station 20 by the terminal 10 is problematic, it is considered that the terminal 10 needs the relay gateway 30 to realize the forwarding of the messages.
The LoRaLAM mode protocol integrally adopts a timing broadcast mechanism of a periodical broadcast sub-mode and an air wireless wake-up mechanism of an air wake-up sub-mode.
The timing broadcast mechanism is a mechanism of keep-alive terminal 10, where terminal 10 will broadcast network access request information to base station 20 periodically based on a preset broadcast time interval, and enter an air wake-up sub-mode after each broadcast is finished, i.e. immediately open a preset listening time window to monitor whether base station 20 issues a preamble, if the first listening time window does not receive the preamble, based on the preset listening time interval, periodically open the listening time window to monitor whether base station 20 issues a wake-up word preamble until terminal 10 is waken up to receive valid data information from base station 20.
The over-the-air Radio Wake-up mechanism may also be understood as over-the-air Wake-up (Wake On Radio), and Wake-up the terminal 10 in sleep by means of transmitting Radio signals.
The wake-up principle in the over-the-air wake-up sub-mode is that the wake-up party (base station 20 in the embodiment of the present invention) adds a longer preamble before transmitting valid data (e.g. network access response information). The awakened party (the terminal 10 in the embodiment of the present invention) periodically listens to the wireless signal preamble transmitted by the base station 20 to the air based on a preset listening time interval, and once the terminal 10 captures the correct preamble, the terminal enters a data receiving state (i.e. opens a data receiving window to start receiving data information from the base station 20), and if the terminal 10 does not obtain (does not listen to the wireless signal), the terminal immediately enters dormancy to wait for the next awakening listening. To ensure that the base station 20 can wake up the terminal 10 normally every time, the time the base station 20 transmits the preamble should be slightly longer than the listening interval for the terminal 10 to wake up, as shown in fig. 11:
1. The LoRaLAM mode in the embodiment of the present invention uses a reply radio wakeup mechanism, and the reply processing is still completed by replying to the ACK for the downlink acknowledgement frame CONFRIMED.
2. Since the maximum packet window of spreading factor SF12 is approximately 500ms, plus error redundancy, the present embodiment sets the duration of both the first data reception window (RX 1) and the second data reception window (RX 2) to 1S.
3. After the terminal 10 is awakened, the first data receiving window (RX 1) is opened immediately, if valid data information issued by the base station 20 is received within the duration of the first data receiving window (RX 1), an ACK is immediately returned to the base station 20, and the second data receiving window (RX 2) is closed at the same time, so that unnecessary power consumption is prevented. If the first data receiving window (RX 1) does not receive the valid data information issued by the base station 20, the second data receiving window (RX 2) is opened, if the second data receiving window (RX 2) receives a message, an ACK (e.g. positive feedback information) is immediately returned to the base station 20, and if the second data receiving window (RX 2) does not receive the valid data information issued by the base station 20, the mode is immediately entered LoRaLAM.
The Gateway column in fig. 11 represents an indication of the transmission duration of the base station 20, the first left segment (period shown by preamble transmission) of the Gateway column is a period in which the base station 20 transmits the preamble, and the middle segment (period shown by packet reception) is a period in which the base station 20 transmits the valid data packet. The terminal 10 (i.e. node in the figure) will periodically monitor the preamble transmitted by the base station 20, and the duration of the first data receiving window (RX 1) and the second data receiving window (RX 2) of the terminal 10 is 1 second, the monitoring duration is 2ms, and the monitoring time interval is 1 second, as can be seen in fig. 11, the time of transmitting the preamble by the base station 20 is slightly longer than the monitoring time interval of waking up the terminal 10.
4. When the protocol of LoRaLAM mode is designed, the base station 20 can add a time correction packet to the data packet sent to the terminal 10 after being awakened, and the terminal 10 can ensure the subsequent awakened time window according to the time correction packet correction time when each awakening. The calculation time of the terminal 10 is based on the time of the base station 20, the base station 20 uses GPS time service time as reference time, the GPS has a pulse per second, the pulse per second is a pulse signal, the precision is higher, the precision is 10ppm, the base station 20 starts timing according to the pulse per second signal, for example, when the time reaches 3600 seconds, the base station 20 sends a valid data message to the terminal 10, the terminal 10 starts timing after receiving the valid data message issued by the base station 20, after the next receiving is 3600 seconds, the terminal 10 is assumed to receive 3700 seconds in the next time, the terminal 10 is fast, then the self-adjusting speed is slow for the seconds of the time, the time is reduced by 100/3700 seconds, the time is consistent with the time window of the base station 20, the specific synchronization time is determined according to the communication delay between the base station 20 and the terminal 10, and the general delay is controlled within 100 us.
The hardware of the base station 20 in the embodiment of the present invention is designed into a gateway module with a network server NS, and the gateway module communicates with the base plate of the terminal 10 through a universal serial bus USB or an asynchronous transceiver Uart, so that the gateway module only performs data flow, and in this way, the existing hardware equipment can be quickly modified into the required gateway hardware.
In view of the fact that the cost of the terminal 10 is not very sensitive, the terminal 10 is provided with a node module, the LoRaLAM-mode execution firmware program SDK of the embodiment of the invention is built in, data is circulated, the data is connected with equipment of a third party through an asynchronous transceiver Uart interface, such as a water valve or a fan controlled by a 485 communication interface, and the like, and if a customer is originally a LoRa module, the data can be directly replaced.
The agriculture communication relay gateway 30LoRa Repeater network access mode design:
The goal is that 1, the whole multi-hop Multihop network breaks through the coverage limitation of 3 km. 2. The remote terminal 10 (SF 12) shortens the signal propagation Time on Air (ToA) of the overall link through the multi-hop Multihop network routing algorithm. 3. And 3 hops are stably completed within one second. 4. The protocol of terminal 10 supports standard Class a, class B, class C and LoRaLAM modes in embodiments of the present invention.
The network topology structure of a communication system provided in the embodiment of the present invention is shown in fig. 12, the lorewan refers to a LoRa network, the network server is a network server, the Gateway is a Gateway (i.e. the base station 20), and the Router Device is a relay Gateway 30 serving as a routing Device. MAIN GATEWAY is the primary gateway and END DEVICE is the terminal 10.
1. Forwarding mechanism of the relay gateway 30a, mechanism of simple relay of the LoRa physical layer. b. Routing protocols form more complex mesh networks. 2. The network topology and forwarding mode are selected such that the terminal 10 can directly communicate with the directly connected base station 20 or can communicate with the directly connected base station 20 in multiple hops through the relay gateway 30, and since the terminal 10 is not feasible in agriculture when participating in the relay gateway 30, the terminal 10 cannot always be in a receiving state, so that the terminal 10 is not applicable to agricultural situations with downlink control, and the terminal 10 equipment is required to be adapted to support routing, in addition, the receiving and transmitting frequency bands of the base station 20 and the terminal 10 are staggered on the CN470 frequency band, and the terminal 10 cannot be used as a repeater is determined. Thus, embodiments of the present invention choose to use the trunking gateway 30 to form a multihop network.
Specifically, as shown in fig. 13, the relay gateway 30 includes a solar power module 31, a processor 32, a plurality of data transceivers 33, and a locator 34. The processor 32 is connected with the solar power supply module 31, the data transceiver 33 is connected with the processor 32 respectively, and the data transceiver 33 is also connected with the solar power supply module 31. The solar power supply module 31 includes a charging unit 311 and a power supply unit 312, the charging unit 311 converts the electricity of the solar battery to the power supply unit 312, and the power supply unit 312 supplies power to the processor 32, the data transceiver 33 (such as a LoRa transceiver), the positioner 34, and the like. The locator 34 in the embodiment of the invention is a GPS module, and the processor 32 is a micro control unit MCU. The micro control unit MCU is responsible for the task operation of the whole relay device and the configuration of the routing algorithm, as well as for the control and scheduling of the data transceiver 33, and at the same time receives the positioning information of the GPS module and uploads these positioning information to the LoRa gateway (base station 20) wirelessly. The data transceiver 33 is responsible for receiving or transmitting the LoRa information given by the micro control unit MCU. The GPS module is responsible for receiving positioning information.
The following illustrates the routing algorithm configured on the MCU of the relay gateway 30 in the embodiment of the present invention, for example, after the first terminal 10, the second terminal 10, and the third terminal 10 are disposed, the first terminal 10, the second terminal 10, and the third terminal 10 begin to report the access request information to the base station 20, where the access request information of the first terminal 10, the second terminal 10, and the third terminal 10 may be received by the base station 20, when the base station 20 receives the access request information of one terminal 10 (e.g., the third terminal 10), the signal RSSI value of the access request information is greater than-110 dBm (the value may be adjusted according to different usage scenarios), the triplet information of the third terminal 10 is stored in the server of the base station 20, the signal RSSI value is less than-110 dBm (the value may be adjusted according to different usage scenarios), the terminal 10 is the weak signal terminal 10, the access request information of the weak signal terminal 10 will be received by the base station 20, when the base station 20 receives the access request information of the one terminal 10 (e.g., the third terminal 10) and the data transceiver 33 of the relay gateway 30, the signal RSSI value is far from the second terminal 10 is received by the base station 10, and the triplet information is directly transmitted to the base station 20, and the signal information is transmitted from the base station 10 to the third terminal 10 is received by the base station 10, and the triplet information is transmitted from the base station 10, and the node 10 is directly to the base station 20, and the signal information is received by the triplet information is received by the base station 10. Meanwhile, the MCU also stores the triplet information sent from the first terminal 10 and the second terminal 10 and forms a routing table, so that the trunking gateway 30 can forward the subsequent data packets of the first terminal 10 and the second terminal 10 through the data transceiver 33, and the base station 20 receives the data packets of the third terminal 10 and the first terminal 10 and the second terminal 10 forwarded by the trunking gateway 30 and forms a stable data forwarding mechanism.
Compared with the existing comparison scheme in the market, the communication system provided by the embodiment of the invention has the advantages that 1, the limitation of coverage range is broken through, and 2, the multi-hop can be supported when the electric quantity constraint and the dynamic topology (multi-hop) requirement of an agricultural scene are considered. 3. The solar cell can supply power, and energy is saved. 4. The signal propagation time ToA is shorter overall. 5. The downlink is supported, and the downlink control link does not depend on a clock and has no strict multi-hop time limit in cooperation with an air wireless wake-up mechanism in LoRaLAM modes.
Compared with the prior general LoRaWAN protocol, the terminal 10 working in LoRaLAM mode provided by the embodiment of the invention has higher real-time performance and reaches the sub-second level. The power consumption is lower, the window can not be continuously opened, and the unnecessary power consumption is reduced. The overall power consumption is lower than that of Class B and Class C, and the real-time performance is better than that of Class A. For example, the power consumption of the Class B and LoRaLAM modes depends on the open duration of the data reception window (pingslot cycles) and the wake-up period of the LoRaLAM mode. The overall Class B4 s/8s windowing cycle power consumption is close to the period power consumption of 0.5s/1s of LoRaLAM modes.
The tenth embodiment of the present invention further provides a computer device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the network access method of the terminal 10 provided in the first embodiment of the present invention when executing the computer program, and the network access method of the terminal 10 is specifically referred to the content provided in the first embodiment of the present invention, and the embodiments of the present invention are not repeated herein.
The eleventh embodiment of the present invention further provides a computer readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the network access method of the terminal 10 provided in the first embodiment of the present invention is implemented, and the network access method of the terminal 10 is specifically referred to the content provided in the first embodiment of the present invention, which is not described herein again.
The twelfth embodiment of the present invention further provides a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, implements the network access method of the terminal 10 provided in the first embodiment of the present invention, and the network access method of the terminal 10 is specifically referred to the content provided in the first embodiment of the present invention, and the embodiments of the present invention are not repeated herein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.