Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with specific embodiment, and with reference to accompanying drawing, the present invention is described in more detail.
At first some english abbreviations, symbol and the mark etc. that use in the accompanying drawing of the present invention are described as follows: SINK representative data aggregation node; END representative data acquisition terminal.SYNC instruction expression synchronic command, data collection station carries out synchronously after receiving this instruction, and what the present invention mentioned is to instigate end node and convergent point to be worked at one time synchronously, thus the information that guarantees convergent point can be issued to terminal node.。The COMD0 instruction represents synchronously/acquisition instructions that data collection station at first carries out carrying out data acquisition then synchronously after receiving this instruction.COMD1 command list registration is according to last teletype command, and data collection station at first carries out uploading data then synchronously after receiving this instruction.SYNC_FIND is the sequential under the terminal synchronizes searching modes; SYNC_MODE﹠amp; DATA_MODE is the sequential under the synchronous mode.
The timing sequence diagram of Fig. 1 for using among low-power consumption sensor network information acquisition system of the present invention and the method timeflag.The implication of each time that relates among Fig. 1 is as follows: t1 represents dormancy/work period (adjustable), and its size and clock precision directly influence the size of t2; T2 represents the time of SINK delayed delivery information, and this time is depended on the crystal oscillator deviation that timer conter is used, and time-delay herein is used for avoiding owing to the crystal oscillator deviation causes the sequential entanglement; T3 represents that the SYNC frame is packaged into the time that finishes that sends; T4 represents that END node maximum wait receives the time of SYNC frame synchronization, and in this time, the END node can postpone enter the wait accepting state according to self address (position in the link), postpone with SYNC time of reception (smaller or equal to) be unit; T5 represents the synchronous wakeup time (adjustable) of END node searching; T6 represents synchronous the staggering the time the time interval of END node searching; T7 represents that the COMD0 frame is packaged into the time that finishes that sends; T8 represents that the END node receives the time that data acquisition instructs laggard line data to gather; T9 represents that the COMD1 frame is packaged into the time that finishes that sends; T10 represents the instruction of END node wait data upload, and time-delay waits for that the END node is synchronous; After t11 represents that the END node is received the data upload instruction, the beginning data upload, in actual implementation procedure, node is according to the address setting data wait reception of self and the time slot of data upload, and time slot is unit with the data time of reception; T12 represent on the SINK node data teletype command send finish after, enter the wait data receiving state.Fig. 4 is timing Design figure of the present invention.
Above-mentioned each time depends on used hardware condition, below only under a kind of hardware condition, restriction and the relation of time is done exemplary explanation.Under other hardware conditions, the algorithm of time is identical.For example precondition is:
1), utilize MSP430F4130 timer conter TIMER0 as clock.
2), crystal oscillator: 32.768KHz ± 20ppm, i.e. maximum fmax=32768.65536Hz, minimum fmin=32767.34464.
3), timer conter adopts and to overflow interruption, namely 2s regularly interrupts.Suppose that dormancy/work period is Ts, then the number of times that needs to carry out interruption in the time at Ts is Ts/2.The minimum and maximum time that timer conter once interrupts is respectively:
Tmin=65536/32768.65536=1.99996s
Tmax=65536/32767.34464=2.00004s
Maximal phase is to shift time in one-period:
trel=(2.00004-1.99996)*Ts/2
4), MSP430F4130 adopts the LM3 low-power consumption mode, and interrupts waking up by TIMER0.Wakeup time 6us.
5), radio frequency chip adopts CC1101, employing frequency calibration when entering RX or TX state by the IDLE state, this alignment time 799us.
6), CC1101XSOC waits for stable time 149-155us.
7), by 4,5,6 as can be known, node is by the normal mode of operation required time that wakes up to setting:
(6+799+149) us, the i.e. 954us≤td≤960us of us≤td≤(6+799+155)
Get maximum of T d=960us
Under these conditions, the time of the time requirement of t1: t1 is determined according to system requirements that by the user this value influences the power consumption of node.T1 is more big, and relative power consumption is more low, otherwise in like manner.The t1 actual range of node: (1.99996*Ts/2)≤t1≤(2.00004*Ts/2).
The time requirement of t2: working stage, the SINK node sends synchronizing information, and the END node receives to be waited for.Be operated at the SINK nodal clock under the situation of peak frequency fmax=32768.65536Hz, can receive synchronizing information in order to guarantee the END node, the SINK node need delay time at least (trel+Td) send i.e. t2 〉=(trel+Td).
Under the situation of Ts=180s, trel=(2.00004-1.99996) * 180/2+=0.0072s, so:
T2 〉=(0.0072+0.00096) s, i.e. t2 〉=8.16ms.
The time requirement of t3: this time is relevant with the frame length of SYNC, and the more big value of being somebody's turn to do of frame length is more big, and vice versa.Under the situation that frame length is fixed, this is worth relevant with the performance of used single-chip microcomputer and radio frequency chip.
The time requirement of t4: this value is relevant with the time of reception of synchronization frame.Suppose every the N of branch node, the time that each node receives SYNC is Trs, and then the reception total time of N node is Tr=N*Trs.Be operated at the SINK nodal clock under the situation of minimum frequency fmin=32767.34464, in order to guarantee the reception of all nodes of branch, reception should be not less than total time: Trmin=Tr+Trel+Td.Tr calculates with desirable time of reception (being the transmitting time of data), but total value will leave sufficient surplus, guarantees that under normal circumstances all nodes can both be received synchronization frame.
The time requirement of t5: the power consumption of this time effects node and synchronous recovery time, rationally set according to requirement in practical systems.
The time requirement of t6: this time needs smaller or equal to t5.
The time requirement of t7: this time is relevant with the frame length of COMD0, and the more big value of being somebody's turn to do of frame length is more big, and vice versa.Under the situation that frame length is fixed, this is worth relevant with the performance of used single-chip microcomputer and radio frequency chip.
The time requirement of t8: this value is the acquisition time of sensing data, and is relevant with type of sensor and mode of operation.
The time requirement of t9: this time is relevant with the frame length of COMD1, and the more big value of being somebody's turn to do of frame length is more big, and vice versa.Under the situation that frame length is fixed, this is worth relevant with the performance of used single-chip microcomputer and radio frequency chip.
The time requirement of t10: this time needs more than or equal to t4.
The time requirement of t11: this value is relevant with the time of reception of Frame.Suppose every the N of branch node, the time that each node receives DATA is Trd (this value will leave certain surplus, to guarantee the correct reception of data), and then the reception total time of N node is Tr=N*Trd.
The time requirement of t12: this value needs greater than (t11+t10-t9).The SINK node can: the time (t12-t11-t10+t9) is built in accepting state, and this value needs the time slot of uploading more than or equal to frame data.
The present invention proposes a kind of power consumption wireless sensor network information gathering system, this system comprises convergence node and large-scale data collection station.
As shown in Figure 2, according to the timing interval of setting, by wireless mode, periodically frequency-division section, timesharing grouping send synchronizing information and control command to the convergence node as synchronous base.The convergence node has M optional working frequency range, and each frequency range has K grouping, and each grouping has N acquisition terminal, and wherein M, K and N are the integers more than or equal to 1.Corresponding grouping of each, each grouping has N data acquisition terminal, is numbered 1,2.....N period.
The convergence node at first powers on, to judge after powering on whether the current time is the control command time, if the control command time, postpone the t2 time (because there is the crystal oscillator error in crystal oscillator, postpone to avoid causing the sequential entanglement because of the crystal oscillator error herein) send the 1st frequency range, the 1st control command of dividing into groups, and the data of wait terminal node are returned; If be the non-control command time, postpone the synchronizing information that the t2 time sends the 1st frequency range, the 1st grouping.Control command is COMD0 and COMD1, and wherein the COMD0 instruction is represented synchronously/acquisition instructions, and data collection station at first carries out carrying out data acquisition then synchronously after receiving this instruction.COMD1 command list registration is according to last teletype command, and data collection station at first carries out uploading data then synchronously after receiving this instruction.The above-mentioned non-control command of mentioning refers to the SYNC instruction, and it represents synchronic command, and data collection station carries out synchronously after receiving this instruction.
Synchronizing information and control command comprise the value of timer conter as clock information.Data collection station n is receiving that the laggard row clock of synchronizing information or control command is synchronous, and its algorithm is: local clock=synchronised clock+data transmitting time.
The pending data aggregation node has sent after control command or the synchronizing information, wait for Fixed Time Interval, 2S for example, 2s regularly interrupts when timer conter, continue to judge whether the current time is the control command time, if the control command time, then postpone the control command that the t2 time sends the 1st frequency range, the 2nd grouping, and wait for that the data of terminal node return; If be the non-control command time, postpone the synchronizing information that the t2 time sends the 1st frequency range, the 2nd grouping.The convergence node is after all grouping informations transmissions with all frequency ranges finish, and dormancy was arrived until t1 (Fig. 3) time.
Data collection station monitors/transmits that (that is, the synchronizing information and the control command that send by the wireless receiving aggregation node are if receive then transmit synchronizing information and control command with time interval identical with the convergence node.) synchronizing information and control command.
Data collection station has a plurality of, can be large-scale, belongs to different working frequency range and groupings, in the course of the work, monitors/transmit synchronizing information and control command with the time interval identical with the convergence node.
Data collection station n at first powers on, judge then whether this data collection station n is synchronous, if it is not synchronous, then enter synchronous searching modes, under this pattern, data collection station n staggers the time (being benchmark with the current time) forward or backward with Fixed Time Interval t6, makes its wakeup time t5 traversal one-period, under the perfect condition, must realize in the cycle synchronously in this traversal; Staggering the time synchronous wakeup time must be more than or equal to staggering the time the time interval, that is: t5 is more than or equal to t6, data collection station n one subsynchronous searching finish (being in the accepting state t5 time), enter resting state, wait for Fixed Time Interval, arrive until the t1 time, after the t1 time arrives, continue to judge whether this data collection station n is synchronous, if not synchronous, then continue to enter synchronous searching modes.
If data collection station n is synchronous, at t4 in the time, if receive that from the convergence node synchronizing information then carries out synchronously, and to the terminal node forwarding synchronizing information that is numbered n+1, enter resting state then, wait for Fixed Time Interval, arrive until the t1 time, after the t1 time arrives, continue to judge whether this data collection station n is synchronous, if not synchronous, then continue to enter synchronous searching modes.
Data collection station n carries out corresponding operating synchronously then as if receiving that control command is then at first carried out, (as the control command that receives is COMD0, then data collection station carries out data acquisition, as the control command that receives is COMD1, and then data collection station carries out data upload; If the time of data acquisition can be merged into an instruction with acquisition instructions and last teletype command than weak point, directly upload after namely collection finishes), and to subordinate's terminal n+1 node forwarding control command, enter resting state then, wait for Fixed Time Interval, arrive until the t1 time, after the t1 time arrives, continue to judge whether this data collection station n is synchronous, if not synchronous, then continue to enter synchronous searching modes; If do not receive information, then synchronization times does not add 1, when synchronization times does not reach the maximum of setting, be judged to be not synchronously, enter resting state then, wait for Fixed Time Interval, arrive until the t1 time, after the t1 time arrives, continue to judge whether this data collection station n is synchronous, if not synchronous, then continue to enter synchronous searching modes.
Data collection station can be sought synchronously with the time interval of setting of staggering the time under not synchronous state, in the time interval of time ergodic data aggregation node of staggering the time, realizes synchronously.Data collection station has M optional working frequency range, and each frequency range has K grouping, and each grouping has N acquisition terminal.Data collection station n (n=1 ... N), monitor same frequency range terminal n-1 and n-2 (if n=1 only monitors convergent point with the time interval identical with the convergence node; If n=2 monitors convergent point and is numbered 1 terminal; If n=3 monitors and is numbered 1 and 2 terminal; If n=4, monitor the terminal of numbering 2 and 3, the rest may be inferred) synchronizing information and control command, and transmit to the n+1 terminal of same frequency range.Data collection station n carries out corresponding operating after receiving control command.The upload frequencies of the transmission frequency determination data of data upload order.
According to a further aspect in the invention, a kind of power consumption wireless sensor network information gathering method is also proposed, Fig. 1 is the execution in step flow chart of convergence node in the power consumption wireless sensor network information gathering method of the present invention, and Fig. 2 is the execution in step flow chart of data collection station.
With reference to Fig. 3, each step below convergence node side is carried out:
Step 1, the convergence node powers on.
Step 2, judge whether the current time is the control command time, if the control command time, postpone the t2 time (because there is the crystal oscillator error in crystal oscillator, postpone to avoid causing the sequential entanglement because of the crystal oscillator error herein) send the 1st frequency range, the 1st control command of dividing into groups, and the data of wait terminal node are returned; If be the non-control command time, postpone the synchronizing information that the t2 time sends the 1st frequency range, the 1st grouping.
Control command is COMD0 and COMD1, and wherein the COMD0 instruction is represented synchronously/acquisition instructions, and data collection station at first carries out carrying out data acquisition then synchronously after receiving this instruction.COMD1 command list registration is according to last teletype command, and data collection station at first carries out uploading data then synchronously after receiving this instruction.The above-mentioned non-control command of mentioning refers to the SYNC instruction, and it represents synchronic command, and data collection station carries out synchronously after receiving this instruction.
Synchronizing information and control command comprise the value of timer conter as clock information.Node N is receiving that the laggard row clock of synchronizing information or control command is synchronous, and its algorithm is: local clock=synchronised clock+data transmitting time.
Step 3, the pending data aggregation node has sent after control command or the synchronizing information, wait for Fixed Time Interval, 2S for example, 2s regularly interrupts when timer conter, continues to judge whether the current time is the control command time, if the control command time, then postpone the control command that the t2 time sends the 1st frequency range, the 2nd grouping, and the data of wait terminal node are returned; If be the non-control command time, postpone the synchronizing information that the t2 time sends the 1st frequency range, the 2nd grouping.
Step 4, repeating step 2 finishes until all groupings (K grouping) information transmission of the 1st frequency range.
Step 5, adjusting frequency range is the 2nd frequency range, repeating step 2,3,4.
Step 6, repeating step 5 send until all frequency ranges (M frequency range) and finish.
Step 7, dormancy was arrived until t1 (Fig. 3) time, repeating step 2,3,4,5,6, t1 represents dormancy/work period.
With reference to Fig. 4, each step below the data collection station side is carried out:
Step 1, data collection station n powers on.
Step 2 judges whether this data collection station n is synchronous, if synchronous, then changes step 5 over to, if not synchronous, changes step 3 over to
Step 3, data collection station n enters synchronous searching modes, under this pattern, data collection station n is with Fixed Time Interval t6 stagger the time forward or backward (being benchmark with the current time), make its wakeup time t5 traversal one-period, under the perfect condition, must realize in the cycle synchronously in this traversal; Staggering the time synchronous wakeup time must be more than or equal to staggering the time the time interval, that is: t5 is more than or equal to t6.
Step 4, data collection station n one subsynchronous searching finishes (being in the accepting state t5 time), execution in step 6.
If step 5 data collection station n is synchronous, at t4 in the time, if receive that from the convergence node synchronizing information then carries out synchronously, and to the terminal node forwarding synchronizing information that is numbered n+1, execution in step 6 then; If receiving that control command is then at first carried out carries out corresponding operating synchronously then, (as the control command that receives is COMD0, and then data collection station carries out data acquisition, as the control command that receives is COMD1, and then data collection station carries out data upload; If the time of data acquisition can be merged into an instruction with acquisition instructions and last teletype command than weak point, directly upload after namely collection finishes), and to subordinate's terminal n+1 node forwarding control command, execution in step 6 then; If do not receive information, then synchronization times does not add 1, when synchronization times does not reach the maximum of setting, be judged to be not synchronous, execution in step 6.
Step 6, data collection station n enter resting state, wait for Fixed Time Interval, arrive until the t1 time, after the t1 time arrives, continue to judge whether this data collection station n is synchronous, if synchronous regime, then execution in step 5, otherwise execution in step 3,4.
In the present invention, when carrying out the COMD1 instruction, wait for then to time t10 at first synchronously, guarantee that all nodes of same grouping are all synchronous, data collection station is according to the numbering setting data wait reception of self and the time slot of data upload then, and time slot is unit with the data time of reception; Each data collection station divides time slot that data are uploaded to the convergence node step by step.The data that data collection station n uploads comprise the data that itself reaches all subordinate's terminals (n+1, n+2, n+3......).
System and method of the present invention utilizes adjustable work/dormancy mechanism and the searching/Restoration Mechanism synchronously of staggering the time, and realizes the long-time reliability service of large-scale sensor network.Frequency-division section, timesharing grouping send synchronizing information to the convergence node at interval with timing, data collection station n monitors the synchronizing information of terminal n-1 and n-2 at interval with regular time, in case the synchronizing information of receiving then realize synchronously and transmit enters normal data then and gathers sending mode.This system is except the data aggregation node adopts mains-supplied, and other all data collection stations all adopt powered battery, the extra cost that can avoid that system connects up in implementation process, perforation etc. brought.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; be understood that; the above only is specific embodiments of the invention; be not limited to the present invention; within the spirit and principles in the present invention all, any modification of making, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.