[go: up one dir, main page]

CN104168641B - A kind of wireless sensor network time synchronization method based on temperature sensing - Google Patents

A kind of wireless sensor network time synchronization method based on temperature sensing Download PDF

Info

Publication number
CN104168641B
CN104168641B CN201410341165.5A CN201410341165A CN104168641B CN 104168641 B CN104168641 B CN 104168641B CN 201410341165 A CN201410341165 A CN 201410341165A CN 104168641 B CN104168641 B CN 104168641B
Authority
CN
China
Prior art keywords
node
time
temperature
frequency offset
formula
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.)
Expired - Fee Related
Application number
CN201410341165.5A
Other languages
Chinese (zh)
Other versions
CN104168641A (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.)
Northwest University
Original Assignee
Northwest 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 Northwest University filed Critical Northwest University
Priority to CN201410341165.5A priority Critical patent/CN104168641B/en
Publication of CN104168641A publication Critical patent/CN104168641A/en
Application granted granted Critical
Publication of CN104168641B publication Critical patent/CN104168641B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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

  • Mobile Radio Communication Systems (AREA)
  • Synchronisation In Digital Transmission Systems (AREA)

Abstract

本发明公开了一种基于温度感知的无线传感器网络时间同步方法,该方法包括的步骤有:敏感度因子确定、敏感度因子间隔确定、本地时间更新。本算法在频偏估计时考虑到了节点当前环境温度变化对节点频偏造成的影响,提高了频偏估计的精度。同时,由于该算法在时间同步的过程中主要依赖本地信息,大大减少了信息传输次数,从而很大程度上降低了能耗,并且减少了由信息逐层传输带来的误差累积。最后,由于该算法对信息传输的依赖较低,从而解决了野外环境下由于恶劣天气以及节点位置动态变化等造成的通信不稳定的问题。

The invention discloses a wireless sensor network time synchronization method based on temperature perception. The method includes the following steps: determining the sensitivity factor, determining the interval of the sensitivity factor, and updating the local time. This algorithm takes into account the impact of the node's current ambient temperature change on the node's frequency offset when estimating the frequency offset, and improves the accuracy of the frequency offset estimation. At the same time, because the algorithm mainly relies on local information in the process of time synchronization, the number of information transmissions is greatly reduced, thereby reducing energy consumption to a large extent, and reducing the accumulation of errors caused by layer-by-layer information transmission. Finally, because the algorithm is less dependent on information transmission, it solves the problem of unstable communication caused by bad weather and dynamic changes of node positions in the field environment.

Description

一种基于温度感知的无线传感器网络时间同步方法A Time Synchronization Method for Wireless Sensor Networks Based on Temperature Sensing

技术领域technical field

本发明涉及无线网络技术领域,具体涉及一种基于温度感知的无线传感器网络的时间同步方法,该方法适用于野生动物监测、土遗址监测等大规模区域监测无线传感器网络应用。The invention relates to the technical field of wireless networks, in particular to a temperature-sensing-based time synchronization method for a wireless sensor network, which is suitable for large-scale regional monitoring wireless sensor network applications such as wild animal monitoring and earthen site monitoring.

背景技术Background technique

作为无线传感器网络的一项重要支撑技术,时间同步得到了广泛的应用,如数据融合技术、休眠调度技术、基于TOA的定位技术以及目标追踪等都需要全网节点保持时间同步。在大规模的传感器网络中,网络节点众多,且节点的能量,处理能力,带宽等相对有限,网络环境相对恶劣,因此,这就要求传感器网络时间同步算法具有低通信开销、低计算复杂度、良好的扩展性和鲁棒性等特点。As an important supporting technology of wireless sensor networks, time synchronization has been widely used, such as data fusion technology, sleep scheduling technology, TOA-based positioning technology and target tracking, all of which require the nodes of the entire network to maintain time synchronization. In a large-scale sensor network, there are many network nodes, and the energy, processing power, and bandwidth of the nodes are relatively limited, and the network environment is relatively harsh. Therefore, this requires the sensor network time synchronization algorithm to have low communication overhead, low computational complexity, Good scalability and robustness.

在进行大规模监测(如野生动物,土遗址等)过程中,来自不同传感器的不同数据(文字数据,声音数据,视频数据等)需要被组合起来,并通过一系列的统计以及分析,最终得到有效的环境信息并且推测出有可能发生的事件。在对多种数据进行融合的过程中,需要采集数据的各个节点的时间同步,否则会得到错误的时间信息,最终导致错误的分析结果。除此之外,由于传感器网络能量受限的特点,节点需要进行周期性的休眠来降低能耗。这就需要全网的节点按照一个特定的规律来调节自己的休眠周期,从而保证数据的正确传输。然而,节点间时间的不同步将会导致节点在错误的时间进行休眠,从而影响数据传输成功率。现有技术中,为了保证全网节点之间的时间同步,在无线传感器网络中已经有许多时间同步策略:In the process of large-scale monitoring (such as wild animals, earthen sites, etc.), different data (text data, sound data, video data, etc.) from different sensors need to be combined, and through a series of statistics and analysis, the final result is Available environmental information and speculated about possible events. In the process of merging multiple data, it is necessary to synchronize the time of each node collecting data, otherwise wrong time information will be obtained, which will eventually lead to wrong analysis results. In addition, due to the energy-constrained nature of sensor networks, nodes need to be periodically dormant to reduce energy consumption. This requires the nodes of the entire network to adjust their sleep cycle according to a specific rule, so as to ensure the correct transmission of data. However, the out-of-sync time between nodes will cause the nodes to go to sleep at the wrong time, thereby affecting the success rate of data transmission. In the prior art, in order to ensure the time synchronization between the nodes of the whole network, there are already many time synchronization strategies in the wireless sensor network:

第一类:基于数据包交换的时间同步方法The first category: time synchronization methods based on packet switching

该方法首先通过节点间时间戳的交换来进行一对节点间的时间同步,再通过网络分层的方法进行逐层同步,最终达到全网的时间同步。该方法存在三方面缺陷:1)由于该方法是利用频繁的时间戳交换来进行时间同步的,因此会引入大量的通信开销。在无线传感器网络中,通信开销在总开销中所占比例远高于计算开销和数据采集带来的开销,因此该方法会造成节点能量的大量流失。2)由于时间戳在网络中是逐层传输的,因此会造成误差累积,从而影响时间同步精度。3)由于传感器网络中使用的是廉价晶振,该晶振易受到温度、电压、震动等工作环境的影响,而该方法并没有考虑到这一点。This method first performs time synchronization between a pair of nodes by exchanging time stamps between nodes, and then performs layer-by-layer synchronization through the method of network layering, and finally achieves time synchronization of the entire network. There are three disadvantages in this method: 1) Since this method utilizes frequent timestamp exchange for time synchronization, it will introduce a large amount of communication overhead. In a wireless sensor network, the proportion of communication overhead in the total overhead is much higher than the overhead caused by computing overhead and data collection, so this method will cause a large loss of node energy. 2) Since the time stamp is transmitted layer by layer in the network, it will cause error accumulation, thereby affecting the time synchronization accuracy. 3) Since the sensor network uses a cheap crystal oscillator, the crystal oscillator is easily affected by the working environment such as temperature, voltage, vibration, etc., but this method does not take this into consideration.

第二类:基于外部周期性信号的时间同步方法The second category: time synchronization methods based on external periodic signals

