CN110933595A - Pasture livestock positioning method and system based on LoRa technology - Google Patents

Pasture livestock positioning method and system based on LoRa technology Download PDF

Info

Publication number
CN110933595A
CN110933595A CN201911126170.3A CN201911126170A CN110933595A CN 110933595 A CN110933595 A CN 110933595A CN 201911126170 A CN201911126170 A CN 201911126170A CN 110933595 A CN110933595 A CN 110933595A
Authority
CN
China
Prior art keywords
lora
data
gateway
positioning
node
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.)
Pending
Application number
CN201911126170.3A
Other languages
Chinese (zh)
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.)
Taiyuan Aioti Technology Co Ltd
Original Assignee
Taiyuan Aioti 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 Taiyuan Aioti Technology Co Ltd filed Critical Taiyuan Aioti Technology Co Ltd
Priority to CN201911126170.3A priority Critical patent/CN110933595A/en
Publication of CN110933595A publication Critical patent/CN110933595A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/023Services making use of location information using mutual or relative location information between multiple location based services [LBS] targets or of distance thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. TPC [Transmission Power Control], power saving or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A40/00Adaptation technologies in agriculture, forestry, livestock or agroalimentary production
    • Y02A40/70Adaptation technologies in agriculture, forestry, livestock or agroalimentary production in livestock or poultry
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a pasture livestock positioning method and system based on a LoRa technology. The positioning method comprises the following steps: acquiring ID data of each LoRa gateway; a plurality of LoRa gateways are arranged around the pasture; acquiring the position data of each LoRa gateway; acquiring positioning data of all LoRa gateways receiving the positioning request information according to the positioning request information of the LoRa nodes; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa nodes are fixed on livestock bodies in the pasture; the positioning data of the LoRa gateway comprises ID data, positioning request information and a timestamp of the LoRa gateway; and determining the position of the LoRa node according to the position data and the positioning data of the LoRa gateway to obtain the position of the livestock corresponding to the LoRa node. The invention can reduce the cost and improve the positioning precision of livestock.

Description

