Detailed Description
The invention is further described with reference to the following examples.
Referring to fig. 1, an embodiment of the present invention provides a network distribution method for smart home devices, where the network distribution method includes the following steps:
s1, the device to be networked establishes an authentication path for communicating with the authentication management device;
s2, the device to be accessed communicates with the authentication management device through the authentication path, and receives the authentication management device to authenticate the identity of the device;
s3, after the identity authentication is successful, the device to be networked receives the initialization configuration information sent by the authentication management device through the authentication path;
and S4, the equipment to be accessed to the network carries out initialization setting according to the initialization configuration information and accesses the intelligent home network.
According to the embodiment of the invention, when the equipment to be networked is accessed into the intelligent home network, the authentication path is established first, so that the condition that the equipment to be networked and the authentication management equipment always use a flooding method for communication in the accessing process is avoided, the communication congestion degree of the intelligent home network is effectively reduced, and a communication foundation is laid for long-distance multi-hop communication between the equipment to be networked and the authentication management equipment.
In an optional embodiment, the performing identity authentication includes: the administrator uploads the identification code and the verification public key of the equipment to be accessed to the authentication management equipment; and the administrator uploads the authentication public key of the authentication management equipment to the equipment to be accessed to the network through Bluetooth or USB.
The method comprises the steps that a device to be accessed to a network encrypts an authentication public key of an authentication management device by using a self authentication private key to generate an encryption verification message, and the encryption verification message is sent to the authentication management device through an authentication path, wherein the encryption verification message comprises an identification code of the device to be accessed to the network;
and the authentication management equipment calls a verification public key of the equipment to be accessed, which is uploaded by an administrator in advance, to decrypt the encrypted verification message according to the unique identification code of the equipment to be accessed, verifies whether the decrypted verification public key is correct or not, if the decrypted verification public key is correct, the equipment to be accessed passes the identity authentication, and otherwise, the equipment to be accessed does not pass the identity authentication.
In an optional embodiment, if the identity authentication of the device to be networked fails, the authentication management device first determines whether the failure reason is a network reason, if so, the authentication management device notifies the device to be networked through a flooding method to reestablish an authentication path, otherwise, the authentication management device rejects the network access of the device to be networked, which does not meet the network access requirement.
In one embodiment, the establishing, by the device to be networked, an authentication path for communicating with an authentication management device includes:
s1, the device to be networked broadcasts an authentication request message, the authentication request message is forwarded to an authentication management device by an intermediate device, the authentication management device receives the authentication request message from different forwarding paths, and selects an authentication path from the forwarding paths based on a set rule;
s2, the device to be networked receives a path confirmation message containing the selected authentication path sent by the authentication management device through the selected authentication path;
and S3, the device to be networked acquires the authentication path according to the path confirmation message.
The embodiment of the invention solves the problem of difficulty in equipment distribution caused by limited coverage range of the wireless router in a residence with a large area through the function of the intermediate equipment. In a residence with a large area, the device to be networked is not necessarily placed near the authentication management device, and a large spatial distance may exist between the device to be networked and the authentication management device, so that the multi-hop long-distance communication between the device to be networked and the authentication management device is realized through the function of the intermediate device.
In one embodiment, the initialization configuration information includes a network access code for enabling the device having the network access code to become an authenticated device for communicating with other authenticated devices.
The intermediate device 3 extracts the device identification code carried in the message for the message not carrying the network access code, records the times of receiving the message, and accumulates to the preset NlimitAnd after that, the intermediate device 3 pulls the device identification code into a blacklist, and does not forward the message sent by the device corresponding to the device identification code.
The background administrator may cause the intermediate device 3 to delete the device identification code from the blacklist by causing the authentication management device 2 to broadcast a blacklist release message carrying the device identification code.
According to the embodiment of the invention, the intelligent home network is prevented from being maliciously attacked by others by a mode of enabling the authentication management equipment to issue the network access code, so that the intelligent home network cannot work normally. If the communication of the unauthenticated device in the smart home network is not limited, the unauthenticated device may continuously send spam messages to the smart home network by other people, so that the network bandwidth is occupied, and the use is influenced. However, the message of the unauthenticated device cannot be forwarded, because some devices to be networked do not yet obtain the network access code, which is not favorable for network access of the devices to be networked.
In one embodiment, the authentication request message includes at least: the method comprises the steps that an identification code of a device to be accessed to the network, a channel number of the first three hops, an identification code set of a passed intermediate device and a minimum link duration mint are obtained;
the channel number of the first three hops is the number of a channel adopted by each intermediate device when each intermediate device forwards the authentication request message in 3 intermediate devices through which the latest 3 hops of the authentication request message pass;
the passing intermediate device identification code set comprises identification codes of each intermediate device which are arranged in sequence and through which the authentication request message passes;
the minimum link duration mint is the maintaining time of the link with the shortest total duration in the connected state among all the links through which the authentication request message passes;
the intermediate equipment comprises movable equipment and fixed equipment;
the intermediate device maintains a neighbor device table, wherein the neighbor device table comprises devices which are positioned in the communication range of the intermediate device and are communicated with the communication link of the intermediate device;
the intermediate device periodically exchanges link maintenance messages with each device in its neighbor device table.
In an alternative embodiment, the mobile device comprises an unmanned weeding machine, a sweeping robot, a robot steward; the fixed equipment comprises a wireless gateway, an intelligent lamp, an intelligent sound box and an intelligent lock.
In one embodiment, the forwarding of the authentication request message to the authentication management device by the intermediate device includes:
s1, the intermediate device judges whether the authentication request message is received repeatedly, if yes, the authentication request message is discarded;
s2, the intermediate device determines the link duration exT of the last hop link passed by the authentication request message, and compares the link duration exT with the minimum link duration mint in the authentication request message, if exT < mint, the value of mint in the authentication request message is updated to the value of exT;
s3, the intermediate device writes the identification code of the intermediate device into an authentication request message;
s4, the intermediate device selects a forwarding channel for the authentication request message, and writes the serial number of the forwarding channel into the corresponding position in the authentication request message;
s5, the intermediate device broadcasts the authentication request message by using the selected forwarding channel.
The previous-hop link refers to, for example, a previous-hop link in which device a receives an authentication request message broadcast by device B in its neighbor device table, and a path space for electromagnetic waves propagating between device a and device B in its neighbor device table is the previous-hop link.
In one embodiment, the intermediate device obtains the link duration by:
s1, when receiving the link maintaining message, the intermediate device calculates the communication distance L of the device sending the link maintaining message in the neighbor device table according to the signal intensity of the link maintaining message;
s2, the intermediate device maintains a set sumDL for recording communication distance conditions of devices in its neighbor device table, sumDL { DL } DL1,DL2,…,DLdIn which d ∈ [1, totalnum }]Totalnum is the total number of devices contained in the neighbor device table of the intermediate device, DLd={Ld,1,Ld,2,…,Ld,k…Ld,Nt},i∈[1,Nt],NtIndicating the total number of the link maintenance messages sent by the d-th device to the intermediate device in the neighbor device table of the intermediate device in the set sumDL calculation period T1; l isd,iIndicating the communication distance between the d-th device in the neighbor device table of the intermediate device and the k-th device when the d-th device sends the link maintenance message to the intermediate device within a calculation period T1;
s3, the intermediate device storing the set DL
dTwo adjacent elements in the set DL
dIs stored as a set tl
d,
Wherein,
to represent
And
deposit set DL
dThe time interval of (c);
s4, the intermediate device calculates the set DLdVariance SD of element(s) in (1)DL,dIf SDDL,dLess than a set threshold SDTHIf yes, the intermediate device judges that the d-th device in the neighbor device table is a fixed device, and marks the device as the fixed device at the corresponding position in the neighbor device table; taking active as the link duration T of the intermediate device keeping connected with the d-th device in the neighbor device tabledActive is preset data, which indicates that the link can always keep connected,
otherwise, the link duration T is calculated by the following formulad:
In the formula,
Γ denotes the total duration t of the d-th deviced,i-2+td,i-1An average moving speed of the inner, Rad representing a communication radius of the intermediate device;
s5, the intermediate device transmits the link duration TdStoring the data;
s6, the intermediate device updating the link duration T with a calculation period T1d。
In the above embodiment of the present invention, the communication distances of both communication parties are estimated according to the signal strength of the received link maintaining message, and then the link duration of the link between the intermediate device and the device in the neighbor device table is accurately calculated according to the communication radius of the intermediate device, the communication distances obtained through multiple measurements, and the measured time intervals. An update mechanism is also provided for updating the link duration of the intermediate device with each device in its neighbor device table in time, since the intermediate device includes both a removable device and a fixed device, and the resulting link duration is not reliable if not updated. The method adopted by the embodiment is beneficial to providing accurate link duration for solving the problem that the intelligent household equipment is accessed to the network in a residence with a large area.
In one embodiment, the selecting a forwarding channel for the authentication request message includes:
s1, excluding the first three-hop channel numbers from all available channels, using the remaining channels as candidate channels, and recording the set of candidate channels as CCS, { cc ═ cc {, where1,cc2,…,ccq,…,ccccnumCcnum is the total number of candidate channels, and q is the [1, ccnum-];
S2, calculating a forwarding evaluation parameter of each candidate channel, specifically:
calculating a forwarding evaluation parameter FEP of a channel q in a candidate signal set by using the following formulaq:
FEPq=λTGPq+μCQq
In the formula, CQ
qIndicating the communication quality of channel q, TGP
qWhich represents the throughput of the channel q,
P
colrepresenting the probability of collision of a data packet transmitted on channel q; ω represents the proportion of the number of fixed devices in the neighbor device table of the intermediate device to the total number of devices in the neighbor device table; psi denotes the use of the channel cc in the neighbor list of the intermediate device
iThe total number of devices of (a); l is
pqmRepresenting a total number of bytes of the authentication request message; t is
avgIndicating the time required for the intermediate device to successfully transmit a packet on channel q,
wherein, T
headAverage time required for an intermediate device to transmit a packet header on channel q, sp representing the transmission rate of channel q, T
asceIndicating that the intermediate device is in channel cc
iReceiving the time required by an acknowledgement character ACK, wherein phi is the propagation delay of the data packet; λ and μ represent preset weight parameters, λ + μ ═ 1;
s3, the channel with the highest forwarding evaluation parameter is used as the forwarding channel.
In the above embodiment of the present invention, the authentication request message is forwarded in a multi-channel manner, thereby avoiding the problems of hidden terminals and exposed terminals occurring in a single channel. And when selecting the channel, the channel number of the first three hops is eliminated, and the possibility of channel collision among the intermediate devices in the same area is further reduced. Because when a certain device successfully uses a certain channel for communication, the same channel is often used for transmission in the next communication, and if the device of the next hop still uses the same channel as the device of the previous hop for communication, the probability of collision is very high, which seriously affects the communication quality. When the channel is evaluated, reasonable weight is set, the two aspects of the communication quality and the throughput of the channel are comprehensively considered, when the throughput is calculated, the collision probability, the proportion of fixed equipment, the total length of authentication request messages, the time for successfully transmitting a data packet, the transmission rate, the propagation delay and the like are considered, the optimal forwarding channel is selected, the forwarding efficiency is improved, and the intelligent home equipment can be accessed to the network in a residence with a large area.
In one embodiment, the link maintenance message further comprises:
a set CNLU for representing channel usage, so that the intermediate device and the devices in its neighbor device table mutually acquire the channel usage of each other,
the specific definition of the collection set CNLU is:
CNLU={(ch1,time1),(ch2,time2),…,(chi,timei),…,(chm,timem)}
where m denotes the total number of channels used by the intermediate device, chiNumber, time, indicating the ith used channeliRepresents the estimated occupation time of the ith used channel, i ∈ [1, m]。
In one embodiment, the communication quality of channel q is obtained by:
s1, using the following formula to fix the period TcqComputing the communication quality CQ of a channel qq:
In the formula, nqIs indicated in the fixed period TcqThe total number of messages received by the intermediate device on channel q; STIPNRq,sSignal to interference plus noise ratio (sNR) representing the s < th > message received by the intermediate device on channel q, s ∈ [1, n ∈q];Λq,sRepresenting a preset weight for the s message; STIPNRfirst,qIs indicated in the fixed period TcqThe signal to interference plus noise ratio of the 1 st message received by the intermediate device on channel q; STIPNRlast,qIs indicated in the fixed period TcqThe signal to interference plus noise ratio of the last 1 message received by the intermediate device on channel q;
s2, communication quality CQ of the channel qqStoring the data;
s3, with a fixed period TcqUpdating the link communication quality CQq。
In the above embodiment of the present invention, when calculating the communication quality of the channel, the signal-to-interference-plus-noise ratio of the plurality of messages received by the intermediate device in the fixed period is calculated, so that the balance between the accuracy and the timeliness of the communication quality of the channel is achieved, and accidental errors are avoided.
In one embodiment, the selecting an authentication path from the forwarding paths based on the set rule includes:
s1, receiving the first Ndl authentication request messages sent by the same device to be networked;
s2, calculating the quality of the authentication path included in each of the Ndl authentication request messages, specifically:
in the formula, FQaIndicating the quality of the authentication path, theta, contained in the received a-th authentication request message1And theta2Representing a preset weight parameter, theta1+θ21 is ═ 1; a denotes the received a-th authentication request message, a e [1, Ndl],mintaRepresents the minimum link duration, totalHop, carried on the a-th authentication request messageaRepresents the total number of intermediate devices passed by the a-th authentication request message;
s3, obtaining the authentication path according to the authentication request message with the highest authentication path quality, specifically:
and sequentially connecting the identification codes of each intermediate device, which are contained in the authentication request message and are arranged in sequence, and passed by the authentication request message, as the authentication path.
In the above embodiment of the present invention, when the authentication path is calculated, only the first Ndl authentication request messages are selected for authentication, thereby reducing the calculation pressure of the authentication management device. Because the arrival sequence of the request messages reflects the transmission speed of the path passed by the messages to a certain extent, only the first Ndl are selected, namely the channel with the top rank is selected for calculation, and the method is more reasonable and efficient. By weighting the two parameters of the minimum link duration and the total number of the intermediate devices, the user can realize preference setting, for example, the weight value of the parameter of the total number of the intermediate devices is set to be a little larger when the transmission speed is inclined. Therefore, balance is achieved between communication quality and communication speed, and an optimal authentication path is provided for enabling the intelligent household equipment to access the network in a residence with a large area.
In an embodiment, when encountering an authentication path interruption, the intermediate device initiates the same process as that of sending an authentication request message by a device to be networked to repair the path. And sending the repair result to the equipment to be accessed to the network and the authentication management equipment so that the equipment to be accessed to the network and the authentication management equipment update the authentication path.
Referring to fig. 2, an embodiment of the present invention provides a network distribution device for smart home devices, where the device includes a device to be networked 1 and an authentication management device 2, where:
the device to be networked 1 is used for establishing an authentication path for communicating with an authentication management device;
the device 1 to be networked is also used for communicating with the authentication management device 2 through the authentication path and receiving the authentication management device 2 to perform identity authentication on the device;
the device to be networked 1 is further configured to receive, through the authentication path, initialization configuration information sent by the authentication management device after the identity authentication is successful;
the device to be networked 1 is further configured to perform initialization setting according to the initialization configuration information, and access to an intelligent home network.
According to the embodiment of the invention, when the device 1 to be accessed is accessed into the intelligent home network, the authentication path is established first, so that the situation that the device 1 to be accessed and the authentication management device 2 always use a flooding method for communication in the accessing process is avoided, the communication congestion degree of the intelligent home network is effectively reduced, and a communication foundation is laid for long-distance multi-hop communication between the device 1 to be accessed and the authentication management device 2.
In an optional embodiment, the performing identity authentication includes: the administrator uploads the identification code and the verification public key of the equipment 1 to be accessed to the authentication management equipment 2; and the administrator uploads the authentication public key of the authentication management device 2 to the device to be networked 1 through Bluetooth or USB.
The device to be accessed to the network 1 encrypts the authentication public key of the authentication management device 2 by using a self authentication private key to generate an encryption verification message, and sends the encryption verification message to the authentication management device 2 through an authentication path, wherein the encryption verification message comprises an identification code of the device to be accessed to the network 1;
the authentication management device 2 calls a verification public key of the device 1 to be networked, which is uploaded by an administrator in advance, to decrypt the encrypted verification message according to the unique identification code of the device 1 to be networked, verifies whether the decrypted verification public key is correct or not, if the decrypted verification public key is correct, it is indicated that the device 1 to be networked passes identity authentication, and otherwise, the device 1 to be networked does not pass identity authentication.
In an embodiment, the device further includes an intermediate device 3, where the intermediate device 3 is all devices with wireless communication capability, except the device to be networked 1 and the authentication management device 2, in all smart home devices;
the establishing of the authentication path for communicating with the authentication management device includes:
the method comprises the steps that a device to be networked 1 broadcasts an authentication request message, the authentication request message is forwarded to an authentication management device 2 by an intermediate device 3, the authentication management device 2 receives the authentication request message from different forwarding paths, and an authentication path is selected from the forwarding paths based on a set rule;
the equipment to be accessed to the network 1 receives a path confirmation message which is sent by the authentication management equipment 2 through the selected authentication path and contains the selected authentication path;
and the equipment 1 to be accessed to the network obtains the authentication path according to the path confirmation message.
The embodiment of the invention solves the problem that the network distribution of the equipment to be networked 1 is difficult due to the limited coverage range of the wireless router in a residence with a large area through the function of the intermediate equipment 3. Since the device 1 to be networked is not necessarily placed in the vicinity of the authentication management device 2 in a residence with a large area, there may be a large spatial distance between the two, which is to implement multi-hop long-distance communication between the device 1 to be networked and the authentication management device 2 through the function of the intermediate device 3.
In one embodiment, the initial configuration information includes a network admission code for making the device possessing the network admission code an authenticated device for communicating with other authenticated devices.
The intermediate device 3 extracts the device identification code carried in the message for the message not carrying the network access code, records the times of receiving the message, and accumulates to the preset NlimitAnd after that, the intermediate device 3 pulls the device identification code into a blacklist, and does not forward the message sent by the device corresponding to the device identification code.
The background administrator may cause the intermediate device 3 to delete the device identification code from the blacklist by causing the authentication management device 2 to broadcast a blacklist release message carrying the device identification code.
In the above embodiment of the present invention, the authentication management device 2 is used to issue the network access code, so as to prevent the smart home network from being maliciously attacked by others, thereby preventing the smart home network from working abnormally. If the communication of the unauthenticated device in the smart home network is not limited, the unauthenticated device may continuously send spam messages to the smart home network by other people, so that the network bandwidth is occupied, and the use is influenced. However, the message of the unauthenticated device cannot be forwarded, because some devices 1 to be networked do not yet obtain the network access code, which is not favorable for the network access of the devices 1 to be networked.
In one embodiment, the authentication request message includes at least: the identification code of the equipment 1 to be accessed to the network, the channel number of the first three hops, the identification code set of the intermediate equipment 3 which has passed through and the minimum link duration mint;
the channel number of the first three hops is the number of a channel adopted when each intermediate device 3 forwards the authentication request message in 3 intermediate devices 3 through which the latest 3 hops of the authentication request message pass;
the passing identifier set of the intermediate device 3 includes identifiers of each intermediate device 3 through which the authentication request message passes, which are arranged in order;
the minimum link duration mint is the maintaining time of the link with the shortest total duration in the connected state among all the links through which the authentication request message passes;
the intermediate device 3 comprises a movable device and a fixed device;
the intermediate device 3 maintains a neighbor device table including devices that are located within the communication range of the intermediate device 3 and that are in communication with the communication link of the intermediate device 3;
the intermediate device 3 periodically exchanges link maintenance messages with each device in its neighbor device table.
In an alternative embodiment, the mobile device comprises an unmanned weeding machine, a sweeping robot, a robot steward; the fixed equipment comprises a wireless gateway, an intelligent lamp, an intelligent sound box and an intelligent lock.
In one embodiment, the intermediate device 3 comprises:
the judging module is used for judging whether the authentication request message is repeatedly received or not, and if so, discarding the authentication request message;
an updating module, configured to determine exT a link duration of a last hop link traversed by the authentication request message, compare exT the link duration with a minimum link duration mint in the authentication request message, and if exT < mint, update a value of mint in the authentication request message to a value of exT by the intermediary 3;
a writing module, configured to write the identifier of the intermediate device 3 into the authentication request message;
a selection module, configured to select a forwarding channel for the authentication request message, and write the number of the forwarding channel into a corresponding location in the authentication request message;
and the sending module is used for broadcasting the authentication request message by adopting the selected forwarding channel.
The previous-hop link refers to, for example, a previous-hop link in which device a receives an authentication request message broadcast by device B in its neighbor device table, and a path space for electromagnetic waves propagating between device a and device B in its neighbor device table is the previous-hop link.
In one embodiment, the update module comprises:
a first calculating unit, configured to, when receiving a link maintenance message, calculate, by the intermediate device 3, a communication distance L between the intermediate device 3 and a device that sends the link maintenance message in a neighbor device table according to signal strength of the link maintenance message;
a first storage unit configured to maintain a set sumDL, { DL }, for recording communication distance statuses of devices in the neighbor device table of the intermediate device 3
1,DL
2,…,DL
dIn which d ∈ [1, totalnum }]Totalnum is the total number of devices contained in the neighbor device table of the intermediate device 3,
i∈[1,N
t],N
tindicating the total number of link maintenance messages sent by the d-th device to the intermediate device 3 in the neighbor device table of the intermediate device 3 within the set sumDL calculation period T1; l is
d,iIndicating the communication distance between the d-th device in the neighbor device table of the intermediate device 3 and the k-th device when sending the link maintenance message to the intermediate device 3 within the calculation period T1;
a second storage unit for storing the set DL
dTwo adjacent elements in the set DL
dIs stored as a set tl
d,
Wherein,
to represent
And
deposit set DL
dThe time interval of (c);
a second calculation unit for calculating a set DLdVariance SD of element(s) in (1)DL,dIf SDDL,dLess than a set threshold SDTHIf yes, the second computing unit determines that the d-th device in the neighbor device table of the intermediate device 3 is a fixed device, and marks the device as a fixed device in the neighbor device table; taking active as the link duration T of the intermediate device 3 keeping connected with the d-th device in the neighbor device tabledActive is preset data, which indicates that the link can always keep connected,
otherwise, the second calculation unit calculates the link duration T by the following formulad:
In the formula,
Γ denotes the total duration t of the d-th deviced,i-2+td,i-1An average moving speed of the inner, Rad, representing a communication radius of the intermediate device 3;
a third storage unit for storing the link duration TdStoring the data;
an updating unit for updating the link duration T with a calculation period T1d。
In the above embodiment of the present invention, the communication distances of both communication parties are estimated according to the signal strength of the received link maintaining message, and then the link duration of the link between the intermediate node and the device in the neighbor device table is accurately calculated according to the communication radius of the intermediate node, the communication distances obtained through multiple measurements, and the measured time intervals. An update mechanism is also provided for updating the link duration of the intermediate device 3 with each device in its neighbor device table in time, since the intermediate device 3 comprises both a removable device and a fixed device, and the resulting link duration is not reliable if not updated. The method adopted by the embodiment is beneficial to providing accurate link duration for solving the problem that the intelligent household equipment is accessed to the network in a residence with a large area.
In one embodiment, the selection module includes:
a candidate channel calculation unit, configured to exclude the first three-hop channel number from all available channels, use the remaining channels as candidate channels, and record a set of candidate channels as CCS, where CCS is { cc }1,cc2,…,ccq,…,ccccnumCcnum is the total number of candidate channels, and q is the [1, ccnum-];
An evaluation parameter calculation unit, configured to calculate a forwarding evaluation parameter of a channel q in the candidate channel set, specifically:
calculating a forwarding evaluation parameter FEP of a channel q in a candidate signal set by using the following formulaq:
FEPq=λTGPq+μCQq
In the formula, CQ
qIndicating the communication quality of channel q, TGP
qWhich represents the throughput of the channel q,
P
colrepresenting the probability of collision of a data packet transmitted on channel q; ω represents the proportion of the number of fixed devices in the neighbor device table of the intermediate device to the total number of devices in the neighbor device table; psi denotes the use of the channel cc in the neighbor list of the intermediate device
iTotal number of devices of;L
pqmRepresenting a total number of bytes of the authentication request message; t is
avgIndicating the time required for the intermediate device to successfully transmit a packet on channel q,
wherein, T
headAverage time required for an intermediate device to transmit a packet header on channel q, sp representing the transmission rate of channel q, T
asceIndicating that the intermediate device is in channel cc
iReceiving the time required by an acknowledgement character ACK, wherein phi is the propagation delay of the data packet; λ and μ represent preset weight parameters, λ + μ ═ 1;
and the channel selection unit is used for taking the channel with the highest forwarding evaluation parameter as a forwarding channel.
In the above embodiment of the present invention, the authentication request message is forwarded in a multi-channel manner, thereby avoiding the problems of hidden terminals and exposed terminals occurring in a single channel. And when selecting the channel, the channel numbers of the first three hops are eliminated, and the possibility of channel collision among the intermediate devices 3 in the same area is further reduced. Because when a certain device successfully uses a certain channel for communication, the same channel is often used for transmission in the next communication, and if the device of the next hop still uses the same channel as the device of the previous hop for communication, the probability of collision is very high, which seriously affects the communication quality. When the channel is evaluated, reasonable weight is set, the two aspects of the communication quality and the throughput of the channel are comprehensively considered, when the throughput is calculated, the collision probability, the proportion of fixed equipment, the total length of an authentication request message, the time for successfully transmitting a data packet, the transmission rate, the propagation delay and the like are considered, and the method makes further contribution to the selection of the optimal forwarding channel and the realization of the access of the intelligent household equipment to the network in a residence with a large area.
In one embodiment, the link maintenance message further comprises:
a set CNLU for representing channel usage, so that the intermediate device 3 and the devices in its neighbor device table mutually acquire channel usage of each other,
the specific definition of the collection set CNLU is:
CNLU={(ch1,time1),(ch2,time2),…,(chi,timei),…,(Chm,timem)}
where m denotes the total number of channels used by the intermediate device 3, chiNumber, time, indicating the ith used channeliRepresents the estimated occupation time of the ith used channel, i ∈ [1, m]。
In one embodiment, the intermediate apparatus 3 further includes a communication quality calculation module for calculating communication quality of the channel;
the communication quality calculation module includes:
a communication quality calculation unit for employing the following formula to fix the period TcqComputing the communication quality CQ of a channel qq:
In the formula, nqIs indicated in the fixed period TcqThe total number of messages received by the intermediate device on channel q; STIPNRq,sSignal to interference plus noise ratio (sNR) representing the s < th > message received by the intermediate device on channel q, s ∈ [1, n ∈q];Λq,sRepresenting a preset weight for the s message; STIPNRfirst,qIs indicated in the fixed period TcqThe signal to interference plus noise ratio of the 1 st message received by the intermediate device on channel q; STIPNRlast,qIs indicated in the fixed period TcqThe signal to interference plus noise ratio of the last 1 message received by the intermediate device on channel q;
a communication quality storage unit for storing the communication quality CQ of the channel qqStoring the data;
a communication quality update unit for updating the communication quality with a fixed period TcqUpdating the link communication quality CQq。
In the above embodiment of the present invention, when calculating the communication quality of the channel, the signal to interference plus noise ratio of the plurality of messages received by the intermediate device 3 in the fixed period is calculated, so that the balance between the accuracy and the timeliness of the communication quality of the channel is achieved, and accidental errors are avoided.
In one embodiment, the authentication management device 2 includes an authentication module, and the authentication module is configured to receive the authentication request messages from different forwarding paths and select an authentication path from the forwarding paths based on a set rule;
the authentication module includes:
a receiving unit, configured to receive the first Ndl authentication request messages sent by the same device 1 to be networked;
an authentication path quality calculation unit, configured to calculate quality of an authentication path included in each of the Ndl authentication request messages, where the quality is specifically:
in the formula, FQaIndicating the quality of the authentication path, theta, contained in the received a-th authentication request message1And theta2Representing a preset weight parameter, theta1+θ21 is ═ 1; a denotes the received a-th authentication request message, a e [1, Ndl],mintaRepresents the minimum link duration, totalHop, carried on the a-th authentication request messageaRepresents the total number of intermediate devices 3 through which the a-th authentication request message passes;
an authentication path obtaining unit, configured to obtain, according to an authentication request message with a highest authentication path quality, a data authentication path from a sending device to the authentication management device 2, specifically:
the identification codes of each intermediate device 3, which are included in the authentication request message and are arranged in sequence, and through which the authentication request message passes, are connected in sequence to serve as the authentication path.
In the above embodiment of the present invention, when the authentication path is calculated, only the first Ndl authentication request messages that are set are selected for authentication, thereby reducing the calculation pressure of the authentication management apparatus 2. Because the arrival sequence of the request messages reflects the transmission speed of the path passed by the messages to a certain extent, only the first Ndl are selected, namely the channel with the top rank is selected for calculation, and the method is more reasonable and efficient. By weighting the two parameters of the minimum link duration and the total number of the intermediate devices 3, the user can implement preference setting, for example, the weighting value of the parameter of the total number of the intermediate devices 3 is set to be larger as the transmission speed is inclined. Therefore, balance is achieved between communication quality and communication speed, and an optimal authentication path is provided for enabling the intelligent household equipment to access the network in a residence with a large area.
In an embodiment, when encountering an authentication path interruption, the intermediate device initiates the same process as that of sending an authentication request message by a device to be networked to repair the path. And sending the repair result to the equipment to be accessed to the network and the authentication management equipment so that the equipment to be accessed to the network and the authentication management equipment update the authentication path.
In an embodiment, the invention further provides an intelligent home system, and the intelligent home system comprises the network distribution device of the intelligent home equipment.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the protection scope of the present invention, although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.