CN101466142A - Synchronization method for layered time comparative clock in wireless sensor network - Google Patents

Synchronization method for layered time comparative clock in wireless sensor network Download PDF

Info

Publication number
CN101466142A
CN101466142A CNA2009100450322A CN200910045032A CN101466142A CN 101466142 A CN101466142 A CN 101466142A CN A2009100450322 A CNA2009100450322 A CN A2009100450322A CN 200910045032 A CN200910045032 A CN 200910045032A CN 101466142 A CN101466142 A CN 101466142A
Authority
CN
China
Prior art keywords
node
synchronization
current
time
clock
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
CNA2009100450322A
Other languages
Chinese (zh)
Other versions
CN101466142B (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.)
Shanghai Jiao Tong University
Original Assignee
Shanghai Jiao Tong 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 Shanghai Jiao Tong University filed Critical Shanghai Jiao Tong University
Priority to CN2009100450322A priority Critical patent/CN101466142B/en
Publication of CN101466142A publication Critical patent/CN101466142A/en
Application granted granted Critical
Publication of CN101466142B publication Critical patent/CN101466142B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Synchronisation In Digital Transmission Systems (AREA)
  • Electric Clocks (AREA)

Abstract

一种无线网络技术领域的无线传感器网络中分层时间比较时钟同步方法包括以下步骤:步骤一,网络开始初始化,并从基站/协调器开始按照信号强度和设备种类分层;步骤二,整个网络分为外时钟源同步和内时钟源同步,节点采用时间戳比较的方法同步,上下级节点以服务器/客户端模式同步;步骤三,根据历次同步效果来调整同步周期,时钟漂移参数;步骤四,自动抛弃陈旧的时间戳。本发明与现有技术相比,能更好地符合无线传感器网络时间同步方法的精度,同时具有低开销、健壮的优点。

Figure 200910045032

A layered time comparison clock synchronization method in a wireless sensor network in the technical field of wireless networks comprises the following steps: Step 1, the network starts to initialize, and starts from the base station/coordinator according to the signal strength and device types; Step 2, the entire network It is divided into external clock source synchronization and internal clock source synchronization. Nodes are synchronized by time stamp comparison method, and upper and lower nodes are synchronized in server/client mode; Step 3, adjust the synchronization period and clock drift parameters according to the previous synchronization effects; Step 4 , to automatically discard stale timestamps. Compared with the prior art, the invention can better meet the accuracy of the wireless sensor network time synchronization method, and has the advantages of low overhead and robustness.

Figure 200910045032

Description

无线传感器网络中分层时间比较时钟同步方法 Hierarchical Time Comparison and Clock Synchronization Method in Wireless Sensor Networks

技术领域 technical field

本发明涉及一种无线网络技术领域的方法,具体是一种无线传感器网络中分层时间比较时钟同步方法。The invention relates to a method in the technical field of wireless networks, in particular to a method for layered time comparison and clock synchronization in a wireless sensor network.

背景技术 Background technique

近年来,由低功耗无线传感器所组成的无线传感器网络(wireless sensornetworks,WSNs)应用愈加广泛。时间同步是WSNs应用的重要组成部分,控制消息冲突、数据融合、节点定位等方面都要求节点间保持时钟同步。In recent years, wireless sensor networks (WSNs) composed of low-power wireless sensors have been widely used. Time synchronization is an important part of WSNs applications. Control message conflicts, data fusion, and node positioning all require clock synchronization between nodes.

国内外许多大学和研究机构都对无线传感器网络的同步技术进行了深入研究并提出了多种时间同步方法,从不同方面满足传感器网络的应用需要。到目前为止,已经提出了十几种实现方法,典型的有RBS、TPSN、LTS、TS/MS、TSync、DMTS、FTSP、AD、TSS和TDP。这些方法虽然从不同的方面满足了应用需要,但是相应的他们自身有不少缺陷,比如RBS精度较好,但是在有的网络协议中无法应用。TS/MS、Tsync精度更好,但是方法复杂,对于无线网络中有限的运算能力和网络开销而言有点过大了。Many universities and research institutions at home and abroad have conducted in-depth research on the synchronization technology of wireless sensor networks and proposed a variety of time synchronization methods to meet the application needs of sensor networks from different aspects. So far, more than a dozen implementation methods have been proposed, typically RBS, TPSN, LTS, TS/MS, TSync, DMTS, FTSP, AD, TSS and TDP. Although these methods meet the application needs from different aspects, they have many defects correspondingly. For example, RBS has better precision, but it cannot be applied in some network protocols. TS/MS and Tsync have better accuracy, but the method is complicated, which is a bit too large for the limited computing power and network overhead in the wireless network.

经对现有技术文献的检索发现,Rui Fan,Indraneel Chakraborty,and NancyLynch,在2005年8月23日的Lecture Notes in Computer Science,Principlesof Distributed Systems(计算机科学讲座笔记,分布式系统原理)中发表的文章《Clock Synchronization for Wireless Networks》(无线网络的时钟同步),该文章提出了一种同步方式,采取外部时钟同步与内部时钟同步并行的方式,通过不断比对时间坐标大小,取其最大(其实也是同步时可能与外部基准时间最接近的)为其逻辑时间,同步周期采用固定周期。该方法的计算开销和通信开销较小,避开了随机性最大的数据包处理延时的估计,同时避免了一些算法可能会将时钟回拨的可能性,但是该方法仅对稳定的单跳网络效果较好,在规模较大的动态网络里同步精度较差,这显然对于某些实际应用是不够的。After searching the existing technical documents, it was found that Rui Fan, Indraneel Chakraborty, and Nancy Lynch, published in Lecture Notes in Computer Science, Principles of Distributed Systems on August 23, 2005 The article "Clock Synchronization for Wireless Networks" (clock synchronization of wireless networks), this article proposes a synchronization method, which adopts a parallel method of external clock synchronization and internal clock synchronization, by continuously comparing the size of the time coordinates, whichever is the largest (actually It is also the logic time that may be the closest to the external reference time during synchronization, and the synchronization period adopts a fixed period. This method has less computational overhead and communication overhead, avoids the estimation of packet processing delay with the greatest randomness, and avoids the possibility that some algorithms may dial back the clock, but this method is only suitable for stable single-hop The network effect is better, but the synchronization accuracy is poor in a large-scale dynamic network, which is obviously not enough for some practical applications.

发明内容 Contents of the invention

本发明的目的是针对上述现有技术的不足,提供了一种无线传感器网络中分层时间比较时钟同步方法,通过分层以及时间戳比较,减少了同步通讯的开销,采用估计逼近时钟漂移,调整参数ρ的方法,进一步降低同步的开销,同时,抛弃了失效的时间戳,减小了对节点存储的开销,本发明能够应用到动态多跳网络中去。The object of the present invention is to address the deficiencies of the above-mentioned prior art, and provide a hierarchical time comparison clock synchronization method in a wireless sensor network, which reduces the overhead of synchronous communication through layering and time stamp comparison, and uses estimation to approach clock drift, The method of adjusting the parameter ρ further reduces the overhead of synchronization. At the same time, the invalid time stamp is discarded, and the overhead for node storage is reduced. The present invention can be applied to dynamic multi-hop networks.

本发明通过如下技术方案实现的,本发明包括如下步骤:The present invention is realized through the following technical solutions, and the present invention comprises the following steps:

步骤一,网络开始初始化:以总的基站/协调器为顶层,根据信号强度和设备种类发出隶属关系确认帧,对应的设备接受到确认帧后,并返回应答帧,以此类推,完成对整个网络的分层设置,同时确认网络达到稳定状态;Step 1, the network starts to initialize: with the general base station/coordinator as the top layer, the affiliation confirmation frame is sent out according to the signal strength and device type, and the corresponding device receives the confirmation frame and returns a response frame, and so on, to complete the whole Layered setup of the network, while confirming that the network has reached a steady state;

步骤二,从顶层开始,逐层开始同步,同步分为两个部分:外时钟源同步和内时钟源同步,外部时钟源同步过程中,若节点i接到GPS同步信号,节点i的当前有效数组坐标i.current加一,外部时钟源同步为内部时钟源同步提供时间基准,各节点根据内时间源和外时钟源同步结果的比较获得该节点的逻辑时间;Step 2, start from the top layer and start synchronization layer by layer. The synchronization is divided into two parts: external clock source synchronization and internal clock source synchronization. During the external clock source synchronization process, if node i receives a GPS synchronization signal, the current valid Add one to the array coordinate i.current, and the synchronization of the external clock source provides a time reference for the synchronization of the internal clock source. Each node obtains the logical time of the node according to the comparison of the synchronization results of the internal time source and the external clock source;

步骤三,各节点统一设定同步周期,随后各节点根据最初若干次同步结果以及同步精度调整时钟漂移参数ρ、同步周期τ,若节点某次同步满足同步精度,则增加同步周期τ,减少系统开销;若不满足,则调整时钟漂移参数ρ,并将减少同步周期τ;Step 3: Each node uniformly sets the synchronization period, and then each node adjusts the clock drift parameter ρ and the synchronization period τ according to the initial synchronization results and synchronization accuracy. overhead; if not satisfied, adjust the clock drift parameter ρ, and reduce the synchronization period τ;

步骤四,节点i检查当前有效数组坐标是否大于数组长度,如果成立,当前有效数组坐标清零,抛弃失效的时间戳,如果不成立,当前有效数组坐标继续计数,重复步骤二。Step 4. Node i checks whether the current valid array coordinates are greater than the array length. If yes, the current valid array coordinates are cleared, and the invalid timestamp is discarded. If not, the current valid array coordinates continue to count, and step 2 is repeated.

所述各节点根据内时间源和外时钟源同步结果的比较获得该节点的逻辑时间,包括如下步骤:Described each node obtains the logic time of this node according to the comparison of internal time source and external clock source synchronization result, comprises the following steps:

第一步,如果节点i发现节点i的逻辑时钟等于节点i的预订同步次数与节点同步周期的乘积,节点i开始同步,并检查外部时钟源是否存在,若存在,则发出外部同步服务请求,进入第二步;无论外部时钟源是否存在都开始内部时钟同步,即执行第三步,同时节点i的预订同步次数增加一,但第0层节点始终不进行内部时钟同步;In the first step, if node i finds that the logical clock of node i is equal to the product of node i’s scheduled synchronization times and node synchronization period, node i starts to synchronize and checks whether the external clock source exists. If it exists, it sends an external synchronization service request. Enter the second step; no matter whether the external clock source exists or not, the internal clock synchronization is started, that is, the third step is executed, and the number of reservation synchronizations of node i is increased by one, but the 0th layer node does not perform internal clock synchronization;

第二步,节点i进行外部时钟源同步:如果节点i接到GPS同步信号,节点i的当前有效数组坐标i.current加一,将GPS时间戳存入数组i.local[i.current]和i.max_gps中,i.local[i.current]随物理时钟同步更新,i.local[]表示节点i对该节点所处时间坐标的最佳估计,i.max_gps表示最近的GPS时间戳;In the second step, node i performs external clock source synchronization: if node i receives a GPS synchronization signal, the current effective array coordinate i.current of node i is increased by one, and the GPS timestamp is stored in the array i.local[i.current] and In i.max_gps, i.local[i.current] is updated synchronously with the physical clock, i.local[] represents node i’s best estimate of the time coordinate of the node, and i.max_gps represents the latest GPS timestamp;

第三步,节点i进行内部时钟同步:节点i向直属的上级节点j发出同步服务请求,如果节点i收到从上级节点j发来的同步帧sync_message(j.local[j.current],j.max_gps),节点i检查节点j的GPS时间戳是否和节点i的i.max_gps一样新,随后检查j.local[j.current]是否比i.global[i.current]大,i.global[]表示节点i对该节点所属网络的其他节点时间最佳估计,如果两者皆满足,代表节点i对其他节点的估计i.global[i.current]有误差,则更新i.global[i.current]为j.local[j.current],j.global[j.current]以物理时钟的(1-ρ)/(1+ρ)倍更新;In the third step, node i performs internal clock synchronization: node i sends a synchronization service request to the directly subordinate node j, if node i receives the synchronization frame sync_message(j.local[j.current], j .max_gps), node i checks whether node j’s GPS timestamp is as new as node i’s i.max_gps, then checks whether j.local[j.current] is greater than i.global[i.current], i.global[ ] indicates that node i best estimates the time of other nodes in the network to which the node belongs. If both are satisfied, it means that node i has an error in estimating i.global[i.current] of other nodes, and then update i.global[i. current] is j.local[j.current], and j.global[j.current] is updated by (1-ρ)/(1+ρ) times of the physical clock;

第四步,节点i比较数组i.local[]各元素,取最大者为i.mlocal,比较数组i.global[]各元素,取最大者为i.mglobal;In the fourth step, the node i compares the elements of the array i.local[], and takes the largest one as i.mlocal, compares the elements of the array i.global[], and takes the largest one as i.mglobal;

第五步,节点i比较i.mlocal和i.mglobal的大小,取较大者为i.logical表示节点i的逻辑时钟,完成节点时钟同步,i.logical随物理时间同步更新。In the fifth step, node i compares the size of i.mlocal and i.mglobal, and takes the larger one as i.logical to represent the logical clock of node i, completes node clock synchronization, and i.logical is updated synchronously with physical time.

与现有技术相比,本发明包括如下有益效果:Compared with the prior art, the present invention includes the following beneficial effects:

1、本发明通过时间戳比较来避免对节点间数据包传输延时的估计;从实际的无线网络的搭建和抓包分析可以知道节点间的传输延时由于信道能量检测和信道冲突检测,节点的任务调度的影响,随机性是非常大的,采用时间戳比较绕开了对这些因素的估计,从而在保证一定精度的条件下,降低系统开销;1. The present invention avoids the estimation of data packet transmission delay between nodes by comparing time stamps; from the actual wireless network construction and packet capture analysis, it can be known that the transmission delay between nodes is due to channel energy detection and channel conflict detection. The impact of task scheduling is very random, and the use of timestamp comparison bypasses the estimation of these factors, thereby reducing system overhead while ensuring a certain accuracy;

2、本发明通过分层的方法减小了节点间的同步误差极限;换言之,节点间的同步误差极限和节点的同步精度都取决于该节点所属网络的最大延时,故将一个大的网络分层,分成若干个小网进行同步,有助于减小误差;2. The present invention reduces the synchronization error limit between nodes by a layered method; in other words, the synchronization error limit between nodes and the synchronization accuracy of nodes all depend on the maximum delay of the network to which the node belongs, so a large network Layered, divided into several small networks for synchronization, which helps to reduce errors;

3、本发明通过变周期的方法,减小了同步通讯的开销;在实际工程中,各节点所使用的晶振是有较大差别的,有的精度好,有的精度差。如果一刀切的统一同步周期,显然是给有限的网络信道流量增加不小的开销,增加全网络能量消耗,而让节点自行统计来变更同周期可以避免不必要的能量消耗和流量开销;3. The present invention reduces the overhead of synchronous communication through the method of variable period; in actual engineering, the crystal oscillators used by each node are quite different, some have good precision, and some have poor precision. If a one-size-fits-all synchronization period is adopted, it will obviously add a lot of overhead to the limited network channel traffic and increase the energy consumption of the entire network, and allowing nodes to make statistics to change the synchronization period can avoid unnecessary energy consumption and traffic overhead;

4、本发明通过估计逼近时钟漂移,调整参数ρ的方法,进一步降低同步的开销,在前面节点同步过程中,可以看到,如果ρ估计较准的话,显然本节点对其他节点的时钟估计更准,相应的同步周期就可以设的更长,自然开销就小了;4. The present invention further reduces the overhead of synchronization by estimating the approximate clock drift and adjusting the parameter ρ. In the previous node synchronization process, it can be seen that if the ρ estimation is accurate, it is obvious that the node has a better estimate of the clocks of other nodes. Accurate, the corresponding synchronization cycle can be set longer, and the natural overhead is small;

5、本发明通过将i.Current清零来抛弃失效的时间戳,减小了对节点存储的开销;虽然随着半导体工艺的不断发展,片上资源越来越丰富,但是,对于节点所使用的单片机而言资源受较大限制的状况在可见得将来一段时间内仍然是无法改变的。本同步机制中两个最佳估计数组在较短的时间内是不占多少资源的,但是时间长了,显然不行的,同时过旧的时间戳也是没有意义的。所以要抛弃失效的时间戳。5. The present invention discards invalid time stamps by clearing i.Current to reduce the cost of node storage; although with the continuous development of semiconductor technology, on-chip resources are becoming more and more abundant, but for nodes used In terms of single-chip microcomputers, the situation that the resources are relatively limited will not be changed for a period of time in the foreseeable future. In this synchronization mechanism, the two best estimated arrays do not take up much resources in a short period of time, but it is obviously not possible for a long time, and at the same time, the old timestamp is meaningless. So discard the invalid timestamp.

综上,本发明能更好的符合无限传感器网络时间同步算法的精度适中,低开销,健壮的要求。In summary, the present invention can better meet the requirements of moderate accuracy, low overhead and robustness of the infinite sensor network time synchronization algorithm.

附图说明 Description of drawings

图1是本发明方法的工作流程图;Fig. 1 is the work flowchart of the inventive method;

图2是本发明的实施例仿真结果图;Fig. 2 is the simulation result figure of embodiment of the present invention;

图中,(a)为模拟的未经处理晶振频率变化图,(b)为经过参数调整后逻辑频率变化图,(c)为处理前后的同步周期进行对比柱状图。In the figure, (a) is the simulated unprocessed crystal frequency change diagram, (b) is the logical frequency change diagram after parameter adjustment, and (c) is the comparison histogram of the synchronization period before and after processing.

具体实施方式 Detailed ways

下面结合附图对本发明的实施例作详细说明:本实施例在以本发明技术方案为前提下进行实施,给出了详细的实施方式和具体的操作过程,但本发明的保护范围不限于下述的实施例。The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings: this embodiment is implemented on the premise of the technical solution of the present invention, and detailed implementation methods and specific operating procedures are provided, but the protection scope of the present invention is not limited to the following the described embodiment.

本实施例应用于无线传感器网络搭建项目中的实验网络的时钟同步研究的应用中,主要采用了基于紫芯公司的ASAP1810/20开发板和TI的CC2420无线传感器开发板,并在其上进行开发组网实验。This embodiment is applied to the application of the clock synchronization research of the experimental network in the wireless sensor network construction project. It mainly uses the ASAP1810/20 development board based on Zixin Company and the CC2420 wireless sensor development board of TI, and develops on it Networking experiment.

本实施例中无线传感器网络由126个从设备和一个主设备组成,其中主设备设有GPS时钟源,网络的分层层数由各节点按照其物理位置和功能自行划分。In this embodiment, the wireless sensor network is composed of 126 slave devices and one master device, wherein the master device is provided with a GPS clock source, and the hierarchical layers of the network are divided by each node according to its physical location and function.

如图1所示,本实施例包括如下步骤:As shown in Figure 1, this embodiment includes the following steps:

步骤一,网络开始初始化:以总的基站/协调器为顶层,根据信号强度和设备种类发出隶属关系确认帧,对应的设备接受到确认帧后,并返回应答帧,以此类推,完成对整个网络的分层设置,同时确认网络达到稳定状态;Step 1, the network starts to initialize: with the general base station/coordinator as the top layer, the affiliation confirmation frame is sent out according to the signal strength and device type, and the corresponding device receives the confirmation frame and returns a response frame, and so on, to complete the whole Layered setup of the network, while confirming that the network has reached a steady state;

步骤二,从顶层开始,逐层开始同步,同步分为两个部分:外时钟源同步和内时钟源同步,外部时钟源同步过程中,若节点i接到GPS同步信号,节点i的当前有效数组坐标i.current加一,外部时钟源同步为内部时钟源同步提供时间基准,各节点根据内时间源和外时钟源同步结果的比较获得该节点的逻辑时间;Step 2, start from the top layer and start synchronization layer by layer. The synchronization is divided into two parts: external clock source synchronization and internal clock source synchronization. During the external clock source synchronization process, if node i receives a GPS synchronization signal, the current valid Add one to the array coordinate i.current, and the synchronization of the external clock source provides a time reference for the synchronization of the internal clock source. Each node obtains the logical time of the node according to the comparison of the synchronization results of the internal time source and the external clock source;

步骤三,各节点统一设定同步周期,随后各节点根据最初若干次同步结果以及同步精度调整时钟漂移参数ρ、同步周期τ,若节点某次同步满足同步精度,则增加同步周期τ,减少系统开销;若不满足,则调整时钟漂移参数ρ,并将减少同步周期τ;Step 3: Each node uniformly sets the synchronization period, and then each node adjusts the clock drift parameter ρ and the synchronization period τ according to the initial synchronization results and synchronization accuracy. overhead; if not satisfied, adjust the clock drift parameter ρ, and reduce the synchronization period τ;

步骤四,节点i检查当前有效数组坐标是否大于数组长度,如果成立,当前有效数组坐标清零,抛弃失效的时间戳,如果不成立,当前有效数组坐标继续计数,重复步骤二。Step 4. Node i checks whether the current valid array coordinates are greater than the array length. If yes, the current valid array coordinates are cleared, and the invalid timestamp is discarded. If not, the current valid array coordinates continue to count, and step 2 is repeated.

所述各节点根据内时间源和外时钟源同步结果的比较获得该节点的逻辑时间,包括如下步骤:Described each node obtains the logic time of this node according to the comparison of internal time source and external clock source synchronization result, comprises the following steps:

第一步,节点i内建立两个数组:i.local[p]、i.global[p],八个变量:i.current、i.next_sync、i.mlocal、i.mglobal、i.max_gps、ρ、i.logical、τ,其中,i.current表示节点i的当前有效数组坐标;i.local[]表示节点i对该节点所处时间坐标的最佳估计;i.global[]表示节点i对该节点所属网络的其他节点时间最佳估计;i.mlocal代表i.local[]中最大值;i.mglobal代表i.global[]中最大值;i.max_gps表示最近的GPS时间戳;ρ表示时钟漂移,单位ppm(每百万分之一);τ表示节点同步周期;p表示数组长度;i.logical表示节点i的逻辑时钟;i.next_sync表示节点i的预定同步次数;The first step is to create two arrays in node i: i.local[p], i.global[p], and eight variables: i.current, i.next_sync, i.mlocal, i.mglobal, i.max_gps, ρ, i.logical, τ, where i.current represents the current valid array coordinates of node i; i.local[] represents the best estimate of node i’s time coordinates for the node; i.global[] represents node i The best estimate of the time of other nodes in the network to which the node belongs; i.mlocal represents the maximum value in i.local[]; i.mglobal represents the maximum value in i.global[]; i.max_gps represents the latest GPS timestamp; ρ Indicates the clock drift, the unit is ppm (per million); τ indicates the node synchronization period; p indicates the length of the array; i.logical indicates the logical clock of node i; i.next_sync indicates the scheduled synchronization times of node i;

第二步,如果节点i发现i.logical=i.next_sync*τ,节点i开始同步,并检查外部时钟源是否存在,若存在,则发出外部同步服务请求,进入步骤三;无论外部时钟源是否存在都开始内部时钟同步,即执行步骤四,同时变量i.next_sync加一,但第0层节点始终不进行内部时钟同步;In the second step, if node i finds that i.logical=i.next_sync*τ, node i starts to synchronize, and checks whether the external clock source exists. If it exists, it sends an external synchronization service request and enters step 3; All existences start internal clock synchronization, that is, execute step 4, and at the same time increase the variable i.next_sync by 1, but the 0th layer nodes do not perform internal clock synchronization;

第三步,节点i进行外部时钟源同步过程:如果节点i接到GPS同步信号,i.current加一,将GPS时间戳存入i.local[i.current]和i.max_gps中,i.local[i.current]随物理时钟同步更新;In the third step, node i performs an external clock source synchronization process: if node i receives a GPS synchronization signal, i.current is incremented by one, and the GPS timestamp is stored in i.local[i.current] and i.max_gps, i. local[i.current] is updated synchronously with the physical clock;

第四步,节点i进行内部时钟同步过程:节点i向直属的上级节点j发出同步服务请求,如果节点i收到从上级节点j发来的同步帧sync_message(j.local[j.current],j.max_gps),节点i检查节点j的GPS时间戳是否和节点i的i.max_gps一样新,随后检查j.local[j.current]是否比i.global[i.current]大,如果两者皆满足,代表节点i对其他节点的估计i.global[i.current]有误差,则更新i.global[i.current]为j.local[j.current],j.global[j.current]以物理时钟的(1-ρ)/(1+ρ)倍更新;In the fourth step, node i performs the internal clock synchronization process: node i sends a synchronization service request to the directly subordinate node j, if node i receives the synchronization frame sync_message(j.local[j.current] from the superior node j, j.max_gps), node i checks whether node j’s GPS timestamp is as new as node i’s i.max_gps, then checks whether j.local[j.current] is greater than i.global[i.current], if both All are satisfied, which means that node i has an error in estimating i.global[i.current] of other nodes, then update i.global[i.current] to j.local[j.current], j.global[j.current] Update with (1-ρ)/(1+ρ) times of the physical clock;

第五步,节点i比较数组i.local[]各元素,取最大者为i.mlocal,比较数组i.global[]各元素,取最大者为i.mglobal;In the fifth step, the node i compares the elements of the array i.local[] and takes the largest one as i.mlocal, compares the elements of the array i.global[] and takes the largest one as i.mglobal;

第六步,节点i比较i.mlocal和i.mglobal的大小,取较大者为i.logical即逻辑时钟已完成节点时钟同步,i.logical随物理时间同步更新。In the sixth step, node i compares the size of i.mlocal and i.mglobal, and takes the larger one as i.logical, that is, the logical clock has completed node clock synchronization, and i.logical is updated synchronously with physical time.

本实施例中,节点间的同步误差如下述公式:|i.log ical(t)-j.log ical(t)|≤2(D+ρ(T+D)),节点间的同步误差大约控制在节点间信号延迟2倍以内,网络结构呈二叉树结构向下递推,本实施例的目的是使用该方法,在尽量小的网络开销和节点计算开销下,满足网络的同步精度要求。In this embodiment, the synchronization error between nodes is as follows: |i.logical(t)-j.logical(t)|≤2(D+ρ(T+D)), the synchronization error between nodes is approximately The signal delay between nodes is controlled within 2 times, and the network structure is recursively descending in a binary tree structure. The purpose of this embodiment is to use this method to meet the synchronization accuracy requirements of the network with as little network overhead and node computing overhead as possible.

将本实施例方法以软件的形式写入各开发板中,再以该开发板为无线传感器网络节点组建网络,观察网络通信情况,主要是确认网络已经建立,顶层节点接入外部时钟源。在实施例中,晶振漂移ρ取10-4秒,同步周期τ取1秒。网络的分层层数根据节点的通信容量和信号覆盖范围而定。Write the method of this embodiment into each development board in the form of software, and then use the development board as a wireless sensor network node to build a network, observe the network communication, mainly to confirm that the network has been established, and the top-level nodes are connected to the external clock source. In the embodiment, the drift ρ of the crystal oscillator is 10 −4 seconds, and the synchronization period τ is 1 second. The number of hierarchical layers of the network depends on the communication capacity and signal coverage of the nodes.

在该实际组网实验的基础上,对调整参数ρ和调整同步周期τ之间的关系进行了模拟仿真,仿真结果如图2所示,图(a)为模拟的未经处理晶振频率变化图,(b)为经过参数调整后逻辑频率变化图,这两幅图中的纵坐标分别表示原始频率和基准频率、逻辑频率和基准频率之差。而图(c)为一柱状图,表示将处理前后的同步周期进行对比。其中,1号柱代表处理前的同步周期,2号柱代表处理后的同步周期。由该图可知,经过处理的逻辑频率比原始频率稳定性要好很多,由此可以在满足一定定时精度的条件下,尽可能地延长同步周期,这对于能耗敏感的无线传感器网络有着很大的意义,尤其是在发射功耗远远超过运算功耗的情况下。On the basis of the actual networking experiment, the relationship between the adjustment parameter ρ and the adjustment synchronization period τ was simulated. The simulation results are shown in Figure 2. Figure (a) is the simulated unprocessed crystal oscillator frequency change diagram , (b) is the change diagram of logic frequency after parameter adjustment, and the ordinates in these two figures respectively represent the difference between the original frequency and the reference frequency, and the logic frequency and the reference frequency. Figure (c) is a histogram showing the comparison of the synchronization periods before and after processing. Among them, No. 1 column represents the synchronization cycle before processing, and No. 2 column represents the synchronization cycle after processing. It can be seen from the figure that the processed logic frequency is much more stable than the original frequency, so the synchronization period can be extended as much as possible under the condition of satisfying a certain timing accuracy, which has great advantages for energy-sensitive wireless sensor networks. Significance, especially when the transmission power consumption far exceeds the operation power consumption.

Claims (2)

1, synchronization method for layered time comparative clock in a kind of wireless sensor network is characterized in that, comprises the steps:
Step 1, network begins initialization: with total base station/telegon is top layer, send the membership acknowledgement frame according to signal strength signal intensity and device category, after corresponding equipment receives acknowledgement frame, and echo reply frame, by that analogy, finish, confirm that simultaneously network reaches stable state whole Network Layering setting;
Step 2, from top layer, successively begin synchronously, be divided into two parts synchronously: external clock source is synchronous and the internal clock source is synchronous, in the external clock reference synchronizing process, if node i is received the GPS synchronizing signal, current effective array coordinate i.current of node i adds one, external clock reference provides time reference synchronously for internal clock source synchronously, and each node is according to the logical time that relatively obtains this node of interior time source and external clock source synchronized result;
Step 3, each node is unified sets synchronizing cycle, and each node is adjusted clock drift parameter ρ, synchronizing cycle τ according to initial several times synchronized result and synchronization accuracy subsequently, satisfies synchronization accuracy if node is subsynchronous, then increase τ synchronizing cycle, reduce overhead; If do not satisfy, then adjust clock drift parameter ρ, and will reduce τ synchronizing cycle;
Whether step 4, node i check current effective array coordinate greater than array length, if set up, the timestamp of inefficacy is abandoned in current effective array coordinate zero clearing, if be false, current effective array coordinate continues counting, repeating step two.
2, synchronization method for layered time comparative clock in the wireless sensor network according to claim 1 is characterized in that, described each node comprises the steps: according to the logical time that relatively obtains this node of interior time source and external clock source synchronized result
The first step equals the reservation synchronization times of node i and the product of node synchronizing cycle if node i is found the logical timer of node i, and node i begins synchronously, and check whether external clock reference exists, if exist, then send the external sync service request, entered for second step; Whether external clock reference exists that all to begin internal clocking synchronous, promptly carries out for the 3rd step, and the reservation synchronization times of node i increases by one simultaneously, but that the 0th node layer does not carry out internal clocking all the time is synchronous;
Second step, it is synchronous that node i is carried out external clock reference: if node i is received the GPS synchronizing signal, current effective array coordinate i.current of node i adds one, gps time stabbed deposits array i.local[i.current in] and i.max_gps in, i.local[i.current] upgrade synchronously with phy clock, i.local[] represent the best estimate of node i to this node time coordinate of living in, i.max_gps represents that nearest gps time stabs;
The 3rd step, it is synchronous that node i is carried out internal clocking: node i to directly under superior node j send synchronization service request, if node i receive the synchronization frame sync_message that sends from superior node j (j.local[j.current], j.max_gps), node i checks whether the same new with the i.max_gps of node i the gps time of node j stabs, check j.local[j.current subsequently] whether than i.global[i.current] big, i.global[] the expression node i is to other node time best estimates of this node belonging network, if both are all satisfied, representation node i is to the estimation i.global[i.current of other nodes] error arranged, then upgrade i.global[i.current] for j.local[j.current], j.global[j.current] doubly upgrade with (1-ρ)/(the 1+ ρ) of phy clock;
In the 4th step, node i is array i.local[relatively] each element, getting the maximum is i.mlocal, relatively array i.global[] each element, getting the maximum is i.mglobal;
In the 5th step, node i compares the size of i.mlocal and i.mglobal, and getting the greater is the logical timer that i.logical represents node i, and it is synchronous to finish nodal clock, and i.logical upgrades synchronously with physical time.
CN2009100450322A 2009-01-08 2009-01-08 Hierarchical Time Comparison and Clock Synchronization Method in Wireless Sensor Networks Expired - Fee Related CN101466142B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100450322A CN101466142B (en) 2009-01-08 2009-01-08 Hierarchical Time Comparison and Clock Synchronization Method in Wireless Sensor Networks

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100450322A CN101466142B (en) 2009-01-08 2009-01-08 Hierarchical Time Comparison and Clock Synchronization Method in Wireless Sensor Networks

Publications (2)

Publication Number Publication Date
CN101466142A true CN101466142A (en) 2009-06-24
CN101466142B CN101466142B (en) 2011-02-09

Family

ID=40806441

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100450322A Expired - Fee Related CN101466142B (en) 2009-01-08 2009-01-08 Hierarchical Time Comparison and Clock Synchronization Method in Wireless Sensor Networks

Country Status (1)

Country Link
CN (1) CN101466142B (en)

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101883420A (en) * 2010-06-25 2010-11-10 中国科学院软件研究所 A Time Synchronization Method for Wireless Sensor Networks
CN102196554A (en) * 2011-06-10 2011-09-21 西安电子科技大学 Method for realizing average clock synchronization of wireless sensor network through cluster averaging
CN102355319A (en) * 2011-08-17 2012-02-15 中国科学院深圳先进技术研究院 Time synchronization method and system for wireless sensor network
CN102547965A (en) * 2011-12-22 2012-07-04 中国科学院上海微系统与信息技术研究所 Application method of global positioning system (GPS) time service pulse in medium and high speed sensor network
CN102566411A (en) * 2012-01-12 2012-07-11 孙得膑 High-precision time service, frequency calibration and phase calibration united system and design method thereof
CN102761941A (en) * 2011-04-28 2012-10-31 北京云天创科技有限公司 Wireless intelligent network protocol with ultra-low power consumption
CN102804879A (en) * 2009-12-31 2012-11-28 无线测震仪股份有限公司 Synchronization of modules in a wireless array
CN103175566A (en) * 2011-12-22 2013-06-26 中国移动通信集团公司 System, device and method for calibrating sensor
CN103402250A (en) * 2013-07-26 2013-11-20 深圳职业技术学院 Clock synchronization method and device for large-scale wireless sensor network
CN103746762A (en) * 2013-11-29 2014-04-23 中国矿业大学 Wireless sensor network time synchronization method layered as required
CN103957589A (en) * 2014-04-01 2014-07-30 安徽工程大学 Multi-hop and low-cost distributed clock synchronization method
CN104284411A (en) * 2013-07-04 2015-01-14 普天信息技术研究院有限公司 A method for automatic adjustment of downlink synchronization period
CN104823494A (en) * 2012-11-30 2015-08-05 高通股份有限公司 Systems and methods for optimization of synchronization message transmission intervals in peer-to-peer network
EP3270286A1 (en) 2016-07-13 2018-01-17 Bayerische Motoren Werke Aktiengesellschaft Vehicle control logic considering timestamps
CN107637144A (en) * 2015-04-17 2018-01-26 诺基亚技术有限公司 Wireless Device Ranging
CN109413734A (en) * 2018-12-14 2019-03-01 郑州联睿电子科技有限公司 Base base station and its construction method when a kind of more
CN110446253A (en) * 2019-07-26 2019-11-12 杭州微萤科技有限公司 A kind of synchronous method by UWB position fixing process Satellite
CN113473404A (en) * 2021-07-02 2021-10-01 华南农业大学 Agricultural Internet of things communication method and device based on wide-band and narrow-band fusion
CN117979412A (en) * 2024-03-29 2024-05-03 江铃汽车股份有限公司 Internal time synchronization method and system for vehicle-mounted communication remote terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1972182B (en) * 2006-12-04 2010-04-14 中国科学院计算技术研究所 A Method of Improving the Time Synchronization Accuracy of Wireless Sensor Networks

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102804879A (en) * 2009-12-31 2012-11-28 无线测震仪股份有限公司 Synchronization of modules in a wireless array
CN101883420A (en) * 2010-06-25 2010-11-10 中国科学院软件研究所 A Time Synchronization Method for Wireless Sensor Networks
CN101883420B (en) * 2010-06-25 2012-12-12 中国科学院软件研究所 Method for synchronizing time of wireless sensor network
CN102761941B (en) * 2011-04-28 2016-08-03 北京云天创科技有限公司 A kind of method utilizing ultra-low power consumption wireless smart sensor's network protocol transmission
CN102761941A (en) * 2011-04-28 2012-10-31 北京云天创科技有限公司 Wireless intelligent network protocol with ultra-low power consumption
CN102196554A (en) * 2011-06-10 2011-09-21 西安电子科技大学 Method for realizing average clock synchronization of wireless sensor network through cluster averaging
CN102355319A (en) * 2011-08-17 2012-02-15 中国科学院深圳先进技术研究院 Time synchronization method and system for wireless sensor network
CN102355319B (en) * 2011-08-17 2015-07-08 中国科学院深圳先进技术研究院 Time synchronization method and system for wireless sensor network
CN102547965B (en) * 2011-12-22 2014-04-30 中国科学院上海微系统与信息技术研究所 Application system of global positioning system (GPS) time service pulse in medium and high speed sensor network
CN103175566A (en) * 2011-12-22 2013-06-26 中国移动通信集团公司 System, device and method for calibrating sensor
CN103175566B (en) * 2011-12-22 2016-03-30 中国移动通信集团公司 A kind of system of calibrating sensors, device and method
CN102547965A (en) * 2011-12-22 2012-07-04 中国科学院上海微系统与信息技术研究所 Application method of global positioning system (GPS) time service pulse in medium and high speed sensor network
CN102566411B (en) * 2012-01-12 2014-04-09 孙得膑 High-precision time service, frequency calibration and phase calibration united system and design method thereof
CN102566411A (en) * 2012-01-12 2012-07-11 孙得膑 High-precision time service, frequency calibration and phase calibration united system and design method thereof
CN104823494A (en) * 2012-11-30 2015-08-05 高通股份有限公司 Systems and methods for optimization of synchronization message transmission intervals in peer-to-peer network
CN104284411A (en) * 2013-07-04 2015-01-14 普天信息技术研究院有限公司 A method for automatic adjustment of downlink synchronization period
CN103402250B (en) * 2013-07-26 2014-11-26 深圳职业技术学院 Clock synchronization method and device for large-scale wireless sensor network
CN103402250A (en) * 2013-07-26 2013-11-20 深圳职业技术学院 Clock synchronization method and device for large-scale wireless sensor network
CN103746762A (en) * 2013-11-29 2014-04-23 中国矿业大学 Wireless sensor network time synchronization method layered as required
CN103746762B (en) * 2013-11-29 2017-02-08 中国矿业大学 Wireless sensor network time synchronization method layered as required
CN103957589A (en) * 2014-04-01 2014-07-30 安徽工程大学 Multi-hop and low-cost distributed clock synchronization method
CN103957589B (en) * 2014-04-01 2017-03-29 安徽工程大学 A kind of distributed clock synchronous method of multi-hop low overhead
CN107637144A (en) * 2015-04-17 2018-01-26 诺基亚技术有限公司 Wireless Device Ranging
EP3270286A1 (en) 2016-07-13 2018-01-17 Bayerische Motoren Werke Aktiengesellschaft Vehicle control logic considering timestamps
CN109413734A (en) * 2018-12-14 2019-03-01 郑州联睿电子科技有限公司 Base base station and its construction method when a kind of more
CN110446253A (en) * 2019-07-26 2019-11-12 杭州微萤科技有限公司 A kind of synchronous method by UWB position fixing process Satellite
CN113473404A (en) * 2021-07-02 2021-10-01 华南农业大学 Agricultural Internet of things communication method and device based on wide-band and narrow-band fusion
CN117979412A (en) * 2024-03-29 2024-05-03 江铃汽车股份有限公司 Internal time synchronization method and system for vehicle-mounted communication remote terminal

Also Published As

Publication number Publication date
CN101466142B (en) 2011-02-09

Similar Documents

Publication Publication Date Title
CN101466142A (en) Synchronization method for layered time comparative clock in wireless sensor network
CN101425887A (en) Time synchronization method used for wireless sensor network
Shi et al. A novel rapid-flooding approach with real-time delay compensation for wireless-sensor network time synchronization
CN102118849A (en) Time synchronization method applicable to wireless sensor network
CN104519563A (en) Hierarchical wireless sensor network time synchronization method
CN102196554A (en) Method for realizing average clock synchronization of wireless sensor network through cluster averaging
CN114584246A (en) Wireless ad hoc network time synchronization method, system and medium based on FPGA
CN104993898B (en) A kind of method for monitoring formula clock synchronization in WIA-PA network between cluster interior nodes
CN105491656B (en) A kind of lightweight method for synchronizing time towards extensive ad hoc network
Liu et al. Research on time synchronization technology of wireless sensor network
CN103516504A (en) Network node clock synchronization method, nodes and system
CN105430736B (en) A kind of self-organizing network method for synchronizing time and device
US20120134456A1 (en) Methods and apparatuses for synchronization of wireless devices in wireless networks
Sun et al. Photovoltaic modules monitoring based on WSN with improved time synchronization
CN110545153B (en) An underwater wireless network time synchronization method that can adapt to the channel environment
CN103298099A (en) Time synchronizing method based on bimodal clock frequency estimation
CN107197514A (en) Cognitive global clock synchronization method for wireless sensor networks and its application in multi-hop networks
CN103746762B (en) Wireless sensor network time synchronization method layered as required
CN109068385A (en) A kind of underwater wireless method for synchronizing network time with fault-tolerance
CN103402250B (en) Clock synchronization method and device for large-scale wireless sensor network
CN107995681A (en) A kind of wireless sense network method for synchronizing time and device
CN111641993B (en) Time synchronization method for energy perception dynamic topology control
Cui et al. An improved TPSN algorithm based on doze mechanism
CN113973277B (en) Time synchronization system and method for wireless sensor of electric power Internet of things
CN104540212B (en) On-demand clock synchronization method for wireless sensor network based on AODV routing protocol

Legal Events

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

Granted publication date: 20110209

Termination date: 20140108