A method for wireless fidelity, Wi-Fi, connection, the method being executed by a mobile terminal and comprising the following steps: performing Wi-Fi scan to obtain information of K access points, APs, K being a positive integer; determining a current position of the mobile terminal; obtaining , from historical records of Wi-Fi connections, a first Wi-Fi list according to the current position, each Wi-Fi list in the historical records of Wi-Fi connections corresponds to a position; matching the information of the K APs with information of P unhidden APs in the first Wi-Fi list, the first Wi-Fi list containing the P unhidden APs and Q hidden APs, P and Q both being positive integers, and the information of an AP comprising at least one of a service set identifier, SSID, a basic service set identifier, BSSID, an encryption scheme, or geographic position information; and determining , in response to a match between the information of the K APs and the information of the P unhidden APs in the first Wi-Fi list, the Q hidden APs as candidate APs for roaming; matching the information of the K APs with the information of the P unhidden APs in the first Wi-Fi list pre-stored comprising: determining, from the P unhidden APs in the first Wi-Fi list, A APs corresponding to the information of the K APs, A being a natural number; determining, in response to that a ratio of A to P exceeds a preset threshold, that the match between the information of the K APs and the information of the P unhidden APs in the first Wi-Fi list exists. performing Wi-Fi scan to obtain information of K access points, APs, K being a positive integer; determining a current position of the mobile terminal; obtaining , from historical records of Wi-Fi connections, a first Wi-Fi list according to the current position, each Wi-Fi list in the historical records of Wi-Fi connections corresponds to a position; matching the information of the K APs with information of P unhidden APs in the first Wi-Fi list, the first Wi-Fi list containing the P unhidden APs and Q hidden APs, P and Q both being positive integers, and the information of an AP comprising at least one of a service set identifier, SSID, a basic service set identifier, BSSID, an encryption scheme, or geographic position information; and determining , in response to a match between the information of the K APs and the information of the P unhidden APs in the first Wi-Fi list, the Q hidden APs as candidate APs for roaming; matching the information of the K APs with the information of the P unhidden APs in the first Wi-Fi list pre-stored comprising: determining, from the P unhidden APs in the first Wi-Fi list, A APs corresponding to the information of the K APs, A being a natural number; determining, in response to that a ratio of A to P exceeds a preset threshold, that the match between the information of the K APs and the information of the P unhidden APs in the first Wi-Fi list exists. determining, from the P unhidden APs in the first Wi-Fi list, A APs corresponding to the information of the K APs, A being a natural number; determining, in response to that a ratio of A to P exceeds a preset threshold, that the match between the information of the K APs and the information of the P unhidden APs in the first Wi-Fi list exists. <EOS>