CN114245455A - Wireless positioning time synchronization method based on LoRa technology - Google Patents

Wireless positioning time synchronization method based on LoRa technology Download PDF

Info

Publication number
CN114245455A
CN114245455A CN202210011546.1A CN202210011546A CN114245455A CN 114245455 A CN114245455 A CN 114245455A CN 202210011546 A CN202210011546 A CN 202210011546A CN 114245455 A CN114245455 A CN 114245455A
Authority
CN
China
Prior art keywords
base station
server
time synchronization
measured
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202210011546.1A
Other languages
Chinese (zh)
Other versions
CN114245455B (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.)
Jilin University
Original Assignee
Jilin University
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 Jilin University filed Critical Jilin University
Priority to CN202210011546.1A priority Critical patent/CN114245455B/en
Publication of CN114245455A publication Critical patent/CN114245455A/en
Application granted granted Critical
Publication of CN114245455B publication Critical patent/CN114245455B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/001Synchronization between nodes
    • H04W56/0015Synchronization between nodes one node acting as a reference for the others
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • H04J3/0667Bidirectional timestamps, e.g. NTP or PTP for compensation of clock drift and for compensation of propagation delays
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/0055Synchronisation arrangements determining timing error of reception due to propagation delay
    • H04W56/0065Synchronisation arrangements determining timing error of reception due to propagation delay using measurement of signal travel time
    • H04W56/009Closed loop measurements
    • 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
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Position Fixing By Use Of Radio Waves (AREA)

Abstract

The invention relates to a wireless positioning time synchronization method based on an LoRa technology, which comprises the following steps: if the number of the points to be measured is larger than the number n of the base stations, grouping the points to be measured and numbering the groups, wherein the number of the points to be measured in each group is at most n; each base station establishes wireless communication for the points to be measured and carries out ranging to obtain the distance between each base station and each point to be measured; for the point to be measured of the jth group, the measured distances of the base station i to the multiple points to be measured of the jth group are packaged into a frame of ranging data information DATAi, and the base station i sends the DATAi to a server; the server sends a response signal ACKi to the base station i after receiving the DATAi; after receiving ranging data information of n base stations, the server transmits time synchronization signals to the base stations in a time-sharing manner; and after each base station receives the corresponding time synchronization signal, resetting the time of each base station according to the time synchronization signal. The invention improves the transmission efficiency and stability of the wireless positioning signal.

Description

