Background technology
Wireless sensor network, as the interface of real world and digital world, has boundless application prospect in fields such as military affairs, industrial or agricultural, city management, digital building, environmental monitoring, rescue and relief work, deathtrap remote monitoring.
The MAC agreement is one of key network agreement guaranteed the wireless sensor network efficient communication, it determines the occupation mode of wireless channel, between sensor node, distribute limited radio channel resource, be used for building the underlying basis framework of wireless sensor network system, the performance of wireless sensor network is had to very important impact.
At present, MAC protocol for wireless sensor networks mainly contains three classes: the first kind is based on the MAC agreement of competition; Its basic thought is when having data to send, and sensor node is by the contention access channel; If clash, adopt certain strategy to resend data, until data send success or abandon sending.This quasi-protocol adopts the carrier sense mode of operation usually, and in conjunction with collision avoidance mechanism, handshake with keep out of the way the possibility that access mechanism reduces conflict.Its advantage be agreement simple, can expand; Shortcoming be have collision, cross-talk, the problem such as fairness is poor and channel utilization is low.Equations of The Second Kind is based on the MAC agreement of scheduling; Its basic thought is to adopt certain dispatching algorithm to make each sensor node only in given time period/sub-band/orthogonal code, access channel to communicate, the node that does not participate in communication enters sleep state with energy-conservation, its major advantage be can realize without conflict communication, the duty ratio controllability is good, network energy efficiency is high, shortcoming is poor expandability, synchronously requires high and scheduled maintenance expense large etc.The 3rd class is hybrid MAC protocols, and its basic thought is in conjunction with the MAC agreement based on competition with based on the advantage of MAC agreement of scheduling, avoids simultaneously shortcoming separately.When time-space domain or the change of certain network condition, this quasi-protocol still shows as take certain quasi-protocol as main, and other agreement is auxiliary characteristic.The major advantage of agreement is to be conducive to the network global optimization, and weak point is the common more complicated of algorithm.
There is following common defects in above existing MAC protocol for wireless sensor networks: the real-time Transmission that can't guarantee simultaneously periodicity perception data and bursty data; The channel that can't guarantee the heterogeneous sensor node is used fairness; Can't meet the QoS needs of heterogeneous sensor different business grade, these problems cause existing MAC agreement can't adapt to the complicated applications occasion of the heterogeneous sensor network that recurrent event perception and event-driven perception coexist.
Summary of the invention
The objective of the invention is to overcome the weak point of existing wireless sensor network MAC agreement, the heterogeneous sensor network application coexisted for recurrent event perception and event-driven perception, a kind of wireless sensor network ADAPTIVE MIXED MAC agreement is proposed, the real-time Transmission of sexy data of cycle and bursty data in the application of solution wireless sensor network, heterogeneous sensor node channel access fairness, the problems such as the different QoS needs of heterogeneous sensor different business grade, for wireless sensor network, can support simultaneously recurrent event perception and event-driven perception task technical support is provided.
A kind of wireless sensor network ADAPTIVE MIXED MAC agreement of the present invention comprises the following steps:
1, a kind of wireless sensor network ADAPTIVE MIXED MAC agreement, is characterized in that, comprises the following steps:
1) network is three etale topology structures;
Network is comprised of aggregation node, backbone node and ordinary node, and ordinary node sends to backbone node by perception data, is transmitted to aggregation node after by backbone node, completing data fusion;
2) the cross time-slot allocation algorithm of frame length based on fixedly the time;
21) time frame means with TF, and time slot means with TS, TF=3 * 2
kTS (0≤k≤15), wherein k is determined by bunch amount of capacity, TS is determined by data packet size, message transmission rate and clock drift parameter, time frame start to use the time frame beacon identity, wherein comprise the parameters such as subnet number, beacon time stamp, beacon duration, time slot sum, remaining time slots number;
22) time frame is divided into to tri-groups of A, B, C, every group comprises 2
kIndividual time slot, the time slot in every group all distributes a call number, and span is 0~2
k-1.The time slot of the time slot of each time slot group and other time slot group replaces layout: A-0, and B-0, C-0, A-1, B-1, C-1 ..., A-2
k-1, B-2
k-1, C-2
k-1;
23) A-0, B-0, C-0 is reserved time slot, wherein A-0 is synchronizeed with the aggregation node essence for backbone node; B-0 networks essence synchronously for newly-increased node, and C-0 is for newly-increased node receiving slot allocation of parameters;
24) do not comprise reserved time slot, A group time slot is the fixedly time slot of distributing to ordinary node, to backbone node, sends data for ordinary node; B group time slot is public competition slot, to backbone node, sends bursty data for ordinary node; C group time slot is the reserved time slot of backbone node, to aggregation node, sends data for backbone node;
25) according to the QoS demand, each node can distribute a plurality of time slots, is called the time slot piece, and the size of time slot piece is characterized by the repetition rate number, and the repetition rate number equals the logarithm of number of time slots distribution, and the time slot piece that node n distributes can be expressed as:
Wherein A means that the time slot piece of node n is the subset of A group time slot,
The initial time slot index value of time slot piece that means node n, R
nMean the time slot repetition rate value of node n, each time slot index in the time slot piece can be expressed as:
Wherein the value of m is
When 26) the network initial topology formed, the A group time slot that backbone node is distributed to ordinary node can not surpass 80% of the total timeslot number of A group, and except reserved time slot, unallocated time slot is the newly-increased standby time slot of node;
3) based on the clock drift that sends shake and propagation delay protection, affect counteracting method;
The time precision of sensor node descends along with the drift of local clock, and in the beginning of sending time slots with finish the transmission conflict that time-interleaving that reserved a period of time Δ t can the offset clock drift produces causes, Δ t is by following formula is arranged:
Frame length when wherein TF is,
For sensor node local clock drift rate;
4) the cross time-slot block-distributing algorithm of service based grade weighting;
Utilize step 2) described time slot block-distributing algorithm, the node high for the grade of service distributes more time slot;
5) and as required smart synchronous synchronized algorithm thick synchronous based on aggregation node-backbone node-ordinary node classification;
51) at the network topology formation stages, aggregation node is periodically broadcasted the networking sync message, in this sync message, comprises the current time of aggregation node; Backbone node is adjusted the local zone time of oneself according to the networking sync message received, realize thick synchronous.After slightly synchronously completing, backbone node adopts CSMA/CA and random back mechanism access channel, synchronizes by bi-directional exchanging mechanism and aggregation node realization networking essence;
52) in the network operation stage, the time precision of backbone node can descend along with the drift of local clock, therefore need synchronous again, backbone node is according to the time precision class requirement, at time slot A-0 interior employing CSMA/CA and random back mechanism access channel, realize smart synchronizeing by bi-directional exchanging mechanism and aggregation node as required;
53) at the network topology formation stages, after backbone node is realized synchronizeing with aggregation node is smart, start periodically broadcast beacon, beacon comprises the information such as subnet number, time stamp, transmitting power; After ordinary node is received beacon, according to the beacon time stamp, adjust the time of oneself, realize thick synchronous; Ordinary node may be received a plurality of different backbone node beacons that come from, and ordinary node selects suitable aggregation node to send the request of networking according to the intensity that receives beacon power; Backbone node distributes the corresponding time slot piece according to the characteristic parameter (comprising dump energy, the grade of service, application number of time slots etc.) of networking requesting node for each node; Each node utilization distributes the initial time slot of time slot piece to complete with the networking of backbone node essence to synchronize;
54) in the network operation stage, the time precision of ordinary node can descend along with the drift of local clock, therefore needs synchronous again; Ordinary node is according to the time precision class requirement, as required at the initial time slot of time slot piece distribution, realizes that by bi-directional exchanging mechanism and backbone node essence synchronizes, do not need when synchronous, distribute the initial time slot of time slot piece to be used for transmitting data;
55) in the network operation stage, it is thick synchronous that newly-increased node utilizes the time frame beacon to network, and then at the B-0 time slot, realizes smart synchronizeing by bi-directional exchanging mechanism and backbone node, and the time slot allocation parameter that receives backbone node at the C-0 time slot networks;
6) based on the burst transfers of data method of public competition slot piece;
Need the node of transmission bursty data to organize time slot (except B-0) by CSMA/CA competition mechanism access channel at B;
7) the CSMA/CA algorithm kept out of the way of service based grade weighting;
Sensor node is classified according to the grade of service, and node back off time in the competition slot piece that the grade of service is high is shorter, thereby obtains higher channel access probability.
The invention has the beneficial effects as follows the weak point that can overcome existing wireless sensor network MAC agreement; In the application of solution wireless sensor network, the problems such as different QoS needs of the real-time Transmission of recurrent event perception and event-driven perception data, heterogeneous sensor node channel access fairness, heterogeneous sensor different business grade, can support simultaneously recurrent event perception and event-driven perception task for wireless sensor network technical support is provided.
Embodiment
The present invention is described in detail below in conjunction with drawings and Examples, as shown in Figure 1, 2, the present invention includes following steps:
(1) at the network topology formation stages, aggregation node is periodically broadcasted the networking sync message, in this sync message, comprises the current time of aggregation node; Backbone node is adjusted the local zone time of oneself according to the networking sync message received, realize thick synchronous.After slightly synchronously completing, backbone node adopts CSMA/CA and random back mechanism access channel, synchronizes by bi-directional exchanging mechanism and aggregation node realization networking essence.
(2) at the network topology formation stages, after backbone node is realized synchronizeing with aggregation node is smart, start periodically broadcast beacon, beacon comprises the information such as subnet number, time stamp, transmitting power; After ordinary node is received beacon, according to the beacon time stamp, adjust the time of oneself, realize thick synchronous; Ordinary node may be received a plurality of different backbone node beacons that come from, and ordinary node is selected suitable backbone node according to the intensity that receives beacon power, and adopts CSMA/CA and random back mechanism access channel to send the request of networking; Backbone node distributes the corresponding time slot piece according to the characteristic parameter (comprising dump energy, the grade of service, application number of time slots etc.) of networking requesting node for each node; Each node utilization distributes the initial time slot of time slot piece to complete with the networking of backbone node essence to synchronize.
(3) in the network operation stage, the time precision of backbone node can descend along with the drift of local clock, therefore needs synchronous again.Backbone node, according to the time precision class requirement, at time slot A-0 interior employing CSMA/CA and random back mechanism access channel, is realized smart synchronizeing by bi-directional exchanging mechanism and aggregation node as required.
(4) in the network operation stage, the time precision of ordinary node can descend along with the drift of local clock, therefore needs synchronous again.Ordinary node, according to the time precision class requirement, at the initial time slot of time slot piece distribution, is realized smart synchronizeing by bi-directional exchanging mechanism and backbone node as required.Do not need when synchronous, distribute the initial time slot of time slot piece to be used for transmitting data.
(5) in the network operation stage, it is thick synchronous that newly-increased node utilizes the time frame beacon to network, and then at the B-0 time slot, realizes smart synchronizeing by bi-directional exchanging mechanism and backbone node.
(6) in the network operation stage, if current time slots just in time belongs to a certain node, this node can utilize current time slots to send the data to affiliated backbone node.
(7) in the network operation stage, if the perception data of a certain node exceeds the setting thresholding, the data that need to will transfinite within the shortest time send to affiliated backbone node.If current time slots just in time belongs to this node, this node can utilize current time slots to send the data to affiliated backbone node; If current time slots does not belong to this node, and belong to step 24) the B group time slot of regulation, this node adopts CSMA/CA and random back mechanism access channel, sends the data to affiliated backbone node; If current time slots belongs to step 24) the C group time slot of regulation, need to wait for next time slot, if next time slot belongs to this node, this node can utilize next time slot to send the data to affiliated backbone node, otherwise wait for again a time slot, adopt CSMA/CA and random back mechanism access channel, send the data to affiliated backbone node.
(8) in the network operation stage, backbone nodes use step 24) C of regulation group time slot sends the data to aggregation node.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in scope disclosed by the invention; the variation that can expect easily or replacement, all should be encompassed in the protection range of the claims in the present invention.