CN112351485A - Radio frequency-based equipment synchronization method - Google Patents

Radio frequency-based equipment synchronization method Download PDF

Info

Publication number
CN112351485A
CN112351485A CN202011170931.8A CN202011170931A CN112351485A CN 112351485 A CN112351485 A CN 112351485A CN 202011170931 A CN202011170931 A CN 202011170931A CN 112351485 A CN112351485 A CN 112351485A
Authority
CN
China
Prior art keywords
timer
time slot
equipment
time
count value
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
CN202011170931.8A
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.)
Nanjing Tuoheng Unmanned System Research Institute Co ltd
Original Assignee
Nanjing Tuoheng Unmanned System Research Institute 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 Nanjing Tuoheng Unmanned System Research Institute Co ltd filed Critical Nanjing Tuoheng Unmanned System Research Institute Co ltd
Priority to CN202011170931.8A priority Critical patent/CN112351485A/en
Publication of CN112351485A publication Critical patent/CN112351485A/en
Pending legal-status Critical Current

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
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W56/00Synchronisation arrangements
    • H04W56/004Synchronisation arrangements compensating for timing error of reception due to propagation delay
    • H04W56/0045Synchronisation arrangements compensating for timing error of reception due to propagation delay compensating for timing error by altering transmission time

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

The invention relates to a device synchronization method based on radio frequency, which comprises the following steps: carrying out timer calibration on transmitting equipment and receiving equipment; the synchronous maintenance of the transmitting equipment is carried out, firstly, the time slot count value is cleared, then, the time slot count value is added with 1 when the time slot starts each time, when the time slot count value reaches N, the transmitting equipment transmits a synchronous data packet, the time slot count value is reset to be zero after the synchronous data packet is transmitted, and the time slot counting of the next round is continued; and (3) carrying out synchronous maintenance on the receiving equipment, receiving a synchronous data packet of the transmitting equipment by the receiving equipment, resetting the time slot count value, updating the timer count value of the receiving equipment, adding 1 to the time slot count value when each time slot starts, and turning on the receiver when the time slot count value is greater than or equal to N to finish synchronous calibration. The invention can effectively solve the problem that the base station or the gateway can not carry out synchronous calibration with the receiving equipment by means of an external device when the synchronous requirement exists and the wireless network is completely deployed in the indoor environment.

Description

Radio frequency-based equipment synchronization method
Technical Field
The invention relates to the technical field of wireless communication, in particular to a device synchronization method based on radio frequency.
Background
In the internet of things field, any equipment that can be connected to the network is defined as the internet of things terminal, has produced massive connection demand from this, for example garbage bin, parking stall, agricultural irrigation, urban pipeline detects etc..
In the LoRaWAN technical specification, three access modes, Class A, Class B and Class C, are defined. In the Class a access mode, the receiving device is always in a sleep state. When an event occurs, the device wakes up and sends information to the gateway, and then the receiving device sleeps again. If the communication needs to be confirmed, the receiving device turns on the receiver and receives the receipt of the gateway after a fixed period of time. In the Class B access mode, the receiving device and the gateway are kept synchronized, and the gateway needs to send downlink information at intervals to allow the receiving device to perform time calibration. The time is calculated in time slots. The gateway and the receiving device maintain the time gap consistent. When an event occurs, the receiving device may send a message in the most recently available time slot. If the message needs to be acknowledged, the receiving device turns on the receiver to receive the receipt after a fixed number of time slots have elapsed. Through the synchronization mechanism, the gateway requires the receiving device to turn on the receiver within a specified time slot. If the gateway has a message to send to the terminal, the gateway will send in the designated time slot. In the Class C access mode, the receiver of the receiving device is always in a receiving state. When an event occurs, the receiving device sends information to the gateway. If the message needs to be acknowledged, the gateway can be issued at any time because the receiver of the receiving device is always on when no task is sent. The gateway has a message to be sent to the receiving device actively, and can also be sent at any time, because the receiving function of the terminal is available all the time.
Compared with three access modes of LoRaWAN, Class A has the advantage of lowest power consumption, but because the terminal is always in a dormant state, the gateway is difficult to actively contact the terminal, so that the defect of bidirectional communication capability is caused, and meanwhile, because the terminal is always in a state of not being controlled by the gateway, if a large number of terminals send uplink data at the same time, serious conflict can be caused. In the Class C mode, the receiver of the terminal is always in an available state without sending task, so the gateway can communicate with the terminal at any time, and the disadvantage is that the power consumption of the terminal is relatively high. In Class B mode, the receiving device is mostly dormant, but the receiver is turned on in a designated time slot, and this time slot is predictable, resulting from gateway designation. Compared to the Class a mode, the Class B mode generates additional power consumption requirements when receiving synchronization signals, but guarantees the implementation of bi-directional communication. Compared with the Class C mode, the Class B mode keeps a dormancy mechanism, and the disadvantage is that the time delay of bidirectional communication is larger. Class B mode balances bi-directional communication with low power consumption, and is implemented with the key that synchronization between the receiving device and the gateway can be maintained. Typically, the transmitting device uses GPS as a clock location source, so current Class B based deployments must ensure that the gateway is installed in an outdoor environment.
For NBIoT technology, a synchronization policy is implemented between the receiving device and the base station, and since the base station is installed outdoors and is connected to the operator by wire, there is no technical obstacle to implementing synchronization. Under the condition of synchronization requirement, when the wireless network is completely deployed in an indoor environment, the base station or the gateway cannot obtain accurate time by using external equipment such as a GPS (global positioning system), and cannot perform synchronization calibration with the receiving equipment.
Disclosure of Invention
The invention aims to provide a radio frequency-based equipment synchronization method, which can solve the problem that a base station or a gateway cannot perform synchronous calibration with receiving equipment by means of an external device, such as a Global Positioning System (GPS), when a synchronization requirement condition exists and a wireless network is completely deployed in an indoor environment.
In order to solve the technical problems, the invention adopts the following technical scheme:
a device synchronization method based on radio frequency comprises the following steps:
step 1, calibrating a timer for transmitting equipment and receiving equipment;
step 2, carrying out synchronous maintenance of the transmitting equipment, firstly, resetting the time slot count value, then adding 1 to the time slot count value when the time slot starts each time, when the time slot count value reaches N, transmitting a synchronous data packet by the transmitting equipment, resetting the time slot count value to be zero after the synchronous data packet is transmitted, and continuing the time slot count of the next round;
and 3, carrying out synchronous maintenance on the receiving equipment, resetting the time slot count value after the receiving equipment receives the synchronous data packet of the transmitting equipment, updating the timer count value of the receiving equipment, adding 1 to the time slot count value when the time slot starts each time, starting the receiver when the time slot count value is more than or equal to N, receiving the synchronous data packet, completing synchronous setting, resetting the time slot count value, and continuing to increase automatically from the next time slot.
The method for calibrating the timer comprises the following steps:
(1) setting the equipment to be in a synchronous mode under the condition of no external time service equipment, setting the length of a theoretical timer of the equipment, and starting the timer;
(2) the equipment sends single-packet data, and records the length of the single-packet data and the total time of sending the single-packet data in the modem;
(3) the equipment records the count values of the timer before and after the single packet of data is sent;
(4) calculating a timer counting difference before and after the single packet data is sent, wherein the timer counting difference comprises a compensation value of a time error between the completion of data modulation and sending and the reporting of a processor by a modem;
(5) the device calibrates the new timer value according to the actually required time length based on the timer count difference, and replaces the theoretical timer length in (1) with the new timer value.
The way to calibrate the timer value setting is:
calibration timer value (actual required time length timer count difference)/total time for completing data packet transmission in modem
The data packet is a single packet of data with a fixed length, and the actually required time length is the time length of each actually used time slot.
The method for updating the timer count value of the receiving equipment comprises the following steps:
(1) the transmitting equipment transmits a synchronous data packet with a fixed length;
(2) and the receiving equipment sets a new timer value based on the counting difference value of the timer according to the actual required time length for sending the synchronous data packet by the transmitting equipment and the time error between the demodulation of the data packet by the local modem and the reporting of the received information, and updates the timer counting value of the receiving equipment to the new timer value.
The manner of resetting the timer value by the receiving device is as follows:
the new timer value is the length of time the synchronization packet has propagated through the air + the total length of time the synchronization packet has completed reception at the receiving modem.
The value N is the maximum time interval for the synchronous calibration of the transmitting device and the receiving device after calibration. After (N × a single slot length time) the time error between the transmitting device and the receiving device reaches the maximum tolerable range of timer errors.
According to the radio frequency-based equipment synchronization method provided by the technical scheme, when the time service condition of external equipment cannot be used and the synchronization between the wireless equipment needs to be realized locally, the synchronization between the transmitting equipment and the receiving equipment can be realized, and the extra power consumption overhead is not increased remarkably.
Firstly, assuming a standard time length as a reference source, selecting a counting value closest to the standard time length by detecting the actual counting number of the timer in the standard time length, and controlling the error brought by the crystal oscillator to the maximum extent; and because the timer used by each wireless device is compared with the standard time length and then the count value is reset, which is equivalent to calibrating with the same reference source, the error between the recalibrated timers is reduced compared with the uncalibrated timers.
Because the wireless communication is completed by the transmitter and the receiver together, the transmitter and the receiver are completely synchronous with each other in principle when working, the wireless device can generate a transmission task once, and the completion time of single transmission is ensured to be fixed and measurable by using data with specified length.
The invention records the counting value of the timer before and after transmission, and when the transmission is finished, the difference of the two counting values is calculated, and the counting value corresponding to the sending time length of the data packet can be obtained; and based thereon recalibrates the timer. In addition, because the transceiver of the wireless communication is designed and manufactured to ensure that the error between the communication code elements is within the specified range, the reference time length obtained by different receiving devices for the working time of the respective transmitters has small error, even if the error range of the wireless transceiver is large, the reference time length is necessarily a controllable range, otherwise, the wireless communication cannot be realized, and in this case, the timer counting value can be calibrated and compensated according to the actual requirement. After the timer is calibrated, the wireless terminal and the gateway can set a count value with more accurate time precision, and after that, the synchronous state can be kept for a long time only by regularly receiving the synchronous signal of the gateway and resetting the timer.
Drawings
FIG. 1 is a flow chart of a method for RF-based device synchronization in accordance with the present invention;
FIG. 2 is a flow chart of the gateway synchronization maintenance of the present invention;
fig. 3 is a flowchart of maintaining synchronization of a terminal device according to the present invention.
Detailed Description
In order that the objects and advantages of the invention will be more clearly understood, the following description is given in conjunction with the accompanying examples. It is to be understood that the following text is merely illustrative of one or more specific embodiments of the invention and does not strictly limit the scope of the invention as specifically claimed.
The wireless communication device usually drives the local clock through oscillation of the crystal oscillator to generate knowledge of the time length, and due to physical characteristics of the crystal oscillator, errors necessarily occur between different crystal oscillators. Two wireless devices use different crystal oscillators, and even if starting to shake at the same moment, the two wireless devices generate larger and larger errors along with the change of time. For example, if the error between the crystal oscillator a and the standard clock is +10 microseconds and the error between the crystal oscillator B and the standard clock is-5 microseconds, the error between the two crystal oscillators reaches 15 microseconds. Moreover, because the error is accumulated, the longer the service time is, the larger the error is; the nominal value is set for a range of crystal oscillators, for example, of 10ppm accuracy, which means that the error per second is within +/-10 microseconds, but does not represent the exact deviation of a particular crystal oscillator. Therefore, even if the crystal oscillators have the same specification, the mutual error is difficult to determine.
Although the error generated by the crystal oscillator is unavoidable, the influence of the error can be minimized by adjusting the timer. The clock used by the embedded device calculates the time length by counting through a timer. The timer count is driven by the oscillation of the crystal, which is also the source of timer error. If a standard time length is used as a reference source, the error caused by the crystal oscillator can be controlled to the maximum extent by detecting the actual counting number of the timer in the standard time length and selecting the counting value closest to the standard time length. Because the nominal value of the crystal oscillator is obtained by unified test, the nominal value represents the range of the error of the crystal oscillator and does not represent the actual error of the crystal oscillator. In the using process of the system, the real-time comparison with the uniform standard time length can be carried out, so that the counting setting which is closest to the standard time length and has the minimum error and can be reached by the timer when the currently used crystal oscillator drives the timer can be accurately measured. Because the timer used by each wireless device is compared with the standard time length and then the count value is reset, which is equivalent to the same reference source being calibrated, the error between the recalibrated timers can be reduced compared with the timers which are not calibrated.
The invention takes a transmitting device as a gateway and a receiving device as a terminal device as an example to explain the device synchronization method based on radio frequency, and with reference to fig. 1, the method specifically comprises the following steps:
step 1, setting the terminal equipment to be in a synchronous mode under the condition of no external time service equipment, setting the theoretical timer length C of the terminal equipment, and starting a timer (at the moment, the timer length is not calibrated, and the error of the timers among different equipment is large and unpredictable); the theoretical timer length means that the counting value of the timer in the specified time length is calculated only in a mode that the crystal oscillator drives the timer at the nominal frequency without considering the calibration of the timer;
step 2, the terminal equipment initiates a single-packet data sending task, wherein the length of the single-packet data is LPacketThe total time for completing the transmission of single-packet data in the modem is TStandard_Packet
Step 3, the terminal equipment records the timer count value C before the single packet data is sentStartAnd the timer count value C when the single packet data transmission is completedFinish
Step 4. adopt COffset=CFinish-CStart+CComplementThe counting difference C of the timer is obtained by calculation in a calculation modeOffsetIn which C isComplementA compensation value set for an error that may be generated in the modem;
step 5, the timer counts the difference value C by the timerOffsetOn the basis of the actual required time length TExpectedResetting timer value CExpectedThen using CExpectedThe timer is reset instead of the theoretical timer length C in step 1. Wherein T isExpectedRepresents the time length of a single time slot used in the later operation of the system;
wherein the timer value CExpectedThe calculation method is as follows: cExpected=(TExpected*COffset)/TStandard_Packet
And calibrating the gateway equipment timer according to the steps 1-5.
Timer value CExpectedAnd for the timer value of the synchronous time slot after the calibration is finished, since the value is obtained by calculation after being compared with the sending time of the standard data packet, the value calibrated by each device is the setting with the minimum error of the current timer under the driving of the crystal oscillator.
Referring to fig. 2, after the timer of the gateway completes calibrationThe method for the gateway to maintain synchronization comprises the following steps: firstly, clearing a time slot Counter, and then when the time slot starts each time, the time slot Counter is equal to Counter + 1; then checking timer value, if time slot Counter reaches Nth time slot, transmitting equipment sends synchronous data packet; the transmission time length of the data packet is TSync(ii) a After the transmission is completed, resetting the time slot Counter to zero; where the value N is used to calculate the maximum time interval for each synchronization of the transmitting device and the receiving device after the calibration is completed. The determination of the value N depends on the errors of the timers of the transmitting and receiving parties after the calibration is completed; for example, after the calibration is completed, the error of the timers of the two parties is 1 ms per second, if the error of the gateway and the terminal device exceeds 10 ms, the communication cannot be performed, the maximum value of N is 10, which means that a synchronization signal must be sent from the gateway every 10 slots at most to synchronize the terminal device once.
Referring to fig. 3, after the timer of the terminal device completes calibration, the method of maintaining synchronization of the terminal device includes: firstly, receiving synchronous data packet of transmitting equipment, updating time slot Counter to be 0, and according to time T of synchronous data packet in air propagationSyncObtaining the corresponding count value C on the locally calibrated timerSyncCalculating and updating the slot length CCurrent,CCurrent=CSync+CSync_ComplementIn which C isSync_ComplementThe delay locally generated when the terminal device processes the synchronization signal, which is mainly generated by the modem of the receiving device when demodulating and reporting data, needs to be compensated for when updating.
The meaning of updating the timer count value is as followsExpectedIn the counting period of a single time slot, the timer should count to C when the synchronization signal is receivedCurrent(ii) a When defining the slot length, C is already ensuredCurrentMust be less than CExpected(ii) a Then starting time slot, starting time slot each time, counting time slot as Counter +1, if the time slot counting Counter is greater than or equal to N, opening the receiver, preparing to receive synchronous signal, completing synchronization, and resetting the Counter; otherwise, wait for the next oneThe start of a time slot.
The present invention is not limited to the above embodiments, and those skilled in the art can make various equivalent changes and substitutions without departing from the principle of the present invention after learning the content of the present invention, and these equivalent changes and substitutions should be considered as belonging to the protection scope of the present invention.

Claims (6)

1. A method for synchronizing equipment based on radio frequency is characterized by comprising the following steps:
step 1, calibrating a timer for transmitting equipment and receiving equipment;
step 2, carrying out synchronous maintenance of the transmitting equipment, firstly, resetting the time slot count value, then adding 1 to the time slot count value when the time slot starts each time, when the time slot count value reaches N, transmitting a synchronous data packet by the transmitting equipment, resetting the time slot count value to be zero after the synchronous data packet is transmitted, and continuing the time slot count of the next round;
and 3, carrying out synchronous maintenance on the receiving equipment, resetting the time slot count value after the receiving equipment receives the synchronous data packet of the transmitting equipment, updating the timer count value of the receiving equipment, adding 1 to the time slot count value when the time slot starts each time, starting the receiver when the time slot count value is more than or equal to N, receiving the synchronous data packet, completing synchronous setting, resetting the time slot count value, and automatically increasing from the next time slot.
2. The method for synchronizing radio frequency-based equipment according to claim 1, wherein the method for calibrating the timer comprises:
(1) setting the equipment to be in a synchronous mode under the condition of no external time service equipment, setting the length of a theoretical timer of the equipment, and starting the timer;
(2) the equipment sends single-packet data, and records the length of the single-packet data and the total time of sending the single-packet data in the modem;
(3) the equipment records the count values of the timer before and after the single packet of data is sent;
(4) calculating a timer counting difference before and after the single packet data is sent, wherein the timer counting difference comprises a compensation value of a time error between the completion of data modulation and sending and the reporting of a processor by a modem;
(5) the device calibrates the new timer value according to the actually required time length based on the timer count difference, and replaces the theoretical timer length in (1) with the new timer value.
3. The radio frequency based device synchronization method of claim 2, wherein the calibration timer value is set by:
calibration timer value (actual required time length timer count difference)/total time for completing data packet transmission in modem
The data packet is a single packet of data with a fixed length, and the actually required time length is the time length of each actually used time slot.
4. The method of claim 2, wherein the method for updating the timer count value of the receiving device comprises:
(1) the transmitting equipment transmits a synchronous data packet with a fixed length;
(2) and the receiving equipment sets a new timer value based on the counting difference value of the timer according to the actual required time length for sending the synchronous data packet by the transmitting equipment and the time error between the demodulation of the data packet by the local modem and the reporting of the received information, and updates the timer counting value of the receiving equipment to the new timer value.
5. The method of claim 4, wherein the receiving device resets the timer value by:
the new timer value is the length of time the synchronization packet has propagated through the air + the total length of time the synchronization packet has completed reception at the receiving modem.
6. The radio frequency based device synchronization method of claim 1, wherein: the value N is the maximum time interval for the synchronous calibration of the transmitting device and the receiving device after calibration.
CN202011170931.8A 2020-10-28 2020-10-28 Radio frequency-based equipment synchronization method Pending CN112351485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011170931.8A CN112351485A (en) 2020-10-28 2020-10-28 Radio frequency-based equipment synchronization method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011170931.8A CN112351485A (en) 2020-10-28 2020-10-28 Radio frequency-based equipment synchronization method

