[go: up one dir, main page]

CN106211051A - A method, device and mobile terminal for automatically connecting to WIFI hotspots - Google Patents

A method, device and mobile terminal for automatically connecting to WIFI hotspots Download PDF

Info

Publication number
CN106211051A
CN106211051A CN201610820937.2A CN201610820937A CN106211051A CN 106211051 A CN106211051 A CN 106211051A CN 201610820937 A CN201610820937 A CN 201610820937A CN 106211051 A CN106211051 A CN 106211051A
Authority
CN
China
Prior art keywords
wifi
hot spot
mobile terminal
mac address
nfc
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610820937.2A
Other languages
Chinese (zh)
Inventor
高申俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201610820937.2A priority Critical patent/CN106211051A/en
Publication of CN106211051A publication Critical patent/CN106211051A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/10009Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06KGRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
    • G06K7/00Methods or arrangements for sensing record carriers, e.g. for reading patterns
    • G06K7/10Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
    • G06K7/14Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation using light without selection of wavelength, e.g. sensing reflected white light
    • G06K7/1404Methods for optical code recognition
    • G06K7/1408Methods for optical code recognition the method being specifically adapted for the type of code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/06Authentication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Toxicology (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Electromagnetism (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Telephone Function (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a method, a device and a mobile terminal for automatically connecting WIFI hotspots, wherein MAC addresses and WIFI passwords of the WIFI hotspots are manufactured on NFC barcodes, when a mobile terminal user needs to connect a WIFI network, the NFC barcodes are scanned by the mobile terminal with an NFC function, the MAC addresses and the WIFI passwords of the WIFI hotspots can be automatically acquired, the WIFI hotspots corresponding to the MAC addresses can be automatically connected, and the WIFI hotspots can verify the WIFI passwords and access the WIFI network. Therefore, the mobile terminal user does not need to manually input a WIFI password and manually search a WIFI hotspot, and can automatically connect with the WIFI network only by scanning the NFC barcode, so that great convenience is brought to the networking of the mobile terminal user.

Description

一种自动连接WIFI热点的方法、装置及移动终端A method, device and mobile terminal for automatically connecting to WIFI hotspots

技术领域technical field

本发明涉及移动终端技术领域,尤其涉及一种自动连接WIFI热点的方法、装置及移动终端。The invention relates to the technical field of mobile terminals, in particular to a method and device for automatically connecting to a WIFI hotspot and a mobile terminal.

背景技术Background technique

在现有技术中,目前很多店面为了方便顾客在店内上网,一般都设置了WIFI热点,并且商家会在显眼的地方写上连接WIFI热点的WIFI密码以及WIFI热点名称。然而,连接WIFI热点需要用户手动添加WIFI热点以及手动输入WIFI密码以进行验证,这给顾客带来极大的不方便。In the prior art, at present many storefronts are generally provided with WIFI hotspots in order to facilitate customers to surf the Internet in the store, and the businessman will write the WIFI password and the WIFI hotspot name connected to the WIFI hotspot in a conspicuous place. However, connecting to a WIFI hotspot requires the user to manually add a WIFI hotspot and manually input a WIFI password for verification, which brings great inconvenience to customers.

故,有必要提出一种新的技术方案,以解决上述技术问题。Therefore, it is necessary to propose a new technical solution to solve the above technical problems.

发明内容Contents of the invention

有鉴于此,本发明的目的在于提供一种自动连接WIFI热点的方法、装置及移动终端,旨在解决现有技术存在的连接WIFI热点,需要用户手动添加WIFI热点以及手动输入WIFI密码以进行验证,这给顾客带来极大的不方便的问题。In view of this, the object of the present invention is to provide a method, device and mobile terminal for automatically connecting to WIFI hotspots, aiming to solve the problem of connecting WIFI hotspots in the prior art, requiring users to manually add WIFI hotspots and manually input WIFI passwords for verification , which brings great inconvenience to customers.

为解决上述技术问题,本发明实施例提供了以下技术方案:In order to solve the above technical problems, the embodiments of the present invention provide the following technical solutions:

本发明实施例提供了一种自动连接WIFI热点的方法,所述自动连接WIFI热点的方法,包括以下步骤:The embodiment of the present invention provides a method for automatically connecting to a WIFI hotspot, and the method for automatically connecting to a WIFI hotspot includes the following steps:

开启移动终端NFC功能;Turn on the NFC function of the mobile terminal;

扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;Scan the NFC barcode to obtain the MAC address of the WIFI hotspot and the WIFI password; wherein, the NFC barcode includes the MAC address of the WIFI hotspot and the WIFI password;

根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;Generate a WIFI connection instruction according to the MAC address and the WIFI password of the WIFI hotspot; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。Automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

为解决上述技术问题,本发明实施例还提供了以下技术方案:In order to solve the above technical problems, the embodiment of the present invention also provides the following technical solutions:

本发明实施例还提供了一种自动连接WIFI热点的装置,所述自动连接WIFI热点的装置,包括:The embodiment of the present invention also provides a device for automatically connecting to a WIFI hotspot. The device for automatically connecting to a WIFI hotspot includes:

NFC开启模块,用于开启移动终端NFC功能;The NFC opening module is used to open the NFC function of the mobile terminal;

NFC读取模块,用于扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;The NFC reading module is used to scan the NFC barcode to obtain the MAC address of the WIFI hotspot and the WIFI password; wherein, the NFC barcode includes the MAC address of the WIFI hotspot and the WIFI password;

连接指令生成模块,用于根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;A connection instruction generating module, configured to generate a WIFI connection instruction according to the MAC address and the WIFI password of the WIFI hotspot; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

WIFI连接模块,用于根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。A WIFI connection module, configured to automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

为解决上述技术问题,本发明实施例还提供了以下技术方案:In order to solve the above technical problems, the embodiment of the present invention also provides the following technical solutions:

本发明实施例还提供了一种移动终端,所述移动终端包括存储器和处理器,所述存储器存储有处理器可执行的指令,所述处理器用于执行所述存储器中的指令,所述指令用于执行如下操作:An embodiment of the present invention also provides a mobile terminal, the mobile terminal includes a memory and a processor, the memory stores instructions executable by the processor, and the processor is used to execute the instructions in the memory, the instructions Used to perform the following operations:

开启移动终端NFC功能;Turn on the NFC function of the mobile terminal;

扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;Scan the NFC barcode to obtain the MAC address of the WIFI hotspot and the WIFI password; wherein, the NFC barcode includes the MAC address of the WIFI hotspot and the WIFI password;

根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;Generate a WIFI connection instruction according to the MAC address and the WIFI password of the WIFI hotspot; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。Automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

相对于现有技术,本发明提供的自动连接WIFI热点的方法、装置及移动终端,通过将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上,当移动终端用户需要连接WIFI网络时,只要通过具有NFC功能的移动终端扫描一下该NFC条码,便能自动获取WIFI热点的MAC地址以及WIFI密码,以及能自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。因此,本发明不需要移动终端用户手动输入WIFI密码以及手动查找WIFI热点,只要扫描一下NFC条码便能自动连接WIFI网络,从而给移动终端用户联网带来极大的方便。Compared with the prior art, the method, device and mobile terminal for automatically connecting to a WIFI hotspot provided by the present invention, by making the MAC address of the WIFI hotspot and the WIFI password on the NFC barcode, when the mobile terminal user needs to connect to the WIFI network, just pass A mobile terminal with an NFC function scans the NFC barcode to automatically obtain the MAC address of the WIFI hotspot and the WIFI password, and automatically connect to the WIFI hotspot corresponding to the MAC address, so that the WIFI hotspot performs a check on the WIFI password. Verify and access the WIFI network. Therefore, the present invention does not require mobile terminal users to manually input WIFI passwords and manually search for WIFI hotspots, and can automatically connect to the WIFI network as long as the NFC barcode is scanned, thereby bringing great convenience to mobile terminal users for networking.

附图说明Description of drawings

图1是本发明实施例一提供的自动连接WIFI热点的方法的实现流程示意图。FIG. 1 is a schematic flowchart of the implementation of the method for automatically connecting to a WIFI hotspot provided by Embodiment 1 of the present invention.

图2是本发明实施例二提供的自动连接WIFI热点的方法的实现流程示意图。FIG. 2 is a schematic flowchart of the implementation of the method for automatically connecting to a WIFI hotspot provided by Embodiment 2 of the present invention.

图3是本发明实施例提供的应用环境示意图。Fig. 3 is a schematic diagram of an application environment provided by an embodiment of the present invention.

图4是本发明实施例三提供的自动连接WIFI热点的装置的模块示意图。Fig. 4 is a block diagram of the device for automatically connecting to a WIFI hotspot provided by Embodiment 3 of the present invention.

图5是本发明实施例提供的自动连接WIFI热点的装置的详细模块示意图。Fig. 5 is a schematic diagram of detailed modules of the device for automatically connecting to a WIFI hotspot provided by an embodiment of the present invention.

图6是本发明实施例提供的移动终端的结构示意图。Fig. 6 is a schematic structural diagram of a mobile terminal provided by an embodiment of the present invention.

具体实施方式detailed description

请参照附图中的图式,其中相同的组件符号代表相同的组件,本发明的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所示例的本发明的具体实施例,其不应被视为限制本发明未在此详述的其它具体实施例。Referring to the drawings in the accompanying drawings, where like reference numerals represent like components, the principles of the present invention are exemplified when implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the invention and should not be construed as limiting the invention to other specific embodiments not described in detail herein.

本发明原理以上述文字来说明,其并不代表为一种限制,本领域技术人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。本发明的原理使用许多其它泛用性或特定目的运算、通信环境或组态来进行操作。The principles of the present invention are described in the above words, which are not meant to be a limitation. Those skilled in the art will understand that the various steps and operations described below can also be implemented in hardware. The principles of the invention operate with numerous other general purpose or special purpose computing, communication environments or configurations.

实施例一Embodiment one

请参阅图1,所示为本发明实施例提供的自动连接WIFI热点的方法。Please refer to FIG. 1 , which shows a method for automatically connecting to a WIFI hotspot provided by an embodiment of the present invention.

所述自动连接WIFI热点的方法,应用于移动终端中,具体包括如下步骤:The method for automatically connecting to a WIFI hotspot is applied in a mobile terminal, and specifically includes the following steps:

在步骤S101中,开启移动终端NFC功能;In step S101, open the NFC function of the mobile terminal;

在本发明实施例中,事先将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上。当移动终端用户需要连接WIFI网络时,只要开启移动终端NFC功能,通过具有NFC功能的移动终端扫描一下该NFC条码,便能自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。In the embodiment of the present invention, the MAC address of the WIFI hotspot and the WIFI password are made on the NFC barcode in advance. When the mobile terminal user needs to connect to the WIFI network, as long as the NFC function of the mobile terminal is turned on, the NFC barcode can be scanned by the mobile terminal with the NFC function, and the WIFI hotspot corresponding to the MAC address can be automatically connected, so that the WIFI hotspot can be connected to the WIFI hotspot. The WIFI password is verified and connected to the WIFI network.

然而,可以理解的是,用户可以手动开启移动终端NFC功能,或者是移动终端自动开启移动终端NFC功能。移动终端自动开启移动终端NFC功能的具体实现方案如下:However, it can be understood that the user may manually enable the NFC function of the mobile terminal, or the mobile terminal may automatically enable the NFC function of the mobile terminal. The specific implementation scheme for the mobile terminal to automatically enable the NFC function of the mobile terminal is as follows:

1、检测当前环境是否有WIFI信号。1. Detect whether there is a WIFI signal in the current environment.

2、如果检测到当前环境有WIFI信号,则生成NFC功能开启指令。如果没有检测到WIFI信号,则不开启移动终端NFC功能。2. If it is detected that there is a WIFI signal in the current environment, an NFC function activation instruction is generated. If no WIFI signal is detected, the NFC function of the mobile terminal is not enabled.

3、根据所述NFC功能开启指令,开启移动终端NFC功能。3. According to the NFC function enabling instruction, enable the NFC function of the mobile terminal.

作为本发明一优选实施例,检测当前环境是否有WIFI信号,如果检测到当前环境有WIFI信号,而且该WIFI信号强度大于预设的信号强度值时(说明该WIFI信号强度适合通信),那么才触发生成NFC功能开启指令,根据所述NFC功能开启指令,开启移动终端NFC功能。否则,不开启移动终端NFC功能。As a preferred embodiment of the present invention, it is detected whether there is a WIFI signal in the current environment. If it is detected that the current environment has a WIFI signal, and the WIFI signal strength is greater than the preset signal strength value (indicating that the WIFI signal strength is suitable for communication), then Triggering and generating an NFC function enabling instruction, and enabling the NFC function of the mobile terminal according to the NFC function enabling instruction. Otherwise, the NFC function of the mobile terminal is not enabled.

作为本发明另一优选实施例,在所述开启移动终端NFC功能的步骤之后,还包括:提示移动终端用户扫描NFC条码。可通过语音播报的形式来提示移动终端用户扫描NFC条码。或者,弹出提示框来提示移动终端用户扫描NFC条码。然而,并不限于上述方案。As another preferred embodiment of the present invention, after the step of enabling the NFC function of the mobile terminal, it further includes: prompting the user of the mobile terminal to scan the NFC barcode. The mobile terminal user can be prompted to scan the NFC barcode in the form of voice broadcast. Or, pop up a prompt box to prompt the mobile terminal user to scan the NFC barcode. However, it is not limited to the above scheme.

在步骤S102中,扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;In step S102, scan the NFC barcode to obtain the MAC address and the WIFI password of the WIFI hotspot; wherein, the NFC barcode includes the MAC address and the WIFI password of the WIFI hotspot;

在本发明实施例中,通过具有NFC功能的移动终端的NFC读写模块来扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码。In the embodiment of the present invention, the NFC barcode is scanned by the NFC read-write module of the mobile terminal with NFC function to obtain the MAC address of the WIFI hotspot and the WIFI password.

在步骤S103中,根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;In step S103, a WIFI connection instruction is generated according to the MAC address of the WIFI hotspot and the WIFI password; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

在本发明实施例中,根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令的步骤,具体包括:In the embodiment of the present invention, the step of generating a WIFI connection instruction according to the MAC address of the WIFI hotspot and the WIFI password specifically includes:

根据所述WIFI热点的MAC地址以及WIFI密码,配置WIFI热点对应的参数;根据WIFI热点对应的参数,生成WIFI连接指令。Configure parameters corresponding to the WIFI hotspot according to the MAC address and the WIFI password of the WIFI hotspot; generate a WIFI connection instruction according to the parameters corresponding to the WIFI hotspot.

在步骤S104中,根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。In step S104, automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

作为本发明另一优选实施例,为了不影响移动终端用户进行传输数据,即当WIFI网络不足于支持传输数据时,那么将WIFI网络切换至数据网络下进行传输数据。在根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点的步骤之后,还包括:As another preferred embodiment of the present invention, in order not to affect the data transmission of mobile terminal users, that is, when the WIFI network is insufficient to support data transmission, the WIFI network is switched to the data network for data transmission. After the step of automatically connecting the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, it also includes:

A、检测移动终端当前是否需要传输数据;A. Detect whether the mobile terminal currently needs to transmit data;

B、如果检测到需要传输数据,则获取所述WIFI热点的信号强度;B. If it is detected that data needs to be transmitted, then obtain the signal strength of the WIFI hotspot;

C、将所述信号强度与预设阈值进行比较;C. Comparing the signal strength with a preset threshold;

D、当所述信号强度低于预设阈值时,则将当前WIFI网络切换至数据网络。D. When the signal strength is lower than the preset threshold, switch the current WIFI network to the data network.

由上可知,本实施例一提供的自动连接WIFI热点的方法,通过将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上,当移动终端用户需要连接WIFI网络时,只要通过具有NFC功能的移动终端扫描一下该NFC条码,便能自动获取WIFI热点的MAC地址以及WIFI密码,以及能自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。因此,本实施例一不需要移动终端用户手动输入WIFI密码以及手动查找WIFI热点,只要扫描一下NFC条码便能自动连接WIFI网络,从而给移动终端用户联网带来极大的方便。As can be seen from the above, the method for automatically connecting to a WIFI hotspot provided by the first embodiment is to make the MAC address of the WIFI hotspot and the WIFI password on the NFC barcode. After the terminal scans the NFC barcode, it can automatically obtain the MAC address and WIFI password of the WIFI hotspot, and can automatically connect to the WIFI hotspot corresponding to the MAC address, so that the WIFI hotspot can verify the WIFI password and access the WIFI The internet. Therefore, this embodiment one does not require the mobile terminal user to manually enter the WIFI password and manually search for the WIFI hotspot, as long as the NFC barcode is scanned, the WIFI network can be automatically connected, thereby bringing great convenience to the mobile terminal user for networking.

实施例二Embodiment two

请一并参阅图2及图3,所示为本发明实施例二提供的自动连接WIFI热点的方法,具体实现如下:Please refer to Figure 2 and Figure 3 together, which shows the method for automatically connecting to a WIFI hotspot provided by Embodiment 2 of the present invention, and the specific implementation is as follows:

在步骤S201中,事先将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上。In step S201, the MAC address of the WIFI hotspot and the WIFI password are made on the NFC barcode in advance.

在步骤S202中,手机检测当前环境是否有WIFI信号。In step S202, the mobile phone detects whether there is a WIFI signal in the current environment.

其中,调用手机中用于扫描WiFi热点的类,以获取可连接的WiFi热点,具体实现如下:Among them, the class used to scan WiFi hotspots in the mobile phone is called to obtain connectable WiFi hotspots. The specific implementation is as follows:

WifiSettings和WifiEnabler创建的时候就会向Android注册接收WIFI_STATE_CHANGED_ACTION,因此他们都会收到WIFI_STATE_CHANGED_ACTION这个Intent,WifiEnabler负责使得图标加亮,WifiSettings负责使得开启扫描WiFi热点。经由WifiService的startScan,再通过JNI由android_net_wifi_scanCommand函数向wpa_supplicant发送扫描命令.当wpa_supplicant处理完SCAN命令后,它会向控制通道发送事件通知扫描完成,从而wifi_wait_for_event函数会接收到该事件,由此WifiMonitor中的MonitorThread会被执行来处理接扫描结果事件。此线程通过WifiStateTracker广播SCAN_RESULTS_AVAILABLE_ACTION这个Intent。而WifiSettings注册了接收此Intent,最终由其相应函数updateAccessPoints将WiFi热点列表,以GUI(Graphical User Interface,图形用户界面)的形式列出来。When WifiSettings and WifiEnabler are created, they will register with Android to receive WIFI_STATE_CHANGED_ACTION, so they will all receive the Intent of WIFI_STATE_CHANGED_ACTION. WifiEnabler is responsible for making the icon brighter, and WifiSettings is responsible for enabling the scanning of WiFi hotspots. Via the startScan of WifiService, and then send the scan command to wpa_supplicant by the android_net_wifi_scanCommand function through JNI. When wpa_supplicant finishes processing the SCAN command, it will send an event to the control channel to notify the scan completion, so that the wifi_wait_for_event function will receive the event, so the WifiMonitor MonitorThread will be implemented to handle incoming scan result events. This thread broadcasts the SCAN_RESULTS_AVAILABLE_ACTION Intent via WifiStateTracker. WifiSettings registers to receive this Intent, and finally its corresponding function updateAccessPoints lists the list of WiFi hotspots in the form of GUI (Graphical User Interface, Graphical User Interface).

在步骤S203中,如果检测到当前环境有WIFI信号,则生成NFC功能开启指令。In step S203, if it is detected that there is a WIFI signal in the current environment, an NFC function activation instruction is generated.

在步骤S204中,根据所述NFC功能开启指令,开启手机NFC功能。In step S204, the NFC function of the mobile phone is enabled according to the NFC function activation instruction.

在步骤S205中,手机通过语音播报形式提示手机用户扫描NFC条码。In step S205, the mobile phone prompts the mobile phone user to scan the NFC barcode through a voice broadcast.

在步骤S206中,通过手机NFC天线线圈与NFC条码进行通信,以获取WIFI热点的MAC地址以及WIFI密码。In step S206, communicate with the NFC barcode through the NFC antenna coil of the mobile phone to obtain the MAC address of the WIFI hotspot and the WIFI password.

在步骤S207中,手机根据所述WIFI热点的MAC地址以及WIFI密码,配置手机端的WIFI热点对应的参数。In step S207, the mobile phone configures parameters corresponding to the WIFI hotspot on the mobile phone according to the MAC address of the WIFI hotspot and the WIFI password.

在步骤S208中,根据WIFI热点对应的参数,生成WIFI连接指令。In step S208, a WIFI connection instruction is generated according to parameters corresponding to the WIFI hotspot.

配置好WIFI热点对应的参数之后,onClick函数会被调用。After configuring the parameters corresponding to the WIFI hotspot, the onClick function will be called.

在步骤S209中,根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点。In step S209, the WIFI hotspot corresponding to the MAC address is automatically connected according to the WIFI connection instruction.

其中,Settings的connect函数响应连接,更新网络保存配置,更新设置当前选择的优先级最高,并保存。然后通过enableNetwork使得其他网络不可用来进行连接。最后调用WifiManager的reconnect函数连接当前选择的网络。WifiManager的reconnect函数通过AIDL的Binder机制,调用WifiService的reconnect函数。然后会调用WifiStateTracker的reconnectCommand函数,通过JNI(android_net_wifi_Wifi)的android_net_wifi_reconnectCommand函数向WPA_WPASUPPLICANT发送RECONNECT命令。android_net_wifi_Wifi通过doCommand(命令名,响应缓冲,响应缓存大小)调用wifi.c中的wifi_command函数来发送命令。最后通过wpa_ctrl的wpa_ctrl_request函数向控制通道发送连接命令。Among them, the connect function of Settings responds to the connection, updates the network save configuration, and updates the current selection with the highest priority and saves it. Then use enableNetwork to make other networks unavailable for connection. Finally, call the reconnect function of WifiManager to connect to the currently selected network. The reconnect function of WifiManager calls the reconnect function of WifiService through the Binder mechanism of AIDL. Then the reconnectCommand function of WifiStateTracker will be called, and the RECONNECT command will be sent to WPA_WPASUPPLICANT through the android_net_wifi_reconnectCommand function of JNI (android_net_wifi_Wifi). android_net_wifi_Wifi calls the wifi_command function in wifi.c through doCommand (command name, response buffer, response buffer size) to send commands. Finally, the connection command is sent to the control channel through the wpa_ctrl_request function of wpa_ctrl.

在步骤S210中,所述WIFI热点接收到WIFI连接指令后,对所述WIFI密码进行验证,如果验证成功,则将手机与WIFI热点建立连接,以使手机接入WIFI网络。In step S210, after receiving the WIFI connection instruction, the WIFI hotspot verifies the WIFI password, and if the verification is successful, establishes a connection between the mobile phone and the WIFI hotspot, so that the mobile phone can access the WIFI network.

由上可知,本实施例二提供的自动连接WIFI热点的方法,通过将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上,当手机检测到当前环境有WIFI信号时,则触发开启手机NFC功能,然后提示用户扫描该NFC条码。用户只要通过具有NFC功能的移动终端扫描一下该NFC条码,便能自动获取WIFI热点的MAC地址以及WIFI密码,以及能自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。因此,本实施例二不需要移动终端用户手动输入WIFI密码以及手动查找WIFI热点,只要扫描一下NFC条码便能自动连接WIFI网络,从而给移动终端用户联网带来极大的方便。As can be seen from the above, the method for automatically connecting to the WIFI hotspot provided by the second embodiment is to make the MAC address of the WIFI hotspot and the WIFI password on the NFC barcode. When the mobile phone detects that there is a WIFI signal in the current environment, it will trigger the NFC function of the mobile phone. , and then prompt the user to scan that NFC barcode. As long as the user scans the NFC barcode through a mobile terminal with NFC function, the MAC address and the WIFI password of the WIFI hotspot can be obtained automatically, and the WIFI hotspot corresponding to the MAC address can be automatically connected, so that the WIFI hotspot can be compared to the said WIFI hotspot. WIFI password to verify and access the WIFI network. Therefore, the second embodiment does not require the mobile terminal user to manually enter the WIFI password and manually search for the WIFI hotspot, as long as the NFC barcode is scanned, the WIFI network can be automatically connected, thereby bringing great convenience to the mobile terminal user for networking.

实施例三Embodiment three

请一并参阅图4及图5,为本发明实施例三提供的自动连接WIFI热点的装置的模块示意图;为了便于说明,仅示出了与本发明实施例相关的部分。所述自动连接WIFI热点的装置包括:NFC开启模块101、NFC读取模块102、连接指令生成模块103、WIFI连接模块104。所述自动连接WIFI热点的装置可以是内置于移动终端中的软件单元、硬件单元或者是软硬件结合的单元。Please refer to FIG. 4 and FIG. 5 together, which are schematic diagrams of the modules of the device for automatically connecting to WIFI hotspots provided by Embodiment 3 of the present invention; for the convenience of description, only the parts related to the embodiment of the present invention are shown. The device for automatically connecting to a WIFI hotspot includes: an NFC opening module 101 , an NFC reading module 102 , a connection instruction generating module 103 , and a WIFI connecting module 104 . The device for automatically connecting to a WIFI hotspot may be a software unit, a hardware unit or a combination of software and hardware built in the mobile terminal.

NFC开启模块101,用于开启移动终端NFC功能;The NFC opening module 101 is used to open the NFC function of the mobile terminal;

NFC读取模块102,用于扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;The NFC reading module 102 is used to scan the NFC barcode to obtain the MAC address and the WIFI password of the WIFI hotspot; wherein, the NFC barcode includes the MAC address and the WIFI password of the WIFI hotspot;

连接指令生成模块103,用于根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;The connection instruction generating module 103 is used to generate a WIFI connection instruction according to the MAC address and the WIFI password of the WIFI hotspot; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

WIFI连接模块104,用于根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。The WIFI connection module 104 is configured to automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

作为本发明一优选实施例,所述自动连接WIFI热点的装置,还包括:WIFI信号检测模块105、开启指令生成模块106。As a preferred embodiment of the present invention, the device for automatically connecting to a WIFI hotspot further includes: a WIFI signal detection module 105 and an activation command generation module 106 .

所述WIFI信号检测模块105,用于检测当前环境是否有WIFI信号。The WIFI signal detection module 105 is used to detect whether there is a WIFI signal in the current environment.

所述开启指令生成模块106,用于如果检测到当前环境有WIFI信号,则生成NFC功能开启指令。The opening instruction generation module 106 is configured to generate an NFC function opening instruction if it is detected that there is a WIFI signal in the current environment.

所述NFC开启模块101,具体用于根据所述NFC功能开启指令,开启移动终端NFC功能。The NFC enabling module 101 is specifically configured to enable the NFC function of the mobile terminal according to the NFC function enabling instruction.

进一步的,作为本发明另一优选实施例,所述自动连接WIFI热点的装置,还包括:提示模块107。Further, as another preferred embodiment of the present invention, the device for automatically connecting to a WIFI hotspot further includes: a prompt module 107 .

提示模块107,用于在开启移动终端NFC功能之后,提示移动终端用户扫描NFC条码。The prompting module 107 is configured to prompt the user of the mobile terminal to scan the NFC barcode after the NFC function of the mobile terminal is turned on.

在本发明实施例中,所述连接指令生成模块103,具体包括:参数配置模块1031、WIFI连接指令生成模块1032。In the embodiment of the present invention, the connection instruction generation module 103 specifically includes: a parameter configuration module 1031 and a WIFI connection instruction generation module 1032 .

所述参数配置模块1031,用于根据所述WIFI热点的MAC地址以及WIFI密码,配置WIFI热点对应的参数。The parameter configuration module 1031 is configured to configure parameters corresponding to the WIFI hotspot according to the MAC address and the WIFI password of the WIFI hotspot.

所述WIFI连接指令生成模块1032,用于根据WIFI热点对应的参数,生成WIFI连接指令。The WIFI connection instruction generating module 1032 is configured to generate a WIFI connection instruction according to parameters corresponding to WIFI hotspots.

作为本发明另一优选实施例,所述自动连接WIFI热点的装置,还包括:数据传输检测模块108、信号强度获取模块109、信号强度比较模块111、网络切换模块112。As another preferred embodiment of the present invention, the device for automatically connecting to a WIFI hotspot further includes: a data transmission detection module 108 , a signal strength acquisition module 109 , a signal strength comparison module 111 , and a network switching module 112 .

数据传输检测模块108,用于检测移动终端当前是否需要传输数据;A data transmission detection module 108, configured to detect whether the mobile terminal currently needs to transmit data;

信号强度获取模块109,用于如果检测到需要传输数据,则获取所述WIFI热点的信号强度;A signal strength acquisition module 109, configured to acquire the signal strength of the WIFI hotspot if it is detected that data needs to be transmitted;

信号强度比较模块111,用于将所述信号强度与预设阈值进行比较;A signal strength comparison module 111, configured to compare the signal strength with a preset threshold;

网络切换模块112,用于当所述信号强度低于预设阈值时,则将当前WIFI网络切换至数据网络。A network switching module 112, configured to switch the current WIFI network to a data network when the signal strength is lower than a preset threshold.

由上可知,本实施例三提供的自动连接WIFI热点的装置,通过将WIFI热点的MAC地址以及WIFI密码制作在NFC条码上,当移动终端用户需要连接WIFI网络时,只要通过具有NFC功能的移动终端扫描一下该NFC条码,便能自动获取WIFI热点的MAC地址以及WIFI密码,以及能自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。因此,本实施例三不需要移动终端用户手动输入WIFI密码以及手动查找WIFI热点,只要扫描一下NFC条码便能自动连接WIFI网络,从而给移动终端用户联网带来极大的方便。As can be seen from the above, the device for automatically connecting to the WIFI hotspot provided by the third embodiment, by making the MAC address of the WIFI hotspot and the WIFI password on the NFC barcode, when the mobile terminal user needs to connect to the WIFI network, as long as the mobile terminal with the NFC function After the terminal scans the NFC barcode, it can automatically obtain the MAC address and WIFI password of the WIFI hotspot, and can automatically connect to the WIFI hotspot corresponding to the MAC address, so that the WIFI hotspot can verify the WIFI password and access the WIFI The internet. Therefore, in the third embodiment, the mobile terminal user does not need to manually enter the WIFI password and manually search for the WIFI hotspot, as long as the NFC barcode is scanned, the WIFI network can be automatically connected, thereby bringing great convenience to the mobile terminal user for networking.

本发明实施例提供的自动连接WIFI热点的方法及装置属于同一构思,其具体实现过程详见说明书全文,此处不再赘述。The method and device for automatically connecting to WIFI hotspots provided by the embodiments of the present invention belong to the same idea, and its specific implementation process can be found in the full text of the specification, and will not be repeated here.

实施例四Embodiment Four

图6示出了本发明实施例五提供的移动终端的具体结构框图,该移动终端可以用于实施上述实施例中提供的自动连接WIFI热点的方法/装置。该移动终端1200可以为智能手机或平板电脑。FIG. 6 shows a specific structural block diagram of a mobile terminal provided in Embodiment 5 of the present invention. The mobile terminal can be used to implement the method/apparatus for automatically connecting to a WIFI hotspot provided in the foregoing embodiments. The mobile terminal 1200 can be a smart phone or a tablet computer.

如图6所示,移动终端1200可以包括RF(Radio Frequency,射频)电路110、包括有一个或一个以上(图中仅示出一个)计算机可读存储介质的存储器120、输入单元130、显示单元140、传感器150、音频电路160、传输模块170、包括有一个或者一个以上(图中仅示出一个)处理核心的处理器180以及电源190等部件。本领域技术人员可以理解,图6中示出的移动终端1200结构并不构成对移动终端1200的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:As shown in FIG. 6, a mobile terminal 1200 may include an RF (Radio Frequency, radio frequency) circuit 110, a memory 120 including one or more (only one shown in the figure) computer-readable storage media, an input unit 130, and a display unit. 140, a sensor 150, an audio circuit 160, a transmission module 170, a processor 180 including one or more (only one is shown in the figure) processing cores, a power supply 190 and other components. Those skilled in the art can understand that the structure of the mobile terminal 1200 shown in FIG. 6 does not constitute a limitation to the mobile terminal 1200, and may include more or less components than those shown in the illustration, or combine certain components, or different components. layout. in:

RF电路110用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。RF电路110可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。RF电路110可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。上述的无线网络可以使用各种通信标准、协议及技术,包括但并不限于全球移动通信系统(Global System for Mobile Communication,GSM)、增强型移动通信技术(Enhanced DataGSM Environment,EDGE),宽带码分多址技术(Wideband Code Division MultipleAccess,WCDMA),码分多址技术(Code Division Access,CDMA)、时分多址技术(TimeDivision Multiple Access,TDMA),无线保真技术(Wireless Fidelity,Wi-Fi)(如美国电气和电子工程师协会标准IEEE802.11a,IEEE 802.11b,IEEE802.11g和/或IEEE 802.11n)、网络电话(Voice over Internet Protocol,VoIP)、全球微波互联接入(WorldwideInteroperability for Microwave Access,Wi-Max)、其他用于邮件、即时通讯及短消息的协议,以及任何其他合适的通讯协议,甚至可包括那些当前仍未被开发出来的协议。The RF circuit 110 is used to receive and send electromagnetic waves, realize mutual conversion between electromagnetic waves and electrical signals, and communicate with communication networks or other devices. The RF circuit 110 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption/decryption chips, Subscriber Identity Module (SIM) cards, memory, and the like. The RF circuit 110 can communicate with various networks such as the Internet, intranet, wireless network, or communicate with other devices through a wireless network. The wireless network mentioned above may include a cellular telephone network, a wireless local area network or a metropolitan area network. The wireless network mentioned above can use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced DataGSM Environment (EDGE), broadband code division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) ( Such as the Institute of Electrical and Electronics Engineers standards IEEE802.11a, IEEE 802.11b, IEEE802.11g and/or IEEE 802.11n), VoIP (Voice over Internet Protocol, VoIP), Worldwide Interoperability for Microwave Access (Wi -Max), other protocols for mail, instant messaging and short messaging, and any other suitable communication protocol, even those that are not yet developed.

存储器120可用于存储软件程序以及模块,如上述实施例中自动连接WIFI热点的方法/装置对应的程序指令/模块,处理器180通过运行存储在存储器120内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现自动连接WIFI热点的功能。存储器120可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器120可进一步包括相对于处理器180远程设置的存储器,这些远程存储器可以通过网络连接至移动终端1200。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。The memory 120 can be used to store software programs and modules, such as the program instructions/modules corresponding to the method/apparatus for automatically connecting to WIFI hotspots in the above-mentioned embodiments, and the processor 180 executes various functions by running the software programs and modules stored in the memory 120. Function application and data processing, that is, the function of automatically connecting to WIFI hotspots. The memory 120 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 120 may further include a memory that is remotely located relative to the processor 180, and these remote memories may be connected to the mobile terminal 1200 through a network. Examples of the aforementioned networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

输入单元130可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元130可包括触敏表面131以及其他输入设备132。触敏表面131,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面131上或在触敏表面131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面131。除了触敏表面131,输入单元130还可以包括其他输入设备132。具体地,其他输入设备132可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 130 can be used to receive input numbers or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, the input unit 130 may include a touch-sensitive surface 131 and other input devices 132 . The touch-sensitive surface 131, also referred to as a touch screen or a touchpad, can collect touch operations of the user on or near it (for example, the user uses any suitable object or accessory such as a finger or a stylus on the touch-sensitive surface 131 or on the operation near the touch-sensitive surface 131), and drive the corresponding connection device according to the preset program. Optionally, the touch-sensitive surface 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and sends it to the to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch-sensitive surface 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 131 , the input unit 130 may also include other input devices 132 . Specifically, other input devices 132 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.

显示单元140可用于显示由用户输入的信息或提供给用户的信息以及移动终端1200的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元140可包括显示面板141,可选的,可以采用LCD(Liquid CrystalDisplay,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板141。进一步的,触敏表面131可覆盖显示面板141,当触敏表面131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图6中,触敏表面131与显示面板141是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面131与显示面板141集成而实现输入和输出功能。The display unit 140 can be used to display information input by or provided to the user and various graphical user interfaces of the mobile terminal 1200, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of LCD (Liquid Crystal Display, liquid crystal display), OLED (Organic Light-Emitting Diode, organic light-emitting diode), and the like. Further, the touch-sensitive surface 131 may cover the display panel 141, and when the touch-sensitive surface 131 detects a touch operation on or near it, the touch operation is sent to the processor 180 to determine the type of the touch event, and then the processor 180 determines the type of the touch event according to the type of the touch event. The type provides a corresponding visual output on the display panel 141 . Although in FIG. 6, the touch-sensitive surface 131 and the display panel 141 are used as two independent components to realize input and input functions, in some embodiments, the touch-sensitive surface 131 and the display panel 141 can be integrated to realize input. and output functions.

移动终端1200还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在移动终端1200移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于移动终端1200还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The mobile terminal 1200 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 when the mobile terminal 1200 moves to the ear. and/or backlighting. As a kind of motion sensor, the gravitational acceleration sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when it is stationary, and can be used for applications that recognize the attitude of mobile phones (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition-related functions (such as pedometer, tap), etc.; as for other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc. that can be configured on the mobile terminal 1200, here No longer.

音频电路160、扬声器161,传声器162可提供用户与移动终端1200之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一终端,或者将音频数据输出至存储器120以便进一步处理。音频电路160还可能包括耳塞插孔,以提供外设耳机与移动终端1200的通信。The audio circuit 160 , the speaker 161 and the microphone 162 can provide an audio interface between the user and the mobile terminal 1200 . The audio circuit 160 can transmit the electrical signal converted from the received audio data to the loudspeaker 161, and the loudspeaker 161 converts it into an audio signal output; After being received, it is converted into audio data, and then the audio data is processed by the output processor 180, and then sent to another terminal through the RF circuit 110, or the audio data is output to the memory 120 for further processing. The audio circuit 160 may also include an earphone jack to provide communication between an external earphone and the mobile terminal 1200 .

移动终端1200通过传输模块170(例如Wi-Fi模块)可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图6示出了传输模块170,但是可以理解的是,其并不属于移动终端1200的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。The mobile terminal 1200 can help users send and receive e-mails, browse web pages, and access streaming media through the transmission module 170 (eg, Wi-Fi module), which provides users with wireless broadband Internet access. Although FIG. 6 shows the transmission module 170, it can be understood that it is not an essential component of the mobile terminal 1200, and can be completely omitted as required without changing the essence of the invention.

处理器180是移动终端1200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行移动终端1200的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理核心;优选的,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。The processor 180 is the control center of the mobile terminal 1200, and uses various interfaces and lines to connect various parts of the entire mobile phone, by running or executing software programs and/or modules stored in the memory 120, and calling data stored in the memory 120 , execute various functions and process data of the mobile terminal 1200, so as to monitor the mobile phone as a whole. Optionally, the processor 180 may include one or more processing cores; preferably, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user interfaces, and application programs, etc. , the modem processor mainly handles wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 180 .

移动终端1200还包括给各个部件供电的电源190(比如电池),优选的,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源190还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。The mobile terminal 1200 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 180 through the power management system, so that functions such as charging, discharging, and power consumption management can be realized through the power management system. . The power supply 190 may also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

尽管未示出,移动终端1200还可以包括摄像头、蓝牙模块等,在此不再赘述。具体在本实施例中,移动终端的显示单元是触摸屏显示器,移动终端还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行述一个或者一个以上程序包含用于进行以下操作的指令:Although not shown, the mobile terminal 1200 may also include a camera, a Bluetooth module, etc., which will not be repeated here. Specifically in this embodiment, the display unit of the mobile terminal is a touch screen display, and the mobile terminal also includes a memory, and one or more programs, wherein one or more programs are stored in the memory, and are configured to be controlled by one or one The above processor executes the one or more programs including instructions for performing the following operations:

开启移动终端NFC功能;Turn on the NFC function of the mobile terminal;

扫描NFC条码,以获取WIFI热点的MAC地址以及WIFI密码;其中,所述NFC条码包括WIFI热点的MAC地址以及WIFI密码;Scan the NFC barcode to obtain the MAC address of the WIFI hotspot and the WIFI password; wherein, the NFC barcode includes the MAC address of the WIFI hotspot and the WIFI password;

根据所述WIFI热点的MAC地址以及WIFI密码,生成WIFI连接指令;其中,所述WIFI连接指令携带有所述WIFI热点的MAC地址以及WIFI密码;Generate a WIFI connection instruction according to the MAC address and the WIFI password of the WIFI hotspot; wherein, the WIFI connection instruction carries the MAC address and the WIFI password of the WIFI hotspot;

根据所述WIFI连接指令自动连接所述MAC地址对应的WIFI热点,以使所述WIFI热点对所述WIFI密码进行验证并接入WIFI网络。Automatically connect to the WIFI hotspot corresponding to the MAC address according to the WIFI connection instruction, so that the WIFI hotspot verifies the WIFI password and accesses the WIFI network.

本发明实施例提供的移动终端可以应用在前述对应的方法实施例一中,详情参见上述实施例一的描述,在此不再赘述。The mobile terminal provided by the embodiment of the present invention can be applied in the foregoing first corresponding method embodiment. For details, refer to the description of the foregoing first embodiment, which will not be repeated here.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取记忆体(RAM,RandomAccess Memory)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: Read Only Memory (ROM, Read Only Memory), Random Access Memory (RAM, Random Access Memory), disk or CD, etc.

综上所述,虽然本发明已以优选实施例揭露如上,但上述优选实施例并非用以限制本发明,本领域的普通技术人员,在不脱离本发明的精神和范围内,均可作各种更动与润饰,因此本发明的保护范围以权利要求界定的范围为准。In summary, although the present invention has been disclosed above with preferred embodiments, the above preferred embodiments are not intended to limit the present invention, and those of ordinary skill in the art can make various modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the scope defined in the claims.

Claims (11)

1. one kind from being dynamically connected the method for WIFI hot spot, it is characterised in that the described method from the WIFI hot spot that is dynamically connected, including with Lower step:
Open mobile terminal NFC function;
Scanning NFC bar code, to obtain MAC Address and the WIFI password of WIFI hot spot;Wherein, described NFC bar code includes WIFI The MAC Address of focus and WIFI password;
MAC Address according to described WIFI hot spot and WIFI password, generate WIFI link order;Wherein, described WIFI connects Instruction carries MAC Address and the WIFI password of described WIFI hot spot;
Certainly the WIFI hot spot that the described MAC Address that is dynamically connected according to described WIFI link order is corresponding, so that described WIFI hot spot pair Described WIFI password carries out verifying and accessing WIFI network.
2. the method from the WIFI hot spot that is dynamically connected as claimed in claim 1, it is characterised in that at described unlatching mobile terminal Before the step of NFC function, also include:
Whether detection current environment has WIFI signal;
If be detected that current environment has WIFI signal, then generate NFC function open command;
Open the step of mobile terminal NFC function, specifically include:
According to described NFC function open command, open mobile terminal NFC function.
3. the method from the WIFI hot spot that is dynamically connected as claimed in claim 1, it is characterised in that at described unlatching mobile terminal After the step of NFC function, also include:
Prompting mobile terminal scanning input NFC bar code.
4. the method from the WIFI hot spot that is dynamically connected as claimed in claim 1, it is characterised in that according to described WIFI hot spot MAC Address and WIFI password, generate the step of WIFI link order, specifically include:
MAC Address according to described WIFI hot spot and WIFI password, the parameter that configuration WIFI hot spot is corresponding;
According to the parameter that WIFI hot spot is corresponding, generate WIFI link order.
5. the method from the WIFI hot spot that is dynamically connected as claimed in claim 1, it is characterised in that refer to connecting according to described WIFI After making the step of the WIFI hot spot that the described MAC Address that is certainly dynamically connected is corresponding, also include:
Detection mobile terminal is currently the need of transmission data;
If be detected that need to transmit data, then obtain the signal intensity of described WIFI hot spot;
Described signal intensity is compared with predetermined threshold value;
When described signal intensity is less than predetermined threshold value, then current WIFI network is switched to data network.
6. the device from the WIFI hot spot that is dynamically connected, it is characterised in that the described device from the WIFI hot spot that is dynamically connected, including:
NFC opening module, is used for opening mobile terminal NFC function;
NFC read module, is used for scanning NFC bar code, to obtain MAC Address and the WIFI password of WIFI hot spot;Wherein, described NFC bar code includes MAC Address and the WIFI password of WIFI hot spot;
Link order generation module, for the MAC Address according to described WIFI hot spot and WIFI password, generates WIFI connection and refers to Order;Wherein, described WIFI link order carries MAC Address and the WIFI password of described WIFI hot spot;
WIFI link block, for according to described WIFI link order from WIFI hot spot corresponding to described MAC Address that be dynamically connected, with Make described WIFI hot spot that described WIFI password to be verified and to access WIFI network.
7. the device from the WIFI hot spot that is dynamically connected as claimed in claim 6, it is characterised in that described from being dynamically connected WIFI hot spot Device, also include: WIFI signal detection module, open command generation module;
Described WIFI signal detection module, is used for detecting whether current environment has WIFI signal;
Described open command generation module, for if be detected that current environment has WIFI signal, then generates the unlatching of NFC function and refers to Order;
Described NFC opening module, specifically for according to described NFC function open command, opens mobile terminal NFC function.
8. the device from the WIFI hot spot that is dynamically connected as claimed in claim 6, it is characterised in that described from being dynamically connected WIFI hot spot Device, also include:
Reminding module, is used for after opening mobile terminal NFC function, prompting mobile terminal scanning input NFC bar code.
9. the device from the WIFI hot spot that is dynamically connected as claimed in claim 6, it is characterised in that described link order generates mould Block, specifically includes: parameter configuration module, WIFI link order generation module;
Described parameter configuration module, for the MAC Address according to described WIFI hot spot and WIFI password, configures WIFI hot spot pair The parameter answered;
Described WIFI link order generation module, for the parameter corresponding according to WIFI hot spot, generates WIFI link order.
10. the device from the WIFI hot spot that is dynamically connected as claimed in claim 6, it is characterised in that described from the WIFI heat that is dynamically connected The device of point, also includes:
Data transmission detection module, is used for detecting mobile terminal currently the need of transmission data;
Signal intensity acquisition module, for if be detected that need to transmit data, then obtaining the signal intensity of described WIFI hot spot;
Signal intensity compares module, for being compared with predetermined threshold value by described signal intensity;
Network handover module, for when described signal intensity is less than predetermined threshold value, then switching to data by current WIFI network Network.
11. 1 kinds of mobile terminals, it is characterised in that described mobile terminal includes memorizer and processor, described memorizer stores Having the executable instruction of processor, described processor is for performing the instruction in described memorizer, and described instruction is for performing such as Lower operation:
Open mobile terminal NFC function;
Scanning NFC bar code, to obtain MAC Address and the WIFI password of WIFI hot spot;Wherein, described NFC bar code includes WIFI The MAC Address of focus and WIFI password;
MAC Address according to described WIFI hot spot and WIFI password, generate WIFI link order;Wherein, described WIFI connects Instruction carries MAC Address and the WIFI password of described WIFI hot spot;
Certainly the WIFI hot spot that the described MAC Address that is dynamically connected according to described WIFI link order is corresponding, so that described WIFI hot spot pair Described WIFI password carries out verifying and accessing WIFI network.
CN201610820937.2A 2016-09-13 2016-09-13 A method, device and mobile terminal for automatically connecting to WIFI hotspots Pending CN106211051A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610820937.2A CN106211051A (en) 2016-09-13 2016-09-13 A method, device and mobile terminal for automatically connecting to WIFI hotspots

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610820937.2A CN106211051A (en) 2016-09-13 2016-09-13 A method, device and mobile terminal for automatically connecting to WIFI hotspots

Publications (1)

Publication Number Publication Date
CN106211051A true CN106211051A (en) 2016-12-07

Family

ID=58066547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610820937.2A Pending CN106211051A (en) 2016-09-13 2016-09-13 A method, device and mobile terminal for automatically connecting to WIFI hotspots

Country Status (1)

Country Link
CN (1) CN106211051A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686528A (en) * 2016-12-21 2017-05-17 上海斐讯数据通信技术有限公司 Data transmission method and system as well as master device and slave device
CN107493565A (en) * 2017-09-19 2017-12-19 深圳天珑无线科技有限公司 Wi Fi connection methods, mobile terminal and computer-readable recording medium
CN111954164A (en) * 2020-07-24 2020-11-17 深圳创维数字技术有限公司 Device distribution network method, device and computer-readable storage medium
CN113873684A (en) * 2021-09-13 2021-12-31 Oppo广东移动通信有限公司 Local area network-based connection establishment method, device, terminal device and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951652A (en) * 2010-08-13 2011-01-19 北京携远天成技术有限公司 Method for automatically switching WiFi and 3G in video transmission
CN102144421A (en) * 2008-09-15 2011-08-03 索尼爱立信移动通讯有限公司 WLAN connection facilitated via near field communication
CN103200567A (en) * 2012-01-05 2013-07-10 中兴通讯股份有限公司 Method and system of wireless fidelity (WiFi) access
CN103298144A (en) * 2012-03-02 2013-09-11 中兴通讯股份有限公司 Method, system and terminal for Wi-Fi connection through NFC
CN103428823A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Internet-surfing method and device combining 3G network and WLAN
CN103546933A (en) * 2013-10-22 2014-01-29 惠州Tcl移动通信有限公司 Method and system for intelligently switching network connection
CN103874164A (en) * 2014-02-28 2014-06-18 齐文钊 Method and system for connecting to WIFI (Wireless Fidelity) by NFC (Near Field Communication) and mobile terminal equipment
CN104410963A (en) * 2014-11-24 2015-03-11 中国联合网络通信集团有限公司 WiFi (wireless fidelity) connection method, WiFi agency and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102144421A (en) * 2008-09-15 2011-08-03 索尼爱立信移动通讯有限公司 WLAN connection facilitated via near field communication
CN101951652A (en) * 2010-08-13 2011-01-19 北京携远天成技术有限公司 Method for automatically switching WiFi and 3G in video transmission
CN103200567A (en) * 2012-01-05 2013-07-10 中兴通讯股份有限公司 Method and system of wireless fidelity (WiFi) access
CN103298144A (en) * 2012-03-02 2013-09-11 中兴通讯股份有限公司 Method, system and terminal for Wi-Fi connection through NFC
CN103428823A (en) * 2012-05-22 2013-12-04 中兴通讯股份有限公司 Internet-surfing method and device combining 3G network and WLAN
CN103546933A (en) * 2013-10-22 2014-01-29 惠州Tcl移动通信有限公司 Method and system for intelligently switching network connection
CN103874164A (en) * 2014-02-28 2014-06-18 齐文钊 Method and system for connecting to WIFI (Wireless Fidelity) by NFC (Near Field Communication) and mobile terminal equipment
CN104410963A (en) * 2014-11-24 2015-03-11 中国联合网络通信集团有限公司 WiFi (wireless fidelity) connection method, WiFi agency and system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106686528A (en) * 2016-12-21 2017-05-17 上海斐讯数据通信技术有限公司 Data transmission method and system as well as master device and slave device
CN106686528B (en) * 2016-12-21 2021-01-01 杭州新中大科技股份有限公司 Data transmission method and system, master device and slave device
CN107493565A (en) * 2017-09-19 2017-12-19 深圳天珑无线科技有限公司 Wi Fi connection methods, mobile terminal and computer-readable recording medium
CN111954164A (en) * 2020-07-24 2020-11-17 深圳创维数字技术有限公司 Device distribution network method, device and computer-readable storage medium
WO2022016670A1 (en) * 2020-07-24 2022-01-27 深圳创维数字技术有限公司 Network configuration method and apparatus for device, and computer readable storage medium
CN113873684A (en) * 2021-09-13 2021-12-31 Oppo广东移动通信有限公司 Local area network-based connection establishment method, device, terminal device and storage medium

Similar Documents

Publication Publication Date Title
US10069818B2 (en) Method, system, device, and terminal for network initialization of multimedia playback device
US11224027B2 (en) Cell registration method and device
KR101981152B1 (en) Call forwarding methods, terminals and portable electronic devices
CN107278380A (en) Method for connecting bluetooth device and terminal device
WO2019029618A1 (en) Ims voice call network switching method, storage device and mobile terminal
WO2018049886A1 (en) Hotspot establishment method and terminal device
CN106603548A (en) Application registration method and mobile terminal
CN106131930A (en) A WiFi network access control method, device and terminal
CN106506862A (en) A mobile terminal working mode switching method and mobile terminal
CN106714333A (en) Data migration method and terminal
CN106453908A (en) A method, device, and mobile terminal for switching between dual-card networks based on calls
CN105187653B (en) Network connection switchs method for closing and device
CN106936516A (en) Display screen display state control method, storage medium and terminal
CN106708633B (en) Method for speeding up terminal WiFi workstation mode closing speed and mobile terminal
CN106570383A (en) A mobile terminal unlocking method, device and mobile terminal
CN106211051A (en) A method, device and mobile terminal for automatically connecting to WIFI hotspots
CN105357657B (en) Mesh Network Establishment Method and Device
CN105162930B (en) The way of recording and device of mobile terminal
CN106507447A (en) A Wi-Fi hotspot connection method and mobile terminal
CN106714279A (en) A hotspot network switching method and terminal equipment
CN105975316A (en) Process management method, device and equipment
CN105100361B (en) The way of recording and device of mobile terminal
CN106255146B (en) A kind of electricity-saving control method of terminal, device and terminal
CN105282330B (en) The method and device of automatic connection network
CN106604361A (en) WiFi scanning method and mobile terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20161207