[go: up one dir, main page]

CN110719580A - Communication method, device, terminal, gateway and computer storage medium - Google Patents

Communication method, device, terminal, gateway and computer storage medium Download PDF

Info

Publication number
CN110719580A
CN110719580A CN201810757553.XA CN201810757553A CN110719580A CN 110719580 A CN110719580 A CN 110719580A CN 201810757553 A CN201810757553 A CN 201810757553A CN 110719580 A CN110719580 A CN 110719580A
Authority
CN
China
Prior art keywords
lora
terminal
lora terminal
gateway
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810757553.XA
Other languages
Chinese (zh)
Other versions
CN110719580B (en
Inventor
陈龙宇
张欢
续芳
张健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile M2M Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile M2M Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile M2M Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810757553.XA priority Critical patent/CN110719580B/en
Publication of CN110719580A publication Critical patent/CN110719580A/en
Application granted granted Critical
Publication of CN110719580B publication Critical patent/CN110719580B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/70Services for machine-to-machine communication [M2M] or machine type communication [MTC]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices
    • H04W88/02Terminal devices
    • H04W88/04Terminal devices adapted for relaying to or from another terminal or user
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例涉及物联网技术,公开了一种通信方法、装置、终端、网关及计算机存储介质,所述方法包括:接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。

Figure 201810757553

The embodiment of the present invention relates to the Internet of Things technology, and discloses a communication method, device, terminal, gateway and computer storage medium. The method includes: receiving a downlink signal sent by a first upper-level network device; wherein the downlink signal includes a target A terminal identifier and an operation instruction for instructing the target terminal to operate; the first upper-level network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal; Determine whether the first LoRa terminal itself is the target terminal according to the downlink signal; corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal; corresponding to It is determined that the first LoRa terminal itself is not the target terminal, and the downlink signal is forwarded to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal.

Figure 201810757553

Description

一种通信方法、装置、终端、网关及计算机存储介质A communication method, device, terminal, gateway and computer storage medium

技术领域technical field

本发明实施例涉及物联网技术,尤其涉及一种通信方法、装置、终端、网关及计算机存储介质。The embodiments of the present invention relate to the Internet of Things technology, and in particular, to a communication method, device, terminal, gateway, and computer storage medium.

背景技术Background technique

随着物联网技术的不断发展,生活质量的日益增加,人们对智能体验的需求也越来越多,各种传统的通讯传输技术在各个物联网行业的应用渐渐满足不了人们的需求。2.4GHz的WiFi、蓝牙、Zigbee等传统的通讯技术以及传统广域网技术2G/3G/4G等无线技术,虽然可以实现各种终端设备的网络互联与通信,但都不能同时兼顾远距离传输和低功耗传输。With the continuous development of Internet of Things technology and the increasing quality of life, people's demand for intelligent experience is also increasing. The application of various traditional communication and transmission technologies in various Internet of Things industries is gradually unable to meet people's needs. 2.4GHz WiFi, Bluetooth, Zigbee and other traditional communication technologies and traditional WAN technologies 2G/3G/4G and other wireless technologies can realize network interconnection and communication of various terminal devices, but they cannot take into account long-distance transmission and low power consumption at the same time. consumption transmission.

直到低功耗广域网(Low Power Wide Area Network,LPWAN)技术出现后,就能在保证更远距离的通信传输时,还能最大限度的降低功耗,节约传输成本。LoRa(Long Range)是一种低功耗广域网通信技术,是美国Semtech公司推广的一种基于扩频技术的超远距离无线传输的技术,具有远距离、低功耗、多节点、低成本的特点。目前,LoRa主要在全球免费频段上运行,如433MHz等频段。Until the Low Power Wide Area Network (LPWAN) technology appears, it is possible to minimize power consumption and save transmission costs while ensuring longer-distance communication transmission. LoRa (Long Range) is a low-power wide-area network communication technology. It is an ultra-long-distance wireless transmission technology based on spread spectrum technology promoted by Semtech in the United States. Features. At present, LoRa mainly operates on free frequency bands around the world, such as 433MHz and other frequency bands.

然而,目前,利用LoRa进行通讯的方法主要是通过LoRa处理器在指定的时间节点利用LoRa网关向LoRa终端发送请求,LoRa终端接收请求后利用LoRa网关向LoRa处理器发送数据来实现的。但是,这种方案需要LoRa处理器在特定的时间节点才能向LoRa终端发送请求,当LoRa终端需要向LoRa网关上报数据(例如警报信息)则需要使用独立的信道进行上报,而且需要使用独立的LoRa处理器处理LoRa网关和各个LoRa终端的信道配置、频段配置、发送接收请求等,其部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性。However, at present, the method of using LoRa for communication is mainly achieved by using the LoRa processor to send a request to the LoRa terminal at a specified time node using the LoRa gateway, and the LoRa terminal uses the LoRa gateway to send data to the LoRa processor after receiving the request. However, this solution requires the LoRa processor to send a request to the LoRa terminal at a specific time node. When the LoRa terminal needs to report data (such as alarm information) to the LoRa gateway, it needs to use an independent channel for reporting, and needs to use an independent LoRa The processor processes the channel configuration, frequency band configuration, and sending and receiving requests of the LoRa gateway and each LoRa terminal. The deployment cost is high, and data is easily lost due to the distance or other interference, and the stability of data transmission cannot be guaranteed.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例为解决现有技术中存在的至少一个问题而提供一种通信方法、装置、终端、网关及计算机存储介质,能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的技术问题,从而充分利用终端资源,保证LoRa网络在长距离传输、复杂环境传输数据时的稳定性。In view of this, the embodiments of the present invention provide a communication method, device, terminal, gateway and computer storage medium to solve at least one problem in the prior art, which can solve the problem that the LoRa network deployment cost is high and the distance is too long. Or other interference, it is easy to lose data, and it is a technical problem that the stability of data transmission cannot be guaranteed, so as to make full use of terminal resources and ensure the stability of LoRa network during long-distance transmission and complex environment transmission of data.

为达到上述目的,本发明实施例的技术方案是这样实现的:In order to achieve the above-mentioned purpose, the technical scheme of the embodiment of the present invention is realized as follows:

第一方面,本发明实施例提供一种通信方法,所述方法应用于第一LoRa终端,所述方法包括:In a first aspect, an embodiment of the present invention provides a communication method, the method is applied to a first LoRa terminal, and the method includes:

接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;Receive a downlink signal sent by a first upper-level network device; wherein, the downlink signal includes a target terminal identifier and an operation instruction used to instruct the target terminal to operate; the first upper-level network device includes a LoRa gateway, or is associated with the The first LoRa terminal is closer to the second LoRa terminal than the LoRa gateway;

根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;Determine whether the first LoRa terminal itself is the target terminal according to the downlink signal;

相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;Corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal;

相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。Corresponding to determining that the first LoRa terminal itself is not the target terminal, the downlink signal is forwarded to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal.

进一步地,在所述接收第一上级网络设备发送的下行信号之后,所述方法还包括:Further, after receiving the downlink signal sent by the first upper-level network device, the method further includes:

向所述第一上级网络设备发送第一应答消息;其中,所述第一应答消息用于指示所述第一LoRa终端接收到所述下行信号;sending a first response message to the first upper-level network device; wherein, the first response message is used to indicate that the first LoRa terminal receives the downlink signal;

接收所述第一上级网络设备发送的第二应答消息;其中,所述第二应答消息用于指示所述第一LoRa终端与所述第一上级网络设备完成信号传递。Receive a second response message sent by the first upper-level network device; wherein, the second response message is used to instruct the first LoRa terminal to complete signal transmission with the first upper-level network device.

进一步地,所述根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端包括:Further, determining whether the first LoRa terminal itself is the target terminal according to the downlink signal includes:

根据所述下行信号中的目标终端标识,确定所述第一LoRa终端自身是否具有所述目标终端标识,若所述第一LoRa终端自身具有所述目标终端标识,则确定所述第一LoRa终端自身为所述目标终端。According to the target terminal identifier in the downlink signal, determine whether the first LoRa terminal itself has the target terminal identifier, and if the first LoRa terminal itself has the target terminal identifier, determine the first LoRa terminal itself is the target terminal.

进一步地,所述将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端包括:Further, the forwarding of the downlink signal to a third LoRa terminal farther from the LoRa gateway than the first LoRa terminal includes:

按照预设的信号转发策略,获取与所述第一LoRa终端相比距离所述LoRa网关更远的所述第三LoRa终端,并将所述下行信号转发至所述第三LoRa终端。According to a preset signal forwarding strategy, the third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal is acquired, and the downlink signal is forwarded to the third LoRa terminal.

进一步地,所述将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端包括:Further, the forwarding of the downlink signal to a third LoRa terminal farther from the LoRa gateway than the first LoRa terminal includes:

在所述第一LoRa终端自身的地址上进行自增,获取与所述第一LoRa终端相比距离所述LoRa网关更远的所述第三LoRa终端的地址,并将所述下行信号转发至所述第三LoRa终端。Perform auto-increment on the address of the first LoRa terminal itself, obtain the address of the third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal, and forward the downlink signal to the third LoRa terminal.

进一步地,所述将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端,包括:Further, the forwarding of the downlink signal to a third LoRa terminal farther from the LoRa gateway than the first LoRa terminal includes:

将所述下行信号转发至第四LoRa终端;其中,所述第四LoRa终端是距离所述第一LoRa终端最近且与所述第一LoRa终端相比距离所述LoRa网关更远的终端;forwarding the downlink signal to a fourth LoRa terminal; wherein, the fourth LoRa terminal is the terminal closest to the first LoRa terminal and farther from the LoRa gateway than the first LoRa terminal;

确定是否接收到所述第四LoRa终端发送的第三应答消息;其中,所述第三应答消息用于指示所述第四LoRa终端接收到所述下行信号;Determine whether the third response message sent by the fourth LoRa terminal is received; wherein, the third response message is used to indicate that the fourth LoRa terminal receives the downlink signal;

相应于确定所述第一LoRa终端接收到所述第四LoRa终端发送的所述第三应答消息,向所述第四LoRa终端发送第四应答消息;其中,所述第四应答消息用于指示所述第一LoRa终端与所述第四LoRa终端完成信号传递;Corresponding to determining that the first LoRa terminal receives the third response message sent by the fourth LoRa terminal, a fourth response message is sent to the fourth LoRa terminal; wherein, the fourth response message is used to indicate The first LoRa terminal and the fourth LoRa terminal complete signal transmission;

相应于确定所述第一LoRa终端没有接收到所述第四LoRa终端发送的所述第三应答消息,将所述下行信号转发至第五LoRa终端;其中,所述第五LoRa终端是距离所述第一LoRa终端次近且与所述第一LoRa终端相比距离所述LoRa网关更远的终端。Corresponding to determining that the first LoRa terminal has not received the third response message sent by the fourth LoRa terminal, the downlink signal is forwarded to the fifth LoRa terminal; wherein, the fifth LoRa terminal is a distance away from the third LoRa terminal. The first LoRa terminal is the next closest terminal and is farther from the LoRa gateway than the first LoRa terminal.

进一步地,所述方法还包括:Further, the method also includes:

接收第二上级网络设备发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;所述第二上级网络设备是与所述第一LoRa终端相比距离所述LoRa网关更远的第六LoRa终端;Receive an uplink signal sent by a second upper-level network device; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway; the second upper-level network device is the same as the first LoRa terminal. Compared with the sixth LoRa terminal farther from the LoRa gateway;

根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关;Determine whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal;

相应于确定所述第一LoRa终端自身不是所述LoRa网关,将所述上行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端。Corresponding to determining that the first LoRa terminal itself is not the LoRa gateway, the uplink signal is forwarded to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal.

进一步地,在所述接收第二上级网络设备发送的上行信号之后,所述方法还包括:Further, after receiving the uplink signal sent by the second upper-level network device, the method further includes:

向所述第二上级网络设备发送第五应答消息;其中,所述第五应答消息用于指示所述第一LoRa终端接收到所述上行信号;Send a fifth response message to the second upper-level network device; wherein, the fifth response message is used to indicate that the first LoRa terminal receives the uplink signal;

接收所述第二上级网络设备发送的第六应答消息;其中,所述第六应答消息用于指示所述第一LoRa终端与所述第二上级网络设备完成信号传递。A sixth response message sent by the second upper-level network device is received; wherein, the sixth response message is used to instruct the first LoRa terminal and the second upper-level network device to complete signal transmission.

进一步地,所述根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关包括:Further, determining whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal includes:

根据所述上行信号中的所述LoRa网关标识,确定所述第一LoRa终端自身是否具有所述LoRa网关标识,若所述第一LoRa终端自身不具有所述目标终端标识,则确定所述第一LoRa终端自身不是所述LoRa网关。According to the LoRa gateway identifier in the uplink signal, determine whether the first LoRa terminal itself has the LoRa gateway identifier, and if the first LoRa terminal itself does not have the target terminal identifier, determine whether the first LoRa terminal itself has the target terminal identifier. A LoRa terminal itself is not the LoRa gateway.

进一步地,所述将所述上行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端包括:Further, the forwarding of the uplink signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal includes:

按照预设的信号转发策略,获取与所述第一LoRa终端相比距离所述LoRa网关更近的所述第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。According to a preset signal forwarding strategy, the address of the seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal is obtained, and the uplink signal is forwarded to the seventh LoRa terminal.

进一步地,所述将所述上行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端包括:Further, the forwarding of the uplink signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal includes:

在所述第一LoRa终端自身的地址上进行自减,获取与所述第一LoRa终端相比距离所述LoRa网关更近的所述第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。Perform self-decrement on the address of the first LoRa terminal itself, obtain the address of the seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal, and forward the uplink signal to the seventh LoRa terminal.

进一步地,所述将所述上行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端包括:Further, the forwarding of the uplink signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal includes:

将所述上行信号转发至第八LoRa终端;其中,所述第八LoRa终端是距离所述第一LoRa终端最近且与所述第一LoRa终端相比距离LoRa网关更近的终端;forwarding the uplink signal to the eighth LoRa terminal; wherein, the eighth LoRa terminal is the terminal closest to the first LoRa terminal and closer to the LoRa gateway than the first LoRa terminal;

确定是否接收到所述第八LoRa终端发送的第七应答消息;其中,所述第七应答消息用于指示所述第八LoRa终端接收到所述上行信号;Determine whether the seventh response message sent by the eighth LoRa terminal is received; wherein, the seventh response message is used to indicate that the eighth LoRa terminal receives the uplink signal;

相应于确定所述第一LoRa终端接收到所述第八LoRa终端发送的所述第七应答消息,向所述第八LoRa终端发送第八应答消息;其中,所述第八应答消息用于指示所述第一LoRa终端与所述第八LoRa终端完成信号传递;Corresponding to determining that the first LoRa terminal receives the seventh response message sent by the eighth LoRa terminal, sends an eighth response message to the eighth LoRa terminal; wherein, the eighth response message is used to indicate The first LoRa terminal and the eighth LoRa terminal complete signal transmission;

相应于确定所述第一LoRa终端没有接收到所述第八LoRa终端发送的所述第七应答消息,将所述上行信号转发至第九LoRa终端;其中,所述第九LoRa终端是距离所述第一LoRa终端次近且与所述第一LoRa终端相比距离所述LoRa网关更近的终端。Corresponding to determining that the first LoRa terminal has not received the seventh response message sent by the eighth LoRa terminal, the uplink signal is forwarded to the ninth LoRa terminal; wherein, the ninth LoRa terminal is a distance from The first LoRa terminal is the next closest terminal and is closer to the LoRa gateway than the first LoRa terminal.

第二方面,本发明实施例提供一种通信方法,所述方法应用于LoRa网关,所述方法包括:In a second aspect, an embodiment of the present invention provides a communication method, the method is applied to a LoRa gateway, and the method includes:

从所述LoRa网关自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;From the LoRa terminals under the jurisdiction of the LoRa gateway itself, determine the LoRa terminal with the highest order according to the preset sorting strategy;

生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;Generating a downlink signal; wherein, the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate;

向所述顺序最高的LoRa终端发送所述下行信号。Send the downlink signal to the LoRa terminal with the highest order.

进一步地,在所述向所述顺序最高的LoRa终端发送下行信号之后,所述方法还包括:Further, after the downlink signal is sent to the LoRa terminal with the highest order, the method further includes:

接收所述顺序最高的LoRa终端发送的第九应答消息;其中,所述第九应答消息用于指示所述顺序最高的LoRa终端接收到所述下行信号;Receive the ninth response message sent by the LoRa terminal with the highest order; wherein, the ninth response message is used to indicate that the LoRa terminal with the highest order receives the downlink signal;

向所述顺序最高的LoRa终端发送第十应答消息;其中,所述第十应答消息用于指示所述LoRa网关与所述顺序最高的LoRa终端完成信号传递。Send a tenth response message to the LoRa terminal with the highest order; wherein, the tenth response message is used to instruct the LoRa gateway and the LoRa terminal with the highest order to complete signal transmission.

进一步地,所述方法还包括:Further, the method also includes:

接收所述顺序最高的LoRa终端发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;Receive the uplink signal sent by the LoRa terminal with the highest order; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway;

根据所述上行信号确定所述LoRa网关自身是否为所述LoRa网关;Determine whether the LoRa gateway itself is the LoRa gateway according to the uplink signal;

相应于确定所述LoRa网关自身是所述LoRa网关,获得所述上行信号中的所述上报指令。Corresponding to determining that the LoRa gateway itself is the LoRa gateway, the reporting instruction in the uplink signal is obtained.

进一步地,在所述接收所述顺序最高的LoRa终端发送的上行信号之后,所述方法还包括:Further, after receiving the uplink signal sent by the LoRa terminal with the highest order, the method further includes:

向所述顺序最高的LoRa终端发送第十一应答消息;其中,所述第十一应答消息用于指示所述LoRa网关接收到所述上行信号;Send an eleventh response message to the LoRa terminal with the highest order; wherein, the eleventh response message is used to instruct the LoRa gateway to receive the uplink signal;

接收所述顺序最高的LoRa终端发送的第十二应答消息;其中,所述第十二应答消息用于指示所述LoRa网关与所述顺序最高的LoRa终端完成信号传递。Receive the twelfth response message sent by the LoRa terminal with the highest order; wherein, the twelfth response message is used to instruct the LoRa gateway and the LoRa terminal with the highest order to complete signal transmission.

第三方面,本发明实施例提供一种通信装置,所述装置包括:In a third aspect, an embodiment of the present invention provides a communication device, the device comprising:

第一接收单元,用于接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述装置相比距离所述LoRa网关更近的第二LoRa终端;a first receiving unit, configured to receive a downlink signal sent by a first upper-level network device; wherein the downlink signal includes a target terminal identifier and an operation instruction used to instruct the target terminal to operate; the first upper-level network device includes LoRa gateway, or a second LoRa terminal closer to the LoRa gateway than the device;

第一确定单元,用于根据所述下行信号确定所述装置自身是否为所述目标终端;a first determining unit, configured to determine whether the device itself is the target terminal according to the downlink signal;

第一执行单元,用于相应于确定所述装置自身是所述目标终端,执行所述下行信号中的所述操作指令;以及,a first execution unit, configured to execute the operation instruction in the downlink signal in response to determining that the device itself is the target terminal; and,

相应于确定所述装置自身不是所述目标终端,将所述下行信号转发至与所述装置相比距离所述LoRa网关更远的第三LoRa终端。Corresponding to determining that the device itself is not the target terminal, the downlink signal is forwarded to a third LoRa terminal that is farther from the LoRa gateway than the device.

进一步地,所述装置还包括:Further, the device also includes:

第二接收单元,用于接收第二上级网络设备发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;所述第二上级网络设备是与所述装置相比距离所述LoRa网关更远的第六LoRa终端;The second receiving unit is configured to receive an uplink signal sent by a second upper-level network device; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway; the second upper-level network device is a a sixth LoRa terminal farther from the LoRa gateway than the device;

第二确定单元,用于根据所述上行信号确定所述装置自身是否为所述LoRa网关;a second determining unit, configured to determine whether the device itself is the LoRa gateway according to the uplink signal;

第二执行单元,用于相应于确定所述装置自身不是所述LoRa网关,将所述上行信号转发至与所述装置相比距离所述LoRa网关更近的第七LoRa终端。The second execution unit is configured to forward the uplink signal to a seventh LoRa terminal that is closer to the LoRa gateway than the device in response to determining that the device itself is not the LoRa gateway.

第四方面,本发明实施例提供一种通信装置,所述装置包括:In a fourth aspect, an embodiment of the present invention provides a communication device, where the device includes:

第三确定单元,用于从所述装置自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;The third determination unit is used to determine the LoRa terminal with the highest order according to the preset sorting strategy from among the LoRa terminals under the jurisdiction of the device itself;

生成单元,用于生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;a generating unit, configured to generate a downlink signal; wherein the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate;

发送单元,用于向所述顺序最高的LoRa终端发送所述下行信号。A sending unit, configured to send the downlink signal to the LoRa terminal with the highest order.

进一步地,所述装置还包括:Further, the device also includes:

第三接收单元,用于接收所述顺序最高的LoRa终端发送的上行信号;其中,所述上行信号包括所述装置的标识以及用于上报信息到所述装置的上报指令;The third receiving unit is used to receive the uplink signal sent by the LoRa terminal with the highest order; wherein, the uplink signal includes the identifier of the device and a reporting instruction for reporting information to the device;

第四确定单元,用于根据所述上行信号确定所述装置自身是否为所述装置;a fourth determining unit, configured to determine whether the device itself is the device according to the uplink signal;

第三执行单元,用于相应于确定所述装置自身是所述装置,获得所述上行信号中的所述上报指令。A third execution unit, configured to obtain the reporting instruction in the uplink signal in response to determining that the device itself is the device.

第五方面,本发明实施例提供一种通信终端,所述终端包括第一通信总线、第一存储器和第一处理器;其中,In a fifth aspect, an embodiment of the present invention provides a communication terminal, where the terminal includes a first communication bus, a first memory, and a first processor; wherein,

所述第一通信总线,配置为实现组件之间的连接通信;the first communication bus, configured to implement connection communication between components;

所述第一存储器,配置为存储能够在所述处理器上运行的计算机程序;the first memory configured to store a computer program executable on the processor;

所述第一处理器,配置为在运行所述计算机程序时,执行第一方面所述通信方法的步骤。The first processor is configured to execute the steps of the communication method of the first aspect when running the computer program.

第六方面,本发明实施例提供一种通信网关,所述网关包括第二通信总线、第二存储器和第二处理器;其中,In a sixth aspect, an embodiment of the present invention provides a communication gateway, where the gateway includes a second communication bus, a second memory, and a second processor; wherein,

所述第二通信总线,配置为实现组件之间的连接通信;the second communication bus, configured to implement connection communication between components;

所述第二存储器,配置为存储能够在所述处理器上运行的计算机程序;the second memory configured to store a computer program executable on the processor;

所述第二处理器,配置为在运行所述计算机程序时,执行第二方面所述的步骤。The second processor is configured to perform the steps of the second aspect when running the computer program.

第七方面,本发明实施例提供一种计算机可读存储介质,所述计算机可读存储介质存储有通信程序,当所述通信程序被至少一个处理器执行时实现上述第一方面所述的通信程序的方法的步骤或者实现上述第二方面所述的通信程序的方法的步骤。In a seventh aspect, an embodiment of the present invention provides a computer-readable storage medium, where a communication program is stored in the computer-readable storage medium, and when the communication program is executed by at least one processor, the communication described in the first aspect above is implemented The steps of the method of the program or the steps of the method of implementing the communication program described in the second aspect above.

本发明实施例提供的一种通信方法、装置、终端、网关及计算机存储介质,首先接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。这样就能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的技术问题,从而充分利用终端资源,保证LoRa网络在长距离传输、复杂环境传输数据时的稳定性。In a communication method, device, terminal, gateway, and computer storage medium provided by an embodiment of the present invention, firstly, a downlink signal sent by a first upper-level network device is received; wherein, the downlink signal includes a target terminal identifier and is used to indicate the target terminal. An operation instruction for the terminal to operate; the first upper-level network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal; the first LoRa terminal is determined according to the downlink signal. Whether a LoRa terminal itself is the target terminal; corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal; corresponding to determining that the first LoRa terminal itself is not The target terminal forwards the downlink signal to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal. In this way, it can solve the technical problem that the LoRa network deployment cost is high, and the data is easily lost due to the distance or other interference, and the stability of data transmission cannot be guaranteed, so as to make full use of terminal resources and ensure that the LoRa network can be transmitted over long distances, complex The stability of the environment when transferring data.

附图说明Description of drawings

图1为本发明实施例提供一种示例性的网络架构示意图;FIG. 1 is a schematic diagram of an exemplary network architecture according to an embodiment of the present invention;

图2为本发明实施例用于组成网络架构的最小单位的示意图;2 is a schematic diagram of a minimum unit used to form a network architecture according to an embodiment of the present invention;

图3为本发明实施例提供的一种通信方法的流程示意图;3 is a schematic flowchart of a communication method according to an embodiment of the present invention;

图4为本发明实施例提供的又一种通信方法的流程示意图;FIG. 4 is a schematic flowchart of another communication method provided by an embodiment of the present invention;

图5为本发明实施例提供的一种LoRa终端向LoRa网关上报信号的示意图;5 is a schematic diagram of a LoRa terminal reporting a signal to a LoRa gateway according to an embodiment of the present invention;

图6为本发明实施例提供的一种通信方法的流程示意图;6 is a schematic flowchart of a communication method according to an embodiment of the present invention;

图7为本发明实施例提供的又一种通信方法的流程示意图;FIG. 7 is a schematic flowchart of another communication method provided by an embodiment of the present invention;

图8为本发明实施例提供的一种通信方法的示意图;FIG. 8 is a schematic diagram of a communication method provided by an embodiment of the present invention;

图9为本发明实施例提供的又一种通信方法的示意图;FIG. 9 is a schematic diagram of still another communication method provided by an embodiment of the present invention;

图10为本发明实施例提供的以LoRa网络为基础的智慧路灯示意图;10 is a schematic diagram of a LoRa network-based smart street light provided by an embodiment of the present invention;

图11为本发明实施例提供的一种通信装置的结构示意图;FIG. 11 is a schematic structural diagram of a communication device according to an embodiment of the present invention;

图12为本发明实施例提供的又一种通信装置的结构示意图;FIG. 12 is a schematic structural diagram of still another communication device according to an embodiment of the present invention;

图13为本发明实施例提供的一种终端的结构示意图;13 is a schematic structural diagram of a terminal according to an embodiment of the present invention;

图14为本发明实施例提供的一种网关的结构示意图。FIG. 14 is a schematic structural diagram of a gateway according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对发明的具体技术方案做进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。To make the objectives, technical solutions and advantages of the embodiments of the present invention clearer, the specific technical solutions of the invention will be described in further detail below with reference to the accompanying drawings in the embodiments of the present invention. The following examples are intended to illustrate the present invention, but not to limit the scope of the present invention.

图1为本发明实施例提供一种示例性的网络架构示意图,如图1所示,该网络架构包括服务器、至少一个LoRa网关、至少一个LoRa终端,其中,所述服务器可以与至少一个LoRa网关通过标准的TCP/IP协议进行连接,LoRa网关可以与至少一个LoRa终端连接。服务器可以通过LoRa终端所属的LoRa网关向所述LoRa终端发送消息,而且LoRa终端也可以通过LoRa终端所属的LoRa网关向服务器上报消息。例如,服务器需要让LoRa终端1亮灯,则服务器通过LoRa终端所属的LoRa网关1向LoRa终端1发送亮灯请求,当LoRa终端1接收到亮灯请求后,可以进行相应的亮灯处理,但是若LoRa终端1出现故障无法进行亮灯处理,则LoRa终端1可以通过LoRa网关1向服务器上报故障信息。本发明实施例中的网络架构还可以应用于其他的物联网场景,本发明实施例不作限制。FIG. 1 is a schematic diagram of an exemplary network architecture provided by an embodiment of the present invention. As shown in FIG. 1 , the network architecture includes a server, at least one LoRa gateway, and at least one LoRa terminal, wherein the server can communicate with at least one LoRa gateway. Connected via standard TCP/IP protocol, the LoRa gateway can connect with at least one LoRa terminal. The server can send messages to the LoRa terminal through the LoRa gateway to which the LoRa terminal belongs, and the LoRa terminal can also report messages to the server through the LoRa gateway to which the LoRa terminal belongs. For example, if the server needs to turn on the LoRa terminal 1, the server sends a light-on request to the LoRa terminal 1 through the LoRa gateway 1 to which the LoRa terminal belongs. When the LoRa terminal 1 receives the light-on request, it can perform the corresponding light-on processing, but If the LoRa terminal 1 fails and cannot be turned on, the LoRa terminal 1 can report the fault information to the server through the LoRa gateway 1. The network architecture in the embodiment of the present invention may also be applied to other Internet of Things scenarios, which is not limited in the embodiment of the present invention.

需要说明的是,图1所示的网络架构可以由至少一个最小单位组成,参见图2,其示出了用于组成网络架构的最小单位的示意图,该最小单位包含了至少一个LoRa终端以及一个终端所属的LoRa网关。其中,每个LoRa终端需要与该LoRa网关完成相关的配置工作,包括配置波特率、空中速率、通信信道和终端地址等。并且,LoRa网关可以与每个LoRa终端进行连接通信,两两LoRa终端之间也可以进行连接通信。默认的是所分配的地址越小(或越大)的终端与网关的物理距离越近,以此保证越靠近LoRa网关的LoRa终端受到的干扰越小,也就可以确保越靠近LoRa网关的LoRa终端,该LoRa终端接收到LoRa网关所发送消息的概率越大,也可以确保越靠近LoRa网关的LoRa终端,LoRa网关能够接收到该LoRa终端所发送消息的概率越大。It should be noted that the network architecture shown in FIG. 1 may be composed of at least one minimum unit. Referring to FIG. 2 , it shows a schematic diagram of the minimum unit used to form the network architecture. The minimum unit includes at least one LoRa terminal and one The LoRa gateway to which the terminal belongs. Among them, each LoRa terminal needs to complete related configuration work with the LoRa gateway, including configuring baud rate, air rate, communication channel and terminal address. In addition, the LoRa gateway can connect and communicate with each LoRa terminal, and can also connect and communicate between two LoRa terminals. The default is that the terminal with a smaller (or larger) assigned address is physically closer to the gateway, so as to ensure that the LoRa terminal closer to the LoRa gateway will suffer less interference, and it can also ensure that the LoRa terminal closer to the LoRa gateway will receive less interference. Terminal, the greater the probability that the LoRa terminal receives the message sent by the LoRa gateway, the greater the probability that the LoRa gateway can receive the message sent by the LoRa terminal is the LoRa terminal that is closer to the LoRa gateway.

实施例一Example 1

本发明实施例提供一种通信方法,所述方法应用于第一LoRa终端,图3为本发明实施例提供的一种通信方法的流程示意图,如图3所示,该方法主要包括以下步骤:An embodiment of the present invention provides a communication method, and the method is applied to a first LoRa terminal. FIG. 3 is a schematic flowchart of a communication method provided by an embodiment of the present invention. As shown in FIG. 3 , the method mainly includes the following steps:

步骤301、接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;Step 301: Receive a downlink signal sent by a first upper-level network device; wherein, the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate; the first upper-level network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal;

步骤302、根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;Step 302: Determine whether the first LoRa terminal itself is the target terminal according to the downlink signal;

步骤303、相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;Step 303, corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal;

步骤304、相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。Step 304 , corresponding to determining that the first LoRa terminal itself is not the target terminal, forward the downlink signal to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal.

通过图3所示的技术方案,当接收到第一上级网络设备发送的下行信号后,能够依次向下一LoRa终端转发下行信号,直至目的终端接收到下行信号,从而保障数据传输的稳定性。Through the technical solution shown in Figure 3, after receiving the downlink signal sent by the first upper-level network device, the downlink signal can be forwarded to the next LoRa terminal in turn until the destination terminal receives the downlink signal, thereby ensuring the stability of data transmission.

对于图3所示的技术方案,在一种可能的实现方式中,步骤301所述的接收第一上级网络设备发送的下行信号之后,还包括:For the technical solution shown in FIG. 3, in a possible implementation manner, after receiving the downlink signal sent by the first upper-level network device described in step 301, it further includes:

向所述第一上级网络设备发送第一应答消息;其中,所述第一应答消息用于指示第一LoRa终端接收到所述下行信号;以及,sending a first response message to the first upper-level network device; wherein, the first response message is used to indicate that the first LoRa terminal receives the downlink signal; and,

接收第一上级网络设备发送的第二应答消息;其中,所述第二应答消息用于指示第一LoRa终端与第一上级网络设备完成信号传递。A second response message sent by the first upper-level network device is received; wherein, the second response message is used to instruct the first LoRa terminal to complete signal transmission with the first upper-level network device.

需要说明的是,第一LoRa终端可能是接收的LoRa网关发送的下行信号,也可能是接收的与所述第一LoRa终端相比距离LoRa网关更近的第二LoRa终端发送的下行信号,当第一LoRa终端是距离LoRa网关最近的LoRa终端,则第一LoRa终端接收的是LoRa网关发送的下行信号,否则第一LoRa终端接收的是与第一LoRa终端相比距离LoRa网关更近的第二LoRa终端发送的下行信号。It should be noted that the first LoRa terminal may be the received downlink signal sent by the LoRa gateway, or it may be the received downlink signal sent by the second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal. The first LoRa terminal is the LoRa terminal closest to the LoRa gateway, then the first LoRa terminal receives the downlink signal sent by the LoRa gateway, otherwise the first LoRa terminal receives the second LoRa gateway that is closer to the LoRa gateway than the first LoRa terminal. Two downlink signals sent by the LoRa terminal.

举例来说,如图2所示,当第一LoRa终端是距离LoRa网关最近的LoRa终端1,则LoRa终端1是接收LoRa网关发送下行信号S1,当第一LoRa终端不是距离LoRa网关最近的LoRa终端1,比如当第一LoRa终端是LoRa终端2,则LoRa终端2是接收与LoRa终端2相比距离LoRa网关更近的LoRa终端1转发的下行信号S2。For example, as shown in Figure 2, when the first LoRa terminal is the LoRa terminal 1 closest to the LoRa gateway, the LoRa terminal 1 receives the downlink signal S1 sent by the LoRa gateway, and when the first LoRa terminal is not the closest LoRa gateway to the LoRa gateway For the terminal 1, for example, when the first LoRa terminal is the LoRa terminal 2, the LoRa terminal 2 receives the downlink signal S2 forwarded by the LoRa terminal 1 which is closer to the LoRa gateway than the LoRa terminal 2.

这里,下行信号中可以具有第一LoRa终端标识,因此,只有第一LoRa终端接收到所述下行信号后,才能向第一上级网络设备发送第一应答消息,并接收第一上级网络设备发送的第二应答消息,从而实现与第一上级网络设备的三次握手,通过三次握手确定第一LoRa终端接收到下行信号。如图2所示,当第一LoRa终端是LoRa终端1时,会接收到LoRa网关发送的下行信号S1,则LoRa终端1会向LoRa网关发送第一应答消息ACK1-1,并接收LoRa网关发送的第二应答消息ACK1-2,从而实现与LoRa网关的三次握手,确定LoRa终端1接收到下行信号S1。Here, the downlink signal may have the first LoRa terminal identifier. Therefore, only after the first LoRa terminal receives the downlink signal can it send the first response message to the first upper-level network device and receive the message sent by the first upper-level network device. The second response message, thereby realizing the three-way handshake with the first upper-level network device, and determining that the first LoRa terminal receives the downlink signal through the three-way handshake. As shown in Figure 2, when the first LoRa terminal is LoRa terminal 1, it will receive the downlink signal S1 sent by the LoRa gateway, then the LoRa terminal 1 will send the first response message ACK1-1 to the LoRa gateway, and receive the message sent by the LoRa gateway. The second response message ACK1-2, thereby realizing the three-way handshake with the LoRa gateway, determines that the LoRa terminal 1 receives the downlink signal S1.

对于图3所示的技术方案,在一种可能的实现方式中,步骤302所述的所述根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端,包括:For the technical solution shown in FIG. 3 , in a possible implementation manner, the step of determining whether the first LoRa terminal itself is the target terminal according to the downlink signal in step 302 includes:

根据所述下行信号中的目标终端标识,确定所述第一LoRa终端自身是否具有所述目标终端标识,若所述第一LoRa终端自身具有所述目标终端标识,则确定所述第一LoRa终端自身为所述目标终端。According to the target terminal identifier in the downlink signal, determine whether the first LoRa terminal itself has the target terminal identifier, and if the first LoRa terminal itself has the target terminal identifier, determine the first LoRa terminal itself is the target terminal.

举例来说,下行信号中的目标终端标识是目标终端地址,若第一LoRa终端自身地址就是下行信号中的目标终端地址,则确定所述第一LoRa终端自身为所述目标终端。For example, the target terminal identifier in the downlink signal is the target terminal address, and if the address of the first LoRa terminal itself is the target terminal address in the downlink signal, the first LoRa terminal itself is determined to be the target terminal.

对于图3所示的技术方案,步骤303所述的相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令,需要说明的是,当确定了所述第一LoRa终端自身是所述目标终端,则执行所述下行信号中的所述操作指令。例如下行信号中的操作指令是目标终端亮灯指令,则当确定了第一LoRa终端自身是目标终端,则第一LoRa终端会进行相应的亮灯处理。For the technical solution shown in FIG. 3 , step 303 corresponds to determining that the first LoRa terminal itself is the target terminal and executing the operation instruction in the downlink signal. It should be noted that when it is determined that the first LoRa terminal itself is the target terminal If the first LoRa terminal itself is the target terminal, the operation instruction in the downlink signal is executed. For example, the operation command in the downlink signal is the target terminal lighting command, and when it is determined that the first LoRa terminal itself is the target terminal, the first LoRa terminal will perform corresponding lighting processing.

对于图3所示的技术方案,步骤304所述的相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端包括:For the technical solution shown in FIG. 3 , step 304 corresponds to determining that the first LoRa terminal itself is not the target terminal, and forwarding the downlink signal to a distance from the LoRa terminal compared to the first LoRa terminal A third LoRa terminal further from the gateway includes:

按照预设的信号转发策略,获取与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端,并将所述下行信号转发至所述第三LoRa终端。According to a preset signal forwarding strategy, a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal is obtained, and the downlink signal is forwarded to the third LoRa terminal.

或者,在第一LoRa终端自身的地址上进行自增,获取与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端的地址,并将所述下行信号转发至所述第三LoRa终端。Or, perform auto-increment on the address of the first LoRa terminal itself, obtain the address of a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal, and forward the downlink signal to the The third LoRa terminal.

具体地,当确定所述第一LoRa终端自身不是所述目标终端,在第一LoRa终端自身的地址上进行自增,获取与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端的地址,并将所述下行信号转发至所述第三LoRa终端,其中转发下行信号中的信号可以有第三LoRa终端的地址,还可以有转发标识,也就是用于标识转发至第三LoRa终端的信号是转发的下行信号。Specifically, when it is determined that the first LoRa terminal itself is not the target terminal, auto-increment is performed on the address of the first LoRa terminal itself, and the first LoRa terminal that is farther away from the LoRa gateway is obtained than the first LoRa terminal. The address of the third LoRa terminal, and the downlink signal is forwarded to the third LoRa terminal, wherein the signal in the forwarded downlink signal may have the address of the third LoRa terminal, and may also have a forwarding identifier, which is used to identify the forwarding to The signal of the third LoRa terminal is the forwarded downlink signal.

举例来说,如图2所示,当第一LoRa终端是LoRa终端1,并不是目的终端,由于LoRa终端1自身的地址是0x01,则LoRa终端1会在自身地址的基础上进行自增,获得地址0x02,也就是与LoRa终端1相比距离LoRa网关更远的第三LoRa终端的地址,也就是LoRa终端2,在下行信号中携带LoRa终端2的地址,形成下行信号S2,并将所述下行信号S2转发至LoRa终端2。For example, as shown in Figure 2, when the first LoRa terminal is LoRa terminal 1, not the destination terminal, since the address of LoRa terminal 1 itself is 0x01, LoRa terminal 1 will auto-increment on the basis of its own address. Obtain address 0x02, that is, the address of the third LoRa terminal farther from the LoRa gateway than LoRa terminal 1, that is, LoRa terminal 2, carry the address of LoRa terminal 2 in the downlink signal, form downlink signal S2, and transfer all The downlink signal S2 is forwarded to the LoRa terminal 2 .

对于图3所示的技术方案,步骤304所述的相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端包括:For the technical solution shown in FIG. 3 , step 304 corresponds to determining that the first LoRa terminal itself is not the target terminal, and forwarding the downlink signal to a distance from the LoRa terminal compared to the first LoRa terminal A third LoRa terminal further from the gateway includes:

将所述下行信号转发至第四LoRa终端;其中,所述第四LoRa终端是距离所述第一LoRa终端最近且与所述第一LoRa终端相比距离LoRa网关更远的终端;forwarding the downlink signal to a fourth LoRa terminal; wherein, the fourth LoRa terminal is the terminal closest to the first LoRa terminal and farther from the LoRa gateway than the first LoRa terminal;

确定是否接收到所述第四LoRa终端发送的第三应答消息;其中,所述第三应答消息用于指示所述第四LoRa终端接收到所述下行信号;Determine whether the third response message sent by the fourth LoRa terminal is received; wherein, the third response message is used to indicate that the fourth LoRa terminal receives the downlink signal;

相应于确定所述第一LoRa终端接收到所述第四LoRa终端发送的第三应答消息,向所述第四LoRa终端发送第四应答消息;其中,所述第四应答消息用于指示第一LoRa终端与第四LoRa终端完成信号传递;Corresponding to determining that the first LoRa terminal receives the third response message sent by the fourth LoRa terminal, a fourth response message is sent to the fourth LoRa terminal; wherein, the fourth response message is used to indicate the first The LoRa terminal and the fourth LoRa terminal complete signal transmission;

相应于确定所述第一LoRa终端没有接收到所述第四LoRa终端发送的第三应答消息,将所述下行信号转发至第五LoRa终端;其中,所述第五LoRa终端是距离所述第一LoRa终端次近且与所述第一LoRa终端相比距离LoRa网关更远的终端。Corresponding to determining that the first LoRa terminal has not received the third response message sent by the fourth LoRa terminal, the downlink signal is forwarded to the fifth LoRa terminal; wherein, the fifth LoRa terminal is a distance from the third LoRa terminal. A LoRa terminal is the next closest terminal and is farther from the LoRa gateway than the first LoRa terminal.

需要说明的是,所述第三LoRa终端是第四LoRa终端或者第五LoRa终端,首先向第四LoRa终端转发下行信号,若第四LoRa终端没有接收到下行信号,则向第五LoRa终端转发下行信号。It should be noted that the third LoRa terminal is the fourth LoRa terminal or the fifth LoRa terminal. First, the downlink signal is forwarded to the fourth LoRa terminal. If the fourth LoRa terminal does not receive the downlink signal, it is forwarded to the fifth LoRa terminal. Downlink signal.

举例来说,如图2所示,当第一LoRa终端是LoRa终端1,则LoRa终端1在确认接收LoRa网关发送的下行信号S1后,首先将下行信号S2转发至距离所述LoRa终端1最近且与LoRa终端1相比距离LoRa网关更远的LoRa终端2,当LoRa终端1确认接收到LoRa终端2发送的应答消息ACK2-1后,LoRa终端1就向LoRa终端2发送应答消息ACK2-2,实现与LoRa终端2的三次握手;当LoRa终端1没有接收到LoRa终端2发送的应答消息ACK2-1,则LoRa终端1将所述下行信号转发至距离LoRa终端1次近且与LoRa终端1相比距离LoRa网关更远的LoRa终端3。For example, as shown in FIG. 2 , when the first LoRa terminal is LoRa terminal 1, LoRa terminal 1 first forwards the downlink signal S2 to the nearest LoRa terminal 1 after confirming to receive the downlink signal S1 sent by the LoRa gateway. And LoRa terminal 2, which is farther from the LoRa gateway than LoRa terminal 1, when LoRa terminal 1 confirms receipt of the response message ACK2-1 sent by LoRa terminal 2, LoRa terminal 1 sends response message ACK2-2 to LoRa terminal 2 , realize the three-way handshake with LoRa terminal 2; when LoRa terminal 1 does not receive the response message ACK2-1 sent by LoRa terminal 2, then LoRa terminal 1 forwards the downlink signal to the LoRa terminal 1 time close to the LoRa terminal 1 Compared to the LoRa terminal 3 which is farther from the LoRa gateway.

对于图3所示的技术方案,步骤301-304是LoRa网关向LoRa终端传递下行信号的过程,在一种可能的实现方式中,图3所示的技术方案还包括LoRa终端向LoRa网关传递上行信号的过程,如图4所示,图4中的技术方案包括:For the technical solution shown in FIG. 3, steps 301-304 are the process of the LoRa gateway transmitting the downlink signal to the LoRa terminal. In a possible implementation, the technical solution shown in FIG. 3 also includes the LoRa terminal transmitting the uplink signal to the LoRa gateway. The process of the signal is shown in Figure 4. The technical solution in Figure 4 includes:

步骤401、接收第二上级网络设备发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;所述第二上级网络设备是与所述第一LoRa终端相比距离所述LoRa网关更远的第六LoRa终端;Step 401, receiving an uplink signal sent by a second upper-level network device; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway; the second upper-level network device is the same as the second upper-level network device. A LoRa terminal is farther from the LoRa gateway than the sixth LoRa terminal;

步骤402、根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关;Step 402: Determine whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal;

步骤403、相应于确定所述第一LoRa终端自身不是所述LoRa网关,将所述上行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端。Step 403 , corresponding to determining that the first LoRa terminal itself is not the LoRa gateway, forward the uplink signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal.

对于图4所示的技术方案,步骤401所述的接收第二上级网络设备发送的上行信号包括:For the technical solution shown in FIG. 4 , the step of receiving the uplink signal sent by the second upper-level network device in step 401 includes:

向所述第二上级网络设备发送第五应答消息;其中,所述第五应答消息用于指示第一LoRa终端接收到所述上行信号;Send a fifth response message to the second upper-level network device; wherein, the fifth response message is used to indicate that the first LoRa terminal receives the uplink signal;

接收所述第二上级网络设备发送的第六应答消息;其中,所述第六应答消息用于指示第一LoRa终端与所述第二上级网络设备完成信号传递。A sixth response message sent by the second upper-level network device is received; wherein, the sixth response message is used to instruct the first LoRa terminal and the second upper-level network device to complete signal transmission.

需要说明的是,第一LoRa终端可能是接收的与所述第一LoRa终端相比距离所述LoRa网关更远的第六LoRa终端发送的上行信号。图5是LoRa终端向LoRa网关上报信号的示意图,如图5所示,当LoRa终端3是第二上级网络设备,第一LoRa终端是LoRa终端2,LoRa终端3向LoRa网关发送上行信号,则LoRa终端2会接收LoRa终端3发送的上行信号。It should be noted that the first LoRa terminal may receive an uplink signal sent by a sixth LoRa terminal that is farther away from the LoRa gateway than the first LoRa terminal. Figure 5 is a schematic diagram of the LoRa terminal reporting signals to the LoRa gateway. As shown in Figure 5, when the LoRa terminal 3 is the second upper-level network device, the first LoRa terminal is the LoRa terminal 2, and the LoRa terminal 3 sends an uplink signal to the LoRa gateway, then LoRa terminal 2 will receive the uplink signal sent by LoRa terminal 3.

另外,上行信号中还可以具有第一LoRa终端标识,因此,只有第一LoRa终端接收到所述上行信号后,才能向第二上级网络设备发送第五应答消息,并接收第二上级网络设备发送的第六应答消息,从而实现与第二上级网络设备的三次握手,通过三次握手确定第一LoRa终端接收到上行信号。In addition, the uplink signal may also have the first LoRa terminal identifier. Therefore, only after the first LoRa terminal receives the uplink signal, it can send the fifth response message to the second upper-level network device, and receive the second upper-level network device. The sixth response message, thereby realizing the three-way handshake with the second upper-level network device, and determining that the first LoRa terminal receives the uplink signal through the three-way handshake.

举例来说,如图5所示,当第一LoRa终端是LoRa终端2时,会接收到LoRa终端3发送的上行信号S-P1,则LoRa终端2会向LoRa终端3发送第五应答消息ACK-P1-1,并接收LoRa终端3发送的第六应答消息ACK-P1-2,从而实现与LoRa终端3的三次握手,确定LoRa终端1接收到上行信号S-P1。For example, as shown in Figure 5, when the first LoRa terminal is LoRa terminal 2, it will receive the uplink signal S-P1 sent by LoRa terminal 3, then LoRa terminal 2 will send the fifth response message ACK to LoRa terminal 3 -P1-1, and receive the sixth response message ACK-P1-2 sent by the LoRa terminal 3, so as to realize the three-way handshake with the LoRa terminal 3, and determine that the LoRa terminal 1 has received the uplink signal S-P1.

对于图4所示的技术方案,步骤402所述的根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关包括:For the technical solution shown in FIG. 4 , determining whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal in step 402 includes:

根据所述上行信号中的LoRa网关标识,确定所述第一LoRa终端自身是否具有所述LoRa网关标识,若所述第一LoRa终端自身不具有所述目标终端标识,则确定所述第一LoRa终端自身不是所述LoRa网关。According to the LoRa gateway identifier in the uplink signal, determine whether the first LoRa terminal itself has the LoRa gateway identifier, and if the first LoRa terminal itself does not have the target terminal identifier, determine whether the first LoRa terminal itself has the target terminal identifier. The terminal itself is not the LoRa gateway.

举例来说,上行信号中的LoRa网关标识是LoRa网关地址,若第一LoRa终端自身地址不是上行信号中的LoRa网关地址,则确定所述第一LoRa终端自身不是所述LoRa网关。For example, the LoRa gateway identifier in the uplink signal is the LoRa gateway address, and if the address of the first LoRa terminal itself is not the LoRa gateway address in the uplink signal, it is determined that the first LoRa terminal itself is not the LoRa gateway.

对于图4所示的技术方案,步骤403所述的根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关包括:For the technical solution shown in FIG. 4 , determining whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal in step 403 includes:

按照预设的信号转发策略,获取与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。According to a preset signal forwarding strategy, the address of a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal is obtained, and the uplink signal is forwarded to the seventh LoRa terminal.

或者,在第一LoRa终端自身的地址上进行自减,获取与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。Or, perform self-decrement on the address of the first LoRa terminal itself, obtain the address of the seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal, and forward the uplink signal to the The seventh LoRa terminal.

具体地,当确定所述第一LoRa终端自身不是所述LoRa网关,在第一LoRa终端自身的地址上进行自减,获取与所述第一LoRa终端相比距离所述LoRa网关更近的第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端,其中转发上行信号中的信号可以有第七LoRa终端的地址,还可以有转发标识,也就是用于标识转发至第七LoRa终端的信号是转发的上行信号。Specifically, when it is determined that the first LoRa terminal itself is not the LoRa gateway, the address of the first LoRa terminal itself is decremented to obtain the first LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal. The address of the seventh LoRa terminal, and the uplink signal is forwarded to the seventh LoRa terminal, wherein the signal in the forwarded uplink signal may have the address of the seventh LoRa terminal, and may also have a forwarding identifier, that is, it is used to identify the forwarding to The signal of the seventh LoRa terminal is the forwarded uplink signal.

举例来说,如图5所示,当第一LoRa终端是LoRa终端2,并不是LoRa网关,由于LoRa终端2自身的地址是0x02,则LoRa终端2会在自身地址的基础上进行自减,获得地址0x01,也就是与LoRa终端2相比距离LoRa网关更近的第七LoRa终端的地址,也就是LoRa终端1,在上行信号中携带LoRa终端1的地址,形成上行信号S2,并将所述上行信号S2转发至LoRa终端1。For example, as shown in Figure 5, when the first LoRa terminal is LoRa terminal 2, not a LoRa gateway, since the address of LoRa terminal 2 itself is 0x02, then LoRa terminal 2 will decrement itself based on its own address, Obtain the address 0x01, that is, the address of the seventh LoRa terminal that is closer to the LoRa gateway than LoRa terminal 2, that is, LoRa terminal 1, carry the address of LoRa terminal 1 in the uplink signal, form the uplink signal S2, and connect all The uplink signal S2 is forwarded to the LoRa terminal 1 .

对于图4所示的技术方案,步骤403所述的根据所述上行信号确定所述第一LoRa终端自身是否为所述LoRa网关包括:For the technical solution shown in FIG. 4 , determining whether the first LoRa terminal itself is the LoRa gateway according to the uplink signal in step 403 includes:

将所述上行信号转发至第八LoRa终端;其中,所述第八LoRa终端是距离所述第一LoRa终端最近且与所述第一LoRa终端相比距离LoRa网关更近的终端;forwarding the uplink signal to the eighth LoRa terminal; wherein, the eighth LoRa terminal is the terminal closest to the first LoRa terminal and closer to the LoRa gateway than the first LoRa terminal;

确定是否接收到所述第八LoRa终端发送的第七应答消息;其中,所述第七应答消息用于指示所述第八LoRa终端接收到所述上行信号;Determine whether the seventh response message sent by the eighth LoRa terminal is received; wherein, the seventh response message is used to indicate that the eighth LoRa terminal receives the uplink signal;

相应于确定所述第一LoRa终端接收到所述第八LoRa终端发送的第七应答消息,向所述第八LoRa终端发送第八应答消息;其中,所述第八应答消息用于指示第一LoRa终端与第八LoRa终端完成信号传递;Corresponding to determining that the first LoRa terminal has received the seventh response message sent by the eighth LoRa terminal, an eighth response message is sent to the eighth LoRa terminal; wherein, the eighth response message is used to indicate the first The LoRa terminal and the eighth LoRa terminal complete signal transmission;

相应于确定所述第一LoRa终端没有接收到所述第八LoRa终端发送的第七应答消息,将所述上行信号转发至第九LoRa终端;其中,所述第九LoRa终端是距离所述第一LoRa终端次近且与所述第一LoRa终端相比距离LoRa网关更近的终端。Corresponding to determining that the first LoRa terminal has not received the seventh response message sent by the eighth LoRa terminal, the uplink signal is forwarded to the ninth LoRa terminal; wherein, the ninth LoRa terminal is a distance from the seventh LoRa terminal. A LoRa terminal is the next closest terminal and is closer to the LoRa gateway than the first LoRa terminal.

这里,所述第七LoRa终端是第八LoRa终端或者第九LoRa终端,首先向距离所述第一LoRa终端最近且与所述第一LoRa终端相比距离LoRa网关更近的第八LoRa终端转发上行信号,若第八LoRa终端没有接收到上行信号,则向距离所述第一LoRa终端次近且与所述第一LoRa终端相比距离LoRa网关更近的第九LoRa终端转发上行信号。Here, the seventh LoRa terminal is the eighth LoRa terminal or the ninth LoRa terminal, and is first forwarded to the eighth LoRa terminal that is closest to the first LoRa terminal and closer to the LoRa gateway than the first LoRa terminal For the uplink signal, if the eighth LoRa terminal does not receive the uplink signal, it forwards the uplink signal to the ninth LoRa terminal that is the second closest to the first LoRa terminal and closer to the LoRa gateway than the first LoRa terminal.

本发明实施例提供了一种通信方法,接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。从而能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的问题,保证了LoRa网络在传输数据时的稳定性。An embodiment of the present invention provides a communication method for receiving a downlink signal sent by a first upper-level network device; wherein the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate; the first The upper-level network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal; according to the downlink signal, determine whether the first LoRa terminal itself is the target terminal; Corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal; Corresponding to determining that the first LoRa terminal itself is not the target terminal, forward the downlink signal to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal. Therefore, it can solve the problem that the LoRa network deployment cost is high, and the data is easily lost due to the long distance or other interference, and the stability of data transmission cannot be guaranteed, and the stability of the LoRa network when transmitting data can be ensured.

实施例二Embodiment 2

本发明实施例提供实现一种通信方法,所述方法应用于LoRa网关,图6为本发明实施例提供的一种通信方法的流程示意图,如图6所示,该方法主要包括以下步骤:An embodiment of the present invention provides a communication method, and the method is applied to a LoRa gateway. FIG. 6 is a schematic flowchart of a communication method provided by an embodiment of the present invention. As shown in FIG. 6 , the method mainly includes the following steps:

步骤601、从所述LoRa网关自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;Step 601, from the LoRa terminals under the jurisdiction of the LoRa gateway itself, determine the LoRa terminal with the highest order according to a preset sorting strategy;

步骤602、生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;Step 602, generating a downlink signal; wherein, the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate;

步骤603、向所述顺序最高的LoRa终端发送所述下行信号。Step 603: Send the downlink signal to the LoRa terminal with the highest order.

对于图6所示的技术方案,步骤601所述的从所述LoRa网关自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端,需要说明的是,如图2所示,其中LoRa终端1,LoRa终端2,…,LoRa终端120都是LoRa网关所辖的LoRa终端,将其按照地址顺序进行排序,选取距离LoRa网关最近的LoRa终端1,也就是顺序最高的LoRa终端。For the technical solution shown in FIG. 6 , in step 601, the LoRa terminal with the highest order is determined from the LoRa terminals under the jurisdiction of the LoRa gateway itself according to the preset sorting strategy. It should be noted that, as shown in FIG. 2 , among which LoRa terminal 1, LoRa terminal 2, ..., LoRa terminal 120 are all LoRa terminals under the jurisdiction of the LoRa gateway, sort them in the order of addresses, and select the LoRa terminal 1 closest to the LoRa gateway, that is, the LoRa terminal with the highest order .

对于图6所示的技术方案,步骤602所述的生成下行信号,需要说明的是,所述目标终端标识可以是目标终端的地址,所述操作指令可以是指示目标终端进行亮灯等操作的指令。For the technical solution shown in FIG. 6 , in the generation of the downlink signal in step 602, it should be noted that the target terminal identifier may be the address of the target terminal, and the operation instruction may be to instruct the target terminal to perform operations such as turning on the lights. instruction.

对于图6所示的技术方案,在一种可能的实现方式中,步骤603所述的向所述顺序最高的LoRa终端发送所述上行信号还包括:For the technical solution shown in FIG. 6, in a possible implementation manner, the step of sending the uplink signal to the LoRa terminal with the highest order in step 603 further includes:

接收所述顺序最高的LoRa终端发送的第九应答消息;其中,所述第九应答消息用于指示所述顺序最高的LoRa终端接收到所述下行信号;以及,Receive the ninth response message sent by the LoRa terminal with the highest order; wherein, the ninth response message is used to indicate that the LoRa terminal with the highest order receives the downlink signal; and,

向所述顺序最高的LoRa终端发送第十应答消息;其中,所述第十应答消息用于指示所述LoRa网关与所述顺序最高的LoRa终端完成信号传递。Send a tenth response message to the LoRa terminal with the highest order; wherein, the tenth response message is used to instruct the LoRa gateway and the LoRa terminal with the highest order to complete signal transmission.

需要说明的是,在向所述顺序最高的LoRa终端发送所述下行信号之后,可以接收所述顺序最高的LoRa终端发送的第九应答消息;以及,向所述顺序最高的LoRa终端发送第十应答消息,从而实现与顺序最高的LoRa终端的三次握手,通过三次握手确定顺序最高的LoRa终端接收到下行信号。如图2所示,当顺序最高的LoRa终端是LoRa终端1,LoRa网关向LoRa终端1发送下行信号之后会接收到LoRa终端1发送的应答消息ACK1-1,则LoRa网关会向LoRa终端1发送应答消息ACK1-2,从而实现与LoRa终端1的三次握手,确定LoRa终端1接收到下行信号S1。It should be noted that, after sending the downlink signal to the LoRa terminal with the highest order, the ninth response message sent by the LoRa terminal with the highest order can be received; and, sending the tenth response message to the LoRa terminal with the highest order Response message, so as to realize the three-way handshake with the LoRa terminal with the highest order, and determine that the LoRa terminal with the highest order receives the downlink signal through the three-way handshake. As shown in Figure 2, when the LoRa terminal with the highest order is LoRa terminal 1, the LoRa gateway will receive the response message ACK1-1 sent by LoRa terminal 1 after sending the downlink signal to LoRa terminal 1, then the LoRa gateway will send to LoRa terminal 1. Respond to the message ACK1-2, thereby realizing the three-way handshake with the LoRa terminal 1, and confirming that the LoRa terminal 1 has received the downlink signal S1.

对于图6所示的技术方案,步骤601-603是LoRa网关向LoRa终端传递下行信号的过程,在一种可能的实现方式中,图6所示的技术方案还包括LoRa终端向LoRa网关传递上行信号的过程,如图7所示,图7中的技术方案包括:For the technical solution shown in Figure 6, steps 601-603 are the process of the LoRa gateway transmitting downlink signals to the LoRa terminal. In a possible implementation, the technical solution shown in Figure 6 also includes the LoRa terminal transmitting the uplink signal to the LoRa gateway. The process of the signal is shown in Figure 7, and the technical solution in Figure 7 includes:

步骤701、接收所述顺序最高的LoRa终端发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令。Step 701: Receive an uplink signal sent by the LoRa terminal with the highest order; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway.

步骤702、根据所述上行信号确定所述LoRa网关自身是否为所述LoRa网关。Step 702: Determine whether the LoRa gateway itself is the LoRa gateway according to the uplink signal.

步骤703、相应于确定所述LoRa网关自身是所述LoRa网关,获得所述上行信号中的所述上报指令。Step 703, corresponding to determining that the LoRa gateway itself is the LoRa gateway, obtain the reporting instruction in the uplink signal.

对于图7所示的技术方案,步骤701所述的接收所述顺序最高的LoRa终端发送的上行信号还包括:For the technical solution shown in FIG. 7, the step 701 of receiving the uplink signal sent by the LoRa terminal with the highest order also includes:

向所述顺序最高的LoRa终端发送第十一应答消息;其中,所述第十一应答消息用于指示所述LoRa网关接收到所述上行信号;以及,Send an eleventh response message to the LoRa terminal with the highest order; wherein, the eleventh response message is used to indicate that the LoRa gateway receives the uplink signal; and,

接收所述顺序最高的LoRa终端发送的第十二应答消息;其中,所述第十二应答消息用于指示所述LoRa网关与所述顺序最高的LoRa终端完成信号传递。Receive the twelfth response message sent by the LoRa terminal with the highest order; wherein, the twelfth response message is used to instruct the LoRa gateway and the LoRa terminal with the highest order to complete signal transmission.

另外,在接收所述顺序最高的LoRa终端发送的上行信号之后,可以向所述顺序最高的LoRa终端发送第十一应答消息;以及,接收所述顺序最高的LoRa终端发送的第十二应答消息,从而实现与顺序最高的LoRa终端的三次握手,通过三次握手确定LoRa网关接收到上行信号。如图5所示,当顺序最高的LoRa终端是LoRa终端1,LoRa网关接收LoRa终端1发送的上行信号S4之后,向LoRa终端1发送应答消息ACK4-1,并接收到LoRa终端1发送的应答消息ACK4-2,从而实现与LoRa终端1的三次握手,确定LoRa网关接收到上行信号S4。In addition, after receiving the uplink signal sent by the LoRa terminal with the highest order, an eleventh response message may be sent to the LoRa terminal with the highest order; and, receiving the twelfth response message sent by the LoRa terminal with the highest order , so as to realize the three-way handshake with the LoRa terminal with the highest order, and determine that the LoRa gateway receives the uplink signal through the three-way handshake. As shown in Figure 5, when the LoRa terminal with the highest order is LoRa terminal 1, after the LoRa gateway receives the uplink signal S4 sent by LoRa terminal 1, it sends a response message ACK4-1 to LoRa terminal 1, and receives the response sent by LoRa terminal 1. message ACK4-2, thereby realizing the three-way handshake with the LoRa terminal 1, and confirming that the LoRa gateway has received the uplink signal S4.

对于图7所示的技术方案,步骤702所述的根据所述上行信号确定所述LoRa网关自身是否为所述LoRa网关,需要说明的是,根据所述上行信号中的LoRa网关标识,确定所述LoRa网关自身是否具有所述LoRa网关标识,若所述LoRa网关自身具有所述目标终端标识,则确定所述LoRa网关自身是所述LoRa网关。例如,上行信号中的LoRa网关标识是LoRa网关地址,若LoRa网关自身地址是上行信号中的LoRa网关地址,则确定所述LoRa网关自身是所述LoRa网关。For the technical solution shown in FIG. 7 , in step 702, determining whether the LoRa gateway itself is the LoRa gateway according to the uplink signal, it should be noted that, according to the LoRa gateway identifier in the uplink signal, determine the LoRa gateway itself. Whether the LoRa gateway itself has the LoRa gateway identifier, if the LoRa gateway itself has the target terminal identifier, it is determined that the LoRa gateway itself is the LoRa gateway. For example, the LoRa gateway identifier in the uplink signal is the LoRa gateway address, and if the address of the LoRa gateway itself is the LoRa gateway address in the uplink signal, it is determined that the LoRa gateway itself is the LoRa gateway.

对于图7所示的技术方案,步骤703所述的相应于确定所述LoRa网关自身是所述LoRa网关,获得所述上行信号中的所述上报指令,需要说明的是,当确认所述LoRa网关自身是所述LoRa网关,则获得所述上行信号中的所述上报指令,可以记录下所述上行信号中的所述上报指令,也可以向服务器发送所述上行信号中的所述上报指令。For the technical solution shown in FIG. 7 , step 703 corresponds to determining that the LoRa gateway itself is the LoRa gateway, and obtaining the reporting instruction in the uplink signal. It should be noted that when the LoRa gateway is confirmed If the gateway itself is the LoRa gateway, it obtains the reporting instruction in the uplink signal, and can record the reporting instruction in the uplink signal, or send the reporting instruction in the uplink signal to the server. .

本发明实施例提供了一种通信方法,从所述LoRa网关自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;向所述顺序最高的LoRa终端发送所述下行信号。从而能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的问题,保证了LoRa网络在传输数据时的稳定性。The embodiment of the present invention provides a communication method. From the LoRa terminals under the LoRa gateway itself, the LoRa terminal with the highest order is determined according to a preset sorting strategy; a downlink signal is generated; wherein, the downlink signal includes a target terminal an identifier and an operation instruction for instructing the target terminal to operate; sending the downlink signal to the LoRa terminal with the highest order. Therefore, it can solve the problem that the LoRa network deployment cost is high, and the data is easily lost due to the long distance or other interference, and the stability of data transmission cannot be guaranteed, and the stability of the LoRa network when transmitting data can be ensured.

实施例三Embodiment 3

本发明实施例实现一种通信方法,图8为本发明实施例提供的一种通信方法的示意图,如图8所示,该方法主要包括以下步骤:An embodiment of the present invention implements a communication method, and FIG. 8 is a schematic diagram of a communication method provided by an embodiment of the present invention. As shown in FIG. 8 , the method mainly includes the following steps:

步骤801、LoRa网关向LoRa终端1发送信号S1,其中,信号S1中包含LoRa目的终端地址、信号传递结束标识以及操作指令,其中信号传递结束标识用于判断当前接收到信号的LoRa终端是否是LoRa目的终端,如果判断是LoRa目的终端地址,则结束信号的传递过程。Step 801, the LoRa gateway sends a signal S1 to the LoRa terminal 1, wherein the signal S1 includes the LoRa destination terminal address, the signal transmission end identification and the operation instruction, wherein the signal transmission end identification is used to judge whether the LoRa terminal currently receiving the signal is a LoRa The destination terminal, if it is determined to be the LoRa destination terminal address, the signal transmission process is ended.

这里,信号S1属于LoRa网关向LoRa终端发送的下行信号。Here, the signal S1 belongs to the downlink signal sent by the LoRa gateway to the LoRa terminal.

需要说明的是,所述信号传递结束标识可以是唯一确认当前接收到信号的LoRa终端是LoRa目的终端的标识,当确认当前接收到信号的LoRa终端是LoRa目的终端后,接收到信号的LoRa终端就不会向其他的LoRa终端转发信号,结束信号的传递过程,但是当确认当前接收到信号的LoRa终端不是LoRa目的终端后,就会向其他的LoRa终端转发信号,继续信号的传递过程。It should be noted that the signal transmission end identifier may be the identifier that uniquely confirms that the LoRa terminal that currently receives the signal is the LoRa destination terminal. After confirming that the LoRa terminal that currently receives the signal is the LoRa destination terminal, the LoRa terminal that receives the signal It will not forward the signal to other LoRa terminals and end the signal transmission process, but when it is confirmed that the LoRa terminal currently receiving the signal is not the LoRa destination terminal, it will forward the signal to other LoRa terminals and continue the signal transmission process.

此外,所述操作指令可以是服务器指示目的终端进行具体操作的命令,比如用来指示目的终端进行亮灯等操作,因此只有当确认了当前接收到信号的LoRa终端是LoRa目的终端后,当前LoRa终端才能进行相应的操作处理,但是也可以是任何LoRa终端接收到信号后,就可以进行相应的操作处理。In addition, the operation instruction may be a command for the server to instruct the destination terminal to perform a specific operation, such as instructing the destination terminal to perform operations such as turning on the light. Therefore, only after it is confirmed that the LoRa terminal that currently receives the signal is the LoRa destination terminal, the current LoRa terminal Only the terminal can perform the corresponding operation processing, but it can also be any LoRa terminal that can perform the corresponding operation processing after receiving the signal.

这里,LoRa网关可以在信道中广播信号S1,所述广播信号S1就是LoRa网关会向处在信道中的LoRa终端发送信号S1,但是处在信道中的LoRa终端可能接收得到信号S1,也可能接收不到信号S1,尤其是距离LoRa网关比较远的LoRa终端可能因为距离等外界因素会接收不到信号S1,从所述LoRa网关自身所辖的LoRa终端中,按照预设的排序策略进行排序,地址越大的LoRa终端距离LoRa网关越远。但是,LoRa终端1是最接近LoRa网关的终端,是可以接收到信号S1的。而且当LoRa网关在信道中广播消息后,只有LoRa终端1会与LoRa网关实现三次握手,其他的LoRa终端接收到信号S1后,不会与LoRa网关实现三次握手,忽略信号S1。其中,具体的三次握手的实现过程可以参见后续步骤802-803,通过三次握手能够使LoRa网关确定LoRa终端1成功接收到信号S1。Here, the LoRa gateway can broadcast the signal S1 in the channel, and the broadcast signal S1 is that the LoRa gateway will send the signal S1 to the LoRa terminal in the channel, but the LoRa terminal in the channel may receive the signal S1, or it may receive the signal S1. If the signal S1 is not available, especially the LoRa terminal that is far away from the LoRa gateway may not receive the signal S1 due to external factors such as distance. The LoRa terminal with a larger address is farther away from the LoRa gateway. However, LoRa terminal 1 is the terminal closest to the LoRa gateway and can receive signal S1. And when the LoRa gateway broadcasts the message in the channel, only the LoRa terminal 1 will implement the three-way handshake with the LoRa gateway. After other LoRa terminals receive the signal S1, they will not implement the three-way handshake with the LoRa gateway and ignore the signal S1. The specific implementation process of the three-way handshake can refer to the subsequent steps 802-803, and through the three-way handshake, the LoRa gateway can determine that the LoRa terminal 1 has successfully received the signal S1.

以LoRa网络为基础的智慧路灯方案为例,图10为本发明实施例提供的以LoRa网络为基础的智慧路灯示意图,如图10所示,所述控制模块包含一个LoRa网关和一个能见度仪,且控制模块与LoRa终端1所在的路灯距离尽可能近(本实例中间隔0.5m),其中LoRa终端1是与控制模块距离最近的LoRa终端,而每一盏路灯包括一个LoRa终端以及微控制单元MCU和照明灯。每一盏路灯之间的间隔为25m,每一个LoRa网关最多控制256盏路灯,当超过256盏路灯时可以新增一个控制模块,也就是新增一个LoRa网关。Taking a LoRa network-based smart street light solution as an example, FIG. 10 is a schematic diagram of a LoRa network-based smart street light provided by an embodiment of the present invention. As shown in FIG. 10 , the control module includes a LoRa gateway and a visibility meter. And the distance between the control module and the street lamp where LoRa terminal 1 is located is as close as possible (0.5m in this example), where LoRa terminal 1 is the closest LoRa terminal to the control module, and each street lamp includes a LoRa terminal and a microcontroller unit MCU and lighting. The interval between each street light is 25m, and each LoRa gateway can control up to 256 street lights. When there are more than 256 street lights, a new control module can be added, that is, a new LoRa gateway can be added.

在智慧路灯工作前,将所有的LoRa通信模块的通信信道设置为信道10,空中速率为4.8Kbps,当然根据需要,也可以将信道和空中速率设置为其他的值。在智慧路灯工作时,控制模块中的能见度仪能定时采集能见度信息,并上传能见度信息至远程服务器,当远程服务器根据能见度信息向LoRa网关发出亮灯命令时,LoRa网关就会发送亮灯信号以通知这120盏灯全部亮光。当LoRa网关选择最后一个LoRa终端(即LoRa终端120)的地址为目的地址发送亮灯信号S1,这里,并不是仅仅只向LoRa终端120发送亮灯信号S1,而是向在信道10中所有的设备发送亮灯信号S1,则所有能够接收到信号S1的路灯就会点亮。此时,无论距离LoRa网关比较远的LoRa终端是否接收到信号S1,距离LoRa网关最近的LoRa终端1可以接收到信号S1,并且LoRa终端1所在的路灯开始与LoRa网关进行三次握手。Before the smart street light works, set the communication channel of all LoRa communication modules to channel 10 and the air rate to 4.8Kbps. Of course, the channel and air rate can also be set to other values as needed. When the smart street light is working, the visibility meter in the control module can collect the visibility information regularly, and upload the visibility information to the remote server. Notice that all 120 lights are on. When the LoRa gateway selects the address of the last LoRa terminal (ie, the LoRa terminal 120 ) as the destination address to send the light-on signal S1, here, it is not just to send the light-on signal S1 to the LoRa terminal 120, but to all the channels in the channel 10. When the device sends the light signal S1, all the street lights that can receive the signal S1 will light up. At this time, regardless of whether the LoRa terminal farther from the LoRa gateway receives the signal S1, the LoRa terminal 1 closest to the LoRa gateway can receive the signal S1, and the street lamp where the LoRa terminal 1 is located begins to shake hands with the LoRa gateway three times.

步骤802、LoRa终端1接收到信号S1后,向LoRa网关发送第一应答消息。Step 802: After receiving the signal S1, the LoRa terminal 1 sends a first response message to the LoRa gateway.

需要说明的是,不管LoRa目的终端是否接收到信号S1,当LoRa终端1接收到信号S1后,会向LoRa网关发送第一应答消息,所述第一应答消息是用于标识LoRa终端1接收到了信号S1。It should be noted that, regardless of whether the LoRa destination terminal receives the signal S1 or not, when the LoRa terminal 1 receives the signal S1, it will send a first response message to the LoRa gateway, and the first response message is used to identify that the LoRa terminal 1 has received it. signal S1.

步骤803、LoRa网关接收到第一应答消息后,向LoRa终端1发送第二应答消息。Step 803 , after receiving the first response message, the LoRa gateway sends the second response message to the LoRa terminal 1 .

这里,LoRa网关接收到LoRa终端1发送的第一应答消息后,会向LoRa终端1发送第二应答消息,所述第二应答消息用于标识LoRa网关向LoRa终端1发送信号工作完成。Here, after receiving the first response message sent by the LoRa terminal 1, the LoRa gateway will send a second response message to the LoRa terminal 1, and the second response message is used to identify the completion of the work of the LoRa gateway sending the signal to the LoRa terminal 1.

步骤804、LoRa终端1接收到第二应答消息后,会生成信号S2,其中,信号S2中包含LoRa终端2地址。Step 804: After the LoRa terminal 1 receives the second response message, it will generate a signal S2, where the signal S2 includes the address of the LoRa terminal 2.

此外,LoRa终端1根据信号S1中的信号传递结束标识确定LoRa终端1不是LoRa目的终端,还需要向下一个LoRa终端传递信号,并生成信号S2,其中,信号S2是信号S1的转发信号,与信号S1基本一致,只是信号S2中包含的是LoRa终端2的地址,并不是LoRa目的终端的地址,这里LoRa终端2的地址是LoRa终端1在自身地址上的基础上进行自增获得的,例如,终端1的地址是0x01,则终端1会在地址0x01的基础上自增获得地址0x02,也就是LoRa终端2的地址,而且信号S2中还携带有信号S1的转发标识,所述转发标识用于标识信号S2是信号S1的转发信号。In addition, the LoRa terminal 1 determines that the LoRa terminal 1 is not a LoRa destination terminal according to the signal transmission end identifier in the signal S1, and also needs to transmit a signal to the next LoRa terminal, and generate a signal S2, where the signal S2 is the forwarding signal of the signal S1, and the The signal S1 is basically the same, but the signal S2 contains the address of the LoRa terminal 2, not the address of the LoRa destination terminal. Here, the address of the LoRa terminal 2 is obtained by the self-increment of the LoRa terminal 1 on the basis of its own address, for example , the address of the terminal 1 is 0x01, then the terminal 1 will automatically increase the address 0x02 on the basis of the address 0x01, which is the address of the LoRa terminal 2, and the signal S2 also carries the forwarding identifier of the signal S1. The identification signal S2 is a forwarded signal of the signal S1.

举例来说,如图10所示,LoRa终端1接收信号S1后,实现三次握手,并使得与LoRa终端连接的路灯进行相应的亮灯处理,根据信号S1中的信号传递结束标识确定LoRa终端1不是LoRa目的终端,则向LoRa终端2发送亮灯信号。For example, as shown in Figure 10, after the LoRa terminal 1 receives the signal S1, it implements a three-way handshake, and causes the street lamps connected to the LoRa terminal to perform corresponding lighting processing, and determines the LoRa terminal 1 according to the signal transmission end mark in the signal S1. If it is not a LoRa destination terminal, it will send a light signal to LoRa terminal 2.

步骤805、LoRa终端1向LoRa终端2发送信号S2。Step 805 , the LoRa terminal 1 sends a signal S2 to the LoRa terminal 2 .

这里,LoRa终端1也可以在信道中广播信号S2,虽然在信道中的其他LoRa终端也可以接收信号S2,但是只有是信号S2中的LoRa终端地址的LoRa终端,也就是LoRa终端2会接收到信号S2后,向LoRa终端1回复应答消息,其他的LoRa终端会忽略信号S2,不会向LoRa终端1回复应答消息。也就是每个LoRa终端在实现三次握手后,都可以通过信道广播信号,但是只有下一个终端地址是信号中的LoRa终端的地址,才可以回复应答消息。Here, LoRa terminal 1 can also broadcast signal S2 in the channel. Although other LoRa terminals in the channel can also receive signal S2, only the LoRa terminal with the LoRa terminal address in signal S2, that is, LoRa terminal 2, will receive the signal S2. After the signal S2, a reply message is returned to the LoRa terminal 1. Other LoRa terminals will ignore the signal S2 and will not reply to the LoRa terminal 1 with a reply message. That is, each LoRa terminal can broadcast the signal through the channel after the three-way handshake, but only the next terminal address is the address of the LoRa terminal in the signal, and the reply message can be replied.

步骤806、判断LoRa终端2是否与LoRa终端1完成三次握手。Step 806 , determine whether the LoRa terminal 2 has completed the three-way handshake with the LoRa terminal 1 .

此外,所述三次握手是指当LoRa终端2接收到LoRa终端1发送的信号S2后,会向LoRa终端发送第一应答消息,当LoRa终端1接收到第一应答消息后,LoRa终端1会向LoRa终端2发送第二应答消息,当LoRa终端2接收到第二应答消息,则判断与LoRa终端1完成了三次握手。In addition, the three-way handshake means that when the LoRa terminal 2 receives the signal S2 sent by the LoRa terminal 1, it will send the first response message to the LoRa terminal. When the LoRa terminal 1 receives the first response message, the LoRa terminal 1 will send the The LoRa terminal 2 sends the second response message, and when the LoRa terminal 2 receives the second response message, it determines that the three-way handshake has been completed with the LoRa terminal 1.

步骤807、当LoRa终端2与LoRa终端1完成三次握手后,LoRa终端2会向LoRa终端3发送信号S3,其中,信号S3中包含LoRa终端3地址。Step 807: After the LoRa terminal 2 and the LoRa terminal 1 complete the three-way handshake, the LoRa terminal 2 sends a signal S3 to the LoRa terminal 3, wherein the signal S3 includes the address of the LoRa terminal 3.

这里,LoRa终端2与LoRa终端1完成三次握手后,根据信号S2中的传递结束标识确定LoRa终端2不是LoRa目的终端,还需要向下一个LoRa终端传递信号,生成信号S3并发送,其中信号S3是信号S2的转发信号,与信号S2基本一致,LoRa终端3的地址是LoRa终端2在自身地址上的基础上进行自增获得的。LoRa终端2也可以在信道中广播信号S3,但是只有LoRa终端3会接收到信号S3后,会向LoRa终端2回复应答消息。Here, after LoRa terminal 2 and LoRa terminal 1 complete the three-way handshake, it is determined that LoRa terminal 2 is not a LoRa destination terminal according to the transmission end mark in signal S2, and a signal needs to be transmitted to the next LoRa terminal to generate signal S3 and send, wherein signal S3 It is the forwarding signal of the signal S2, which is basically the same as the signal S2. The address of the LoRa terminal 3 is obtained by the self-increment of the LoRa terminal 2 on the basis of its own address. The LoRa terminal 2 can also broadcast the signal S3 in the channel, but only the LoRa terminal 3 will reply the reply message to the LoRa terminal 2 after receiving the signal S3.

步骤808、判断LoRa终端3是否与LoRa终端2完成三次握手。Step 808: Determine whether the LoRa terminal 3 completes the three-way handshake with the LoRa terminal 2.

步骤809、当LoRa终端3与LoRa终端2完成三次握手后,LoRa终端3会向LoRa目的终端发送信号S4,其中,信号S4中包含LoRa目的终端的地址。Step 809: After the LoRa terminal 3 and the LoRa terminal 2 complete the three-way handshake, the LoRa terminal 3 sends a signal S4 to the LoRa destination terminal, wherein the signal S4 includes the address of the LoRa destination terminal.

需要说明的是,LoRa终端3与LoRa终端2完成三次握手后,根据信号S3中的传递结束标识确定LoRa终端3不是LoRa目的终端,还需要向下一个LoRa终端传递信号,生成信号S4并发送,信号S4是信号S3的转发信号,与信号S3基本一致,LoRa目的终端的地址是LoRa终端3在自身地址上的基础上进行自增获得的。It should be noted that after the LoRa terminal 3 and the LoRa terminal 2 complete the three-way handshake, it is determined that the LoRa terminal 3 is not the LoRa destination terminal according to the transmission end mark in the signal S3, and the signal needs to be transmitted to the next LoRa terminal, and the signal S4 is generated and sent. The signal S4 is the forwarding signal of the signal S3, which is basically the same as the signal S3. The address of the LoRa destination terminal is obtained by the self-increment of the LoRa terminal 3 on the basis of its own address.

步骤810、当LoRa目的终端接收到信号S4后,向LoRa终端3发送第一应答消息。Step 810: After the LoRa destination terminal receives the signal S4, it sends a first response message to the LoRa terminal 3.

这里,所述第一应答消息是用于标识LoRa目的终端接收到了信号S4。Here, the first response message is used to identify that the LoRa destination terminal has received the signal S4.

步骤811、LoRa终端3接收到第一应答消息后,向LoRa目的终端发送第二应答消息。Step 811: After receiving the first response message, the LoRa terminal 3 sends a second response message to the LoRa destination terminal.

另外,LoRa目的终端接收到第二应答消息后,根据信号S4中的传递结束标识确定当前接收到信号S4的LoRa终端是LoRa目的终端,则不需要向下一个LoRa终端传递信号,结束信号传递的过程,并根据操作指令,进行相应的操作,例如根据信号S4中的LoRa目的终端的亮灯指令进行亮灯操作。In addition, after receiving the second response message, the LoRa destination terminal determines that the LoRa terminal that currently receives the signal S4 is the LoRa destination terminal according to the transmission end identifier in the signal S4, so it does not need to transmit the signal to the next LoRa terminal. process, and perform corresponding operations according to the operation instruction, for example, perform the lighting operation according to the lighting instruction of the LoRa destination terminal in the signal S4.

举例来说,如图10所示,若LoRa目的终端是LoRa终端120,则LoRa终端1接收到亮灯信号后,会转发亮灯信号给LoRa终端2,LoRa终端2接收到亮灯信号后,会转发信号给LoRa终端3,按照上述方法进行亮灯信号的传递,使得LoRa终端120接收亮灯信号,保证每个保证LoRa终端都可以接收到亮灯信号,从而保证与LoRa终端连接的每一盏路灯都能亮灯。For example, as shown in Figure 10, if the LoRa destination terminal is LoRa terminal 120, after LoRa terminal 1 receives the light-on signal, it will forward the light-on signal to LoRa terminal 2. After LoRa terminal 2 receives the light-on signal, The signal will be forwarded to the LoRa terminal 3, and the light-on signal will be transmitted according to the above method, so that the LoRa terminal 120 receives the light-on signal, ensuring that each guaranteed LoRa terminal can receive the light-on signal, thereby ensuring that each connection with the LoRa terminal is connected. Street lights can be turned on.

步骤812、当LoRa终端3没有与LoRa终端2完成三次握手,则LoRa终端2会生成信号S-P4,其中,信号S-P4中包含LoRa目的终端的地址。Step 812: When the LoRa terminal 3 has not completed the three-way handshake with the LoRa terminal 2, the LoRa terminal 2 will generate a signal S-P4, wherein the signal S-P4 contains the address of the LoRa destination terminal.

这里,LoRa终端3没有与LoRa终端2完成三次握手还可以是指LoRa终端2没有接收到第一次应答消息,从而确定LoRa终端3没有接收到信号S3,则LoRa终端2会生成信号S-P4,其中LoRa目的终端的地址是根据终端3的地址进行自增获得的,其中信号S-P4是信号S3的转发信号,与信号S3基本一致。Here, the fact that the LoRa terminal 3 has not completed the three-way handshake with the LoRa terminal 2 may also mean that the LoRa terminal 2 has not received the first response message, thus determining that the LoRa terminal 3 has not received the signal S3, then the LoRa terminal 2 will generate the signal S-P4 , where the address of the LoRa destination terminal is obtained by self-incrementing according to the address of terminal 3, wherein the signal S-P4 is the forwarding signal of the signal S3, which is basically consistent with the signal S3.

举例来说,如图10所示,当整个通讯链路出现部分终端中断连接时,例如LoRa终端5始终没有向LoRa终端4回复应答消息,则LoRa终端4会向LoRa终端6继续发送亮灯信号S6,保证亮灯信号继续传递下去。For example, as shown in Figure 10, when some terminals are disconnected in the entire communication link, for example, LoRa terminal 5 has not responded to LoRa terminal 4 with a response message, then LoRa terminal 4 will continue to send light signals to LoRa terminal 6. S6, ensure that the light-on signal continues to be transmitted.

步骤813、LoRa终端2会向LoRa目的终端发送信号S-P4。Step 813, the LoRa terminal 2 will send the signal S-P4 to the LoRa destination terminal.

步骤814、当LoRa目的终端接收到信号S-P4后,向LoRa终端2发送第一应答消息。Step 814: After the LoRa destination terminal receives the signal S-P4, it sends a first response message to the LoRa terminal 2.

另外,所述第一应答消息是用于标识LoRa目的终端接收到了信号S-P4。In addition, the first response message is used to identify that the LoRa destination terminal has received the signal S-P4.

步骤815、LoRa终端2接收到第一应答消息后,向LoRa目的终端发送第二应答消息。Step 815: After receiving the first response message, the LoRa terminal 2 sends a second response message to the LoRa destination terminal.

这里,LoRa目的终端接收到第二应答消息后,根据信号S-P4中的传递结束标识确定当前接收到信号S-P4的LoRa终端是LoRa目的终端,则不需要向下一个LoRa终端传递信号。Here, after receiving the second response message, the LoRa destination terminal determines that the LoRa terminal currently receiving the signal S-P4 is the LoRa destination terminal according to the transmission end identifier in the signal S-P4, and does not need to transmit the signal to the next LoRa terminal.

步骤816、当LoRa终端2没有与LoRa终端1完成三次握手,则LoRa终端1会生成信号S-P5,其中,信号S-P5中包含LoRa终端3的地址。Step 816: When the LoRa terminal 2 has not completed the three-way handshake with the LoRa terminal 1, the LoRa terminal 1 will generate a signal S-P5, wherein the signal S-P5 contains the address of the LoRa terminal 3.

需要说明的是,LoRa终端2没有与LoRa终端1完成三次握手还可以是指LoRa终端1没有接收到第一次应答消息,从而确定LoRa终端2没有接收到信号S2,则LoRa终端1会生成信号S-P5,其中LoRa终端3的地址是根据终端2的地址进行自增获得的,信号S-P5是信号S2的转发信号,与信号S2基本一致。It should be noted that the fact that LoRa terminal 2 has not completed the three-way handshake with LoRa terminal 1 may also mean that LoRa terminal 1 has not received the first response message, thus determining that LoRa terminal 2 has not received signal S2, then LoRa terminal 1 will generate a signal S-P5, where the address of the LoRa terminal 3 is obtained by self-incrementing according to the address of the terminal 2, and the signal S-P5 is the forwarding signal of the signal S2, which is basically the same as the signal S2.

步骤817、LoRa终端1会向LoRa终端3发送信号S-P5。Step 817 , the LoRa terminal 1 will send the signal S-P5 to the LoRa terminal 3 .

步骤818、判断LoRa终端3是否与LoRa终端1完成三次握手。Step 818 , determine whether the LoRa terminal 3 completes the three-way handshake with the LoRa terminal 1 .

步骤819、当LoRa终端3与LoRa终端1完成三次握手后,LoRa终端3会向LoRa目的终端发送信号S5,其中,信号S5中包含LoRa目的终端的地址。Step 819: After the LoRa terminal 3 and the LoRa terminal 1 complete the three-way handshake, the LoRa terminal 3 sends a signal S5 to the LoRa destination terminal, wherein the signal S5 includes the address of the LoRa destination terminal.

步骤820、当LoRa目的终端接收到信号S5后,向LoRa终端3发送第一应答消息。Step 820: After the LoRa destination terminal receives the signal S5, it sends a first response message to the LoRa terminal 3.

步骤821、LoRa终端3接收到第一应答消息后,向LoRa目的终端发送第二应答消息。Step 821: After receiving the first response message, the LoRa terminal 3 sends a second response message to the LoRa destination terminal.

步骤822、当LoRa终端3没有与LoRa终端1完成三次握手,则LoRa终端1会生成信号S-P6,其中,信号S-P6中包含LoRa目的终端的地址。Step 822: When the LoRa terminal 3 has not completed the three-way handshake with the LoRa terminal 1, the LoRa terminal 1 will generate a signal S-P6, wherein the signal S-P6 contains the address of the LoRa destination terminal.

步骤823、LoRa终端1会向LoRa目的终端发送信号S-P6。Step 823, the LoRa terminal 1 will send the signal S-P6 to the LoRa destination terminal.

这里,信号S-P6中包含LoRa目的终端的地址,信号S-P6是信号S-P5的转发信号,与信号S-P5基本一致。Here, the signal S-P6 includes the address of the LoRa destination terminal, and the signal S-P6 is a forwarding signal of the signal S-P5, which is basically the same as the signal S-P5.

步骤824、当LoRa目的终端接收到信号S-P6后,向LoRa终端1发送第一应答消息。Step 824: After the LoRa destination terminal receives the signal S-P6, it sends a first response message to the LoRa terminal 1.

步骤825、LoRa终端1接收到第一应答消息后,向LoRa目的终端发送第二应答消息。Step 825: After receiving the first response message, the LoRa terminal 1 sends a second response message to the LoRa destination terminal.

这里,LoRa目的终端接收到第二应答消息后,根据信号S-P6中的传递结束标识确定当前接收到信号S-P6的LoRa终端是LoRa目的终端,则不需要向下一个LoRa终端传递信号,结束信号传递的过程。Here, after receiving the second response message, the LoRa destination terminal determines that the LoRa terminal currently receiving the signal S-P6 is the LoRa destination terminal according to the transmission end identifier in the signal S-P6, so it does not need to transmit the signal to the next LoRa terminal, End the process of signaling.

对于图8所示的技术方案,步骤801-825是LoRa网关向LoRa终端传递下行信号的过程,在一种可能的实现方式中,图9所示的技术方案还包括LoRa终端向LoRa网关传递上行信号的过程,如图9所示,图9中的技术方案包括:For the technical solution shown in Figure 8, steps 801-825 are the process of the LoRa gateway transmitting downlink signals to the LoRa terminal. In a possible implementation, the technical solution shown in Figure 9 also includes the LoRa terminal transmitting the uplink signal to the LoRa gateway. The process of the signal is shown in Figure 9. The technical solution in Figure 9 includes:

步骤901、LoRa目的终端向LoRa终端3发送信号S1,其中,信号S1中包含LoRa终端3地址、信号传递结束标识以及操作指令,其中信号传递结束标识用于判断当前接收到信号的LoRa终端是否是LoRa网关,如果判断是LoRa网关地址,则结束信号的传递过程。Step 901, LoRa destination terminal sends signal S1 to LoRa terminal 3, wherein, signal S1 includes LoRa terminal 3 address, signal transmission end mark and operation instruction, and wherein signal transmission end mark is used to judge whether the LoRa terminal that currently receives the signal is. LoRa gateway, if it is determined to be the address of the LoRa gateway, the signal transmission process is ended.

需要说明的是,当LoRa目的终端需要上报信号时,LoRa目的终端会在信道中广播上行信号,当LoRa网关接收到上行信号时,会与LoRa目的终端进行三次握手,但是若LoRa目的终端始终与LoRa网关无法完成三次握手,则LoRa目的终端会向LoRa终端3发送信号S1,其信号S1是上行信号的转发信号,其中LoRa终端3地址是LoRa目的终端在自身地址的基础进行自减获得的。It should be noted that when the LoRa destination terminal needs to report a signal, the LoRa destination terminal will broadcast the uplink signal in the channel. When the LoRa gateway receives the uplink signal, it will shake hands with the LoRa destination terminal three times, but if the LoRa destination terminal always communicates with the LoRa destination terminal. If the LoRa gateway cannot complete the three-way handshake, the LoRa destination terminal will send a signal S1 to the LoRa terminal 3, and the signal S1 is the forwarding signal of the uplink signal. The address of the LoRa terminal 3 is obtained by the LoRa destination terminal on the basis of its own address.

举例来说,如图10所示,当整个通讯链路出现部分终端中断连接时,若LoRa终端120是LoRa目的终端,LoRa终端120需要上报警报信号给LoRa网关,由于LoRa网关与LoRa终端120距离比较远,LoRa网关与LoRa终端120始终无法完成三次握手,则LoRa终端120会向LoRa终端119转发警报信号。For example, as shown in FIG. 10 , when some terminals are disconnected in the entire communication link, if the LoRa terminal 120 is the LoRa destination terminal, the LoRa terminal 120 needs to report an alarm signal to the LoRa gateway, because the distance between the LoRa gateway and the LoRa terminal 120 If it is far away, the LoRa gateway and the LoRa terminal 120 cannot complete the three-way handshake, and the LoRa terminal 120 will forward the alarm signal to the LoRa terminal 119 .

步骤902、判断LoRa终端3是否与LoRa目的终端完成三次握手。Step 902: Determine whether the LoRa terminal 3 completes the three-way handshake with the LoRa destination terminal.

步骤903、当LoRa终端3与LoRa终端2完成三次握手后,LoRa终端3会向LoRa终端1发送信号S2,其中,信号S2中包含LoRa终端2地址。Step 903: After the LoRa terminal 3 and the LoRa terminal 2 complete the three-way handshake, the LoRa terminal 3 sends a signal S2 to the LoRa terminal 1, wherein the signal S2 includes the address of the LoRa terminal 2.

这里,当LoRa终端3与LoRa终端2完成三次握手后,会根据信号S1中的信号传递结束标识判断LoRa终端3是否是LoRa网关,若不是LoRa网关,则LoRa终端3会生成信号S2,其中信号S2与信号S1基本一致,只是信号S2中包含LoRa终端2的地址,并不是LoRa终端1的地址,还携带有信号S1的转发标识。Here, after the LoRa terminal 3 and the LoRa terminal 2 complete the three-way handshake, it will be determined whether the LoRa terminal 3 is a LoRa gateway according to the signal transmission end mark in the signal S1. If it is not a LoRa gateway, the LoRa terminal 3 will generate a signal S2 is basically the same as the signal S1, except that the signal S2 contains the address of the LoRa terminal 2, not the address of the LoRa terminal 1, and also carries the forwarding identifier of the signal S1.

步骤904、判断LoRa终端2是否与LoRa终端3完成三次握手。Step 904 , determine whether the LoRa terminal 2 completes the three-way handshake with the LoRa terminal 3 .

步骤905、当LoRa终端2与LoRa终端3完成三次握手后,LoRa终端2会向LoRa终端1发送信号S3,其中,信号S3中包含LoRa终端1地址。Step 905: After the LoRa terminal 2 and the LoRa terminal 3 complete the three-way handshake, the LoRa terminal 2 sends a signal S3 to the LoRa terminal 1, wherein the signal S3 includes the address of the LoRa terminal 1.

步骤906、LoRa终端1接收到信号S3后,向LoRa终端2发送第一应答消息。Step 906: After the LoRa terminal 1 receives the signal S3, it sends a first response message to the LoRa terminal 2.

步骤907、LoRa终端2接收到第一应答消息后,向LoRa终端1发送第二应答消息。Step 907 , after receiving the first response message, the LoRa terminal 2 sends the second response message to the LoRa terminal 1 .

这里,LoRa终端1与LoRa终端2完成三次握手。Here, LoRa terminal 1 and LoRa terminal 2 complete the three-way handshake.

步骤908、LoRa终端1向LoRa网关发送信号S4。Step 908, the LoRa terminal 1 sends a signal S4 to the LoRa gateway.

步骤909、当LoRa网关接收到信号S4后,向LoRa终端1发送第一应答消息。Step 909 , when the LoRa gateway receives the signal S4 , it sends a first response message to the LoRa terminal 1 .

步骤910、LoRa终端1接收到第一应答消息后,向LoRa网关发送第二应答消息。Step 910: After receiving the first response message, the LoRa terminal 1 sends a second response message to the LoRa gateway.

这里,LoRa网关根据信号S4中的信号传递结束标识判断其自身是否是LoRa网关,若自身是LoRa网关,则根据操作指令进行相应的处理。Here, the LoRa gateway determines whether it is a LoRa gateway according to the signal transmission end identifier in the signal S4, and if it is a LoRa gateway, it performs corresponding processing according to the operation instruction.

步骤911、当LoRa终端2没有与LoRa终端3完成三次握手,则LoRa终端3会生成信号S-P1,其中,信号S-P1中包含LoRa终端1的地址。Step 911: When the LoRa terminal 2 has not completed the three-way handshake with the LoRa terminal 3, the LoRa terminal 3 will generate a signal S-P1, wherein the signal S-P1 contains the address of the LoRa terminal 1.

步骤912、当LoRa终端1接收到信号S-P1后,向LoRa终端3发送第一应答消息。Step 912: After the LoRa terminal 1 receives the signal S-P1, it sends a first response message to the LoRa terminal 3.

步骤913、LoRa终端3接收到第一应答消息后,向LoRa终端1发送第二应答消息。Step 913 , after receiving the first response message, the LoRa terminal 3 sends the second response message to the LoRa terminal 1 .

需要说明的是,LoRa终端1与LoRa终端3完成三次握手,进入步骤908。It should be noted that the LoRa terminal 1 and the LoRa terminal 3 complete the three-way handshake, and enter step 908 .

步骤914、当LoRa目的终端没有与LoRa终端3完成三次握手,则LoRa目的终端会生成信号S-P2,其中,信号S-P2中包含LoRa终端2的地址。Step 914: When the LoRa destination terminal has not completed the three-way handshake with the LoRa terminal 3, the LoRa destination terminal will generate a signal S-P2, wherein the signal S-P2 contains the address of the LoRa terminal 2.

步骤915、判断LoRa终端2是否与LoRa目的终端完成三次握手。Step 915: Determine whether the LoRa terminal 2 completes the three-way handshake with the LoRa destination terminal.

这里,当LoRa终端2与LoRa目的终端完成三次握手后,进入步骤905。Here, after the LoRa terminal 2 completes the three-way handshake with the LoRa destination terminal, step 905 is entered.

步骤916、当LoRa终端3没有与LoRa目的终端完成三次握手后,LoRa目的终端会向LoRa终端1发送信号S-P3,其中,信号S-P3中包含LoRa终端1的地址。Step 916: After the LoRa terminal 3 has not completed the three-way handshake with the LoRa destination terminal, the LoRa destination terminal will send a signal S-P3 to the LoRa terminal 1, wherein the signal S-P3 contains the address of the LoRa terminal 1.

步骤917、当LoRa终端1接收到信号S-P3后,向LoRa目的终端发送第一应答消息。Step 917: After the LoRa terminal 1 receives the signal S-P3, it sends a first response message to the LoRa destination terminal.

步骤918、LoRa目的终端接收到第一应答消息后,向LoRa终端1发送第二应答消息。Step 918 , after receiving the first response message, the LoRa destination terminal sends a second response message to the LoRa terminal 1 .

这里,当LoRa终端1与LoRa目的终端完成三次握手后,进入步骤908。Here, after the LoRa terminal 1 completes the three-way handshake with the LoRa destination terminal, step 908 is entered.

本发明实施例提供了一种通信方法,接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述第一LoRa终端相比距离所述LoRa网关更近的第二LoRa终端;根据所述下行信号确定所述第一LoRa终端自身是否为所述目标终端;相应于确定所述第一LoRa终端自身是所述目标终端,执行所述下行信号中的所述操作指令;相应于确定所述第一LoRa终端自身不是所述目标终端,将所述下行信号转发至与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端。从而能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的问题,保证了LoRa网络在传输数据时的稳定性。An embodiment of the present invention provides a communication method for receiving a downlink signal sent by a first upper-level network device; wherein the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate; the first The upper-level network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal; according to the downlink signal, determine whether the first LoRa terminal itself is the target terminal; Corresponding to determining that the first LoRa terminal itself is the target terminal, execute the operation instruction in the downlink signal; Corresponding to determining that the first LoRa terminal itself is not the target terminal, forward the downlink signal to a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal. Therefore, it can solve the problem that the LoRa network deployment cost is high, and the data is easily lost due to the long distance or other interference, and the stability of data transmission cannot be guaranteed, and the stability of the LoRa network when transmitting data can be ensured.

实施例四Embodiment 4

本发明实施例提供一种通信装置,图11为本发明实施例提供的一种通信装置的结构示意图,如图11所示,该通信装置1100主要包括部分:第一接收单元1101、第一确定单元1102和第一执行单元1103;其中,An embodiment of the present invention provides a communication device. FIG. 11 is a schematic structural diagram of a communication device provided by an embodiment of the present invention. As shown in FIG. 11 , the communication device 1100 mainly includes parts: a first receiving unit 1101 , a first determining unit 1102 and the first execution unit 1103; wherein,

所述第一接收单元1101,用于接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述通信装置1100相比距离所述LoRa网关更近的第二LoRa终端;The first receiving unit 1101 is configured to receive a downlink signal sent by a first upper-level network device; wherein, the downlink signal includes a target terminal identifier and an operation instruction used to instruct the target terminal to operate; the first upper-level The network device includes a LoRa gateway, or a second LoRa terminal that is closer to the LoRa gateway than the communication device 1100;

所述第一确定单元1102,用于根据所述下行信号确定所述通信装置1100自身是否为所述目标终端;The first determining unit 1102 is configured to determine whether the communication device 1100 itself is the target terminal according to the downlink signal;

所述第一执行单元1103,用于相应于确定所述通信装置1100自身是所述目标终端,执行所述下行信号中的所述操作指令;以及,The first execution unit 1103 is configured to execute the operation instruction in the downlink signal in response to determining that the communication device 1100 itself is the target terminal; and,

相应于确定所述通信装置1100自身不是所述目标终端,将所述下行信号转发至与所述通信装置1100相比距离所述LoRa网关更远的第三LoRa终端。Corresponding to determining that the communication device 1100 itself is not the target terminal, the downlink signal is forwarded to a third LoRa terminal that is farther from the LoRa gateway than the communication device 1100 .

相应地,所述第一接收单元1101还用于:Correspondingly, the first receiving unit 1101 is further configured to:

向所述第一上级网络设备发送第一应答消息;其中,所述第一应答消息用于指示所述通信装置1100收到所述下行信号;sending a first response message to the first upper-level network device; wherein, the first response message is used to instruct the communication apparatus 1100 to receive the downlink signal;

接收第一上级网络设备发送的第二应答消息;其中,所述第二应答消息用于指示所述通信装置1100与第一上级网络设备完成信号传递。A second response message sent by the first upper-level network device is received; wherein, the second response message is used to instruct the communication apparatus 1100 to complete signal transmission with the first upper-level network device.

示例性地,所述第一确定单元1102还用于:Exemplarily, the first determining unit 1102 is further configured to:

根据所述下行信号中的目标终端标识,确定所述通信装置1100自身是否具有所述目标终端标识,若所述通信装置1100自身具有所述目标终端标识,则确定所述通信装置1100自身为所述目标终端。According to the target terminal identification in the downlink signal, determine whether the communication device 1100 has the target terminal identification, and if the communication device 1100 has the target terminal identification, determine that the communication device 1100 is the the target terminal.

可选地,所述第一执行单元1103还用于:Optionally, the first execution unit 1103 is further configured to:

按照预设的信号转发策略,获取与所述通信装置1100相比距离所述LoRa网关更远的第三LoRa终端的地址,并将所述下行信号转发至所述第三LoRa终端。According to a preset signal forwarding strategy, the address of a third LoRa terminal that is farther from the LoRa gateway than the communication device 1100 is obtained, and the downlink signal is forwarded to the third LoRa terminal.

可选地,所述第一执行单元1103还用于:Optionally, the first execution unit 1103 is further configured to:

在所述通信装置1100自身的地址上进行自增,获取与所述第一LoRa终端相比距离所述LoRa网关更远的第三LoRa终端的地址,并将所述下行信号转发至所述第三LoRa终端。Auto-increment the address of the communication device 1100 itself, obtain the address of a third LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal, and forward the downlink signal to the first LoRa terminal Three LoRa terminals.

可选地,所述第一执行单元1103还用于:Optionally, the first execution unit 1103 is further configured to:

将所述下行信号转发至第四LoRa终端;其中,所述第四LoRa终端是距离所述通信装置1100最近且与所述通信装置1100相比距离LoRa网关更远的终端;forwarding the downlink signal to a fourth LoRa terminal; wherein, the fourth LoRa terminal is the terminal closest to the communication device 1100 and farther from the LoRa gateway than the communication device 1100;

确定是否接收到所述第四LoRa终端发送的第三应答消息;其中,所述第三应答消息用于指示所述第四LoRa终端接收到所述下行信号;Determine whether the third response message sent by the fourth LoRa terminal is received; wherein, the third response message is used to indicate that the fourth LoRa terminal receives the downlink signal;

相应于确定所述通信装置1100接收到所述第四LoRa终端发送的第三应答消息,向所述第四LoRa终端发送第四应答消息;其中,所述第四应答消息用于指示所述通信装置1100与第四LoRa终端完成信号传递。Corresponding to determining that the communication apparatus 1100 receives the third response message sent by the fourth LoRa terminal, a fourth response message is sent to the fourth LoRa terminal; wherein, the fourth response message is used to indicate the communication The device 1100 completes signal transmission with the fourth LoRa terminal.

相应于确定所述通信装置1100没有接收到所述第四LoRa终端发送的第三应答消息,将所述下行信号转发至第五LoRa终端;其中,所述第五LoRa终端是距离所述通信装置1100次近且与所述通信装置1100相比距离LoRa网关更远的终端。Corresponding to determining that the communication device 1100 has not received the third response message sent by the fourth LoRa terminal, the downlink signal is forwarded to the fifth LoRa terminal; wherein, the fifth LoRa terminal is a distance from the communication device 1100 times closer and farther from the LoRa gateway than the communication device 1100.

示例性地,所述装置1100还包括:第二接收单元1104、第二确定单元1105和第二执行单元1106;其中,Exemplarily, the apparatus 1100 further includes: a second receiving unit 1104, a second determining unit 1105 and a second executing unit 1106; wherein,

所述第二接收单元1104,用于接收第二上级网络设备发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;所述第二上级网络设备是与所述通信装置1100相比距离所述LoRa网关更远的第六LoRa终端;The second receiving unit 1104 is configured to receive an uplink signal sent by a second upper-level network device; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway; the second upper-level The network device is a sixth LoRa terminal that is farther from the LoRa gateway than the communication device 1100;

所述第二确定单元1105,用于根据所述上行信号确定所述通信装置1100自身是否为所述LoRa网关;The second determining unit 1105 is configured to determine whether the communication device 1100 itself is the LoRa gateway according to the uplink signal;

所述第二执行单元1106,用于相应于确定所述通信装置1100自身不是所述LoRa网关,将所述上行信号转发至与所述通信装置1100相比距离所述LoRa网关更近的第七LoRa终端。The second execution unit 1106 is configured to, in response to determining that the communication device 1100 itself is not the LoRa gateway, forward the uplink signal to a seventh device that is closer to the LoRa gateway than the communication device 1100. LoRa terminal.

示例性地,所述第二接收单元1104还用于:Exemplarily, the second receiving unit 1104 is further configured to:

向所述第二上级网络设备发送第五应答消息;其中,所述第五应答消息用于指示所述通信装置1100接收到所述上行信号;sending a fifth response message to the second upper-level network device; wherein the fifth response message is used to instruct the communication apparatus 1100 to receive the uplink signal;

接收所述第二上级网络设备发送的第六应答消息;其中,所述第六应答消息用于指示所述通信装置1100与所述第二上级网络设备完成信号传递。A sixth response message sent by the second upper-level network device is received; wherein, the sixth response message is used to instruct the communication apparatus 1100 to complete signal transmission with the second upper-level network device.

相应地,所述第二确定单元1105具体用于:Correspondingly, the second determining unit 1105 is specifically configured to:

根据所述上行信号中的LoRa网关标识,确定所述通信装置1100自身是否具有所述LoRa网关标识,若所述通信装置1100自身不具有所述目标终端标识,则确定所述通信装置1100自身不是所述LoRa网关。According to the LoRa gateway identifier in the uplink signal, it is determined whether the communication device 1100 itself has the LoRa gateway identifier, and if the communication device 1100 itself does not have the target terminal identifier, it is determined that the communication device 1100 itself is not The LoRa Gateway.

示例性地,所述第二执行单元1106还用于:Exemplarily, the second execution unit 1106 is further configured to:

按照预设的信号转发策略,获取与所述通信装置1100相比距离所述LoRa网关更近的第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。According to a preset signal forwarding strategy, the address of a seventh LoRa terminal that is closer to the LoRa gateway than the communication device 1100 is obtained, and the uplink signal is forwarded to the seventh LoRa terminal.

示例性地,所述第二执行单元1106还用于:Exemplarily, the second execution unit 1106 is further configured to:

在所述通信装置1100自身的地址上进行自减,获取与所述通信装置1100相比距离所述LoRa网关更近的第七LoRa终端的地址,并将所述上行信号转发至所述第七LoRa终端。Perform self-decrement on the address of the communication device 1100 itself, obtain the address of a seventh LoRa terminal that is closer to the LoRa gateway than the communication device 1100, and forward the uplink signal to the seventh LoRa terminal LoRa terminal.

示例性地,所述第二执行单元1106还用于:Exemplarily, the second execution unit 1106 is further configured to:

将所述上行信号转发至第八LoRa终端;其中,所述第八LoRa终端是距离所述通信装置1100最近且与所述通信装置1100相比距离LoRa网关更近的终端;forwarding the uplink signal to the eighth LoRa terminal; wherein, the eighth LoRa terminal is the terminal closest to the communication device 1100 and closer to the LoRa gateway than the communication device 1100;

确定是否接收到所述第八LoRa终端发送的第七应答消息;其中,所述第七应答消息用于指示所述第八LoRa终端接收到所述上行信号;Determine whether the seventh response message sent by the eighth LoRa terminal is received; wherein, the seventh response message is used to indicate that the eighth LoRa terminal receives the uplink signal;

相应于确定所述通信装置1100接收到所述第八LoRa终端发送的第七应答消息,向所述第八LoRa终端发送第八答消息;其中,所述第八应答消息用于指示所述通信装置1100与第八LoRa终端完成信号传递。Corresponding to determining that the communication device 1100 has received the seventh response message sent by the eighth LoRa terminal, the eighth response message is sent to the eighth LoRa terminal; wherein, the eighth response message is used to indicate the communication The device 1100 completes signal transmission with the eighth LoRa terminal.

相应于确定所述通信装置1100没有接收到所述第八LoRa终端发送的第七应答消息,将所述上行信号转发至第九LoRa终端;其中,所述第九LoRa终端是距离所述通信装置1100次近且与所述通信装置1100相比距离LoRa网关更近的终端。Corresponding to determining that the communication device 1100 has not received the seventh response message sent by the eighth LoRa terminal, the uplink signal is forwarded to the ninth LoRa terminal; wherein, the ninth LoRa terminal is a distance from the communication device 1100 times closer and closer to the LoRa gateway than the communication device 1100.

本发明实施例提供的一种通信装置,接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述通信装置相比距离所述LoRa网关更近的第二LoRa终端;根据所述下行信号确定所述通信装置自身是否为所述目标终端;相应于确定所述通信装置自身是所述目标终端,执行所述下行信号中的所述操作指令;相应于确定所述通信装置自身不是所述目标终端,将所述下行信号转发至与所述通信装置相比距离所述LoRa网关更远的第三LoRa终端。从而能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的问题,保证了LoRa网络在传输数据时的稳定性。An embodiment of the present invention provides a communication device that receives a downlink signal sent by a first upper-level network device; wherein the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate; the first The upper-level network equipment includes a LoRa gateway, or a second LoRa terminal closer to the LoRa gateway than the communication device; determining whether the communication device itself is the target terminal according to the downlink signal; corresponding to determining the the communication device itself is the target terminal, and executes the operation instruction in the downlink signal; corresponding to determining that the communication device itself is not the target terminal, forwards the downlink signal to a device that is compared with the communication device A third LoRa terminal further from the LoRa gateway. Therefore, it can solve the problem that the LoRa network deployment cost is high, and the data is easily lost due to the long distance or other interference, and the stability of data transmission cannot be guaranteed, and the stability of the LoRa network when transmitting data can be ensured.

实施例五Embodiment 5

本发明实施例提供一种通信装置,图12为本发明实施例提供的一种通信装置的结构示意图,如图12所示,该通讯装置1200主要包括部分:第三确定单元1201、生成单元1202和发送单元1203;其中,An embodiment of the present invention provides a communication device. FIG. 12 is a schematic structural diagram of a communication device provided by an embodiment of the present invention. As shown in FIG. 12 , the communication device 1200 mainly includes parts: a third determining unit 1201 and a generating unit 1202 and sending unit 1203; wherein,

所述第三确定单元1201,用于从所述通讯装置1200自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;The third determining unit 1201 is configured to determine the LoRa terminal with the highest order according to a preset sorting strategy from among the LoRa terminals under the jurisdiction of the communication device 1200;

所述生成单元1202,用于生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;The generating unit 1202 is configured to generate a downlink signal; wherein, the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate;

所述发送单元1203,用于向所述顺序最高的LoRa终端发送所述下行信号。The sending unit 1203 is configured to send the downlink signal to the LoRa terminal with the highest order.

相应地,所述第一发送单元1203还用于:Correspondingly, the first sending unit 1203 is further configured to:

接收所述顺序最高的LoRa终端发送的第九应答消息;其中,所述第九应答消息用于指示所述顺序最高的LoRa终端接收到所述下行信号;以及,Receive the ninth response message sent by the LoRa terminal with the highest order; wherein, the ninth response message is used to indicate that the LoRa terminal with the highest order receives the downlink signal; and,

向所述顺序最高的LoRa终端发送第十应答消息;其中,所述第十应答消息用于指示所述通讯装置1200与所述顺序最高的LoRa终端完成信号传递。Send a tenth response message to the LoRa terminal with the highest order; wherein, the tenth response message is used to instruct the communication device 1200 to complete signal transmission with the LoRa terminal with the highest order.

示例性地,所述装置还包括:第三接收单元1204、第四确定单元1205和第三执行单元1206;其中,Exemplarily, the apparatus further includes: a third receiving unit 1204, a fourth determining unit 1205 and a third executing unit 1206; wherein,

所述第三接收单元1204,用于接收所述顺序最高的LoRa终端发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;The third receiving unit 1204 is used to receive the uplink signal sent by the LoRa terminal with the highest order; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway;

所述第四确定单元1205,用于根据所述上行信号确定所述通讯装置1200自身是否为所述LoRa网关;The fourth determining unit 1205 is configured to determine whether the communication device 1200 itself is the LoRa gateway according to the uplink signal;

所述第三执行单元1206,用于相应于确定所述通讯装置1200自身是所述LoRa网关,获得所述上行信号中的所述上报指令。The third execution unit 1206 is configured to obtain the reporting instruction in the uplink signal in response to determining that the communication device 1200 itself is the LoRa gateway.

示例性地,所述第三接收单元1204还用于:Exemplarily, the third receiving unit 1204 is further configured to:

向所述顺序最高的LoRa终端发送第十一应答消息;其中,所述第十一应答消息用于指示所述通讯装置1200接收到所述上行信号;Send an eleventh response message to the LoRa terminal with the highest order; wherein, the eleventh response message is used to instruct the communication device 1200 to receive the uplink signal;

接收所述顺序最高的LoRa终端发送的第十二应答消息;其中,所述第十二应答消息用于指示所述通讯装置1200与所述顺序最高的LoRa终端完成信号传递。Receive the twelfth response message sent by the LoRa terminal with the highest order; wherein, the twelfth response message is used to instruct the communication device 1200 to complete signal transmission with the LoRa terminal with the highest order.

本发明实施例提供的一种通信装置,从所述通讯装置自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;向所述顺序最高的LoRa终端发送所述下行信号。从而能够解决LoRa网络部署成本较高,并且由于距离过远或其他的干扰容易丢失数据,不能保障数据传输的稳定性的问题,保证了LoRa网络在传输数据时的稳定性。In a communication device provided by an embodiment of the present invention, from the LoRa terminals under the jurisdiction of the communication device itself, the LoRa terminal with the highest order is determined according to a preset sorting strategy; a downlink signal is generated; wherein the downlink signal includes a target terminal an identifier and an operation instruction for instructing the target terminal to operate; sending the downlink signal to the LoRa terminal with the highest order. Therefore, it can solve the problem that the LoRa network deployment cost is high, and the data is easily lost due to the long distance or other interference, and the stability of data transmission cannot be guaranteed, and the stability of the LoRa network when transmitting data can be ensured.

实施例六Embodiment 6

本发明实施例提供一种通信终端,图13为本发明实施例提供的一种终端的结构示意图,如图13所示,所述终端1300至少包括一个处理器1301、一个通信总线1302和存储器1303。其中,通信总线1302配置为实现这些组件之间的连接通信;An embodiment of the present invention provides a communication terminal. FIG. 13 is a schematic structural diagram of a terminal provided by an embodiment of the present invention. As shown in FIG. 13 , the terminal 1300 at least includes a processor 1301 , a communication bus 1302 and a memory 1303 . Wherein, the communication bus 1302 is configured to realize the connection communication between these components;

存储器1303存储在所述处理器1301上运行的计算机程序;The memory 1303 stores computer programs running on the processor 1301;

处理器1301,运行所述计算机程序时,执行:The processor 1301, when running the computer program, executes:

接收第一上级网络设备发送的下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;所述第一上级网络设备包括LoRa网关,或与所述终端1300相比距离所述LoRa网关更近的第二LoRa终端;Receive a downlink signal sent by a first upper-level network device; wherein, the downlink signal includes a target terminal identifier and an operation instruction used to instruct the target terminal to operate; the first upper-level network device includes a LoRa gateway, or is associated with the The terminal 1300 is a second LoRa terminal that is closer to the LoRa gateway;

根据所述下行信号确定所述终端1300自身是否为所述目标终端;Determine whether the terminal 1300 itself is the target terminal according to the downlink signal;

相应于确定所述终端1300自身是所述目标终端,执行所述下行信号中的所述操作指令;Corresponding to determining that the terminal 1300 itself is the target terminal, execute the operation instruction in the downlink signal;

相应于确定所述终端1300自身不是所述目标终端,将所述下行信号转发至与所述终端1300相比距离所述LoRa网关更远的第三LoRa终端。Corresponding to determining that the terminal 1300 itself is not the target terminal, the downlink signal is forwarded to a third LoRa terminal that is farther from the LoRa gateway than the terminal 1300 .

所述处理器1301,还执行:The processor 1301 further executes:

接收第二上级网络设备发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;所述第二上级网络设备是与所述终端1300相比距离所述LoRa网关更远的第六LoRa终端;Receive an uplink signal sent by a second upper-level network device; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway; the second upper-level network device is compared with the terminal 1300. The sixth LoRa terminal farther from the LoRa gateway;

根据所述上行信号确定所述终端1300自身是否为所述LoRa网关;Determine whether the terminal 1300 itself is the LoRa gateway according to the uplink signal;

相应于确定所述终端1300自身不是所述LoRa网关,将所述上行信号转发至与所述终端1300相比距离所述LoRa网关更近的第七LoRa终端。Corresponding to determining that the terminal 1300 itself is not the LoRa gateway, the uplink signal is forwarded to a seventh LoRa terminal that is closer to the LoRa gateway than the terminal 1300 .

相应地,本发明实施例再提供一种计算机存储介质,所述计算机可读存储介质上存储有通信程序,所述通信程序被处理器执行时实现本实施例提供的通信方法的步骤。Correspondingly, an embodiment of the present invention further provides a computer storage medium, where a communication program is stored on the computer-readable storage medium, and when the communication program is executed by a processor, the steps of the communication method provided in this embodiment are implemented.

实施例七Embodiment 7

本发明实施例提供一种通信网关1400,图14为本发明实施例提供的一种网关1400的结构示意图,如图14所示,所述网关1400至少包括一个处理器1401、一个通信总线1402和存储器1403。其中,通信总线1402配置为实现这些组件之间的连接通信;An embodiment of the present invention provides a communication gateway 1400. FIG. 14 is a schematic structural diagram of a gateway 1400 provided by an embodiment of the present invention. As shown in FIG. 14, the gateway 1400 at least includes a processor 1401, a communication bus 1402 and Memory 1403. Wherein, the communication bus 1402 is configured to realize the connection communication between these components;

存储器1403存储在所述处理器1401上运行的计算机程序;The memory 1403 stores computer programs running on the processor 1401;

处理器1401,运行所述计算机程序时,执行:The processor 1401, when running the computer program, executes:

从所述网关1400自身所辖的LoRa终端中,按照预设的排序策略确定顺序最高的LoRa终端;From the LoRa terminals under the jurisdiction of the gateway 1400 itself, determine the LoRa terminal with the highest order according to the preset sorting strategy;

生成下行信号;其中,所述下行信号包括目标终端标识以及用于指示所述目标终端进行操作的操作指令;Generating a downlink signal; wherein, the downlink signal includes a target terminal identifier and an operation instruction for instructing the target terminal to operate;

向所述顺序最高的LoRa终端发送所述下行信号。Send the downlink signal to the LoRa terminal with the highest order.

所述处理器1401,还执行:The processor 1401 further executes:

接收所述顺序最高的LoRa终端发送的上行信号;其中,所述上行信号包括LoRa网关标识以及用于上报信息到所述LoRa网关的上报指令;Receive the uplink signal sent by the LoRa terminal with the highest order; wherein, the uplink signal includes a LoRa gateway identifier and a reporting instruction for reporting information to the LoRa gateway;

根据所述上行信号确定所述网关1400自身是否为所述LoRa网关;Determine whether the gateway 1400 itself is the LoRa gateway according to the uplink signal;

相应于确定所述LoRa网关1400自身是所述LoRa网关,获得所述上行信号中的所述上报指令。Corresponding to determining that the LoRa gateway 1400 itself is the LoRa gateway, the reporting instruction in the uplink signal is obtained.

相应地,本发明实施例再提供一种计算机存储介质,所述计算机可读存储介质上存储有通信程序,所述通信程序被处理器执行时实现本实施例提供的通信方法的步骤。Correspondingly, an embodiment of the present invention further provides a computer storage medium, where a communication program is stored on the computer-readable storage medium, and when the communication program is executed by a processor, the steps of the communication method provided in this embodiment are implemented.

应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本发明的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本发明的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present invention. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present invention, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, rather than the embodiments of the present invention. implementation constitutes any limitation. The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages or disadvantages of the embodiments.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

在本申请所提供的几个实施例中,应该理解到,所揭露的方法和装置,可以通过其它的方式实现。以上所描述的终端实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。In the several embodiments provided in this application, it should be understood that the disclosed method and apparatus may be implemented in other manners. The terminal embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined, or Can be integrated into another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.

上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit; it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may all be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by program instructions related to hardware, the aforementioned program can be stored in a computer-readable storage medium, and when the program is executed, the execution includes: The steps of the above method embodiments; and the aforementioned storage medium includes: a removable storage device, a read only memory (Read Only Memory, ROM), a magnetic disk or an optical disk and other media that can store program codes.

或者,本发明上述集成的单元如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台终端执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of software products in essence or the parts that make contributions to the prior art. The computer software products are stored in a storage medium and include several instructions for A terminal is caused to execute all or part of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.

以上所述,仅为本发明的实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above are only the embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art who is familiar with the technical scope disclosed by the present invention can easily think of changes or substitutions. Included within the scope of protection of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (23)

1. A communication method, applied to a first LoRa terminal, the method comprising:
receiving a downlink signal sent by a first superior network device; the downlink signal comprises a target terminal identifier and an operation instruction for indicating the target terminal to operate; the first superior network device comprises an LoRa gateway or a second LoRa terminal which is closer to the LoRa gateway than the first LoRa terminal;
determining whether the first LoRa terminal is the target terminal according to the downlink signal;
executing the operation instruction in the downlink signal corresponding to the determination that the first LoRa terminal is the target terminal;
and correspondingly determining that the first LoRa terminal is not the target terminal, and forwarding the downlink signal to a third LoRa terminal which is farther away from the LoRa gateway than the first LoRa terminal.
2. The method according to claim 1, wherein after said receiving the downlink signal transmitted by the first upper network device, the method further comprises:
sending a first response message to the first superior network device; the first response message is used for indicating that the first LoRa terminal receives the downlink signal;
receiving a second response message sent by the first superior network equipment; the second response message is used for indicating that the first LoRa terminal and the first superior network device complete signal transmission.
3. The method of claim 1, wherein the determining whether the first LoRa terminal is the target terminal according to the downlink signal comprises:
and determining whether the first LoRa terminal has the target terminal identification or not according to the target terminal identification in the downlink signal, and if the first LoRa terminal has the target terminal identification, determining that the first LoRa terminal is the target terminal.
4. The method of claim 1, wherein forwarding the downlink signal to a third LoRa terminal that is further away from the LoRa gateway than the first LoRa terminal comprises:
and acquiring a third LoRa terminal which is farther from the LoRa gateway than the first LoRa terminal according to a preset signal forwarding strategy, and forwarding the downlink signal to the third LoRa terminal.
5. The method according to claim 1 or 4, wherein the forwarding the downlink signal to a third LoRa terminal that is farther away from the LoRa gateway than the first LoRa terminal comprises:
and performing self-increment on the address of the first LoRa terminal, acquiring the address of the third LoRa terminal which is farther away from the LoRa gateway than the first LoRa terminal, and forwarding the downlink signal to the third LoRa terminal.
6. The method of claim 1, wherein forwarding the downlink signal to a third LoRa terminal that is further away from the LoRa gateway than the first LoRa terminal comprises:
forwarding the downlink signal to a fourth LoRa terminal; the fourth LoRa terminal is a terminal which is closest to the first LoRa terminal and is farther from the LoRa gateway than the first LoRa terminal;
determining whether a third response message sent by the fourth LoRa terminal is received; the third response message is used to indicate that the fourth LoRa terminal receives the downlink signal;
in response to determining that the first LoRa terminal receives the third response message sent by the fourth LoRa terminal, sending a fourth response message to the fourth LoRa terminal; the fourth response message is used for indicating that the first LoRa terminal and the fourth LoRa terminal complete signal transmission;
in response to determining that the first LoRa terminal does not receive the third response message sent by the fourth LoRa terminal, forwarding the downlink signal to a fifth LoRa terminal; the fifth loRa terminal is a terminal which is next close to the first loRa terminal and is farther from the loRa gateway than the first loRa terminal.
7. The method according to any one of claims 1-6, further comprising:
receiving an uplink signal sent by a second superior network device; the uplink signal comprises an LoRa gateway identifier and a reporting instruction used for reporting information to the LoRa gateway; the second superior network device is a sixth LoRa terminal that is farther from the LoRa gateway than the first LoRa terminal;
determining whether the first LoRa terminal is the LoRa gateway or not according to the uplink signal;
and correspondingly determining that the first LoRa terminal is not the LoRa gateway, and forwarding the uplink signal to a seventh LoRa terminal which is closer to the LoRa gateway than the first LoRa terminal.
8. The method according to claim 7, wherein after said receiving the uplink signal transmitted by the second superior network device, the method further comprises:
sending a fifth response message to the second superior network device; the fifth response message is used to indicate that the first LoRa terminal receives the uplink signal;
receiving a sixth response message sent by the second superior network device; the sixth response message is used to indicate that the first LoRa terminal and the second superior network device complete signal transmission.
9. The method of claim 7, wherein the determining whether the first LoRa terminal is the LoRa gateway according to the uplink signal comprises:
and determining whether the first LoRa terminal has the LoRa gateway identification or not according to the LoRa gateway identification in the uplink signal, and if the first LoRa terminal does not have the target terminal identification, determining that the first LoRa terminal is not the LoRa gateway.
10. The method of claim 7, wherein forwarding the upstream signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal comprises:
and according to a preset signal forwarding strategy, acquiring an address of the seventh LoRa terminal which is closer to the LoRa gateway than the first LoRa terminal, and forwarding the uplink signal to the seventh LoRa terminal.
11. The method according to claim 7 or 10, wherein said forwarding the upstream signal to a seventh LoRa terminal closer to the LoRa gateway than the first LoRa terminal comprises:
and performing self-subtraction on the address of the first LoRa terminal, acquiring the address of the seventh LoRa terminal which is closer to the LoRa gateway than the first LoRa terminal, and forwarding the uplink signal to the seventh LoRa terminal.
12. The method of claim 7, wherein forwarding the upstream signal to a seventh LoRa terminal that is closer to the LoRa gateway than the first LoRa terminal comprises:
forwarding the uplink signal to an eighth LoRa terminal; the eighth LoRa terminal is the terminal which is closest to the first LoRa terminal and closer to the LoRa gateway than the first LoRa terminal;
determining whether a seventh response message sent by the eighth LoRa terminal is received; wherein, the seventh response message is used to indicate that the eighth LoRa terminal receives the uplink signal;
in response to determining that the first LoRa terminal receives the seventh response message sent by the eighth LoRa terminal, sending an eighth response message to the eighth LoRa terminal; the eighth response message is used for indicating that the first LoRa terminal and the eighth LoRa terminal complete signaling;
in response to determining that the first LoRa terminal does not receive the seventh response message sent by the eighth LoRa terminal, forwarding the uplink signal to a ninth LoRa terminal; the ninth loRa terminal is a terminal which is next close to the first loRa terminal and is closer to the loRa gateway than the first loRa terminal.
13. A communication method is applied to an LoRa gateway, and comprises the following steps:
determining an LoRa terminal with the highest sequence from LoRa terminals governed by the LoRa gateway according to a preset sequencing strategy;
generating a downlink signal; the downlink signal comprises a target terminal identifier and an operation instruction for indicating the target terminal to operate;
and sending the downlink signal to the LoRa terminal with the highest sequence.
14. The method of claim 13, wherein after the sending the downlink signal to the highest-order LoRa terminal, the method further comprises:
receiving a ninth response message sent by the LoRa terminal with the highest sequence; the ninth response message is used to indicate that the LoRa terminal with the highest order receives the downlink signal;
sending a tenth response message to the LoRa terminal with the highest sequence; the tenth response message is used for indicating that the LoRa gateway and the LoRa terminal with the highest sequence complete signal transmission.
15. The method according to any one of claims 13-14, further comprising:
receiving an uplink signal sent by the LoRa terminal with the highest sequence; the uplink signal comprises an LoRa gateway identifier and a reporting instruction used for reporting information to the LoRa gateway;
determining whether the LoRa gateway is the LoRa gateway or not according to the uplink signal;
and correspondingly determining that the LoRa gateway is the LoRa gateway, and obtaining the reporting instruction in the uplink signal.
16. The method according to claim 15, wherein after the receiving the uplink signal transmitted by the highest-order LoRa terminal, the method further comprises:
sending an eleventh response message to the LoRa terminal with the highest sequence; wherein the eleventh response message is used to indicate that the LoRa gateway receives the uplink signal;
receiving a twelfth response message sent by the LoRa terminal with the highest sequence; the twelfth response message is used for indicating that the LoRa gateway and the LoRa terminal with the highest sequence complete signal transmission.
17. A communications apparatus, the apparatus comprising:
a first receiving unit, configured to receive a downlink signal sent by a first superior network device; the downlink signal comprises a target terminal identifier and an operation instruction for indicating the target terminal to operate; the first superior network device comprises an LoRa gateway or a second LoRa terminal which is closer to the LoRa gateway than the device;
a first determining unit, configured to determine whether the apparatus itself is the target terminal according to the downlink signal;
a first execution unit, configured to execute the operation instruction in the downlink signal in response to determining that the apparatus itself is the target terminal; and the number of the first and second groups,
and in response to determining that the apparatus itself is not the target terminal, forwarding the downlink signal to a third LoRa terminal that is further away from the LoRa gateway than the apparatus.
18. The apparatus of claim 17, further comprising:
the second receiving unit is used for receiving an uplink signal sent by a second superior network device; the uplink signal comprises an LoRa gateway identifier and a reporting instruction used for reporting information to the LoRa gateway; the second upper network device is a sixth LoRa terminal farther from the LoRa gateway than the apparatus;
a second determining unit, configured to determine whether the apparatus itself is the LoRa gateway according to the uplink signal;
and a second execution unit, configured to forward the uplink signal to a seventh LoRa terminal closer to the LoRa gateway than the apparatus in response to determining that the apparatus itself is not the LoRa gateway.
19. A communications apparatus, the apparatus comprising:
a third determining unit, configured to determine, according to a preset sorting policy, an LoRa terminal with a highest order from LoRa terminals governed by the apparatus itself;
a generating unit, configured to generate a downlink signal; the downlink signal comprises a target terminal identifier and an operation instruction for indicating the target terminal to operate;
and the sending unit is used for sending the downlink signal to the LoRa terminal with the highest sequence.
20. The method of claim 19, wherein the apparatus further comprises:
a third receiving unit, configured to receive an uplink signal sent by the LoRa terminal with the highest order; wherein the uplink signal comprises an identifier of the device and a reporting instruction for reporting information to the device;
a fourth determining unit, configured to determine whether the apparatus itself is the apparatus according to the uplink signal;
a third executing unit, configured to obtain the reporting instruction in the uplink signal in response to determining that the apparatus itself is the apparatus.
21. A communication terminal, characterized in that the terminal comprises a first communication bus, a first memory and a first processor; wherein,
the first communication bus is configured to realize connection communication among the components;
the first memory configured to store a computer program operable on the processor;
the first processor, when executing the computer program, is configured to perform the steps of the communication method of any of claims 1 to 12.
22. A communications gateway, characterized in that the gateway comprises a second communications bus, a second memory and a second processor; wherein,
the second communication bus is configured to realize connection communication among the components;
the second memory configured to store a computer program operable on the processor;
the second processor, when executing the computer program, is configured to perform the steps of the communication method of any of claims 13 to 16.
23. A computer storage medium, characterized in that it stores a communication program which, when executed by at least one processor, implements the steps of the method of the communication program according to any one of claims 1 to 12 or implements the steps of the method of the communication program according to any one of claims 13 to 16.
CN201810757553.XA 2018-07-11 2018-07-11 A communication method, device, terminal, gateway and computer storage medium Active CN110719580B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810757553.XA CN110719580B (en) 2018-07-11 2018-07-11 A communication method, device, terminal, gateway and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810757553.XA CN110719580B (en) 2018-07-11 2018-07-11 A communication method, device, terminal, gateway and computer storage medium

Publications (2)

Publication Number Publication Date
CN110719580A true CN110719580A (en) 2020-01-21
CN110719580B CN110719580B (en) 2023-08-15

Family

ID=69208970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810757553.XA Active CN110719580B (en) 2018-07-11 2018-07-11 A communication method, device, terminal, gateway and computer storage medium

Country Status (1)

Country Link
CN (1) CN110719580B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113411816A (en) * 2020-03-17 2021-09-17 阿里巴巴集团控股有限公司 Single-channel LoRa gateway and networking method thereof, and network server

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1426194A (en) * 2001-12-20 2003-06-25 深圳市中兴通讯股份有限公司上海第二研究所 Route processing method for multi-stage network management system
CN101764724A (en) * 2008-05-30 2010-06-30 当代天启技术(北京)有限公司 Methods of network deployment and data transmission of building automation system (BAS)
US20110106959A1 (en) * 2008-04-18 2011-05-05 France Telecom Method for transferring a flow between heterogeneous access points
US20160191443A1 (en) * 2014-12-31 2016-06-30 William Dudley Cloud-based delivery notifications for messaging systems
CN106792916A (en) * 2016-12-13 2017-05-31 浙江科技学院 A kind of mixed type remote-wireless sensor network system and its communication means
CN107612668A (en) * 2017-09-06 2018-01-19 深圳天珑无线科技有限公司 Communication means, device, terminal, server and storage medium based on LoRa
CN107888420A (en) * 2017-11-23 2018-04-06 北京安博通科技股份有限公司 A kind of management system of LAN forwarding unit
CN107911801A (en) * 2017-10-26 2018-04-13 上海宏力达信息技术股份有限公司 A kind of wireless communication system and method based on LoRa
CN107995634A (en) * 2017-11-23 2018-05-04 武汉民大信息科技有限公司 A kind of small-scale remote local area network system and its method of work based on LoRa
US20180139274A1 (en) * 2016-11-16 2018-05-17 Cisco Technology, Inc. Application based intelligent edge computing in a low power wide area network environment
US10004097B1 (en) * 2016-12-20 2018-06-19 Intel Corporation Reestablishment of a network connection with an end device node methods and apparatuses

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1426194A (en) * 2001-12-20 2003-06-25 深圳市中兴通讯股份有限公司上海第二研究所 Route processing method for multi-stage network management system
US20110106959A1 (en) * 2008-04-18 2011-05-05 France Telecom Method for transferring a flow between heterogeneous access points
CN101764724A (en) * 2008-05-30 2010-06-30 当代天启技术(北京)有限公司 Methods of network deployment and data transmission of building automation system (BAS)
US20160191443A1 (en) * 2014-12-31 2016-06-30 William Dudley Cloud-based delivery notifications for messaging systems
US20180139274A1 (en) * 2016-11-16 2018-05-17 Cisco Technology, Inc. Application based intelligent edge computing in a low power wide area network environment
CN106792916A (en) * 2016-12-13 2017-05-31 浙江科技学院 A kind of mixed type remote-wireless sensor network system and its communication means
US10004097B1 (en) * 2016-12-20 2018-06-19 Intel Corporation Reestablishment of a network connection with an end device node methods and apparatuses
CN107612668A (en) * 2017-09-06 2018-01-19 深圳天珑无线科技有限公司 Communication means, device, terminal, server and storage medium based on LoRa
CN107911801A (en) * 2017-10-26 2018-04-13 上海宏力达信息技术股份有限公司 A kind of wireless communication system and method based on LoRa
CN107888420A (en) * 2017-11-23 2018-04-06 北京安博通科技股份有限公司 A kind of management system of LAN forwarding unit
CN107995634A (en) * 2017-11-23 2018-05-04 武汉民大信息科技有限公司 A kind of small-scale remote local area network system and its method of work based on LoRa

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113411816A (en) * 2020-03-17 2021-09-17 阿里巴巴集团控股有限公司 Single-channel LoRa gateway and networking method thereof, and network server
CN113411816B (en) * 2020-03-17 2024-05-14 阿里巴巴集团控股有限公司 Single-channel LoRa gateway, networking method thereof and network server

Also Published As

Publication number Publication date
CN110719580B (en) 2023-08-15

Similar Documents

Publication Publication Date Title
CN112671638B (en) Gateway structure for multi-protocol conversion
CN103713608B (en) Wireless Internet of Things house system hierarchical network framework and its group-net communication method
CN108401041A (en) A kind of bimodulus heterogeneous network group-net communication method towards electric power information collection system
CN106792916A (en) A kind of mixed type remote-wireless sensor network system and its communication means
CN103874291A (en) Power line carrier-based intelligent networking control system and method
CN105392185B (en) A kind of networking method of smart machine, apparatus and system
CN108234562A (en) A kind of apparatus control method, control device and controlled plant
CN103873112A (en) Intelligent power line carrier synchronous control method
US20150103711A1 (en) Method for internet protocol-based sleep mode control using synchronization information
CN107666686A (en) Transmit the method and via node of data
CN105636022A (en) RSSI-based low-power consumption passive wireless node networking method
CN206704494U (en) More machine fishs based on ZigBee
CN107959921A (en) A kind of positioning via network system and method based on BLE technologies
CN108494687B (en) Wifi-based multi-path networking communication method and system for electric power information physical system
CN110719580B (en) A communication method, device, terminal, gateway and computer storage medium
CN206272855U (en) Hybrid Long Range Wireless Sensor Network System
CN101374155A (en) Method for locating client node in wireless netted network and wireless netted network system
CN204968114U (en) Bimodulus network coordination ware, bimodulus router and bimodulus mesh network deployment system
CN103458423B (en) The methods, devices and systems of transmitting cognitive stream between isomery cognition wireless network
CN106255167A (en) A kind of wireless sensor network based on low-power consumption lossy networks Routing Protocol and computational methods thereof
CN112004242B (en) Port mapping registration method and device of elevator terminal and computer equipment
JP7489400B2 (en) Receiver-centric communication with multiple network technologies for enhanced reliability.
CN114915936A (en) Wireless Mesh network system, connection method and transmission structure of sensing data
CN114449470A (en) A sensor data transmission method
KR102078780B1 (en) The apparatus and method of intelligent transmission in wireless personal area network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant