CN111328028B - Communication method and device - Google Patents

Communication method and device Download PDF

Info

Publication number
CN111328028B
CN111328028B CN202010017740.1A CN202010017740A CN111328028B CN 111328028 B CN111328028 B CN 111328028B CN 202010017740 A CN202010017740 A CN 202010017740A CN 111328028 B CN111328028 B CN 111328028B
Authority
CN
China
Prior art keywords
lora
data
data information
gateway
gateways
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010017740.1A
Other languages
Chinese (zh)
Other versions
CN111328028A (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.)
Hangzhou Hikvision System Technology Co Ltd
Original Assignee
Hangzhou Hikvision System Technology 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 Hangzhou Hikvision System Technology Co Ltd filed Critical Hangzhou Hikvision System Technology Co Ltd
Priority to CN202010017740.1A priority Critical patent/CN111328028B/en
Publication of CN111328028A publication Critical patent/CN111328028A/en
Application granted granted Critical
Publication of CN111328028B publication Critical patent/CN111328028B/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/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • 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/16Gateway arrangements

Abstract

The embodiment of the application provides a communication method and a device, wherein the method comprises the following steps: receiving a plurality of first data information sent by a plurality of lora gateways, wherein the first data information comprises data contents and data identifications corresponding to the data contents, the first data information is obtained by the lora gateways according to first data packets, and the first data packets are data packets broadcasted by lora equipment to the lora gateways; determining at least one target data message in the plurality of first data messages according to the data identifiers in the plurality of first data messages, wherein the same data identifier does not exist in the at least one target data message; and processing the data content in the at least one target data message. The communication method and the communication device provided by the embodiment of the application can solve the problem of unstable communication when the signal strength between the lora equipment and the corresponding lora gateway is weak.

Description

Communication method and device
Technical Field
The embodiment of the application relates to the technical field of communication, in particular to a communication method and device.
Background
The Lora is a wireless radio frequency technology with long distance, low power consumption and low speed, and the equipment terminal based on the Lora technology can be accessed to the internet through the Lora gateway to realize multi-level and wide-area networking interconnection.
The communication between the existing lora equipment and the lora gateway adopts a timing rotation training mode, a plurality of lora equipment can only correspond to one lora gateway, and due to the corresponding relation between the lora equipment and the lora gateway, when the signal intensity between the lora equipment and the corresponding lora gateway is weak, for example, in a scene that the lora equipment moves, the communication between the lora equipment and the lora gateway is unstable at the moment, so that the communication between the lora equipment and a network end is influenced.
Disclosure of Invention
The embodiment of the application provides a communication method and device, which are used for solving the problem of unstable communication when the signal strength between a lora device and a corresponding lora gateway is weak.
In a first aspect, an embodiment of the present application provides a communication method, where the method includes:
receiving a plurality of first data information sent by a plurality of lora gateways, wherein the first data information comprises data contents and data identifications corresponding to the data contents, the first data information is obtained by the lora gateways according to first data packets, and the first data packets are data packets broadcasted by lora equipment to the lora gateways;
determining at least one target data message in the plurality of first data messages according to the data identifiers in the plurality of first data messages, wherein the same data identifier does not exist in the at least one target data message;
and processing the data content in the at least one target data message.
In one possible implementation manner, determining at least one target data information in the plurality of first data information according to the data identifier in the plurality of first data information includes:
for each piece of first data information, after receiving the first data information sent by a lora gateway, acquiring a data identifier in the first data information;
judging whether a data identifier identical to the data identifier in the first data information exists or not;
if not, determining the first data information as the target data information.
In one possible implementation manner, the data identifier includes a device identifier and an uplink count value, where:
the equipment identification is used for indicating a lora equipment which broadcasts a first data packet to a lora gateway;
and the uplink count value is used for indicating the times of broadcasting the first data packet to the lora gateway by the lora equipment.
In one possible implementation, the method further includes:
determining second data information corresponding to the first lora equipment, wherein the second data information comprises data content and equipment identification of the first lora equipment;
determining a first lora gateway corresponding to the first lora equipment in the plurality of lora gateways;
and sending the second data information to the first lora gateway.
In a possible implementation manner, the determining, in the plurality of lora gateways, a first lora gateway corresponding to the first lora device further includes:
acquiring the signal intensity between each lora gateway in the plurality of lora gateways and the first lora device according to the first data information sent by the plurality of lora gateways;
and determining a first lora gateway corresponding to the first lora device in the plurality of lora gateways according to the signal strength between each lora gateway in the plurality of lora gateways and the first lora device.
In one possible implementation manner, determining, in the plurality of lora gateways, a first lora gateway corresponding to the first lora device according to a signal strength between each lora gateway in the plurality of lora gateways and the first lora device includes:
performing a first operation, the first operation comprising: obtaining ith first data information sent by an ith lora gateway, and obtaining the signal intensity of the ith lora gateway and the first lora equipment in the ith first data information, wherein the equipment identification of the first i first data information is the same; initially, i is 1, and i is an integer greater than or equal to 1;
performing a second operation, the second operation comprising: determining a lora gateway with the strongest signal intensity with the first lora device in the first i lora gateways as the first lora gateway, and updating i to be i + 1;
and repeatedly executing the first operation and the second operation to determine the first lora gateway.
In a possible implementation manner, the sending the second data information to the first lora gateway includes:
acquiring the state of the first lora gateway, wherein the state comprises an online state and an offline state;
and when the state of the first lora gateway is determined to be the online state, sending the second data information to the first lora gateway.
In one possible implementation, the method further includes:
determining the data transmission rate of the first lora device according to the signal intensity between the first lora device and the first lora gateway;
and sending the data transmission rate to the first lora gateway so that the first lora gateway sends the data transmission rate to the first lora device, wherein the data transmission rate is used for indicating the data transmission rate when the first lora device broadcasts the first data packet.
In a second aspect, an embodiment of the present application provides a communication apparatus, including:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a plurality of first data information sent by a plurality of lora gateways, the first data information comprises data contents and data identifications corresponding to the data contents, the first data information is obtained by the lora gateways according to a first data packet, and the first data packet is a data packet broadcasted by lora equipment to the lora gateways;
the determining module is used for determining at least one piece of target data information in the plurality of pieces of first data information according to the data identification in the plurality of pieces of first data information, and the same data identification does not exist in the at least one piece of target data information;
and the processing module is used for processing the data content in the at least one target data message.
In a possible implementation manner, the determining module is specifically configured to:
for each piece of first data information, after receiving the first data information sent by a lora gateway, acquiring a data identifier in the first data information;
judging whether a data identifier identical to the data identifier in the first data information exists or not;
if not, determining the first data information as the target data information.
In one possible implementation manner, the data identifier includes a device identifier and an uplink count value, where:
the equipment identification is used for indicating a lora equipment which broadcasts a first data packet to a lora gateway;
and the uplink count value is used for indicating the times of broadcasting the first data packet to the lora gateway by the lora equipment.
In one possible implementation, the processing module is further configured to:
determining second data information corresponding to the first lora equipment, wherein the second data information comprises data content and equipment identification of the first lora equipment;
determining a first lora gateway corresponding to the first lora equipment in the plurality of lora gateways;
and sending the second data information to the first lora gateway.
In a possible implementation manner, the first data information further includes a signal strength between the lora device and the lora gateway, and the processing module is further specifically configured to:
acquiring the signal intensity between each lora gateway in the plurality of lora gateways and the first lora device according to the first data information sent by the plurality of lora gateways;
and determining a first lora gateway corresponding to the first lora device in the plurality of lora gateways according to the signal strength between each lora gateway in the plurality of lora gateways and the first lora device.
In a possible implementation manner, the processing module is specifically further configured to:
performing a first operation, the first operation comprising: obtaining ith first data information sent by an ith lora gateway, and obtaining the signal intensity of the ith lora gateway and the first lora equipment in the ith first data information, wherein the equipment identification of the first i first data information is the same; initially, i is 1, and i is an integer greater than or equal to 1;
performing a second operation, the second operation comprising: determining a lora gateway with the strongest signal intensity with the first lora device in the first i lora gateways as the first lora gateway, and updating i to be i + 1;
and repeatedly executing the first operation and the second operation to determine the first lora gateway.
In a possible implementation manner, the processing module is specifically further configured to:
acquiring the state of the first lora gateway, wherein the state comprises an online state and an offline state;
and when the state of the first lora gateway is determined to be the online state, sending the second data information to the first lora gateway.
In one possible implementation, the processing module is further configured to:
determining the data transmission rate of the first lora device according to the signal intensity between the first lora device and the first lora gateway;
and sending the data transmission rate to the first lora gateway so that the first lora gateway sends the data transmission rate to the first lora device, wherein the data transmission rate is used for indicating the data transmission rate when the first lora device broadcasts the first data packet.
In a third aspect, an embodiment of the present application provides a communication device, including: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the communication method of any of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the communication method according to any one of the first aspect is implemented.
The communication method and the communication device provided by the embodiment of the application firstly receive a plurality of first data messages sent by a plurality of lora gateways, wherein the first data messages comprise data contents and data identifications corresponding to the data contents, determine at least one target data message in the plurality of first data messages according to the data identifications in the plurality of first data messages, wherein the same data identification does not exist in the at least one target data message, and finally process the data contents in the at least one target data message. According to the scheme provided by the embodiment of the application, when the lora equipment is communicated with the server, the lora gateway is used as a medium to conduct communication between the lora equipment and the server, the lora equipment broadcasts the first data packet to the lora gateway, then the lora gateway obtains the first data information according to the first data packet, and sends the first data information to the server. Because the first data packet is broadcasted to the lora gateway by the lora equipment, as long as the lora gateway can receive the first data packet broadcasted by the lora equipment, the lora gateway can send corresponding first data information to the server, so that the relation decoupling between the lora equipment and the lora gateway is realized, the message stability can be improved under the scene that the environment signal of the lora equipment is unstable, and the method is suitable for the scene that the lora equipment moves.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of a communication method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a communication method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a communication method provided in an embodiment of the present application;
fig. 4 is a schematic diagram of the movement of the lora device according to the embodiment of the present application;
fig. 5 is a schematic flow chart of lora gateway election provided in the embodiment of the present application;
fig. 6 is a schematic flow chart of second data information transmission according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a communication device according to an embodiment of the present application;
fig. 8 is a schematic hardware structure diagram of a communication device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
First, the concepts related to the embodiments of the present application will be explained.
And Lora: long range radio is a low-power consumption local area network wireless standard, is also a long-distance, low-power consumption and low-speed radio frequency technology, is farther than other wireless modes in propagation under the same power consumption condition, and can realize the unification of low power consumption and long distance.
LoraWAN, defines an end-to-end standard specification using Lora, a technology, and LoraWAN, a set of standard specifications.
EN: and the End Node realizes the equipment terminal of the Lora protocol, namely the Lora equipment.
GW: gateway, connected to EN, and bridge for connecting EN and network server.
And NS: the Network Server, the Network Server and a part of the Server directly communicate with the GW.
AS: the Application Server, the Application Server and a part of the Server are mainly responsible for data processing.
CS: client Server, part of Server.
NC: network Controller, Network control server, part of server.
OTAA: Over-The-Air Activation, is an Air network access mode of LoraWAN.
ABP: activation by Personalization, a simple mechanism for network access.
Loraserver: and the device gateway background scheduling management platform is arranged on the server under the LoraWAN environment, and all operations of the management platform are completed by the server.
RSSI: received Signal Strength Indication is an optional part of a wireless transmission layer, and is a positioning technology for measuring the distance between a Signal point and a receiving point according to the Strength of a Received Signal and further performing positioning calculation according to corresponding data.
Snr: signal-to-noise ratio, ratio of signal power to noise power.
Fig. 1 is a schematic view of an application scenario of a communication method provided in an embodiment of the present application, and as shown in fig. 1, the communication method includes a lora device 11, a lora gateway 12, and a server 13, where the lora device 11 and the lora gateway 12 may be connected through a wireless network, the lora gateway 12 and the server 13 may be connected through a wired or wireless network, and when the lora device 11 and the server 13 communicate with each other, data forwarding needs to be performed through the lora gateway.
The Lora device 11 may be a terminal device, the Lora device 11 may be in a stationary state or in a mobile state, one Lora device 11 may be in communication connection with a plurality of Lora gateways 12, and one Lora gateway 12 may also be in communication connection with a plurality of Lora devices 11. If the network environment changes or the location of the lora device 11 changes, the lora gateway 12 communicatively connected to the lora device 11 may also change.
When the lora device 11 sends the first data packet to the lora gateways 12 in a broadcast manner, the lora gateways 12 receive the first data packet, obtain first data information according to the first data packet, send the first data information to the server 13, and the server 13 performs deduplication processing on one or more pieces of received first data information, where the obtained first data information are all different. The finally obtained first data information can be processed correspondingly, for example, the internet is accessed.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a communication method according to an embodiment of the present application, and as shown in fig. 2, the method includes:
step 21, a server receives a plurality of first data information sent by a plurality of lora gateways, wherein the first data information includes data content and data identifiers corresponding to the data content, the first data information is obtained by the lora gateways according to a first data packet, and the first data packet is a data packet broadcasted by the lora equipment to the lora gateways.
The embodiment of the application relates to equipment on three sides, namely, a lora device, a lora gateway and a server, wherein when the lora device needs to send a first data packet to the server side, the lora device firstly sends the first data packet to a plurality of lora gateways in a broadcasting mode, the lora gateway capable of receiving the first data packet broadcasted by the lora device is the lora gateway capable of establishing communication connection with the lora device, and when the position of the lora device moves or the signal strength between the lora device and the lora gateway changes, the lora gateway capable of receiving the broadcast of the lora device can also change.
The first data packet comprises data content and a device identifier of the lora device, wherein the device identifier of the lora device is used for indicating the lora device broadcasting the first data packet. After receiving a first data packet broadcast by the lora device, the lora gateway obtains first data information according to the first data packet, wherein the first data information includes the content of the first data packet and also includes the signal strength between the lora device and the lora gateway.
The first data information includes data content and data identifier corresponding to the data content, where the data content is that the lora device needs to be transmitted to the server and then processed by the server, and the data identifier corresponding to the data content includes an uplink count value besides the device identifier of the lora device, where the uplink count value indicates the number of times that the lora device broadcasts the first data packet at different times, that is, broadcasts the first data packet. The up count value is 1 when the lora device broadcasts the first packet for the first time, 2 when the lora device broadcasts the first packet for the second time, 100 when the lora device broadcasts the first packet for the first hundred times, and so on. The data content in the first data packet broadcast by the Lora device at each time may be the same or different.
When the device identifiers in the data identifiers of the two pieces of first data information are the same and the uplink count values are the same, it indicates that the two pieces of first data information are obtained according to the first data packet broadcasted by the same lora device at one time, and at this time, the two pieces of first data information are the same data information. When the device identifiers in the data identifiers of the two pieces of first data information are the same but the uplink count values are different, it is indicated that the two pieces of first data information are respectively obtained according to two first data packets broadcast twice by the same lora device, and at this time, the two pieces of first data information are different data information. When the device identifiers in the data identifiers of the two pieces of first data information are different, the two pieces of first data information are obtained from two first data packets broadcast by two different lora devices, and the two pieces of first data information are different data information at this time. As can be seen from the above, only when the data identifiers of the two pieces of first data information are the same, the two pieces of first data information are the same data information, and according to the data identifiers, the two pieces of first data information can be used for deduplication of the data information.
Step 22, determining at least one target data information in the plurality of first data information according to the data identifier in the plurality of first data information, wherein the same data identifier does not exist in the at least one target data information.
Since there may be more than one first data information sent by the lora gateway received by the server, and there may be more than one lora gateway receiving the broadcast when the same lora device broadcasts the same first data packet, the server may receive multiple same first data information, and at this time, deduplication needs to be performed according to the data identifier. When the lora equipment broadcasts the first data packet to the plurality of lora gateways, the data identifications of the first data information received by the plurality of lora gateways are the same, so that the server can perform deduplication processing on the first data information with the same data identifications when receiving the plurality of first data information, and target data information is obtained, and space is saved.
And 23, processing the data content in the at least one target data message.
After the target data information is obtained, the data content in the target data information may be processed, for example, the data content in the target information may be uploaded to the internet or processed by other methods, so that the data content is transferred from the lora device to the server, and the communication between the lora device and the server is realized.
The communication method provided by the embodiment of the application comprises the steps of firstly receiving a plurality of first data messages sent by a plurality of lora gateways, wherein the first data messages comprise data contents and data identifications corresponding to the data contents, determining at least one target data message in the plurality of first data messages according to the data identifications in the plurality of first data messages, wherein the same data identification does not exist in the at least one target data message, and finally processing the data contents in the at least one target data message. According to the scheme provided by the embodiment of the application, when the lora equipment is communicated with the server, the lora gateway is used as a medium to conduct communication between the lora equipment and the server, the lora equipment broadcasts the first data packet to the lora gateway, then the lora gateway obtains the first data information according to the first data packet, and sends the first data information to the server. Because the first data packet is broadcasted to the lora gateway by the lora equipment, as long as the lora gateway can receive the first data packet broadcasted by the lora equipment, the lora gateway can send corresponding first data information to the server, so that the relation decoupling between the lora equipment and the lora gateway is realized, the message stability can be improved under the scene that the environment signal of the lora equipment is unstable, and the method is suitable for the scene that the lora equipment moves.
The embodiments of the present application will be described in detail with reference to specific examples.
Fig. 3 is a schematic diagram of a principle of a communication method provided in an embodiment of the present application, and as shown in fig. 3, the communication method includes a lora device 31, a lora gateway 32, and a lora device gateway access scheduling management platform 33, where the lora device gateway access scheduling management platform 33 may be a server. In one system, the lora devices 31 may include one or more, and two lora devices, device 1 and device 2, are shown in fig. 3. The lora gateway 32 also includes one or more, 3 lora gateways are shown in fig. 3, gateway 1, gateway 2, and gateway 3, respectively. The lora device gateway access scheduling management platform 33 (hereinafter referred to as a management platform) includes several modules, which are respectively WEB configuration operation management, device management, gateway management, message box unpacking, message deduplication forwarding, ADR data rate adaptive control, and downlink message gateway election, where different modules are responsible for different functions, and the functions of each part will be described in the following embodiments.
In the management platform, the gateway management module mainly manages the lora gateway, the management platform can be a server of a network side, and the management of the lora gateway can be completed through a background page on the server based on the network side, for example, operations such as adding the lora gateway, deleting the lora gateway and the like can be performed on the background page, when the lora gateway needs to be added, the name of the lora gateway, the description information of the lora gateway, the ID of the lora gateway and the downlink open port of the lora gateway are input, the lora gateway can be added into the downlink lora gateway of the management platform through inputting the information, and the lora gateway can be used as a medium for communication between the lora equipment and the management platform.
The device management module mainly manages the lora devices, wherein different access modes can be provided when the lora devices are added, for example, when an ABP mode is adopted, the access modes comprise inputting the names of the lora devices, the description information of the lora devices, the access modes of the lora devices, application session keys and communication session keys, and when an OTAA mode is adopted, the access modes comprise inputting the names of the lora devices, the description information of the lora devices, the access modes of the lora devices, the identifiers of the lora devices and the application identifiers.
In fig. 3, the lora device 31 needs to communicate with the management platform 33, and the lora gateway 32 is needed as an intermediate layer for conversion. In practice, the signal strength between each lora device and different lora gateways varies due to the influence of distance, network environment, and the like. In the previous scheme, one lora device can only correspond to one lora gateway, a corresponding relation exists between the lora device and the lora gateway, and the lora device can only send data information to the management platform through the lora gateway bound with the lora device. In the embodiment of the application, there is no such corresponding relationship between the lora device and the lora gateway, and the way for the lora device to send data to the lora gateway is to send a first data packet to all the lora gateways capable of generating communication connection with the lora device in a broadcast manner, where the first data packet includes data content and a data identifier corresponding to the data content. Then, the lora gateway receiving the first data packet processes the data packet to obtain first data information. The first data information includes the data content in the first data packet and the data identifier corresponding to the data content, and also includes the signal strength between the lora device and the lora gateway. The Lora gateway transmits the first data information to the management platform 33.
Fig. 4 is a schematic diagram of the movement of a lora device according to an embodiment of the present application, and as shown in fig. 4, the lora device includes one lora device, i.e., device 1, and also includes four lora gateways, i.e., gateway 1, gateway 2, gateway 3, and gateway 4. Initially, the device 1 is located at a position a, and at this time, the device 1 needs to send data to the management platform, and then the device 1 broadcasts a first data packet, where the first data packet includes data content and a device identifier of the device 1, where the device identifier is used to indicate a lora device that broadcasts the first data packet to a lora gateway. If the gateway 1 and the gateway 2 receive the broadcast information of the device 1, the gateway 1 and the gateway 2 process the received first data packet to obtain first data information, and then send the first data information to the management platform. The management platform in the embodiment of the present application is a management platform disposed on a server, and operations of the management platform are all performed by the server.
Because there are multiple gateways that receive the broadcast information, the server will receive the first data information sent by multiple gateways, and at this time, for each first data information, after receiving the first data information sent by the lora gateway, the server obtains the data identifier in the first data information. The data identification comprises an equipment identification and an uplink count value, wherein the equipment identification is used for indicating the lora equipment which broadcasts the first data packet to the lora gateway, and the uplink count value is used for indicating the times of broadcasting the first data packet to the lora gateway by the lora equipment. The increase of the uplink count value is controlled by the lora device, when the uplink count value is 1, the uplink count value is a first data packet broadcasted by the lora device for the first time, when the lora device broadcasts the first data packet for the second time, the corresponding uplink count value is increased by 1 and changed into 2, when the lora device broadcasts the first data packet for the third time, the corresponding uplink count value is continuously increased by 1 and changed into 3, and the like.
For example, the device 1 in fig. 4 broadcasts a first data packet, and after receiving the broadcasted first data packet, the gateway 1 and the gateway 2 respectively obtain respective first data information according to the first data packet and send the respective first data information to the server. After receiving the first data information sent by the gateway 1 and the gateway 2, the server can know that the first data information is obtained according to the first data packet broadcast by the device 1 according to the device identifier in the first data information, that is, the device identifier of the device 1. If the device 1 broadcasts the first data packet for the first time, the uplink count values in the first data information obtained by the gateway 1 and the gateway 2 according to the first data packet are both 1 at this time, which indicates that the same lora device is obtained in one broadcast at this time. If the uplink count values are different, it indicates that the two pieces of first data information are also different.
For each piece of first data information, after receiving the first data information, the server judges whether a data identifier identical to the data identifier in the first data information exists. If yes, the server is indicated to receive the data information which is the same as the first data information before receiving the first data information.
The judgment of the data identifier not only needs to judge whether the device identifier is the same, but also needs to judge whether the uplink count value is the same. Only if the device identifiers are the same and the uplink count values are the same, it can be confirmed that the first data information sent by the multiple gateways is obtained in one broadcast according to the same lora device and belongs to the same data information. The two pieces of first data information are considered to be different data information as long as one of the device identification and the uplink count value is different.
Therefore, after the server receives each piece of first data information, the data identifier of the first data information is matched with the data identifier of the received first data information, whether the data identifier identical to the data identifier in the first data information exists is judged, if yes, the first data information is the repeated data information, the data content in the first data information is filtered, and the signal strength between the lora device and the lora gateway in the first data information is reserved. If not, the first data information is indicated to be not received before, the first data information is determined as the target data information at the moment, the data content of the target data information is reserved, and meanwhile, the signal strength between the lora equipment and the lora gateway in the target data information is also reserved.
For example, in fig. 4, both the gateway 1 and the gateway 2 receive the first data packet broadcast by the device 1, and obtain the first data information according to the first data packet and send the first data information to the server. If the first data information sent by the gateway 1 is sent to the server, and the server judges that the data identifier of the first data information sent by the gateway 1 is different from the data identifier of the received data information, the data content in the first data information and the signal strength between the device 1 and the gateway 1 are reserved. After that, the server receives the first data information sent by the gateway 2, judges that the data identifier of the first data information sent by the gateway 2 is the same as the data identifier of the first data information sent by the gateway 1 before, and then confirms that the first data information sent by the gateway 2 is the repeated information, only the signal strength between the device 1 and the gateway 2 in the first data information sent by the gateway 2 is reserved, and the data content in the first data information sent by the gateway 2 is filtered.
When the device 1 moves to the position B, the communication connection between the device 1 and the gateways 1 and 2 is disconnected, that is, the device 1 cannot communicate with the gateways 1 and 2, and at the position B, the device 1 can establish communication with the gateways 3 and 4, at this time, the device 1 needs to send data to the server, the device 1 broadcasts the first data packet, and if the gateway 3 and the gateway 4 receive the broadcast information of the device 1, the gateway 3 and the gateway 4 process the received first data packet to obtain the first data information, and send the first data information to the server. It can be seen that, after the lora device is moved, the lora device can send the first data packet to the lora gateway capable of receiving the broadcast information in a broadcast manner, without forwarding through a fixed lora gateway.
If the lora device broadcasts, a plurality of lora gateways receive the broadcasted first data packet, the plurality of lora gateways send a plurality of first data information to the server, and at this time, the server repeatedly receives the plurality of first data information and needs to perform deduplication processing on the first data information.
After the lora device broadcasts the first packet each time, the Fcnt field in the lora protocol message body in the first packet is updated, and the Fcnt field in the lora protocol message body is equivalent to the uplink count value in the above embodiment. The upstream count (i.e., Fcnt field) is accumulated each time a new first packet is broadcast by the Lora device. For example, the uplink count value may be implemented by setting an uplink counter, and when the lora device broadcasts the first packet for the first time, the uplink count value in the first data information received by the server is 1, and when the lora device broadcasts the first packet for the second time, the uplink count value in the first data information received by the server is 2, and the uplink count values are sequentially accumulated.
And at the server side, after receiving the first data information sent by the lora gateway each time, acquiring the corresponding Fcnt field in the first data packet, and recording the Fcnt field corresponding to the latest lora equipment. And if the server receives the first data information and the Fcnt field in the data information is less than or equal to the Fcnt field corresponding to the latest lora device recorded in the server, the first data information is considered to be repeated or overtime data information, and the data information is not processed.
The Fcnt field corresponding to the latest lora device recorded at the server side can be regarded as a local count value, and when the server receives the first data information sent by the lora gateway, the server obtains an uplink count value in the first data information and updates the local count value according to the uplink count value in the first data information.
The local count value is a numerical value stored in the server side and is updated according to the first data information sent by the lora gateway. For example, when a certain lora device broadcasts a first data packet for the first time, the lora gateway obtains first data information according to the first data packet and sends the first data information to the server, and obtains an uplink count value 1 in the first data information, where the local count value is 1. When the lora device broadcasts the first data packet for the nth time, the lora gateway obtains the first data information for the nth time according to the first data packet broadcasted for the nth time, and sends the first data information for the nth time to the server, and if an uplink count value in the first data information for the nth time is n, the local count value is updated to be n.
For example, if the local count value recorded by the server side is 100 (i.e., the Fcnt field corresponding to the latest lora device recorded by the server side), and at this time, the server receives the first data message sent by the lora gateway, and the uplink count value in the first data message is 98, which is smaller than 100, the server determines that the first data message is a duplicate data message or a timeout data message, and does not process the data message, where the duplicate data message is the same first data message that has been received before, and the timeout data message is the first data message that is received after a certain time period due to network delay.
It should be noted that, when not all the uplink count values are smaller than the local count value, the corresponding first data information is determined to be the repeated or overtime data information, and when the lora device is restarted, the uplink count value of the lora device is reset, and at this time, the uplink count value is accumulated from 0 again. If the lora device broadcasts the first data packet, the first data information is obtained through the lora gateway and sent to the server side, the uplink count value of the first data information may be smaller than the local count value, but the first data information is neither repeated nor overtime data information.
In order to avoid determining the reset first data information as the data information received repeatedly or overtime, in the embodiment of the present application, a threshold MAX _ FCNT _ DROP is set. When the difference value between the local count value and the upper and lower count values is greater than or equal to the threshold value, the lora device is considered to be restarted, the corresponding uplink counter is reset, and at the moment, after the server receives the first data information, the server needs to process the first data information, so that the problem of data information loss caused by the restart of the lora device is solved.
The corresponding decision formula is as follows:
when K1-K2> -MAX _ FCNT _ DROP, the lora device is judged to be restarted,
wherein, K1 is the local count value, and K2 is the ascending count value.
The calculation formula of the threshold is as follows:
MAX_FCNT_DROP=u*t+1,
and u is the frequency of broadcasting the first data packet by the lora equipment, and t is the longest transmission time from the lora equipment broadcasting the first data packet to the server receiving the corresponding first data information.
The above formula indicates that, when the difference between the local count value and the uplink count value is greater than or equal to the threshold MAX _ FCNT _ DROP, it is determined that the corresponding lora device is restarted, and at this time, the first data information received by the server and sent by the lora gateway is obtained by the lora gateway according to the first data packet broadcast by the restarted lora device, and the first data information is neither repeated nor overtime received data information. And when the difference value between the local count value and the uplink count value is smaller than the threshold value MAX _ FCNT _ DROP, determining that the first data information sent by the lora gateway received by the server at the moment is the repeated or overtime received data information.
For example, the threshold MAX _ FCNT _ DROP is 3, and the local count value recorded by the server side is 100. If the server receives the first data information of the lora gateway at this time, the uplink count value of the first data information is 97, the difference value between the local count value 100 and the uplink count value 97 is 3, and the threshold value MAX _ FCNT _ DROP is not exceeded, the first data information is determined to be the data information received repeatedly or overtime at this time, and the first data information is not processed; if the server receives the first data information of the lora gateway, the uplink count value of the first data information is 1, the difference value between the local count value 100 and the uplink count value 1 is 99, and the difference value exceeds the threshold value MAX _ FCNT _ DROP, it is determined that the first data information is obtained according to the first data packet broadcasted after the lora device is restarted, and the first data information needs to be processed.
Further, in addition to setting the uplink counter to record the uplink count value, the downlink counter may be set to record the downlink count value. The uplink count value recorded by the uplink counter refers to the number of times a first packet is broadcast by one lora device. The increase of the uplink count value is controlled by the lora equipment, and the server can perform duplicate removal processing on the first data information through the uplink count value and the equipment identifier carried in the first data information.
The downlink count value recorded by the downlink counter refers to the number of times that the server transmits the second data information to the lora device through the lora gateway. After the server records the uplink frames sent by the lora devices, a downlink counter can be created for each lora device. The increase of the downlink count value is controlled by the server, and the lora device can perform deduplication processing on the second data information through the downlink count value carried in the second data information. After one data information exchange or after the personalized lora device is reset, both the uplink counter of the lora device and the downlink counter corresponding to the lora device on the server are reset to 0. After that, each time one of the parties sends a new data frame, the counter controlled by the sender is incremented by 1. The link counter corresponding to the receiver remains synchronized with the receiver after the check is passed.
Specifically, when the server sends the second data information to the plurality of lora gateways, the plurality of lora gateways process the second data information and then send the second data information to the lora equipment. Because the second data information is processed by the plurality of lora gateways and then is sent to the lora equipment, when the server sends the second data information to the plurality of lora gateways each time, the downlink count value can be included in the second data information, and the lora equipment carries out deduplication processing on the second data information according to the downlink count value in the received second data information. The second data information sent by the server to the lora device may be feedback of the data information sent by the lora device to the server, or may be information actively sent by the server to the lora device.
When a server wants to send data information to a certain lora device, it is determined to which lora device the server needs to send the data information to, where the lora device to which the data information needs to be sent is a first lora device, and the first lora device is any one of the plurality of lora devices.
After the first lora device is determined, second data information corresponding to the first lora device is determined, the second data information comprises data content and a device identification of the first lora device, and the second data information can be determined to be sent to the first lora device according to the device identification of the first lora device.
After the second data information is determined, the second data information needs to be sent through the lora gateway. Different from the sending of the uplink message, in the embodiment of the present application, the server sends the second data information to the first lora device through one lora gateway, instead of sending the second data information through a plurality of lora gateways, so that the first lora gateway corresponding to the first lora device is determined in the plurality of lora gateways, and then the first lora gateway sends the second data information to the first lora device. When the server sends the second data information to the first lora device through the first lora gateway, the first lora device only receives the second data information through the first lora gateway, and does not receive the second data information through other lora gateways, so that the second data information received by the first lora device is not repeatedly received, and deduplication processing is not needed. At this time, the server side may not be provided with a downlink counter to record the downlink count value.
In the embodiment of the application, the signal strength between each lora gateway in the lora gateways and the first lora device is obtained according to the first data information sent by the lora gateways, and then the first lora gateway corresponding to the first lora device is determined according to the signal strength between each lora gateway and the first lora device.
Specifically, a first operation is performed, where the first operation includes: obtaining ith first data information sent by an ith lora gateway, and obtaining the signal intensity of the ith lora gateway and the first lora equipment in the ith first data information, wherein the equipment identification of the first i first data information is the same; initially, i is 1, and i is an integer greater than or equal to 1.
The method comprises the steps that a first data packet is broadcasted at a first lora device, a plurality of lora gateways send first data information to a server, and after the server obtains the first data information sent by one lora gateway, the signal intensity between the lora gateway and the first lora device is obtained according to the first data information.
Performing a second operation, the second operation comprising: and determining the lora gateway with the strongest signal intensity with the first lora equipment in the first i lora gateways as the first lora gateway, and updating the i to be i + 1.
After the server acquires the first data information sent by one lora gateway, the reselection of the gateway is triggered, and the lora gateway with the strongest signal intensity with the first lora device is determined as the first lora gateway. Optionally, in this embodiment of the present application, the signal strength of the lora gateway and the first lora device may be the signal strength analyzed in the first data information once, or may be the signal strength analyzed in the first data information obtained during multiple data transmissions between the lora gateway and the first lora device.
And repeatedly executing the first operation and the second operation to obtain the first lora gateway.
This will be explained below with reference to fig. 5.
Fig. 5 is a schematic flow chart of lora gateway election provided in the embodiment of the present application, and as shown in fig. 5, the method includes:
s51, the lora gateway receives the first packet broadcast by the first lora device.
There may be more than one lora gateway receiving the first data packet broadcasted by the first lora device, and if there is only one lora gateway receiving the broadcast, the lora gateway is determined to be the first lora gateway, and a subsequent gateway election process is not needed. If there are multiple lora gateways receiving the broadcast, subsequent gateway elections are required.
And S52, the lora gateway processes the first data packet to obtain first data information and sends the first data information to the server.
The first data packet comprises data content and a data identifier, wherein the data identifier comprises an uplink count value and a device identifier, and the first data information comprises the signal strength between the lora device and the lora gateway besides the data content and the data identifier. And selecting a gateway aiming at one lora device, wherein the device identifiers of the first data information are the same and indicate the first lora devices.
And S53, the server receives the first data information and obtains the signal strength between the lora gateway and the lora equipment according to the first data information.
The server receives first data information sent by the lora gateway, wherein the device identification of each first data information is the same, but the uplink count value may be different, which indicates that the lora gateway with the strongest signal strength with the first lora device can be determined comprehensively according to multiple information transmissions between the lora gateway and the first lora device, but is not limited to be determined according to one information transmission.
S54, the server judges whether the lora gateway which sends the first data information is the election gateway or not, if yes, S55 is executed, and if not, S56 is executed.
And after receiving the first data information, judging whether the current lora gateway sending the first data information is an election gateway or not, wherein the election gateway is the first lora gateway.
And S55, judging whether the signal intensity between the gateway and the lora equipment is enhanced, if so, ending the process, and if not, executing S57.
If the lora gateway sending the first data information is the election gateway, whether the signal intensity between the lora gateway and the first lora device is enhanced or not is judged according to the first data information, if yes, the lora gateway is still the election gateway, and if not, the gateway election needs to be carried out again. The method for judging whether the signal strength between the lora gateway and the first lora device is enhanced may be that the signal strengths carried in two pieces of first data information sent by the lora gateway are compared, and the two pieces of first data information for signal strength comparison are obtained by the lora gateway through broadcasting the first data packet twice by the first lora device. If the signal strength carried in the first data information of the next time is higher than the signal strength carried in the first data information of the previous time, the signal strength between the lora gateway and the first lora device is enhanced, otherwise, the signal strength between the lora gateway and the first lora device is not enhanced.
And S56, comparing the signal strength of the lora gateway which sends the first data information with the signal strength of the election gateway.
And if the lora gateway of the first data information sent currently is not the election gateway, triggering gateway election.
And S57, performing gateway election again.
And S58, judging whether the signal intensity of the lora gateway which sends the first data information at present is higher than that of the election gateway, if so, executing S59, and if not, ending the process.
And S59, replacing the current election gateway with the lora gateway which currently sends the first data information, and ending the process.
And if the signal intensity of the lora gateway which sends the first data information is higher than that of the election gateway, determining the lora gateway which sends the first data information as a new election gateway, and otherwise, not performing the election gateway replacement operation.
Fig. 6 is a schematic flow chart of sending second data information according to an embodiment of the present application, and as shown in fig. 6, the flow chart includes:
and S61, the server selects the current elected lora gateway to issue a downlink message.
The downlink message is second data information that the server needs to send to the first lora device. The server needs to send the second data information to the first lora device through the currently elected first lora gateway.
S62, judging whether the current elected lora gateway is in an online state, if so, executing S63, and if not, executing S64;
and the first lora gateway is a current elected gateway, and the state of the first lora gateway is judged before the second data information is sent through the first lora gateway. Wherein the status includes an online status and an offline status.
When the lora gateway is in the offline state, it indicates that the lora gateway is not in the working state, and at this time, even if the signal strength between the lora gateway and the first lora device is strong, data information transmission between the server and the lora gateway cannot be performed, so in the embodiment of the present application, the state of the first lora gateway needs to be determined first. The determining method may be that the server sends a heartbeat packet to the first lora gateway according to a preset time interval, and after receiving a response of the heartbeat packet of the first lora gateway within a certain time interval, the first lora gateway is determined to be the lora gateway in the online state, otherwise, the first lora gateway is determined to be the lora gateway in the offline state.
And S63, sending the second data information to the first lora gateway.
After determining that the first lora gateway is in the online state, the server may send the second data information to the first lora gateway, and the first lora gateway processes the second data information and sends the second data information to the first lora device.
And S64, re-determining the first lora gateway.
S65, determining whether the first lora device successfully receives the second data information, if yes, ending the process, otherwise, executing S64.
The method comprises the steps that a lora gateway issues heartbeat packets to a server at regular time to keep the online state of the lora gateway, the server issues downlink messages to actively detect the current online state of a first lora gateway, and the first lora gateway is triggered to reselect when being offline.
The server issues a downlink message connection failure to a first lora gateway of the lora equipment, removes the first lora gateway with abnormal connection, and triggers the lora gateway to reselect.
And when the selected first lora gateway is in an offline state or the first lora gateway fails to send the second data information to the first lora device, re-determining the first lora gateway, and then re-sending the second data information to the first lora device by the newly determined first lora gateway.
Meanwhile, the method also comprises the real-time updating of the state information of the lora gateway, when the lora gateway sends the first data information to the server, the lora gateway reports the signal intensity of the lora gateway and the first lora device, then the server obtains the real-time signal intensity of the first lora device and the lora gateway in real time, when the first lora device moves or the network environment between the first lora device and the lora gateway changes, so that the lora gateway with the highest signal intensity is compared with the current first lora gateway, and therefore when the signal intensity of the current first lora gateway is attenuated, the first lora gateway is updated and re-election is carried out.
In the embodiment of the application, when the lora equipment broadcasts the first data packet to the lora gateway, the data rate can be adaptively adjusted, and the lora network allows the lora equipment to use all available data rates one by one. The loran protocol adjusts and optimizes the data rate of the static lora device according to the characteristics, which is called data rate Adaptation (ADR). When ADRs are available, the network will optimize the data rate to make it use as fast as possible.
If ADR is set to 1, the management platform can control the data rate of the lora device through the MAC command. If ADR is set to 0, the server does not make any adjustments to the data rate of the lora device, regardless of the quality of the received signal, and the lora device or the network decides whether to use ADR or not. In some embodiments, turning on the ADR under the allowed conditions can extend battery life of the lora devices, making full use of network bandwidth.
Specifically, the server determines the data transmission rate of the first lora device according to the signal intensity between the first lora device and the first lora gateway;
and then sending a data transmission rate to the first lora gateway so that the first lora gateway sends the data transmission rate to the first lora device, wherein the data transmission rate is used for indicating the data transmission rate when the first lora device broadcasts the first data packet.
In the embodiment of the application, the server notifies the lora gateway of the result of the data transmission rate attenuation of the lora device, and meanwhile, after the lora device reaches the rate enhancement standard, the management platform notifies the lora device of the adjusted data transmission rate through a Mac command by using the first lora gateway (namely, the election gateway).
The server can adjust the data transmission rate between the first lora device and the lora gateway according to the signal strength and the data identification between the first lora device and the first lora gateway. Wherein, the data transmission rate is divided into 5 stages in total, table 1 is a table of correspondence between the data transmission rate and the spreading factor, and 0-5 is used in table 1 to represent the 5-stage data transmission rate, where SF represents the spreading factor and indicates that the physical bit rate is the signal transmission rate.
TABLE 1
Data rate Configuration of Indicating physical bit rate
0 Lora:SF12/125kHz 250
1 Lora:SF11/125kHz 440
2 Lora:SF10/125kHz 980
3 Lora:SF9/125kHz 1760
4 Lora:SF8/125kHz 3125
5 Lora:SF7/125kHz 5470
And continuously receiving the messages of the same lora equipment twice, wherein the RSSI is more than-75, the Snr is more than 10, and the spreading factor is more than 9, and then the spreading factor of the lora equipment is adjusted to be 9. Receiving the message of the same lora equipment twice continuously, wherein the RSSI is greater than-85, the Snr is greater than 0, and the spreading factor is greater than 10, and then the spreading factor of the lora equipment is adjusted to be 10; and continuously receiving the messages of the same lora equipment twice, wherein the RSSI is greater than-95, the Snr is greater than-5, and the spreading factor is greater than 11, and then the spreading factor of the lora equipment is adjusted to be 11.
Table 1 shows the adjustment mode of the data rate and the threshold value, where the threshold value is obtained after a field scene test, and the threshold value is the RSSI threshold value, and the data rate adjustment mode is set. For example, when RSSI is greater than-75, adjust data transmission rate to 1760 (indicating physical bit rate), -75 is a threshold value; when the RSSI is greater than-85, the data transmission rate is adjusted to 980 (indicating the physical bit rate), -85 is a threshold value, and so on. The setting of the threshold value in table 1 is only an example, the setting of the actual threshold value is not limited thereto, and the specific value of the threshold value may be modified according to the actual measurement condition.
The embodiment of the application carries out single gateway test and double gateway test. During single gateway testing, the lora gateway is deployed on a certain desktop, and 6 lora devices are set as testing nodes while 0dbi antenna is adopted. And during the double-gateway test, adding a lora gateway on the basis of the single gateway, wherein the distance between the added lora gateway and the previous lora gateway is about 30 meters.
The precondition of the test node is as follows:
node frequency: 472-473.4MHz (random channel);
spreading factor SF-10;
data information length: 51 bytes;
the air time length of the single packet of data is 616 ms;
the acknowledgement and rate adaptation functions are not turned on.
Average occupancy of channel is the time length of air occupied by a single node per minute and the number of test nodes/(number of channels 1 minute).
Table 2 is a packet receiving rate statistics table obtained by testing a single gateway and a dual gateway in the same environment.
TABLE 2
Figure BDA0002359544950000211
It can be seen that when the dual gateways are adopted, the packet receiving rate under the same condition is higher than that of the single gateway, and by adopting the dynamic routing mode of the lora gateway provided by the embodiment of the application, the packet receiving rate of the device in the lorawan can be improved.
The communication method provided by the embodiment of the application comprises the steps of firstly receiving a plurality of first data messages sent by a plurality of lora gateways, wherein the first data messages comprise data contents and data identifications corresponding to the data contents, determining at least one target data message in the plurality of first data messages according to the data identifications in the plurality of first data messages, wherein the same data identification does not exist in the at least one target data message, and finally processing the data contents in the at least one target data message. According to the scheme provided by the embodiment of the application, when the lora equipment is communicated with the server, the lora gateway is used as a medium to conduct communication between the lora equipment and the server, the lora equipment broadcasts the first data packet to the lora gateway, then the lora gateway obtains the first data information according to the first data packet, and sends the first data information to the server. Because the first data packet is broadcasted to the lora gateway by the lora equipment, as long as the lora gateway can receive the first data packet broadcasted by the lora equipment, the lora gateway can send corresponding first data information to the server, so that the relation decoupling between the lora equipment and the lora gateway is realized, the message stability can be improved under the scene that the environment signal of the lora equipment is unstable, and the method is suitable for the scene that the lora equipment moves. Meanwhile, the scheme provided by the embodiment of the application supports the rate self-adaptation of the lora equipment, and the server can adjust the rate of the data information sent by the lora equipment to the lora gateway according to the signal intensity between the lora equipment and the lora gateway, so that the power consumption of the lora equipment is reduced, and the electric quantity of the lora equipment is saved. The server supports the multi-gateway management mode message processing and duplicate removal of the lora equipment, supports the election of the lora gateway, and supports the retransmission of the downlink data information to increase the stability of the downlink information under the abnormal condition of the network.
Fig. 7 is a schematic structural diagram of a communication apparatus according to an embodiment of the present application, and as shown in fig. 7, the communication apparatus includes a receiving module 71, a determining module 72, and a processing module 73, where:
the receiving module 71 is configured to receive multiple pieces of first data information sent by multiple lora gateways, where the first data information includes data content and data identifiers corresponding to the data content, the first data information is obtained by the lora gateways according to a first data packet, and the first data packet is a data packet broadcast by the lora device to the lora gateways;
the determining module 72 is configured to determine at least one target data information from the plurality of first data information according to the data identifier in the plurality of first data information, where the same data identifier does not exist in the at least one target data information;
the processing module 73 is configured to process data content in the at least one target data information.
In a possible implementation manner, the determining module 72 is specifically configured to:
for each piece of first data information, after receiving the first data information sent by a lora gateway, acquiring a data identifier in the first data information;
judging whether a data identifier identical to the data identifier in the first data information exists or not;
if not, determining the first data information as the target data information.
In one possible implementation manner, the data identifier includes a device identifier and an uplink count value, where:
the equipment identification is used for indicating a lora equipment which broadcasts a first data packet to a lora gateway;
and the uplink count value is used for indicating the times of broadcasting the first data packet to the lora gateway by the lora equipment.
In a possible implementation manner, the processing module 73 is further configured to:
determining second data information corresponding to the first lora equipment, wherein the second data information comprises data content and equipment identification of the first lora equipment;
determining a first lora gateway corresponding to the first lora equipment in the plurality of lora gateways;
and sending the second data information to the first lora gateway.
In a possible implementation manner, the first data information further includes a signal strength between the lora device and the lora gateway, and the processing module 73 is further specifically configured to:
acquiring the signal intensity between each lora gateway in the plurality of lora gateways and the first lora device according to the first data information sent by the plurality of lora gateways;
and determining a first lora gateway corresponding to the first lora device in the plurality of lora gateways according to the signal strength between each lora gateway in the plurality of lora gateways and the first lora device.
In a possible implementation manner, the processing module 73 is further specifically configured to:
performing a first operation, the first operation comprising: obtaining ith first data information sent by an ith lora gateway, and obtaining the signal intensity of the ith lora gateway and the first lora equipment in the ith first data information, wherein the equipment identification of the first i first data information is the same; initially, i is 1, and i is an integer greater than or equal to 1;
performing a second operation, the second operation comprising: determining a lora gateway with the strongest signal intensity with the first lora device in the first i lora gateways as the first lora gateway, and updating i to be i + 1;
and repeatedly executing the first operation and the second operation to determine the first lora gateway.
In a possible implementation manner, the processing module 73 is further specifically configured to:
acquiring the state of the first lora gateway, wherein the state comprises an online state and an offline state;
and when the state of the first lora gateway is determined to be the online state, sending the second data information to the first lora gateway.
In a possible implementation manner, the processing module 73 is further configured to:
determining the data transmission rate of the first lora device according to the signal intensity between the first lora device and the first lora gateway;
and sending the data transmission rate to the first lora gateway so that the first lora gateway sends the data transmission rate to the first lora device, wherein the data transmission rate is used for indicating the data transmission rate when the first lora device broadcasts the first data packet.
The apparatus provided in the embodiment of the present application may be configured to implement the technical solution of the method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 8 is a schematic diagram of a hardware structure of a communication device according to an embodiment of the present application, and as shown in fig. 8, the communication device includes: at least one processor 81 and a memory 82. The processor 81 and the memory 82 are connected by a bus 83.
Optionally, the model determination further comprises a communication component. For example, the communication component may include a receiver and/or a transmitter.
In particular implementations, the at least one processor 81 executes computer-executable instructions stored by the memory 82 to cause the at least one processor 81 to perform the communication methods described above.
For a specific implementation process of the processor 81, reference may be made to the above method embodiments, which implement the principle and the technical effect similarly, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 8, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the communication method as described above is implemented.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
The division of the units is only a logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (11)

1. A communication method applied to a server is characterized by comprising the following steps:
receiving a plurality of first data information sent by a plurality of lora gateways, wherein the first data information comprises data contents and data identifications corresponding to the data contents, the first data information is obtained by the lora gateways according to first data packets, and the first data packets are data packets broadcasted by lora equipment to the lora gateways;
determining at least one target data message in the plurality of first data messages according to the data identifiers in the plurality of first data messages, wherein the same data identifier does not exist in the at least one target data message;
and processing the data content in the at least one target data message.
2. The method of claim 1, wherein determining at least one target data information from the plurality of first data information according to the data identifier of the plurality of first data information comprises:
for each piece of first data information, after receiving the first data information sent by a lora gateway, acquiring a data identifier in the first data information;
judging whether a data identifier identical to the data identifier in the first data information exists or not;
if not, determining the first data information as the target data information.
3. The method of claim 2, wherein the data identifier comprises a device identifier and an uplink count value, and wherein:
the equipment identification is used for indicating a lora equipment which broadcasts a first data packet to a lora gateway;
and the uplink count value is used for indicating the times of broadcasting the first data packet to the lora gateway by the lora equipment.
4. The method according to any one of claims 1-3, further comprising:
determining second data information corresponding to the first lora equipment, wherein the second data information comprises data content and equipment identification of the first lora equipment;
determining a first lora gateway corresponding to the first lora equipment in the plurality of lora gateways;
and sending the second data information to the first lora gateway.
5. The method of claim 4, wherein the first data information further includes signal strength between a lora device and a lora gateway, and determining a first lora gateway corresponding to the first lora device in the plurality of lora gateways comprises:
acquiring the signal intensity between each lora gateway in the plurality of lora gateways and the first lora device according to the first data information sent by the plurality of lora gateways;
and determining a first lora gateway corresponding to the first lora device in the plurality of lora gateways according to the signal strength between each lora gateway in the plurality of lora gateways and the first lora device.
6. The method of claim 5, wherein determining, in the plurality of lora gateways, a first lora gateway corresponding to the first lora device according to the signal strength between each lora gateway in the plurality of lora gateways and the first lora device comprises:
performing a first operation, the first operation comprising: obtaining ith first data information sent by an ith lora gateway, and obtaining the signal intensity of the ith lora gateway and the first lora equipment in the ith first data information, wherein the equipment identification of the first i first data information is the same; initially, i is 1, and i is an integer greater than or equal to 1;
performing a second operation, the second operation comprising: determining a lora gateway with the strongest signal intensity with the first lora device in the first i lora gateways as the first lora gateway, and updating i to be i + 1;
and repeatedly executing the first operation and the second operation to determine the first lora gateway.
7. The method of claim 6, wherein sending the second data information to the first lora gateway comprises:
acquiring the state of the first lora gateway, wherein the state comprises an online state and an offline state;
and when the state of the first lora gateway is determined to be the online state, sending the second data information to the first lora gateway.
8. The method of claim 5, further comprising:
determining the data transmission rate of the first lora device according to the signal intensity between the first lora device and the first lora gateway;
and sending the data transmission rate to the first lora gateway so that the first lora gateway sends the data transmission rate to the first lora device, wherein the data transmission rate is used for indicating the data transmission rate when the first lora device broadcasts the first data packet.
9. A communication device provided on a server, comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a plurality of first data information sent by a plurality of lora gateways, the first data information comprises data contents and data identifications corresponding to the data contents, the first data information is obtained by the lora gateways according to a first data packet, and the first data packet is a data packet broadcasted by the lora equipment to the lora gateways;
the determining module is used for determining at least one piece of target data information in the plurality of pieces of first data information according to the data identification in the plurality of pieces of first data information, and the same data identification does not exist in the at least one piece of target data information;
and the processing module is used for processing the data content in the at least one target data message.
10. A communication device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the communication method of any of claims 1 to 8.
11. A computer-readable storage medium having stored thereon computer-executable instructions which, when executed by a processor, implement the communication method of any one of claims 1 to 8.
CN202010017740.1A 2020-01-08 2020-01-08 Communication method and device Active CN111328028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010017740.1A CN111328028B (en) 2020-01-08 2020-01-08 Communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010017740.1A CN111328028B (en) 2020-01-08 2020-01-08 Communication method and device

Publications (2)

Publication Number Publication Date
CN111328028A CN111328028A (en) 2020-06-23
CN111328028B true CN111328028B (en) 2021-10-08

Family

ID=71172502

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010017740.1A Active CN111328028B (en) 2020-01-08 2020-01-08 Communication method and device

Country Status (1)

Country Link
CN (1) CN111328028B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111246529B (en) * 2020-01-17 2022-04-01 广东中电富嘉工贸有限公司 Communication switching method and device of electronic shackle based on LoRa technology, electronic equipment and storage medium
CN115396503B (en) * 2021-05-24 2023-11-24 阿里巴巴新加坡控股有限公司 Information processing system, method for realizing information processing by information processing system and gateway
CN113438729B (en) * 2021-08-25 2021-11-12 伏诺瓦(天津)科技有限公司 Lora sub-equipment registration method and device based on carrier channel monitoring mechanism
CN113973215A (en) * 2021-10-25 2022-01-25 北京字节跳动网络技术有限公司 Data deduplication method and device and storage medium
CN116390156B (en) * 2023-06-02 2023-08-25 新华三技术有限公司 LoRa communication method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658355A (en) * 2016-09-26 2017-05-10 珠海格力电器股份有限公司 Method for forwarding broadcast packet in bluetooth BLE networking and system thereof
CN108881052A (en) * 2018-06-26 2018-11-23 新华三技术有限公司 A kind of message forwarding method and device
CN109547348A (en) * 2017-09-21 2019-03-29 阿里巴巴集团控股有限公司 A kind of communication, method for routing foundation and device
KR20190117135A (en) * 2018-04-06 2019-10-16 주식회사 앤씽크 Integrated control system for ctms
CN110418425A (en) * 2019-07-29 2019-11-05 北京安云世纪科技有限公司 Gateway, data communications method and calculating equipment based on Lora agreement

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413600A (en) * 2019-06-29 2019-11-05 万翼科技有限公司 Data managing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106658355A (en) * 2016-09-26 2017-05-10 珠海格力电器股份有限公司 Method for forwarding broadcast packet in bluetooth BLE networking and system thereof
CN109547348A (en) * 2017-09-21 2019-03-29 阿里巴巴集团控股有限公司 A kind of communication, method for routing foundation and device
KR20190117135A (en) * 2018-04-06 2019-10-16 주식회사 앤씽크 Integrated control system for ctms
CN108881052A (en) * 2018-06-26 2018-11-23 新华三技术有限公司 A kind of message forwarding method and device
CN110418425A (en) * 2019-07-29 2019-11-05 北京安云世纪科技有限公司 Gateway, data communications method and calculating equipment based on Lora agreement

Also Published As

Publication number Publication date
CN111328028A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN111328028B (en) Communication method and device
CA2738103C (en) Data transmission method and apparatus
CN110401962B (en) LoRaWAN system and method for automatically adjusting length of data message
CN108476091B (en) Method, system and user equipment for determining transmission conditions of real-time media stream of wireless communication network
US20210067453A1 (en) Data transmission method and apparatus
US9215609B2 (en) Method and system for measuring wireless link quality
US20200267083A1 (en) Transmit data volume control device, method, and recording medium
CN101932029A (en) Data transmission method, equipment and system
US20190239086A1 (en) A system and method for mitigating a coverage hole from a coverage area
US20230262748A1 (en) Dynamic downlink reuse in a c-ran
WO2014098096A1 (en) Data transmission device, data transmission method, and program therefor
US20150016294A1 (en) Link aggregation apparatus
US8923156B1 (en) Quality of service aware channel quality indicator
JP2014517559A (en) Experience quality
US9686797B2 (en) Method and apparatus for determining power offset parameters
EP2706695A2 (en) Wireless communication system, base station, and wireless communication method
US20030092392A1 (en) Weighted wireless early detection
CN113784378B (en) Method, device, server and storage medium for detecting faults of indoor partition cells
US11785442B2 (en) Data transport network protocol based on real time transport network congestion conditions
JP7464046B2 (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, AND COMMUNICATION PROGRAM
CN113765703B (en) Data transmission switching control method and system of intelligent gateway
CN107959947B (en) Data transmission method, device and base station
US11689645B2 (en) Service data transmission method and apparatus
CN108055679B (en) Mesh network flow control method
KR20220024642A (en) Parameter optimization method, apparatus, base station, server and storage medium

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