Summary of the invention
In view of the foregoing deficiencies of prior art, the purpose of the present invention is to provide a kind of wireless routing device and electronics
The wireless network access method of equipment solves the problems, such as that the above-mentioned access of smart machine in the prior art wireless network process is complicated.
To realize that above-mentioned target and other related objectives, the present invention provide a kind of wireless routing device, comprising: multicast message
Forwarding module, for forwarding the multicast message sent by multicast originator to multiple electronic equipments;Wherein, in the multicast message
Last three bytes of multicast mac address be used to load the configuration information of the wireless network, the configuration information includes: down
Number third byte sends mark for being set as first dielectric mark or data, and most latter two byte is respectively used to be set as institute's wireless network
The SSID and password of network, the length of the SSID and password are set as 0, so that each electronic equipment is from described group of casting
The configuration information of the wireless network is extracted in text and accesses the wireless network accordingly.
Optionally, the multicast message includes following several: the first data message: its multicast mac address it is third from the bottom
Byte is first dielectric mark, and most latter two byte is 0, and the first data message length is set as L;Second data message: its multicast
The byte third from the bottom of MAC Address is that data send mark, and most latter two byte is respectively the SSID length and Password Length,
Second data message length is L;Third data message: the byte third from the bottom of its multicast mac address is that data send mark, most
Latter two byte is respectively the SSID length and Password Length, and third data message length is incremented by one by one by order of transmission adds 1
And in L+1 to the value range of [L+ (SSID length+Password Length)/2];4th data message: its multicast mac address
Byte third from the bottom is that data send mark, and most latter two byte is 0, and the 4th data message length is passed one by one by order of transmission
Increase by 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2].
Optionally, in third data packet text, if SSID and Password Length add up as odd number, multicast MAC
Last byte of location is set to 0.
Optionally, the wireless routing device is successively to forward first data message, the second data message, third number
According to message and the 4th data message to each electronic equipment.
Optionally, first data message, the second data message, third data message and the 4th data message are each
Self weight recurrence is sent repeatedly.
To realize above-mentioned target and other related objectives, the present invention provides the wireless network access side of a kind of electronic equipment
Method, comprising: the multicast message that forwarding is sent by multicast originator to multiple electronic equipments;Wherein, the group in the multicast message
Last three bytes for broadcasting MAC Address are used to load the configuration information of the wireless network, and the configuration information includes: reciprocal the
Three bytes send mark for being set as first dielectric mark or data, and most latter two byte is respectively used to be set as institute's wireless network
SSID and password, the length of the SSID and password are set as 0;Each electronic equipment is extracted from the multicast message
The configuration information of the wireless network simultaneously accesses the wireless network accordingly.
Optionally, the multicast message includes following several: the first data message: its multicast mac address it is third from the bottom
Byte is first dielectric mark, and most latter two byte is 0, and the first data message length is set as L;Second data message: its multicast
The byte third from the bottom of MAC Address is that data send mark, and most latter two byte is respectively the SSID length and Password Length,
Second data message length is L;Third data message: the byte third from the bottom of its multicast mac address is that data send mark, most
Latter two byte is respectively the SSID length and Password Length, and third data message length is incremented by one by one by order of transmission adds 1
And in L+1 to the value range of [L+ (SSID length+Password Length)/2];4th data message: its multicast mac address
Byte third from the bottom is that data send mark, and most latter two byte is 0, and the 4th data message length is passed one by one by order of transmission
Increase by 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2].
Optionally, in third data packet text, if SSID and Password Length add up as odd number, multicast MAC
Last byte of location is set to 0.
Optionally, the wireless network access method of the electronic equipment, comprising: successively forward first datagram
Text, the second data message, third data message and the 4th data message are to each electronic equipment.
Optionally, first data message, the second data message, third data message and the 4th data message are each
Self weight recurrence is sent repeatedly.
As described above, the present invention provides the wireless network access method of a kind of wireless routing device and electronic equipment, pass through
The multicast message that forwarding is sent by multicast originator is to multiple electronic equipments;Wherein, the multicast mac address in the multicast message
Last three bytes be used to load the configuration information of the wireless network, the configuration information includes: that byte third from the bottom is used
Mark is sent in being set as first dielectric mark or data, and most latter two byte is respectively used to be set as the SSID of institute's wireless network and close
Code, the SSID and password length or be set as 0;Each electronic equipment extracts described wireless from the multicast message
The configuration information of network simultaneously accesses the wireless network accordingly;The present invention realizes more smart machines while accessing wireless network,
And the access of equipment wireless network can be realized without the support that user logs in smart machine and more hardware designs, reduce at
This.
Specific embodiment
Illustrate embodiments of the present invention below by way of specific specific example, those skilled in the art can be by this specification
Other advantages and efficacy of the present invention can be easily understood for disclosed content.The present invention can also pass through in addition different specific realities
The mode of applying is embodied or practiced, the various details in this specification can also based on different viewpoints and application, without departing from
Various modifications or alterations are carried out under spirit of the invention.It should be noted that in the absence of conflict, the embodiment in the application
And the feature in embodiment can be combined with each other.
As shown in Figure 1, the present invention provides a kind of wireless routing device 1, for example, router or the friendship with routing function
It changes planes comprising: multicast message forwarding module 11.
The multicast message forwarding module 11, for forwarding, by multicast originator, (such as mobile phone, tablet computer etc. are mobile eventually
End or other electric terminals) multicast message sent is to multiple electronic equipments 2;Wherein, multicast MAC in the multicast message
Last three bytes of location are used to load the configuration information of the wireless network, and the configuration information includes: byte third from the bottom
Mark is sent for being set as first dielectric mark or data, most latter two byte is respectively used to be set as the SSID of institute's wireless network
(Service Set Identifier, service set) and password, the length of the SSID and password are set as 0, for
Each electronic equipment 2 extracts the configuration information of the wireless network from the multicast message and accesses the wireless network accordingly
Network, in one embodiment, the wireless network are WiFi network, but are not limited thereto, and also can be other existing communications
Network.
In one embodiment, the multicast message includes following several: the first data message: its multicast mac address falls
Number third byte is first dielectric mark, and most latter two byte is 0, and the first data message length is set as L;Second data message:
The byte third from the bottom of its multicast mac address is that data send mark, and most latter two byte is respectively the SSID length and close
Code length, the second data message length are L;Third data message: the byte third from the bottom of its multicast mac address is data transmission
Mark, most latter two byte are respectively the SSID length and Password Length, and third data message length presses order of transmission one by one
It is incremented by and adds 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2];4th data message: its multicast
The byte third from the bottom of MAC Address is that data send mark, and most latter two byte is 0, and the 4th data message length is by transmission
Order is incremented by one by one adds 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2].
Referring to Fig. 2, introducing the principle of above-mentioned multicast message forwarding for an embodiment: the wireless routing device 1 be according to
It is secondary to forward first data message, the second data message, third data message and the 4th data message to each electronics
Equipment 2, in one embodiment, first data message, the second data message, third data message and the 4th datagram
Text respectively repeats to send repeatedly, such as 3 times.
As shown, A, B indicate the data of a byte, respectively represents first dielectric mark and data send mark.L is
The length of data message determines the sequencing of multicast message.
Specifically, in step: sending first dielectric mark (A), three bytes after MAC Address by the first data message
For A:00:00, message length is filled with L;
In stepb: the length of SSID and password are sent by the second data message, three bytes are B after MAC Address:
[SSID length]: [Password Length], message length L;
In step C: sending the ASCII character of SSID and password, three bytes after MAC Address by third data message sequence
For B:[data]: [data], the sequencing of message length determination data message is from L+1 to [(SSID length+password is long by L+
Degree)/2], for example, being followed successively by L+1 by each data message length of transmission sequence, L+2 ... is until [L+ (SSID length+password
Length)/2];Optionally, last byte of MAC Address is 0 if SSID and Password Length add up as odd number, i.e. B:[number
According to]: 00;
In step D: it is used as end of identification message by sending the 4th data message, three bytes are B:00 after MAC Address:
00, prolong as [L+ (SSID length+Password Length)/2]+1 after message length sequence.
Corresponding, each electronic equipment 2 may be, for example, intelligent appliance equipment, mobile terminal (smart phone or tablet computer)
And connect with the routing device, it is furthermore preferred that can each intelligent appliance equipment can pass through the intelligent socket with wireless network card
The information such as SSID, password are obtained from the multicast message, to connect the routing device and access the wireless network;Cause
This, present invention can apply in the smart home system of Internet of Things, realize simple and quick intelligent appliance equipment access network and
Transmission.
The process of Fig. 3 illustration is specifically seen, electronic equipment 2 is first scanned all channel, for determining transmission group
The channel of unicast packets router begins to receive multicast packets after determining channel.The state of starting is " initial ", is waited until always
Receive length and MAC Address meet the multicast packets of origin identification after switching state be " receiving length ";Then it waits and receiving
After length and MAC Address third byte meet the multicast packets of length mark, two length for SSID and password after MAC Address is recorded
Degree, and switching state is " receiving data ";MAC Address third byte is then met into " receiving data " state and receives length
Data in the range of " receiving data " state are stored in character array in order, if it is determined that data receiver is finished and received
To end of identification, then switching state is " terminating to receive ", and SSID and encrypted message are separated and controlled from character array
Electronic equipment 2 is connected to wireless network;Those skilled in the art according to the present invention should can teach and be realized and be changed,
Not it is limited with illustrated example.
As shown in figure 4, the present invention provides the wireless network access method of a kind of electronic equipment, technical principle is the same as above-mentioned reality
Apply that example is roughly the same, therefore the technical characteristic in above-described embodiment can be applied to the present embodiment in the absence of conflict, therefore
Duplicate technical characteristic is repeated no more;The described method includes:
Step S1: the multicast message that forwarding is sent by multicast originator to multiple electronic equipments;Wherein, the multicast message
In last three bytes of multicast mac address be used to load the configuration information of the wireless network, the configuration information includes:
Byte third from the bottom sends mark for being set as first dielectric mark or data, most latter two byte be respectively used to be set as it is wireless
The SSID and password of network, the length of the SSID and password are set as 0;
Step S2: each electronic equipment extracts the configuration information of the wireless network and accordingly from the multicast message
Access the wireless network.
In one embodiment, the multicast message includes following several: the first data message: its multicast mac address falls
Number third byte is first dielectric mark, and most latter two byte is 0, and the first data message length is set as L;Second data message:
The byte third from the bottom of its multicast mac address is that data send mark, and most latter two byte is respectively the SSID length and close
Code length, the second data message length are L;Third data message: the byte third from the bottom of its multicast mac address is data transmission
Mark, most latter two byte are respectively the SSID length and Password Length, and third data message length presses order of transmission one by one
It is incremented by and adds 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2];4th data message: its multicast
The byte third from the bottom of MAC Address is that data send mark, and most latter two byte is 0, and the 4th data message length is by transmission
Order is incremented by one by one adds 1 and in L+1 to the value range of [L+ (SSID length+Password Length)/2].
In one embodiment, in the third data packet text, if SSID and Password Length add up as odd number, multicast
Last byte of MAC Address is set to 0.
In one embodiment, the wireless network access method of the electronic equipment, comprising: successively forward first number
According to message, the second data message, third data message and the 4th data message to each electronic equipment.
In one embodiment, first data message, the second data message, third data message and the 4th datagram
Text respectively repeats to send multiple.
In conclusion the present invention provides the wireless network access method of a kind of wireless routing device and electronic equipment, pass through
The multicast message that forwarding is sent by multicast originator is to multiple electronic equipments;Wherein, the multicast mac address in the multicast message
Last three bytes be used to load the configuration information of the wireless network, the configuration information includes: that byte third from the bottom is used
Mark is sent in being set as first dielectric mark or data, and most latter two byte is respectively used to be set as the SSID of institute's wireless network and close
Code, the SSID and password length or be set as 0;Each electronic equipment extracts described wireless from the multicast message
The configuration information of network simultaneously accesses the wireless network accordingly;The present invention realizes more smart machines while accessing wireless network,
And the access of equipment wireless network can be realized without the support that user logs in smart machine and more hardware designs, reduce at
This.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.It is any ripe
The personage for knowing this technology all without departing from the spirit and scope of the present invention, carries out modifications and changes to above-described embodiment.Cause
This, institute is complete without departing from the spirit and technical ideas disclosed in the present invention by those of ordinary skill in the art such as
At all equivalent modifications or change, should be covered by the claims of the present invention.