Pasture livestock positioning method and system based on LoRa technology
Technical Field
The invention relates to the field of pasture livestock management, in particular to a method and a system for positioning pasture livestock based on a LoRa technology.
Background
For the management of pasture livestock, the livestock are mainly managed by manpower, the livestock are lost to different degrees every year, and the labor input cost is high. In the prior art, for positioning livestock in a pasture, some livestock are positioned by adopting a GPS, and the method has high cost and short endurance time. Some livestock are positioned by adopting a Received Signal Strength (RSSI) -based algorithm, measurement experiments are usually carried out on a positioning environment for many times, the relation between a Signal propagation distance and path loss in the environment is obtained, a distance-loss model is established, the accuracy of propagation distance estimation directly influences the final positioning accuracy, the error of the method reaches 1000 + 2000 meters, and the positioning error is larger.
Disclosure of Invention
The invention aims to provide a method and a system for positioning livestock in a pasture based on a LoRa technology, so that the cost is reduced, and the positioning precision of the livestock is improved.
In order to achieve the purpose, the invention provides the following scheme:
a pasture livestock positioning method based on LoRa technology comprises the following steps:
acquiring ID data of each LoRa gateway; the LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium;
acquiring the position data of each LoRa gateway;
acquiring positioning data of all LoRa gateways receiving the positioning request information according to the positioning request information of the LoRa nodes; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises ID data of the LoRa gateway, the positioning request information and a timestamp;
and determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data to obtain the position of the livestock corresponding to the LoRa node.
Optionally, the obtaining ID data of each LoRa gateway specifically includes:
judging whether the ID data of the LoRa gateway is stored in a first storage medium of the LoRa gateway or not to obtain a first judgment result;
when the first judgment result shows that the first storage medium of the LoRa gateway stores the ID data of the LoRa gateway, reading the ID data of the LoRa gateway from the first storage medium of the LoRa gateway;
and when the first judgment result shows that the first storage medium of the LoRa gateway does not store the ID data of the LoRa gateway, acquiring the IMEI number of the 4G module of the LoRa gateway, and determining the IMEI number of the 4G module as the ID data of the LoRa gateway.
Optionally, the obtaining of the location data of each LoRa gateway specifically includes:
acquiring a GPS information packet sent to the first microcontroller by the GPS receiving module;
analyzing the universal coordination time in the GPS information packet according to the GPS information packet;
writing the universal coordination time into a real-time clock of the first microcontroller;
according to the GPS information packet, analyzing longitude and latitude information in the GPS information packet;
and obtaining the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
Optionally, the obtaining, according to the location request information of the LoRa node, location data of all LoRa gateways that receive the location request information further includes:
judging whether a second storage medium in the LoRa node stores the ID data of the LoRa node or not to obtain a second judgment result;
when the second judgment result indicates that a second storage medium in the LoRa node stores the ID data of the LoRa node, acquiring the ID data of the LoRa node;
when the second judgment result indicates that the second storage medium in the LoRa node does not store the ID data of the LoRa node, generating a temporary ID of the LoRa node; the temporary ID includes an 8-bit node random number and an 8-bit digit 0;
sending a registration request to each LoRa gateway according to the temporary ID;
judging whether the LoRa gateway receives the registration request of the temporary ID for the first time to obtain a third judgment result;
when the third judgment result shows that the LoRa gateway receives the registration request of the temporary ID for the first time, the registration request is sent to a server through the 4G module;
judging whether the server receives the registration request of the 4G module for the first time to obtain a fourth judgment result;
when the fourth judgment result shows that the server receives the registration request of the 4G module for the first time, generating an 8-bit server random number according to a timestamp of the registration request sent by the 4G module;
generating ID data of the LoRa node according to the 8-bit server random number and the 8-bit node random number;
and when the fourth judgment result shows that the server does not receive the registration request of the 4G module for the first time, acquiring ID data of the LoRa node generated in history.
Optionally, according to the location data of the LoRa gateway and the location data, the location of the LoRa node is determined, and the location of the livestock corresponding to the LoRa node is obtained, which specifically includes:
determining the distance difference of the LoRa node to the LoRa gateways according to the timestamps in the positioning data of the LoRa gateways;
and determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the multiple LoRa gateways, so as to obtain the position of the livestock corresponding to the LoRa nodes.
Optionally, the determining, according to the location data of the LoRa gateway and the location data, the location of the LoRa node to obtain the location of the livestock corresponding to the LoRa node, and then further including:
determining the position distribution and the number of livestock on the pasture according to the positions and the number of all LoRa nodes;
determining electric quantity information of each LoRa node;
and determining the electric quantity information of each LoRa gateway.
The invention also provides a pasture livestock positioning system based on the LoRa technology, which comprises:
the LoRa gateway ID data acquisition module is used for acquiring the ID data of each LoRa gateway; the LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium;
the LoRa gateway position data acquisition module is used for acquiring the position data of each LoRa gateway;
the positioning data acquisition module of the loRa gateway is used for acquiring positioning data of all the loRa gateways receiving the positioning request information according to the positioning request information of the loRa node; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises ID data of the LoRa gateway, the positioning request information and a timestamp;
and the livestock position acquisition module is used for determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data to obtain the position of the livestock corresponding to the LoRa node.
Optionally, the LoRa gateway ID data obtaining module specifically includes:
the first judging unit is used for judging whether the ID data of the LoRa gateway is stored in a first storage medium of the LoRa gateway or not to obtain a first judging result;
an LoRa gateway ID data reading unit, configured to read, when the first determination result indicates that the first storage medium of the LoRa gateway stores the ID data of the LoRa gateway, the ID data of the LoRa gateway from the first storage medium of the LoRa gateway;
and an LoRa gateway ID data determining unit, configured to, when the first determination result indicates that the first storage medium of the LoRa gateway does not store the ID data of the LoRa gateway, obtain an IMEI number of a 4G module of the LoRa gateway, and determine the IMEI number of the 4G module as the ID data of the LoRa gateway.
Optionally, the LoRa gateway location data obtaining module specifically includes:
the GPS information packet acquisition unit is used for acquiring a GPS information packet sent to the first microcontroller by the GPS receiving module;
the universal coordination time analysis unit is used for analyzing the universal coordination time in the GPS information packet according to the GPS information packet;
the real-time clock writing unit is used for writing the universal coordination time into a real-time clock of the first microcontroller;
the longitude and latitude information analyzing unit is used for analyzing the longitude and latitude information in the GPS information packet according to the GPS information packet;
and the LoRa gateway position data acquisition unit is used for acquiring the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
Optionally, the livestock position obtaining module specifically includes:
the distance difference obtaining unit is used for determining the distance difference of the LoRa node reaching the LoRa gateways according to timestamps in the positioning data of the LoRa gateways;
and the position calculation unit is used for determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the LoRa gateways, so as to obtain the position of the livestock corresponding to the LoRa nodes.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
the LoRa node is basically in a dormant state, and only when the LoRa node is in the dormant state, the LoRa node automatically wakes up to upload once request positioning, so that the cost is low, no extra power is consumed, and the service life of the battery is long. The LoRa gateway uses GPS to carry out timing and positioning, thereby ensuring the strict synchronization of time between the LoRa gateways, and adopts TDOA algorithm, the positioning precision is 20-200 meters, compared with the prior art, the positioning precision is greatly improved. And the invention is based on the general LoRaWAN protocol, easy to LoRa node expansion, can be adjusted according to different scales of different pastures, and is suitable for livestock positioning of all pastures.
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 embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a schematic flow chart of a pasture livestock positioning method based on the LoRa technology;
FIG. 2 is a schematic structural diagram of a pasture livestock positioning system based on LoRa technology according to the present invention;
FIG. 3 is a schematic diagram of the locations of gateways and nodes in an embodiment of the present invention;
fig. 4 is a flowchart of an execution process of the LoRa gateway in an embodiment of the present invention;
fig. 5 is a flowchart of an execution process of the LoRa node according to an embodiment of the present invention.
Detailed Description
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 only a part of the embodiments of the present invention, and not all of the embodiments. 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.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
Fig. 1 is a schematic flow chart of the pasture livestock positioning method based on the LoRa technology. As shown in fig. 1, the pasture livestock positioning method based on the LoRa technology comprises the following steps:
step 100: and acquiring the ID data of each LoRa gateway. The LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium. Specifically, whether the ID data of the LoRa gateway is stored in the first storage medium of the LoRa gateway is determined. If yes, reading the ID data of the LoRa gateway from a first storage medium of the LoRa gateway; if not, obtaining the IMEI number of the 4G module of the LoRa gateway, and determining the IMEI number of the 4G module as the ID data of the LoRa gateway.
Step 200: and acquiring the position data of each LoRa gateway. Specifically, first, a GPS information packet sent by the GPS receiving module to the first microcontroller is acquired. And then, according to the GPS information packet, when analyzing the universal coordination in the GPS information packet, writing the universal coordination time into a real-time clock of the first microcontroller. And further analyzing the longitude and latitude information in the GPS information packet according to the GPS information packet. And finally, obtaining the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
Step 300: and acquiring the positioning data of all the LoRa gateways receiving the positioning request information according to the positioning request information of the LoRa nodes. The positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises the ID data of the LoRa gateway, the positioning request information and a timestamp. The location request information of the LoRa node includes ID data of the LoRa node, and the ID data of the LoRa node is acquired in the following manner:
and judging whether a second storage medium in the LoRa node stores the ID data of the LoRa node or not to obtain a second judgment result.
And when the second judgment result shows that the second storage medium in the LoRa node stores the ID data of the LoRa node, acquiring the ID data of the LoRa node.
When the second judgment result indicates that the second storage medium in the LoRa node does not store the ID data of the LoRa node, generating a temporary ID of the LoRa node; the temporary ID includes an 8-bit node random number and an 8-bit digit 0.
And sending a registration request to each LoRa gateway according to the temporary ID.
And judging whether the LoRa gateway receives the registration request of the temporary ID for the first time or not to obtain a third judgment result.
And when the third judgment result shows that the LoRa gateway receives the registration request of the temporary ID for the first time, sending the registration request to a server through the 4G module.
And when the third judgment result shows that the LoRa gateway does not receive the registration request of the temporary ID for the first time, ignoring the registration request.
And judging whether the server receives the registration request of the 4G module for the first time or not to obtain a fourth judgment result.
And when the fourth judgment result shows that the server receives the registration request of the 4G module for the first time, generating an 8-bit server random number according to the timestamp of the registration request sent by the 4G module.
And generating ID data of the LoRa node according to the 8-bit server random number and the 8-bit node random number.
And when the fourth judgment result shows that the server does not receive the registration request of the 4G module for the first time, acquiring ID data of the LoRa node generated in history.
Step 400: and determining the position of the LoRa node according to the position data and the positioning data of the LoRa gateway to obtain the position of the livestock corresponding to the LoRa node. Specifically, firstly, the time difference of the LoRa node reaching the LoRa gateways is determined according to the timestamps in the positioning data of the LoRa gateways, and then the time difference is multiplied by the speed of light to obtain the distance difference of the LoRa node reaching the LoRa gateways. And then, determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the multiple LoRa gateways, wherein the position of the LoRa nodes is the position of the corresponding livestock.
After the positions of the livestock are obtained, the position distribution and the number of the livestock on the pasture can be determined according to the positions and the number of all LoRa nodes. And determining the electric quantity information of each LoRa node according to the battery information of the second lithium battery of each LoRa node. And determining the electric quantity information of each LoRa gateway according to the battery information of the first lithium battery of each LoRa gateway. And then can further carry out the monitoring to the electric quantity information of loRa gateway, the electric quantity information of loRa node, the position distribution and the quantity of pasture livestock.
Corresponding to the pasture livestock positioning method based on the LoRa technology shown in the figure 1, the invention also provides a pasture livestock positioning system based on the LoRa technology. Fig. 2 is a schematic structural diagram of the pasture livestock positioning system based on the LoRa technology. As shown in fig. 2, the pasture livestock positioning system based on the LoRa technology comprises the following structures:
an LoRa gateway ID data acquisition module 201, configured to acquire ID data of each LoRa gateway; the LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium.
And an LoRa gateway location data obtaining module 202, configured to obtain location data of each LoRa gateway.
The LoRa gateway location data acquiring module 203 is configured to acquire, according to location request information of an LoRa node, location data of all LoRa gateways that have received the location request information; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises the ID data of the LoRa gateway, the positioning request information and a timestamp.
And the livestock position acquisition module 204 is configured to determine the position of the LoRa node according to the position data of the LoRa gateway and the positioning data, and obtain the position of the livestock corresponding to the LoRa node.
As another embodiment, in the pasture livestock positioning system based on the LoRa technology, the LoRa gateway ID data obtaining module 201 specifically includes:
the first judging unit is used for judging whether the ID data of the LoRa gateway is stored in a first storage medium of the LoRa gateway or not, and obtaining a first judging result.
And the LoRa gateway ID data reading unit is used for reading the ID data of the LoRa gateway from the first storage medium of the LoRa gateway when the first judgment result shows that the ID data of the LoRa gateway is stored in the first storage medium of the LoRa gateway.
And an LoRa gateway ID data determining unit, configured to, when the first determination result indicates that the first storage medium of the LoRa gateway does not store the ID data of the LoRa gateway, obtain an IMEI number of a 4G module of the LoRa gateway, and determine the IMEI number of the 4G module as the ID data of the LoRa gateway.
As another embodiment, in the pasture livestock positioning system based on the LoRa technology, the LoRa gateway location data obtaining module 202 specifically includes:
and the GPS information packet acquisition unit is used for acquiring the GPS information packet sent to the first microcontroller by the GPS receiving module.
And the universal coordination time analysis unit is used for analyzing the universal coordination time in the GPS information packet according to the GPS information packet.
And the real-time clock writing unit is used for writing the universal coordination time into the real-time clock of the first microcontroller.
And the latitude and longitude information analyzing unit is used for analyzing the latitude and longitude information in the GPS information packet according to the GPS information packet.
And the LoRa gateway position data acquisition unit is used for acquiring the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
As another embodiment, in the grazing land livestock positioning system based on the LoRa technology, the livestock position obtaining module 204 specifically includes:
and the distance difference obtaining unit is used for determining the distance difference of the LoRa node reaching the LoRa gateways according to the timestamps in the positioning data of the LoRa gateways.
And the position calculation unit is used for determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the LoRa gateways, so as to obtain the position of the livestock corresponding to the LoRa nodes.
An embodiment is provided below to further illustrate the scheme shown in fig. 1 and 2.
This implementation case arranges around the pasture that is no less than 3 loRa gateways, and every loRa gateway can both cover whole pasture. Fig. 3 is a schematic location diagram of a gateway and a node in the embodiment of the present invention, and fig. 3 illustrates 3 LoRa gateways. The LoRa node is composed of a LoRa module, a microcontroller, a lithium battery and a storage medium. The LoRa gateway comprises a LoRa module, a microcontroller, a GPS receiving module, a 4G module, a lithium battery and a storage medium.
Fig. 4 is a flowchart of an execution process of an LoRa gateway in an embodiment of the present invention, fig. 5 is a flowchart of an execution process of an LoRa node in an embodiment of the present invention, and the process of the embodiment is specifically described with reference to fig. 4 and 5.
Step 1: and reading the equipment ID of the LoRa gateway from the storage medium after the LoRa gateway is started, and if the storage medium does not have the ID, acquiring the IMEI number of the 4G module as the equipment ID of the LoRa gateway.
Step 2: and (2) after the gateway in the step (1) obtains the equipment ID, turning on a GPS information switch for obtaining a GPS receiving module, and sending a GPS information packet to the microcontroller by the GPS receiving module every 1 second. The microcontroller can analyze Universal Time Coordinated (UTC) in the GPS information each Time the GPS information packet is received, and if the LoRa gateway can analyze UTC, write the UTC Time into a Real-Time Clock (RTC) of the microcontroller; if the LoRa gateway can not analyze the UTC, the GPS information packet is ignored. Every time the microcontroller receives the GPS information packet, if the longitude and latitude can be analyzed, the longitude and latitude are stored in a storage medium; and if the longitude and latitude cannot be analyzed, ignoring the GPS information packet.
And step 3: and after the LoRa node is started, reading the equipment ID of the LoRa node from the storage medium, and if no ID exists, belonging to the unregistered LoRa node. For the unregistered LoRa node, the LoRa node generates an 8-bit random number + 8-bit number 0 as a temporary ID, and then requests registration from the LoRa gateway. The LoRa node requests registration in a broadcast mode, and all LoRa gateways in a communication range can receive the registration request. When receiving the registration request, the LoRa gateway judges whether the registration request is the first registration request for receiving the temporary ID, if so, the LoRa gateway requests the registration to a pasture management platform server through a 4G module; if not, the LoRa gateway ignores the registration message this time. The server judges whether the request registration of the temporary ID is received for the first time, if so, the server generates an 8-bit random number through a time stamp when the LoRa gateway requests registration, the 8-bit LoRa node random number and the 8-bit server random number form the equipment ID of the LoRa node, and the server replies the generated equipment ID of the LoRa node to the gateway; if not, the service replies to the LoRa gateway with the historically generated device ID, ensuring its uniqueness in the system.
And 5: and after receiving the server reply, the LoRa gateway forwards the equipment ID of the LoRa gateway to the LoRa node. The LoRa node saves the device ID in the storage medium and uses the device ID in subsequent communications.
Step 6: and sending a positioning request to the LoRa gateway every 5 minutes after the LoRa node obtains the equipment ID, and determining the geographical position of the livestock by requesting positioning. The equipment ID of the LoRa node corresponds to livestock, and one LoRa node is worn by each livestock.
And 7: and after receiving the request positioning data, the LoRa gateway forwards the request positioning data and a timestamp to the server. The location request data and the registration request in step 4 are both json strings, which include device id and command, for example, the location request data is:
{"device_id":"90505A575738CB94","command":"req_location"};
the request registration in step 4 is:
{"device_id":"90505A5700000000","command":"req_id"}。
and 8: the server solves the geographical position of the LoRa node to be positioned according to a hyperbolic positioning algorithm, and the positioning principle is as follows: the LoRa node to be positioned broadcasts a request positioning data packet, and the gateway 1, the gateway 2 and the gateway 3 all receive the request positioning data packet. The 3 gateways add their own timestamps and then forward to the server. And the server subtracts the timestamps of the gateway 1 and the gateway 2, takes the absolute value, and multiplies the absolute value by the speed of light to obtain the distance difference from the node to the gateway 1 and the gateway 2. According to the geometric definition of the hyperbola, the gateway 1 and the gateway 2 are two focuses of the hyperbola 1, and the node is on one branch. In the same way, the distance difference between the node and the gateway 2 and the gateway 3 can be obtained, the gateway 2 and the gateway 3 are two focuses of the hyperbola 2, the node is on one branch of the hyperbola 2, the point to be positioned is located at the intersection point of the hyperbola 1 and the hyperbola 2, and then the position of the point to be positioned can be determined according to the position information of the 3 gateways.
The location data packet requested by the LoRa node also includes the power information of the node. The electric quantity of the LoRa node can be checked in real time on the pasture management platform, the livestock quantity of the pasture and the position of the LoRa node are displayed on a map.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. For the system disclosed by the embodiment, the description is relatively simple because the system corresponds to the method disclosed by the embodiment, and the relevant points can be referred to the method part for description.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (10)

1. A pasture livestock positioning method based on LoRa technology is characterized by comprising the following steps:
acquiring ID data of each LoRa gateway; the LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium;
acquiring the position data of each LoRa gateway;
acquiring positioning data of all LoRa gateways receiving the positioning request information according to the positioning request information of the LoRa nodes; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises ID data of the LoRa gateway, the positioning request information and a timestamp;
and determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data to obtain the position of the livestock corresponding to the LoRa node.
2. The pasture livestock positioning method based on the LoRa technology as claimed in claim 1, wherein said obtaining ID data of each LoRa gateway specifically includes:
judging whether the ID data of the LoRa gateway is stored in a first storage medium of the LoRa gateway or not to obtain a first judgment result;
when the first judgment result shows that the first storage medium of the LoRa gateway stores the ID data of the LoRa gateway, reading the ID data of the LoRa gateway from the first storage medium of the LoRa gateway;
and when the first judgment result shows that the first storage medium of the LoRa gateway does not store the ID data of the LoRa gateway, acquiring the IMEI number of the 4G module of the LoRa gateway, and determining the IMEI number of the 4G module as the ID data of the LoRa gateway.
3. The pasture livestock positioning method based on the LoRa technology as claimed in claim 1, wherein said obtaining the location data of each LoRa gateway specifically includes:
acquiring a GPS information packet sent to the first microcontroller by the GPS receiving module;
analyzing the universal coordination time in the GPS information packet according to the GPS information packet;
writing the universal coordination time into a real-time clock of the first microcontroller;
according to the GPS information packet, analyzing longitude and latitude information in the GPS information packet;
and obtaining the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
4. The method for positioning livestock in a pasture based on the LoRa technology as claimed in claim 1, wherein the method for acquiring the positioning data of all LoRa gateways receiving the positioning request information according to the positioning request information of the LoRa nodes further comprises:
judging whether a second storage medium in the LoRa node stores the ID data of the LoRa node or not to obtain a second judgment result;
when the second judgment result indicates that a second storage medium in the LoRa node stores the ID data of the LoRa node, acquiring the ID data of the LoRa node;
when the second judgment result indicates that the second storage medium in the LoRa node does not store the ID data of the LoRa node, generating a temporary ID of the LoRa node; the temporary ID includes an 8-bit node random number and an 8-bit digit 0;
sending a registration request to each LoRa gateway according to the temporary ID;
judging whether the LoRa gateway receives the registration request of the temporary ID for the first time to obtain a third judgment result;
when the third judgment result shows that the LoRa gateway receives the registration request of the temporary ID for the first time, the registration request is sent to a server through the 4G module;
judging whether the server receives the registration request of the 4G module for the first time to obtain a fourth judgment result;
when the fourth judgment result shows that the server receives the registration request of the 4G module for the first time, generating an 8-bit server random number according to a timestamp of the registration request sent by the 4G module;
generating ID data of the LoRa node according to the 8-bit server random number and the 8-bit node random number;
and when the fourth judgment result shows that the server does not receive the registration request of the 4G module for the first time, acquiring ID data of the LoRa node generated in history.
5. The method for positioning livestock in a pasture based on an LoRa technology according to claim 1, wherein the determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data to obtain the position of the livestock corresponding to the LoRa node specifically comprises:
determining the distance difference of the LoRa node to the LoRa gateways according to the timestamps in the positioning data of the LoRa gateways;
and determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the multiple LoRa gateways, so as to obtain the position of the livestock corresponding to the LoRa nodes.
6. The method for positioning livestock in pasture based on LoRa technology according to claim 1, wherein the determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data obtains the position of the livestock corresponding to the LoRa node, and then further comprises:
determining the position distribution and the number of livestock on the pasture according to the positions and the number of all LoRa nodes;
determining electric quantity information of each LoRa node;
and determining the electric quantity information of each LoRa gateway.
7. The utility model provides a pasture livestock positioning system based on loRa technique which characterized in that includes:
the LoRa gateway ID data acquisition module is used for acquiring the ID data of each LoRa gateway; the LoRa gateways are arranged around a pasture, and the communication range of each LoRa gateway covers the pasture; the LoRa gateway comprises a first LoRa module, a first microcontroller, a GPS receiving module, a 4G module, a first lithium battery and a first storage medium;
the LoRa gateway position data acquisition module is used for acquiring the position data of each LoRa gateway;
the positioning data acquisition module of the loRa gateway is used for acquiring positioning data of all the loRa gateways receiving the positioning request information according to the positioning request information of the loRa node; the positioning request information of the LoRa node comprises ID data and a request instruction of the LoRa node; the LoRa node comprises a second LoRa module, a second microcontroller, a second lithium battery and a second storage medium, and is fixed on livestock in the pasture; the positioning data of the LoRa gateway comprises ID data of the LoRa gateway, the positioning request information and a timestamp;
and the livestock position acquisition module is used for determining the position of the LoRa node according to the position data of the LoRa gateway and the positioning data to obtain the position of the livestock corresponding to the LoRa node.
8. The LoRa technology-based pasture livestock positioning system of claim 7, wherein said LoRa gateway ID data acquisition module specifically comprises:
the first judging unit is used for judging whether the ID data of the LoRa gateway is stored in a first storage medium of the LoRa gateway or not to obtain a first judging result;
an LoRa gateway ID data reading unit, configured to read, when the first determination result indicates that the first storage medium of the LoRa gateway stores the ID data of the LoRa gateway, the ID data of the LoRa gateway from the first storage medium of the LoRa gateway;
and an LoRa gateway ID data determining unit, configured to, when the first determination result indicates that the first storage medium of the LoRa gateway does not store the ID data of the LoRa gateway, obtain an IMEI number of a 4G module of the LoRa gateway, and determine the IMEI number of the 4G module as the ID data of the LoRa gateway.
9. The LoRa technology-based pasture livestock positioning system of claim 7, wherein said LoRa gateway location data acquisition module specifically comprises:
the GPS information packet acquisition unit is used for acquiring a GPS information packet sent to the first microcontroller by the GPS receiving module;
the universal coordination time analysis unit is used for analyzing the universal coordination time in the GPS information packet according to the GPS information packet;
the real-time clock writing unit is used for writing the universal coordination time into a real-time clock of the first microcontroller;
the longitude and latitude information analyzing unit is used for analyzing the longitude and latitude information in the GPS information packet according to the GPS information packet;
and the LoRa gateway position data acquisition unit is used for acquiring the position data of the LoRa gateway at each moment according to the real-time clock of the first controller and the latitude and longitude information.
10. The LoRa technology based pasture animal positioning system of claim 7 wherein the animal position acquisition module specifically comprises:
the distance difference obtaining unit is used for determining the distance difference of the LoRa node reaching the LoRa gateways according to timestamps in the positioning data of the LoRa gateways;
and the position calculation unit is used for determining the position of the LoRa node by adopting a hyperbolic positioning algorithm according to the position data of the LoRa gateways and the distance difference between the LoRa nodes and the LoRa gateways, so as to obtain the position of the livestock corresponding to the LoRa nodes.
CN201911126170.3A 2019-11-18 2019-11-18 Pasture livestock positioning method and system based on LoRa technology Pending CN110933595A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911126170.3A CN110933595A (en) 2019-11-18 2019-11-18 Pasture livestock positioning method and system based on LoRa technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911126170.3A CN110933595A (en) 2019-11-18 2019-11-18 Pasture livestock positioning method and system based on LoRa technology

