Background technology
Wi-Fi(WirelessFidelity), Chinese name Wireless Fidelity, is the technology that can the terminals such as PC, handheld device (such as PAD, mobile phone) wirelessly be interconnected of one, and in fact it is a high frequency radio signal。At present, form a WLAN and adopt Wi-Fi very at large, such WLAN has a wireless access point AP, it is usually one wireless router of employing as WAP, other wireless device is by being linked into the Internet by AP, and the terminal (equipment) that wireless aps is communicated by Wi-Fi and AP with some forms a WLAN。
The equipment of tool Wi-Fi function is also referred to as Wi-Fi equipment, and these equipment generally have wireless network card: as PC, game machine, smart mobile phone or digital audio-frequency player can be connected to network from the wireless network in scope。It is little of several rooms that one or more (interconnection) access point of its coverage is referred to as focus-can form an area, or big such as many sq. mi。
Wi-Fi equipment is owing to adopting wireless connections without wiring, real life use more and more extensive, particularly in Smart Home, by Wi-Fi can by all intelligent home devices in family such as electric refrigerator, washing machine, CCTV camera, television set even family time other kitchen and toilet facility can connect into a LAN and realize unified management。
At present, when Wi-Fi equipment is linked in wireless network by AP, first it is that Wi-Fi equipment passes through scanning, find to have in a channel in 13Wi-Fi channel of regulation have electromagnetic wave signal, then, by this channel title (SSID) to up this AP of confirmation and password, only password correctly could allow Wi-Fi equipment to be networked by this AP, completes Wi-Fi parameter configuration。This owing to having Man Machine Interface such as keyboard and display etc., is all very easily for a lot of Wi-Fi equipment such as mobile phone, notebook computer and other computer equipment。But a lot of Wi-Fi equipment are due to the interface without display screen or other man-machine interaction, when when installing for the first time, require over external cable network, serial ports, equipment is carried out Wi-Fi parameter configuration (including SSID, key etc.) by the modes such as USB interface, in order to allow equipment can be linked in correct access point (hereinafter referred to as AP), both add equipment cost, use inconvenience very。Additionally some AP and Wi-Fi equipment support that one is WPS(Wi-FiProtectedSetup, Wi-Fi protection setting) technology, in use, as long as by the next button being WPS on AP and equipment, the wireless connections of encryption can be set up between。But using the WPS most basic requirement simplifying network security configuration is exactly that AP and equipment must pass through WPS certification, if a side is not over certification, all cannot realize WPS function。And due to the difference between each manufacturer, the problem that the AP of different brands and equipment also there will be compatibility。Also have some Wi-Fi equipment then to adopt and be first operated in ap mode, to allow the Wi-Fi equipment with man-machine interface first access the AP of equipment to be configured, set up wireless connections, then the Wi-Fi parameter arranged will be needed to be sent to equipment to be configured, after equipment to be configured receives parameter, reconvert returns general mode, is linked in the AP of target。This pattern not only complicated technology realization, and use procedure is loaded down with trivial details, and Consumer's Experience is bad。
Summary of the invention
The present invention is to solve that some do not have the Wi-Fi equipment of the interface of display screen or other man-machine interaction, when installing for the first time, require over external cable network, serial ports, equipment is carried out Wi-Fi parameter configuration by the modes such as USB interface, in order to allows equipment can be linked in correct access point, had both added equipment cost, use inconvenience very, it is provided that a kind of Wi-Fi method for parameter configuration。
The technical scheme is that a kind of Wi-Fi method for parameter configuration, by the Wi-Fi equipment with human-computer interaction device that is connected with AP as configurating terminal, it is achieved the Wi-Fi equipment of other this AP to be accessed is configured, comprises the following steps:
Step 1, configurating terminal will need all Wi-Fi parameters arranging Wi-Fi equipment to be configured to be converted to IP multicast packets according to the form set, and send;
Step 2, Wi-Fi equipment to be configured open the monitoring pattern of equipment Wi-Fi, monitoring wireless packet on all Wi-Fi channels in turn;
Step 3, at any one Wi-Fi channel-monitoring and receive wireless data packet when Wi-Fi equipment to be configured, according to the mode resolution data bag set, it is thus achieved that Wi-Fi parameter;
Step 4, after Wi-Fi equipment to be configured receives complete Wi-Fi parameter information, cease listening for pattern, and the Wi-Fi that the parameter received is set to oneself access target component, is connected to AP wireless router;
The Wi-Fi password of the above-mentioned SSID that Wi-Fi parameter is AP and access AP。
In the present invention, the Wi-Fi equipment to be configured of working as not having man-machine interaction means is configured as the configurating terminal operated by can conveniently carry out the mobile terminal of man-machine interaction, convenient and practical。
The present invention by the packet sent is processed, can also strengthen safety during configuration。: as described in step 1 in the packet that sends also includes UID and the password of Wi-Fi equipment to be configured, during Wi-Fi equipment resolution data bag to be configured in described step 3, only identical with this Wi-Fi equipment to be configured UID and password just turn to step 4。
Also including the UID of Wi-Fi equipment to be configured in the packet sent in described step 1, during Wi-Fi equipment resolution data bag to be configured in described step 3, only identical with this Wi-Fi equipment to be configured UID just turns to step 4。
In described step 1, the data that send first are encoded when sending IP multicast packets by configurating terminal, carry out an XOR together with and access the Wi-Fi password of AP or equipment UID is also added the password of Wi-Fi equipment to be configured to the SSID of AP;In step 3, Wi-Fi equipment resolution data Bao Shihou to be configured, the data received are carried out an XOR again with equipment UID own, it is possible to restore the SSID of AP and access the Wi-Fi password of AP。
Below in conjunction with specific embodiment, the present invention is described in more detail。
Embodiment 1, in the present embodiment, utilize a mobile terminal such as mobile phone, as configurating terminal, other Wi-Fi equipment to be configured is carried out Wi-Fi parameter configuration, which is suitable in a kind of intelligent domestic system, all intelligent home devices are connected in WLAN, first have to guarantee that operating handset is under Wi-Fi mode, and have already accessed in same target AP wireless router。Mobile terminal will need to arrange all Wi-Fi parameters of equipment, SSID including target AP, with the key etc. being linked into required for target A, according to the mode specified, content of parameter is converted to one by one by byte different IP multicast (Multicast) addresses, and sends multicast packets。Mobile terminal, when sending multicast packets, can adopt the mode that timing sends in turn, to guarantee that equipment can completely receive all of multicast packets。
Needing some in Wi-Fi equipment to be configured i.e. Smart Home are not had man-machine interaction means household electrical appliances, such as refrigerator, washing machine and CCTV camera etc., when carrying out Wi-Fi parameter configuration, open the monitoring pattern of this Wi-Fi equipment Wi-Fi to be configured, this is to specify in 802.11 agreements, 802.11 wireless data frame are monitored in turn on all 13 Wi-Fi channels, and according to mac address filter multicast packet。
Owing to after the multicast address of rear 23bit and the IP of MAC Address, 23bit is corresponding, when mobile phone transmits packets to different target ip multicast address, it is possible to correspond to different Destination MAC multicast address。Wi-Fi equipment to be configured, by monitoring and receive 802.11 packets of radio link layer, the rule according to destination-mac address, therefrom filters out multicast packets, it is possible to restored by the Wi-Fi parameter information wherein carried。
During Wi-Fi equipment uppick multicast packets to be configured, according to destination-mac address, calculate check bit therein distinguishes whether we apply required multicast packets。If not then abandoning。If it is according to bag sequence number, corresponding content of parameter is extracted, until having received all of content of parameter。
After Wi-Fi equipment to be configured receives complete Wi-Fi parameter information, cease listening for pattern, and the Wi-Fi that the parameter received is set to oneself accesses target component, is connected to correct AP wireless router。
Now mobile phone should have been networked successfully by aware device, stops sending Wi-Fi parameter information。
Whenever, user can pass through the mode such as software or hardware, is reset to by equipment under monitoring duty, and the parameter re-starting Wi-Fi is arranged。
Table 2 represents that the SSID of AP is " IMAGIN ", AP key is " and 88888888 ", device password is " 12345 ", and equipment UID is the coded system of " 0214010000001 "。
We can carry out Wi-Fi content of parameter being converted to IP multicast address and sending in the following way, and wherein IP multicast address is 4 bytes, and we use therein low 23, such as table 1 below
Table 1
Multicast address 4 bytes=239(fixes)
=sequence number (starting to be incremented by from 0, less than 127) that multicast address the 3rd byte (uses 7BIT)
Multicast address the 2nd byte=coding (parameter XOR UID)
Multicast address the 1st byte=verification and (sequence number+parameter)
Table 2: be one group of IP multicast packets example by Wi-Fi Parameters Transformation
Illustrate,
1), when taking sequence number 7bit, whole parameter information length are less than 127 characters;
2) sending multicast packets real data length can be fixed value, such as 8 bytes, does not exceed the length of a Wi-Fi isl frame, to prevent link layer burst;
3) verification is with optional, it is simple to distinguish the multicast packets of other application or our application during equipment receiving data bag。
4) when do not use verification and time, it is possible to 16bit expression content character, it is possible to support that content of parameter is UNICODE character set。
5) content of parameter ending should add ending symbol ' 0 ', it is simple to recipient judges whether content receives completely。
6) content of parameter can be carried out certain conversion and encryption to prevent network interception, in arranging message, content of parameter is carried out XOR encryption by the UID of input equipment, to guarantee that the equipment only with this UID just can solve correct content of parameter, it is ensured that equipment safety operation。In content of parameter, last ending symbol is not encrypted, it is simple to recipient judges whether to have been received by complete content of parameter。
7) in arranging message, input equipment password guarantees that only validated user just can be configured operation。
In the method that by mobile phone other Wi-Fi equipment to be configured carried out parameter configuration above, the password by the SSID of AP and addition AP can be realized and be sent to Wi-Fi equipment to be configured by the mode of multicast, the Wi-Fi equipment of all configurations in AP sphere of action, it it is no matter legal Wi-Fi equipment to be configured, or other equipment with Wi-Fi function receives this packet such as through monitoring pattern, if mobile phone sends, these packets are not processed, some then can be made originally should not to add the Wi-Fi function of this AP and can also pass through the SSID resolving these packets acquisition AP with the password adding AP thus realizing " rubbing net "。Additionally, if Wi-Fi equipment to be configured is exactly in other AP sphere of action, it is possible to scan the channel of other AP, receive the multicast packet that in other AP, any terminal sends, will be joined by same mode in the wireless network of other AP, it is possible to information leakage can be caused。Therefore, in the present embodiment, also obtaining the UID of legal Wi-Fi equipment to be configured in advance and arrange password in the Wi-Fi equipment that this is to be configured, UID refers to the unique identifier (UniqueIdentifier) of equipment here, it is made up of numeral or character string, is used for distinguishing distinct device。The password of Wi-Fi equipment to be configured is packed together with adding the password of AP with the SSID of AP, in the information sent on such mobile phone, including SSID+ key+device password+UID, equipment is after parsing content of parameter, device password therein is verified, the only identical configuration just carrying out next step of password, so that it is guaranteed that the user only authorized just can initiate the configuration operation of Wi-Fi parameter。It addition, Wi-Fi equipment to be configured is after receiving such multicast packet, detect UID, it is possible to know whether and be intended for this Wi-Fi equipment to be configured。
Additionally, in order to reduce " rubbing net " and prevent eavesdropping, when mobile phone sends multicast packets, by Wi-Fi equipment UID to be configured to above-mentioned device password, the content of parameter such as SSID and the WIFI password of AP carry out an XOR, after Wi-Fi equipment to be configured receives this coding, an XOR is carried out again with the UID of oneself, the UID of the Wi-Fi equipment only to be configured and UID sending coding use is identical just can parse correct content of parameter, restores SSID and WIFI password and device password。Thus it is possible to prevent simple eavesdropping and " rubbing net ", is also possible to prevent other Wi-Fi equipment in maloperation network simultaneously。
Concrete mobile phone sends the flow process of Wi-Fi parameter coding as shown in Figure 1:
Start, by SSID, key, Wi-Fi equipment password to be configured composition parameter word symbol string;
Then, the UID XOR of parameter character string with Wi-Fi equipment to be configured is encoded;Start to take a character from the first character of encoded content, a to the last character every time;
Convert characters to target multicast address, send multicast packets to target multicast address。
Finally detecting whether Wi-Fi equipment to be configured configures, this can look into from the network neighbor of LAN。
Wi-Fi equipment to be configured receives with process of analysis as shown in Figure 2:
First Wi-Fi equipment to be configured opens Wi-Fi listening functions, from first Wi-Fi channel, whole 13 Wi-Fi channels is scanned。
Receive the multicast packets of 802.11 frames in any one channel, if any。
Extracting the multicast address of multicast packets, and detect whether it meets definition coding rule, only when meeting definition coding rule, just according to definition rule, multicast packets address being converted to sequence number and character, until receiving complete content of parameter。
With the UID of the Wi-Fi equipment to be configured parameter character string XOR to receiving itself;The device password of SSID, key and Wi-Fi equipment to be configured itself is extracted from parameter character string。
Check that whether the device password of SSID above, key and Wi-Fi equipment to be configured itself is complete, simultaneously, the device password of Wi-Fi equipment to be configured itself is compared, only the device password of the whether complete Wi-Fi equipment simultaneously to be configured of the device password of SSID, key and Wi-Fi equipment to be configured itself itself is correctly just configured in this Wi-Fi equipment to be configured, stop Wi-Fi listening functions, terminate。