Publications (1)

Publication Number Publication Date
CN112351485A true CN112351485A (en) 2021-02-09

Family

ID=74358854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011170931.8A Pending CN112351485A (en) 2020-10-28 2020-10-28 Radio frequency-based equipment synchronization method

Country Status (1)

Country Link
CN (1) CN112351485A (en)

Similar Documents

Publication Publication Date Title
US9392565B2 (en) Method and system for accurate clock synchronization through interaction between communication layers and sub-layers for communication systems
US9955446B2 (en) Frequency offset compensation for WiFi ranging
US8290523B2 (en) Method and system for accurate clock synchronization for communication networks
US20120120874A1 (en) Wireless access point clock synchronization system
US6061573A (en) Method and apparatus in a radio communication system for synchronizing transmissions while maintaining full user traffic
EP2382829B1 (en) Method of synchronisation within a base station system
EP0813698A1 (en) Synchronization system for a shared channel communication system
US20030103475A1 (en) Two-way timing and calibration methods for time division multiple access radio networks
CN110581756B (en) Method for operating a radio transmission system and device for a radio transmission system
CN104469929A (en) Method for Synchronization of Assemblies in a Base Station
WO2006122499A1 (en) Method and system of locking clock
US20140301375A1 (en) Timing advance method for synchronized wifi network
US5059926A (en) Frequency synchronization apparatus
EP3021129A1 (en) Joint position detection by sensor devices
KR101576340B1 (en) A wireless access point clock synchronization system
WO2007076249A3 (en) Determining a minimum time of flight of a radio frequency transmission
CN112351485A (en) Radio frequency-based equipment synchronization method
US7327314B2 (en) Two-way ranging between radio transceivers
JP2023529605A (en) Masterless Device Cooperation in Location Positioning Systems
WO2007040685A1 (en) Alignment between a base station controller and a base station
WO2012059903A2 (en) A wireless access point clock synchronization system
JP5215440B2 (en) Method and apparatus for synchronizing base stations using mobile GPS stations
Schmid et al. Temperature driven time synchronization
TW202116046A (en) Method of adjusting target clock and a wireless device thereof

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