Publications (1)

Publication Number Publication Date
CN110933595A true CN110933595A (en) 2020-03-27

Family

ID=69854091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911126170.3A Pending CN110933595A (en) 2019-11-18 2019-11-18 Pasture livestock positioning method and system based on LoRa technology

Country Status (1)

Country Link
CN (1) CN110933595A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432353A (en) * 2020-04-17 2020-07-17 秦皇岛职业技术学院 Tourist management device for tourism management
CN111510860A (en) * 2020-07-01 2020-08-07 杭州沃朴物联科技有限公司 Intelligent grazing management system and method
CN113156463A (en) * 2021-03-05 2021-07-23 成都航空职业技术学院 Intelligent grazing system based on Beidou short message and monitoring method thereof
CN113965991A (en) * 2021-10-28 2022-01-21 杭州字节信息技术有限公司 LoRaWan-based node positioning implementation method

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101360345A (en) * 2008-09-27 2009-02-04 中国移动通信集团设计院有限公司 Data service management method, apparatus and system
CN105142108A (en) * 2015-08-22 2015-12-09 内蒙古科技大学 Wireless management system for grazing on grassland
CN107124698A (en) * 2017-04-28 2017-09-01 深圳市亿兆互联技术有限公司 A kind of vertical space positioner based on LoRa technologies, method and system
CN107153886A (en) * 2017-03-31 2017-09-12 深圳市亿兆互联技术有限公司 A kind of customer's localization method for market layout optimization
CN107249211A (en) * 2017-07-28 2017-10-13 优艾特仪表科技成都有限公司 A kind of intelligent gateway and operational process based on LoRa and NB IoT
US20180283882A1 (en) * 2017-04-04 2018-10-04 Appropolis Inc. Location-based services system and method therefor

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101360345A (en) * 2008-09-27 2009-02-04 中国移动通信集团设计院有限公司 Data service management method, apparatus and system
CN105142108A (en) * 2015-08-22 2015-12-09 内蒙古科技大学 Wireless management system for grazing on grassland
CN107153886A (en) * 2017-03-31 2017-09-12 深圳市亿兆互联技术有限公司 A kind of customer's localization method for market layout optimization
US20180283882A1 (en) * 2017-04-04 2018-10-04 Appropolis Inc. Location-based services system and method therefor
CN107124698A (en) * 2017-04-28 2017-09-01 深圳市亿兆互联技术有限公司 A kind of vertical space positioner based on LoRa technologies, method and system
CN107249211A (en) * 2017-07-28 2017-10-13 优艾特仪表科技成都有限公司 A kind of intelligent gateway and operational process based on LoRa and NB IoT

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111432353A (en) * 2020-04-17 2020-07-17 秦皇岛职业技术学院 Tourist management device for tourism management
CN111432353B (en) * 2020-04-17 2022-09-06 秦皇岛职业技术学院 Tourist management device for tourism management
CN111510860A (en) * 2020-07-01 2020-08-07 杭州沃朴物联科技有限公司 Intelligent grazing management system and method
CN113490139A (en) * 2020-07-01 2021-10-08 杭州沃朴物联科技有限公司 Intelligent grazing management system and method
CN113156463A (en) * 2021-03-05 2021-07-23 成都航空职业技术学院 Intelligent grazing system based on Beidou short message and monitoring method thereof
CN113156463B (en) * 2021-03-05 2023-10-20 成都航空职业技术学院 Intelligent grazing system based on Beidou short message and monitoring method thereof
CN113965991A (en) * 2021-10-28 2022-01-21 杭州字节信息技术有限公司 LoRaWan-based node positioning implementation method

