Embodiment
See Fig. 1, be the method flow diagram of a kind of sensor networking that the embodiment of the present invention provides, comprise:
101: obtain the short address of network node and the station location marker of father node.
64 Bits Expanding unique identifier EUI-64 one_to_one corresponding of short address and network node, by network coordinator, also referred to as gateway, unified management and distribution can be the prime number of network node described in unique identification.
Network coordinator can safeguard an address pool, comprising all unappropriated short addresses.
Network node can pass through Neighbor Discovery Protocol, and obtain the nodal information of at least one neighbor node in network, described nodal information comprises the EUI-64 of described neighbor node, short address, station location marker and node type; Described node type can be network coordinator, router or end-apparatus part etc.
Described network node records the nodal information of at least one neighbor node described in neighbor information table, and described neighbor information table comprises described nodal information and neighborhood; Described neighborhood can be father and mother (parent) or child (children) etc.Such as shown in table 1:
Table 1 neighbor information table
EUI-64 |
Short address |
Node type |
Station location marker |
Neighborhood |
… |
|
|
|
|
|
|
|
|
|
|
|
|
Nodename and territory network mark knowledge (PAN ID) etc. can also be comprised in described neighbor information table.Described nodename can configure according to nodal function, and such as a node is responsible for detecting kitchen temperature, then this nodename is configured to kitchen temperature.
Described network node selects described neighbor information table interior joint type to be that a neighbor node of network coordinator or router is as father node.Described network node can to described father node sending node route requests message, when described father node allows described network node by oneself access network, described father node upgrades the neighborhood of network node described in its neighbor information table for child children, and responds advertising of route message to described network node; After described network node receives described advertising of route message, upgrade the neighborhood of father node described in described neighbor information table for father and mother parent.
Described network node according to described neighbor information table, can obtain the station location marker of described father node.Wherein, the station location marker of network coordinator can be the short address of network coordinator, the station location marker of other nodes, is the station location marker of the father node of this node and the product of the short address of this node self.
Described network node can send Address requests message, to network coordinator request dispatching short address, comprises the EUI-64 of described network node in described Address requests message.Described network node can send described Address requests message to described father node, is transmitted to network coordinator by described father node; Described network node can also send described Address requests message directly to network coordinator.
Network coordinator, according to the EUI-64 of described network node, is described network node distribution short address.Network coordinator can respond address assignment message, comprises described short address, such as 13 in described address assignment message.
Network coordinator can also preserve a network node information table, comprising the EUI-64 of network node and the corresponding relation of short address.
102: the station location marker generating described network node according to the short address of described network node and the station location marker of father node.
Described network node can using the station location marker of the product of the station location marker of described short address and described father node as described network node.The short address of such as network node is 13, and the station location marker of father node is 2*5, then the station location marker that network node generates is 2*5*13.
103: send position logon message, register the station location marker of described network node to network coordinator.
Described network node sends position logon message, to the station location marker of network coordinator registration oneself, comprises the station location marker of described network node in the logon message of described position.
Network coordinator preserves the station location marker of described network node after receiving described position logon message.
The title of described network node can also be comprised in the logon message of described position.Network coordinator can maintenance position information table, and described positional information table comprises the corresponding relation of the Name & Location mark of network node, such as kitchen temperature correspondence position mark 2*5*13.Can be understood as, described network coordinator provides the function of similar name server (Domain Name Server is called for short DNS).
104: receive the location confirmation message from described network coordinator.
Network coordinator responds location confirmation message to described network node.Described network node receives described location confirmation message, completes the process adding network.
When described network node there occurs movement, when moving to target father node from current parent, described network node can perform step 101 ~ 104 to rejoin network.
Optionally, can arrange a time cycle, within this time cycle, the EUI-64 of network node and short address bind, when network node is moved or the short time leaves, without the need to again obtaining short address by network coordinator.
For example, as shown in Figure 2, be the topological schematic diagram of sensor network in the embodiment of the present invention, wherein, the short address of network coordinator is configured to 2, and station location marker is also configured to 2; Wherein, node 6, its EUI-64 is EUI-64-6, and node type is end-apparatus part, and name is called bathroom humidity, is to add this network of network node.According to the embodiment of the present invention, the process that node 6 adds network is as follows:
First node 6 is by Neighbor Discovery Protocol, and obtain neighbor node, the i.e. nodal information of node 2 and node 5, the EUI-64 of its interior joint 2 is EUI-64-2, and the EUI-64 of node 5 is EUI-64-5; And in the neighbor information table of self, record the nodal information of node 2 and node 5; Starting stage, the neighborhood in neighbor information table is empty.As follows:
EUI-64 |
Short address |
Node type |
Station location marker |
Neighborhood |
… |
EUI-64-2 |
5 |
Router |
2*5 |
|
|
EUI-64-5 |
13 |
End-apparatus part |
2*5*13 |
|
|
Equally, node 2 can, by the nodal information of node 6, be saved in the neighbor information table of self; The nodal information of node 6 also can be saved in the neighbor information table of self by node 5.
Node 6 selects node type to be the neighbor node of router, and namely short address is that the node 2 of 5 is as father node.
Then, node 6 sends route requests message to node 2, and after node 2 receives described route requests message, if allow node 6 to add network by oneself, node 2 upgrades the neighborhood of the neighbor information table interior joint 6 of self for child children; And respond advertising of route message to node 6, after node 6 receives described advertising of route message, upgrade father node in local neighbor information table, namely the neighborhood of node 2 is father and mother parent.
Then, node 6 inquires about self neighbor information table, and to father node, namely node 2 sends address registration message, wherein comprises EUI-64-6.After node 2 receives described address registration message, because oneself is not network coordinator, the neighbours inquiring about self transmit, and forward described address registration message to network coordinator.After network coordinator receives described address registration message, be that node 6 distributes short address 17 according to EUI-64-6; And respond Address Confirmation message, wherein comprise short address 17; Described Address Confirmation message is through father node, and namely node 2 is transmitted to node 6, and node 6 gets self short address 17.
Then node 6 is according to neighbor information table, and obtain the station location marker 2*5 of father node, be multiplied with the station location marker 2*5 of father node the short address 17 of self, the product 2*5*17 obtained is the station location marker of node 6.
Then, node 6 sends position logon message to network coordinator, wherein comprises the Name & Location mark 2*5*17 of node 6; After network coordinator receives described position logon message, preserve the corresponding relation of the Name & Location mark 2*5*17 of node 6, and respond location confirmation message.
After node 6 receives location confirmation message, complete the process adding network.
See Fig. 3, be the method flow diagram of a kind of sensor network route that the embodiment of the present invention provides, comprise:
301: network node receives data message, obtain the destination locations mark of described data message;
302: when described destination locations mark is different from the station location marker of described network node, described network node forwards described data message according to described destination locations mark.
When described destination locations mark is different from the station location marker of described network node, described network node judges whether the station location marker of self can divide exactly described destination locations mark;
When the aliquant described destination locations mark of the station location marker of described network node, the local neighbor information table stored of described network node inquiry, in described neighbor information table, neighborhood is that the neighbor node of father and mother parent forwards described data message;
When the station location marker of described network node can divide exactly described destination locations mark, the local neighbor information table stored of described network node inquiry, in described neighbor information table, neighborhood is child children, and the neighbor node that station location marker can divide exactly described destination locations mark forwards described data message.
When described network node needs that other nodes send datagram in network, described network node can according to the name acquiring of destination node the station location marker of destination node.
Described network node can inquire about the local neighbor information table stored, when described destination node is not in the neighbor information table that this locality stores,
The described network equipment can send position enquiring message to network coordinator, and receives the position response message that network coordinator responds described position enquiring message, obtains the station location marker of described destination node.Comprise the title of described destination node in described position enquiring message, in the response message of described position, comprise the station location marker of described destination node.Can be understood as, described network coordinator provides the function of similar DNS.
Described network node generates the second data message, and the destination locations of described second data message is designated the station location marker of described destination node;
When the station location marker of the aliquant described destination node of station location marker of described network node, the local neighbor information table stored of described network node inquiry, the neighbor node being father and mother parent to neighborhood forwards described second data message;
When the station location marker of described network node can divide exactly the station location marker of described destination node, the local neighbor information table stored of described network node inquiry, be child children to neighborhood, and the neighbor node that station location marker can divide exactly the station location marker of described destination node forward described second data message.
For example, as shown in Figure 2, after node 6 adds network, need to send datagram to node 4.
First node 6 is according to the station location marker of the name acquiring node 4 of node 4; Node 6 generates data message, and the destination locations of described data message is designated the station location marker 2*7*11 of node 4; Node 6 judges whether the station location marker 2*5*17 of self can divide exactly described destination locations mark 2*7*11; When the station location marker of the aliquant described destination node of local position mark, node 6 inquires about self neighbor information table, and be the neighbor node of father and mother parent to neighborhood, namely node 2 forwards described data message.
Node 2 receives described data message, confirms that the destination locations mark of described data message is different from the station location marker of self; Node 2 judges whether the station location marker of self can divide exactly described destination locations mark; When the aliquant described destination locations mark of self station location marker, node 2 inquires about self neighbor information table, and be the neighbor node of father and mother parent to neighborhood, namely network coordinator forwards described data message.
After network coordinator receives described data message, confirm that the destination locations mark of described data message is different from the station location marker of self; Network coordinator judges whether the station location marker of self can divide exactly described destination locations mark; When the station location marker of self can divide exactly described destination locations mark, the neighbor information table of network coordinator inquiry self, be child children to neighborhood, and station location marker can divide exactly the neighbor node of described destination locations mark, namely node 3 forwards described data message.
After node 3 receives described data message, confirm that the destination locations mark of described data message is different from the station location marker of self; Node 3 judges whether the station location marker of self can divide exactly described destination locations mark; When the station location marker of self can divide exactly described destination locations mark, node 3 inquires about self neighbor information table, be child children to neighborhood, and station location marker can divide exactly the neighbor node of described destination locations mark, namely node 4 forwards described data message.
After node 4 receives described data message, confirm that the destination locations mark of described data message is identical with the station location marker of self, routing procedure terminates.Node 4 processes described data message.
See Fig. 4, be the block diagram of a kind of network node that the embodiment of the present invention provides, for realizing the method shown in Fig. 1 of the present invention.Described network node comprises acquiring unit 401, generation unit 402, transmitter 403 and receiver 404.Wherein:
Described acquiring unit 401, for the station location marker of the short address and father node that obtain described network node;
Described generation unit 402, for generating the station location marker of described network node according to the station location marker of described short address and described father node; Described transmitter 403, for sending position logon message, registers the station location marker of described network node to network coordinator;
Described receiver 404, for receiving the location confirmation message from described network coordinator.
64 Bits Expanding unique identifier EUI-64 one_to_one corresponding of described short address and described network node, by network coordinator, also referred to as gateway, unified management and distribution can be the prime number of network node described in unique identification.
Described acquiring unit 401 is also for passing through Neighbor Discovery Protocol, and obtain the nodal information of at least one neighbor node of described network node, described nodal information comprises EUI-64, short address, station location marker and node type; Described node type can be network coordinator, router or end-apparatus part etc.
Described network node can also comprise:
Record cell, for the nodal information of at least one neighbor node described of record in neighbor information table.
Selected cell is that a neighbor node of network coordinator or router is as father node for selecting described neighbor information table interior joint type.
Described acquiring unit 401, specifically for according to described neighbor information table, obtains the station location marker of described father node.Described station location marker can be expressed as the product of prime number, such as 2*5.
Described transmitter 403, also can be used for described father node sending node route requests message, upgrades the neighborhood of node described in self neighbor information table for child children to make described father node.
Described receiver 404, also for receiving the advertising of route message that described father node is responded.
Described network node can also comprise:
Updating block, for upgrading described neighbor information table.
Described updating block, specifically for according to described advertising of route message, upgrades the neighborhood of father node described in described neighbor information table for father and mother parent.
Described transmitter 403, also can be used for sending Address requests message, to network coordinator request dispatching short address; The EUI-64 of described network node is comprised in described Address requests message.
Network coordinator responds address assignment message to described network node, comprises described short address in described address assignment message; Described receiver 404 is also for receiving described address assignment message; Described acquiring unit 401, specifically for according to described address assignment message, obtains described short address.
Described generation unit 402 is specifically for being multiplied the station location marker of described short address with described father node, and the product obtained is as the station location marker of described network node.The short address of such as network node is 13, and the station location marker of father node is 2*5, then the station location marker that network node generates is 2*5*13.
See Fig. 5, be the block diagram of the another kind of network node that the embodiment of the present invention provides, described network node, for realizing the method shown in Fig. 3, comprises receiver 501, acquiring unit 502, judging unit 503 and transmitter 504.Wherein:
Described receiver 501, for receiving data message;
Described acquiring unit 502, for obtaining the destination locations mark of described data message;
Whether described judging unit 503 is identical with the station location marker of described network node for judging described destination locations mark;
Described transmitter 504, for when the station location marker of described destination node is different from the station location marker of described network node, forwards described data message according to described destination locations mark.
Described judging unit 503, also for when described destination locations mark is different from the station location marker of described network node, judges whether the station location marker of described network node can divide exactly the station location marker of described object.
Described acquiring unit 502, also for when the aliquant described destination locations of station location marker of described network node identifies, obtaining neighborhood in the neighbor information table of described network node is the nodal information of the neighbor node of father and mother parent; Correspondingly, described transmitter 504 is specifically for being that the neighbor node of father and mother parent forwards described data message to described neighborhood.
Described acquiring unit 502, time also for can divide exactly described destination locations mark when the station location marker of described network node, obtain neighborhood in the neighbor information table of described network node and be child children and station location marker can divide exactly the nodal information of neighbor node of described destination locations mark; Correspondingly, described transmitter 504 specifically for be child children to described neighborhood and station location marker can divide exactly described destination locations mark neighbor node forward described data message.
When in network, other nodes send datagram described network node needs, described network node can inquire about self neighbor information table, when in the neighbor information table of destination node not at self, described network node can inquire about the station location marker of described destination node to network coordinator.Can be understood as, described network coordinator provides the function of similar DNS.
Described transmitter 504 also for sending position enquiring message to network coordinator, comprises the title of described destination node in described position enquiring message.
The position response message of described position enquiring message also responded by described receiver 501 for receiving network coordinator, comprise the station location marker of described destination node in the response message of described position.
See Fig. 6, be a kind of sensor network system block diagram that the embodiment of the present invention provides, described network packet includes network node 601 and network coordinator 602.Wherein:
Described network node 601, for the station location marker of the short address and father node that obtain self, and according to the short address of self and the station location marker of described father node, generates the station location marker of self; Also for sending position logon message, register the station location marker of self to described network coordinator 602, and receive the location confirmation message from described network coordinator 602;
Described network coordinator 602, for receiving described position logon message, and sends described location confirmation message.
64 Bits Expanding unique identifier EUI-64 one_to_one corresponding of described short address and described network node 601, by described network coordinator 602, also referred to as gateway, unified management and distribution, can network node in sensor network described in unique identification, described short address is prime number.
Described network coordinator 602 can safeguard an address pool, comprising all unappropriated short addresses.
Described father node can be described network coordinator 602.
Described network node 601 also for by Neighbor Discovery Protocol, obtains the nodal information of at least one neighbor node in described network, and in the neighbor information table of self, record the nodal information of at least one neighbor node described.
Described network node 601 is also for selecting described neighbor information table interior joint type to be that a neighbor node of network coordinator or router is as father node, to described father node sending node route requests message, upgrade the neighborhood of network node described in its neighbor information table for child children to make described father node; And receive the advertising of route message that described father node responds, upgrade the neighborhood of father node described in self neighbor information table for father and mother parent.
Described network node 601 according to described neighbor information table, can obtain the station location marker of described father node.Described station location marker can be expressed as the product of prime number, such as 2*5.
Described network node 601, also for sending Address requests message to described network coordinator 602, comprises the EUI-64 of described network node 601 in described Address requests message.
Described network coordinator 602 receives described Address requests message, according to the EUI-64 of described network node 601, for described network node 601 distributes short address, and responds address assignment message, comprises described short address, such as 13 in described address assignment message.
Described network coordinator 602 can preserve a network node information table, comprising the EUI-64 of network node and the corresponding relation of short address.
Described network node 601 specifically for the product of the station location marker using described short address and described father node as self station location marker described.The short address of such as network node is 13, and the station location marker of father node is 2*5, then the station location marker that network node generates is 2*5*13.
Described network node 601, also for sending position logon message, registers the station location marker of self to described network coordinator 602; The station location marker of described network node is comprised in the logon message of described position.
Described network coordinator 602 preserves the station location marker of described network node after receiving described position logon message, and responds location confirmation message to described network node 601.
Described network coordinator 602 can maintenance position information table, and described positional information table comprises the corresponding relation of the Name & Location mark of network node, such as kitchen temperature correspondence position mark 2*5*13.Can be understood as, described network coordinator provides the function of similar DNS.
Described network node 601, also for receiving data message, obtains the destination locations mark of described data message; When described destination locations mark is different from the station location marker of self, forward described data message according to described destination locations mark.
When described destination locations mark is different from the station location marker of described network node 601, described network node 601 is also for judging whether the station location marker of self can divide exactly described destination locations mark;
When the aliquant described destination locations mark of the station location marker of described network node 601, described network node 601 inquires about self neighbor information table, and the neighbor node being father and mother parent to neighborhood forwards described data message;
When the station location marker of described network node 601 can divide exactly described destination locations mark, described network node 601 inquires about self neighbor information table, be child children to neighborhood, and the neighbor node that station location marker can divide exactly described destination locations mark forward described data message.
As shown in Figure 7, described network can also comprise other network nodes 603; Other network nodes 603 described can be neighborhoods with described network node 601, may not be neighborhood.
When described network node 601 needs to send datagram to other network nodes 603 described, described network node 601 can according to the name acquiring of other network nodes 603 described the station location marker of other network nodes 603.
Described network node first can inquire about self neighbor information table, when in the neighbor information table of other network nodes 603 described not at self, the described network equipment 601 is also for sending position enquiring message to described network coordinator 602, and receive the position response message that described network coordinator 602 responds described position enquiring message, obtain the station location marker of other network nodes 603 described.Described position enquiring message comprises the title of described second network node 603, comprises the station location marker of other network nodes 603 described in the response message of described position.
Described network node 601 is also for generating and sending the second data message, and the destination locations of described second data message is designated the station location marker of other network nodes 603 described.
Adopting the technical scheme that the embodiment of the present invention provides, by using prime number short address and station location marker, realizing quickly networking and the route of non-uniform Distribution sensor network interior joint, the movement of all right support node; Solve existing wireless sensor network not support node non-uniform Distribution and mobility, or need to generate and maintaining routing list, consumption of network resources and the high problem of node energy consumption.One of ordinary skill in the art will appreciate that all or part of step realized in above-described embodiment method is that the hardware that can carry out instruction relevant by program completes, described program can be stored in computer-readable recording medium, described storage medium can be ROM/RAM, disk or CD etc.
The above; be only the present invention's preferably embodiment, but protection scope of the present invention is not limited thereto, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; the change that can expect easily or replacement, all should be encompassed within protection scope of the present invention.