Wireless positioning time synchronization method based on LoRa technology
Technical Field
The invention relates to the technical field of wireless positioning, in particular to a wireless positioning time synchronization method based on an LoRa technology.
Background
In the technical field of wireless positioning, the wireless positioning technology is widely applied to scenes of industrial production, animal husbandry and electronic fences, particularly, the satellite positioning technology can meet the basic requirement of outdoor positioning, but the positioning effect is poor in an indoor scene, and the positioning technology for solving the problem of indoor positioning is a wireless sensor network of local networking generally. In many wireless sensor networks with wireless positioning functions, especially in wireless sensor networks using a three-edge or multi-edge positioning principle, data collection and time synchronization functions in the wireless sensor networks are partially lacked, or the time synchronization function is not accurate enough and has poor effect, so that the wireless positioning algorithms and devices are lacked in high efficiency and stability in practical application.
Particularly, in the existing wireless positioning system based on the LoRa technology, a structure composed of three functional parts, namely a base station (or called hotspot, anchor point and reference node), a point to be positioned (position unknown point) and a server is adopted, the structure only has a wireless ranging function and a corresponding positioning calculation algorithm, and further realizes the positioning function, but the positioning system or device lacks time synchronization among the base stations (or called hotspot, anchor point and reference node), so that the system has the problems of low working efficiency, instability, abnormal interruption and the like.
Disclosure of Invention
The invention aims to provide a wireless positioning time synchronization method based on an LoRa technology, which improves the transmission efficiency and stability of wireless positioning signals.
In order to achieve the purpose, the invention provides the following scheme:
a wireless positioning time synchronization method based on an LoRa technology is applied to a wireless positioning system, and the wireless positioning system comprises a server, at least three base stations and a point to be measured;
the wireless positioning time synchronization method based on the LoRa technology comprises the following steps:
if the number of the points to be measured is larger than the number n of the base stations, grouping the points to be measured and numbering the groups, wherein the number of the points to be measured in each group is at most n; if the number of the points to be measured is not more than the number n of the base stations, the number of the points to be measured is 1 group;
each base station establishes wireless communication with the points to be measured and carries out ranging to obtain the distance between each base station and each point to be measured;
for the point to be measured of the jth group, the measured distances of the base station i to the multiple points to be measured of the jth group are encapsulated into a frame of ranging data information i, which is marked as DATAi, and the base station i sends the DATAi to the server;
the server sends a response signal ACKi to the base station i after receiving the DATAi;
after receiving ranging data information of n base stations, the server transmits time synchronization signals to the base stations in a time-sharing manner; the time synchronization signal comprises a timestamp;
after each base station receives the corresponding time synchronization signal, the time of each base station is reset according to the time synchronization signal, and the time synchronization of one working period is completed; the time synchronization of one packet is taken as one duty cycle.
Optionally, the method further comprises:
measuring and storing the distance between the server and each base station; and the time synchronization signal SYNi sent to the base station i by the server is determined according to the distance between the server and the base station i.
Optionally, the measuring and storing the distance between the server and each base station specifically includes:
and measuring and storing the distance between the server and each base station by using a distance measuring engine of an SX1280 chip according to the TOF principle.
Optionally, after the base station i sends the DATAi to the server, the method specifically includes:
and after the base station i finishes sending the DATAi, if the response signal ACKi of the server is not received within the set time, the base station i sends the DATAi to the server again.
Optionally, the sending, by the base station i, the DATAi to the server specifically includes:
the base station i keeps preset wireless communication parameters in the process of sending the DATAi to the server; the wireless communication parameters include a channel and a spreading factor.
Optionally, the sending, by the server, the response signal ACKi to the base station i after receiving the DATAi specifically includes:
and the wireless communication parameters of the server are the same as those of the base station i, and after the server receives the DATAi, the server keeps the same wireless communication parameters as those of the base station i and sends a response signal ACKi to the base station i.
Optionally, the calculation formula of the timestamp is:
Figure BDA0003457607500000031
wherein, T0For time-synchronizing the time of the start time server, TgapFor a transmission interval of two frames of time-synchronous signals, Ts(i) TOA, T from base station i to the serverd(i) Representing the propagation delay from the base station i to the server;
Ts(i)=Nsymbol×2SF÷BW;
wherein N issymbolIndicating the number of symbols, SF the spreading factor and BW the bandwidth.
Alternatively, Td(i)=di/(3×108)×1000;
Wherein d isiRepresenting the distance between the server and base station i.
Optionally, the method further comprises:
and the server positions the point to be measured according to a trilateral positioning principle or a multilateral positioning principle based on the received ranging data information.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
in the information transmission process, a base station i sends DATAi to the server; the server sends a response signal ACKi to the base station i after receiving the DATAi; after receiving the ranging data information of the n base stations, the server sends time synchronization signals to each base station in a time-sharing manner, namely, the process of data transmission and time synchronization can be completed only by three times of information transmission between the base stations and the server, and the transmission efficiency and stability of the wireless positioning signals are improved.
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 wireless positioning time synchronization method based on the LoRa technology according to the present invention;
fig. 2 is a schematic structural diagram of a wireless positioning time synchronizer based on the LoRa technology according to the present invention;
FIG. 3 is a schematic diagram of a time communication model of each base station and server according to the present invention;
fig. 4 is a schematic view of an experimental scenario 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.
The invention aims to provide a wireless positioning time synchronization method based on an LoRa technology, which improves the transmission efficiency and stability of wireless positioning signals.
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 a wireless positioning time synchronization method based on the LoRa technology, and as shown in fig. 1, the wireless positioning time synchronization method based on the LoRa technology is applied to a wireless positioning system, and the wireless positioning system includes a server, at least three base stations, and a plurality of points to be measured.
Each base station is pre-allocated with a channel and a Spreading Factor (SF), the SF and the channel are not repeatedly configured among the base stations so as to reduce co-channel interference in the communication process, and the server pre-stores parameter settings such as the channel and the SF of each base station and ensures smooth communication between the server and each base station.
Each base station comprises an SX1280 chip.
The wireless positioning time synchronization method based on the LoRa technology comprises the following steps:
step 101: if the number of the points to be measured is larger than the number n of the base stations, grouping the points to be measured and numbering the groups, wherein the number of the points to be measured in each group is at most n; and if the number of the points to be measured is not more than the number n of the base stations, the number of the points to be measured is 1 group.
Step 102: and each base station establishes wireless communication for the points to be measured and carries out ranging to obtain the distance between each base station and each point to be measured.
Step 103: for the point to be measured of the jth group, the measured distances of the multiple points to be measured of the jth group are encapsulated by the base station i into a frame of ranging data information i, which is marked as DATAi, and the base station i sends the DATAi to the server.
Step 104: and the server sends a response signal ACKi to the base station i after receiving the DATAi.
Step 105: after receiving ranging data information of n base stations, the server transmits time synchronization signals to the base stations in a time-sharing manner; the time synchronization signal includes a time stamp.
Step 106: after each base station receives the corresponding time synchronization signal, the time of each base station is reset according to the time synchronization signal, the time synchronization of one working period is completed, and the time synchronization of the next packet is started; the time synchronization of one packet is taken as one duty cycle.
And (3) repeating the steps 103 to 106 in the wireless positioning process of a group of points to be measured, namely a working period, by the base station, and continuously circulating to realize the stable and efficient operation of the positioning function of the wireless positioning system.
The wireless positioning time synchronization method based on the LoRa technology further comprises the following steps:
measuring and storing the distance between the server and each base station; the time synchronization signal SYNi sent by the server to the base station i is determined according to the distance between the server and the base station i.
Measuring and storing the distance between the server and each base station, specifically comprising:
and measuring and storing the distance between the server and each base station by using a distance measuring engine of an SX1280 chip according to a TOF principle.
After the base station i sends the DATAi to the server, the method specifically includes:
after the base station i finishes sending the DATAi, the base station i does not receive the response signal ACKi of the server within the set time, and then the base station i sends the DATAi to the server again.
The base station i sends the DATAi to the server, and specifically includes:
the method comprises the steps that a base station i keeps preset wireless communication parameters in the process of sending DATAi to a server; the wireless communication parameters include a channel and a spreading factor.
The server sends a response signal ACKi to the base station i after receiving the DATAi, and specifically includes:
the wireless communication parameters of the server are the same as those of the base station i, and after receiving the DATAi, the server keeps the same wireless communication parameters as those of the base station i and transmits a response signal ACKi to the base station i.
The calculation formula of the time stamp is as follows:
Figure BDA0003457607500000061
wherein, T0For time-synchronizing the time of the start time server, TgapFor a transmission interval of two frames of time-synchronous signals, Ts(i) Is a baseTOA, T of station i to serverd(i) Represents the propagation delay of the base station i to the server, and m is equal to [1,2, …, i-1 ∈]。
In the calculation formula of the time stamp
Figure BDA0003457607500000062
Partially T (1) + T (2) +. cndot.. cndot. + T (i-1).
Ts(i)=Nsymbol×2SF÷BW。
Wherein N issymbolIndicating the number of symbols, SF the spreading factor and BW the bandwidth.
Td(i)=di/(3×108)×1000。
Wherein d isiRepresenting the distance between the server and the base station i.
The wireless positioning time synchronization method based on the LoRa technology further comprises the following steps:
and the server positions the point to be measured according to the trilateral positioning principle or the multilateral positioning principle based on the received ranging data information.
The technical problem to be solved by the invention is as follows: the method comprises the steps of collecting data collected in the positioning process in each positioning base station, transmitting the data to a server, positioning and resolving by the server, further completing time synchronization work of each base station (or called anchor point) through program operation of a wireless communication module of the server and the server, and enabling each base station to keep synchronization in working procedures, thereby realizing stable and efficient wireless positioning service. The wireless positioning time synchronization method based on the LoRa technology can be applied to various positioning devices, particularly a wireless positioning system based on the 2.4G frequency band of the LoRa technology, can avoid installing other communication or distance measurement modes, and simplifies the devices.
The invention relates to a wireless positioning time synchronization method based on an LoRa technology, which comprises three functional parts, namely a server, a base station (or called hotspot, anchor point and reference node with known position) and a point to be measured (or called point to be positioned with unknown position).
The server is used for positioning calculation, positioning scheduling of the base station and calculation of time synchronization signals, namely, the position of a position to be positioned is calculated through wireless ranging data obtained by the base station, and time synchronization among the base stations and ranging scheduling of the base stations by the server are realized through wireless communication; a base station (or called a hotspot, an anchor point and a reference node, hereinafter referred to as a base station) is a point fixed at a known position in space, and mainly works to measure and collect ranging data of a point to be measured, wherein the main ranging data is the air propagation time of a signal when the base station communicates with the point to be measured, and the distance between the base station and the point to be measured is calculated through the air propagation time and the propagation speed of the signal in the space and other ranging data including but not limited to bandwidth, spreading factor, signal-to-noise ratio, received signal strength attenuation, frequency deviation and the like; the point to be measured (or called point to be measured, hereinafter referred to as point to be measured) is mainly arranged on a person or an object with unknown position to realize wireless positioning of the person or the object with the unknown position. The positioning principle adopts a three-edge or multi-edge positioning principle, the number of base stations is three or more than three and is reasonably distributed, and the number of points to be measured is one or more than one.
As shown in fig. 2, an LoRa wireless communication device includes a processor (MCU), a memory, an SX1280LoRa wireless communication module (SX 1280 in fig. 2), an antenna, and other supporting parts (other parts such as a power supply in fig. 2). The processor MCU is mainly used for running a software program for realizing the wireless positioning time synchronization method based on the LoRa technology and realizing data transmission, the memory is used for storing codes and data, the SX1280 is mainly used for realizing LoRa wireless communication, the antenna is mainly used for receiving and transmitting data, and other supporting parts mainly comprise a power supply, a key, various interfaces and the like.
In the wireless positioning time synchronization method based on the LoRa technology, the communication between the server and the base station adopts the LoRa communication technology and works in the 2.4GHZ frequency band, so that in other positioning technologies except the LoRa technology of the 2.4GHZ frequency band, the LoRa wireless communication device for realizing the wireless positioning time synchronization method based on the LoRa technology can be additionally arranged on the server and the base station to realize the time synchronization and positioning data transmission functions, and in a positioning system adopting the LoRa technology of the 2.4GHZ frequency band, the LoRa wireless communication device can be directly applied to realize the wireless ranging, time synchronization and positioning data transmission functions.
In the positioning scene, the wireless positioning system comprises one server, three or more than three base stations, the base stations are numbered from 1 to n, the ith base station is called a base station i, and a plurality of points to be measured are arranged. The equipment mainly used for time synchronization is a base station and a server, and communication parameters such as channels, bandwidths and spread spectrum factors at two ends of communication need to be ensured to be consistent in the LoRa communication process. The channel frequency can be set to range from 2400MHz to 2480MHz, the Spreading Factor (SF) can be set to range from 5 to 12, and the parameter represents the chip rate (R)c) And symbol rate (R)S) The specific calculation method of the relationship is shown in formula (1):
2SF=Rc/RS (1)
the information transmission and the information interaction of the time synchronization process are realized by scheduling the configuration of important parameters, namely a channel and a spreading factor, in the LoRa communication process. The method comprises the steps that firstly, the base stations and the server carry out information interaction, then the server carries out time synchronization on the base stations, the time synchronization mode is that the server sends calculated time stamps to the base stations, and then the base stations synchronize the time of the base stations by the time stamps.
The wireless positioning time synchronization method based on the LoRa technology is described in detail as follows:
step 1: the method comprises the steps of setting n base stations and a plurality of points to be measured in a scene, and setting one server, wherein the base stations and the server are fixed at positions, then each base station and each server start to initialize, and after initialization, the positions of each server and each base station are fixed and do not change. When the system is initialized, the server and the base station measure the distance through the SX1280 chipAn engine for measuring and storing the distance between the server and each base station by TOF (time of flight) principle, wherein the distance between the base station i and the server is marked as di(unit meter), if the number of the points to be measured is larger than the number n of the base stations in the same time zone, the server groups the points to be measured, each group of n points to be measured, and the next five steps (Step2 to Step6) are a wireless positioning process of the base stations to the group of points to be measured, namely a working period.
Step 2: the base station and the server start working: firstly, each base station establishes wireless communication with a point to be measured in an area and carries out ranging, and each base station collects ranging data and calculates the distance result between the base station and the point to be measured. This part of the work is done by the positioning system.
Step 3: the base station i which completes distance data resolving encapsulates a distance measurement result into a frame of distance measurement data information i, which is called DATAi, and sends the frame of distance measurement data information i to a server through the LoRa wireless communication device, a preset channel and a preset spreading factor are kept in the sending process, a server response signal ACKi is waited after the sending is finished, and the DATAi is sent repeatedly if the server response signal ACKi is not received after a period of time.
Step 4: the server is set to be in a receiving mode, wireless communication parameters of the server are the same as preset parameters of a certain base station, when the ranging data information DATAi of the base station i is received and checked to be correct, the server keeps setting of preset channel and spreading factor parameters of the base station i, and then sends a response signal ACKi to the base station i.
Step 5: after receiving the response signal ACKi sent by the server, the base station i switches to the receiving mode to prepare for receiving the time synchronization signal SYNi. After the server finishes sending, the wireless communication parameters (including channel, spreading factor, etc.) are switched to be set to be the same as that of another base station, and the ranging data information of the other base station is ready to be received.
Step 6: repeating the steps 2 to 5 until the ranging data information of all the base stations is received by the server, and after the server receives the ranging information of all the base stations, switching the spreading factor and the channel in a time-sharing manner, respectively sending time synchronization signals SYNi for multiple times, wherein the SYNi comprises time stamp information, the time stamps in the SYNi information sent each time are different, the sending sequence of the time synchronization information SYNi is strictly sent from 1 to n from small to large, so that i also represents the sequence of sending the signals by the server, and the time stamp information sent by the server to the base station i is determined by the sending sequence and the communication parameter calculation of the base station i. After all base stations receive the time stamps, the time of the base stations is reset by the time stamps in the received information. The time synchronization between the base stations is completed, and meanwhile, the server can also resolve the ranging data to complete the positioning service, and a positioning cycle is completed. Each base station begins the wireless location process of the next cycle. If a certain base station does not receive the time synchronization signal due to abnormal conditions such as interference, the program is restarted after waiting for a period of time, and the time of the base station is synchronized in the next period.
After passing through the steps 1-6, the wireless sensor network completes ranging, information collection and time synchronization of a group of points to be measured, and can realize a wireless positioning function, and a time communication model diagram of each base station and server in the steps 3 to 6 is shown in fig. 3. The steps 2 to 6 are a working period, the wireless sensor network completes a wireless positioning process once in each working period, and the wireless sensor network continuously circulates, so that the stable and efficient operation of the wireless sensor network positioning function is realized.
In the invention, three wireless signal forms are provided, the lengths of the three signal payloads are the same, and the information in the signal is ensured to be less than or equal to the signal payload, as shown in fig. 3. The first is a DATA signal (ranging DATA information), the content of which includes, but is not limited to, ranging DATA of a positioning process, the purpose of which is mainly for a base station to communicate information to a server; the second type is an ACK signal (response signal), the content of the signal includes, but is not limited to, a response signal, base station configuration instruction information, and point information to be measured, and the signal is mainly used for a server to respond to a DATA signal of a base station and for the server to perform ranging scheduling or communication parameter configuration on the base station. The third is a time synchronization signal SYN, whose main contents include, but are not limited to, timestamp information and base station configuration instruction information and point information to be measured of the next cycle. Because the SYN signal in the time synchronization process is sent in a time-sharing manner and the end-to-end communication between the server and the base station is actually carried out in the time synchronization process, the most accurate time stamp information aiming at the base station can be transmitted to different base stations so as to ensure that all the base stations keep the same time after the time synchronization process is finished.
In order to achieve the time synchronization effect of the invention, in combination with the time synchronization process of time-sharing multiple transmission in the time synchronization process, the invention discloses a time stamp calculation method, which is used for calculating the time consumption in the time synchronization process, adding the time consumption into the error elimination process of the time synchronization, presetting the time difference and the error of each base station in the time synchronization process into the time stamp information of the base station, and improving the time synchronization accuracy, wherein the time stamp calculation mode in the time synchronization method is shown as a formula (2):
Figure BDA0003457607500000101
wherein, T0The time of the server is generally set to 0 time for starting time synchronization, that is, the self timer is cleared when the server starts synchronization. T isgapThe transmission interval between two frames of time synchronization signals can also be regarded as signal processing time delay of the server side. T iss(i) Is TOA (TimeOne air) from base station to server, and the part is mainly determined by 3 communication parameters, namely spreading factor SF, bandwidth BW and symbol number NsymbolThe specific calculation formula is shown as formula (3):
Ts(i)=Nsymbol×2SF÷BW(ms) (3)
wherein the bandwidth BW is in KHZ, the selectable values are 203KHZ, 406KHZ, 812KHZ and 1625KHZ, the spreading factor calculation method and the selectable values are as described above, NsymbolThe size depends on the modulation parameters, which mainly include the coding rate, data frame preamble length, payload length, CRC check bits and spreading factor SF, NsymbolThe length setting and calculating mode is determined by an SX1280 chip, and the part is mainly used for calculating the time required by each time of sending in multiple times of time synchronization. When the normal encoding mode is adopted, NsymbolThe calculation formula is as formula (4), when long intersection is adoptedN using fixed and variable preamble modes when organizing the encoding schemesymbolThe calculation methods are shown in formula (5) and formula (6), respectively.
Figure BDA0003457607500000102
Figure BDA0003457607500000111
Figure BDA0003457607500000112
Figure BDA0003457607500000113
In equations (4), (5), and (6), if CRC check is turned on, then BCRC16, otherwise BCRC0; if the fixed preamble mode is set, NheaderIs 0, otherwise the header is Nheader20; CR denotes coding rate, CR denotes 1,2, 3, and 4 when coding rates are 4/5, 4/6, 4/7, and 4/8, respectively, in normal coding, and when long interleaving coding is employed, coding rates are 4/5, 4/6, and 4/8, respectively, corresponding to CR values of 5, 6, and 8; b ispayloadRepresents the payload length in bits; n is a radical ofpreambleIndicates the length of the preamble sequence of the transmitted signal, and is set to 12 symbols, N by defaultpreambleFrom 8 to 61440 symbols can be provided, with an automatic addition of 4.25 symbols during the LoRa brewing process. T isd(i) For propagation delay from a base station i to a server, the propagation delay is related to the propagation speed of an electromagnetic wave in space and the propagation distance, and the propagation delay is generally equal to the propagation distance divided by the propagation speed (i.e. 3 × 10)8m/s), because the LoRa wireless communication distance can reach kilometer level, the time synchronization error is corrected by adopting the parameter, and the time synchronization error caused by the distance between base stations is reduced. In the present invention, Td(i) Wireless distance between server and base station when system is initializedAnd (3) calculating, wherein the calculation formula is shown as the formula (7):
Td(i)=di/(3×108)×1000(ms) (7)
the timestamp information in the time synchronization process is calculated by the formula, and through the calculation of the formula, the time error caused by time-sharing transmission of the time synchronization signal and air propagation of the time synchronization signal in the time synchronization process can be reduced, and meanwhile, the time correction result is corrected by the propagation delay of the radio signal, so that the accurate and stable time synchronization effect is achieved.
The wireless communication part of the invention is a request response mechanism, and the terminal equipment (namely, the base station) sends information to the synchronous control end (namely, the server) and waits for the response and time synchronization of the synchronous control end (namely, the server). The time synchronization method adopts various time delay calculations, carries out time synchronization end to end by a synchronization mode of continuously sending synchronization signals in a time-sharing way in a short time, calculates the time of each synchronized terminal (namely, a base station) for receiving the time synchronization signals, and takes the time as a time stamp when the base station is synchronized, thereby reducing time synchronization errors caused by signal air propagation, propagation delay caused by the space distance between terminal equipment (namely, the base station) and a synchronization control end (namely, a server) and the like.
The invention has the following effective effects:
1. the time synchronization method has the functions of time synchronization and information exchange and can be completed through a simple communication process. The main reason is that in the communication, one base station and the server only need three information transfers to complete the process. Has high efficiency.
2. The method adopts the LoRa technology working in the 2.4G frequency band, the technology has the communication distance of the farthest 3 kilometers and higher communication speed, and meanwhile, a TOF (time of flight) ranging engine is arranged, so that the space distance between a receiving end and a transmitting end can be obtained, and the error in time synchronization can be corrected conveniently. Meanwhile, the LoRa adopts a spread spectrum communication technology, so that the system has stronger anti-interference capability, low power consumption performance and higher stability.
3. The method has higher accuracy, and in the time synchronization process, time error calculation and reduction are carried out in various modes, so that the time synchronization precision is greatly improved, and microsecond precision can be realized.
4. The system realized by the method of the invention adopts low-power consumption devices and the MCU, and has excellent low-power consumption performance.
The following describes a wireless positioning time synchronization method based on the LoRa technique according to an embodiment of the present invention.
In this embodiment, a hardware platform adopts the structure shown in fig. 2, a server, four base stations and 4 points to be tested are arranged in an experimental area, the server is constructed by a module externally connected to a PC and containing an SX1280 chip, hardware parts of the base stations, such as a processor, a memory and the like, are constructed by STM32L4 series MCU plus SX1280 modules and corresponding circuits, and the base stations are respectively named as base station 1, base station 2, base station 3 and base station 4; the points to be positioned are named as a point to be measured X1, a point to be measured X2, a point to be measured X3 and a point to be measured X4 respectively. Example experimental environment as shown in fig. 4, lightning is identified as a ranging signal in fig. 4, and a dotted line represents a wireless communication link for information exchange and time synchronization.
In this embodiment, the base station communication parameter configuration and the number of signal symbols N calculated according to the communication parameter configuration and the payload lengthsymbolAs shown in table 1, other communication parameters, such as header sequence length (set 12 symbols), coding rate (set 4/5), payload length (set 20 bytes), the base station is set the same as the server. The base station location is known and fixed according to positioning system implementation principles.
The method comprises the following steps: in the experimental environment of the embodiment, the initialization is started after the base stations and the servers are fixed, and the positions of the servers and the base stations are not changed after the initialization. When the system is initialized, the server and the base stations measure and store the distances between the server and each base station through a ranging engine arranged on an SX1280 chip and a TOF (time of flight) principle, and the distance marks of the four base stations and the server are d1、d2、d3、d4(the units are all meters).
Step two: the base station and the server start working: firstly, each base station establishes wireless communication with a point to be measured in an area and carries out ranging, and each base station collects ranging data and calculates the distance result between the base station and the point to be measured.
Table 1 embodiment base station communication parameter configuration table
Figure BDA0003457607500000141
Step three: the four base stations which finish the distance DATA calculation respectively encapsulate the distance measurement result into a frame of distance measurement DATA information which is respectively called DATA1, DATA2, DATA3 and DATA4 and send the frame of distance measurement DATA information to a server through the wireless communication module of the invention, each base station keeps a channel and a spreading factor preset according to the table 1 in the sending process, each base station waits for a server to answer a signal ACK after sending is finished, and if a certain base station does not receive the server's answer signal ACK after a period of time, DATA is sent repeatedly.
Step four: the server sets a receiving mode, wireless communication parameters of the server are the same as preset parameters of a certain base station, when the server receives ranging DATA information DATA of the certain base station and checks the ranging DATA information DATA to be correct, the server keeps setting parameters such as a channel and a spreading factor preset by the base station, and then sends a response signal ACK to the base station.
Step five: after receiving the response signal ACK sent by the server, the base station switches to the reception mode to prepare for receiving the time synchronization signal SYN. After the server finishes sending, the switching communication parameters are set to be the same as the parameters of the channel, the spreading factor and the like of the other base station, and the ranging data information of the other base station is prepared to be received.
Step six: and repeating the processes from the third step to the fifth step until ranging data information of 4 base stations is received by the server, setting a spreading factor and channel parameters by time-sharing switching after the server receives the ranging information of the 4 base stations, and respectively sending time synchronization signals SYN1, SYN2, SYN3 and SYN4 for multiple times, wherein the sending sequence of the time synchronization signals is from 1 to 4 and is from small to large, the SYN comprises timestamp information, the timestamps in the SYN information sent to the base stations each time are different, and the timestamp information is determined by the sending sequence and the communication parameters of the base stations. Formula for calculationReferring to equation (2), the time synchronization initial time T in the equation0Is 0, two time synchronization intervals TgapIs 0, T of four base stations in combination with the communication parameters in this embodimentsAnd the last timestamp information is shown in table 1. After all base stations receive the time stamps, self time is reset by the time stamps in the received information, namely time synchronization among the base stations is completed, and meanwhile, the server can also calculate ranging data to complete positioning service. The system starts the wireless ranging, ranging data transmission and time synchronization process of the next period according to the synchronization time and the corresponding setting. If a certain base station does not receive the time synchronization signal due to abnormal conditions such as interference, the program is restarted after waiting for a period of time, and the time of the base station is synchronized in the next period.
And repeating the second step to the sixth step to finish a working cycle. The signaling of the duty cycle described above is described with reference to fig. 3. In each working period of the wireless sensor network, a time synchronization process is provided, so that each device can be ensured to stably operate according to a preset working beat.
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.
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 (9)

1. A wireless positioning time synchronization method based on an LoRa technology is characterized in that the wireless positioning time synchronization method based on the LoRa technology is applied to a wireless positioning system, and the wireless positioning system comprises a server, at least three base stations and a point to be measured;
the wireless positioning time synchronization method based on the LoRa technology comprises the following steps:
if the number of the points to be measured is larger than the number n of the base stations, grouping the points to be measured and numbering the groups, wherein the number of the points to be measured in each group is at most n; if the number of the points to be measured is not more than the number n of the base stations, the number of the points to be measured is 1 group;
each base station establishes wireless communication with the points to be measured and carries out ranging to obtain the distance between each base station and each point to be measured;
for the point to be measured of the jth group, the measured distances of the base station i to the multiple points to be measured of the jth group are encapsulated into a frame of ranging data information i, which is marked as DATAi, and the base station i sends the DATAi to the server;
the server sends a response signal ACKi to the base station i after receiving the DATAi;
after receiving ranging data information of n base stations, the server transmits time synchronization signals to the base stations in a time-sharing manner; the time synchronization signal comprises a timestamp;
after each base station receives the corresponding time synchronization signal, the time of each base station is reset according to the time synchronization signal, and the time synchronization of one working period is completed; the time synchronization of one packet is taken as one duty cycle.
2. The method for wireless positioning time synchronization based on LoRa technology, which is characterized in that the method also includes:
measuring and storing the distance between the server and each base station; and the time synchronization signal SYNi sent to the base station i by the server is determined according to the distance between the server and the base station i.
3. The LoRa technology-based wireless positioning time synchronization method of claim 2, wherein the measuring and storing of the distance between the server and each base station specifically comprises:
and measuring and storing the distance between the server and each base station by using a distance measuring engine of an SX1280 chip according to the TOF principle.
4. The LoRa-technology-based wireless positioning time synchronization method of claim 1, wherein after the base station i sends DATAi to the server, the method specifically comprises:
and after the base station i finishes sending the DATAi, if the response signal ACKi of the server is not received within the set time, the base station i sends the DATAi to the server again.
5. The LoRa-technology-based wireless location time synchronization method of claim 1, wherein the base station i sends DATAi to the server, and specifically comprises:
the base station i keeps preset wireless communication parameters in the process of sending the DATAi to the server; the wireless communication parameters include a channel and a spreading factor.
6. The LoRa-technology-based wireless positioning time synchronization method of claim 5, wherein the server sends an acknowledgement signal ACKi to the base station i after receiving the DATAi, and specifically comprises:
and the wireless communication parameters of the server are the same as those of the base station i, and after the server receives the DATAi, the server keeps the same wireless communication parameters as those of the base station i and sends a response signal ACKi to the base station i.
7. The LoRa-technology-based wireless location time synchronization method of claim 1, wherein the timestamp is calculated by the following formula:
Figure FDA0003457607490000021
wherein, T0For time-synchronizing the time of the start time server, TgapFor a transmission interval of two frames of time-synchronous signals, Ts(i) TOA, T from base station i to the serverd(i) Representing propagation delay from base station i to server;
Ts(i)=Nsymbol×2SF÷BW;
Wherein N issymbolIndicating the number of symbols, SF the spreading factor and BW the bandwidth.
8. The LoRa-technology-based wireless location time synchronization method of claim 7, wherein T isd(i)=di/(3×108)×1000;
Wherein d isiRepresenting the distance between the server and base station i.
9. The method for wireless positioning time synchronization based on LoRa technology, which is characterized in that the method also includes:
and the server positions the point to be measured according to a trilateral positioning principle or a multilateral positioning principle based on the received ranging data information.
CN202210011546.1A 2022-01-06 2022-01-06 Wireless positioning time synchronization method based on LoRa technology Active CN114245455B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210011546.1A CN114245455B (en) 2022-01-06 2022-01-06 Wireless positioning time synchronization method based on LoRa technology

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210011546.1A CN114245455B (en) 2022-01-06 2022-01-06 Wireless positioning time synchronization method based on LoRa technology

Publications (2)

Publication Number Publication Date
CN114245455A true CN114245455A (en) 2022-03-25
CN114245455B CN114245455B (en) 2023-04-07

Family

ID=80745932

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210011546.1A Active CN114245455B (en) 2022-01-06 2022-01-06 Wireless positioning time synchronization method based on LoRa technology

Country Status (1)

Country Link
CN (1) CN114245455B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827903A (en) * 2022-06-14 2022-07-29 吉林大学 Positioning method and system based on LoRa SX1280 channel multiplexing

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1946002A (en) * 2006-09-30 2007-04-11 华为技术有限公司 Clock synchronizing method between base stations
US20180024224A1 (en) * 2016-07-20 2018-01-25 Semtech Corporation Method and system of timing and localizing a radio signal
CN108877296A (en) * 2018-08-01 2018-11-23 江苏省送变电有限公司 A kind of collision avoidance system based on Internet of Things
CN208294571U (en) * 2018-05-23 2018-12-28 福州大学 Safety operation platform under a kind of smart well off the net based on Lora group
CN109819396A (en) * 2019-01-30 2019-05-28 北京布科思科技有限公司 A kind of wireless location method and system
CN110113764A (en) * 2019-04-29 2019-08-09 深圳前海微众银行股份有限公司 Localization method, device, equipment and the computer readable storage medium of terminal device
CN113050051A (en) * 2021-03-05 2021-06-29 惠州Tcl移动通信有限公司 UWB ranging calibration method, device, terminal and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1946002A (en) * 2006-09-30 2007-04-11 华为技术有限公司 Clock synchronizing method between base stations
US20180024224A1 (en) * 2016-07-20 2018-01-25 Semtech Corporation Method and system of timing and localizing a radio signal
CN208294571U (en) * 2018-05-23 2018-12-28 福州大学 Safety operation platform under a kind of smart well off the net based on Lora group
CN108877296A (en) * 2018-08-01 2018-11-23 江苏省送变电有限公司 A kind of collision avoidance system based on Internet of Things
CN109819396A (en) * 2019-01-30 2019-05-28 北京布科思科技有限公司 A kind of wireless location method and system
CN110113764A (en) * 2019-04-29 2019-08-09 深圳前海微众银行股份有限公司 Localization method, device, equipment and the computer readable storage medium of terminal device
CN113050051A (en) * 2021-03-05 2021-06-29 惠州Tcl移动通信有限公司 UWB ranging calibration method, device, terminal and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114827903A (en) * 2022-06-14 2022-07-29 吉林大学 Positioning method and system based on LoRa SX1280 channel multiplexing