Similar Documents

Publication Publication Date Title
CN110933595A (en) Pasture livestock positioning method and system based on LoRa technology
CN106658399B (en) Method for positioning mobile phone position based on mobile phone user position fingerprint
CN106572495B (en) Network quality monitoring method and coverage evaluation method based on signaling and MR data
CN107466043B (en) Method and equipment for determining azimuth angle of base station antenna
CN109246592B (en) Method and device for acquiring position information of user terminal
JP6623282B2 (en) Differentiated positioning
US20180213350A1 (en) Targeted prs configuration searches
CN104459746A (en) Method, system and device for position determination with predicted ephemeris
CN110001712B (en) Existing railway line control measurement system based on satellite navigation positioning reference station network
CN101835192B (en) Method for measuring network signal coverage, network controller and communication system
CN112312301B (en) User terminal positioning method, device, equipment and computer storage medium
CN112291844B (en) Positioning method and device based on MR and MDT
US20180124732A1 (en) Beacon sensor based network fingerprint
CN110881191A (en) Method, device and system for acquiring longitude and latitude of cell and storage medium
CN102843766B (en) Method and system for locating Home NodeB, method and system for updating location information
CN106413082B (en) Geographical position monitoring method and equipment
CN113133046A (en) Network coverage evaluation method and device, electronic equipment and computer storage medium
JP7379687B2 (en) Terminal network access methods, devices, electronic devices and storage media
CN113068118A (en) NB-IoT positioning accuracy improving method and system
CN104883735A (en) Accurate position judging method based on mobile internet
US9510317B1 (en) Location estimation of mobile stations by coordinating the acquisition and use of control plane and user plane location data
Bareth Simulating power consumption of location tracking algorithms to improve energy-efficiency of smartphones
CN110198518A (en) A kind of user's accurate positioning method and system based on Internet of Things
CN113038599B (en) Base station triangulation method and system based on NB-IoT network
Espinoza et al. Sound noise monitoring platform: Smart-phones as sensors

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200327