Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, one objective of the present invention is to provide a method for reliably collecting data of a wireless sensor network based on a logic node, which has the advantages of improving the self-healing capability of the network, improving the reliability and robustness of the network, balancing energy consumption, and prolonging the service life of the network.
Another objective of the present invention is to provide a reliable data collection device for a wireless sensor network based on logical nodes.
In order to achieve the above object, an embodiment of the present invention provides a method for reliable data collection of a wireless sensor network based on a logical node, including the following steps: setting network level information to perform level marking on all nodes in the wireless sensor network; constructing candidate logic nodes according to the nodes marked by the levels; selecting a logic node according to the candidate logic node; and load balancing the logic nodes to collect target data.
According to the method for reliably collecting data of the wireless sensor network based on the logic nodes, disclosed by the embodiment of the invention, the logic nodes are further selected by constructing candidate logic nodes by carrying out hierarchical marking on all nodes in the wireless sensor network, so that the load balance is achieved, the aim of collecting target data is further fulfilled, invalid logic nodes and redundant logic nodes can be removed, the control overhead of the logic nodes is reduced while the nodes as many as possible have backup forwarding nodes, the self-healing capability of the network can be improved, the reliability and robustness of the network are improved, the energy consumption is balanced, and the service life of the network is prolonged.
In addition, the method for reliably collecting data of the wireless sensor network based on the logical nodes according to the above embodiments of the present invention may further have the following additional technical features:
further, in an embodiment of the present invention, the setting network hierarchy information further includes: initializing a hierarchical mark of a sink node to be 0, initializing a hierarchical mark of a sensor node to be infinite, initializing a child node set of the sink node to be empty, and initializing a parent node set and a child node set of the sensor node to be empty; enabling the sink node to broadcast the level message 0 of the sink node to surrounding nodes; marking the updating level of the node receiving the level message 0 as 1, recording the sink node into the father node set of the sink node, and returning a response to the sink node; after the sink node receives the response, the response sender is recorded into a child node set CL of the response sendersink(ii) a Causing the node with the level mark 1 to continue broadcasting its level message 1; judging whether the level mark of the node receiving the level message is 1 is larger than 2, if so, updating the level mark of the node to be 2, recording the level message sender into a parent node set of the node, returning a response to the level message sender, otherwise, continuously broadcasting the level message 2 by the node with the level mark of 2 until all the nodes in the wireless sensor network have the level marks, and using L to indicate that L indicates the level mark of all the nodes in the wireless sensor networkjRepresenting a physical node vjThe hierarchical marking of (2); when the sensor node receives the response, the response sender is recorded into the child node set.
Further, in one embodiment of the present invention, all nodes in the wireless sensor network are initialized to be non-leaf nodes and non-logical nodes; according to the recorded node father node set and the node child set, if the node vmIf the set of child nodes is empty, node vmThe is _ leaf attribute of (1) is set to true; from the bottommost non-leaf node vkStart, vkTo its parent node viSending child node set information, and ascending layer by layer; at the parent node viAll the seeds are collectedAfter the child node set information sent by the node, the parent node v is sentiComplete child node set CLiPerforming full combination of every two to obtain a candidate logical node set C _ LNi(ii) a For physical node v in candidate logical nodejAnd physical node vkChild node set CL ofjAnd child node set CLkComparing to obtain a common child node set and the number of elements; and if the number of the elements is zero, the elements are invalid logical nodes, and the invalid logical nodes are removed.
Further, in one embodiment of the invention, a logical node set LN is initializediIs an empty set; selecting the candidate logical node CLN with the largest element number valuej,kAs a logical node and updates a logical node set LNiWhen a plurality of candidate logical nodes with the largest element number exist, the candidate logical nodes formed by non-logical node members are preferentially selected; let the parent node viTo physical nodes v constituting a logical nodejAnd physical node vkSending ln _ confirm _ message to enable the physical node to set the self is _ ln attribute as true after receiving the message and record the identification of each other; updating SCLl,m=SCLl,m-SCLj,k(ii) a If SCLl,mWhen size is 0, CLNl,mIs a redundant logical node and is selected from the set of candidate logical nodes C _ LNiDeleting; updating the set of candidate logical nodes C _ LNi=C_LNi-CLNj,kUp to the set of candidate logical nodes C _ LNiIs empty.
Further, in an embodiment of the present invention, the load balancing the logical nodes to collect target data further includes:
for logical node LNA,BNode vaResidual energy of (D) is recorded as AEANode vbResidual energy of (D) is recorded as AEB(ii) a Noting the energy consumption for transmitting a single piece of data as e, node vaThe energy serving the common child node in the remaining energy is noted as LEANode vbThe energy serving the common child node in the remaining energy is noted as LEB(ii) a Node v2,v3,v4To logical node LNA,BThe upload data volume is recorded as TE2,TE3,TE4Node v1To node vaThe upload data volume is recorded as TE1Then in the logical node LNA,BMiddle node vaIs/are as follows
LEA=AEA-TE1X e, node vbLE ofB=AEB;
Updating LEA>LEBAnd TE2>TE3>TE4Then v is2Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE2E; compare LEAAnd LEBSelecting the larger of them, for LEA>LEBThen v is3Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE3E; compare LEAAnd LEBChoose the larger one, for LEA<LEBThen v is4Selection of vbUpdating LE for next hop forwarding nodeB=LEB-TE4E; the residual energy of the two physical nodes in the logic node is compared, so that the physical node with large residual energy bears the data forwarding task of the child node with large transmission overhead, and the load balance in the logic node is realized.
In order to achieve the above object, another embodiment of the present invention provides a device for collecting reliable data of a wireless sensor network based on logical nodes, including: the setting module is used for setting network hierarchy information so as to carry out hierarchy marking on all nodes in the wireless sensor network; the building module is used for building candidate logic nodes according to the nodes marked by the levels; a selection module for selecting a logical node according to the candidate logical node; and the collection module is used for carrying out load balancing on the logic nodes so as to collect target data.
According to the reliable data collection device of the wireless sensor network based on the logic nodes, disclosed by the embodiment of the invention, the logic nodes are further selected by constructing candidate logic nodes by carrying out hierarchical marking on all nodes in the wireless sensor network, so that the load balance is achieved, the aim of collecting target data is further fulfilled, invalid logic nodes and redundant logic nodes can be removed, the control overhead of the logic nodes is reduced while the nodes as many as possible have backup forwarding nodes, the self-healing capability of the network can be improved, the reliability and robustness of the network are improved, the energy consumption is balanced, and the service life of the network is prolonged.
In addition, the wireless sensor network reliable data collection device based on the logical nodes according to the above embodiment of the present invention may further have the following additional technical features:
further, in an embodiment of the present invention, the setting module further includes: the conversion unit is used for initializing the hierarchical mark of the sink node to 0, initializing the hierarchical mark of the sensor node to infinity, initializing the child node set of the sink node to be null, and initializing the father node set and the child node set of the sensor node to be null; a first broadcasting unit, configured to enable the sink node to broadcast its hierarchical message 0 to surrounding nodes; the updating unit is used for marking the updating level of the node receiving the level message 0 as 1, recording the sink node into a parent node set of the sink node, and returning a response to the sink node; a first recording unit, configured to record a response sender in a child node set CL of the sink node after the sink node receives the responsesink(ii) a A second broadcasting unit, configured to enable the node with the level flag of 1 to continue broadcasting its level message of 1; a judging unit, configured to judge whether a level flag of a node receiving the level message 1 is greater than 2, if so, update the level flag to be 2, and record a level message sender in a parent node set of the node, and return a response to the level message sender, otherwise, the node having the level flag 2 continues to broadcast the level message 2 until all nodes in the wireless sensor network have the level flag, and use L to judge whether the level flag of the node is greater than 2, where if so, the node having the level flag to be 2 continues to broadcast the level message 2 until all nodes in thejRepresenting a physical node vjThe hierarchical marking of (2); and the second recording unit is used for recording the response sender into the child node set when the sensor node receives the response.
Further, in one embodiment of the present inventionIn an embodiment, the building block is further configured to: initializing all nodes in the wireless sensor network into non-leaf nodes and non-logic nodes; according to the recorded node father node set and the node child set, if the node vmIf the set of child nodes is empty, node vmThe is _ leaf attribute of (1) is set to true; from the bottommost non-leaf node vkStart, vkTo its parent node viSending child node set information, and ascending layer by layer; at the parent node viAfter the child node set information sent by all child nodes is collected, the father node v is subjected toiComplete child node set CLiPerforming full combination of every two to obtain a candidate logical node set C _ LNi(ii) a For physical node v in candidate logical nodejAnd physical node vkChild node set CL ofjAnd child node set CLkComparing to obtain a common child node set and the number of elements; and if the number of the elements is zero, the elements are invalid logical nodes, and the invalid logical nodes are removed.
Further, in an embodiment of the present invention, the selecting module is further configured to: initializing a logical node set LNiIs an empty set; selecting the candidate logical node CLN with the largest element number valuej,kAs a logical node and updates a logical node set LNiWhen a plurality of candidate logical nodes with the largest element number exist, the candidate logical nodes formed by non-logical node members are preferentially selected; let the parent node viTo physical nodes v constituting a logical nodejAnd physical node vkSending ln _ confirm _ message to enable the physical node to set the self is _ ln attribute as true after receiving the message and record the identification of each other; updating SCLl,m=SCLl,m-SCLj,k(ii) a If SCLl,mWhen size is 0, CLNl,mIs a redundant logical node and is selected from the set of candidate logical nodes C _ LNiDeleting; updating the set of candidate logical nodes C _ LNi=C_LNi-CLNj,kUp to the set of candidate logical nodes C _ LNiIs empty.
Further, in an embodiment of the present invention, the collecting module is further configured to:
for logical node LNA,BNode vaResidual energy of (D) is recorded as AEANode vbResidual energy of (D) is recorded as AEB(ii) a Noting the energy consumption for transmitting a single piece of data as e, node vaThe energy serving the common child node in the remaining energy is noted as LEANode vbThe energy serving the common child node in the remaining energy is noted as LEB(ii) a Node v2,v3,v4To logical node LNA,BThe upload data volume is recorded as TE2,TE3,TE4Node v1To node vaThe upload data volume is recorded as TE1Then in the logical node LNA,BMiddle node vaIs/are as follows
LEA=AEA-TE1X e, node vbLE ofB=AEB;
Updating LEA>LEBAnd TE2>TE3>TE4Then v is2Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE2E; compare LEAAnd LEBSelecting the larger of them, for LEA>LEBThen v is3Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE3E; compare LEAAnd LEBChoose the larger one, for LEA<LEBThen v is4Selection of vbUpdating LE for next hop forwarding nodeB=LEB-TE4E; the residual energy of the two physical nodes in the logic node is compared, so that the physical node with large residual energy bears the data forwarding task of the child node with large transmission overhead, and the load balance in the logic node is realized.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
The following describes a method and an apparatus for reliable data collection of a wireless sensor network based on logical nodes according to an embodiment of the present invention with reference to the accompanying drawings, and first, a method for reliable data collection of a wireless sensor network based on logical nodes according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for reliable data collection of a wireless sensor network based on logical nodes according to an embodiment of the present invention.
As shown in fig. 1, the method for reliable data collection of a logic node-based wireless sensor network comprises the following steps:
before this, the meaning of each node is defined, specifically:
logical Node (LN): in the network routing process, an abstract node formed by n (n is more than or equal to 2) same-layer physical nodes with common father nodes and common child nodes is called a logic node. The method is discussed with n as 2 and using LNj,kRepresentation by physical node vjAnd vkConstituent logical nodes, and physical node vjAnd vkAt the same level.
Candidate Logical Node (CLN): nodes obtained by performing pairwise full-combination calculation on all child nodes by a parent node are called candidate logical nodes. Node viIs designated as C _ LNi(ii) a When the parent node viAnd if t child nodes exist below, the number of elements in the candidate logical node set is t (t-1)/2.
Invalid Logical Node (ILN): when the physical nodes forming the candidate logical node do not have the common child node, the candidate logical node is called an invalid logical node.
Redundant Logical Node (RLN): when the child node of the candidate logical node is covered by the selected logical node, the candidate logical node is called a redundant logical node.
In step S101, network hierarchy information is set to hierarchically label all nodes within the wireless sensor network.
In an embodiment of the invention, firstly, in the construction of the wireless sensor network, the hierarchical mark of the sink node is initialized to 0, and the hierarchical mark of the sensor node is initialized to infinity; initializing a child node set of the sink node to be empty, and initializing a father node set and a child node set of the sensor node to be empty;
further, the sink node broadcasts the level message 0 to the surrounding nodes;
further, the node receiving the layer message 0 updates the layer mark thereof to be 1, records the sink node into the father node set thereof, and returns a response to the sink node;
further, after the sink node receives the response, the response sender is recorded in the child node set CL of the sink nodesink;
Further, the node marked with level 1 continues to broadcast its level message 1;
further, the node receiving the level message 1 judges whether the level mark of the node is larger than 2, if so, the level mark is updated to be 2, the level message sender is recorded into the parent node set of the node, and a response is returned to the level message sender;
further, when the sensor node receives the response, the response sender is recorded into the child node set of the sensor node;
further, the node labeled level 2 continues to broadcast its level message 2. And so on until all nodes in the wireless sensor network have hierarchical marks, which are marked by LjRepresenting a physical node vjThe hierarchical marking of (2).
In step S102, candidate logical nodes are constructed from the hierarchically labeled nodes.
As shown in fig. 2, in one embodiment of the present invention, first, nodes in the wireless sensor network are initialized to be non-leaf nodes and non-logical nodes, i.e., the is _ leaf attribute and the is _ ln attribute are default to false.
Further, according to the node father node set and the node son node set recorded in the step one, if the node vmIf the set of child nodes is empty, node vmThe is _ leaf attribute of (1) is set to true.
Further, from the bottommost non-leaf node vk(is_leaf=false,Lk>0) Start, vkTo its parent node viAnd sending child node set information ch _ table _ message layer by layer upwards.
Further, a parent node viAfter the ch _ table _ message sent by all child nodes is collected, v is processediComplete child node set CLiPerforming full combination of every two to obtain a candidate logic node set C _ LNiIf the number of the candidate logical nodes in the candidate logical node set is CLi_size(CLi_size-1)/2。
Further, for two physical nodes v in the candidate logical nodejAnd vkChild node set CL ofjAnd CLkComparing, recording their common child node set SCLj,k=CLj∩CLkAnd the number of elements SCLj,k_size。
Further, if SCLj,kIf _ size is 0, the candidate logical node is an invalid logical node, and the combination is directly removed, i.e., the invalid logical node is removed.
In step S103, a logical node is selected according to the candidate logical node.
As shown in FIG. 3, in one embodiment of the invention, first, a logical node set LN is initializediIs an empty set.
Further, SCL is first selectedj,kCandidate logical node CLN with largest size valuej,kAs a logical node, update LNi=LNi∪{CLNj,k}; when there are multiple SCLsj,kAnd the candidate logical node with the largest size value is selected preferentially.
Further, a parent node viTo two physical nodes v constituting a logical nodejAnd vkAnd sending ln _ confirm _ message, setting the self is _ ln attribute as true after the physical node receives the message, and recording the identifications of the self is _ ln attribute and the self is _ ln attribute as true.
Further, due to SCLj,kThe node in (1) is covered by the selected logic node, and other candidate logic nodes CLNl,mDeleting self-common child node set SCLl,mIn the SCLj,kElement of (1), i.e. updating the SCLl,m=SCLl,m-SCLj,k(ii) a If SCLl,mWhen size is 0, CLNl,mFor redundant logical nodes, from a set of candidate logical nodes C _ LNiDeletion in, i.e. C _ LNi=C_LNi-CLNl,m。
Further, a candidate logical node set C _ LN is updatedi=C_LNi-CLNj,k. This process is repeated until the candidate logical node set C _ LNiEmpty, when the common child nodes have all been covered, logical node set LNiAll selected logical nodes are recorded.
In step S104, the logical nodes are load balanced to collect target data.
In one embodiment of the invention, first, the logical node LN is as shown in FIG. 4A,BFor example, node vaResidual energy of (D) is recorded as AEANode vbResidual energy of (D) is recorded as AEB. At the same time, let the energy consumption for transmitting a single unit of data be recorded as e, node vaThe energy serving the common child node in the remaining energy is noted as LEANode vbThe energy serving the common child node in the remaining energy is noted as LEB. Node v2,v3,v4To logical node LNA,BThe upload data volume is recorded as TE2,TE3,TE4Node v1To node vaThe upload data volume is recorded as TE1Then in the logical node LNA,BMiddle node vaLE ofA=AEA-TE1X e, node vbLE ofB=AEB。
Further, let LE be assumedA>LEBAnd TE2>TE3>TE4V is then2Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE2×e。
Further, LE is then comparedAAnd LEBSelecting the larger of them, here still LEA>LEBFor example, then v3Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE3×e。
Further, LE is comparedAAnd LEBThe larger of which is selected, here by LEA<LEBFor example, then v4Selection of vbUpdating LE for next hop forwarding nodeB=LEB-TE4And (x e). By comparing the residual energy of the two physical nodes in the logic node, the physical node with large residual energy undertakes the data forwarding task of the child node with large transmission overhead, thereby realizing the load balance in the logic node.
With reference to fig. 5 and fig. 6, the construction and optimization process of the logical node is described in detail, and the is _ leaf and is _ ln attributes of all nodes are initialized to false. FIG. 6(a) is a network transmission hierarchy diagram in which node v1、v2、v3、v4、v5、v6The subsets are null, so all are leaf nodes, is _ leaf is set to true, and logical nodes cannot be formed. And CLA={v1、v2、v3、v4},CLB={v2、v3、v4、v5、v6},CLC={v4、v5、v6},CLD={v5、v6From vA、vB、vC、vDThe logical node is started to be constructed. Node vA、vB、vC、vDTo its parent node v0Transmitting child node set information ch _ table _ message, node v0After ch _ table _ messages sent by all child nodes are received, pairwise combination is carried out on the 4 child nodes to obtain 6 candidate logical nodes, namely a node v0Candidate logical node set C _ LN of0={CLNA,B,CLNA,C,CLNA,D,CLNB,C,CLNB,D,CLNC,DAs shown in fig. 6 (b).
Next, C _ LN is compared and stored
0And the child node set of the inner candidate logical node and the number of elements of the inner candidate logical node. SCL
A,B={v
2、v
3、v
4},SCL
A,B_size=3;SCL
A,C={v
4},SCL
A,C_size=1;
SCL
A,D_size=0;SCL
B,C={v
4、v
5、v
6},SCL
B,C_size=3;SCL
B,D={v
5、v
6},SCL
B,D_size=2;SCL
C,D={v
5、v
6},SCL
C,DThe dashed line in fig. 6(b) indicates a possible path related to the logical node. Judging the number of elements in the child node set of the candidate logical node because of the
SCL A,D0, so CLN
A,DDeleting the logic node for the invalid logic node to obtain C _ LN
0={CLN
A,B,CLN
A,C,CLN
B,C,CLN
B,D,CLN
C,D}。SCL
A,BSize and SCL
B,CThe values of _ size are all 3, and are all the largest of the candidate logical nodes, CLN
A,BAnd CLN
B,CMay be selected as a logical node. The CLN is selected here
A,BBeing logical nodes, LNs
0={CLN
A,B},C_LN
0={CLN
A,C,CLN
B,C,CLN
B,D,CLN
C,D}. Node v
0To node v
A、v
BSending ln _ confirm _ message, v
AAnd v
BUpon receiving the message, the attribute is _ ln ═ true is set.
Due to the SCL
A,B={v
2、v
3、v
4And updating the child node sets of other candidate logical nodes and the number of elements thereof,
SCL
A,C_size=0;SCL
B,C={v
5、v
6},SCL
B,C_size=2;SCL
B,D={v
5、v
6},SCL
B,D_size=2;SCL
C,D={v
5、v
6},SCL
C,Dthe result graph is shown in fig. 6 (c). The redundant logic node CLN is also removed first
A,CAt this time, C _ LN
0={CLN
B,C,CLN
B,D,CLN
C,DThe number of elements in the child node set of 3 candidate logical nodes is 2, but the node v
BIs already a logical node CLN
A,BSo that the CLN is selected
C,DBeing logical nodes, LNs
0={CLN
A,B,CLN
C,D},C_LN
0={CLN
B,C,CLN
B,D},SCL
C,D={v
5、v
6And the updating is continued to be carried out,
SCL
B,C_size=0;
SCL B,D0 is formed; the redundant logic node is CLN
B,CAnd CLN
B,DDeleting redundant logical nodes to obtain
To this end, the logical node has been determined, i.e. LN
0={CLN
A,B,CLN
C,DAnd the final result is shown in fig. 6 (d).
According to the method for reliably collecting data of the wireless sensor network based on the logic nodes, disclosed by the embodiment of the invention, the logic nodes are further selected by constructing candidate logic nodes by carrying out hierarchical marking on all nodes in the wireless sensor network, so that the load balance is achieved, the aim of collecting target data is further fulfilled, invalid logic nodes and redundant logic nodes can be removed, the control overhead of the logic nodes is reduced while the nodes as many as possible have backup forwarding nodes, the self-healing capability of the network can be improved, the reliability and robustness of the network are improved, the energy consumption is balanced, and the service life of the network is prolonged.
Next, a reliable data collection device of a wireless sensor network based on logical nodes according to an embodiment of the present invention is described with reference to the accompanying drawings.
Fig. 7 is a schematic structural diagram of a reliable data collection device of a wireless sensor network based on logical nodes according to an embodiment of the present invention.
As shown in fig. 7, the device 10 for collecting reliable data of a wireless sensor network based on logical nodes includes: a setup module 100, a build module 200, a selection module 300, and a collection module 400.
The setting module 100 is configured to set network level information to perform level marking on all nodes in the wireless sensor network. The construction module 200 is configured to construct candidate logical nodes according to the nodes after the hierarchical marking. The selection module 300 is configured to select a logical node according to the candidate logical node. The collection module 400 is used to load balance the logical nodes to collect the target data. The device has the advantages of improving the self-healing capability of the network, improving the reliability and robustness of the network, balancing energy consumption and prolonging the service life of the network.
Further, in an embodiment of the present invention, the setting module 100 further includes: the conversion unit is used for initializing the hierarchical mark of the sink node to 0, initializing the hierarchical mark of the sensor node to infinity, initializing the child node set of the sink node to be null, and initializing the father node set and the child node set of the sensor node to be null; a first broadcasting unit, configured to enable a sink node to broadcast its hierarchical message 0 to surrounding nodes; the updating unit is used for marking the updating level of the node receiving the level message 0 as 1, recording the sink node into the father node set of the node, and returning a response to the sink node; a first recording unit, configured to record the sender of the response into the child node set CL of the sink node after the sink node receives the responsesink(ii) a A second broadcasting unit, configured to enable the node with the level flag of 1 to continue broadcasting its level message of 1; a judging unit, configured to judge whether the level flag of the node receiving the level message 1 is greater than 2, if so, update the level flag of the node, and record the level message sender in its parent node set, and return a response to the level message sender, otherwise, the node having the level flag of 2 continues to broadcast the level message 2 until all nodes in the wireless sensor network have the level flag, and L is used for indicating that all nodes in the wireless sensor network have the level flagjRepresenting a physical node vjThe hierarchical marking of (2); and the second recording unit is used for recording the response sender into the child node set when the sensor node receives the response.
Further, in an embodiment of the present invention, the building module 200 is further configured to: initializing all nodes in a wireless sensor network to be non-leaf nodes and non-logic nodes(ii) a According to the recorded node father node set and the node son node set, if the node vmIf the set of child nodes is empty, node vmThe is _ leaf attribute of (1) is set to true; from the bottommost non-leaf node vkStart, vkTo its parent node viSending child node set information, and ascending layer by layer; at parent node viAfter child node set information sent by all child nodes is collected, father nodes v are subjected to information processingiComplete child node set CLiPerforming full combination of every two to obtain a candidate logical node set C _ LNi(ii) a For physical node v in candidate logical nodejAnd physical node vkChild node set CL ofjAnd child node set CLkComparing to obtain a common child node set and the number of elements; if the number of the elements is zero, the elements are invalid logic nodes, and the invalid logic nodes are removed.
Further, in an embodiment of the present invention, the selecting module 300 is further configured to: initializing a logical node set LNiIs an empty set; selecting the candidate logical node CLN with the largest element number valuej,kAs a logical node and updates a logical node set LNiWhen a plurality of candidate logical nodes with the largest element number exist, the candidate logical nodes formed by non-logical node members are preferentially selected; let the parent node viTo physical nodes v constituting a logical nodejAnd physical node vkSending ln _ confirm _ message to enable the physical node to set the self is _ ln attribute as true after receiving the message and record the identification of each other; updating SCLl,m=SCLl,m-SCLj,k(ii) a If SCLl,mWhen size is 0, CLNl,mIs a redundant logical node and is selected from a candidate logical node set C _ LNiDeleting; updating candidate set of logical nodes C _ LNi=C_LNi-CLNj,kUp to candidate logical node set C _ LNiIs empty.
Further, in an embodiment of the present invention, the collecting module 400 is further configured to:
for logical node LNA,BNode vaResidual energy of (D) is recorded as AEANode vbIs left overResidual energy is recorded as AEB(ii) a Noting the energy consumption for transmitting a single piece of data as e, node vaThe energy serving the common child node in the remaining energy is noted as LEANode vbThe energy serving the common child node in the remaining energy is noted as LEB(ii) a Node v2,v3,v4To logical node LNA,BThe upload data volume is recorded as TE2,TE3,TE4Node v1To node vaThe upload data volume is recorded as TE1Then in the logical node LNA,BMiddle node vaIs/are as follows
LEA=AEA-TE1X e, node vbLE ofB=AEB;
Updating LEA>LEBAnd TE2>TE3>TE4Then v is2Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE2E; compare LEAAnd LEBSelecting the larger of them, for LEA>LEBThen v is3Selection of vaUpdating LE for next hop forwarding nodeA=LEA-TE3E; compare LEAAnd LEBChoose the larger one, for LEA<LEBThen v is4Selection of vbUpdating LE for next hop forwarding nodeB=LEB-TE4E; the residual energy of the two physical nodes in the logic node is compared, so that the physical node with large residual energy bears the data forwarding task of the child node with large transmission overhead, and the load balance in the logic node is realized.
It should be noted that the foregoing explanation on the embodiment of the method for collecting reliable data of a wireless sensor network based on a logic node is also applicable to the device for collecting reliable data of a wireless sensor network based on a logic node in this embodiment, and is not repeated here.
According to the reliable data collection device of the wireless sensor network based on the logic nodes, all nodes in the wireless sensor network are subjected to hierarchical marking to construct candidate logic nodes, and the logic nodes are further selected, so that load balance is achieved, the purpose of collecting target data is further completed, invalid logic nodes and redundant logic nodes can be removed, the control overhead of the logic nodes is reduced while the nodes as many as possible have backup forwarding nodes, the self-healing capability of the network can be improved, the reliability and robustness of the network are improved, the energy consumption is balanced, and the service life of the network is prolonged.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.