Disclosure of Invention
In view of the above-mentioned shortcomings in the prior art, the present disclosure provides a wireless network access method and a wireless access point.
As a first aspect of the present disclosure, there is provided a wireless network access method, including:
receiving a verification request sent by a shared server, and acquiring a random number and a first encryption result in the verification request, wherein the verification request is sent to the shared server after a first wireless access point receives a connection request sent by a terminal, and the first encryption result is generated by encrypting the random number by the terminal;
encrypting the random number to obtain a second encryption result, and determining a comparison result according to the first encryption result and the second encryption result;
and sending the comparison result to the first wireless access point through the sharing server so that the first wireless access point can determine whether to allow the terminal to access a wireless network corresponding to the first wireless access point according to the comparison result.
Preferably, encrypting the random number to obtain a second encryption result includes:
and encrypting the random number by using a preset secret key shared with the terminal to obtain the second encryption result.
Preferably, the method further comprises:
and sending the identification of the second wireless access point and the address corresponding to the identification to the shared server for storage so as to register on the shared server.
As a second aspect of the present disclosure, there is provided a wireless network access method, the method including:
responding to a connection request sent by a terminal, generating a random number, and sending the random number to the terminal;
sending a verification request carrying the random number and a first encryption result to a second wireless access point through a sharing server in response to receiving the first encryption result generated by encrypting the random number and sent by the terminal, wherein the second wireless access point is a wireless access point to which the terminal belongs;
receiving a comparison result sent by the shared server, wherein the comparison result is that the second wireless access point encrypts the random number to generate a second encryption result, and the comparison result is sent to the shared server after being determined according to the first encryption result and the second encryption result;
and determining whether the terminal is allowed to access the wireless network corresponding to the first wireless access point or not according to the comparison result.
Preferably, the determining whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result includes:
and in response to determining that the first encryption result is consistent with the second encryption result, determining to allow the terminal to access the wireless network corresponding to the first wireless access point.
As a third aspect of the present disclosure, there is provided a wireless access point, comprising:
the terminal comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a verification request sent by a shared server, and the verification request is sent to the shared server after a first wireless access point receives a connection request sent by a terminal;
an obtaining module, configured to obtain a random number and a first encryption result in the verification request, where the first encryption result is generated by encrypting the random number by the terminal, and the second wireless access point is a wireless access point to which the terminal belongs;
the determining module is used for encrypting the random number to obtain a second encryption result and determining a comparison result according to the first encryption result and the second encryption result;
a sending module, configured to send the comparison result to the first wireless access point through the sharing server, so that the first wireless access point determines whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result.
Preferably, in the encryption module, the encryption module encrypts the random number to obtain a second encryption result, and is specifically configured to:
and encrypting the random number by using a preset secret key shared with the terminal to obtain the second encryption result.
Preferably, the sending module is further configured to send the identifier of the second wireless access point and the address corresponding to the identifier to the shared server for storage, so as to register on the shared server.
As a fourth aspect of the present disclosure, there is provided a wireless access point, the method comprising:
the generating module is used for responding to a received connection request sent by a terminal and generating a random number;
a sending module, configured to send the random number to the terminal; sending a verification request carrying the random number and a first encryption result to a second wireless access point through a sharing server in response to receiving the first encryption result generated by encrypting the random number and sent by the terminal, wherein the second wireless access point is a wireless access point to which the terminal belongs;
a receiving module, configured to receive a comparison result sent by the shared server, where the comparison result is that the second wireless access point encrypts the random number to generate a second encryption result, and sends the second encryption result to the shared server after determining the comparison result according to the first encryption result and the second encryption result;
and the determining module is used for determining whether the terminal is allowed to access the wireless network corresponding to the first wireless access point according to the comparison result.
Preferably, the determining module is specifically configured to:
and in response to determining that the first encryption result is consistent with the second encryption result, determining to allow the terminal to access the wireless network corresponding to the first wireless access point.
In the embodiment of the disclosure, the second wireless access point receives the authentication request sent by the shared server, and acquires the random number and the first encryption result therein. And the second wireless access point encrypts the random number to obtain a second encryption result, determines a comparison result according to the first encryption result and the second encryption result, and sends the comparison result to the first wireless access point. And the first wireless access point determines whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result. Adopt more fair mode sharing wifi, when the terminal removes the unable territory district that covers of home country wifi, can connect others' wifi to the wifi of home country at terminal can externally provide service, improves the utilization ratio of the wifi of home country at terminal, improves communication efficiency, promotes user experience.
Detailed Description
For a better understanding of the technical aspects of the present disclosure, reference is made to the following detailed description taken in conjunction with the accompanying drawings.
In order to adopt more fair mode sharing wifi to improve the utilization ratio of the wifi of affiliation at terminal, improve communication efficiency, promote user experience. The disclosure provides a wireless network access method and a wireless access point. The following detailed description is made with reference to the accompanying drawings which respectively illustrate embodiments provided by the present disclosure.
Fig. 1 shows a flowchart of a wireless network access method on a second wireless access point side according to an embodiment of the present disclosure. The wireless network access method can be applied to a second wireless access point, namely a wireless access point to which the terminal belongs. As shown in fig. 1, the wireless network access method provided in this embodiment includes the following steps.
Step S101, receiving an authentication request sent by the sharing server.
Step S102, the random number and the first encryption result in the verification request are obtained.
Step S103, encrypting the random number to obtain a second encryption result, and determining a comparison result according to the first encryption result and the second encryption result.
And step S104, sending the comparison result to the first wireless access point through the sharing server, so that the first wireless access point determines whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result.
The first wireless access point is a wireless access point (e.g., visitwife) to which the terminal applies for access, and the second wireless access point is a wireless access point (e.g., homewife) to which the terminal belongs. The verification request is sent to the shared server after the first wireless access point receives the connection request sent by the terminal, and the first encryption result is generated by the terminal through encryption of the random number.
According to the wireless network access method provided by the embodiment of the disclosure, when the terminal moves to a place which cannot be covered by the second wireless access point, a nearby wireless network is automatically searched, namely, the wireless network of the first wireless access point is searched, the terminal sends a connection request to the first wireless access point, the first wireless access point generates a random number and sends the random number to the terminal, and the terminal encrypts the random number to generate a first encryption result and then sends the first encryption result to the first wireless access point. The first wireless access point sends an authentication request carrying the random number and the first encryption result to the sharing server, the sharing server forwards the authentication request to the second wireless access point, and the authentication request is used for assisting the first wireless access point in authenticating whether the terminal is reliable or not. The second wireless access point encrypts the random number to obtain a second encryption result, and determines a comparison result according to the first encryption result and the second encryption result. The second wireless access point sends the comparison result to the first wireless access point through the sharing server. And the first wireless access point determines whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result. Therefore, the second wireless access point is used to verify whether the terminal is reliable, that is, to assist in verifying whether the first wireless access point allows the terminal to access the wireless network corresponding to the first wireless access point.
In the embodiment of the disclosure, wifi is shared in a relatively fair manner, when the terminal moves to a region where the wifi of the terminal cannot cover, wifi of other people can be connected, and the wifi of the terminal can provide services externally, so that the utilization rate of the wifi of the terminal is improved, the communication efficiency is improved, and the user experience is improved.
It should be noted that the comparison result includes that the first encryption result is consistent with the second encryption result, or that the first encryption result is inconsistent with the second encryption result.
In a preferred embodiment, the connection request includes the terminal name and the radio access point identity of the second radio access point. The authentication request also includes the terminal name and the identity of the second wireless access point. When the sharing server locally queries a public network ip (Internet Protocol, inter-network interconnection Protocol) address corresponding to the identifier of the second wireless access point in the verification request, it is described that the second wireless access point to which the terminal belongs stores the identifier of the second wireless access point and the corresponding public network ip address locally in advance, and the second wireless access point is added into the sharing server and is willing to share wifi of the second wireless access point. Thus, it is determined that the second wireless access point is authenticated, and the shared server may then forward the verification request to the second wireless access point.
Further, in step S103, encrypting the random number to obtain a second encryption result includes: and encrypting the random number by using a preset secret key shared with the terminal to obtain a second encryption result.
In this step, after receiving the random number sent by the sharing server, the second wireless access point encrypts the random number according to a preset algorithm by using a preset key shared with the terminal to obtain a second encryption result.
It should be noted that, the first encryption result is obtained by encrypting, according to a preset algorithm, the terminal by using a preset key shared with the second wireless access point after receiving the random number sent by the first wireless access point.
In some embodiments, the wireless network access method further comprises: and sending the identification of the second wireless access point and the address corresponding to the identification to a shared server for storage so as to register on the shared server.
In the initial stage of the embodiment of the disclosure, a sharing server is constructed, all wifi willing to be shared are written into the sharing server, and all terminals added into the sharing server allow normal access to other wifi in the sharing service. Each terminal has its own home wireless access point (i.e., the second wireless access point in the embodiment of the present disclosure), for example, homewifi (home wifi), and has a shared preset key with the home second wireless access point, and each terminal can normally access the wireless network of its own home second wireless access point. And the second wireless access point to which each terminal belongs sends the identification of the second wireless access point and the corresponding address (the ip address of the public network) to the sharing server for storage, and the sharing server writes the information into a wifi list in the sharing server after receiving the information, so that the registration of the second wireless access point in the sharing server is completed. The second wireless access point to which the terminal belongs prompts that the terminal has joined the shared server in an open SSID (Service Set Identifier).
Fig. 2 shows a flowchart of a wireless network access method on a first wireless access point side according to an embodiment of the present disclosure. The wireless network access method can be applied to a first wireless access point, namely a wireless access point to which a terminal applies for connection. As shown in fig. 2, the wireless network access method provided in this embodiment includes the following steps.
Step S201, in response to receiving a connection request sent by a terminal, generates a random number.
Step S202, the random number is sent to the terminal.
Step S203, responding to the first encryption result generated by encrypting the random number and sent by the terminal, and sending an authentication request carrying the random number and the first encryption result to the second wireless access point through the sharing server.
Step S204, receiving the comparison result sent by the sharing server.
Step S205, determining whether the terminal is allowed to access the wireless network corresponding to the first wireless access point according to the comparison result.
The first wireless access point is a wireless access point (e.g., visitwife) to which the terminal applies for access, and the second wireless access point is a wireless access point (e.g., homewife) to which the terminal belongs. And the comparison result is that the second wireless access point encrypts the random number to generate a second encryption result, and the second encryption result is determined according to the first encryption result and the second encryption result and then is sent to the shared server.
According to the wireless network access method provided by the embodiment of the disclosure, when the terminal moves to a place which cannot be covered by the second wireless access point, a nearby wireless network is automatically searched, namely, the wireless network of the first wireless access point is searched, the terminal sends a connection request to the first wireless access point, the first wireless access point generates a random number and sends the random number to the terminal, and the terminal encrypts the random number to generate a first encryption result and then sends the first encryption result to the first wireless access point. The first wireless access point sends an authentication request carrying the random number and the first encryption result to the sharing server, and the sharing server forwards the authentication request to the second wireless access point to request the second wireless access point to assist the first wireless access point to authenticate whether the terminal is reliable or not. And the first wireless access point receives the comparison result sent by the sharing server, and determines whether the terminal is reliable according to the comparison result, namely whether the terminal is allowed to access the wireless network corresponding to the first wireless access point.
In the embodiment of the disclosure, wifi is shared in a relatively fair manner, when the terminal moves to a region where the wifi of the terminal cannot cover, wifi of other people can be connected, and the wifi of the terminal can provide services externally, so that the utilization rate of the wifi of the terminal is improved, the communication efficiency is improved, and the user experience is improved.
In a preferred embodiment, the connection request includes the terminal name and the radio access point identity of the second radio access point. The authentication request also includes the terminal name and the identity of the second wireless access point. When the sharing server locally inquires out the public network ip address corresponding to the identifier of the second wireless access point in the verification request, the second wireless access point to which the terminal belongs stores the identifier of the second wireless access point and the corresponding public network ip address in the sharing server in advance, and the second wireless access point is added into the sharing server and is willing to share wifi of the second wireless access point. Thus, it is determined that the second wireless access point is authenticated, and the shared server may then forward the verification request to the second wireless access point.
Further, the determining whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result (i.e. step S205) includes: and in response to determining that the first encryption result is consistent with the second encryption result, determining to allow the terminal to access the wireless network corresponding to the first wireless access point.
In this step, if it is verified that the first encryption result is consistent with the second encryption result, it is indicated that the terminal is reliable, and the terminal is allowed to access the wireless network corresponding to the first wireless access point.
In the embodiment of the disclosure, if it is verified that a first encryption result obtained by encrypting the random number by the terminal is consistent with a second encryption result obtained by encrypting the random number by the second wireless access point according to a comparison result sent by the second wireless access point, it indicates that the terminal is reliable, and the terminal is allowed to access a wireless network corresponding to the first wireless access point. The realization adopts more fair mode sharing wifi, when the terminal remove the unable regional district that covers of home country wifi, can connect others' wifi to the wifi of the home country at terminal can externally provide service, improves the utilization ratio of the wifi of the home country at terminal, improves communication efficiency, promotes user experience.
It should be noted that, if it is verified that the first encryption result obtained by encrypting the random number by the terminal is inconsistent with the second encryption result obtained by encrypting the random number by the second wireless access point, it indicates that the terminal is unreliable, and the terminal is not allowed to access the wireless network corresponding to the first wireless access point.
Fig. 3 shows a schematic structural diagram of a second wireless access point side provided in an embodiment of the present disclosure. Based on the same technical concept as the embodiment corresponding to fig. 1, as shown in fig. 3, the shared server provided by the embodiment of the present disclosure includes the following modules.
A receiving module 11, configured to receive an authentication request sent by a shared server, where the authentication request is sent to the shared server after a first wireless access point receives a connection request sent by a terminal.
An obtaining module 12, configured to obtain a random number and a first encryption result in the authentication request, where the first encryption result is generated by the terminal by encrypting the random number.
The determining module 13 is configured to encrypt the random number to obtain a second encryption result, and determine a comparison result according to the first encryption result and the second encryption result.
A sending module 14, configured to send the comparison result to the first wireless access point through the sharing server, so that the first wireless access point determines whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result.
In some embodiments, in the determining module 12, encrypting the random number to obtain a second encryption result is specifically configured to: and encrypting the random number by using a preset secret key shared with the terminal to obtain the second encryption result.
In some embodiments, the sending module 13 is further configured to send the identifier of the second wireless access point and the address corresponding to the identifier to the shared server for storage, so as to register on the shared server.
Fig. 4 shows a schematic structural diagram of a first wireless access point side provided in an embodiment of the present disclosure. Based on the same technical concept as the embodiment corresponding to fig. 2, as shown in fig. 4, the shared server provided by the embodiment of the present disclosure includes the following modules.
A generating module 21, configured to generate a random number in response to receiving a connection request sent by a terminal.
A sending module 22, configured to send the random number to the terminal; and in response to receiving a first encryption result generated by encrypting the random number and sent by the terminal, sending an authentication request carrying the random number and the first encryption result to a second wireless access point through a sharing server, wherein the second wireless access point is a wireless access point to which the terminal belongs.
A receiving module 23, configured to receive a comparison result sent by the shared server, where the comparison result is that the second wireless access point encrypts the random number to generate a second encryption result, and sends the second encryption result to the shared server after determining the comparison result according to the first encryption result and the second encryption result.
A determining module 24, configured to determine whether to allow the terminal to access the wireless network corresponding to the first wireless access point according to the comparison result.
In some embodiments, the determining module 24 is specifically configured to:
and in response to determining that the first encryption result is consistent with the second encryption result, determining to allow the terminal to access the wireless network corresponding to the first wireless access point.
It is to be understood that the above embodiments are merely exemplary embodiments that are employed to illustrate the principles of the present disclosure, and that the present disclosure is not limited thereto. It will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the disclosure, and these are to be considered as the scope of the disclosure.