在这种方法中,全网所有节点都根据一个统一的周期性信号来调整自己的时钟频率。这种周期性信号包括:wifi信号,广播信号,日光的发出的光信号等等。该方法在同步过程中主要依赖于本地信息,很大程度上减少了时间戳的交换,降低了能耗,减少了误差累积。该方法存在的缺陷有:1)对环境有一定的限制,该类方法不适用与各种信号无法到达的野外环境。而且根据日光灯进行同步的方法要求传感器网络必须工作在室内环境。2)WIFI信号和广播信号需要额外的硬件设备进行接收,这种设备不仅提高了经济开销,而且需要高能耗支撑,不适用于大规模部署。3)这种方法同样没有考虑到工作环境对廉价晶振的影响。In this method, all nodes in the entire network adjust their clock frequency according to a unified periodic signal. Such periodic signals include: wifi signals, broadcast signals, light signals emitted by sunlight, and so on. This method mainly relies on local information in the synchronization process, which greatly reduces the exchange of time stamps, reduces energy consumption, and reduces error accumulation. The defects of this method are as follows: 1) There are certain restrictions on the environment, and this type of method is not applicable to the field environment where various signals cannot reach. Moreover, the method of synchronizing according to fluorescent lamps requires that the sensor network must work in an indoor environment. 2) WIFI signals and broadcast signals require additional hardware equipment to receive, which not only increases the economic cost, but also requires high energy consumption support, which is not suitable for large-scale deployment. 3) This method also does not take into account the impact of the working environment on cheap crystal oscillators.

发明内容Contents of the invention

工作在大规模野外环境下的传感器网络时间同步方法与通常环境下的方法有着显著的不同,针对现有同步方法不能适用于大规模网络的现状,本发明提出一种基于温度感知的无线传感器网络时间同步方法,使得同步过程在野外大规模环境下依然能够达到高精度以及低能耗的要求。The sensor network time synchronization method working in a large-scale field environment is significantly different from the method in a normal environment. Aiming at the current situation that the existing synchronization method cannot be applied to a large-scale network, this invention proposes a wireless sensor network based on temperature perception The time synchronization method enables the synchronization process to meet the requirements of high precision and low energy consumption in large-scale environments in the field.

为了实现上述任务,本发明采用的技术方案是:In order to realize above-mentioned task, the technical scheme that the present invention adopts is:

一种基于温度感知的无线传感器网络时间同步方法,包括以下步骤:A method for synchronizing time in a wireless sensor network based on temperature perception, comprising the following steps:

记R为无线传感器网络中的参考节点,N为除参考节点之外的任意一个传感器节点,网络初始化后,节点N重复执行以下周期,该周期包括步骤一至步骤三:Note that R is the reference node in the wireless sensor network, and N is any sensor node except the reference node. After the network is initialized, the node N repeatedly executes the following cycle, which includes steps 1 to 3:

步骤一,敏感度因子确定Step 1, determine the sensitivity factor

步骤S10,节点N向参考节点R发送时间同步请求数据包;Step S10, the node N sends a time synchronization request packet to the reference node R;

步骤S11,节点R在收到时间同步请求数据包后,向节点N依次返回四个应答数据包:M0,M1,M2,M3,每个数据包中记录发送该数据包时时刻节点R的本地时间,分别为time(R)0~time(R)3;M0与M1、M2与M3间隔时间均为1s;M1与M2间隔时间为10min;Step S11, after receiving the time synchronization request data packet, node R returns four response data packets to node N in turn: M 0 , M 1 , M 2 , M 3 , each data packet records the time when the data packet is sent The local time of node R is time(R) 0 ~time(R) 3 respectively; the interval between M 0 and M 1 , M 2 and M 3 is 1s; the interval between M 1 and M 2 is 10min;

步骤S12,节点N在接收到数据包M0~M3的同时,记录自己的本地时间time0~time3以及节点N当前所处的环境温度temp0~temp3Step S12, while receiving the data packets M 0 -M 3 , the node N records its own local time time 0 -time 3 and the current ambient temperature temp 0 -temp 3 of the node N;

步骤S13,节点N对其在time1以及time3的频偏skew1以及skew3进行计算:Step S13, node N calculates its frequency offset skew 1 and skew 3 at time 1 and time 3 :

步骤S14,节点N根据频偏及温度信息对当前敏感度因子TSF值进行计算:Step S14, the node N calculates the current sensitivity factor TSF value according to the frequency offset and temperature information:

公式2中,Temp为标准温度,取值为25℃;In formula 2, Temp is the standard temperature, the value is 25°C;

步骤二,敏感度因子间隔确定Step 2, determine the interval of sensitivity factor

步骤S20,节点N获取此刻所处环境温度T1,节点N上一周期该时刻所处环境温度为Tpre,则节点N的温度变化率DT为:Step S20, the node N obtains the ambient temperature T 1 at the moment, and the ambient temperature of the node N at this moment in the last cycle is T pre , then the temperature change rate DT of the node N is:

公式3中,dpre为上一周期步骤S22获得的敏感度因子间隔d的值;In formula 3, d pre is the value of the sensitivity factor interval d obtained in step S22 of the previous cycle;

步骤S21,节点N计算当前累积误差值error:Step S21, node N calculates the current cumulative error value error:

步骤S22,节点N对敏感度因子间隔d进行设定,方法为:Step S22, the node N sets the sensitivity factor interval d, the method is:

公式5中,μ=150~900μs,λ=0.6~1.4℃,dstd=20min;In formula 5, μ=150~900μs, λ=0.6~1.4℃, d std =20min;

步骤S23,节点N设置当前频偏值skew为skew3,Δt时长后转入步骤S31,100s<Δt<10000s;In step S23, the node N sets the current frequency offset value skew to skew 3 , and after Δt, go to step S31, 100s<Δt<10000s;

步骤三,本地时间更新Step 3, local time update

步骤S30,节点N获取其此刻所处环境温度T2,根据步骤S14计算的敏感度因子TSF对节点当前频偏进行计算:In step S30, the node N obtains the ambient temperature T 2 where it is located at the moment, and calculates the current frequency offset of the node according to the sensitivity factor TSF calculated in step S14:

skew=TSF·(T-Temp)2 (公式6)skew=TSF·(T-Temp) 2 (Formula 6)

上式中,T表示时间;In the above formula, T represents time;

步骤S31,节点N计算当前的相偏:Step S31, node N calculates the current phase offset:

公式7中,skewpre为上一周期步骤S23或步骤S30获得的当前频偏值,offsetpre为上一周期步骤S31计算出的当前相偏值;In Formula 7, skew pre is the current frequency offset value obtained in step S23 or step S30 in the previous cycle, and offset pre is the current phase offset value calculated in step S31 in the previous cycle;

步骤S32,若节点N的当前相偏满足:Step S32, if the current phase offset of node N satisfies:

则节点N对自身本地时间进行更新,更新后的本地时间clock为:Then node N updates its own local time, and the updated local time clock is:

clock=clockpre+offset (公式9)clock=clock pre +offset (Formula 9)

在公式8和公式9中,ε为本地时钟周期,clockpre为更新前的本地时间;更新完毕后,节点N将offsetpre清零;In Equation 8 and Equation 9, ε is the local clock cycle, and clock pre is the local time before the update; after the update is completed, node N clears offset pre to zero;

步骤S33,节点N查看计时器,若时长d未到时,则休眠Δt时长后转至步骤S30;否则,完成本周期,转入步骤S10开始执行下一周期。Step S33, the node N checks the timer, if the duration d has not expired, go to step S30 after sleeping for Δt time; otherwise, complete this cycle, go to step S10 to start the next cycle.

本发明与现有技术相比有以下的技术优点:Compared with the prior art, the present invention has the following technical advantages:

1.降低了能耗;1. Reduced energy consumption;

首先,由于节点在进行同步的过程中主要依赖于本地信息进行时钟频偏的估计以及本地时钟的更新,很大程度上减少了通信开销。First of all, since the nodes mainly rely on local information to estimate the clock frequency offset and update the local clock during the synchronization process, the communication overhead is greatly reduced.

其次,由于节点是根据其环境温度信息来进行时间同步的,而温度的获取不需要借助额外的硬件设备,仅需要温度传感器,因此,减少了信号接收能耗。Secondly, because the nodes are time-synchronized according to their ambient temperature information, and the acquisition of temperature does not require additional hardware devices, only temperature sensors are needed, thus reducing the energy consumption of signal reception.

2.提高了同步精度;2. Improved synchronization accuracy;