Also Published As

Publication number Publication date
CN114245455B (en) 2023-04-07

Similar Documents

Publication Publication Date Title
EP3550899A1 (en) Method and apparatus for determining clock time deviation between terminal and base station
CN103918340B (en) Determine method, base station and the user equipment of channel loss
US9131509B2 (en) Mechanism for group polling without precise timing
EP1434448A3 (en) Method and apparatus for high rate packet data transmission
CN109996325B (en) Clock synchronization system and method of wireless sensor network
CN114245455B (en) Wireless positioning time synchronization method based on LoRa technology
CN103179654A (en) Method and device for determining emitting power of Physical Random Access Channel (PRACH)
CN111491266A (en) Time synchronization method for UWB TDOA positioning system base station
CN103108388A (en) Method, device and system of wireless sensor network clock synchronization
CN100581094C (en) Network clock synchronizing method for short distance radio communication network
CN111882847A (en) Electric energy meter pulse transmission method and device based on low-power-consumption Bluetooth chip
CN102238558B (en) A kind of method of the network optimization and the hard analogue system of network
CN106455038A (en) Master node, slave node and synchronization information self-correcting method
CN104540214A (en) Time-sharing system time slot setting method for determining time slot numbers based on time marks and time slot positions
CN103516423B (en) A kind of method and apparatus zoomed out for fiber bit clock
CN115066010A (en) Multi-channel lora monitoring system multi-stage synchronous networking method
US20160302173A1 (en) Data transmission method, apparatus, and system
CN102138295B (en) Communication system, dependent station thereof and dependent-station relay transmission method
CN103067432B (en) The sending method of data, transmitting terminal and communication system
CN116390217A (en) LoRa equipment ad hoc network system based on self-adaptive time synchronization scheme
CN105263153A (en) Method of intelligent detection on communication link quality of wireless module
CN108809469A (en) Time transfer receiver synchronized algorithm suitable for radar pulse communication equipment networking
CN201266940Y (en) GPS network clock synchronous server
CN113691481A (en) Method, device, base station and storage medium for frame synchronization in new air interface system
CN103139897B (en) Method and device for transmitting pilot signals in mixed ad-hoc network

Legal Events

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