A kind of efficient Internet of Things construction method
Technical field
The present invention relates to a kind of construction method more particularly to a kind of efficient Internet of Things construction methods.
Background technique
Internet of Things is a kind of new service mode.In recent years, many research work be dedicated to the construction method of Internet of Things with
Ensure the stability of network and the continuity of communication, so that user node being capable of quick obtaining network service.With network technology
Development, Internet of Things can become following and provide the one mode of service.Currently, the building delay of Internet of Things and cost all compare
Greatly, network service performance is reduced.Therefore, the delay and cost that how to reduce Internet of Things building become the hot spot of Recent study
Problem.
Summary of the invention
Goal of the invention:It is a kind of efficient the technical problem to be solved by the present invention is in view of the deficiencies of the prior art, provide
Internet of Things construction method.
Technical solution:The invention discloses a kind of efficient Internet of Things construction method, the Internet of Things includes a control
Device and more than two sensing nodes, a controller and sensing node constitute a tree, in the tree, control
Device is root node;Controller can be smart phone;
One controller or a sensing node are by an address unique identification, and the address is by hardware ID and coordinate structure
At hardware ID can be MAC Address;After one controller starting, an address is constructed, the hardware ID of the address is zero, coordinate
For the geographical coordinate of controller oneself;After one sensing node starting, an address is constructed, the hardware ID of the address is sensing section
The hardware ID of point oneself, coordinate are the geographical coordinate of oneself;
There are three types of state, dormant state, semidormancy state and active states for one sensing node;The sensing section of dormant state
Point does not receive any message;The state value of dormant state is 0;The sensing node of semidormancy state can only receive beacon message, touching
Send out message and new node message;The state value of semidormancy state is 1;The sensing node of active state can receive any message;It is living
The state value of jump state is 2;
Each controller or sensing node save a neighbor table, and each neighbor entry includes address field, status field, life
Order period region and relation domain;Relationship thresholding is 0 or 1;Relationship thresholding 1 shows that the sensing node joined tree, relationship
Thresholding 0 shows that tree is not added in the sensing node;
Controller, the sensing node in active state and semidormancy state periodically send beacon message, send two letters
Marking the time interval between message is T1;
After Internet of Things starting, controller and all sensing nodes are in active state;Controller is built by following processes
Found a neighbor table:
Step 101:Start;
Step 102:Controller sends a beacon message, and the source address of the beacon message is the address of the controller, mesh
Address be broadcast address, i.e. each bit of address is 1, is loaded as state value 2;
Step 103:After neighbours' sensing node receives the beacon message, the controller in beacon message load is saved
Neighbor table is checked in address, judges whether there is a neighbor entry, and the address thresholding of the neighbor entry is equal to the beacon message
Source address, thens follow the steps 104, no to then follow the steps 105;
Step 104:The neighbours' sensing node for receiving the beacon message selects a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and n1 is the number greater than 1, such as 1.5, and n1 is adjustment factor,
N1 is bigger, and life cycle is longer, and n1 is smaller, and the smaller relationship thresholding of life cycle is 0;Execute step 106;
Step 105:The neighbours' sensing node for receiving the beacon message creates a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0;
Step 106:Terminate.
Controller establishes neighbor table by the above process to obtain the state of neighbours' sensing node to establish tree.
Neighbor table ensures the validity of neighbor node by life cycle.
In the method for the invention, active state is in after sensing node starting, sensing node obtains the address of controller
After execute following processes:
Step 201:Start;
Step 202:Sensing node sends a beacon message, and the source address of the beacon message is the address of the controller,
Destination address is broadcast address, i.e. each bit of address is 1, loads the address for state value 2 and controller;
Step 203:After neighbours' sensing node receives the beacon message, the controller in beacon message load is saved
Neighbor table is checked in address;If there is a neighbor entry, the address thresholding of the neighbor entry is with being equal to the source of the beacon message
Location, thens follow the steps 204, no to then follow the steps 205;
Step 204:The neighbours' sensing node for receiving the beacon message selects a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0, execute step 206;
Step 205:The neighbours' sensing node for receiving the beacon message creates a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0;
Step 206:Terminate.
Sensing node establishes neighbor table by the above process to obtain the state of neighbours' sensing node to establish tree-shaped knot
Structure.
In the method for the invention, after controller and sensing node establish neighbor table, controller initiates tree creation
Process:
Step 301:Start;
Step 302:Controller selects a neighbor entry E1, the address in all neighbor entries, in neighbor entry E1
The coordinate in domain is nearest at a distance from the coordinate of the controller;Controller sends a building and sets message, the building tree message
Source address is the address of the controller, and destination address is the address of neighbor entry E1, and the relationship thresholding of neighbor entry E1 is arranged
It is 1;The controller checks neighbor table, and for each neighbor entry other than neighbor entry E1, controller executes following
Operation:If the coordinate of the address in neighbor entry E1 is at a distance from the coordinate of the address of the neighbor entry less than sensing node
Radius R1 is transmitted, then the controller sends a sleep messages, and the source address of the sleep messages is the address of the controller, purpose
Address is the address of the neighbor entry, sets 0 for the state value of the neighbor entry;
Step 303:Controller selects a neighbor entry E2, and the state value of neighbor entry E2 is 2, and relationship thresholding is 0,
In the neighbor entry that all state values are 2 and relationship thresholding is 0, the coordinate of the address field in neighbor entry E2 and the controller
Coordinate distance it is nearest;Controller sends a building and sets message, and the source address of the building tree message is the ground of the controller
Location, destination address are the address of neighbor entry E2, set 1 for the relationship thresholding of neighbor entry E2;Controller checks neighbor table,
The neighbor entry that for each state thresholding other than neighbor entry E2 be 2 and relationship thresholding is 0, controller execute following
Operation:If the coordinate of the address in neighbor entry E2 is at a distance from the coordinate of the address of the neighbor entry less than sensing node
Radius R1 is transmitted, then the controller sends a sleep messages, and the source address of the sleep messages is the address of the controller, purpose
Address is the address of the neighbor entry, sets 0 for the state value of the neighbor entry;
Step 304:Controller checks neighbor table, judges whether at least there is a neighbor entry, the shape of the neighbor entry
State value is 2 and relationship thresholding is 0, is to then follow the steps 303, no to then follow the steps 305;
Step 305:Judge whether that sensing node receives sleep messages, is to then follow the steps 306, it is no to then follow the steps
307;
Step 306:The sensing node for receiving sleep messages saves the source address of the sleep messages, selects a neighbor table
, the address thresholding of the neighbor entry is equal to the source address of the building tree message, sets the relationship thresholding of the neighbor entry to
1, a beacon message is then sent, the source address of the beacon message is the address of the sensing node, and destination address is broadcast ground
Each bit of location, i.e. address is 1, is loaded as state value 0 and dormancy time T2, then the sensing node switchs to suspend mode
State;After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the address field of the neighbor entry is equal to should
The state thresholding of the neighbor entry is set the state value in beacon message load, relation domain by the source address of beacon message
Value is set as 0, and life cycle thresholding is set as n1 × T2;Execute step 309;
Step 307:The sensing node for receiving building tree message saves the source address of the building tree message;Judge whether to
There is a neighbor entry less, it is to then follow the steps 308, otherwise that the state value of the neighbor entry, which is 2, and relationship thresholding is equal to 0
Execute step 309;
Step 308:The sensing node for receiving building tree message selects a neighbor entry, the address field of the neighbor entry
Value is equal to the source address of the building tree message, sets 1 for the relationship thresholding of the neighbor entry, then selects a neighbor entry
The state value of E3, neighbor entry E3 are 2, and relationship thresholding is 0, in the neighbor entry that all state values are 2 and relationship thresholding is 0
In, it is maximum at a distance from the coordinate of the address thresholding of the coordinate and neighbor entry E3 of controller address;The sensing node sends one
Building tree message, the source address of the building tree message are the address of oneself, and destination address is the address thresholding in neighbor entry E3,
1 is set by the relationship thresholding of neighbor entry E3;The sensing node checks neighbor table, for the shape other than neighbor entry E3
Each neighbor entry that state value is 2 and relationship thresholding is 0, the sensing node execute operations described below:Sensing node sends one and stops
Dormancy message, the source address of the sleep messages are the address of oneself, and destination address is the address thresholding in the neighbor entry, by the neighbour
The state thresholding for occupying list item is set as 0, executes step 305;
Step 309:Terminate;
Sensing node in a dormant state is converted to semidormancy state after suspend mode n1 × T2.
Controller establishes a tree by the above process, and the above process selects optimal neighbours to pass using neighbor table
Node is felt as child node, so that it is guaranteed that the stability of tree;After controller selects child node, by all child nodes
Neighbor node is set as dormant state to effectively save the energy of neighbours' sensing node, when improving the existence of whole network
Between;Suspend mode node can be periodically switched to semidormancy state can receive the node of message change active state so that it is guaranteed that tree-shaped
The stability of structure.
In the method for the invention, if the state of a node is converted to semidormancy state from dormant state, it is executed
Operations described below updates neighbor table:
Step 401:Start;
Step 402:Sensing node sends a beacon message, and the source address of the beacon message is the ground of sensing node oneself
Location, destination address are broadcast address, are loaded as state value 1;
Step 403:After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the neighbor entry
Address thresholding is equal to the source address of the beacon message, then sets the state value of the neighbor entry in beacon message load
State value, life cycle is set as n1 × T1;
Step 404:Terminate;
If the sensing node of semidormancy state is not received by triggering message in n2 × T1, n2 is the number greater than 2, then
A beacon message is sent, the source address of the beacon message is the address of oneself, and destination address is broadcast address, is loaded as state
Value 0 and dormancy time T2, the sensing node of semidormancy state are converted to dormant state;Neighbours' sensing node receives the beacon and disappears
After breath, a neighbor entry is selected, the address thresholding of the neighbor entry is equal to the source address of the beacon message, then by the neighbours
The state value of list item is set as the state value in beacon message load, and life cycle is set as n1 × T2, the setting of relationship thresholding
It is 0.
After node is converted to semidormancy state from dormant state, the state of oneself is updated by the above process, so that it is guaranteed that
Neighbours' sensing node can obtain newest status information, and ensure the stability of tree to oneself transmission information.5,
A kind of efficient Internet of Things construction method according to claim 1, which is characterized in that if sensing node, which is in, enlivens shape
The time of state is more than predetermined value T3, then executes following processes:
Step 501:Start;
Step 502:The neighbor entry that sensing node selects all relationship thresholdings to be equal to 1, one neighbor entry of simultaneous selection
The relationship thresholding of E4, neighbor entry E4 are 0, and the coordinate of the address neighbor entry E4 thresholding and each relationship thresholding are equal to 1 neighbour
The distance for occupying the coordinate of the address thresholding in list item both less than transmits radius R1;It, should if the state of neighbor entry E4 is equal to 0
Sensing node is waited until the state thresholding of neighbor entry E4 becomes semidormancy state;The sensing node sends a triggering and disappears
Breath, the source address of the triggering message are the address of the sensing node oneself, and destination address is the address thresholding of neighbor entry E4,
Load is the neighbor table and dormancy time T2 of sensing node oneself;
Step 503:The sensing node sends a beacon message, the source address of the beacon message be the sensing node from
Oneself address, destination address are broadcast address, load as state value 0 and dormancy time T2, are converted to dormant state;Neighbours pass
After sense node receives the beacon message, a neighbor entry is selected, the address thresholding of the neighbor entry is equal to the beacon message
Source address, by the state value of the neighbor entry be set as beacon message load in state value, life cycle be set as n1 ×
T2, relationship thresholding are set as 0;
Step 504:After sensing node receives triggering message, the neighbor table of oneself is updated in triggering Message Payload
Neighbor table creates a neighbor entry in the neighbor table, and the address thresholding of the neighbor entry is with being equal to the source of the triggering message
Location, state thresholding are 0, and life cycle thresholding is n1 × T2, and relationship thresholding is 0;The sensing node of triggering message is received from neighbours
A neighbor entry is deleted in table, the address thresholding of the neighbor entry is equal to the address of the sensing node, is changed into active state;
The sensing node sends a beacon message, and the source address of the beacon message is equal to the address of oneself, and destination address is broadcast ground
Location loads as state value 2;After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the neighbor entry
Address thresholding is equal to the source address of the beacon message, sets the shape in beacon message load for the state value of the neighbor entry
State value, life cycle are set as n1 × T1, and relationship thresholding is set as 1;
Step 505:Terminate.
The above process is that oneself is converted to dormant state by the node in active state, and the purpose is to save the energy of oneself
Source, the above process not only effectively maintain the topology of tree, at the same also effectively increase the life cycle of whole network with
And stability.
6, a kind of efficient Internet of Things construction method according to claim 1 a, which is characterized in that if neighbours
The life cycle of list item is expired, then the neighbor entry is deleted from neighbor table;
If the sensing node in semidormancy state detects that a relationship thresholding is the life cycle of 1 neighbor entry
Expired and be not received by new node message of the source address thresholding equal to the address thresholding of the neighbor entry, which then looks into
See whether the coordinate of oneself is less than threshold value D1 at a distance from the coordinate of the address field of the neighbor entry, thresholding D1 generally transmits half
The 70% of diameter;If the coordinate of the sensing node is not less than threshold value D1 at a distance from the coordinate of the address field of the neighbor entry,
The sensing node deletes the neighbor entry;If the coordinate of the sensing node is at a distance from the coordinate of the address field of the neighbor entry
Less than threshold value D1, which is then changed into active state, deletes the neighbor entry, sends a new node message, this is new
The source address of node messages is the address of oneself, and destination address is broadcast address, is loaded as state thresholding 2;Neighbours' sensing node
After receiving the new node message, a neighbor entry is selected, the address thresholding of the neighbor entry is equal to the new node message
The state thresholding of the neighbor entry is set the state thresholding in the new node Message Payload, life cycle setting by source address
For n1 × T1, relationship thresholding is set as 1.
If neighbours' sensing node that relationship thresholding is 1 fails, the sensing node in semidormancy state will change
For active state to ensure the stability of tree topology, while neighbours' sensing node of failure is deleted to ensure that neighbours sense
The real-time and correctness of nodal information.The above process effectively ensures the stability of Internet of Things tree topology, to increase
The strong stability and continuity of communication.
Beneficial effect:The present invention provides a kind of efficient Internet of Things construction method, mobile device provides through the invention
Method can quick obtaining network service, the stability and communication performance of network are improved, to reduce communication delay and generation
Valence is improved service quality.Present invention can apply to the numerous areas such as agricultural engineerization, intelligent medical, before having a wide range of applications
Scape.
Detailed description of the invention
The present invention is done with reference to the accompanying drawings and detailed description and is further illustrated, of the invention is above-mentioned
And/or otherwise advantage will become apparent.
Fig. 1 establishes neighbor table flow diagram to be of the present invention.
Fig. 2 is maintenance of neighbor table flow diagram of the present invention.
Fig. 3 is building tree flow diagram of the present invention.
Fig. 4 is update neighbor table flow diagram of the present invention.
Fig. 5 is node shape body flow path switch schematic diagram of the present invention.
Specific embodiment:
The present invention provides a kind of efficient Internet of Things construction methods, and the method that mobile device provides through the invention can
Quick obtaining network service, improves the stability and communication performance of network, to reduce communication delay and cost, improves service
Quality.Present invention can apply to the numerous areas such as agricultural engineerization, intelligent medical, are with a wide range of applications.
Fig. 1 establishes neighbor table flow diagram to be of the present invention.The Internet of Things includes a controller and two
Above sensing node, a controller and sensing node constitute a tree, and in the tree, controller is root section
Point;
One controller or a sensing node are by an address unique identification, and the address is by hardware ID and coordinate structure
At;After one controller starting, an address is constructed, the hardware ID of the address is zero, and coordinate is that the geographical of controller oneself sits
Mark;After one sensing node starting, an address is constructed, the hardware ID of the address is the hardware ID of sensing node oneself, coordinate
For the geographical coordinate of oneself;
There are three types of state, dormant state, semidormancy state and active states for one sensing node;The sensing section of dormant state
Point does not receive any message;The state value of dormant state is 0;The sensing node of semidormancy state can only receive beacon message, touching
Send out message and new node message;The state value of semidormancy state is 1;The sensing node of active state can receive any message;It is living
The state value of jump state is 2;
Each controller or sensing node save a neighbor table, and each neighbor entry includes address field, status field, life
Order period region and relation domain;Relationship thresholding is 0 or 1;Relationship thresholding 1 shows that the sensing node joined tree, relationship
Thresholding 0 shows that tree is not added in the sensing node;
Controller, the sensing node in active state and semidormancy state periodically send beacon message, send two letters
Marking the time interval between message is T1;
After Internet of Things starting, controller and all sensing nodes are in active state;Controller is built by following processes
Found a neighbor table:
Step 101:Start;
Step 102:Controller sends a beacon message, and the source address of the beacon message is the address of the controller, mesh
Address be broadcast address, i.e. each bit of address is 1, is loaded as state value 2;
Step 103:After neighbours' sensing node receives the beacon message, the controller in beacon message load is saved
Neighbor table is checked in address, judges whether there is a neighbor entry, and the address thresholding of the neighbor entry is equal to the beacon message
Source address, thens follow the steps 104, no to then follow the steps 105;
Step 104:The neighbours' sensing node for receiving the beacon message selects a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and n1 is the number greater than 1, and relationship thresholding is 0;Execute step
106;
Step 105:The neighbours' sensing node for receiving the beacon message creates a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0;
Step 106:Terminate.
Fig. 2 is maintenance of neighbor table flow diagram of the present invention.Active state, sensing are in after sensing node starting
Following processes are executed behind the address of node acquisition controller:
Step 201:Start;
Step 202:Sensing node sends a beacon message, and the source address of the beacon message is the address of the controller,
Destination address is broadcast address, i.e. each bit of address is 1, loads the address for state value 2 and controller;
Step 203:After neighbours' sensing node receives the beacon message, the controller in beacon message load is saved
Neighbor table is checked in address;If there is a neighbor entry, the address thresholding of the neighbor entry is with being equal to the source of the beacon message
Location, thens follow the steps 204, no to then follow the steps 205;
Step 204:The neighbours' sensing node for receiving the beacon message selects a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0, execute step 206;
Step 205:The neighbours' sensing node for receiving the beacon message creates a neighbor entry, the ground of the neighbor entry
Location thresholding is equal to the source address of the beacon message, which sets the beacon for the state thresholding of the neighbor entry
State value in Message Payload, life cycle are set as n1 × T1, and relationship thresholding is 0;
Step 206:Terminate.
Fig. 3 is building tree flow diagram of the present invention.After controller and sensing node establish neighbor table,
Controller initiates tree and creates process:
Step 301:Start;
Step 302:Controller selects a neighbor entry E1, the address in all neighbor entries, in neighbor entry E1
The coordinate in domain is nearest at a distance from the coordinate of the controller;Controller sends a building and sets message, the building tree message
Source address is the address of the controller, and destination address is the address of neighbor entry E1, and the relationship thresholding of neighbor entry E1 is arranged
It is 1;The controller checks neighbor table, and for each neighbor entry other than neighbor entry E1, controller executes following
Operation:If the coordinate of the address in neighbor entry E1 is at a distance from the coordinate of the address of the neighbor entry less than sensing node
Radius R1 is transmitted, then the controller sends a sleep messages, and the source address of the sleep messages is the address of the controller, purpose
Address is the address of the neighbor entry, sets 0 for the state value of the neighbor entry;
Step 303:Controller selects a neighbor entry E2, and the state value of neighbor entry E2 is 2, and relationship thresholding is 0,
In the neighbor entry that all state values are 2 and relationship thresholding is 0, the coordinate of the address field in neighbor entry E2 and the controller
Coordinate distance it is nearest;Controller sends a building and sets message, and the source address of the building tree message is the ground of the controller
Location, destination address are the address of neighbor entry E2, set 1 for the relationship thresholding of neighbor entry E2;Controller checks neighbor table,
The neighbor entry that for each state thresholding other than neighbor entry E2 be 2 and relationship thresholding is 0, controller execute following
Operation:If the coordinate of the address in neighbor entry E2 is at a distance from the coordinate of the address of the neighbor entry less than sensing node
Radius R1 is transmitted, then the controller sends a sleep messages, and the source address of the sleep messages is the address of the controller, purpose
Address is the address of the neighbor entry, sets 0 for the state value of the neighbor entry;
Step 304:Controller checks neighbor table, judges whether at least there is a neighbor entry, the shape of the neighbor entry
State value is 2 and relationship thresholding is 0, is to then follow the steps 303, no to then follow the steps 305;
Step 305:Judge whether that sensing node receives sleep messages, is to then follow the steps 306, it is no to then follow the steps
307;
Step 306:The sensing node for receiving sleep messages saves the source address of the sleep messages, selects a neighbor table
, the address thresholding of the neighbor entry is equal to the source address of the building tree message, sets the relationship thresholding of the neighbor entry to
1, a beacon message is then sent, the source address of the beacon message is the address of the sensing node, and destination address is broadcast ground
Each bit of location, i.e. address is 1, is loaded as state value 0 and dormancy time T2, then the sensing node switchs to suspend mode
State;After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the address field of the neighbor entry is equal to should
The state thresholding of the neighbor entry is set the state value in beacon message load, relation domain by the source address of beacon message
Value is set as 0, and life cycle thresholding is set as n1 × T2;Execute step 309;
Step 307:The sensing node for receiving building tree message saves the source address of the building tree message;Judge whether to
There is a neighbor entry less, it is to then follow the steps 308, otherwise that the state value of the neighbor entry, which is 2, and relationship thresholding is equal to 0
Execute step 309;
Step 308:The sensing node for receiving building tree message selects a neighbor entry, the address field of the neighbor entry
Value is equal to the source address of the building tree message, sets 1 for the relationship thresholding of the neighbor entry, then selects a neighbor entry
The state value of E3, neighbor entry E3 are 2, and relationship thresholding is 0, in the neighbor entry that all state values are 2 and relationship thresholding is 0
In, it is maximum at a distance from the coordinate of the address thresholding of the coordinate and neighbor entry E3 of controller address;The sensing node sends one
Building tree message, the source address of the building tree message are the address of oneself, and destination address is the address thresholding in neighbor entry E3,
1 is set by the relationship thresholding of neighbor entry E3;The sensing node checks neighbor table, for the shape other than neighbor entry E3
Each neighbor entry that state value is 2 and relationship thresholding is 0, the sensing node execute operations described below:Sensing node sends one and stops
Dormancy message, the source address of the sleep messages are the address of oneself, and destination address is the address thresholding in the neighbor entry, by the neighbour
The state thresholding for occupying list item is set as 0, executes step 305;
Step 309:Terminate;
Sensing node in a dormant state is converted to semidormancy state after suspend mode n1 × T2.
Fig. 4 is update neighbor table flow diagram of the present invention.If the state of a node turns from dormant state
It is changed to semidormancy state, it executes operations described below and updates neighbor table:
Step 401:Start;
Step 402:Sensing node sends a beacon message, and the source address of the beacon message is the ground of sensing node oneself
Location, destination address are broadcast address, are loaded as state value 1;
Step 403:After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the neighbor entry
Address thresholding is equal to the source address of the beacon message, then sets the state value of the neighbor entry in beacon message load
State value, life cycle is set as n1 × T1;
Step 404:Terminate;
If the sensing node of semidormancy state is not received by triggering message in n2 × T1, n2 is the number greater than 2, then
A beacon message is sent, the source address of the beacon message is the address of oneself, and destination address is broadcast address, is loaded as state
Value 0 and dormancy time T2, the sensing node of semidormancy state are converted to dormant state;Neighbours' sensing node receives the beacon and disappears
After breath, a neighbor entry is selected, the address thresholding of the neighbor entry is equal to the source address of the beacon message, then by the neighbours
The state value of list item is set as the state value in beacon message load, and life cycle is set as n1 × T2, the setting of relationship thresholding
It is 0.
Fig. 5 is node shape body flow path switch schematic diagram of the present invention.If sensing node be in active state when
Between be more than predetermined value T3, then execute following processes:
Step 501:Start;
Step 502:The neighbor entry that sensing node selects all relationship thresholdings to be equal to 1, one neighbor entry of simultaneous selection
The relationship thresholding of E4, neighbor entry E4 are 0, and the coordinate of the address neighbor entry E4 thresholding and each relationship thresholding are equal to 1 neighbour
The distance for occupying the coordinate of the address thresholding in list item both less than transmits radius R1;It, should if the state of neighbor entry E4 is equal to 0
Sensing node is waited until the state thresholding of neighbor entry E4 becomes semidormancy state;The sensing node sends a triggering and disappears
Breath, the source address of the triggering message are the address of the sensing node oneself, and destination address is the address thresholding of neighbor entry E4,
Load is the neighbor table and dormancy time T2 of sensing node oneself;
Step 503:The sensing node sends a beacon message, the source address of the beacon message be the sensing node from
Oneself address, destination address are broadcast address, load as state value 0 and dormancy time T2, are converted to dormant state;Neighbours pass
After sense node receives the beacon message, a neighbor entry is selected, the address thresholding of the neighbor entry is equal to the beacon message
Source address, by the state value of the neighbor entry be set as beacon message load in state value, life cycle be set as n1 ×
T2, relationship thresholding are set as 0;
Step 504:After sensing node receives triggering message, the neighbor table of oneself is updated in triggering Message Payload
Neighbor table creates a neighbor entry in the neighbor table, and the address thresholding of the neighbor entry is with being equal to the source of the triggering message
Location, state thresholding are 0, and life cycle thresholding is n1 × T2, and relationship thresholding is 0;The sensing node of triggering message is received from neighbours
A neighbor entry is deleted in table, the address thresholding of the neighbor entry is equal to the address of the sensing node, is changed into active state;
The sensing node sends a beacon message, and the source address of the beacon message is equal to the address of oneself, and destination address is broadcast ground
Location loads as state value 2;After neighbours' sensing node receives the beacon message, a neighbor entry is selected, the neighbor entry
Address thresholding is equal to the source address of the beacon message, sets the shape in beacon message load for the state value of the neighbor entry
State value, life cycle are set as n1 × T1, and relationship thresholding is set as 1;
Step 505:Terminate.
If the life cycle of a neighbor entry is expired, the neighbor entry is deleted from neighbor table;
If the sensing node in semidormancy state detects that a relationship thresholding is the life cycle of 1 neighbor entry
Expired and be not received by new node message of the source address thresholding equal to the address thresholding of the neighbor entry, which then looks into
See whether the coordinate of oneself is less than threshold value D1 at a distance from the coordinate of the address field of the neighbor entry;If the seat of the sensing node
Mark is not less than threshold value D1 at a distance from the coordinate of the address field of the neighbor entry, then the sensing node deletes the neighbor entry;Such as
It is less than threshold value D1 at a distance from the coordinate of the address field of the coordinate and neighbor entry of the fruit sensing node, which then changes
For active state, the neighbor entry is deleted, sends a new node message, the source address of the new node message is the ground of oneself
Location, destination address are broadcast address, are loaded as state thresholding 2;After neighbours' sensing node receives the new node message, one is selected
A neighbor entry, the address thresholding of the neighbor entry is equal to the source address of the new node message, by the status field of the neighbor entry
Value is set as the state thresholding in the new node Message Payload, and life cycle is set as n1 × T1, and relationship thresholding is set as 1.
Embodiment 1
Based on the simulation parameter of table 1, the present embodiment simulates the efficient Internet of Things construction method of one of present invention, net
After network starting, controller executes step 101-106 and establishes neighbor table, and sensing node executes step 201-206 and establishes neighbor table, so
Controller executes step 301-309 and establishes tree afterwards, changes if node is changed to semidormancy state from dormant state, holds
Row step 401-404 updates neighbor table, if node is changed to dormant state from active state, thens follow the steps 501-505 update
For neighbor table to safeguard the stability of tree, performance evaluation is as follows:When number of nodes increases, network struction delay is increased
Add, when number of nodes reduces, network struction delay decreases, and the average retardation of data acquisition is 750ms.
1 simulation parameter of table
The present invention provides a kind of thinking of efficient Internet of Things construction method, implement the technical solution method and
There are many approach, the above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.The available prior art of each component part being not known in the present embodiment is realized.