首先,节点在进行同步的过程中考虑到了工作环境(温度)对节点晶振的影响,并对此影响进行了补偿,因此能够避免由于温度造成的频偏变化,从而降低了时钟相偏的累积。First of all, the node takes into account the influence of the working environment (temperature) on the crystal oscillator of the node during the synchronization process, and compensates for this influence, so that the frequency offset change caused by temperature can be avoided, thereby reducing the accumulation of clock phase offset.

其次,由于该时间同步方法基本不需要时间戳的逐层传递,因此降低了同步误差的累积。Secondly, since the time synchronization method basically does not require layer-by-layer transmission of time stamps, the accumulation of synchronization errors is reduced.

3.提高了鲁棒性3. Improved robustness

同样,由于节点在进行时间同步的过程中主要依赖本地信息,而不是时间戳的交换,因此,该方法对通信条件的要求较低。当节点的通信设备出现异常无法工作,或是在网络节点位置动态变化,无法与参考节点保持通信的情况下,节点能够根据本地的电压信息进行时间同步,因此提高了鲁棒性。Also, since nodes mainly rely on local information in the process of time synchronization, rather than the exchange of time stamps, this method has lower requirements on communication conditions. When the communication equipment of the node is abnormal and cannot work, or the position of the network node changes dynamically and cannot maintain communication with the reference node, the node can perform time synchronization according to the local voltage information, thus improving the robustness.

附图说明Description of drawings

图1是本发明方法的流程图;Fig. 1 is a flow chart of the inventive method;

图2是“温度-频偏”关系示意图;Figure 2 is a schematic diagram of the "temperature-frequency offset" relationship;

图3是频偏相偏估计过程以及温度敏感度因子TSF估计过程周期关系示意图;Fig. 3 is a schematic diagram of the frequency offset phase offset estimation process and the temperature sensitivity factor TSF estimation process cycle relationship diagram;

图4是仿真实验模拟温度变化示意图;Fig. 4 is a schematic diagram of simulated temperature variation in the simulation experiment;

图5是精度控制参数μ对再λ同步间隔和时间戳交换次数的影响以及μ的最优值确定实验结果图;Fig. 5 is the influence of the precision control parameter μ on the re-λ synchronization interval and the number of time stamp exchanges and the experimental results of determining the optimal value of μ;

图6是温度调节因子λ对TSF估计间隔和时间戳交换次数的影响以及λ的最优值确定实验结果图;Fig. 6 is the influence of the temperature adjustment factor λ on the TSF estimation interval and the number of time stamp exchanges and the experimental results of determining the optimal value of λ;

图7是动态周期TSFB算法、固定周期TSFB算法以及EACS算法频偏估计精度对比实验结果图;Fig. 7 is a comparison experiment result diagram of frequency offset estimation accuracy of dynamic period TSFB algorithm, fixed period TSFB algorithm and EACS algorithm;

图8(a)是不同精度控制参数μ取值下TSFB算法与FTSP算法能耗对比实验结果图;Fig. 8(a) is a comparison experiment result of energy consumption between TSFB algorithm and FTSP algorithm under different precision control parameter μ values;

图8(b)是不同温度调节因子λ取值下TSFB算法与FTSP算法能耗对比实验结果图;Figure 8(b) is a diagram of the energy consumption comparison experiment results of the TSFB algorithm and the FTSP algorithm under different values of the temperature adjustment factor λ;

图9是TSFB算法与FTSP算法鲁棒性对比实验结果图;Figure 9 is a diagram of the experimental results of the robustness comparison between the TSFB algorithm and the FTSP algorithm;

具体实施方式detailed description

申请人在野生动物监测、土遗址监测等大规模监测中,为了保证休眠调度过程的顺利进行,以及保证数据融合阶段数据处理结果的正确性,需要建立高精度且低能耗的时间同步策略。而大规模野外环境与普通网络环境相比存在两个问题:1)网络规模大,导致节点通信能耗以及时间同步累积误差迅速增大;2)环境动态变化,导致节点之间的通信情况不稳定,不能保持持续的正常通信。In order to ensure the smooth progress of the dormant scheduling process and the correctness of the data processing results in the data fusion stage in large-scale monitoring such as wildlife monitoring and earthen site monitoring, the applicant needs to establish a time synchronization strategy with high precision and low energy consumption. However, there are two problems in the large-scale field environment compared with the ordinary network environment: 1) the large network scale leads to a rapid increase in the energy consumption of node communication and the cumulative error of time synchronization; 2) the dynamic change of the environment leads to unstable communication between nodes. Stable, unable to maintain continuous normal communication.

针对现有时间同步方法不适用于大规模野外环境的现状,本发明提出一种基于温度感知的传感器网络的时间同步方法,利用节点时钟频偏与温度的高度相关性(如图2所示)进行时间同步,使得时间同步算法在这种特殊的网络条件下仍然能够做到高精度、低能耗以及高鲁棒性。Aiming at the fact that the existing time synchronization methods are not suitable for large-scale field environments, the present invention proposes a time synchronization method based on temperature-aware sensor networks, which utilizes the high correlation between node clock frequency deviation and temperature (as shown in Figure 2) Time synchronization is performed so that the time synchronization algorithm can still achieve high precision, low energy consumption and high robustness under such special network conditions.

本发明需要在传感器节点进行时间同步的过程中周期性的对其敏感度因子TSF进行估计以及更新。这里的敏感度因子TSF表示节点对其所处环境温度变化的敏感程度。在每两次TSF估计的间隔时段,节点根据其所处环境温度值以及当前TSF估计值进行频偏的估计及补偿。这里的频偏指的每一个节点相对于同一个参考节点的频偏。同时,节点根据估计误差的累积以及温度变化情况,可对节点执行TSF估计间隔的调节,以此达到能量消耗与估计精度的平衡。The present invention needs to periodically estimate and update the sensitivity factor TSF of the sensor nodes during the time synchronization process. The sensitivity factor TSF here indicates the sensitivity of the node to the temperature change of its environment. During the interval between two TSF estimates, the node estimates and compensates the frequency offset according to its ambient temperature and the current TSF estimate. The frequency offset here refers to the frequency offset of each node relative to the same reference node. At the same time, the node can adjust the TSF estimation interval for the node according to the accumulation of estimation errors and temperature changes, so as to achieve a balance between energy consumption and estimation accuracy.

一、本发明方法详细步骤One, the detailed steps of the inventive method

本发明提出一种基于温度感知的无线传感器网络的时间同步方法,该方法在同步过程中根据本地温度值以及敏感度因子TSF不断修正节点的时钟频偏,以及对时钟相偏进行补偿,同时,根据误差的累积状况以及温度变化状况周期性的进行敏感度因子TSF估计及更新。如图1所示,该方法包括以下步骤:The present invention proposes a time synchronization method for a wireless sensor network based on temperature perception. During the synchronization process, the method continuously corrects the clock frequency offset of the node according to the local temperature value and the sensitivity factor TSF, and compensates the clock phase offset. At the same time, The sensitivity factor TSF is estimated and updated periodically according to the accumulation of errors and the temperature change. As shown in Figure 1, the method includes the following steps:

一种基于温度感知的无线传感器网络时间同步方法,该方利用无线传感器的温度与频偏之间的关系进行时间同步,包括以下步骤:A method for time synchronization of a wireless sensor network based on temperature perception, which utilizes the relationship between the temperature of the wireless sensor and the frequency offset to perform time synchronization, comprising the following steps:

记R为无线传感器网络中的参考节点,N为除参考节点之外的任意一个传感器节点,网络初始化后,节点N重复执行以下周期,即所有节点均不断重复按照周期执行;时间同步过程是伴随着整个网络的运行而进行的,只要网络生命周期没有结束,时间同步过程就会不停的周期性的进行下去;周期循环过程如图3所示,该周期包括步骤一至步骤三:Note that R is the reference node in the wireless sensor network, and N is any sensor node except the reference node. After the network is initialized, the node N repeats the following cycle, that is, all nodes are repeatedly executed according to the cycle; the time synchronization process is accompanied by As long as the network life cycle is not over, the time synchronization process will continue periodically; the cycle process is shown in Figure 3, and this cycle includes steps 1 to 3:

步骤一,敏感度因子确定Step 1, determine the sensitivity factor

为了使节点在同步过程中能够及时地根据当前温度对时间频偏进行补偿,在在无线传感器网络节点进行时间同步的过程中需要周期性的对其敏感度因子TSF进行估计以及更新。TSF的估计主要依赖于在估计过程中节点温度的变化量以及相应的频偏变化量。节点为了获取其频偏信息,需要通过与参考节点R进行时间戳交换;这里的参考节点为一个标准节点,在部署前确定,可以为一个普通节点,也可以为一个基站;全网节点以参考节点的时间为标注进行时间同步:这里以传感器网络中除了标准节点之外的任意一个节点N为例:In order to enable the nodes to compensate the time frequency offset according to the current temperature in time during the synchronization process, the sensitivity factor TSF needs to be estimated and updated periodically during the time synchronization process of the wireless sensor network nodes. The estimation of TSF mainly depends on the variation of node temperature and the corresponding variation of frequency offset during the estimation process. In order to obtain its frequency offset information, a node needs to exchange time stamps with the reference node R; the reference node here is a standard node, which is determined before deployment, and can be an ordinary node or a base station; the nodes of the entire network refer to The time of the node is time-synchronized for the label: Here, take any node N in the sensor network except the standard node as an example:

步骤S10,节点N向参考节点R发送时间同步请求数据包,告知参考节点需要进行同步过程;Step S10, the node N sends a time synchronization request packet to the reference node R, informing the reference node that a synchronization process is required;

步骤S11,节点R在收到时间同步请求数据包后,向节点N依次返回四个应答数据包:M0,M1,M2,M3,每个数据包中记录发送该数据包时时刻节点R的本地时间,分别为time(R)0~time(R)3;(例如,M0中包含节点R发送M0的时间:time(R)0)M0与M1、M2与M3间隔时间均为1s;M1与M2间隔时间为10min;Step S11, after receiving the time synchronization request data packet, node R returns four response data packets to node N in turn: M 0 , M 1 , M 2 , M 3 , each data packet records the time when the data packet is sent The local time of node R is time(R) 0 ~time(R) 3 respectively; (for example, M 0 contains the time when node R sends M 0 : time(R) 0 ) M 0 and M 1 , M 2 and The interval between M 3 is 1s; the interval between M 1 and M 2 is 10min;

步骤S12,为获得节点自身时间与参考节点R之间的时间差,节点N在接收到数据包M0~M3的同时,记录自己的本地时间time0~time3以及节点N当前所处的环境温度temp0~temp3(即一个数据包对应一个时间值和一个温度值,如接收到数据包M0时,记录此时的本地时间time0和环境温度temp0);这里的温度信息由温度传感器获得,主要用于敏感度因子估计周期内温度变化量的测量;Step S12, in order to obtain the time difference between the node's own time and the reference node R, the node N records its own local time time 0 to time 3 and the current environment of the node N when it receives the data packets M 0 to M 3 Temperature temp 0 ~ temp 3 (that is, a data packet corresponds to a time value and a temperature value, such as when receiving a data packet M 0 , record the local time time 0 and the ambient temperature temp 0 at this time); the temperature information here is determined by the temperature Obtained by the sensor, mainly used for the measurement of the temperature variation within the sensitivity factor estimation cycle;

步骤S13,节点N根据数据包M0~M3中的信息以及自己的本地时间信息time0~time3对其在time1以及time3的频偏skew1以及skew3进行计算,计算方法为:Step S13, node N calculates its frequency offset skew 1 and skew 3 at time 1 and time 3 according to the information in the data packets M 0 to M 3 and its own local time information time 0 to time 3 , the calculation method is as follows:

步骤S14,节点N根据频偏及温度信息对其当前敏感度因子TSF值进行计算,计算公式为:Step S14, the node N calculates its current sensitivity factor TSF value according to the frequency offset and temperature information, and the calculation formula is:

公式2中,由于temp0和temp1,temp2和temp3的采集时间较为接近(间隔1s),因此用这段时间内的平均温度Tempa和Tempb进行敏感度因子TSF的估计,即In formula 2, since the acquisition time of temp 0 and temp 1 , temp 2 and temp 3 are relatively close (interval 1s), the sensitivity factor TSF is estimated by using the average temperature Temp a and Temp b during this period, namely

Temp为标准温度,取值为25℃;Temp is the standard temperature, the value is 25°C;

步骤二,敏感度因子间隔确定Step 2, determine the interval of sensitivity factor

由于节点频偏的变化情况会随着温度的变化速率而不同,在温度变化较明显的时候,节点的频偏变化也会较为明显,此时为了保证同步的精度,需要缩短敏感度因子TSF的估计周期,从而能够保证较高的同步精度。而在温度较为平稳的时候,节点的频偏几乎不变,此时为了降低通信开销,需要延长敏感度因子TSF的估计周期。因此,敏感度因子间隔的确定需要依赖于温度的变化速率以及误差的累积情况:Since the change of frequency offset of nodes will be different with the change rate of temperature, when the temperature changes significantly, the change of frequency offset of nodes will also be more obvious. At this time, in order to ensure the accuracy of synchronization, it is necessary to shorten the sensitivity factor TSF The period is estimated, so that a high synchronization accuracy can be guaranteed. When the temperature is relatively stable, the frequency offset of the node is almost unchanged. At this time, in order to reduce the communication overhead, it is necessary to extend the estimation period of the sensitivity factor TSF. Therefore, the determination of the sensitivity factor interval needs to depend on the rate of change of temperature and the accumulation of errors:

步骤S20,计算温度变化率DT:节点N获得其当前所处环境温度T1,节点N上一周期该时刻所处环境温度为Tpre,则节点N的温度变化率DT为:Step S20, calculating the temperature change rate DT: the node N obtains its current ambient temperature T 1 , and the ambient temperature of the node N at this moment in the last cycle is T pre , then the temperature change rate DT of the node N is:

公式3中,dpre为上一周期步骤S22获得的敏感度因子间隔d的值;注:由于本方案在网络初始化后是不断循环重复执行的,而一个周期的参数计算要依赖于上一个周期的参数值,如公式3中计算温度变化率DT时,就需要上一个周期的环境温度和敏感度因子间隔。即,如本周期当前所处环境温度为T1,则T1就作为下一个周期计算DT参数时的Tpre,本周期的敏感度因子间隔d作为下一个周期的dpre,其他参数以此类推;而网络初始化后第一次计算参数,需要上一个周期的参数值时,随机设置一个上周期参数值,用于当前参数计算,而在以后的周期可不断对前面周期的参数进行修正。In Equation 3, d pre is the value of the sensitivity factor interval d obtained in step S22 of the previous cycle; Note: Since this solution is repeatedly executed after network initialization, the parameter calculation of one cycle depends on the previous cycle When calculating the temperature change rate DT in formula 3, the ambient temperature and the sensitivity factor interval of the previous cycle are required. That is, if the current ambient temperature in this cycle is T 1 , then T 1 will be used as T pre when calculating DT parameters in the next cycle, the sensitivity factor interval d of this cycle will be used as d pre in the next cycle, and other parameters will be based on By analogy; when the parameters are calculated for the first time after the network is initialized and the parameter values of the previous cycle are needed, a parameter value of the previous cycle is randomly set for the current parameter calculation, and the parameters of the previous cycle can be continuously corrected in subsequent cycles.

步骤S21,节点N计算当前累积误差值error:Step S21, node N calculates the current cumulative error value error:

在公式4中,节点N根据最后两次与参考节点的时间戳交换结果time3与time(R)3之差以及time2与time(R)2之差的均值对当前误差进行估计;In Formula 4, node N estimates the current error based on the mean value of the difference between time 3 and time(R) 3 and the difference between time 2 and time(R) 2 between the last two timestamp exchange results with the reference node;

