Summary of the invention
The present invention has overcome the deficiencies in the prior art, a kind of wireless sensor network accumulation formula data set searching method has been proposed, this method can begin by any assigned source node in a wireless sensor network, strive for by limited message propagation, find ferret out, reduced the message transmission capacity of search data collection, can significantly improve the wireless sensor network lifetime.
Technical scheme of the present invention is: wireless sensor network accumulation formula data set searching method, the assigned source node begins arbitrarily in a wireless sensor network, by limited message propagation (propagation of search message in node is controlled near the source node in the as far as possible little scope), seek the less set of node of having stored certain data set; This method is distributed realization in each node, and the dynamic change in search procedure of searched set of node realizes a kind of search of accumulating formula, and the node to be searched collection progressively enlarges, and is all found up to the memory location of all data of searched data centralization.
Described searching method is based on the distributed propagation of message, comprises search message, ack message and research message, and in search procedure, the intermediate node that meets search condition is called the center node.
Described search message sends by generating tree (spanning) mode, and the accumulation that is used to carry out data set is searched, and search message comprises four partial contents:
1) data set that will search for;
2) transmit the last hop node sign of this message;
3) the center node identification of this message of initialization;
4) the present jumping figure that transmits of this message.
Described ack message is that clean culture sends, and the node that has been used to store searched data centralization data is reported to the center node, and ack message comprises four partial contents:
1) data set that finds;
The node identification of the data set that 2) finds;
3) next-hop node of this message sign;
4) the destination center node identification of this message.
Described research message is that multicast sends, and is used for the center node and notifies its child node to carry out following two kinds of actions:
A) stop the transmission of search message;
B) or become next stage center node and continue the transmission of new search message.
Described message comprises three partial contents:
1) sign of the next stage center of appointment;
2) data set of being responsible for searching for by next stage center node of appointment;
3) next-hop node collection.
The present invention has following beneficial effect:
1) the method is propagated search message according to generating tree (spanning) mode, and spread scope is limited near the node that sets out, has stored on the set of node of searched data set, greatly reduced participating in the node number of search, thereby significantly reduced message propagation quantity.
2) the ack transmission of news process of returning to upper level center node after new center node finds is the clean culture process, can significantly reduce transmission of news quantity.
3) center node notice leaf node stop or the process that becomes next stage center are multicast process, can significantly reduce the transmission of news amount.
4) the present invention has reduced the message transmission capacity of search data collection, can significantly improve the wireless sensor network lifetime.
Embodiment
Further specify below in conjunction with embodiment.
The present invention can begin by any assigned source node in a wireless sensor network, strive for seeking the less set of node of having stored certain data set by limited message propagation (propagation of search message in node is controlled near the source node in the as far as possible little scope).This method is distributed realization in each node, and the dynamic change in search procedure of searched set of node realizes a kind of search of accumulating formula, and the node to be searched collection progressively enlarges, and is all found up to the memory location of all data of searched data centralization.
As shown in Figure 1, the leaf node 2 in general node 1, the used network of algorithm and the transmission 3 of search message have been comprised in the network, this transmission is represented by solid arrow, has also comprised in addition and has represented ack message to return 4 to the clean culture of center node, dots among the figure.
The message based distributed propagation of the realization of this method, at first introduce the employed three class message of this method, search message, ack message, research message:
Search message: such message sends by generating tree (spanning) mode, and the accumulation that is used to carry out data set is searched.This type of message comprises 4 partial contents: the 1) data set that will search for of this message is designated as search.Q; 2) transmit the last hop node sign of this message, be designated as search.from; 3) the center node identification of this message of initialization is designated as search.fromCenter; 4) the present jumping figure that transmits of this message is designated as search.hop.
Ack message: such message is that clean culture sends, and the node that has been used to store searched data centralization data is reported to the center node.These message 3 partial contents: the data set that 1) finds is designated as ack.found; 2) find the node identification of ack.found data set, be designated as ack.source; 3) next-hop node of this message sign is designated as ack.next; 4) the destination center node identification of this message is designated as ack.toCenter
Research message: such message is that multicast sends, and is used for the center node and notifies its leaf node to carry out following two kinds of actions: a) stop the transmission of search message, b) or become next stage center node and continue the transmission of new search message.This type of message comprises 2 partial contents: the 1) sign of the next stage center of appointment is designated as research.newCenter; 2) data set of being responsible for searching for by next stage center node of appointment is designated as research.Q; 3) the next-hop node collection is designated as research.nexts
Pong message: such message is that message is jumped in clean culture 1, is used for the father node with the sign notice search message formation of oneself, so that allow father node add the route that sends this pong message to.This type of message comprises 2 partial contents: 1) send the node identification of this message, be designated as pong.from; 2) next of this message jumped the destination node sign, is designated as pong.to;
Each node maintenance has reverse routing table and forward routing table: oppositely routing table is formed on each node by pong message; The forward routing table forms in each node in the search message process again.Concrete forming process can be with reference to following distributed algorithm implementation procedure.
When initial, the reverse and forward routing table of each node all is an empty set.As Fig. 1 is example, and the method that the present invention proposes has realized that with the distributed execution on following described each node the follow node begins search data collection query={1,2,3,4,5}, progressively find the process of all data of data centralization in a kind of mode of accumulation:
(1) order is set out node as the center node, the operation of execution in step 2.
(2) if this center node is the node that sets out, a) search message of initialization then; B) make the search.from=node identification that sets out, the search.fromCenter=node identification that sets out, search.Q=query local (local stored data sets), search.hop=0; 3) if search.Q is that empty set then finishes; Otherwise enter step 4.
(3) if this node is to receive the center node that becomes after the research message that upper level center node sends, then this node carries out following operation: a) search message of initialization, b) make search.from=local node sign, search.fromCenter=local node sign, search.Q=research.Q (i.e. the search data collection that from the research message that upper level center node is received, comprises), search.hop=0; C) propagate this search message (node that receives this search message is carried out according to the operation of step 10) to neighbor node; D) operation of continuation step 4.
(4) this center node waits for that the long time of MaxHops*t1, (wherein MaxHops was these network edge two internodal maximum hop counts, t1 is that message propagation 1 is jumped spent maximum time), if no any ack message is returned in the MaxHops*t1 time, then think and search for failure, report (attention to upper level center node, if this center node itself is the then directly end search of node of setting out, return the search failed message) to the user; Otherwise, continue execution in step 5 operations.
(5) establishing the center node, the data set ack.found that comprises in all ack message of returning is carried out the set that union operation obtains is q1, if q1=search.Q then shows and found all data of data centralization, enters step 6; Otherwise enter step 7.
(6) this center node is carried out following operation: a) research message of initialization; B) make the research.Q=sky, the research.newCenter=sky; C) make the set of node that comprises in the local forward routing table of research.TOs=; D) all the leaf node multicasts to this center node send research message (the realization refer step 8 and 9 that multicast sends), thereby make its all leaf node stop transmission of news.Notice that the transmission of research message here is multicast operation (the multicast path is created in the forward routing table of each node according to last search and pong transmission of news process).
(7) this center node is carried out following operation: a) research message of initialization; B) make research.Q=search.Q q1; C) from the node that returns ack message, select the node of the maximum ack.found set of transmission (to have a plurality of as if both candidate nodes as new center node, that of selection node identification maximum), the new center node identification of selecting of note is c1, makes research.newCenter=c1; D) make the set of node that comprises in the local forward routing table of research.nexts=; E) all the leaf node multicasts to this center node send research message (refer step 8 and 9), thereby carry out according to the operation of step 3 again after making new center node (some leaf nodes) receive research message, other leaf nodes then stop transmission of news.
(8) [realization of research message multicast] any one receive that the node of research message checks at first whether oneself belongs to research.nexts, if not, then abandon this research message, otherwise, remember that the set of node that comprises in the forward routing table of oneself is p1, if p1 is that sky shows that then this message has arrived the leaf node, entering step 9 continues to carry out, otherwise, make research.nexts=q1, continue neighbours' multicast towards periphery.
(9) the leaf node of receiving research message checks whether research.newCenter equals the local node sign, if, then this leaf node is changed into new next stage center node, get back to step 3 and continue to carry out (create new search message, the data set that comprises in the research message is searched for); Otherwise, stop transmission of news.
(10) [search message is according to generating the realization that tree (spanning) mode is propagated] any one receive that the node of search message at first judges the search message of oneself whether once receiving from search.center, if then abandon this message; Otherwise this vertex ticks oneself is the leaf node, and carries out following operation: a) the hop count device search.hop in the search message is added 1 (being search.hop=search.hop+1); B) according to the content of search.fromCenter and search.from, in the reverse routing table in this locality, add a route (being used for returning ack message to the clean culture of the center of this message of initialization node in case of necessity) to search.fromCenter; C) (node of receiving this pong message adds a route that arrives the node that sends hello message in the local forward routing table of oneself to return pong message to a last hop node clean culture that sends this search message.Attention: the center node can utilize this route, and its leaf node is notified in multicast---stop the transmission of search message or become next stage center node continuing the transmission of new search message); D) this node receives that since one search message waits for the 2*search.hop*t1 time and (note, t1 is that message propagation 1 is jumped spent maximum time), if 2*search.hop*t1 did not receive research message in the time, then this node is changed into ordinary node and transmit this search message to neighbor node according to the operation continuation of step 10; Otherwise, execution in step 9; E) check whether search.Q ∩ local is empty set, if not the then also operation of continuous extra execution in step 11.
(11) the ack message unicast is returned the realization of center node, this node carries out following operation: 1) ack message of initialization, the common factor that comprises local node data set (being designated as local) and search.Q in this message makes that this data set is ack.found=search.Q ∩ local; B) make ack.toCenter=search.fromCenter, ack.source=local node sign; C) make ack.next=search the next-hop node sign of the arrival ack.toCenter that local oppositely routing table finds; D) carry out according to step 12, the node that points to ack.toCenter returns ack message, notes, the ack message is here carried out singlecast router by each node with reference to the reverse routing table of oneself and returned.
(12) node of receiving ack message checks that whether ack.next equals the local node sign, if not, then abandons this message; If, then make ack.next=search the next-hop node sign of the arrival ack.toCenter that local oppositely routing table finds, continue to transmit this message to next-hop node, arrive ack.toCenter until this message.
The present invention will " search " message propagates according to generating tree (spanning) mode, and spread scope is limited near the node that sets out, has stored on the set of node of searched data set, greatly reduced participating in the node number of search, thereby reduced message propagation quantity; New center node find the back to upper level center node to return " ack " transmission of news process be the clean culture process, can reduce transmission of news quantity; Center node notice leaf node stop or the process that becomes next stage center are multicast process, can reduce the transmission of news amount.More than 3 message transmission capacities that in wireless sensor network, greatly reduce the search data collection, therefore can improve the wireless sensor network lifetime.