Patent Description:
This application relates to the field of communications technologies, and in particular, to a wireless fidelity (Wireless Fidelity, Wi-Fi) hotspot connection method and a terminal.

Wireless local area network technologies enable a user to conveniently access a network resource anytime and anywhere in a wireless manner. As one of the wireless local area network (Wireless Local Area Network, WLAN) technologies, Wi-Fi is widely applied.

A user may usually connect to a Wi-Fi hotspot in the following manner: A terminal searches for nearby Wi-Fi hotspots, and displays service set identifiers (Service Set Identifier, SSID) of all found Wi-Fi hotspots on a Wi-Fi setting screen of the terminal; and in response to selection of an SSID by the user, the terminal receives a Wi-Fi password input by the user, and connects to a selected target Wi-Fi hotspot based on the SSID and the Wi-Fi password.

However, when a Wi-Fi hotspot is configured as a hidden hotspot, the terminal cannot find an SSID of the Wi-Fi hotspot, and consequently cannot display the SSID of the Wi-Fi hotspot on the Wi-Fi setting screen of the terminal. In addition, many users are unfamiliar with a hidden hotspot connection manner. In this case, even if a user knows an SSID and an access password of a hidden hotspot, the user cannot control the terminal to connect to the hidden hotspot. Therefore, user experience is relatively poor. Further, <CIT> refers to a wireless fidelity, Wi-Fi, connecting method and a mobile terminal. The method comprises the steps of obtaining X parameters of a target access point, wherein the X parameters comprise at least a target SSID, which contains the target access point, and X is a positive integer; conducting Wi-Fi scanning on the X parameters; obtaining encryption ways of hidden access points to obtain H encryption ways when the target access point cannot be scanned, wherein H is a positive integer; conducting Wi-Fi scanning according to the target SSID and the H encryption ways. Further, <CIT> refers to a processing apparatus performing a communication by way of a wireless encryption method via an access point. A plurality of access points are displayed on display means of the information processing apparatus in a manner that one of the plurality of access points can be selected. At this time, an encryption method of a communication adopted by the access point is obtained, and it is determined whether the obtained encryption method of the access point has a predetermined encryption strength. The access point determined to have a predetermined encryption strength is displayed on the display means more preferentially than the other access point. Further, <CIT> refers to wireless communication terminal reading connection setting information for making a connection to access point, the connection setting information including a plurality of identifiers of access point. Wireless communication terminal stores the read connection setting information. Wireless communication terminal reads the stored connection setting information and uses an identifier informed by access point and the read connection setting information to set wireless communication connection with access point.

This application provides a Wi-Fi hotspot connection method and a terminal. A terminal can connect to a Wi-Fi hotspot regardless of whether the Wi-Fi hotspot is configured as a hidden hotspot, and efficiency of connecting to the Wi-Fi hotspot by the terminal can be improved. Therefore, user experience is improved. The above mentioned problem is solved by the subject matter of the independent claims. Further implementation forms are provided in the dependent claims.

According to a first aspect of this application, a Wi-Fi hotspot connection method is provided, where the method includes: displaying, by a terminal, a first screen that includes an SSID input box and a security selection box for a Wi-Fi hotspot; receiving an SSID of a first Wi-Fi hotspot input by a user in the SSID input box; obtaining an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot; displaying a second screen when the obtained encryption manner of the first Wi-Fi hotspot is different from an encryption manner selected from the security selection box, where the second screen comprises a password input box; receiving an access password of the first Wi-Fi hotspot input by the user in the password input box; in response to a user's connection operation on the second screen, connecting to the first Wi-Fi hotspot based on the SSID, the access password, and the obtained encryption manner of the first Wi-Fi hotspot.

In this application, when the encryption manner of the first Wi-Fi hotspot is different from the default encryption manner, the terminal does not directly display information indicating a connection failure, but displays the second screen on which the access password can be input. After the terminal receives the access password input by the user, in response to the user's connection operation, the terminal proceeds to connect to the first Wi-Fi hotspot based on the encryption manner obtained by the terminal for the first Wi-Fi hotspot and the SSID and the access password of the first Wi-Fi hotspot. In this case, the user does not need to attempt to successively use encryption manners in the foregoing "security" list to connect to the Wi-Fi hotspot. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, and improve user experience.

In a possible design method, the obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot may include: in response to a user's connection operation on the first screen, obtaining, by the terminal, the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot. It may be understood that, usually, if the user is unfamiliar with a hidden hotspot connection manner, after the user inputs the SSID on the first screen, the user may directly perform the connection operation on the first screen. A result of the connection operation is that the terminal fails to connect to the first Wi-Fi hotspot. However, in this application, even if the user is unfamiliar with the hidden hotspot connection manner and directly performs the connection operation on the first screen, in response to the connection operation, the terminal may obtain the encryption manner of the first Wi-Fi hotspot. Then, the terminal displays the second screen that includes the password input box. In this way, the terminal may connect to the first Wi-Fi hotspot based on the access password input by the user in the password input box, the SSID of the first Wi-Fi hotspot, and the obtained encryption manner.

In another possible design method, considering that some users may be familiar with the hidden hotspot connection manner, after a user familiar with the hidden hotspot connection manner inputs the SSID in the SSID input box, the user may continue to tap the security selection box on the first screen. Usually, in response to the user's tapping operation on the security selection box, the terminal may display the "security" list including a plurality of encryption manner options, so that the user selects an encryption manner. However, the user may not know the encryption manner of the first Wi-Fi hotspot, and cannot select the correct encryption manner from the "security" list.

For this case, before the obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot, the method in this application may include: in response to a user's selection operation on the security selection box on the first screen, displaying, by the terminal, a third screen that includes an encryption manner option and a security obtaining option. Correspondingly, the obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot may include: in response to a user's selection from the security obtaining option, obtaining the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In this application, after receiving the SSID input by the user on the first screen, in response to the user's selection operation on the security selection box on the first screen, the terminal may display the third screen. Because the third screen includes the encryption manner option and the security obtaining option, even if the user does not know the encryption manner of the first Wi-Fi hotspot, the user may also tap the security obtaining option, so that the terminal automatically obtains the encryption manner of the first Wi-Fi hotspot in response to the user's tapping operation on the security obtaining option. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, improve efficiency of connecting to the Wi-Fi hotspot by the terminal, and improve user experience.

In another possible design method, after the terminal receives the SSID of the first Wi-Fi hotspot input by the user on the first screen, even if the terminal does not receive the user's selection operation on the security selection box or does not receive the user's connection operation on the first screen as the foregoing two design methods, the terminal may also obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot. Specifically, the obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot may include: after responding to the user's input of the SSID of the first Wi-Fi hotspot on the first screen, automatically obtaining, by the terminal, the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In this application, after the terminal receives the SSID input by the user on the first screen, even if the terminal does not receive the user's selection operation on the security selection box or does not receive the user's connection operation on the first screen, directly in response to the operation "the user inputs the SSID of the first Wi-Fi hotspot on the first screen", the terminal may also obtain the encryption manner of the first Wi-Fi hotspot. To be specific, in this application, the terminal may further automatically obtain the encryption manner of the first Wi-Fi hotspot in a manner in which the encryption manner of the Wi-Fi hotspot is imperceptible to the user.

In another possible design method, because when the terminal displays the second screen, the terminal has obtained the encryption manner of the first Wi-Fi hotspot. In this way, the second screen may display the security selection box including the encryption manner of the first Wi-Fi hotspot.

In this application, the terminal may further display the obtained encryption manner on the second screen, so that the user can know which encryption manner is used by the first Wi-Fi hotspot for encryption, that is, which encryption manner is a correct encryption manner used by the first Wi-Fi hotspot. In this way, the user can select the correct encryption manner when controlling another terminal to connect to the first Wi-Fi hotspot.

In another possible design method, the second display may not display the security selection box including the encryption manner of the first Wi-Fi hotspot.

That the terminal does not display the security selection box including the encryption manner does not indicate that the terminal does not obtain the encryption manner of the first Wi-Fi hotspot. It indicates that the terminal does not display the encryption manner to the user on the display screen of the terminal. The terminal still connects to the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot, the encryption manner obtained by the terminal, and an access password of the first Wi-Fi hotspot. To be specific, in this application, the terminal may connect to the Wi-Fi hotspot in a manner in which the encryption manner of the Wi-Fi hotspot is imperceptible to the user.

In another possible design method, the obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot may include: broadcasting, by the terminal, a probe request frame carrying the SSID of the first Wi-Fi hotspot; receiving a probe response frame sent by the first Wi-Fi hotspot, where the probe response frame carries the encryption manner of the first Wi-Fi hotspot; and parsing the received probe response frame to obtain the encryption manner of the first Wi-Fi hotspot. The obtaining, by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot may include: sending, by the terminal, an encryption manner obtaining request to a cloud server, where the encryption manner obtaining request carries the SSID of the first Wi-Fi hotspot, and the cloud server stores encryption manners of a plurality of Wi-Fi hotspots; and receiving, by the terminal, an encryption manner obtaining response sent by the cloud server, where the encryption manner obtaining response carries the SSID of the first Wi-Fi hotspot.

In another possible design method, the encryption manner selected from the security selection box is an encryption manner input by default (namely unencrypted) or an encryption manner selected by the user. Specifically, before the user inputs the connection operation on the first screen or the second screen, the user does not select an encryption manner from the security selection box. The terminal may consider by default that the encryption manner selected from the security selection box is unencrypted, namely, the encryption manner is N/A. Before the user inputs the connection operation on the first screen or the second screen, the user selects any encryption manner from the security selection box. The encryption manner selected from the security selection box is the encryption manner selected by the user.

According to a second aspect, this application provides a terminal, and the terminal includes: a display unit, an input unit, an obtaining unit, and a connection unit. The display unit is configured to display a first screen, where the first screen includes an SSID input box and a security selection box for a Wi-Fi hotspot. The input unit is configured to receive an SSID of a first Wi-Fi hotspot input by a user in the SSID input box displayed on the display unit. The obtaining unit is configured to obtain an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot input from the input unit. The display unit is further configured to: display a second screen if the encryption manner of the first Wi-Fi hotspot obtained by the obtaining unit is different from an encryption manner selected from the security selection box, where the second screen includes a password input box. The input unit is further configured to receive an access password of the first Wi-Fi hotspot input by the user in the password input box displayed on the display unit. The connection unit is configured to: in response to a user's connection operation on the second screen displayed on the display unit, connect to the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot input from the input unit, the access password of the first Wi-Fi hotspot input from the input unit, and the encryption manner obtained by the obtaining unit for the first Wi-Fi hotspot input from the input unit.

In a possible design method, the obtaining unit is specifically configured to: in response to a user's connection operation on the first screen displayed on the display unit, obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the display unit is further configured to: in response to a user's selection operation on the security selection box on the first screen, display a third screen, where the third screen includes an encryption manner option and a security obtaining option. The obtaining unit is specifically configured to: in response to a user's selection from the security obtaining option displayed on the display unit, obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the obtaining unit is specifically configured to: after responding to the user's input of the SSID of the first Wi-Fi hotspot on the first screen displayed on the display unit, automatically obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the obtaining unit is specifically configured to: broadcast a probe request frame, where the probe request frame carries the SSID of the first Wi-Fi hotspot; receive a probe response frame sent by the first Wi-Fi hotspot, where the probe response frame carries the encryption manner of the first Wi-Fi hotspot; and parse the probe response frame to obtain the encryption manner of the first Wi-Fi hotspot.

In another possible design method, the obtaining unit is specifically configured to: send an encryption manner obtaining request to a cloud server, where the encryption manner obtaining request carries the SSID of the first Wi-Fi hotspot, and the cloud server stores encryption manners of a plurality of Wi-Fi hotspots; and receive an encryption manner obtaining response sent by the cloud server, where the encryption manner obtaining response carries the SSID of the first Wi-Fi hotspot.

In another possible design method, the encryption manner selected from the security selection box is an encryption manner input by default or an encryption manner selected by the user.

According to a third aspect, this application provides a terminal, and the terminal includes a processor, a memory, a touchscreen, and a communications interface. The memory, the touchscreen, and the communications interface are coupled to the processor. The communications interface is configured to communicate with another terminal. The another device includes a wireless fidelity Wi-Fi hotspot, the memory is configured to store computer program code, and the computer program code includes a computer instruction. When the processor executes the computer instruction, the touchscreen is configured to display a first screen, where the first screen includes an SSID input box and a security selection box for the Wi-Fi hotspot. The processor is configured to: receive an SSID of a first Wi-Fi hotspot input by a user in the SSID input box displayed on the touchscreen, and obtain an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot. The touchscreen is further configured to: display a second screen if the encryption manner of the first Wi-Fi hotspot obtained by the processor is different from an encryption manner selected from the security selection box, where the second screen includes a password input box. The processor is further configured to receive an access password of the first Wi-Fi hotspot input by the user in the password input box displayed on the touchscreen. The processor is further configured to: in response to a user's connection operation on the second screen, connect to the first Wi-Fi hotspot based on the SSID, the access password, and the obtained encryption manner of the first Wi-Fi hotspot through the communications interface.

In a possible design method, the processor is further configured to: in response to a user's connection operation on the first screen displayed on the touchscreen, obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the first screen displayed on the touchscreen further includes the security selection box. The touchscreen is further configured to: before the processor obtains the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot, in response to a user's selection operation on the security selection box on the first screen, display a third screen, where the third screen includes an encryption manner option and a security obtaining option. The processor is further configured to: in response to a user's selection from the security obtaining option displayed on the touchscreen, obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the processor is further configured to: after responding to the user's input of the SSID of the first Wi-Fi hotspot on the first screen displayed on the touchscreen, automatically obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In another possible design method, the communications interface is further configured to: broadcast a probe request frame, where the probe request frame carries the SSID of the first Wi-Fi hotspot; and receive a probe response frame sent by the first Wi-Fi hotspot, where the probe response frame carries the encryption manner of the first Wi-Fi hotspot. The processor is further configured to parse the probe response frame received through the communications interface, to obtain the encryption manner of the first Wi-Fi hotspot.

In another possible design method, the communications interface is further configured to: send an encryption manner obtaining request to a cloud server, where the encryption manner obtaining request carries the SSID of the first Wi-Fi hotspot, and the cloud server stores encryption manners of a plurality of Wi-Fi hotspots; and receive an encryption manner obtaining response sent by the cloud server, where the encryption manner obtaining response carries the SSID of the first Wi-Fi hotspot.

According to a fourth aspect, this application provides a computer storage medium, where the computer storage medium includes a computer instruction, and when the computer instruction is run on a terminal, the terminal is enabled to perform the Wi-Fi hotspot connection method according to the first aspect and any possible design method of the first aspect.

According to a fifth aspect, this application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to perform the Wi-Fi hotspot connection method according to the first aspect and any possible design method of the first aspect.

The terms "first" and "second" mentioned below are merely intended for description, and shall not be understood as an indication or implication of relative importance or implicit indication of a quantity of indicated technical features. Therefore, a feature limited by using "first" or "second" may explicitly or implicitly include one or more features. In the descriptions of this application, unless otherwise specified, "a plurality of" means two or more than two.

This application provides a Wi-Fi hotspot connection method and a terminal. The method may be applied to a process in which a terminal connects to a Wi-Fi hotspot, and may be particularly applied to a process in which the terminal connects to a Wi-Fi hotspot configured as a hidden hotspot. Certainly, the terminal may also connect to a non-hidden hotspot by using the Wi-Fi hotspot connection method provided in this application. In this application, that a Wi-Fi hotspot is configured as a hidden hotspot specifically means that a function of broadcasting an SSID by the Wi-Fi hotspot by using a wireless signal is disabled, in other words, the hidden hotspot does not broadcast the wireless signal carrying the SSID of the Wi-Fi hotspot. The wireless signal may be a Wi-Fi beacon (Beacon) frame.

The terminal in this application may be an electronic device having a Wi-Fi connection function. For example, the terminal may be a mobile phone (for example, a mobile phone <NUM> shown in <FIG>, a tablet computer, a personal computer (Personal Computer, PC), a personal digital assistant (personal digital assistant, PDA), a smartwatch, a netbook, or a wearable electronic device. A specific form of the device is not particularly limited in this application.

<FIG> are a schematic diagram of a Wi-Fi network architecture to which a Wi-Fi hotspot connection method is applied according to this application. As shown in <FIG>, the Wi-Fi network architecture may include a mobile phone <NUM>, a router <NUM> (namely, a Wi-Fi hotspot-<NUM>), a notebook computer <NUM> (namely, a Wi-Fi hotspot-<NUM>), a mobile phone <NUM> (namely, a Wi-Fi hotspot-<NUM>), and a router <NUM> (namely, a Wi-Fi hotspot-<NUM>). An SSID of the Wi-Fi hotspot-<NUM> is Zhangsan, an SSID of the Wi-Fi hotspot-<NUM> is ABC123, an SSID of the Wi-Fi hotspot-<NUM> is Xyzd, and an SSID of the Wi-Fi hotspot-<NUM> is G1B-1B-<NUM>-7R-<NUM>.

The router <NUM>, the notebook computer <NUM>, the mobile phone <NUM>, and the router <NUM> are located nearby the mobile phone <NUM>, and may each broadcast a Wi-Fi beacon frame, so that a nearby terminal (for example, the mobile phone <NUM>) can detect the Wi-Fi beacon frame of the Wi-Fi hotspot and connect to the Wi-Fi hotspot. The Wi-Fi beacon frame broadcast by the Wi-Fi hotspot carries the SSID of the Wi-Fi hotspot. For example, the Wi-Fi beacon frame broadcast by the router <NUM> carries G1B-1B-<NUM>-7R-<NUM>.

After finding the Wi-Fi beacon frame broadcast by the Wi-Fi hotspot nearby the terminal, the terminal may display, on a "Wi-Fi setting" screen of the terminal, the SSID of the Wi-Fi hotspot found by the terminal. However, when a Wi-Fi hotspot is configured as a hidden hotspot, the terminal cannot find the Wi-Fi hotspot and display an SSID of the Wi-Fi hotspot.

For example, it is assumed that the notebook computer <NUM> (namely, the Wi-Fi hotspot-<NUM>) shown in <FIG> is configured as a hidden hotspot. A user uses the notebook computer <NUM> to log in to a configuration screen <NUM> of a wireless router shown in <FIG>, and configures the notebook computer <NUM> as the hidden hotspot. A screen <NUM> corresponding to a wireless setting option <NUM> on the configuration screen <NUM> shown in <FIG> includes a "broadcast an SSID signal of a wireless router" option <NUM>. As shown in <FIG>, when the user disables the "broadcast an SSID signal of a wireless router" option <NUM>, the notebook computer <NUM> is configured as the hidden hotspot.

When the notebook computer <NUM> is configured as the hidden hotspot, the notebook computer <NUM> does not broadcast the Wi-Fi beacon frame carrying the SSID (ABC123) of the Wi-Fi hotspot-<NUM>. In this case, the terminal (for example, the mobile phone) cannot detect the SSID of the notebook computer <NUM>. In other words, the terminal does not display the SSID of the notebook computer <NUM> on the "Wi-Fi setting" screen. For example, as shown in <FIG>, a "Wi-Fi setting" screen <NUM> of the mobile phone <NUM> includes only the SSID (Zhangsan) of the router <NUM>, the SSID (Xyzd) of the mobile phone <NUM>, and the SSID (G1B-1B-<NUM>-7R-<NUM>) of the router <NUM>, but does not include the SSID (ABC123) of the notebook computer <NUM>.

If the user wants to control the mobile phone <NUM> to connect to a Wi-Fi network provided by the notebook computer <NUM>, the user may tap an "add network" option <NUM> on the "Wi-Fi setting" screen <NUM> shown in <FIG>. Then, the mobile phone <NUM> may display a hotspot addition screen <NUM> shown in <FIG>. As shown in <FIG>, the hotspot addition screen <NUM> may include an SSID input box <NUM>, a security selection box <NUM>, a "cancel" button <NUM>, and a "connect" button <NUM>. The SSID input box <NUM> is used to input an SSID (such as ABC123) of a Wi-Fi hotspot. The security selection box <NUM> is used to select an encryption manner of the Wi-Fi hotspot. The "cancel" button <NUM> is used to cancel a connection to the Wi-Fi hotspot. The "connect" button <NUM> is used to instruct the terminal to connect to the Wi-Fi hotspot.

The following describes a method in which the terminal connects to the Wi-Fi hotspot in response to a tapping operation on the "connect" button <NUM> after the terminal receives the SSID input by the user in the SSID input box <NUM>. Generally, as shown in <FIG>, a method for a terminal to connect to a Wi-Fi hotspot includes steps S301 to S307.

The terminal broadcasts a probe request (Probe Request) frame carrying an SSID.

Assuming that an SSID of the Wi-Fi hotspot is "ABC123", the terminal broadcasts the following probe request frame:
Tag: SSID parameter set: ABC123
Tag Number: SSID parameter set (<NUM>)
Tag length: <NUM>, indicating that a length of
the SSID carried in the probe request frame is <NUM>
SSID: ABC123, indicating that the SSID
carried in the probe request frame is "ABC123".

It should be noted that this application merely uses an example to provide information, related to this application, in information carried in the probe request frame, such as the SSID (ABC123) and the length length of the SSID. The probe request frame in this application includes but is not limited to the foregoing information. Other information carried in the probe request frame is not described in detail in this application.

After finding the probe request frame, the Wi-Fi hotspot determines whether the SSID carried in the probe request frame is the same as the SSID of the Wi-Fi hotspot.

Specifically, if the SSID carried in the probe request frame is the same as the SSID of the Wi-Fi hotspot, step S303 is performed. If the SSID carried in the probe request frame is different from the SSID of the Wi-Fi hotspot, the Wi-Fi hotspot discards the probe request frame.

The Wi-Fi hotspot sends a probe response (Probe Response) frame to the terminal, where the probe response frame carries an encryption manner of the Wi-Fi hotspot.

After receiving the probe request frame, the Wi-Fi hotspot parses the probe request frame to obtain the SSID; and if the obtained SSID is the same as the SSID of the Wi-Fi hotspot, determines that the terminal can connect to the Wi-Fi hotspot. The Wi-Fi hotspot may return the probe response frame to the terminal. The probe response frame carries the following robust security network (Robust Security Network) information (Information). To be specific, the following RSN information is the encryption manner of the Wi-Fi hotspot carried in the probe response frame:
Tag: SSID parameter set: ABC123
Tag Number: SSID parameter set (<NUM>)
Tag length: <NUM>
SSID: ABC123
Tag: RSN Information
Group Cipher Suite: <NUM>-0f-ac AES (CCM)
Pairwise Cipher Suite List <NUM>-0f-ac AES (CCM)
Auth Key Management (AKM) type: PSK (<NUM>).

An AES is an advanced encryption standard (The Advanced Encryption Standard) encryption algorithm, and a counter mode (Counter Mode CBC MAC, CCM) is an authentication-based encryption technology in IEEE <NUM>. The AES (CCM) is corresponding to a WPA encryption manner. With reference to the foregoing "Auth Key Management (AKM) type", it can be learned that the encryption manner of the Wi-Fi hotspot is WPA PSK.

It should be noted that this application merely uses an example to provide information, related to this application, in information carried in the probe response frame, such as the encryption manner (WPA PSK). The probe response frame in this application includes but is not limited to the foregoing information. Other information carried in the probe response frame is not described in detail in this application.

After receiving the probe response frame, the terminal parses the probe response frame to obtain the encryption manner of the Wi-Fi hotspot, and compares whether the encryption manner of the Wi-Fi hotspot is the same as a default encryption manner.

The encryption manner of the Wi-Fi hotspot may include a wired equivalent privacy (Wired Equivalent Privacy, WEP) protocol manner, a Wi-Fi protected access (Wi-Fi Protected Access, WPA)/WPA2 pre-shared key (Pre-Shared Key, PSK) manner, a wireless local area network authentication and privacy infrastructure (Wireless LAN Authentication and Privacy Infrastructure, WAPI) PSK manner, a WAPI certificate manner, and the like.

Specifically, if the encryption manner carried in the probe response frame is the same as the encryption manner selected from the security selection box, steps S305 to S307 are performed. If the encryption manner carried in the probe response frame is different from the encryption manner selected from the security selection box, the terminal may display prompt information "connection fails".

The terminal requests the Wi-Fi hotspot to authenticate (Authentication) the terminal.

A response made by the Wi-Fi hotspot to the authentication request may indicate whether the authentication on the terminal succeeds.

After the authentication succeeds, the terminal sends an association (Association) request to the Wi-Fi hotspot.

The Wi-Fi hotspot responds to the (Association) request from the terminal.

After step S307 is performed, the terminal succeeds in connecting to the Wi-Fi hotspot. The authentication in this application includes authentication performed by the Wi-Fi hotspot on an access password sent by the terminal.

In a scenario of this application, after the terminal receives an SSID input by a user in an SSID input box <NUM> shown in <FIG>, if the terminal does not receive a user's operation on a security selection box <NUM> for selecting an encryption manner of the Wi-Fi hotspot, but directly receives a user's tapping operation on a "connect" button <NUM>, the terminal may consider by default that the Wi-Fi hotspot is unencrypted, in other words, the default encryption manner is N/A.

For an unencrypted Wi-Fi hotspot, the encryption manner carried in the probe response frame sent by the Wi-Fi hotspot is N/A. In addition, even if the user does not select the encryption manner of the Wi-Fi hotspot from the security selection box <NUM>, but directly taps the "connect" button <NUM>, because the encryption manner selected from the security selection box is the default encryption manner (that is, the encryption manner is N/A), the encryption manner carried in the probe response frame is the same as the encryption manner selected from the security selection box. In this case, the terminal may perform steps S305 to S307, and succeeds in connecting to the Wi-Fi hotspot.

However, for an encrypted Wi-Fi hotspot, after the user inputs the SSID of the Wi-Fi hotspot in the SSID input box <NUM>, the user further needs to input a correct encryption manner and access password of the Wi-Fi hotspot in the security selection box <NUM>, and then can succeed in connecting to the Wi-Fi hotspot.

However, most users are unfamiliar with a hidden hotspot connection manner. After inputting the SSID of the hidden hotspot in the SSID input box <NUM>, the users may directly tap the "connect" button <NUM>, to connect to the hidden hotspot. A result is definitely a connection failure. Specifically, the encryption manner (for example, the WPA/WPA2 PSK manner) of the encrypted Wi-Fi hotspot is different from the default encryption manner "N/A" of the terminal. As a result, the terminal fails to connect to the Wi-Fi hotspot.

Certainly, some users may be familiar with the hidden hotspot connection manner. However, to connecting to the hidden hotspot successfully, the user not only needs to know the SSID and the access password of the hidden hotspot, but also needs to know the encryption manner of the hidden hotspot. However, a user may usually remember the SSID and the access password of the Wi-Fi hotspot, but is unaware of the encryption manner of the Wi-Fi hotspot.

In another scenario of this application, as shown in <FIG>, after the terminal receives an SSID input by a user in an SSID input box <NUM>, if the terminal receives a user's tapping operation on a security selection box <NUM> shown in <FIG>, the terminal may display a "security" list <NUM> shown in <FIG>. The "security" list <NUM> includes a possible encryption manner of the Wi-Fi hotspot, for example, a WEP manner, a WPA/WPA2 PSK manner, a WAPI PSK manner, or a WAPI certificate manner.

As shown in <FIG>, after the user selects the WPA/WPA2 PSK manner from the "security" list <NUM>, the mobile phone <NUM> may display a display screen shown in <FIG>. The display screen shown in <FIG> includes a "password" input window <NUM>. The "password" input window <NUM> is used to input an access password of the Wi-Fi hotspot, and an encryption manner selected by the user, for example, the WPA/WPA2 PSK manner, is displayed in the security selection box <NUM>. In this scenario, the encryption manner selected from the security selection box is the encryption manner selected by the user, for example, the WPA/WPA2 PSK manner.

As shown in <FIG>, after the user inputs the SSID "ABC123" and the access password "<NUM>" in the "password" input window <NUM>, if the user taps a "connect" button <NUM>, the mobile phone <NUM> may send a probe request frame to the Wi-Fi hotspot. After receiving the probe response frame, the mobile phone <NUM> may compare the encryption manner carried in the probe response frame with the encryption manner "WPA/WPA2 PSK" manner selected by the user. If the encryption manner carried in the probe response frame is the same as the WPA/WPA2 PSK manner, the mobile phone <NUM> performs steps S305 to S307, and succeeds in connecting to the Wi-Fi hotspot. If the encryption manner carried in the probe response frame is the same as the WPA/WPA2 PSK manner, the mobile phone <NUM> fails to connect to the Wi-Fi hotspot.

If the user does not know the encryption manner of the Wi-Fi hotspot, the user needs to attempt to successively use the encryption manners in the "security" list <NUM> shown in <FIG>, to connect to the Wi-Fi hotspot. When the user attempts to successively use the encryption manner in the "security" list (for example, the "security" list <NUM>) to connect to the Wi-Fi hotspot, user operations are complex, and user's experience is affected.

It should be emphasized again that the Wi-Fi hotspot connection method provided in this application may be applied to not only a process in which the terminal connects to a Wi-Fi hotspot in a hidden state, but also a process in which the terminal connects to a common Wi-Fi hotspot (that is, a Wi-Fi hotspot that is not configured as a hidden hotspot). For example, some users may want to control the mobile phone <NUM> to connect, by using a hotspot addition screen <NUM> shown in <FIG>, to the Wi-Fi hotspot that is not configured as the hidden hotspot. However, if the Wi-Fi hotspot is an encrypted hotspot, even though the user knows an access password, the user may not know an encryption manner of the Wi-Fi hotspot. In this case, the user needs to attempt to successively use encryption manners in a "security" list to attempt to connect to the Wi-Fi hotspot, until the user succeeds in connecting to the Wi-Fi hotspot. Consequently, operations performed by the user are complex, and user experience is affected.

According to the Wi-Fi hotspot connection method provided in this application, the terminal may automatically obtain the encryption manner of the Wi-Fi hotspot (including the hidden hotspot and the common Wi-Fi hotspot). This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, and improve user experience.

<FIG> is a schematic diagram of an example of a frame structure of a Wi-Fi frame according to this application. As shown in <FIG>, the Wi-Fi frame <NUM> may include a frame header (namely, a MAC header) <NUM>, a frame body (Frame Body) <NUM>, and a frame check (Frame Check Sequence, FCS) field <NUM>. The MAC header <NUM> is the media access control (Media Access Control, MAC) header.

As shown in <FIG>, the MAC header <NUM> may include a frame control (Frame Control) field <NUM>, a duration/identifier (Duration/ID) <NUM>, an address (Address) field <NUM>, a sequence control (Sequence Control) field <NUM>, and the like.

The frame control field <NUM> may include a protocol version (Protocol Version) field 501a, a type field 501b, and the like. The protocol version field 501a is used to indicate a protocol version to which the Wi-Fi frame <NUM> conforms, where the protocol version is usually <NUM>. The type field 501b may include a type and a subtype, where the type is used to indicate that a corresponding frame is a management frame, a data frame, or a control frame, and the subtype is used to indicate a subtype of the frame. For example, when type = <NUM>, it may indicate that the corresponding frame is the management frame. In this case, the subtype may indicate that the management frame is a type of management frame, such as a beacon (Beacon) frame, a probe request frame, or a probe response (Probe Response) frame. For example, when type = <NUM> and subtype = <NUM>, the Wi-Fi frame <NUM> shown in <FIG> is the probe request frame. When type = <NUM> and subtype = <NUM>, the Wi-Fi frame <NUM> shown in <FIG> is the probe response frame. The address field <NUM> may include address information such as a source address, a destination address, a transmission workstation address, and a receiving workstation address, where the destination address may be any one of a unicast address (Unicast address), a multicast address (Multicast address), and a broadcast address (Broadcast address).

As shown in <FIG>, the frame body <NUM> includes an SSID field <NUM>, a supported rate (Supported Rates) <NUM>, and an extended supported rate (Extended Supported Rates) <NUM>. The supported rate <NUM> and the extended supported rate <NUM> are used to indicate a set of rates supported by a mobile phone or a wireless router.

The probe request frame may be a management frame (Management Frame) in IEEE <NUM>. A station (Station, STA) (for example, the mobile phone <NUM>) may detect a Wi-Fi signal in a manner of proactively sending a probe request frame carrying an SSID. When the Wi-Fi frame <NUM> shown in <FIG> is the probe request frame, to be specific, when the type and the subtype in the type field 501b indicate that the Wi-Fi frame <NUM> is the probe request frame, the SSID field <NUM> in the Wi-Fi frame <NUM> carries an SSID of a Wi-Fi hotspot. When the Wi-Fi frame <NUM> shown in <FIG> is the probe request frame, to be specific, when the type and the subtype in the type field 501b indicate that the Wi-Fi frame <NUM> is the probe request frame, the frame body <NUM> not only includes the SSID of the Wi-Fi hotspot, but also includes an encryption manner of the Wi-Fi hotspot.

As shown in <FIG>, for example, a mobile phone <NUM> is used as the terminal, and the mobile phone <NUM> may specifically include components such as a processor <NUM>, a radio frequency (Radio Frequency, RF) circuit <NUM>, a memory <NUM>, a touchscreen <NUM>, a Bluetooth apparatus <NUM>, one or more sensors <NUM>, a Wi-Fi apparatus <NUM>, a positioning apparatus <NUM>, an audio circuit <NUM>, a peripheral interface <NUM>, and a power system <NUM>. These components may perform communication by using one or more communications buses or signal cables (not shown in <FIG>). Persons skilled in the art may understand that a hardware structure shown in <FIG> does not constitute a limitation on the mobile phone, and the mobile phone <NUM> may include more or fewer components than those shown in the figure, or may combine some components, or have different component arrangements.

The following describes the components of the mobile phone <NUM> in detail with reference to <FIG>.

The processor <NUM> is a control center of the mobile phone <NUM>, is connected to components of the mobile phone <NUM> by using various interfaces and lines, and performs various functions of the mobile phone <NUM> and data processing by running or executing an application program stored in the memory <NUM> and invoking data stored in the memory <NUM>. In some embodiments, the processor <NUM> may include one or more processing units. In some embodiments of this application, the processor <NUM> may further include a fingerprint verification chip, configured to verify a captured fingerprint.

The radio frequency circuit <NUM> may be configured to receive and send radio signals. Particularly, after receiving downlink data from a base station, the radio frequency circuit <NUM> may send the downlink data to the processor <NUM> for processing, and send related uplink data to the base station. The radio frequency circuit usually includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency circuit <NUM> may further communicate with another device through wireless communication. The wireless communication may use any communications standard or protocol, including but not limited to a global system for mobile communications, a general packet radio service, code division multiple access, wideband code division multiple access, long term evolution, or the like.

The memory <NUM> is configured to store the application program and the data. The processor <NUM> performs various functions of the mobile phone <NUM> and data processing by running the application program and the data stored in the memory <NUM>. The memory <NUM> mainly includes a program storage area and a data storage area. The program storage area may store an operating system, and an application program required by at least one function (such as a voice playing function or an image playing function). The data storage area may store data (such as audio data and a phone book) that is created based on use of the mobile phone <NUM>. In addition, the memory <NUM> may include a highspeed random access memory (Random Access Memory, RAM), and may further include a non-volatile memory such as a magnetic disk storage component, a flash memory component, or another volatile solid-state storage component. The memory <NUM> may store various operating systems. The memory <NUM> may be independent, and is connected to the processor <NUM> by using the communications bus; or the memory <NUM> may be integrated with the processor <NUM>.

The touchscreen <NUM> may specifically include a touchpad <NUM>-<NUM> and a display <NUM>-<NUM>.

The touchpad <NUM>-<NUM> may collect a touch event performed by a user on or near the mobile phone <NUM> (for example, an operation performed by the user on or near the touchpad <NUM>-<NUM> by using any proper object such as a finger or a stylus), and send collected touch information to another device (for example, the processor <NUM>). The touch event performed by the user near the touchpad <NUM>-<NUM> may be referred to as a floating touch. The floating touch may be that the user does not need to directly touch the touchpad for selecting, moving, or dragging an object (for example, an icon), and that the user only needs to be located near the device for ease of performing a desired function. In addition, the touchpad <NUM>-<NUM> may be implemented in a plurality of types such as a resistive type, a capacitive type, an infrared type, and a surface acoustic wave type.

The display (also referred to as a display screen) <NUM>-<NUM> may be configured to display information entered by the user or information provided for the user, and various menus of the mobile phone <NUM>. The display <NUM>-<NUM> may be configured in a form such as a liquid crystal display or an organic light-emitting diode. The touchpad <NUM>-<NUM> may cover the display <NUM>-<NUM>. When detecting a touch event on or near the touchpad <NUM>-<NUM>, the touchpad <NUM>-<NUM> transfers the touch event to the processor <NUM> to determine a type of the touch event. Then, the processor <NUM> may provide corresponding visual output on the display <NUM>-<NUM> based on the type of the touch event. In <FIG>, the touchpad <NUM>-<NUM> and the display screen <NUM>-<NUM> are used as two independent components to implement input and output functions of the mobile phone <NUM>. However, in some embodiments, the touchpad <NUM>-<NUM> and the display screen <NUM>-<NUM> may be integrated to implement the input and output functions of the mobile phone <NUM>. It may be understood that the touchscreen <NUM> is made by stacking a plurality of layers of materials. In this embodiment of this application, only the touchpad (layer) and the display screen (layer) are displayed, and other layers are not described in this embodiment of this application. In addition, the touchpad <NUM>-<NUM> may be configured on the front side of the mobile phone <NUM> in a full panel form, and the display screen <NUM>-<NUM> may also be configured on the front side of the mobile phone <NUM> in a full panel form, so that a bezel-less structure can be implemented for the front side of the mobile phone.

In addition, the mobile phone <NUM> may further have a fingerprint recognition function. For example, a fingerprint recognizer <NUM> may be configured on the back side (for example, below a rear-facing camera) of the mobile phone <NUM>, or the fingerprint recognizer <NUM> is configured on the front side (for example, below the touchscreen <NUM>) of the mobile phone <NUM>. For another example, the fingerprint recognizer <NUM> may be configured on the touchscreen <NUM> to implement the fingerprint recognition function. To be specific, the fingerprint recognizer <NUM> may be integrated with the touchscreen <NUM> to implement the fingerprint recognition function of the mobile phone <NUM>. In this case, the fingerprint recognizer <NUM> is configured on the touchscreen <NUM>, and may be a part of the touchscreen <NUM>, or may be configured on the touchscreen <NUM> in another manner. A main component of the fingerprint recognizer <NUM> in this embodiment of this application is a fingerprint sensor. The fingerprint sensor may use any type of sensing technology, including but not limited to an optical, capacitive, piezoelectric, or ultrasonic sensing technology, or the like.

The mobile phone <NUM> may further include the Bluetooth apparatus <NUM>, configured to implement data exchange between the mobile phone <NUM> and another device within a short range (for example, a mobile phone or a smartwatch). In this embodiment of this application, the Bluetooth apparatus may be an integrated circuit, a Bluetooth chip, or the like.

The mobile phone <NUM> may further include at least one type of sensor <NUM>, such as a light sensor, a motion sensor, and another sensor. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor may adjust luminance of the display on the touchscreen <NUM> based on brightness of ambience light. The proximity sensor may turn off the display when the mobile phone <NUM> approaches an ear. As a type of the motion sensor, an accelerometer sensor may detect acceleration values in directions (usually three axes), may detect, in a static state, a value and a direction of gravity, and may be used for an application for identifying a posture (such as screen switching between a landscape mode and a portrait mode, a related game, and magnetometer posture calibration) of the mobile phone, a vibration-identification-related function (such as a pedometer and tapping), and the like. Other sensors that can be configured on the mobile phone <NUM> such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor are not described herein.

The Wi-Fi apparatus <NUM> is configured to provide the mobile phone <NUM> with network access that complies with a Wi-Fi-related standard protocol, and the mobile phone <NUM> may access a Wi-Fi hotspot by using the Wi-Fi apparatus <NUM>, to help the user receive and send an email, browse a web page, access streaming media, and the like. The Wi-Fi apparatus <NUM> provides wireless broadband internet access for the user. In some other embodiments, the Wi-Fi apparatus <NUM> may also be used as a Wi-Fi wireless access point, and may provide Wi-Fi network access for another device.

The positioning apparatus <NUM> is configured to provide a geographic location for the mobile phone <NUM>. It may be understood that the positioning apparatus <NUM> may be specifically a receiver of a positioning system such as a global positioning system (Global Positioning System, GPS), the BeiDou navigation satellite system, or the Russian GLONASS. After receiving the geographic location sent by the positioning system, the positioning apparatus <NUM> sends the information to the processor <NUM> for processing, or sends the information to the memory <NUM> for storage. In some other embodiments, the positioning apparatus <NUM> may also be a receiver of an assisted global positioning system (Assisted Global Positioning System, AGPS). The AGPS system, as an assisted server, assists the positioning apparatus <NUM> in completing ranging and positioning services. In this case, the assisted positioning server, by using a wireless communications network, communicates with a positioning apparatus <NUM> (namely, a GPS receiver) of a device such as the mobile phone <NUM> to provide positioning assistance. In some other embodiments, the positioning apparatus <NUM> may be alternatively an apparatus using a Wi-Fi hotspot-based positioning technology. Each Wi-Fi hotspot has a globally unique media access control (Media Access Control, MAC) address. When Wi-Fi is enabled for the device, the device may scan and collect broadcast signals of nearby Wi-Fi hotspots, and therefore can obtain the MAC addresses broadcast by the Wi-Fi hotspots. The device sends, to a location server by using a wireless communications network, data (for example, the MAC addresses) that can identify the Wi-Fi hotspots. The location server retrieves a geographic location of each Wi-Fi hotspot, calculates a geographic location of the device based on strength of the Wi-Fi broadcast signals, and sends the geographic location to the positioning apparatus <NUM> of the device.

The audio circuit <NUM>, a speaker <NUM>, and a microphone <NUM> may provide an audio interface between the user and the mobile phone <NUM>. The audio circuit <NUM> may transmit an electrical signal obtained by converting received audio data, to the speaker <NUM>, and the speaker <NUM> converts the electrical signal into a sound signal for output. In addition, the microphone <NUM> converts a collected sound signal into an electrical signal. The audio circuit <NUM> receives the electrical signal, converts the electrical signal into audio data, and then outputs the audio data to the RF circuit <NUM>, so as to send the audio data to, for example, another mobile phone, or outputs the audio data to the memory <NUM> for further processing.

The peripheral interface <NUM> is configured to provide various interfaces for an external input/output device (for example, a keyboard, a mouse, an external display, an external memory, and a subscriber identity module card). For example, the peripheral interface <NUM> is connected to a mouse by using a universal serial bus (Universal Serial Bus, USB) interface, and connected, by using a metal contact in a subscriber identity module card slot, to a subscriber identity module (Subscriber Identification Module, SIM) card provided by a telecommunications operator. The peripheral interface <NUM> may be configured to couple the external input/output peripheral device to the processor <NUM> and the memory <NUM>.

In this embodiment of the present invention, the mobile phone <NUM> may communicate with another device in a device group through the peripheral interface <NUM>, for example, may receive, through the peripheral interface <NUM>, displayed data sent by the another device for displaying. This is not limited in this embodiment of the present invention.

The mobile phone <NUM> may further include the power supply apparatus <NUM> (for example, a battery and a power supply management chip) that supplies power to the components. The battery may be logically connected to the processor <NUM> by using the power supply management chip, so that functions such as charging, discharging, and power consumption management are implemented by using the power supply apparatus <NUM>.

Although not shown in <FIG>, the mobile phone <NUM> may further include a camera (a front-facing camera and/or a rear-facing camera), a flash, a micro projection apparatus, a near field communication (Near Field Communications, NFC) apparatus, and the like.

All methods in the following embodiments may be implemented in the mobile phone <NUM> having the foregoing hardware structure.

This application provides a Wi-Fi hotspot connection method, and the method may be applied to a process in which a terminal connects to a Wi-Fi hotspot. As shown in <FIG>, the Wi-Fi hotspot connection method provided in this application includes steps S701 to S707.

The terminal displays a first screen, where the first screen includes an SSID input box and a security selection box for a Wi-Fi hotspot.

For example, the terminal is a mobile phone <NUM>. The first screen in this application may be a hotspot addition screen <NUM> shown in <FIG>. The hotspot addition screen <NUM> (namely, the first screen) may include an SSID input box <NUM>, a security selection box <NUM>, a "cancel" button <NUM>, and a "connect" button <NUM>. For detailed descriptions of the SSID input box <NUM>, the security selection box <NUM>, the "cancel" button <NUM>, and the "connect" button <NUM>, refer to descriptions of the SSID input box <NUM>, the security selection box <NUM>, the "cancel" button <NUM>, and the "connect" button <NUM> that are shown in <FIG> in this application. Details are not described herein in this application again.

The terminal receives an SSID of a first Wi-Fi hotspot input by a user in the SSID input box.

For example, the mobile phone <NUM> may receive an SSID input by the user in the SSID input box <NUM>, for example, ABC123. In this case, as shown in <FIG>, the SSID input box <NUM> may include the SSID input by the user, for example, ABC123.

The terminal obtains an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

In a first application scenario of this application, as shown in step S703 in <FIG>, the terminal may obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot. For a specific method in which the terminal obtains the encryption manner of the first Wi-Fi hotspot from the Wi-Fi hotspot, refer to detailed descriptions in steps S301 to S303 in this application. Details are not described herein again in this application.

In a second application scenario of this application, the terminal may obtain the encryption manner of the first Wi-Fi hotspot from a cloud server. A plurality of Wi-Fi hotspots may share encryption manners of the plurality of Wi-Fi hotspots with the cloud server, and the cloud server may store SSIDs and the encryption manners of the plurality of Wi-Fi hotspots. For example, the terminal may send an encryption manner obtaining request to the cloud server, where the encryption manner obtaining request carries the SSID of the first Wi-Fi hotspot. After receiving the encryption manner obtaining request, the cloud server searches for the encryption manner of the first Wi-Fi hotspot, and sends an encryption manner obtaining response to the terminal, where the encryption manner obtaining response carries the found encryption manner.

The terminal compares whether the encryption manner of the first Wi-Fi hotspot is the same as an encryption manner selected from the security selection box.

Specifically, when the encryption manner of the first Wi-Fi hotspot is different from the encryption manner selected from the security selection box, step S705 is performed. For example, when the encryption manner selected from the security selection box is a default encryption manner (that is, the encryption manner is N/A), and the encryption manner of the first Wi-Fi hotspot is WPA/WPA2 PSK, the terminal may perform step S705. When the encryption manner of the first Wi-Fi hotspot is the same as the encryption manner selected from the security selection box, the terminal may interact with the first Wi-Fi hotspot for authentication on the terminal, so as to enable the terminal to connect to the first Wi-Fi hotspot. For a specific method in which the terminal interacts with the first Wi-Fi hotspot for authentication on the terminal, so as to enable the terminal to connect to the first Wi-Fi hotspot, refer to detailed descriptions of steps S305 to S307 in the foregoing embodiment. Details are not described herein again in this application.

The terminal displays a second screen, where the second screen includes a password input box.

Both the second screen and the first screen in this application are screens used to add a Wi-Fi hotspot for the terminal. However, the second screen is different from the first screen. The second screen includes the "password" input window used to input an access password of the Wi-Fi hotspot.

For example, the terminal is the mobile phone <NUM>. When the mobile phone <NUM> determines that the encryption manner of the first Wi-Fi hotspot is different from the default encryption manner, the mobile phone <NUM> may display a second screen <NUM> shown in FIG. The second screen <NUM> includes a "password" input window <NUM>, and the "password" input window <NUM> is used to receive an access password input by the user.

It may be understood that when the terminal displays the second screen, the terminal has obtained the encryption manner of the first Wi-Fi hotspot. In this case, the terminal may display the encryption manner of the first Wi-Fi hotspot on the second screen. For example, assuming that the encryption manner of the first Wi-Fi hotspot is WPA/WPA2 PSK, the mobile phone <NUM> may display a second screen <NUM> shown in <FIG>. The second screen <NUM> not only includes a "password" input window <NUM>, but also includes a "security" selection box <NUM> in which the encryption manner "WPA/WPA2 PSK" is displayed.

It should be emphasized that, as shown in <FIG>, that the terminal displays no "security" selection box <NUM> does not mean that the terminal does not obtain the encryption manner of the first Wi-Fi hotspot. Instead, the terminal does not present the encryption manner to the user on the display screen of the terminal, and the terminal still connects to the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot, the encryption manner obtained by the terminal, and the access password of the first Wi-Fi hotspot. To be specific, in this application, the terminal may connect to the Wi-Fi hotspot in a manner in which the encryption manner of the Wi-Fi hotspot is imperceptible to the user.

The terminal receives the access password of the first Wi-Fi hotspot input by the user in the password input box.

The second screen <NUM> shown in <FIG> is used as an example. As shown in <FIG>, the mobile phone <NUM> may receive the access password input by the user in the "password" input window <NUM>.

In response to a user's connection operation on the second screen, the terminal connects to the first Wi-Fi hotspot based on the SSID, the access password, and the obtained encryption manner of the first Wi-Fi hotspot.

For example, the user's connection operation on the second screen may be a user's tapping operation on a "connect" button <NUM> on the second screen <NUM> shown in <FIG>. As shown in <FIG>, after the user taps the "connect" button <NUM>, in response to the user's tapping operation on the "connect" button <NUM>, the mobile phone <NUM> may connect to the first Wi-Fi hotspot based on the SSID "ABC123" input in an SSID input box <NUM>, the encryption manner "WPA/WPA2 PSK" displayed in a "security" selection box <NUM>, and the access password "<NUM>" input in a "password" input window <NUM>.

It should be noted that, in this application, for a method in which the terminal connects to the first Wi-Fi hotspot based on the SSID, the access password, and the encryption manner of the first Wi-Fi hotspot, refer to the method steps corresponding to steps S301 to S307 in this application. Details are not described herein again in this application.

Optionally, before step S707 is performed, the terminal has obtained the encryption manner of the first Wi-Fi hotspot, and determines that the obtained encryption manner is different from the encryption manner selected from the security selection box. In other words, the terminal has scanned the Wi-Fi hotspot. Therefore, the terminal may no longer broadcast the probe request frame to scan the Wi-Fi hotspot. To be specific, in this application, for a method in which the terminal connects to the first Wi-Fi hotspot based on the SSID, the access password, and the encryption manner of the first Wi-Fi hotspot, refer to the method steps corresponding to steps S305 to S307 in this application. Details are not described herein again in this application.

According to the Wi-Fi hotspot connection method in this application, when the encryption manner of the first Wi-Fi hotspot is different from the encryption manner selected from the security selection box, the terminal does not directly display information indicating a connection failure, but displays the second screen on which the access password can be input. After the terminal receives the access password input by the user, in response to the user's connection operation, the terminal proceeds to connect to the first Wi-Fi hotspot based on the obtained encryption manner of the first Wi-Fi hotspot and the SSID and the access password of the first Wi-Fi hotspot. In this case, the user does not need to attempt to successively use encryption manners in the foregoing "security" list to connect to the Wi-Fi hotspot. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, and improve user experience.

Generally, after the user inputs the SSID of the first Wi-Fi hotspot on the first screen shown in <FIG>, the corresponding "password" input window is not displayed on the first screen. If the user is unfamiliar with a hidden hotspot connection manner, the user may directly tap the "connect" button <NUM> shown in <FIG>. A result is that the terminal fails to connect to the first Wi-Fi hotspot.

In this case, in an implementation of the first application scenario, in response to a user's connection operation on the first screen (for example, a user's tapping operation on the "connect" button <NUM> on the first screen shown in <FIG>), the terminal may obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot. Specifically, in this implementation, as shown in <FIG> and <FIG>, step S703 shown in <FIG> may be replaced with steps S1101 to S1106.

In response to the user's connection operation on the first screen, the terminal broadcasts a probe response frame, where the probe response frame carries the SSID of the first Wi-Fi hotspot.

For example, the user's connection operation on the first screen may be the user's tapping operation on the "connect" button <NUM> on the first screen shown in <FIG>. In response to the user's tapping operation on the "connect" button <NUM> on the first screen shown in <FIG>, the mobile phone <NUM> may broadcast the probe response frame carrying the SSID (such as ABC123) of the first Wi-Fi hotspot.

Optionally, the user's connection operation on the first screen may be a user's tapping operation on the "connect" button after the terminal receives the SSID input by the user and the encryption manner selected by the user and receives the access password input by the user.

For example, it is assumed that the SSID of the first Wi-Fi hotspot is ABC123, the encryption manner of the first Wi-Fi hotspot is a WPA/WPA2 PSK manner, and the access password of the first Wi-Fi hotspot is <NUM>.

As shown in <FIG>, after receiving the SSID "ABC123" input by the user in an SSID input box <NUM> shown in <FIG>, in response to a user's tapping operation on a security selection box <NUM>, the mobile phone <NUM> may display a security list <NUM> shown in <FIG>. The security list <NUM> includes a plurality of encryption manners, and the user may select an encryption manner from the security list <NUM> to connect to the first Wi-Fi hotspot. After the user selects an encryption manner "WAPI PSK" <NUM> shown in <FIG>, in response to the user's operation of selection of the WAPI PSK manner, the mobile phone <NUM> displays a display screen <NUM> shown in <FIG>. The display screen <NUM> shown in <FIG> includes a "security" selection box <NUM> in which the encryption manner "WAPI PSK" is displayed and a "password" input window <NUM>. As shown in <FIG>, after the user inputs the access password "<NUM>" in the "password" input window <NUM> and taps a "connect" button <NUM>, in response to the user's tapping operation on the "connect" button <NUM>, the mobile phone <NUM> may broadcast the probe response frame carrying the SSID "ABC123". To be specific, the first screen may alternatively be a display screen shown in <FIG>, and the user's connection operation on the first screen is the user's tapping operation on the "connect" button <NUM> shown in <FIG>.

S1102: The first Wi-Fi hotspot receives the probe request frame.

The first Wi-Fi hotspot determines that the SSID carried in the probe request frame is the same as the SSID of the first Wi-Fi hotspot.

The first Wi-Fi hotspot sends a probe response frame to the terminal, where the probe response frame carries the encryption manner of the first Wi-Fi hotspot.

The terminal receives the probe response frame carrying the encryption manner of the first Wi-Fi hotspot.

The terminal parses the probe response frame to obtain the encryption manner of the first Wi-Fi hotspot.

It may be figured out that, because the encryption manner "WAPI PSK" <NUM> selected by the user from the security list <NUM> shown in <FIG> is different from the encryption manner "WPA/WPA2 PSK" <NUM> of the first Wi-Fi hotspot, after receiving the probe response frame carrying the encryption manner of the first Wi-Fi hotspot, the mobile phone <NUM> performs step S704 to determine that the encryption manner (that is, the encryption manner "WAPI PSK" selected by the user) selected from the security selection box is different from the encryption manner "WPA/WPA2 PSK" of the first Wi-Fi hotspot, and then may proceed to perform steps S705 to S707.

In this application, after receiving the SSID input by the user on the first screen, in response to the user's connection operation on the first screen, the terminal may send the probe request frame to obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot. In this case, the user does not need to remember the encryption manner of the Wi-Fi hotspot or attempt to successively use different security information to connect to the Wi-Fi hotspot. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, improve efficiency of connecting to the Wi-Fi hotspot by the terminal, and improve user experience.

Certainly, some users may be familiar with the hidden hotspot connection manner. As shown in <FIG>, after inputting the SSID (for example, ABC123) in the SSID input box <NUM>, a user who is familiar with the hidden hotspot connection manner may proceed to tap the security selection box <NUM>. Generally, in response to the user's tapping operation on the security selection box <NUM> shown in <FIG>, the mobile phone <NUM> may display the "security" list <NUM> shown in <FIG>, so that the user selects the encryption manner. However, the user may not know the encryption manner of the first Wi-Fi hotspot, and cannot select the correct encryption manner from the "security" list <NUM>.

In this case, in an implementation of the first application scenario or the second application scenario, in response to the user's tapping operation on the security selection box, the terminal may display the "security" list including a security obtaining option. In response to a user's tapping operation on the security obtaining option, the terminal may automatically obtain the encryption manner of the first Wi-Fi hotspot. Specifically, as shown in <FIG>, before step S703 shown in <FIG> is performed, the method in this application may further include step S1201, and step S703 shown in <FIG> may be replaced with step S1202.

In response to a user's tapping operation on the security selection box on the first screen, the terminal displays a third screen, where the third screen includes an encryption manner option and a security obtaining option.

The security selection box in this application may be a security selection box <NUM> on a first screen <NUM> shown in <FIG>. For example, the mobile phone <NUM> is used as the terminal. In response to a user's tapping operation on the security selection box <NUM> shown in <FIG>, the mobile phone <NUM> may display a third screen <NUM> shown in <FIG>. The third screen <NUM> shown in <FIG> includes a "security" obtaining option <NUM> and encryption manners such as WEP and WPA/WPA2 PSK.

For example, as shown in <FIG>, information indicating "the mobile phone automatically obtains security" may be displayed in the "security" obtaining option <NUM>, to prompt the user to tap the "security" obtaining option <NUM> to trigger the mobile phone to automatically obtain the encryption manner of the Wi-Fi hotspot.

In response to a user's selection from the security obtaining option, the terminal obtains the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

For example, after the user taps the "security" obtaining option <NUM> shown in <FIG>, the mobile phone <NUM> may obtain the encryption manner of the first Wi-Fi hotspot, and then perform steps S704 to S707.

It should be noted that, the encryption manners (namely, the foregoing encryption manner option) such as WEP and WPA/WPA2 PSK on the third screen <NUM> shown in <FIG> are optional. The third screen may include only the security obtaining option, but does not include the encryption manner option.

In response to the user's selection from the security obtaining option, the terminal may obtain the encryption manner of the first Wi-Fi hotspot from the cloud server based on the SSID of the first Wi-Fi hotspot. For a method in which the terminal obtains the encryption manner of the first Wi-Fi hotspot from the cloud server, refer to related descriptions after step S703 is performed in this application. Details are not described herein again in this application.

Alternatively, in response to the user's selection from the security obtaining option, the terminal may broadcast a probe response frame to obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot. For a method in which the terminal broadcasts the probe response frame to obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot, refer to related descriptions in steps S1101 to S1106 in this application. Details are not described herein again in this application.

In this application, after receiving the SSID input by the user on the first screen, in response to the user's tapping operation on the security selection box on the first screen, the terminal may display the third screen. Because the third screen includes the encryption manner option and the security obtaining option, even if the user does not know the encryption manner of the first Wi-Fi hotspot, the user may also tap the security obtaining option, so that the terminal automatically obtains the encryption manner of the first Wi-Fi hotspot in response to the user's tapping operation on the security obtaining option. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, improve efficiency of connecting to the Wi-Fi hotspot by the terminal, and improve user experience.

Optionally, like the foregoing two implementations, in another implementation of the first application scenario or the second application scenario, after the terminal receives the SSID of the first Wi-Fi hotspot input by the user on the first screen (to be specific, after step S702 is performed), even though the terminal does not receive the user's tapping operation on the "security" selection box or does not receive the user's tapping operation on the "connect" button, the terminal may also perform step S703 to obtain the encryption manner of the first Wi-Fi hotspot. Specifically, in response to the operation that "the user inputs the SSID of the first Wi-Fi hotspot on the first screen", the terminal may obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot. To be specific, in response to the operation that "the user inputs the SSID of the first Wi-Fi hotspot on the first screen", the terminal may further perform step S703. Specifically, as shown in <FIG>, step S703 shown in <FIG> may be replaced with step S1401.

In response to the user's input of the SSID of the first Wi-Fi hotspot on the first screen, the terminal obtains the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

For example, after the mobile phone <NUM> detects the SSID (for example, ABC123) of the first Wi-Fi hotspot input by the user on a first screen <NUM> shown in <FIG>, the mobile phone <NUM> may obtain the encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot.

Referring to a security selection box <NUM> shown in <FIG>, a default encryption manner N/A of the mobile phone <NUM> is shown in the security selection box <NUM>. Therefore, when obtaining the encryption manner of the first Wi-Fi hotspot, the mobile phone <NUM> may perform step S704, and learn that the encryption manner of the first Wi-Fi hotspot is different from the default encryption manner. In this case, the mobile phone <NUM> may display a second screen. For example, the mobile phone <NUM> may display a second screen <NUM> shown in <FIG>. Optionally, the second screen <NUM> shown in <FIG> may be replaced with the second screen <NUM> shown in <FIG>.

For example, from the operation in which the terminal detects that the user starts to input the SSID in an SSID input box <NUM>, if the terminal detects no character input by the user in the SSID input box <NUM> within a preset time after the terminal detects that the user inputs one character in the SSID input box <NUM>, the terminal may perform step S1401 to obtain the encryption manner of the first Wi-Fi hotspot based on the SSID that includes all characters input in the SSID input box <NUM>. After the terminal performs step S1401, if the terminal further detects that the user continues to input a character in the SSID input box <NUM>, the terminal may perform step S1401 again to obtain the encryption manner of the first Wi-Fi hotspot based on the SSID that includes all characters input in the SSID input box <NUM>.

In response to receiving of the SSID of the first Wi-Fi hotspot input by the user on the first screen, the terminal may obtain the encryption manner of the first Wi-Fi hotspot from the cloud server based on the SSID of the first Wi-Fi hotspot. For a method in which the terminal obtains the encryption manner of the first Wi-Fi hotspot from the cloud server, refer to related descriptions after step S703 is performed in this application. Details are not described herein again in this application.

Alternatively, in response to receiving of the SSID of the first Wi-Fi hotspot input by the user on the first screen, the terminal may broadcast a probe response frame to obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot. For a method in which the terminal broadcasts the probe response frame to obtain the encryption manner of the first Wi-Fi hotspot from the first Wi-Fi hotspot, refer to related descriptions in steps S1101 to S <NUM> in this application. Details are not described herein again in this application.

In this application, after the terminal receives the SSID input by the user on the first screen, even if the terminal does not receive the user's tapping operation in the "security" selection box or does not receive the user's tapping operation on the "connect" button, in response to the operation that "the user inputs the SSID of the first Wi-Fi hotspot on the first screen", the terminal may also directly obtain the encryption manner of the first Wi-Fi hotspot. To be specific, in this application, the terminal may further automatically obtain the encryption manner of the first Wi-Fi hotspot in a manner in which the encryption manner of the Wi-Fi hotspot is imperceptible to the user.

It may be understood that, after the terminal displays the second screen (that is, after step S705 is performed), and before the terminal receives the access password of the first Wi-Fi hotspot input by the user on the second screen (that is, before step S706 is performed), even if the terminal responds to the user's connection operation on the second user screen, the terminal still cannot succeed in connecting to the Wi-Fi hotspot because the user has not input the access password of the Wi-Fi hotspot on the second screen. Therefore, in this application, after the terminal displays the second screen, and before the terminal receives the access password of the first Wi-Fi hotspot input by the user on the second screen, the terminal does not respond to the user's connection operation on the second screen, in other words, the terminal does not respond to the user's tapping operation on the "connect" button on the second screen.

For example, when the user has not input the access password in a "password" input window <NUM>, the mobile phone <NUM> may display, on a second screen, a "connect" button <NUM> in an inoperable state shown in <FIG>. The mobile phone <NUM> does not respond to any user's operation on the "connect" button <NUM> shown in <FIG>.

As shown in <FIG>, after the user inputs the access password in a "password" input window <NUM>, a "connect" button <NUM> is switched to an operable state. In response to a user's tapping operation on the "connect" button <NUM> shown in <FIG>, the mobile phone <NUM> connects to the Wi-Fi hotspot.

This application provides the Wi-Fi hotspot connection method. The terminal may automatically obtain the security information of the first Wi-Fi hotspot, and the user does not need to remember the security information or attempt to successively use different security information to connect to a network. This can reduce operations performed by the user when the terminal connects to the Wi-Fi hotspot, shorten a time for the terminal to connect to the Wi-Fi hotspot, and improve user experience.

It can be understood that, to implement the foregoing functions, the terminal and the like include corresponding hardware structures and/or software modules for performing the functions. Persons skilled in the art should be easily aware that, in the embodiments of the present invention, the units and algorithm steps in the examples described with reference to the embodiments disclosed in this specification can be implemented by hardware or a combination of hardware and computer software. Whether a function is performed by hardware or hardware driven by computer software depends on particular applications and design constraints of the technical solutions. Persons skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of the embodiments of the present invention.

In the embodiments of this application, the terminal may be divided into functional modules based on the foregoing method examples. For example, each functional module may be obtained through division based on each corresponding function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module. It should be noted that the module division in the embodiments of the present invention is an example, and is merely logical function division. There may be another division manner in actual implementation.

When functional modules corresponding to various functions are obtained through division, <FIG> is a possible schematic structural diagram of a terminal in the foregoing embodiments. As shown in <FIG>, the terminal <NUM> includes a display unit <NUM>, an input unit <NUM>, an obtaining unit <NUM>, and a connection unit <NUM>. The display unit <NUM> is configured to support the terminal in performing step S701, step S705, and step S1201 in the method embodiment, and/or is configured to perform another process of the technology described in this specification. The input unit <NUM> is configured to support the terminal in performing step S702, and step S706 in the method embodiment, and/or is configured to perform another process of the technology described in this specification. The obtaining unit <NUM> is configured to support the terminal in performing step S703, step S1202, step S1401, step S1101, and steps <NUM> to S1106 in the method embodiment, and/or is configured to perform another process of the technology described in this specification. The connection unit <NUM> is configured to support the terminal in performing step S301, step S303, steps <NUM> to S307, and step <NUM> in the method embodiment, and/or is configured to perform another process of the technology described in this specification.

All related content of the steps in the foregoing method embodiment may be cited in function descriptions of corresponding functional modules.

Certainly, the terminal <NUM> includes but is not limited to the unit modules listed above. For example, the terminal <NUM> may further include a storage unit, and the storage unit is configured to store an SSID, an encryption manner, and an access password of a Wi-Fi hotspot to which the terminal has connected. The storage unit may be further configured to store the first screen, a second screen, and the like. The terminal <NUM> may further include a comparing unit. The comparing unit is configured to support the terminal in performing step S304, and step S704 in the method embodiment, and/or is configured to perform another process of the technology described in this specification.

In addition, functions that the functional units can specifically implement include but are not limited to the functions corresponding to the method steps in the foregoing examples. For detailed descriptions about other units of the terminal <NUM>, refer to the detailed descriptions about the method steps corresponding to the units. Details are not described herein again in this embodiment of this application.

When an integrated unit is used, the input unit <NUM>, a calculation unit, and the like may be integrated into one processing module for implementation. For example, the connection unit <NUM> may be a Wi-Fi module (for example, the Wi-Fi apparatus <NUM> shown in <FIG>) in the terminal. When the terminal obtains from a first Wi-Fi hotspot, an encryption manner of the first Wi-Fi hotspot, the obtaining unit <NUM> may also be a Wi-Fi module (for example, the Wi-Fi apparatus <NUM> shown in <FIG>) in the terminal. When the terminal obtains from a cloud server, the encryption manner of the first Wi-Fi hotspot, the obtaining unit <NUM> may be any one of a Bluetooth module (for example, the Bluetooth apparatus <NUM> in the mobile phone <NUM> shown in <FIG>), an RF circuit (for example, the radio frequency circuit <NUM> shown in <FIG>), or a Wi-Fi module (for example, the Wi-Fi apparatus <NUM> shown in <FIG>) in the terminal. The obtaining unit <NUM> and the connection unit <NUM> may be collectively referred to as a communications module. The input module <NUM> may be a processing module. The storage unit may be a storage module (for example, the memory <NUM> shown in <FIG>) in the terminal, and the display unit may be a display module, for example, a touchscreen (for example, the touchscreen <NUM> shown in <FIG>).

<FIG> is a possible schematic structural diagram of a terminal in the foregoing embodiment. The terminal <NUM> includes a processing module <NUM>, a storage module <NUM>, a display module <NUM>, and a communications module <NUM>. The processing module <NUM> is configured to perform control management on an action of the terminal. The display module <NUM> is configured to display an image generated by the processing module <NUM>, for example, a first screen and a second screen. The storage module <NUM> is configured to store program code and data of the terminal. The communications module <NUM> is configured to communicate with another terminal. For example, the communications module <NUM> is configured to interact with a first Wi-Fi hotspot to be accessed the first Wi-Fi hotspot. The communications module <NUM> is configured to interact with a cloud server to obtain an encryption manner of the first Wi-Fi hotspot. The processing module <NUM> may be a processor or a controller, for example, may be a central processing unit (Central Processing Unit, CPU), a general purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or another programmable logic device, a transistor logic device, a hardware component, or any combination thereof. The processing module <NUM> may implement or execute various example logical blocks, modules, and circuits described with reference to content disclosed in the present invention. Alternatively, the processor may be a combination for implementing a computing function, for example, a combination of one or more microprocessors, or a combination of the DSP and a microprocessor. The communications module <NUM> may be a transceiver, a transceiver circuit, a communications interface, or the like. The storage module <NUM> may be a memory.

When the processing module <NUM> is the processor (for example, the processor <NUM> shown in <FIG>), the communications module <NUM> is an RF transceiver circuit (for example, the radio frequency circuit <NUM> shown in <FIG>), and the storage module <NUM> is a memory (for example, the memory <NUM> shown in <FIG>). When the display module <NUM> is a touchscreen (including the touchpad <NUM>-<NUM> and the display <NUM>-<NUM> shown in <FIG>), the terminal provided in this embodiment of the present invention may be the terminal <NUM> shown in <FIG>. The communications modules <NUM> may include not only the RF circuit, but also a Wi-Fi module and a Bluetooth module. The communications modules such as the RF circuit, the Wi-Fi module, and the Bluetooth module may be collectively referred to as a communications interface. The processor, the communications interface, the touchscreen, and the storage area may be coupled together by using a bus.

This application further provides a computer storage medium, where the computer storage medium stores computer program code, and when the processor executes the computer program code, the terminal performs related method steps in any one of <FIG>, <FIG>, <FIG> and <FIG>, <FIG>, and <FIG> to implement the Wi-Fi hotspot connection method in the foregoing embodiments.

This application further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to perform related method steps in any one of <FIG>, <FIG>, <FIG> and <FIG>, <FIG>, and <FIG> to implement the Wi-Fi hotspot connection method in the foregoing embodiments.

The terminal <NUM>, the terminal <NUM>, the computer storage medium, and the computer program product provided in this application are all configured to perform the corresponding methods provided in the foregoing. Therefore, for beneficial effects that can be achieved by the terminal <NUM>, the terminal <NUM>, the computer storage medium, and the computer program product, refer to the beneficial effects of the corresponding methods provided in the foregoing.

The foregoing descriptions about implementations allow persons skilled in the art to understand that, for the purpose of convenient and brief description, division of the foregoing functional modules is used as an example for illustration. In actual application, the foregoing functions may be allocated to different functional modules and implemented as required, to be specific, an inner structure of an apparatus is divided into different functional modules to implement all or some of the functions described above. For a detailed working process of the foregoing system, apparatus, and unit, refer to a corresponding process in the foregoing method embodiments.

For example, the module or unit division is merely logical function division, and there may be another division manner in actual implementation. In addition, displayed or discussed mutual couplings or direct couplings or communication connections may be indirect couplings or communication connections using some interfaces, apparatuses, or units, and may have an electrical form, a mechanical form, or another form.

The units described as separate parts may or may not be physically separate; and parts displayed as units may or may not be physical units, in other words, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions in the embodiments.

The integrated units may be implemented in a form of hardware, or may be implemented in a form of a software functional unit.

When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, the integrated unit may be stored in a computer-readable storage medium. Based on such an understanding, the technical solutions of this application essentially, or the part contributing to the prior art, or all or some of the technical solutions may be implemented in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device, or the like) or a processor to perform all or some of the steps of the methods described in the embodiments of this application. The foregoing storage medium includes any medium that can store program code, such as a flash memory, a removable hard disk, a read-only memory, a random access memory, a magnetic disk, or an optical disc.

Claim 1:
A Wi-Fi hotspot connection method, wherein the method comprises:
• displaying (step <NUM>), by a terminal, a first screen, wherein the first screen comprises a service set identifier, SSID, input box, a security selection box for a wireless fidelity Wi-Fi hotspot and a password input box;
• receiving (step <NUM>), by the terminal, an SSID of a first Wi-Fi hotspot input by a user in the SSID input box, an access password of a first Wi-Fi hotspot input by a user in the password input box and an encryption manner selected from the security selection box in the first screen, and
• in response to the user's first operation on the first screen, obtaining (step <NUM>), by the terminal, an encryption manner of the first Wi-Fi hotspot based on the SSID of the first Wi-Fi hotspot;
• displaying (step <NUM>), by the terminal, a second screen if the obtained encryption manner of the first Wi-Fi hotspot is different from an encryption manner selected from the security selection box, wherein the second screen comprises the password input box;
• receiving (step <NUM>), by the terminal, the access password of the first Wi-Fi hotspot input by the user in the password input box; and
• in response to the user's second operation on the second screen, connecting (step <NUM>), by the terminal, to the first Wi-Fi hotspot based on the SSID, the access password, and the obtained encryption manner of the first Wi-Fi hotspot.