步骤S22,节点N根据步骤S21以及步骤S20的结果对敏感度因子间隔d进行设定,并从此刻开始计时,d的计算公式如下:Step S22, node N sets the sensitivity factor interval d according to the results of step S21 and step S20, and starts timing from this moment. The calculation formula of d is as follows:

公式5中,μ和λ分别为误差控制因子以及温度调节因子,取值为:μ=150~900μs,λ=0.6~1.4℃;根据实验一、实验二的结果,当μ=300us,λ=1℃时,本方法性能最优;dstd为标准间隔,通常取dstd=20min;In Formula 5, μ and λ are the error control factor and temperature adjustment factor respectively, and the values are: μ=150~900μs, λ=0.6~1.4℃; according to the results of Experiment 1 and Experiment 2, when μ=300us, λ= At 1°C, this method has the best performance; d std is the standard interval, usually d std = 20min;

从公式5可以看出,当节点周围环境温度变化量增大或节点同步误差升高时,TSF估计间隔会相应的缩短来保证同步精度,反之,间隔会增大来降低通信开销;It can be seen from Equation 5 that when the ambient temperature changes around the node or the synchronization error of the node increases, the TSF estimation interval will be shortened accordingly to ensure the synchronization accuracy; otherwise, the interval will be increased to reduce the communication overhead;

步骤23,为方便之后的相偏估计过程,节点N设置当前频偏值skew为skew3,Δt时长后转入步骤S31,这里Δt为时间估计间隔;Δt满足100s<Δt<10000s,即网络设置时,只要在此范围内选择一个Δt均满足本方案要求;Step 23, for the convenience of the subsequent phase offset estimation process, the node N sets the current frequency offset value skew to skew 3 , and then transfers to step S31 after the duration of Δt, where Δt is the time estimation interval; Δt satisfies 100s<Δt<10000s, that is, the network setting , as long as a Δt is selected within this range, the requirements of this scheme are met;

步骤三,本地时间更新Step 3, local time update

节点N在对其温度敏感因子TSF以及敏感度因子间隔d进行更新之后,转入本地时间更新过程,该过程中的时钟频偏估计主要依赖于步骤一中获得的温度敏感度因子TSF以及节点当前环境温度,时间更新过程的时长为d。After the node N updates its temperature sensitivity factor TSF and the sensitivity factor interval d, it turns to the local time update process. The clock frequency offset estimation in this process mainly depends on the temperature sensitivity factor TSF obtained in step 1 and the node's current time. Ambient temperature, the duration of the time update process is d.

步骤S30,为了对时钟频偏skew(由于时刻不同,该步骤的skew与步骤S23的skew不是同一个值,而是处于不同情况下的两个值)进行估计,节点N首先获取其此刻环境温度T2,其次根据本周期步骤S14计算的敏感度因子TSF对节点当前频偏进行估计:Step S30, in order to estimate the clock frequency offset skew (due to the different time, the skew in this step and the skew in step S23 are not the same value, but two values in different situations), node N first obtains its ambient temperature at the moment T 2 , and then estimate the current frequency offset of the node according to the sensitivity factor TSF calculated in step S14 of this cycle:

skew=TSF·(T-Temp)2 (公式6)skew=TSF·(T-Temp) 2 (Formula 6)

上式中,T表示时间;In the above formula, T represents time;

步骤S31,节点N计算当前的相偏:Step S31, node N calculates the current phase offset:

公式7中,skewpre为上一周期步骤S23或步骤S30获得的当前频偏值,即如果从步骤S23跳至步骤S31,则skewpre的值为上一周期步骤S23中的频偏值skew;如果从步骤S30执行至步骤S31,则skewpre的值为上一周期步骤S30中的频偏值skew;offsetpre为上一周期步骤S31计算出的当前相偏值;In formula 7, skew pre is the current frequency offset value obtained in step S23 or step S30 of the previous cycle, that is, if jumping from step S23 to step S31, the value of skew pre is the frequency offset value skew in step S23 of the previous cycle; If it is executed from step S30 to step S31, the value of skew pre is the frequency offset value skew in step S30 of the previous cycle; offset pre is the current phase offset value calculated in step S31 of the previous cycle;

步骤S32,若节点N的当前相偏offset满足公式8,则认为节点N的相偏过大且会对网络应用造成影响,此时,节点N需要对自己本地时间进行更新,否则不进行更新:Step S32, if the current phase offset of node N satisfies Formula 8, it is considered that the phase offset of node N is too large and will affect network applications. At this time, node N needs to update its own local time, otherwise no update:

公式8中ε为本地时钟周期,对同步精度要求不严格的情况下也可以适当增大ε的值;更新后的本地时间clock为:In Equation 8, ε is the local clock period, and the value of ε can be appropriately increased when the synchronization accuracy is not strictly required; the updated local time clock is:

clock=clockpre+offset (公式9)clock=clock pre +offset (Formula 9)

公式9中,clockpre为更新前的本地时间;更新完毕后,节点N将offsetpre清零;频偏与相偏周期关系如图3所示;In Formula 9, clock pre is the local time before the update; after the update is completed, node N clears offset pre to zero; the relationship between frequency offset and phase offset cycle is shown in Figure 3;

步骤S33,节点N查看计时器,若从步骤S22计时开始,时长d未到时,则休眠Δt时长后转至步骤S30;否则,完成本周期,转入步骤S10开始执行下一周期。In step S33, node N checks the timer. If the time period d has not expired since the timing of step S22, then go to step S30 after sleeping for Δt time; otherwise, complete this cycle and go to step S10 to start the next cycle.

二、本发明方法中各相关参数的确定:Two, the determination of each relevant parameter in the inventive method:

实验一:误差控制因子μ对数据包交换间隔和数据包交换次数的影响以及μ的最优值确定:Experiment 1: The influence of the error control factor μ on the packet exchange interval and the number of data packet exchanges and the determination of the optimal value of μ:

步骤一:仿真实验场景初始化Step 1: Initialize the simulation experiment scene

申请人根据真实野外场景下的温度变化情况模拟出了12000条温度数据,代表了200分钟内每一秒的温度值,根据该数据得到的温度压变化曲线如图4所示。为了证明本方法在温度变化情况下的同步性能,该轨迹主要在两种温度状况之间交替:温度平缓以及温度爬升状态。温度变化范围为25℃~43℃,根据温度与频偏的关系,其相应的12000条频偏数据的变化范围为20ppm~60ppm。The applicant simulated 12,000 pieces of temperature data based on the temperature change in the real field scene, representing the temperature value of each second within 200 minutes. The temperature and pressure change curve obtained according to the data is shown in Figure 4. To demonstrate the synchronous performance of the method under varying temperature conditions, the trajectory mainly alternates between two temperature regimes: a temperature flat and a temperature ramp regime. The temperature range is 25°C to 43°C, and according to the relationship between temperature and frequency offset, the corresponding 12,000 pieces of frequency offset data vary from 20ppm to 60ppm.

步骤二:取精度控制参数μ=150,300,450,750,900(单位:μs)。在每种控制参数μ的取值下,根据之前所述的时间同步步骤对该12000条频偏数据进行同步,总共进行五次实验。每次实验记录在同步过程中时间戳的交换次数,以及每两次时间戳交换的间隔时间,观察μ对这两项参数的影响。Step 2: Take the precision control parameter μ=150, 300, 450, 750, 900 (unit: μs). Under each value of the control parameter μ, the 12,000 pieces of frequency offset data are synchronized according to the time synchronization steps described above, and a total of five experiments are performed. Each experiment records the number of time stamp exchanges during the synchronization process, and the interval time between two time stamp exchanges, and observes the influence of μ on these two parameters.

步骤三:分析与处理实验数据Step 3: Analyze and process experimental data

图5示出了温度敏感度因子TSF估计间隔和时间戳交换次数随着精度控制参数μ的变化趋势。可以看出,当参数μ从150μs变化到300μs时,时间戳的交换次数明显减少,同时,平均TSF估计间隔明显增大。而在参数μ变化到300μs之后,这两项参数的变化趋于平缓。因此为了在减小能耗的同时保证时间同步的精度,本方法在精度控制参数μ=300μs时的性能最佳。Figure 5 shows the variation trend of the temperature sensitivity factor TSF estimation interval and the number of time stamp exchanges with the precision control parameter μ. It can be seen that when the parameter μ is changed from 150 μs to 300 μs, the number of timestamp exchanges is significantly reduced, and at the same time, the average TSF estimation interval is significantly increased. However, after the parameter μ changes to 300μs, the changes of these two parameters tend to be gentle. Therefore, in order to ensure the accuracy of time synchronization while reducing energy consumption, this method has the best performance when the accuracy control parameter μ=300 μs.

实验二:温度协调因子λ对数据包交换间隔和数据包交换次数的影响以及λ的最优值确定:Experiment 2: The influence of the temperature coordination factor λ on the packet exchange interval and the number of data packet exchanges and the determination of the optimal value of λ:

步骤一:仿真实验场景初始化Step 1: Initialize the simulation experiment scene

申请人根据真实野外场景下的温度变化情况模拟出了12000条温度数据,代表了200分钟内每一秒的温度值。根据该数据得到的温度压变化曲线如图4所示。为了证明本方法在温度变化情况下的同步性能,该轨迹主要在两种温度状况之间交替:温度平缓以及温度爬升状态。温度变化范围为25℃~43℃,根据温度与频偏的关系,其相应的12000条频偏数据的变化范围为20ppm~60ppm。The applicant simulated 12,000 pieces of temperature data according to the temperature changes in the real field scene, representing the temperature value of each second within 200 minutes. The temperature and pressure variation curve obtained according to the data is shown in Fig. 4 . To demonstrate the synchronous performance of the method in the case of temperature changes, the trajectory mainly alternates between two temperature regimes: a temperature flat and a temperature ramp regime. The temperature range is 25°C to 43°C, and according to the relationship between temperature and frequency offset, the corresponding 12,000 pieces of frequency offset data vary from 20ppm to 60ppm.

步骤二:取温度协调因子λ=0.6,0.8,1.0,1.2,1.4(单位:℃)。在每种协调因子λ的取值下,根据之前所述的时间同步步骤对该12000条频偏数据进行同步,总共进行五次实验。每次实验记录在同步过程中时间戳的交换次数,以及每两次时间戳交换的间隔时间,观察λ对这两项参数的影响;Step 2: Take temperature coordination factors λ=0.6, 0.8, 1.0, 1.2, 1.4 (unit: °C). Under each value of the coordination factor λ, the 12,000 pieces of frequency offset data are synchronized according to the time synchronization steps described above, and a total of five experiments are performed. Each experiment records the number of time stamp exchanges during the synchronization process, and the interval between each time stamp exchange, and observes the influence of λ on these two parameters;

步骤三:分析与处理实验数据Step 3: Analyze and process experimental data

图6示出了温度敏感度因子TSF估计间隔和时间戳交换次数随着精度控制参数μ的变化趋势。可以看出,当参数λ从0.8℃变化到1.0℃时,时间戳的交换次数明显减少,同时,平均TSF估计间隔明显增大;而在参数λ变化到1.0℃之后,这两项参数的变化趋于平缓。因此为了在减小能耗的同时保证时间同步的精度,本方法在精度控制参数λ=1.0℃时的性能最佳。Figure 6 shows the variation trend of the temperature sensitivity factor TSF estimation interval and the times of timestamp exchange with the precision control parameter μ. It can be seen that when the parameter λ changes from 0.8°C to 1.0°C, the number of time stamp exchanges decreases significantly, and at the same time, the average TSF estimation interval increases significantly; and after the parameter λ changes to 1.0°C, the changes in these two parameters leveled off. Therefore, in order to ensure the accuracy of time synchronization while reducing energy consumption, this method has the best performance when the accuracy control parameter λ=1.0°C.

三、本发明方法性能试验以及与其他算法的对比实验Three, the method performance test of the present invention and the comparative experiment with other algorithms

下面我们通过一组实验来验证本发明同步方法的性能以及相对于其他方法的优势,实验主要对以下四种算法的性能进行比较:Below we verify the performance of the synchronization method of the present invention and its advantages over other methods through a set of experiments. The experiments mainly compare the performance of the following four algorithms:

(1)本发明方法(记做TSFB方法);(1) the inventive method (recorded as TSFB method);

(2)本方法在使用固定周期时的情况(记做固定周期TSFB);(2) The situation when this method uses a fixed period (denoted as a fixed period TSFB);

(3)FTSP算法:该算法是基于时间戳交换的时间同步算法。该方法首先通过节点间时间戳的交换来进行一对节点间的时间同步,再通过网络分层的方法进行逐层同步,最终达到全网的时间同步。且该方法并不考虑节点的工作环境对其频偏的影响。(3) FTSP algorithm: This algorithm is a time synchronization algorithm based on timestamp exchange. This method first performs time synchronization between a pair of nodes by exchanging time stamps between nodes, and then performs layer-by-layer synchronization through the method of network layering, and finally achieves time synchronization of the entire network. And this method does not consider the influence of the working environment of the node on its frequency offset.

(4)EACS算法:该算法同样是利用温度进行时间同步的算法,但是该方法是在节点部署前获得节点频偏与温度之间的关系,并将该关系以表格的形式存储在节点内。在同步的过程中,该方法假设频偏与温度之间的关系不会随着时间以及温度的变化而变化,这不符合实际的频偏变化模式,因此会带来同步误差。(4) EACS algorithm: This algorithm also uses temperature for time synchronization, but this method is to obtain the relationship between node frequency offset and temperature before node deployment, and store the relationship in the node in the form of a table. In the process of synchronization, this method assumes that the relationship between frequency offset and temperature will not change with time and temperature, which does not conform to the actual frequency offset change mode, so it will cause synchronization errors.

实验主要从以下几方面来证明本发明的优势:The experiment mainly proves the advantages of the present invention from the following aspects:

①频偏估计精度;②能耗(即再同步间隔);③算法鲁棒性;①Frequency offset estimation accuracy; ②Energy consumption (ie, resynchronization interval); ③Algorithm robustness;

仿真网络初始化:Simulation network initialization:

申请人根据真实野外场景下的温度变化情况模拟出了12000条温度数据,代表了200分钟内每一秒的温度值。根据该数据得到的温度压变化曲线如图4所示。为了证明本方法在温度变化情况下的同步性能,该轨迹主要在两种温度状况之间交替:温度平缓以及温度爬升状态。温度变化范围为225℃~43℃,根据温度与频偏的关系,其相应的12000条频偏数据的变化范围为20ppm~60ppm。The applicant simulated 12,000 pieces of temperature data according to the temperature changes in the real field scene, representing the temperature value of each second within 200 minutes. The temperature and pressure change curve obtained according to the data is shown in Fig. 4 . To demonstrate the synchronous performance of the method under varying temperature conditions, the trajectory mainly alternates between two temperature regimes: a temperature flat and a temperature ramp regime. The temperature range is 225°C to 43°C, and according to the relationship between temperature and frequency offset, the corresponding 12,000 pieces of frequency offset data vary from 20ppm to 60ppm.

a.算法频偏估计精度评估a. Evaluation of Algorithm Frequency Offset Estimation Accuracy

仿真实验过程:Simulation experiment process:

该实验主要对比动态周期TSFB算法、固定周期TSFB算法以及EACS算法的频偏估计精度。在该实验中,首先对动态周期的TSFB算法进行仿真,为了验证不同周期下的算法性能,在试验初始时我们取标准TSF估计周期长度dstd分别为1500s,1800s,2000s,2300s以及2500s,实验结束后得到平均包交换间隔分别为:1050s,1190s,1380s,1450s以及1950s。然后,根据得到的平均包交换间隔来设置EACS算法的温度敏感度因子TSF估计间隔以及固定周期TSFB算法的TSF估计间隔,重复实验。最后,将三种方法的频偏估计结果与初始化过程中生成的真实频偏数据进行对比,统计出三种频偏估计误差的最大值以及平均值。This experiment mainly compares the frequency offset estimation accuracy of dynamic period TSFB algorithm, fixed period TSFB algorithm and EACS algorithm. In this experiment, the TSFB algorithm with a dynamic period is first simulated. In order to verify the performance of the algorithm under different periods, we take the standard TSF estimated period length d std as 1500s, 1800s, 2000s, 2300s and 2500s at the beginning of the experiment. After the end, the average packet exchange intervals are: 1050s, 1190s, 1380s, 1450s and 1950s. Then, set the temperature sensitivity factor TSF estimation interval of the EACS algorithm and the TSF estimation interval of the fixed-period TSFB algorithm according to the obtained average packet exchange interval, and repeat the experiment. Finally, the frequency offset estimation results of the three methods are compared with the real frequency offset data generated in the initialization process, and the maximum and average values of the three frequency offset estimation errors are calculated.

实验结果:Experimental results:

如图7所示,很明显的,通过固定以及动态间隔的TSFB算法与EACS算法的对比可以看出,由于TSFB算法能够动态估计温度与频偏之间的敏感程度TSF,因此能够避免由于环境带来的当前“温度-频偏”对应关系与先验知识不符所带来的频偏估计误差,从而提高了同步精度。除此之外,通过对比动态以及固定TSFB算法,可以看出,动态周期调节机制的引入使得动态周期TSFB算法能够在节点环境温度变化的情况下及时修正TSF值,相比于固定周期的TSFB算法能够一定程度上降低频偏估计误差。As shown in Figure 7, it is obvious that by comparing the TSFB algorithm with fixed and dynamic intervals with the EACS algorithm, it can be seen that since the TSFB algorithm can dynamically estimate the sensitivity between temperature and frequency offset TSF, it can avoid environmental bands. The frequency offset estimation error caused by the current "temperature-frequency offset" correspondence relationship does not match the prior knowledge, thereby improving the synchronization accuracy. In addition, by comparing the dynamic and fixed TSFB algorithms, it can be seen that the introduction of the dynamic period adjustment mechanism enables the dynamic period TSFB algorithm to correct the TSF value in time when the ambient temperature of the node changes. Compared with the fixed period TSFB algorithm The frequency offset estimation error can be reduced to a certain extent.

b.算法能耗评估b. Algorithm energy consumption evaluation

仿真实验过程:Simulation experiment process:

该实验主要对比TSFB算法以及FTSP算法的算法能耗。This experiment mainly compares the algorithm energy consumption of TSFB algorithm and FTSP algorithm.

首先取精度控制参数μ=150,300,450,750,900(单位:μs)。对于TSFB算法在每种控制参数μ的取值下,根据之前所述的时间同步步骤对该12000条频偏数据进行同步,总共进行五次实验。每次实验记录在同步过程中每两次时间戳交换的间隔时间。而对于FTSP算法,该算法的再同步周期是固定的(150s)。First take the precision control parameter μ = 150, 300, 450, 750, 900 (unit: μs). For the TSFB algorithm, under each value of the control parameter μ, the 12,000 pieces of frequency offset data are synchronized according to the time synchronization steps described above, and a total of five experiments are performed. Each experiment records the time between every two timestamp exchanges during the synchronization process. As for the FTSP algorithm, the resynchronization period of the algorithm is fixed (150s).

其次取温度协调因子λ=0.6,0.8,1.0,1.2,1.4(单位:℃)。对于TSFB算法在每种协调因子λ的取值下,根据之前所述的时间同步步骤对该12000条频偏数据进行同步,总共进行五次实验。每次实验记录在同步过程中每两次时间戳交换的间隔时间。而对于FTSP算法,该算法的再同步周期是固定的(150s)。Secondly, take the temperature coordination factor λ=0.6, 0.8, 1.0, 1.2, 1.4 (unit: ℃). For the TSFB algorithm, under each value of the coordination factor λ, the 12,000 pieces of frequency offset data are synchronized according to the time synchronization steps described above, and a total of five experiments are performed. Each experiment records the time between every two timestamp exchanges during the synchronization process. As for the FTSP algorithm, the resynchronization period of the algorithm is fixed (150s).

实验结果:Experimental results:

在图8(a)以及图8(b)中,很明显地,对于TSFB算法,每两次时间戳交换的间隔时间随着精度控制参数μ以及度协调因子λ的增大而增大。然而,即使在误差控制因子μ以及温度协调因子λ取值均非常低(μ=150μs,λ=0.6℃)的情况下,节点依然能够保持两次时间戳交换的平均间隔时间大于900s,这远远高于FTSP的150s。而时间戳的交换会带来巨大的通信开销,且通信开销在传感器网络总能耗占很大比例。因此,证明了TSFB算法能够在保证精度的前提下降低能耗。十分适用于能量有限的无线传感器网络。In Fig. 8(a) and Fig. 8(b), it is obvious that for the TSFB algorithm, the interval between two time stamp exchanges increases with the increase of the precision control parameter μ and the degree coordination factor λ. However, even when the values of the error control factor μ and the temperature coordination factor λ are very low (μ=150μs, λ=0.6℃), the nodes can still keep the average interval between two timestamp exchanges greater than 900s, which is far from Much higher than FTSP's 150s. The exchange of time stamps will bring huge communication overhead, and the communication overhead accounts for a large proportion of the total energy consumption of the sensor network. Therefore, it is proved that the TSFB algorithm can reduce energy consumption under the premise of ensuring accuracy. It is very suitable for wireless sensor networks with limited energy.

c.算法鲁棒性评估c. Algorithm robustness evaluation

仿真实验过程:Simulation experiment process:

该实验过程模拟了在野外恶劣环境下造成节点信息传递无法进行的情况。对于TSFB算法,仍然根据之前所述的同步步骤对12000条频偏数据进行同步,但是从第1000s开始,不进行之前所述的步骤一,即TSF估计过程(由于该过程依赖于时间戳交换)。FTSP算法同样不能进行时间戳的交换。The experimental process simulates the situation that the node information transmission cannot be carried out under the harsh environment in the wild. For the TSFB algorithm, the 12,000 pieces of frequency offset data are still synchronized according to the previously described synchronization steps, but starting from the 1000th s, the previously described step 1, that is, the TSF estimation process (since this process depends on timestamp exchange) . The FTSP algorithm also cannot exchange timestamps.

实验结果:Experimental results:

如图9所示,在实验的开始阶段(即0~1000s),TSFB算法和FTSP算法的差距并不十分明显。然而,随着环境温度开始变化,频偏也随着温度不断的变化。此时FTSP算法只能依赖最初始的频偏估计值对时间相偏进行估计和补偿,因此误差不断累积。且从图9还可以看出,节点环境温度值从3000s开始不断上升,这使得节点的频偏变化速率升高,而此时FTSP算法无法捕捉该变化。因此FTSP不断增长的频偏估计误差最终导致了其同步误差的不断累积。相比于FTSP算法,TSFB算法在通信失效的情况下仍然能够保持相对较低的同步误差。这是因为通信失效仅仅造成了TSF无法正常更新,而节点可以根据最近一次TSF估计结果以及传感器节点采集到的温度信息来对频偏进行更新,很大程度上降低了由电压变化造成的频偏估计误差。因此,相比于FTSP算法,TSFB算法具有较高的鲁棒性。As shown in Figure 9, at the beginning of the experiment (ie 0-1000s), the gap between the TSFB algorithm and the FTSP algorithm is not very obvious. However, as the ambient temperature begins to change, the frequency offset also changes continuously with the temperature. At this time, the FTSP algorithm can only estimate and compensate the time phase offset by relying on the initial frequency offset estimation value, so the error continues to accumulate. It can also be seen from Figure 9 that the ambient temperature of the node has been rising continuously since 3000s, which makes the frequency offset change rate of the node increase, and the FTSP algorithm cannot capture this change at this time. Therefore, the FTSP's increasing frequency offset estimation error eventually leads to the continuous accumulation of its synchronization errors. Compared with the FTSP algorithm, the TSFB algorithm can still maintain a relatively low synchronization error in the case of communication failure. This is because the communication failure only caused the TSF to be unable to be updated normally, and the node can update the frequency offset according to the latest TSF estimation result and the temperature information collected by the sensor node, which greatly reduces the frequency offset caused by the voltage change. Estimate error. Therefore, compared with the FTSP algorithm, the TSFB algorithm has higher robustness.

Claims (1)

  1. A kind of 1. wireless sensor network time synchronization method based on temperature sensing, it is characterised in that:
    Remember that R is the reference mode in wireless sensor network, N is any one sensor node in addition to reference mode, net After network initialization, node N repeats the following cycle, and the cycle includes step 1 to step 3:
    Step 1, Sensitivity Factor determine
    Step S10, node N send time synchronized request data package to reference mode R;
    Step S11, node R return to four reply data bags successively after time of receipt (T of R) synchronization request packet, to node N:M0, M1,M2,M3, the local zone time of moment node R, respectively time (R) when record sends the packet in each packet0~ time(R)3;M0With M1、M2With M3Interval time is 1s;M1With M2Interval time is 10min;
    Step S12, node N are receiving packet M0~M3While, record the local zone time time of oneself0~time3And The environment temperature temp that node N is presently in0~temp3
    Step S13, node N is to it in time1And time3Frequency deviation skew1And skew3Calculated:
    Step S14, node N are calculated current Sensitivity Factor TSF values according to frequency deviation and temperature information:
    In formula 2,Temp is normal temperature, value 25 ℃;
    Step 2, Sensitivity Factor interval determine
    Step S20, node N obtain local environment temperature T this moment1, the node N upper cycles, the moment local environment temperature was Tpre, Then node N rate of temperature change DT is:
    In formula 3, dpreFor the upper cycle step S22 Sensitivity Factor interval d obtained value;
    Step S21, node N calculate current accumulated error value error:
    Step S22, node N are set to Sensitivity Factor interval d, and method is:
    In formula 5, the μ s of μ=150~900, λ=0.6~1.4 DEG C, dstd=20min;
    It is skew that step S23, node N, which set current frequency offset value skew,3, step S31,100s < Δ t < are transferred to after Δ t durations 10000s;
    Step 3, local zone time renewal
    Step S30, node N obtain its local environment temperature T this moment2, the Sensitivity Factor TSF calculated according to step S14 is to node Current frequency offset is calculated:
    Skew=TSF (T-Temp)2(formula 6)
    In above formula, T represents the time;
    Step S31, node N calculate current skew:
    In formula 7, skewpreThe current frequency offset value obtained for upper cycle step S23 or step S30, offsetpreFor upper one week The current phase bias that phase step S31 is calculated;
    Step S32, if node N current skew meets:
    Then node N is updated to the own local time, and the local zone time clock after renewal is:
    Clock=clockpre+ offset (formula 9)
    In formula 8 and formula 9, ε is local clock cycles, clockpreFor the local zone time before renewal;After renewal, section Point N is by offsetpreReset;
    Step S33, node N check timer, if duration d is not timed out, step S30 is gone to after dormancy Δ t durations;Otherwise, it is complete In the cost cycle, it is transferred to step S10 and starts to perform next cycle.
CN201410341165.5A 2014-07-17 2014-07-17 A kind of wireless sensor network time synchronization method based on temperature sensing Expired - Fee Related CN104168641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410341165.5A CN104168641B (en) 2014-07-17 2014-07-17 A kind of wireless sensor network time synchronization method based on temperature sensing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410341165.5A CN104168641B (en) 2014-07-17 2014-07-17 A kind of wireless sensor network time synchronization method based on temperature sensing

Publications (2)

Publication Number Publication Date
CN104168641A CN104168641A (en) 2014-11-26
CN104168641B true CN104168641B (en) 2017-12-15

Family

ID=51912224

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410341165.5A Expired - Fee Related CN104168641B (en) 2014-07-17 2014-07-17 A kind of wireless sensor network time synchronization method based on temperature sensing

Country Status (1)

Country Link
CN (1) CN104168641B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109788547B (en) * 2018-12-28 2021-06-01 南京华曼吉特信息技术研究院有限公司 Adaptive time synchronization method for temperature compensation of low communication load
JP7052837B2 (en) * 2020-08-07 2022-04-12 株式会社オートネットワーク技術研究所 In-vehicle device, time synchronization method and time synchronization program
CN112261670B (en) * 2020-10-15 2023-04-07 锐迪科(重庆)微电子科技有限公司 Method and device for determining frequency deviation

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101917761A (en) * 2010-08-13 2010-12-15 清华大学 A Time Synchronization Method for Network Access of Mobile Sensor Strange Nodes in Wireless Networks
EP2378822A2 (en) * 2010-04-16 2011-10-19 Simmonds Precision Products, Inc. Synchronizing wireless devices
CN103052150A (en) * 2012-11-19 2013-04-17 安徽工程大学 Wireless sensor network time synchronization method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8867588B2 (en) * 2012-08-31 2014-10-21 Cambridge Silicon Radio Limited Chirp data channel synchronisation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2378822A2 (en) * 2010-04-16 2011-10-19 Simmonds Precision Products, Inc. Synchronizing wireless devices
CN101917761A (en) * 2010-08-13 2010-12-15 清华大学 A Time Synchronization Method for Network Access of Mobile Sensor Strange Nodes in Wireless Networks
CN103052150A (en) * 2012-11-19 2013-04-17 安徽工程大学 Wireless sensor network time synchronization method

Also Published As

Publication number Publication date
CN104168641A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN109936519B (en) Clock Frequency Offset Estimation Method for Industrial Wireless Sensor Network Based on Timing Response
CN101562489B (en) Method for time synchronization in wireless sensor network
Schmid et al. Temperature compensated time synchronization
CN103281772B (en) A kind of method for synchronizing time of wireless sensor network and system
CN108880727B (en) A Realization Method of Accurate Clock Synchronization Based on PTPd2 Protocol
US9386552B2 (en) Wireless sensor time synchronization
US11153838B1 (en) Time synchronization enhancements for integrated 5G-TSN networking
WO2022267496A1 (en) Timestamp-free synchronizing clock parameter tracking method based on extended kalman filter
CN104158647A (en) Clock synchronizing method for wireless sensing network
CN101729180A (en) Method and system for synchronizing precision clocks, and precision clock frequency/time synchronizing device
CN104507156A (en) Improved method for time synchronization based on IEEE 1588 PTP mechanism for wireless network
CN104168641B (en) A kind of wireless sensor network time synchronization method based on temperature sensing
CN109548135A (en) A kind of wireless network time synchronous method of optimization
CN103457685A (en) Method for precisely synchronizing time of industrial wireless network on basis of prediction and compensation
CN106452650A (en) Clock synchronizing frequency deviation estimation method applicable to multi-hop wireless sensor network
CN105577349A (en) Airborne network IEEE1588 protocol master-slave clock port synchronization method
CN102480350A (en) Time synchronization and maintenance method and device based on frequency deviation estimation
CN103945522B (en) Time synchronizing method of wireless sensor network based on voltage sensing
Wang et al. Estimation of frequency offset for time synchronization with immediate clock adjustment in multihop wireless sensor networks
CN110121208A (en) Intersection based on more base station locations mutually tests clock synchronizing method and system
CN109560889A (en) A method of realizing App and server-side time synchronization
Pérez Solano et al. Time synchronization enhancements in wireless networks with ultra wide band communications
WO2018098791A1 (en) Clock synchronization frequency deviation estimation method applicable to multi-hop wireless sensor network
CN109788547B (en) Adaptive time synchronization method for temperature compensation of low communication load
CN102710359A (en) Accurate clock frequency synchronizing method and device based on IEEE1588 (institute of electrical and electronics engineers)

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20171215