A kind of method that WIFI module and multiple AP carry out WPS session negotiation simultaneously
Technical field
The present invention relates to a kind of method that WIFI module carries out WPS session negotiation with multiple AP simultaneously.
Background technology
Almost all of smart machine can realize online by WIFI with WIFI function, user,
Internet resources needed for acquisition, its application is ubiquitous.WIFI function there is one for safety even
The WPS technology connect, WPS is the abbreviation of WIFI Protected Setup, is the most up-to-date one
Be applied in wireless network provides the simple mode connected, and receives and is divided into PBC, PIN, and
NFC tri-kinds.WPS can effectively simplify the connection procedure between WIFI module and AP, and provides
Protection mechanism safely and efficiently, wherein AP is the abbreviation of Access Point, i.e. wireless access points.
But existing WPS mechanism all there is a problem in that when WIFI module is carried out with an AP
The when that WPS connecting, when WIFI module receives the beacon frame (Beacon of the WPS of other AP
Frame, is that AP starts the data externally sent after WPS connects, declares that this AP starts WPS
Connecting, WIFI module can obtain the information of AP by beacon frame) time, assist according to the WPS of standard
Discuss then WIFI module and can send signal reject frame (i.e. WSC_NACK, expression WIFI equipment at once
Refusal carries out WPS with AP and is connected), cause WIFI module can not while carry out with other AP
WPS connects.This just brings an inconvenient place: if WIFI module is carried out with this AP
WPS connection failure after, user must manually restart WIFI module WPS connect, ability
It is attached with second AP, adds the operating procedure of user.
Summary of the invention
The technical problem to be solved in the present invention, is to provide a kind of WIFI module to enter with multiple AP simultaneously
The method of row WPS session negotiation, solves the problem that existing WPS Connection Step is loaded down with trivial details.
The present invention is achieved in that
A kind of method that WIFI module and multiple AP carry out WPS session negotiation simultaneously, it is characterised in that:
Comprise the steps:
Step 10, use WIFI module obtain the AP signal that around pending WPS connects, record
The AP signal got;
Step 20, from the AP signal recorded select an AP signal;
Step 30, use WIFI module carry out WPS connection to the AP signal selected, and detection is even
Access node fruit;
If step 40 connection result is successfully, then terminate session negotiation process or to all unselected
The AP signal selected sends AP signal reject frame and terminates session negotiation process;Otherwise connection result is for losing
Lose, detect whether the most non-selected AP signal;
If step 50 the most non-selected AP signal, then from non-selected AP signal, select one
AP signal, returns step 30;Without unselected AP signal, then terminate session negotiation process.
Further, in described step 30, use WIFI module that the AP signal selected is carried out
What WPS connected concretely comprises the following steps:
Use the WIFI module AP signal to having selected to send certification start frame, set the first time-out time,
Wait receiver module identification request frame, if the first time-out time to and do not receive module id claim frame,
Then connection failure;
In the first time-out time, otherwise receive module id claim frame, then use WIFI module to send mould
Block identification acknowledgement frame, sets the second time-out time, waits initiation requests frame to be received, if during the second time-out
Between to and do not receive initiation requests frame, then connection failure;
In the second time-out time, otherwise receive initiation requests frame, then use WIFI module sending module to recognize
Card information frame, set the 3rd time-out time, wait routing iinformation frame waiting, if the 3rd time-out time to and
Do not receive routing iinformation frame, then connection failure;
Otherwise in the 3rd time-out time, receive initiation requests frame, then successful connection.
Further, in step 20 to step 50, if there being get Unrecorded pending
The AP signal that WPS connects, then record this AP signal.
Further, described AP is Soft AP.
And the present invention carries out the system of WPS session negotiation, bag while also provide for a kind of with multiple AP
Containing WIFI module, it is characterised in that: include such as lower module:
Signal acquisition module: the AP letter that around pending WPS connects for using WIFI module to obtain
Number, the AP signal that record gets;
Signal selection module: for selecting an AP signal from the AP signal recorded;
Signal link block: for using WIFI module that the AP signal selected is carried out WPS connection,
Detection connection result;
Signal detection module: if being successfully for connection result, then terminate session negotiation process or right
All unselected AP signals send AP signal reject frame and terminate session negotiation process;Otherwise connect
Result is unsuccessfully, detects whether the most non-selected AP signal;
And signal reselection module: if for the most non-selected AP signal, then from non-selected AP
Signal selects an AP signal, and is delivered to signal link block;Without unselected AP
Signal, then terminate session negotiation process.
Present invention have the advantage that user only needs to start a WPS and connects, it is possible to open with multiple
The AP of dynamic WPS carries out WPS session negotiation, and completes network connection when there being available network to connect,
Simplify connection procedure, serve good effect.
Accompanying drawing explanation
The present invention is further illustrated the most in conjunction with the embodiments.
Fig. 1 is that the method for the present invention performs flow chart.
Fig. 2 is the system structure schematic diagram of the present invention.
Detailed description of the invention
Incorporated by reference to Fig. 1 and Fig. 2, embodiments of the present invention will be explained in detail below.
A kind of method that WIFI module and multiple AP carry out WPS session negotiation simultaneously, this session negotiation
Flow process start from step S101, in step S101, use WIFI module to obtain the most pending around
The AP signal that WPS connects, the AP signal that record gets.AP signal operationally can broadcast letter
Mark frame (beacon frame), by getting beacon frame, WIFI module judges whether AP signal is in
Pending WPS connection status, having got AP signal that pending WPS connects can direct record
On a memory.
Subsequently in step S102, the AP signal recorded from step S101 selects one
AP signal.An AP signal can be randomly choosed or according to the Connection Time getting AP signal
Select an AP signal in order.The most first use WIFI module in step S102
In the AP signal that selected carry out WPS connection, then detect connection result, i.e. detect in step S104
Connection result is the most successful.
The AP signal selected carries out be generally adopted by EAPOL or EAP when WPS connects recognize
(Extensible Authentication Protocol, is EAP to card mechanism, is one
The authentication mechanism commonly used, is commonly used in the connection of wireless network or point-to-point).WPS connects
Key step as follows: use WIFI module that the AP signal that selected is sent certification start frame
(EAP-Start), set the first time-out time, wait receiver module identification request frame
(EAP-Request/identity), if the first time-out time to and do not receive module id claim frame,
Then connection failure.
In the first time-out time, otherwise receive module id claim frame, then use WIFI module to send mould
Block identification acknowledgement frame (EAP-Response/identity), sets the second time-out time, waits to be received
Beginning claim frame (EAP-Request (Start)), if the second time-out time to and do not receive initiation requests frame,
Then connection failure.
In the second time-out time, otherwise receive initiation requests frame, then use WIFI module sending module to recognize
Card information frame (EAP-Response(M1)), set the 3rd time-out time, wait routing iinformation waiting
Frame (EAP-Request (M2D)), if the 3rd time-out time to and do not receive routing iinformation frame, then
Connection failure;Otherwise in the 3rd time-out time, receive initiation requests frame, then successful connection.Above-mentioned setting
After one time-out time, if time-out does not receives reply, then may work abnormal by AP, then connect mistake
Lose.The routing iinformation got just can be used after successful connection to carry out the connection surfed the Net.
If connection result is successfully, then enters step S107 and all unselected AP signals are sent
AP signal reject frame also enters step S108 and terminates session negotiation process, it is also possible to directly terminate WPS
Session negotiation process, does not processes unselected AP signal.Otherwise connection result is unsuccessfully,
Then enter step S105 and detect whether the most non-selected AP signal.
If the most non-selected AP signal, the most untreated AP signal, then enter step S106
From non-selected AP signal, select an AP signal, return step S103, i.e. circular treatment, connect
The AP signal that after failure, reselection one did not process is attached.Without unselected AP
Signal, the most all of AP signal is all disposed, then enter step S108 and terminate session negotiation process.
If simultaneously in step S103 to step S107, if there being get Unrecorded pending
The AP signal that WPS connects, then record this AP signal.Unrecorded pending WPS is connected
AP signal record get off these AP signals can be attached when session negotiation failure attempt.
The AP carrying out WPS session negotiation can be common router AP or be Soft AP, Soft AP
It is that AP simulated by software, AP can be simulated with software at notebook or intelligent movable equipment.
The present invention also provides for a kind of system realizing the inventive method simultaneously, with multiple AP while of i.e. a kind of
Carry out the system of WPS session negotiation, as in figure 2 it is shown, native system includes signal acquisition module 1, letter
Number select module 2, signal link block 3, signal detection module 4 and signal reselection module 5, its
In:
Signal acquisition module 1: for using WIFI module to obtain the AP that around pending WPS connects
Signal, the AP signal that record gets;
Signal selection module 2: for selecting an AP signal from the AP signal recorded;
Signal link block 3: for using WIFI module the AP signal selected to carry out WPS even
Connect, detect connection result;
Signal detection module 4: if for connection result be successfully, then terminate session negotiation process or
All unselected AP signals are sent AP signal reject frame and terminates session negotiation process;Otherwise connect
Access node fruit is unsuccessfully, detects whether the most non-selected AP signal;
And signal reselection module 5: if for the most non-selected AP signal, then from non-selected AP
Signal selects an AP signal, and is delivered to signal link block;Without unselected AP
Signal, then terminate session negotiation process.
By the present invention, WIFI module can simultaneously scan for and store multiple WPS session, and order performs,
Until one of them WPS session success or all failures.The present invention only starts a WPS and connects,
Just can carry out WPS session negotiation with the AP of multiple startup WPS, serve good effect.
Although the foregoing describing the detailed description of the invention of the present invention, but it is familiar with the technology people of the art
Member should be appreciated that our described specific embodiment is merely exemplary rather than for this
The restriction of bright scope, those of ordinary skill in the art are in the equivalence made according to the spirit of the present invention
Modify and change, all should contain in the scope of the claimed protection of the present invention.