CN103596261B - A kind of clock synchronizing method of vehicle detecting system - Google Patents
A kind of clock synchronizing method of vehicle detecting system Download PDFInfo
- Publication number
- CN103596261B CN103596261B CN201310539703.7A CN201310539703A CN103596261B CN 103596261 B CN103596261 B CN 103596261B CN 201310539703 A CN201310539703 A CN 201310539703A CN 103596261 B CN103596261 B CN 103596261B
- Authority
- CN
- China
- Prior art keywords
- period
- current
- clock
- node
- synchronization
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000001360 synchronised effect Effects 0.000 claims abstract description 54
- 230000001965 increasing effect Effects 0.000 claims description 44
- 238000001514 detection method Methods 0.000 claims description 25
- 241000238876 Acari Species 0.000 claims description 4
- 230000003247 decreasing effect Effects 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 239000000470 constituent Substances 0.000 description 2
- 238000005265 energy consumption Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 239000000463 material Substances 0.000 description 1
Landscapes
- Synchronisation In Digital Transmission Systems (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The present invention relates to a kind of clock synchronizing method of vehicle detecting system, when the clock offset of node and gateway node is no more than the first allowable error when this method is each subsynchronous in preset time, increase synchronizing cycle;When there is the clock offset more than the first allowable error in each hyposynchronous clock offset in preset time, reduce synchronizing cycle;The synchronous energy expense of clock can be reduced on the premise of clock synchronization accuracy is not sacrificed using the present invention.
Description
Technical Field
The invention relates to a Wireless Sensor Network (WSN) technology, in particular to a clock synchronization method of a vehicle detection system.
Background
The WSN fusing the sensor technology, the information processing technology and the network communication technology forms a network by a large number of sensor nodes distributed on a physical space in an ad hoc network mode, and various material phenomena including temperature, humidity, moving target direction, speed and the like in different surrounding environments are detected by means of different types of sensors built in the nodes. Clock synchronization is an important component of WSN application, and data fusion detected by sensor nodes, self positioning and the like require clocks among the sensor nodes to be kept synchronous.
The methods widely used for network clock synchronization mainly include a Global Positioning System (GPS) and a Network Time Protocol (NTP) 1. GPS has a relatively high synchronization accuracy, but it is costly and consumes a lot of energy, and the synchronization accuracy is greatly affected in an environment where obstacles such as buildings are present. NTP is a protocol for clock synchronization on the Internet, which can realize high-precision computer timing on the network, but it is computationally intensive and has high computational overhead. In the application of the WSN, the appearance of the sensor node is required to be as small as possible, the sensor node is difficult to maintain after being deployed, further, strict requirements are imposed on energy consumption, low cost is required, the sensor node can be deployed in a large quantity, and obviously, the GPS and the NTP are not suitable for the clock synchronization of the WSN. A great deal of research is also carried out on clock synchronization in a distributed system, but the methods do not consider the characteristics of a wireless sensor network, and need large resource overhead, so the method is not suitable for clock synchronization of the WSN.
The clock synchronization algorithms currently proposed for WSNs can be divided into three categories: a receiver-receiver based Synchronization algorithm, a Pair-Wise Synchronization (Pair-Wise Synchronization) algorithm based on Pair-Wise Synchronization between a sender and a receiver (sender-receiver), and a sender-receiver based one-way (one-way) Synchronization algorithm. The one-way synchronization algorithm needs to send the least number of clock synchronization messages in the three methods, the sending node can complete clock synchronization between the sending node and the receiving node only by sending the clock synchronization message once, and the one-way synchronization algorithm has lower network flow overhead and computation complexity and therefore has lower energy consumption.
The vehicle detection system is a typical WSN, and the limitation of the node volume, weight and the like is more severe due to the environment in which the node is arranged, for example, when the geomagnetic detector is arranged under the road surface and the damage to the road surface is to be reduced as much as possible, the node volume is required to be as small as possible, and the repeater is hung on the original facilities beside the road, so that the load is added to the original facilities as little as possible, and the node weight is required to be as light as possible; moreover, the vehicle detection system also requires that its constituent nodes can continue to operate for a long time. Thus, the vehicle detection system has a higher demand for energy saving of its constituent nodes. Of course, the accuracy requirement of the vehicle detection system on clock synchronization is also high. Therefore, compared with the existing clock synchronization algorithm provided for the WSN, a clock synchronization method which can meet the synchronization precision requirement of the vehicle detection system and consumes less energy is urgently needed by the vehicle detection system.
Disclosure of Invention
In view of the above, the main objective of the present invention is to provide a clock synchronization method for a vehicle detection system, which can reduce the energy overhead of clock synchronization without sacrificing the clock synchronization precision.
In order to achieve the purpose, the technical scheme of the invention is as follows:
a method of clock synchronization for a vehicle detection system, the method comprising:
A. the node takes the current period as a synchronous period to carry out clock synchronization with the gateway node; when the current preset time expires, executing the step B;
B. comparing the clock offset between the node and the gateway node at each time of synchronization within the current preset time with the first allowable error, and executing the step C if the clock offset larger than the first allowable error does not exist; otherwise, executing step D;
C. increasing the current period, taking the increased period as the current period, taking the next preset time as the current preset time, and returning to the step A;
D. and C, reducing the current period, taking the reduced period as the current period, taking the next preset time as the current preset time, and returning to the step A.
Preferably, the current period is: an initial period or a second period, the second period being greater than the initial period;
when the current period is the initial period, increasing the current period, and taking the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the second period, the increasing the current period takes the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the initial period is taken as the current period.
Preferably, the current period is: the first period is greater than the second period, and the second period is greater than the first period;
when the current period is the initial period, increasing the current period, and taking the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the second period, the increasing the current period takes the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the third period, increasing the current period, and taking the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the second cycle is taken as the current cycle.
Preferably, the first allowable error takes the value of 1 clock tick of the local clock.
Preferably, the value range of the initial period is: [1s,5s ]; the value range of the second period is as follows: [3s,20s ]; the value range of the third period is as follows: [20s,30s ].
Preferably, the method further comprises an initial synchronization at the time of node startup, the process is as follows:
a1, receiving a synchronization packet sent by a gateway node;
b1, obtaining the receiving time of the whole-point synchronous packet according to the offset time carried by the synchronous packet, receiving the whole-point synchronous packet issued by the gateway node according to the receiving time, and calculating the difference between the time of actually receiving the whole-point synchronous packet and the obtained receiving time to obtain the current clock offset of the node and the gateway node;
c1, judging whether the current clock offset is smaller than a second allowable error, if so, adjusting the local clock by the node to be synchronous with the gateway node clock, and executing the step A; otherwise, in the next minute, return to step a 1.
Preferably, the method for determining the expiration of the preset time is as follows:
setting the maximum count value of the counter as a preset fixed time length, and resetting and recounting when the maximum count value is counted;
the node finishes the synchronization of the local clock and the gateway node clock, the counter starts counting when the step A is executed, and when the counter counts to the maximum count value, the preset time is expired; or,
setting a first counter and a second counter;
when the node is started, the first counter starts counting;
the node finishes the synchronization of the local clock and the gateway node clock, and when the step A is executed, the second counter starts counting by taking the current count value of the first counter as the initial count value; and when the counting value of the second counter is equal to the calibration point of the node, namely the preset time is expired, the second counter is cleared and counts again.
Preferably, when the number of times that the node continuously loses the synchronization packet is greater than the number of times that the packet loss is allowed, the node performs fast synchronization, and the specific steps are as follows:
a2, receiving a synchronization packet sent by a gateway node;
b2, obtaining the receiving time of the whole-point synchronous packet according to the offset time carried by the synchronous packet, receiving the whole-point synchronous packet issued by the gateway node according to the receiving time, and calculating the difference between the time of actually receiving the whole-point synchronous packet and the receiving time to obtain the current clock offset of the node and the gateway node;
c2, judging whether the current clock offset is smaller than a second allowable error, if so, adjusting the local clock by the node to be synchronous with the gateway node clock, and executing the step A; otherwise, returning to the step a2 in the next N seconds;
wherein, the value range of N is [5, 16 ].
Preferably, the second allowable error takes the value of one of 1 clock tick and 2 tick clock ticks of the local clock.
Preferably, the node is a geomagnetic detector, the gateway node is an access point, and the synchronization packet sent by the access point is forwarded to the geomagnetic detector through a repeater, specifically:
the repeater receives a synchronous packet sent by an access point;
the repeater adds a new timestamp obtained after the path offset into the timestamp of the received synchronization packet, and forwards the synchronization packet carrying the new timestamp; wherein,
the path offset is the time from when the repeater receives the synchronization packet to when the synchronization packet is forwarded.
Based on the above, the clock synchronization method of the vehicle detection system provided by the invention has the following advantages and characteristics:
1. when the clock offset of each time of synchronization in the preset time is not greater than the first allowable error, the synchronization period is increased, so that the synchronization frequency is reduced, the synchronization precision is not influenced, and the purpose of reducing the energy expenditure of clock synchronization is achieved; furthermore, when the clock offset which is larger than the first allowable error exists in the clock offset of each time of synchronization within the preset time, the synchronization period is reduced, and the precision of clock synchronization is ensured. In addition, the clock synchronization is dynamically adapted to the wireless network transmission condition, the synchronization times are increased when the network signals are not good, and the synchronization times are reduced when the signals are good, so that the data can be accurately exchanged among the devices of the system according to respective time points;
2. the repeater adds the path offset into the timestamp of the forwarded synchronization packet, so that the repeater is transparent when viewed by the node, and the synchronization packet received by the node is directly issued by the gateway node or forwarded by the repeater, and the clock synchronization can be realized by adopting the same algorithm, thereby enhancing the expandability of the vehicle detection system;
3. a rapid synchronization method is provided, so that when the node is accessed to the network again after being disconnected from the network, the node can rapidly synchronize with the gateway node clock.
Drawings
Fig. 1 is a schematic flow chart of a clock synchronization method of a vehicle detection system according to an embodiment of the invention.
Fig. 2 is a schematic flow chart illustrating synchronization between a geomagnetic detector and an access point clock according to an embodiment of the present invention.
Fig. 3 is a schematic flowchart of clock synchronization between a repeater and an access point according to an embodiment of the present invention.
Detailed Description
Specifically, the implementation flow of the clock synchronization method of the vehicle detection system according to the embodiment of the present invention is shown in fig. 1, and includes:
step 101: the node takes the current period as a synchronous period to carry out clock synchronization with the gateway node; when the current preset time expires, executing step 102;
step 102: comparing the clock offset between the node and the gateway node at each time of synchronization within the current preset time with the first allowable error, and if the clock offset larger than the first allowable error does not exist, executing step 103; otherwise, go to step 104;
step 103: increasing the current period, taking the increased period as the current period, taking the next preset time as the current preset time, and returning to the step 101;
step 104: and reducing the current period, taking the reduced period as the current period, taking the next preset time as the current preset time, and returning to the step 101.
In a step 101, the process is carried out,
the nodes refer to the other nodes except the gateway node in the vehicle detection system.
The clock synchronization between the node and the gateway node specifically comprises the following steps:
step a11, the node receives a synchronous packet sent by the gateway node;
step b11, the node obtains the clock offset between the node and the gateway node according to the time of actually receiving the synchronization packet and the time stamp of the synchronization packet;
and c11, adjusting the local clock by the obtained clock offset to synchronize the local clock with the gateway node clock. Wherein,
when the node is a geomagnetic detector and the gateway node is an Access Point (AP, Access Point), for a transmission mode in which a synchronization packet sent by the AP is forwarded to the geomagnetic detector through a repeater, step a11 specifically includes:
the repeater receives a synchronous packet sent by the AP;
the repeater adds a new timestamp obtained after the path offset into the timestamp of the received synchronization packet, and forwards the synchronization packet carrying the new timestamp; wherein, the path offset is the time from the time when the repeater receives the synchronous packet to the time when the repeater forwards the synchronous packet;
the node receives the synchronization packet forwarded by the repeater.
The step b11 is specifically as follows:
calculating the sum of the time stamp of the synchronous packet and the time delay of the synchronous packet from the gateway node to the node to obtain the time of theoretically receiving the synchronous packet;
calculating the difference between the time of the actually received synchronous packet and the time of theoretically receiving the synchronous packet to obtain the clock offset of the node and the gateway node; namely:
the time at which the synchronization packet should theoretically be received = the time stamp of the synchronization packet + the time delay of the synchronization packet from the gateway node to the node
Clock offset = time of actually received synchronization packet-time at which the synchronization packet should theoretically be received
The node and the gateway node can also perform clock synchronization through the existing clock synchronization algorithm proposed for the WSN.
The preset time may be a preset fixed time duration.
In a step 102, the process is executed,
the first allowable error takes the value of 1 clock tick (tick) of the local clock.
In the steps 103 and 104, the process is carried out,
the current cycle is: an initial period or a second period, the second period being greater than the initial period;
correspondingly, the increasing/decreasing of the current period takes the increased/decreased period as the current period: assigning an initial cycle or a second cycle to the current cycle corresponding to the operation of increasing/decreasing the current cycle, specifically:
the current period is an initial period, and the increasing of the current period takes the increased period as the current period as follows: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
the current period is a second period, and the increasing the current period takes the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the initial period is taken as the current period.
The current period may also be: the first period is greater than the second period, and the second period is greater than the first period;
correspondingly, the increasing/decreasing of the current period takes the increased/decreased period as the current period: assigning an initial period, a second period or a third period to the current period corresponding to the increasing/decreasing operation of the current period, specifically:
the current period is an initial period, and the increasing of the current period takes the increased period as the current period as follows: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
the current period is a second period, and the increasing the current period takes the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
the current period is a third period, and the increasing the current period takes the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the second cycle is taken as the current cycle.
Here, the value range of the initial period is: [1s,5s ]; the value range of the second period is as follows: [3s,20s ]; the value range of the third period is as follows: [20s,30s ]. When the current period is the initial period, the second period or the third period, preferably, the value of the initial period is 1s, 3s or 5s, the value of the second period is 3s, 10s or 20s, and the value of the third period is 20s, 25s or 30 s; when the current period is the initial period or the second period, preferably, the value of the initial period is 1s, 3s, or 5s, and the value of the second period is 3s, 5s, or 20 s.
When a node is started, before step 101, the embodiment of the present invention further includes initial synchronization, which includes the following processes:
step a 12: receiving a synchronous packet sent by a gateway node;
step b 12: obtaining the receiving time of the whole-point synchronous packet according to the offset time carried by the synchronous packet, receiving the whole-point synchronous packet issued by the gateway node according to the receiving time, and calculating the difference between the time of actually receiving the whole-point synchronous packet and the obtained receiving time to obtain the current clock offset of the node and the gateway node;
step c 12: judging whether the current clock offset is smaller than a second allowable error, if so, adjusting the local clock by the node to be synchronous with the gateway node clock, and executing the step 101; otherwise, in the next minute, return to performing step a 12.
In the step b12, the step b,
the offset time carried by the synchronization packet refers to the time of the transmission time of the synchronization packet which is offset by one whole second before;
the obtaining of the receiving time of the integral point synchronization packet according to the offset time carried by the synchronization packet can be realized by the following formula:
the reception time of the integer synchronization packet = the time + (1 s-offset time) at which the detector receives the synchronization packet.
In the step c12, the step c,
the second allowable error may take the value of one of 1 clock tick and 2 clock ticks of the local clock; preferably, the second allowable error takes 2 clock ticks of the local clock.
The embodiment of the present invention further includes a method for determining that the current preset time in step 101 expires, which specifically includes:
step a 13: setting the maximum count value of the counter as a preset fixed time length, and resetting and recounting when the maximum count value is counted; the value range of the fixed time length is [1s, 60s ], and preferably, the fixed time length is 1s, 30s or 60 s;
step b 13: the node finishes the step c12 of adjusting the local clock to be synchronous with the gateway node clock, and when the step A is executed, the counter starts counting, and when the counter counts to the maximum count value, the preset time is expired; or,
step a 14: setting a first counter and a second counter;
step b 14: when the node is started, the first counter starts counting;
step c 14: the node finishes the step c12 of adjusting the local clock to be synchronous with the gateway node clock, and when the step A is executed, the second counter starts counting by taking the current count value of the first counter as the initial count value; when the count value of the second counter is equal to the calibration point of the node, namely the preset time is expired, the second counter is cleared and counts again;
in step a14, the maximum count value of the first counter is 30s, and the first counter is cleared and recounted when the count reaches 30 s.
In step c14, the calibration points are inherent to the node device.
When the node is offline, that is, the number of times that the node continuously loses the synchronization packet is greater than the number of times that the packet is allowed to be lost, the embodiment of the present invention further includes a method for quickly synchronizing with the gateway node when the node re-accesses the network, which specifically includes the following steps:
step a 15: receiving a synchronous packet sent by a gateway node;
step b 15: obtaining the receiving time of an integer point synchronous packet according to the offset time carried by the synchronous packet, receiving the integer point synchronous packet issued by a gateway node according to the receiving time, and calculating the difference between the time of actually receiving the integer point synchronous packet and the receiving time to obtain the current clock offset of the node and the gateway node;
step c 15: judging whether the current clock offset is smaller than a second allowable error or not, if so, adjusting the local clock to be synchronous with the gateway node clock by the node, and executing the step A; otherwise, returning to execute the step a15 in the next N seconds;
wherein, the value range of N is [5, 16], preferably, N is 5, 8 or 16.
The value range of the allowed packet loss times is [8 times, 16 times ], and preferably, the allowed packet loss times is 8 times, 10 times or 16 times.
As shown in fig. 2, when the node is a geomagnetic detector and the gateway node is an AP, the implementation flow of clock synchronization of the vehicle detection system according to the embodiment of the present invention is as follows:
step 201: the geomagnetic detector performs clock synchronization with the AP by taking the initial period as a synchronization period; when the current preset time expires, executing step 202;
step 202: the geomagnetic detector compares the clock offset between the geomagnetic detector and the AP during each time of synchronization within the current preset time with the first allowable error, if the clock offset larger than the first allowable error does not exist, the next preset time is taken as the current preset time, and step 203 is executed; otherwise, taking the next preset time as the current preset time, and returning to the step 201;
step 203: the geomagnetic detector performs clock synchronization with the AP by taking the second period as a synchronization period; when the current preset time expires, executing step 204;
step 204: the geomagnetic detector compares the clock offset between the geomagnetic detector and the AP during each synchronization within the current preset time with the first allowable error, and if the clock offset greater than the first allowable error does not exist, the next preset time is taken as the current preset time, and step 205 is executed; otherwise, taking the next preset time as the current preset time, and returning to the step 201;
step 205: the geomagnetic detector performs clock synchronization with the AP by taking the third period as a synchronization period; when the current preset time expires, executing step 206;
step 206: the geomagnetic detector compares the clock offset between the geomagnetic detector and the AP during each synchronization within the current preset time with the first allowable error, and if the clock offset greater than the first allowable error does not exist, the next preset time is taken as the current preset time, and the step returns to step 205; otherwise, the next preset time is taken as the current preset time, and the step 203 is returned.
As shown in fig. 3, when the node is a repeater and the gateway node is an AP, the implementation process of clock synchronization of the vehicle detection system according to the embodiment of the present invention is as follows:
step 301: the repeater takes the initial period as a synchronous period to carry out clock synchronization with the AP; when the current preset time expires, executing step 302;
step 302: the repeater compares the clock offset between the repeater and the AP during each synchronization within the current preset time with the first allowable error, if the clock offset larger than the first allowable error does not exist, the next preset time is taken as the current preset time, and step 303 is executed; otherwise, taking the next preset time as the current preset time, and returning to the step 301;
step 303: the repeater takes the second period as a synchronous period to carry out clock synchronization with the AP; when the current preset time expires, executing step 304;
step 304: the repeater compares the clock offset between the repeater and the AP during each synchronization within the current preset time with the first allowable error, if the clock offset larger than the first allowable error does not exist, the next preset time is taken as the current preset time, and the step 303 is returned; otherwise, the next preset time is taken as the current preset time, and the step 301 is returned to.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.
Claims (9)
1. A method of clock synchronization for a vehicle detection system, the method comprising:
A. the node takes the current period as a synchronous period to carry out clock synchronization with the gateway node; when the current preset time expires, executing the step B;
B. comparing the clock offset between the node and the gateway node at each time of synchronization within the current preset time with the first allowable error, and executing the step C if the clock offset larger than the first allowable error does not exist; otherwise, executing step D;
C. increasing the current period, taking the increased period as the current period, taking the next preset time as the current preset time, and returning to the step A;
D. reducing the current period, taking the reduced period as the current period, taking the next preset time as the current preset time, and returning to the step A;
the clock synchronization between the node and the gateway node specifically comprises the following steps:
step a11, the node receives a synchronous packet sent by the gateway node;
step b11, the node obtains the clock offset between the node and the gateway node according to the time of actually receiving the synchronization packet and the time stamp of the synchronization packet;
step c11, adjusting the local clock to obtain clock offset, so that the local clock is synchronous with the gateway node clock;
when the number of times of continuously losing the synchronization packets by the node is larger than the number of times of allowing packet loss, the node executes rapid synchronization, and the specific steps are as follows:
a2, receiving a synchronization packet sent by a gateway node;
b2, obtaining the receiving time of the whole-point synchronous packet according to the offset time carried by the synchronous packet, receiving the whole-point synchronous packet issued by the gateway node according to the receiving time, and calculating the difference between the time of actually receiving the whole-point synchronous packet and the receiving time to obtain the current clock offset of the node and the gateway node;
c2, judging whether the current clock offset is smaller than a second allowable error, if so, adjusting the local clock by the node to be synchronous with the gateway node clock, and executing the step A; otherwise, returning to the step a2 in the next N seconds;
wherein, the value range of N is [5, 16 ].
2. The clock synchronization method of a vehicle detection system according to claim 1, wherein the current cycle is: an initial period or a second period, the second period being greater than the initial period;
when the current period is the initial period, increasing the current period, and taking the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the second period, the increasing the current period takes the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the initial period is taken as the current period.
3. The clock synchronization method of a vehicle detection system according to claim 2, wherein the current cycle is: the first period is greater than the second period, and the second period is greater than the first period;
when the current period is the initial period, increasing the current period, and taking the increased period as the current period: taking the second period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the second period, the increasing the current period takes the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: taking the initial period as the current period;
when the current period is the third period, increasing the current period, and taking the increased period as the current period: taking the third period as the current period; and the current period is reduced, and the reduced period is taken as the current period: the second cycle is taken as the current cycle.
4. The method of claim 3, wherein the first allowable error is 1 clock tick of the local clock.
5. The clock synchronization method of the vehicle detection system according to claim 4, wherein the initial period has a value range of: [1s,5s ]; the value range of the second period is as follows: [3s,20s ]; the value range of the third period is as follows: [20s,30s ].
6. The clock synchronization method of a vehicle detection system according to claim 1, wherein the method further comprises an initial synchronization at the start of the node, as follows:
a1, receiving a synchronization packet sent by a gateway node;
b1, obtaining the receiving time of the whole-point synchronous packet according to the offset time carried by the synchronous packet, receiving the whole-point synchronous packet issued by the gateway node according to the receiving time, and calculating the difference between the time of actually receiving the whole-point synchronous packet and the obtained receiving time to obtain the current clock offset of the node and the gateway node;
c1, judging whether the current clock offset is smaller than a second allowable error, if so, adjusting the local clock by the node to be synchronous with the gateway node clock, and executing the step A; otherwise, in the next minute, return to step a 1.
7. The clock synchronization method for a vehicle detection system according to claim 6, wherein the method of determining the expiration of the preset time is as follows:
setting the maximum count value of the counter as a preset fixed time length, and resetting and recounting when the maximum count value is counted;
the node finishes the synchronization of the local clock and the gateway node clock, the counter starts counting when the step A is executed, and when the counter counts to the maximum count value, the preset time is expired; or,
setting a first counter and a second counter;
when the node is started, the first counter starts counting;
the node finishes the synchronization of the local clock and the gateway node clock, and when the step A is executed, the second counter starts counting by taking the current count value of the first counter as the initial count value; and when the counting value of the second counter is equal to the calibration point of the node, namely the preset time is expired, the second counter is cleared and counts again.
8. The method for synchronizing clocks of a vehicle detection system according to claim 6 or 7, wherein the second allowable error is one of 1 clock tick and 2 tick clock ticks of a local clock.
9. The clock synchronization method of the vehicle detection system according to claim 1, 2 or 3, wherein the node is a geomagnetic detector, the gateway node is an access point, and the synchronization packet sent by the access point is forwarded to the geomagnetic detector through a relay, specifically:
the repeater receives a synchronous packet sent by an access point;
the repeater adds a new timestamp obtained after the path offset into the timestamp of the received synchronization packet, and forwards the synchronization packet carrying the new timestamp; wherein,
the path offset is the time from when the repeater receives the synchronization packet to when the synchronization packet is forwarded.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310539703.7A CN103596261B (en) | 2013-11-05 | 2013-11-05 | A kind of clock synchronizing method of vehicle detecting system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310539703.7A CN103596261B (en) | 2013-11-05 | 2013-11-05 | A kind of clock synchronizing method of vehicle detecting system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103596261A CN103596261A (en) | 2014-02-19 |
CN103596261B true CN103596261B (en) | 2017-11-07 |
Family
ID=50086193
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310539703.7A Active CN103596261B (en) | 2013-11-05 | 2013-11-05 | A kind of clock synchronizing method of vehicle detecting system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103596261B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104301988B (en) * | 2014-08-17 | 2018-10-12 | 宿迁学院 | A kind of clock synchronizing method of the earth induction Vehicular system based on Sensor Network |
CN104811988B (en) * | 2015-04-24 | 2019-02-22 | 迈锐数据(北京)有限公司 | A kind of quick method of network entry of wireless sensor network node |
CN105722207A (en) * | 2016-01-28 | 2016-06-29 | 武汉慧联无限科技有限公司 | Self-adaptive clock synchronization method for wireless network at low transmission speeds |
CN109640287A (en) * | 2018-12-11 | 2019-04-16 | 西安理工大学 | A kind of clock skew method for early warning based on RSSP-II agreement |
CN117979412B (en) * | 2024-03-29 | 2024-07-19 | 江铃汽车股份有限公司 | Internal time synchronization method and system for vehicle-mounted communication remote terminal |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101202617A (en) * | 2006-12-12 | 2008-06-18 | 北京三星通信技术研究有限公司 | Method for time synchronism compensation among multi-stage equipments |
CN101478358B (en) * | 2008-01-02 | 2013-01-23 | 中兴通讯股份有限公司 | Method and device for optimized time synchronization correction |
CN103999387B (en) * | 2011-11-11 | 2017-05-17 | 爱立信(中国)通信有限公司 | Sync interval determination |
-
2013
- 2013-11-05 CN CN201310539703.7A patent/CN103596261B/en active Active
Non-Patent Citations (1)
Title |
---|
实时分布***中自适应的时钟同步算法;张海辉等;《计算机工程》;20040930;第30卷(第17期);标题1和2 * |
Also Published As
Publication number | Publication date |
---|---|
CN103596261A (en) | 2014-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3564921B1 (en) | Sensing system and time synchronization method | |
Hasan et al. | Time synchronization in vehicular ad-hoc networks: A survey on theory and practice | |
CN103596261B (en) | A kind of clock synchronizing method of vehicle detecting system | |
Lasassmeh et al. | Time synchronization in wireless sensor networks: A survey | |
JP6400700B2 (en) | Method and system for mobile device clock management | |
US20100177763A1 (en) | network device for use in a network | |
KR20170125035A (en) | Methods and systems for synchronizing devices | |
KR20090065403A (en) | A positioning estimation method of mobile node in wireless sensor networks | |
US9513388B2 (en) | Method for providing synchronization in a data acquisition system | |
US11218980B2 (en) | Methods and systems for representing errors | |
Chen et al. | An implementation of IEEE 1588 protocol for IEEE 802.11 WLAN | |
JP2017507504A (en) | Method and system for mobile device clock management | |
Kim et al. | Synchronized sensing for wireless monitoring of large structures | |
CN103747516A (en) | Event time tag later time synchronization method in wireless sensor network | |
WO2016065642A1 (en) | Synchronization device and method | |
Kumar et al. | Time synchronization in wireless sensor networks: Estimating packet delay | |
Lv et al. | Simulation and performance analysis of the ieee1588 ptp with kalman filtering in multi-hop wireless sensor networks | |
CN107959968B (en) | High-precision low-overhead wireless sensor network clock synchronization method | |
KR20170058629A (en) | Method, apparatus, system and computer program for enhancing the accuracy of Time Synchronization between devices | |
WO2021118467A1 (en) | Time synchronization in wireless communication network system | |
EP3420747B1 (en) | Method and wireless station for a ranging protocol | |
Tackett et al. | An implementation of time synchronization in low-power wireless sensor networks | |
KR100999903B1 (en) | Time Synchronizing Method in Wireless Sensor Networks | |
Cho | Time synchronization for multi-hop surveillance camera systems | |
Gong | Clock synchronization in wireless sensor networks: Performance analysis and protocol design |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |