[go: up one dir, main page]

CN108040357B - Mobile terminal wireless local area network scanning method and device, computer equipment - Google Patents

Mobile terminal wireless local area network scanning method and device, computer equipment Download PDF

Info

Publication number
CN108040357B
CN108040357B CN201711240802.XA CN201711240802A CN108040357B CN 108040357 B CN108040357 B CN 108040357B CN 201711240802 A CN201711240802 A CN 201711240802A CN 108040357 B CN108040357 B CN 108040357B
Authority
CN
China
Prior art keywords
scanning
mobile terminal
local area
area network
wireless local
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.)
Expired - Fee Related
Application number
CN201711240802.XA
Other languages
Chinese (zh)
Other versions
CN108040357A (en
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 CN201711240802.XA priority Critical patent/CN108040357B/en
Publication of CN108040357A publication Critical patent/CN108040357A/en
Application granted granted Critical
Publication of CN108040357B publication Critical patent/CN108040357B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/18Selecting a network or a communication service
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/12Details of telephonic subscriber devices including a sensor for measuring a physical value, e.g. temperature or motion
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

本申请涉及一种移动终端无线局域网扫描方法和装置、计算机设备。移动终端无线局域网扫描方法,包括:当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;若处于锁屏状态,则采用被动扫描模式扫描无线局域网;若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网。当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;若处于锁屏状态,则将移动终端默认的主动扫描模式切换为被动扫描模式来扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射。

The present application relates to a mobile terminal wireless local area network scanning method and device, and computer equipment. A wireless local area network scanning method for a mobile terminal includes: when the wireless local area network function of the mobile terminal is enabled, judging whether the current mobile terminal is in a locked screen state; if it is in the locked screen state, scanning the wireless local area network in a passive scanning mode; if it is in an unlocked and bright screen state , the wireless local area network is scanned according to the first preset scanning strategy. When the wireless local area network function of the mobile terminal is enabled, it is judged whether the current mobile terminal is in the locked screen state; if it is in the locked screen state, the default active scanning mode of the mobile terminal is switched to the passive scanning mode to scan the wireless local area network. Scanning mode can save power consumption, improve battery life and reduce radiation.

Description

移动终端无线局域网扫描方法和装置、计算机设备Mobile terminal wireless local area network scanning method and device, computer equipment

技术领域technical field

本申请涉及计算机技术,特别是涉及移动终端无线局域网扫描方法和装置、计算机设备、计算机可读存储介质。The present application relates to computer technology, and in particular, to a method and apparatus for scanning a wireless local area network of a mobile terminal, computer equipment, and a computer-readable storage medium.

背景技术Background technique

无线局域网(Wireless Local Network,WLAN)是指以无线信道来替代传统有线传输介质所构成的局域网络。移动终端(工作站STA)采用无线保真(Wireless Fidelity,Wi-Fi)技术与无线接入点(Access Point,AP)建立连接以接入无线局域网。具体的,移动终端内置Wi-Fi模块,为接入无线局域网,移动终端首先需要通过扫描来发现附近是否有可用的无线局域网,扫描方式分为两种:主动扫描和被动扫描。其中,移动终端必须先通过扫描机制得到可用接入点的相关信息。一般不管移动终端处于锁屏还是解锁状态下,都是通过同一种扫描模式来获取可用接入点,该扫描过程中存在功耗大、续航时间短的问题。A wireless local area network (Wireless Local Network, WLAN) refers to a local area network composed of a wireless channel instead of a traditional wired transmission medium. A mobile terminal (station STA) establishes a connection with a wireless access point (Access Point, AP) by using a wireless fidelity (Wireless Fidelity, Wi-Fi) technology to access a wireless local area network. Specifically, the mobile terminal has a built-in Wi-Fi module. In order to access the wireless local area network, the mobile terminal first needs to scan to find out whether there is an available wireless local area network nearby. There are two scanning methods: active scanning and passive scanning. Among them, the mobile terminal must first obtain the relevant information of the available access points through the scanning mechanism. Generally, regardless of whether the mobile terminal is in the screen-locked or unlocked state, the same scanning mode is used to obtain available access points, and the scanning process has problems of high power consumption and short battery life.

发明内容SUMMARY OF THE INVENTION

本申请实施例提供一种移动终端无线局域网扫描方法和装置、计算机设备、计算机可读存储介质,可以根据解锁屏状态选择合适的扫描方式,降低了功耗,提高了续航能力。Embodiments of the present application provide a method and device for scanning a wireless local area network of a mobile terminal, a computer device, and a computer-readable storage medium, which can select an appropriate scanning mode according to the unlocked screen state, reduce power consumption, and improve battery life.

本申请实施例提供一种移动终端无线局域网扫描方法,包括:An embodiment of the present application provides a wireless local area network scanning method for a mobile terminal, including:

当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;When the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state;

若处于锁屏状态,则采用被动扫描模式扫描无线局域网;If the screen is locked, use passive scanning mode to scan the wireless LAN;

若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网。If it is in the unlocked and bright screen state, the wireless local area network is scanned according to the first preset scanning strategy.

本申请实施例提供一种移动终端无线局域网扫描装置,包括:An embodiment of the present application provides a wireless local area network scanning device for a mobile terminal, including:

判断模块,用于当移动终端的无线局域网无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;a judging module for judging whether the current mobile terminal is in a locked screen state when the wireless local area network function of the mobile terminal is turned on;

扫描模块,用于当所述终端处于锁屏状态时,采用被动扫描模式扫描无线局域网;a scanning module, used for scanning the wireless local area network in a passive scanning mode when the terminal is in a locked screen state;

控制模块,用于当所述终端处于解锁亮屏状态时,根据预设扫描策略控制所述扫描模块扫描无线局域网。The control module is configured to control the scanning module to scan the wireless local area network according to a preset scanning strategy when the terminal is in an unlocked and bright screen state.

本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如上述的移动终端无线局域网扫描方法的步骤。An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the above-mentioned method for scanning a wireless local area network of a mobile terminal are implemented.

本申请实施例提供一种计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如上述的移动终端无线局域网扫描方法。An embodiment of the present application provides a computer device, including a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor causes the processor to execute the above-mentioned mobile terminal wireless LAN scanning method.

上述移动终端无线局域网扫描方法和装置、计算机设备、计算机可读存储介质,当移动终端的无线局域网无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;若处于锁屏状态,则将移动终端默认的主动扫描模式切换为被动扫描模式来扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射;若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网,即,可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。The above-mentioned mobile terminal wireless local area network scanning method and device, computer equipment, and computer-readable storage medium, when the wireless local area network wireless local area network function of the mobile terminal is turned on, it is judged whether the current mobile terminal is in a locked screen state; The default active scanning mode of the terminal is switched to passive scanning mode to scan the wireless local area network. Compared with the default active scanning mode, it can save power consumption, improve battery life and reduce radiation; if it is in the unlocked and bright screen state, scan according to the first preset The policy scans the wireless local area network, that is, the corresponding scanning mode can be flexibly and automatically matched to scan the nearby and accessible network access devices to scan the wireless local area network, so as to improve the user experience.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only These are some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.

图1为一个实施例中移动终端无线局域网扫描方法的流程图;1 is a flowchart of a method for scanning a wireless local area network of a mobile terminal in one embodiment;

图2为一个实施例中根据第一预设扫描策略扫描无线局域网的流程图;2 is a flowchart of scanning a wireless local area network according to a first preset scanning strategy in one embodiment;

图3为一个实施例中根据第二预设扫描策略扫描无线局域网的流程图;3 is a flowchart of scanning a wireless local area network according to a second preset scanning strategy in one embodiment;

图4为另一个实施例中根据第二预设扫描策略扫描无线局域网的流程图;4 is a flowchart of scanning a wireless local area network according to a second preset scanning strategy in another embodiment;

图5为另一个实施例中的移动终端无线局域网扫描方法的流程图;5 is a flowchart of a method for scanning a wireless local area network of a mobile terminal in another embodiment;

图6为另一个实施例中的扫描无线局域网的流程图;6 is a flowchart of scanning a wireless local area network in another embodiment;

图7为一个实施例中移动终端无线局域网扫描装置的内部结构框架图;7 is an internal structural frame diagram of a wireless local area network scanning device of a mobile terminal in an embodiment;

图8为与本申请实施例提供的计算机设备相关的手机的部分结构的框图。FIG. 8 is a block diagram of a partial structure of a mobile phone related to a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.

如图1所示,本申请实施例提供一种移动终端无线局域网扫描方法,移动终端无线局域网扫描方法包括:As shown in FIG. 1 , an embodiment of the present application provides a method for scanning a wireless local area network of a mobile terminal, and the method for scanning a wireless local area network for a mobile terminal includes:

步骤102:当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态。Step 102: when the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state.

若移动终端需要访问无线局域网,则需要发现附近的、可接入的网络接入设备,如无线接入点(Access Point,AP),与网络接入设备进行扫描、认证和关联后,才可以访问无线局域网。移动终端与网络接入设备进行扫描、认证和关联的前提是,移动终端需要开启无线局域网。If the mobile terminal needs to access the wireless local area network, it needs to discover a nearby and accessible network access device, such as a wireless access point (Access Point, AP), and scan, authenticate and associate with the network access device before it can Access the wireless LAN. The prerequisite for scanning, authenticating and associating the mobile terminal with the network access device is that the mobile terminal needs to enable the wireless local area network.

当移动终端的无线局域网功能打开时,需要判断当前移动终端是否处于锁屏状态。具体地,在接收到移动终端的灭屏广播时,可通过移动终端操作系统的系统锁屏机制对外提供的屏幕保护管理器来判断当前移动是否存在锁屏,也即,是否处于锁屏状态。其中,锁屏状态包括灭屏锁屏状态和亮屏锁屏状态。When the wireless local area network function of the mobile terminal is turned on, it is necessary to determine whether the current mobile terminal is in a locked screen state. Specifically, when the screen-off broadcast of the mobile terminal is received, the screen saver manager provided externally by the system screen-locking mechanism of the mobile terminal operating system can be used to determine whether the current mobile has a screen-locked state, that is, whether it is in a screen-locked state. The lock screen state includes a screen-off lock-screen state and a screen-on-screen lock state.

例如,以操作系统为安卓Android系统为例,在接收到移动终端的灭屏广播时,可通过操作系统的系统锁屏机制对外提供的屏幕保护管理器来判断是否处于锁屏状态,若处于锁屏状态,则进行下一步流程,即执行步骤S104。若不处于锁屏状态,而是处于解锁亮屏状态,则进行下一步流程,即执行步骤S106。For example, taking the Android system as the operating system as an example, when receiving the screen-off broadcast of the mobile terminal, the screen saver manager provided by the system screen lock mechanism of the operating system can be used to determine whether the screen is in the locked state. If the screen status is displayed, the next process is performed, that is, step S104 is executed. If it is not in the locked screen state but in the unlocked and bright screen state, the next process is performed, that is, step S106 is performed.

步骤104:采用被动扫描模式扫描无线局域网。Step 104: Scan the wireless local area network in a passive scanning mode.

当移动终端处于锁屏状态时,其中,锁屏状态包括亮屏锁屏状态和灭屏锁屏状态,则将移动终端默认的主动扫描模式切换为被动扫描模式,采用被动扫描模式扫描附近的、可接入的网络接入设备,如无线接入点(Access Point,AP)。也即,当移动终端处于锁屏状态时,无论移动终端是否连接了网络接入设备(例如,AP),用户在锁屏状态时对无线局域网的急迫性要求并没有解锁亮屏时那么高,若此时,仍维持默认的主动扫描模式,周期性地发射大功率的射频信号来扫描附近的、可接入的网络接入设备,则会无形中增加移动终端的功耗,缩短整机的待机时长,并不会真正改善了用户体验的附加功耗,反而缩短了待机时长。当将主动扫描模式切换为被动扫描模式后,可能会稍微多花费一点时间才能接入可用的网络接入设备。但是此时,移动终端处于锁屏状态,用户基本无法感知耗时,并不会影响到用户体验,同时还能够节省功耗,提高续航能力,还可以减少辐射。When the mobile terminal is in a screen-locked state, where the screen-locked state includes a screen-on-screen lock state and a screen-off screen lock state, the default active scanning mode of the mobile terminal is switched to a passive scanning mode, and the passive scanning mode is used to scan nearby, An accessible network access device, such as a wireless access point (Access Point, AP). That is, when the mobile terminal is in the locked screen state, regardless of whether the mobile terminal is connected to a network access device (for example, an AP), the user's urgency requirement for the wireless local area network when the screen is locked is not as high as when the screen is unlocked and bright. If at this time, the default active scanning mode is still maintained, and high-power radio frequency signals are periodically transmitted to scan for nearby and accessible network access devices, it will invisibly increase the power consumption of the mobile terminal and shorten the whole machine. The standby time does not really improve the additional power consumption of the user experience, but shortens the standby time. After switching the active scanning mode to the passive scanning mode, it may take a little longer to connect to the available network access devices. However, at this time, the mobile terminal is in the locked screen state, and the user basically cannot perceive the time consumption, which does not affect the user experience. At the same time, it can save power consumption, improve battery life, and reduce radiation.

需要说明的是,对于被动扫描方式,移动终端不会主动发送探测请求帧,就是被动的接收无线接入点定期发送的信标帧(Beacon)来发现网络。信标帧包括有无线接入点AP的服务集标识、支持速率、无线接入点的MAC地址、支持的认证方式,加密算法、信标帧发送间隔,使用的信道等信息。例如,无线接入点发送信标帧的默认周期为100ms,即无线接入点每100ms都会广播发送一次信标帧。STA就是通过在其支持的每个信道上侦听信标帧,来获知周围存在的无线网络。It should be noted that, for the passive scanning mode, the mobile terminal does not actively send a probe request frame, but passively receives a beacon frame (Beacon) periodically sent by the wireless access point to discover the network. The beacon frame includes information such as the service set identifier of the wireless access point AP, the supported rate, the MAC address of the wireless access point, the supported authentication method, the encryption algorithm, the beacon frame sending interval, and the channel used. For example, the default period for the wireless access point to send the beacon frame is 100ms, that is, the wireless access point broadcasts and sends the beacon frame every 100ms. The STA learns the surrounding wireless network by listening to the beacon frame on each channel it supports.

对于主动扫描模式,移动终端会主动在其所支持的信道上依次发送探测信号,用于探测周围存在的无线网络。移动终端发送的探测信号称为探测请求帧(Probe Request),通过接受探查响应帧(Probe Response)来获取网络信号。探测请求帧又可以分为两类,一类是未指定服务集标识(Service Set Identifier,SSID),一类是指定服务集标识。若探测请求帧里面未没指定服务集标识,意味着这个探测请求想要获取到周围所有能够获取到的无线网络信号,所有收到这个广播探测请求帧的无线接入点都会回应移动终端。若探测请求帧中指定了服务集标识,意味着移动终端只想找到特定的服务集标识,不需要除指定服务集标识之外的其它无线网络。无线接入点接收探测请求帧后,只有发现探测请求帧中的服务集标识和自己的服务集标识是相同的情况下,才会回应移动终端。For the active scanning mode, the mobile terminal will actively send detection signals in sequence on the channels supported by it to detect the surrounding wireless networks. The probe signal sent by the mobile terminal is called a probe request frame (Probe Request), and a network signal is obtained by receiving a probe response frame (Probe Response). The probe request frame can be further divided into two categories, one is an unspecified service set identifier (Service Set Identifier, SSID), and the other is a specified service set identifier. If the service set identifier is not specified in the probe request frame, it means that the probe request wants to obtain all available wireless network signals around, and all wireless access points that receive the broadcast probe request frame will respond to the mobile terminal. If the service set ID is specified in the probe request frame, it means that the mobile terminal only wants to find a specific service set ID, and does not need other wireless networks other than the specified service set ID. After the wireless access point receives the probe request frame, it will respond to the mobile terminal only when it finds that the service set ID in the probe request frame is the same as its own service set ID.

步骤106:根据第一预设扫描策略扫描无线局域网。Step 106: Scan the wireless local area network according to the first preset scanning strategy.

当移动终端处于解锁亮屏状态时,则可以根据第一预设扫描策略来扫描无线局域网。其中,第一预设扫描策略可以理解为,可以根据解锁亮屏状态下,不同的应用场景来设定相应的扫描模式(主动扫描或被动扫描)来扫描附近的、可接入的网络接入设备。When the mobile terminal is in the unlocked and bright screen state, the wireless local area network can be scanned according to the first preset scanning strategy. Among them, the first preset scanning strategy can be understood as that the corresponding scanning mode (active scanning or passive scanning) can be set according to different application scenarios when the screen is unlocked and bright to scan for nearby and accessible network access equipment.

例如,可以根据锁屏亮屏状态下移动终端的移动速度、需要连接无线网络的应用程序等应用场景来自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备。For example, the corresponding scanning mode can be automatically matched to scan for nearby and accessible network access devices according to application scenarios such as the moving speed of the mobile terminal when the screen is locked and bright, and applications that need to be connected to the wireless network.

上述移动终端无线局域网扫描方法,当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;若处于锁屏状态,则将移动终端默认的主动扫描模式切换为被动扫描模式扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射;若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网,即,可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。In the above-mentioned mobile terminal wireless local area network scanning method, when the wireless local area network function of the mobile terminal is enabled, it is judged whether the current mobile terminal is in a locked screen state; if it is in a locked screen state, the default active scanning mode of the mobile terminal is switched to passive scanning mode to scan wireless Compared with the default active scanning mode, the local area network can save power consumption, improve battery life, and reduce radiation; if it is in the unlocked and bright screen state, the wireless local area network is scanned according to the first preset scanning strategy, that is, it can flexibly and automatically match the corresponding Scanning mode to scan for nearby and accessible network access devices to scan wireless local area networks to improve user experience.

如图2所示,在一个实施例中,所述根据第一预设扫描策略扫描无线局域网,包括:As shown in FIG. 2, in one embodiment, the scanning of the wireless local area network according to the first preset scanning strategy includes:

步骤202:检测当前移动终端的移动速度。Step 202: Detect the current moving speed of the mobile terminal.

本实施例中,可以通过GPS定位技术、北斗定位技术或基站定位技术检测移动终端的移动速度,还可以通过设置于移动终端内的陀螺仪检测移动终端的移动方向,但本申请实施例不限于此,还可以采用其他方式检测移动终端的移动速度和移动方向。In this embodiment, the moving speed of the mobile terminal can be detected through GPS positioning technology, Beidou positioning technology or base station positioning technology, and the moving direction of the mobile terminal can also be detected through a gyroscope set in the mobile terminal, but the embodiment of the present application is not limited to Therefore, other methods may also be used to detect the moving speed and moving direction of the mobile terminal.

步骤204:当所述移动速度大于等于第一预设速度时,采用被动扫描模式扫描无线局域网。Step 204: When the moving speed is greater than or equal to the first preset speed, use a passive scanning mode to scan the wireless local area network.

其中,第一预设速度可以为自行车的骑行速度,例如,可以为15-20km/h(千米每小时),当然也可以设定为机动车辆的正常行驶速度,例如,可以为30-100km/h。Wherein, the first preset speed may be the riding speed of the bicycle, for example, it may be 15-20km/h (kilometers per hour), and of course, it may be set as the normal driving speed of the motor vehicle, for example, it may be 30-20km/h (kilometers per hour). 100km/h.

当移动终端的移动速度大于第一预设速度时,则认为该移动终端处于快速移动的过程中,也即,移动终端的位置在不断且快速地变化。即使在当前位置有可接入的网络接入设备(如无线接入点),移动终端也很难保持与可用网络接入设备的连接。若此时移动终端仍然采用主动扫描模式,不但会增加移动终端功耗,还会增加对用户的辐射。因此,可以将解锁亮屏状态下快速移动的移动终端的扫描模式设定为被动扫描模式,以便节省功耗,增加待机时长,同时减少辐射。When the moving speed of the mobile terminal is greater than the first preset speed, it is considered that the mobile terminal is in the process of rapid movement, that is, the position of the mobile terminal is constantly and rapidly changing. Even if there is an accessible network access device (such as a wireless access point) at the current location, it is difficult for the mobile terminal to maintain a connection with the available network access device. If the mobile terminal still adopts the active scanning mode at this time, it will not only increase the power consumption of the mobile terminal, but also increase the radiation to the user. Therefore, the scanning mode of the fast moving mobile terminal in the unlocked and bright screen state can be set to the passive scanning mode, so as to save power consumption, increase the standby time, and reduce radiation at the same time.

需要说明的是,第一预设速度的取值大小可以根据用户的需求来设定,在此不做进一步的限定。It should be noted that, the value of the first preset speed may be set according to the needs of the user, which is not further limited here.

步骤206:当所述移动速度小于等于第二预设速度时,根据第二预设扫描策略扫描无线局域网。Step 206: When the moving speed is less than or equal to the second preset speed, scan the wireless local area network according to the second preset scanning strategy.

其中,第二预设速度可以为用户散步的步行速度,例如,可以为3-6km/h(千米每小时)。The second preset speed may be the walking speed at which the user takes a walk, for example, may be 3-6 km/h (kilometers per hour).

当移动终端的移动速度小于等于第二预设速度时,则认为该移动终端处于慢速移动的过程中,移动终端的位置虽然发生变化,但是其变化较慢。当存在可接入的网络接入设备(如无线接入点),移动终端可以保持与可用网络接入设备的连接。此时,移动终端可以采用第二预设扫描策略扫描附近的、可接入的网络接入设备。When the moving speed of the mobile terminal is less than or equal to the second preset speed, it is considered that the mobile terminal is in the process of slow moving, and although the position of the mobile terminal changes, the change is relatively slow. When an accessible network access device (eg, a wireless access point) exists, the mobile terminal can maintain a connection with the available network access device. At this time, the mobile terminal may scan for nearby and accessible network access devices using the second preset scanning strategy.

进一步地,如图3所示,在一个实施例中,根据第二预设扫描策略扫描无线局域网,包括:Further, as shown in FIG. 3, in one embodiment, scanning the wireless local area network according to the second preset scanning strategy includes:

步骤302:检测是否接收到应用程序发送的无线扫描请求,所述无线扫描请求携带所述应用程序的历史属性。Step 302: Detect whether a wireless scanning request sent by an application is received, where the wireless scanning request carries the history attribute of the application.

当移动终端处于解锁亮屏状态,其当前移动终端的移动速度小于等于第二预设速度时,当存在可接入的网络接入设备(如无线接入点),移动终端可以保持与可用网络接入设备的连接。当移动终端的前台或后台的应用程序需要接入无线局域网络时,则需要向移动终端的操作系统发送无线扫描请求,当操作系统应答该无线扫描请求后,才允许该应用程序接入到该无线局域网。When the mobile terminal is in the unlocked and bright-screen state, and the current moving speed of the mobile terminal is less than or equal to the second preset speed, when there is an accessible network access device (such as a wireless access point), the mobile terminal can maintain communication with the available network Access device connection. When the application program in the foreground or background of the mobile terminal needs to access the wireless local area network, it needs to send a wireless scanning request to the operating system of the mobile terminal. After the operating system responds to the wireless scanning request, the application program is allowed to access the wireless local area network. Wireless LAN.

具体地,无线扫描请求中携带有该应用程序的历史属性,其中,应用程序的历史属性包括该应用程序在预设周期内接入到无线局域网的历史时长、历史接入频率等等。其中,预设周期可以为24小时,也即,从凌晨00:00:--深夜24:00:00,以每天为一个周期。Specifically, the wireless scan request carries the historical attribute of the application, wherein the historical attribute of the application includes the historical duration and historical access frequency of the application accessing the wireless local area network within a preset period. The preset period may be 24 hours, that is, from 00:00 in the morning to 24:00:00 in the middle of the night, with each day as a period.

若移动终端接收到应用程序发送的无线扫描请求,则进行下一步流程,即执行步骤S304。If the mobile terminal receives the wireless scanning request sent by the application, the next step is performed, that is, step S304 is executed.

步骤304:根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式。其中,所述扫描模式包括主动扫描和被动扫描。Step 304: Determine the current scan mode of the mobile terminal according to the mapping relationship between the preset history attribute and the scan mode. Wherein, the scanning mode includes active scanning and passive scanning.

当该应用程序在预设周期内接入无线局域网的历史时长大于预设时长时,则在映射关系表中,将该历史属性对应的扫描方式设定为主动扫描模式;反之,在该映射关系表中,将该历史属性对应的扫描方式设定为被动扫描模式。When the historical duration of the application accessing the wireless local area network within the preset period is greater than the preset duration, in the mapping relationship table, the scanning mode corresponding to the historical attribute is set to the active scanning mode; otherwise, in the mapping relationship In the table, the scanning mode corresponding to the historical attribute is set to passive scanning mode.

相应的,当该应用程序在预设周期内接入无线局域网的历史频率大于预设频率时,则在映射关系表中,将该历史属性对应的扫描方式设定为主动扫描模式;反之,在该映射关系表中,将该历史属性对应的扫描方式设定为被动扫描模式。Correspondingly, when the historical frequency of the application accessing the wireless local area network in the preset period is greater than the preset frequency, then in the mapping relationship table, the scanning mode corresponding to the historical attribute is set to the active scanning mode; In the mapping relationship table, the scanning mode corresponding to the historical attribute is set as the passive scanning mode.

表1为历史属性与扫描方式的映射关系对应表Table 1 is the mapping relationship between historical attributes and scanning methods.

历史属性historical properties 扫描方式scanning method 历史时长大于预设时长The historical duration is longer than the preset duration 主动扫描Active scan 历史时长小于预设时长The historical duration is less than the preset duration 被动扫描passive scan 历史频率大于预设频率The historical frequency is greater than the preset frequency 主动扫描Active scan 历史频率小于预设频率The historical frequency is less than the preset frequency 被动扫描passive scan

根据无线扫描请求中携带的历史属性,可以根据如表1所示的历史属性与扫描方式的映射关系获取与历史属性对应的扫描方式(主动扫描或者被动扫描)。According to the historical attribute carried in the wireless scanning request, the scanning mode (active scanning or passive scanning) corresponding to the historical attribute can be obtained according to the mapping relationship between the historical attribute and the scanning mode as shown in Table 1.

步骤306:根据所述确定的扫描模式扫描无线局域网。Step 306: Scan the wireless local area network according to the determined scan mode.

例如,若该应用程序为用户使用频率最高的聊天交互程序,则可以确定与该应用程序历史属性相对应的扫描模式为主动扫描模式,则此时,移动终端切换为主动扫描模式,这样能够快速扫描到可用无线局域网,及时性好、响应快。相应的,若该应用程序的历史属性对应的扫描模式为被动扫描模式的话,则采用被动扫描扫描无线局域网,以便节省功耗,增加待机时长,同时减少辐射。For example, if the application is the most frequently used chat interaction program by the user, it can be determined that the scanning mode corresponding to the historical attribute of the application is the active scanning mode. At this time, the mobile terminal switches to the active scanning mode, which can quickly Scan to the available wireless LAN, with good timeliness and fast response. Correspondingly, if the scanning mode corresponding to the history attribute of the application is the passive scanning mode, passive scanning is used to scan the wireless local area network, so as to save power consumption, increase the standby time, and reduce radiation.

本实施例中,可以实时根据应用程序的历史属性在映射关系中确定与之对应的扫描模式,根据不同的历史属性采用与之匹配的扫描方式来扫描无线网络,若采用主动扫描模式则可以提高扫描效率、时性好、响应快;若采用被动扫描模式则可以节省功耗,增加待机时长,同时减少辐射。In this embodiment, the corresponding scanning mode can be determined in the mapping relationship according to the historical attribute of the application in real time, and the wireless network can be scanned by the matching scanning mode according to different historical attributes. Scanning efficiency, timeliness, and fast response; passive scanning mode can save power consumption, increase standby time, and reduce radiation.

可选的,如图4所示,在一个实施例中,根据第二预设扫描策略扫描无线局域网,包括:Optionally, as shown in FIG. 4 , in one embodiment, scanning the wireless local area network according to the second preset scanning strategy includes:

步骤402:根据所述移动速度动态调整主动扫描模式的扫描频率。Step 402: Dynamically adjust the scanning frequency of the active scanning mode according to the moving speed.

也即,第二预设扫描策略可以理解为主动扫描模式,其采用主动扫描的过程中,可以根据移动终端的移动速度的大小来动态调整主动扫描模式的扫描频率。That is, the second preset scanning strategy can be understood as an active scanning mode, and in the process of adopting the active scanning, the scanning frequency of the active scanning mode can be dynamically adjusted according to the moving speed of the mobile terminal.

例如,当前移动终端的移动速度范围在0-1km/h,可以理解为当前移动终端的移动速度非常缓慢,接近于静止状态,此时,可以加快主动扫描模式的扫描频率,也即缩短发送探测请求帧的时间间隔,可以更快的探测周围存在的无线网络。For example, if the current moving speed of the mobile terminal is in the range of 0-1 km/h, it can be understood that the current moving speed of the mobile terminal is very slow and close to a stationary state. The time interval of the request frame can detect the surrounding wireless network faster.

需要说明的是,当处于解锁亮屏状态下的移动终端在慢速移动过程中,其移动速度越小,其主动扫描模式的扫描频率越高,其移动速度与扫描频率成反比例关系。It should be noted that when the mobile terminal in the unlocked and bright screen state is moving slowly, the smaller the moving speed, the higher the scanning frequency of the active scanning mode, and the moving speed is inversely proportional to the scanning frequency.

在一个实施例中,在步骤402:根据所述移动速度动态调整主动扫描模式的扫描频率后,还可以包括:In one embodiment, after step 402: dynamically adjusting the scanning frequency of the active scanning mode according to the moving speed, it may further include:

步骤404:当采用主动扫描模式接入到所述无线局域网时,将所述主动扫描模式切换为被动扫描模式。Step 404: When using the active scanning mode to access the wireless local area network, switch the active scanning mode to a passive scanning mode.

也即,当移动终端通过主动扫描模式扫描到附近、可接入的无线局域网,且移动终端接入到该无线局域网时,则可以将移动终端当前使用的主动扫描模式切换为被动扫描模式。当移动终端连接了网络接入设备时,则用户对搜索其他网络接入设备的实时性要求也就不高了,此时将主动扫描模式切换为被动扫描模式,可以节省功耗,增加续航时间,同时减少辐射。That is, when the mobile terminal scans a nearby and accessible wireless local area network through the active scanning mode, and the mobile terminal accesses the wireless local area network, the active scanning mode currently used by the mobile terminal can be switched to the passive scanning mode. When the mobile terminal is connected to the network access device, the user's requirement for real-time searching of other network access devices is not high. At this time, switching the active scanning mode to the passive scanning mode can save power consumption and increase battery life. , while reducing radiation.

如图5所示,在一个实施例中,移动终端无线局域网扫描方法包括:As shown in FIG. 5 , in one embodiment, the method for scanning a wireless local area network of a mobile terminal includes:

步骤502:当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;Step 502: when the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state;

步骤504:若处于锁屏状态,判断所述移动终端处于锁屏灭屏状态的时长是否超过预设时间。Step 504: If it is in a screen-locked state, determine whether the duration of the mobile terminal being in the screen-locked and screen-off state exceeds a preset time.

可以理解的是,该预设时间为缓冲时长,可以防止用于因误灭屏或灭屏后又快速亮屏而导致扫描模式的来回切换,这样反而增加了扫描无线局域网的时长。It can be understood that the preset time is the buffering time, which can prevent the scanning mode from being switched back and forth due to accidentally turning off the screen or quickly turning on the screen after turning off the screen, which increases the time for scanning the wireless local area network.

若锁屏灭屏状态的时长超过预设时间,则执行步骤506:则采用被动扫描模式扫描无线局域网。If the duration of the screen-locking and screen-off state exceeds the preset time, step 506 is executed: the wireless local area network is scanned in a passive scanning mode.

在一个实施例中,扫描无线局域网,包括:In one embodiment, scanning the wireless local area network includes:

步骤602:获取当前移动终端的位置信息。Step 602: Obtain location information of the current mobile terminal.

可以通过GPS定位技术、北斗定位技术或基站定位技术检测移动终端的位置信息。在本实施例中,采用基站定位技术获取当前移动终端的位置信息,而不必主动打开GPS定位,以降低使用GPS定位的功耗。The location information of the mobile terminal can be detected through GPS positioning technology, Beidou positioning technology or base station positioning technology. In this embodiment, the location information of the current mobile terminal is obtained by using the base station positioning technology, and it is not necessary to actively turn on the GPS positioning, so as to reduce the power consumption of using the GPS positioning.

步骤604:获取与所述位置信息相匹配的预设热点数据库。Step 604: Acquire a preset hotspot database matching the location information.

其中,所述预设热点数据库中存储有能够覆盖当前位置区域的多个热点。也即,预设热点数据库中存储的热点的覆盖范围包括了当前所述移动终端所在的位置区域。Wherein, the preset hotspot database stores a plurality of hotspots that can cover the current location area. That is, the coverage of the hotspots stored in the preset hotspot database includes the current location area where the mobile terminal is located.

需要说明的是,预设热点数据库中的热点可以为常用热点,也可以是该移动终端进行曾经连接的安全热点。It should be noted that the hotspots in the preset hotspot database may be commonly used hotspots, or may be secure hotspots that the mobile terminal used to connect to.

步骤606:从所述预设热点数据库中选择对应的热点进行扫描。Step 606: Select a corresponding hotspot from the preset hotspot database to scan.

其中,数据库中存储了各个热点与移动终端连接的稳定性信息。预设数据库中的热点数量可以是任意的,例如,可以是1个、2个或多个,当热点数量为一个时,可以直接对该热点进行优先扫描。当热点数量为多个时,可以根据各个热点与移动终端连接的稳定性信息进行扫描,其稳定性越高,其扫描的优先级越高,也即,优先对优先级高的热点进行扫描。The database stores the stability information of the connection between each hotspot and the mobile terminal. The number of hotspots in the preset database may be arbitrary, for example, there may be one, two or more, and when the number of hotspots is one, the hotspot may be directly scanned preferentially. When the number of hotspots is multiple, scanning can be performed according to the stability information of the connection between each hotspot and the mobile terminal.

本实施例中,可以能够使移动终端尽可能优先扫描预设热点数据库中稳定性高的WiFi热点,可以提高扫描的准确度,避免移动终端对所有的WiFi热点进行盲目的扫描连接,减小了额外的功耗,提升了用户的体验度。In this embodiment, the mobile terminal may be able to preferentially scan the WiFi hotspots with high stability in the preset hotspot database as much as possible, which can improve the scanning accuracy, avoid the mobile terminal from blindly scanning and connecting all WiFi hotspots, and reduce the number of WiFi hotspots. The extra power consumption improves the user experience.

如图7所示,本申请实施例还提供一种移动终端无线局域网扫描装置,包括:As shown in FIG. 7 , an embodiment of the present application further provides a wireless local area network scanning device for a mobile terminal, including:

判断模块710,用于当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;The judgment module 710 is used for judging whether the current mobile terminal is in a locked screen state when the wireless local area network function of the mobile terminal is enabled;

扫描模块720,用于当所述终端处于锁屏状态时,采用被动扫描模式扫描无线局域网;A scanning module 720, configured to scan the wireless local area network in a passive scanning mode when the terminal is in a locked screen state;

控制模块730,用于当所述终端处于解锁亮屏状态时,根据预设扫描策略控制所述扫描模块720扫描无线局域网。The control module 730 is configured to control the scanning module 720 to scan the wireless local area network according to a preset scanning strategy when the terminal is in an unlocked and bright screen state.

上述移动终端无线局域网扫描装置,内置在移动终端,当移动终端的无线局域网功能开启时,判断模块710判断当前移动终端是否处于锁屏状态;当所述终端处于锁屏状态时,扫描模块720采用被动扫描模式扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射用于当所述终端处于解锁亮屏状态时,控制模块730根据预设扫描策略控制所述扫描模块720扫描无线局域网,可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。The above-mentioned mobile terminal wireless local area network scanning device is built in the mobile terminal. When the wireless local area network function of the mobile terminal is enabled, the judgment module 710 judges whether the current mobile terminal is in the locked screen state; when the terminal is in the locked screen state, the scanning module 720 adopts The passive scanning mode scans the wireless local area network. Compared with the default active scanning mode, it can save power consumption, improve battery life, and reduce radiation. When the terminal is in an unlocked and bright screen state, the control module 730 controls the The scanning module 720 scans the wireless local area network, and can flexibly and automatically match the corresponding scanning mode to scan the nearby and accessible network access devices to scan the wireless local area network, thereby improving the user experience.

在一个实施例中,移动终端无线局域网扫描装置还包括:In one embodiment, the mobile terminal wireless local area network scanning device further includes:

第一检测模块,用于检测当前移动终端的移动速度;a first detection module, used to detect the current moving speed of the mobile terminal;

扫描模块,还用于当所述移动速度大于等于第一预设速度时,采用被动扫描模式扫描无线局域网;a scanning module, further configured to scan the wireless local area network in a passive scanning mode when the moving speed is greater than or equal to the first preset speed;

扫描模块,还用于当所述移动速度小于等于第二预设速度时,根据第二预设扫描策略扫描无线局域网。The scanning module is further configured to scan the wireless local area network according to the second preset scanning strategy when the moving speed is less than or equal to the second preset speed.

在一个实施例中,移动终端无线局域网扫描装置还包括:In one embodiment, the mobile terminal wireless local area network scanning device further includes:

第二检测模块,用于检测移动终端是否接收到应用程序发送的无线扫描请求,所述无线扫描请求携带所述应用程序的历史属性;a second detection module, configured to detect whether the mobile terminal receives a wireless scanning request sent by an application, where the wireless scanning request carries the historical attribute of the application;

确定模块,用于当接收到应用程序发送的无线扫描请求时,根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式;a determining module, configured to determine the current scanning mode of the mobile terminal according to the mapping relationship between the preset historical attribute and the scanning mode when receiving the wireless scanning request sent by the application;

扫描模块,还用于根据确定的扫描模式对扫描无线局域网,其中,所述扫描模式包括主动扫描和被动扫描。The scanning module is further configured to scan the wireless local area network according to the determined scanning mode, wherein the scanning mode includes active scanning and passive scanning.

本实施例中,可以实时根据应用程序的历史属性在映射关系中确定与之对应的扫描模式,根据不同的历史属性采用与之匹配的扫描方式来扫描无线网络,若采用主动扫描模式则可以提高扫描效率、时性好、响应快;若采用被动扫描模式则可以节省功耗,增加待机时长,同时减少辐射。In this embodiment, the corresponding scanning mode can be determined in the mapping relationship according to the historical attribute of the application in real time, and the wireless network can be scanned by the matching scanning mode according to different historical attributes. Scanning efficiency, timeliness, and fast response; passive scanning mode can save power consumption, increase standby time, and reduce radiation.

在一个实施例中,移动终端无线局域网扫描模块,还用于根据所述移动速度动态调整主动扫描模式的扫描频率。In one embodiment, the wireless local area network scanning module of the mobile terminal is further configured to dynamically adjust the scanning frequency of the active scanning mode according to the moving speed.

在一个实施例中,移动终端无线局域网扫描装置还包括:In one embodiment, the mobile terminal wireless local area network scanning device further includes:

切换模块,用于当采用主动扫描模式接入到所述无线局域网时,将所述主动扫描模式切换为被动扫描模式。The switching module is configured to switch the active scanning mode to a passive scanning mode when accessing to the wireless local area network in an active scanning mode.

当移动终端通过移动终端无线局域网主动扫描模式扫描到附近、可接入的无线局域网,且移动终端接入到该无线局域网时,则可以将移动终端当前使用的主动扫描模式切换为被动扫描模式。当移动终端连接了网络接入设备时,则用户对搜索其他网络接入设备的实时性要求也就不高了,此时将主动扫描模式切换为被动扫描模式,可以节省功耗,增加续航时间,同时减少辐射。When the mobile terminal scans a nearby and accessible wireless local area network through the mobile terminal wireless local area network active scanning mode, and the mobile terminal accesses the wireless local area network, the active scanning mode currently used by the mobile terminal can be switched to the passive scanning mode. When the mobile terminal is connected to the network access device, the user's requirement for real-time searching of other network access devices is not high. At this time, switching the active scanning mode to the passive scanning mode can save power consumption and increase battery life. , while reducing radiation.

在一个实施例中,判断模块,还包括:In one embodiment, the judging module further includes:

判断单元,用于判断所述移动终端处于灭屏状态的时长是否超过预设时间。A judging unit for judging whether the duration of the screen-off state of the mobile terminal exceeds a preset time.

本实施例中,可以防止用于因误灭屏或灭屏后又快速亮屏而导致扫描模式的来回切换,这样反而增加了扫描无线局域网的时长。In this embodiment, it is possible to prevent the scanning mode from switching back and forth due to mistakenly turning off the screen or quickly turning on the screen after turning off the screen, which instead increases the duration of scanning the wireless local area network.

在一个实施例中,扫描模块,包括:In one embodiment, the scanning module includes:

位置获取单元,用于获取当前移动终端的位置信息;a location acquisition unit, used for acquiring the location information of the current mobile terminal;

热点获取单元,用于获取与所述位置信息相匹配的预设热点数据库;所述预设热点数据库中存储有能够覆盖当前位置区域的多个热点;a hotspot acquiring unit, configured to acquire a preset hotspot database matching the location information; the preset hotspot database stores a plurality of hotspots that can cover the current location area;

扫描单元,用于从所述预设热点数据库中选择对应的热点进行扫描。A scanning unit, configured to select a corresponding hotspot from the preset hotspot database for scanning.

本实施例中,扫描模块可以能够使移动终端尽可能优先扫描预设热点数据库中稳定性高的WiFi热点,可以提高扫描的准确度,避免移动终端对所有的WiFi热点进行盲目的扫描连接,减小了额外的功耗,提升了用户的体验度。In this embodiment, the scanning module can enable the mobile terminal to scan the WiFi hotspots with high stability in the preset hotspot database as much as possible, which can improve the scanning accuracy, avoid the mobile terminal from blindly scanning and connecting all the WiFi hotspots, and reduce the The extra power consumption is reduced, and the user experience is improved.

上述移动终端无线局域网扫描装置中各个模块的划分仅用于举例说明,在其他实施例中,可将移动终端无线局域网扫描装置按照需要划分为不同的模块,以完成上述移动终端无线局域网扫描装置的全部或部分功能。The division of each module in the above-mentioned mobile terminal wireless local area network scanning device is only used for illustration. full or partial functionality.

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机可执行指令的非易失性计算机可读存储介质,当所述计算机可执行指令被一个或多个处理器执行时,使得所述处理器执行以下步骤:The embodiment of the present application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the following steps:

当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;When the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state;

若处于锁屏状态,则采用被动扫描模式扫描无线局域网;If the screen is locked, use passive scanning mode to scan the wireless LAN;

若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网。If it is in the unlocked and bright screen state, the wireless local area network is scanned according to the first preset scanning strategy.

上述计算机可读存储介质中计算机程序(指令)在被执行时,当移动终端处于锁屏状态时,能够将移动终端默认的主动扫描模式切换为被动扫描模式来扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射;当移动终端处于解锁亮屏状态时,可以根据第一预设扫描策略扫描无线局域网,即可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。When the computer program (instruction) in the above-mentioned computer-readable storage medium is executed, when the mobile terminal is in the locked screen state, the default active scanning mode of the mobile terminal can be switched to the passive scanning mode to scan the wireless local area network, compared with the default active scanning mode. Scanning mode can save power consumption, improve battery life, and reduce radiation; when the mobile terminal is in the unlocked and bright screen state, it can scan the wireless local area network according to the first preset scanning strategy, that is, it can flexibly automatically match the corresponding scanning method to scan nearby It can scan the wireless local area network and improve the user experience.

本申请实施例还提供了一种计算机设备。如图8所示,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示的,请参照本申请实施例方法部分。该计算机设备可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售移动终端)、车载电脑、穿戴式设备等任意移动终端设备,以计算机设备为手机为例:The embodiments of the present application also provide a computer device. As shown in FIG. 8 , for the convenience of description, only the parts related to the embodiments of the present application are shown, and the specific technical details are not disclosed, please refer to the method part of the embodiments of the present application. The computer equipment can be any mobile terminal equipment including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, Personal Digital Assistant), a POS (Point of Sales, a mobile terminal for sales), a vehicle-mounted computer, a wearable device, etc. The computer equipment is a mobile phone For example:

图8为与本申请实施例提供的计算机设备相关的手机的部分结构的框图。参考图8,手机包括:射频(Radio Frequency,RF)电路810、存储器820、输入单元830、显示单元840、传感器850、音频电路880、无线保真(wireless fidelity,WiFi)模块880、处理器880、以及电源890等部件。本领域技术人员可以理解,图8所示的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 8 is a block diagram of a partial structure of a mobile phone related to a computer device provided by an embodiment of the present application. Referring to FIG. 8 , the mobile phone includes: a radio frequency (RF) circuit 810 , a memory 820 , an input unit 830 , a display unit 840 , a sensor 850 , an audio circuit 880 , a wireless fidelity (WiFi) module 880 , and a processor 880 , and the power supply 890 and other components. Those skilled in the art can understand that the structure of the mobile phone shown in FIG. 8 does not constitute a limitation on the mobile phone, and may include more or less components than shown, or combine some components, or arrange different components.

其中,RF电路810可用于收发信息或通话过程中,信号的接收和发送,可将基站的下行信息接收后,给处理器880处理;也可以将上行的数据发送给基站。通常,RF电路包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路810还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System ofMobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband CodeDivision Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE))、电子邮件、短消息服务(Short Messaging Service,SMS)等。The RF circuit 810 can be used for receiving and sending signals during sending and receiving of information or during a call. After receiving the downlink information of the base station, it can be processed by the processor 880; it can also send the uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, RF circuitry 810 may also communicate with networks and other devices via wireless communications. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access) Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE)), email, Short Messaging Service (Short Messaging Service, SMS) and the like.

存储器820可用于存储软件程序以及模块,处理器880通过运行存储在存储器820的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器820可主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能的应用程序、图像播放功能的应用程序等)等;数据存储区可存储根据手机的使用所创建的数据(比如音频数据、通讯录等)等。此外,存储器820可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 820 can be used to store software programs and modules, and the processor 880 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820 . The memory 820 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playback function, an application program for an image playback function, etc.), etc.; The data storage area may store data (such as audio data, address book, etc.) created according to the usage of the mobile phone, and the like. Additionally, memory 820 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

输入单元830可用于接收输入的数字或字符信息,以及产生与手机800的用户设置以及功能控制有关的键信号输入。具体地,输入单元830可包括触控面板831以及其他输入设备832。触控面板831,也可称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板831上或在触控面板831附近的操作),并根据预先设定的程式驱动相应的连接装置。在一个实施例中,触控面板831可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器880,并能接收处理器880发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板831。除了触控面板831,输入单元830还可以包括其他输入设备832。具体地,其他输入设备832可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)等中的一种或多种。The input unit 830 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the mobile phone 800 . Specifically, the input unit 830 may include a touch panel 831 and other input devices 832 . The touch panel 831 , also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user using a finger, a stylus, etc., any suitable object or accessory on or near the touch panel 831 ) operation), and drive the corresponding connection device according to the preset program. In one embodiment, the touch panel 831 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, 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 then sends it to the touch controller. To the processor 880, and can receive the command sent by the processor 880 and execute it. In addition, the touch panel 831 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. Besides the touch panel 831 , the input unit 830 may further include other input devices 832 . Specifically, other input devices 832 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), and the like.

显示单元840可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元840可包括显示面板841。在一个实施例中,可以采用液晶显示器(LiquidCrystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板841。在一个实施例中,触控面板831可覆盖显示面板841,当触控面板831检测到在其上或附近的触摸操作后,传送给处理器880以确定触摸事件的类型,随后处理器880根据触摸事件的类型在显示面板841上提供相应的视觉输出。虽然在图8中,触控面板831与显示面板841是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板831与显示面板841集成而实现手机的输入和输出功能。The display unit 840 may be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 840 may include a display panel 841 . In one embodiment, the display panel 841 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. In one embodiment, the touch panel 831 may cover the display panel 841, and when the touch panel 831 detects a touch operation on or near it, the touch panel 831 transmits it to the processor 880 to determine the type of the touch event, and then the processor 880 determines the type of the touch event according to the The type of touch event provides a corresponding visual output on display panel 841 . Although in FIG. 8, the touch panel 831 and the display panel 841 are used as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 831 and the display panel 841 can be integrated to form Realize the input and output functions of the mobile phone.

手机800还可包括至少一种传感器850,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板841的亮度,接近传感器可在手机移动到耳边时,关闭显示面板841和/或背光。运动传感器可包括加速度传感器,通过加速度传感器可检测各个方向上加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换)、振动识别相关功能(比如计步器、敲击)等;此外,手机还可配置陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器等。Cell phone 800 may also include at least one sensor 850, such as light sensors, motion sensors, 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 841 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 841 and/or when the mobile phone is moved to the ear. or backlight. Motion sensors can include acceleration sensors, which can detect the magnitude of acceleration in all directions, and can detect the magnitude and direction of gravity when stationary. It can be used for applications that recognize the posture of mobile phones (such as switching between horizontal and vertical screens), and vibration recognition related functions (such as Pedometer, tapping), etc.; in addition, the mobile phone can also be equipped with other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc.

音频电路860、扬声器861和传声器862可提供用户与手机之间的音频接口。音频电路860可将接收到的音频数据转换后的电信号,传输到扬声器861,由扬声器861转换为声音信号输出;另一方面,传声器862将收集的声音信号转换为电信号,由音频电路860接收后转换为音频数据,再将音频数据输出处理器880处理后,经RF电路810可以发送给另一手机,或者将音频数据输出至存储器820以便后续处理。Audio circuit 860, speaker 861 and microphone 862 may provide an audio interface between the user and the cell phone. The audio circuit 860 can transmit the received audio data converted electrical signals to the speaker 861, and the speaker 861 converts them into sound signals for output; on the other hand, the microphone 862 converts the collected sound signals into electrical signals, and the audio circuit 860 converts the collected sound signals into electrical signals. After receiving, it is converted into audio data, and then the audio data is output to the processor 880 for processing, and can be sent to another mobile phone via the RF circuit 810, or the audio data can be output to the memory 820 for subsequent processing.

WiFi属于短距离无线传输技术,手机通过WiFi模块880可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图8示出了WiFi模块880,但是可以理解的是,其并不属于手机800的必须构成,可以根据需要而省略。WiFi is a short-distance wireless transmission technology. The mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 880. It provides users with wireless broadband Internet access. Although FIG. 8 shows the WiFi module 880, it can be understood that it is not a necessary component of the mobile phone 800 and can be omitted as required.

处理器880是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器820内的软件程序和/或模块,以及调用存储在存储器820内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。在一个实施例中,处理器880可包括一个或多个处理单元。在一个实施例中,处理器880可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等;调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器880中。The processor 880 is the control center of the mobile phone, using various interfaces and lines to connect various parts of the entire mobile phone, by running or executing the software programs and/or modules stored in the memory 820, and calling the data stored in the memory 820. Various functions of the mobile phone and processing data, so as to monitor the mobile phone as a whole. In one embodiment, the processor 880 may include one or more processing units. In one embodiment, the processor 880 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface and application programs, etc.; the modem processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 880.

手机800还包括给各个部件供电的电源890(比如电池),优选的,电源可以通过电源管理系统与处理器880逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The mobile phone 800 also includes a power supply 890 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 880 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.

在一个实施例中,手机800还可以包括摄像头、蓝牙模块等。In one embodiment, the mobile phone 800 may further include a camera, a Bluetooth module, and the like.

在本申请实施例中,该移动终端所包括的处理器780执行存储在存储器上的计算机程序时实现以下步骤:In this embodiment of the present application, the processor 780 included in the mobile terminal implements the following steps when executing the computer program stored in the memory:

当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;When the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state;

若处于锁屏状态,则采用被动扫描模式扫描无线局域网;If the screen is locked, use passive scanning mode to scan the wireless LAN;

若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网。If it is in the unlocked and bright screen state, the wireless local area network is scanned according to the first preset scanning strategy.

移动终端所包括的处理器880执行存储在存储器上的计算机程序时,上述计算机可读存储介质中计算机程序(指令)在被执行时,当移动终端处于锁屏状态时,能够将移动终端默认的主动扫描模式切换为被动扫描模式来扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射;当移动终端处于解锁亮屏状态时,可以根据第一预设扫描策略扫描无线局域网,即可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。When the processor 880 included in the mobile terminal executes the computer program stored in the memory, when the computer program (instruction) in the above-mentioned computer-readable storage medium is executed, when the mobile terminal is in a locked screen state, the default value of the mobile terminal can be changed. The active scanning mode is switched to the passive scanning mode to scan the wireless local area network. Compared with the default active scanning mode, it can save power consumption, improve battery life, and reduce radiation; when the mobile terminal is in the unlocked and bright screen state, it can scan according to the first preset. The strategy scans the WLAN, that is, it can flexibly and automatically match the corresponding scanning mode to scan the nearby and accessible network access devices to scan the WLAN, and improve the user experience.

本申请实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如下步骤:Embodiments of the present application also provide a computer program product containing instructions, which, when running on a computer, causes the computer to perform the following steps:

当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;When the wireless local area network function of the mobile terminal is enabled, determine whether the current mobile terminal is in a locked screen state;

若处于锁屏状态,则采用被动扫描模式扫描无线局域网;If the screen is locked, use passive scanning mode to scan the wireless LAN;

若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网。If it is in the unlocked and bright screen state, the wireless local area network is scanned according to the first preset scanning strategy.

包含指令的计算机程序产品,当其在计算机上运行时,上述计算机可读存储介质中计算机程序(指令)在被执行时,当移动终端处于锁屏状态时,能够将移动终端默认的主动扫描模式切换为被动扫描模式来扫描无线局域网,相比默认的主动扫描模式,可节省功耗,提高续航能力,减少辐射;当移动终端处于解锁亮屏状态时,可以根据第一预设扫描策略扫描无线局域网,即可以灵活的自动匹配相应的扫描方式来扫描附近的、可接入的网络接入设备以扫描无线局域网,提高用户的体验度。A computer program product comprising an instruction, when it is run on a computer, when the computer program (instruction) in the above-mentioned computer-readable storage medium is executed, when the mobile terminal is in a locked screen state, the default active scanning mode of the mobile terminal can be changed. Switching to passive scanning mode to scan WLAN, compared with the default active scanning mode, can save power consumption, improve battery life, and reduce radiation; when the mobile terminal is in the unlocked and bright screen state, it can scan wireless LAN according to the first preset scanning strategy Local area network, that is, you can flexibly and automatically match the corresponding scanning mode to scan the nearby, accessible network access devices to scan the wireless local area network, and improve the user experience.

本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but should not be construed as a limitation on the scope of the patent of the present application. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (9)

1.一种移动终端无线局域网扫描方法,其特征在于,包括:1. a mobile terminal wireless local area network scanning method, is characterized in that, comprises: 当移动终端的无线局域网功能开启时,判断当前所述移动终端是否处于锁屏状态;When the wireless local area network function of the mobile terminal is enabled, determine whether the mobile terminal is currently in a locked screen state; 若处于锁屏状态,则采用被动扫描模式扫描无线局域网;If the screen is locked, use passive scanning mode to scan the wireless LAN; 若处于解锁亮屏状态,则根据第一预设扫描策略扫描无线局域网;If it is in the unlocked and bright screen state, scan the wireless local area network according to the first preset scanning strategy; 所述根据第一预设扫描策略扫描无线局域网,包括:The scanning of the wireless local area network according to the first preset scanning strategy includes: 检测当前移动终端的移动速度;Detect the moving speed of the current mobile terminal; 当所述移动速度小于等于第二预设速度时,根据第二预设扫描策略扫描无线局域网;When the moving speed is less than or equal to the second preset speed, scan the wireless local area network according to the second preset scanning strategy; 所述根据第二预设扫描策略扫描无线局域网,包括:The scanning of the wireless local area network according to the second preset scanning strategy includes: 检测移动终端是否接收到应用程序发送的无线扫描请求,所述无线扫描请求携带所述应用程序的历史属性;Detecting whether the mobile terminal receives a wireless scanning request sent by an application, where the wireless scanning request carries the historical attribute of the application; 若是,则根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式,其中,所述扫描模式包括主动扫描和被动扫描;If so, determine the current scan mode of the mobile terminal according to the mapping relationship between the preset historical attribute and the scan mode, wherein the scan mode includes active scan and passive scan; 根据所述确定的所述扫描模式扫描无线局域网;Scan a wireless local area network according to the determined scan mode; 其中,所述根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式包括:Wherein, determining the current scan mode of the mobile terminal according to the mapping relationship between the preset historical attribute and the scan mode includes: 若在预设周期内接入无线局域网的历史时长大于预设时长时,所述扫描模式为主动扫描;否则,所述扫描模式为被动扫描;If the historical duration of accessing the wireless local area network within the preset period is greater than the preset duration, the scanning mode is active scanning; otherwise, the scanning mode is passive scanning; 或者,若在预设周期内接入无线局域网的历史频率大于预设频率时,所述扫描模式为主动扫描;否则,所述扫描模式为被动扫描。Alternatively, if the historical frequency of accessing the wireless local area network within a preset period is greater than the preset frequency, the scanning mode is active scanning; otherwise, the scanning mode is passive scanning. 2.根据权利要求1所述的方法,其特征在于,2. The method according to claim 1, wherein 所述根据第一预设扫描策略扫描无线局域网,还包括:The scanning of the wireless local area network according to the first preset scanning strategy further includes: 检测当前移动终端的移动速度;Detect the moving speed of the current mobile terminal; 当所述移动速度大于等于第一预设速度时,采用被动扫描模式扫描无线局域网。When the moving speed is greater than or equal to the first preset speed, a passive scanning mode is used to scan the wireless local area network. 3.根据权利要求1所述的方法,其特征在于,所述根据第二预设扫描策略扫描无线局域网,包括:3. The method according to claim 1, wherein the scanning of the wireless local area network according to the second preset scanning strategy comprises: 根据所述移动速度动态调整主动扫描模式的扫描频率。The scanning frequency of the active scanning mode is dynamically adjusted according to the moving speed. 4.根据权利要求3所述的方法,其特征在于,所述根据所述移动速度动态调整主动扫描模式的扫描频率后,还包括:4. The method according to claim 3, wherein after dynamically adjusting the scanning frequency of the active scanning mode according to the moving speed, the method further comprises: 当采用主动扫描模式接入到所述无线局域网时,将所述主动扫描模式切换为被动扫描模式。When using the active scanning mode to access the wireless local area network, the active scanning mode is switched to the passive scanning mode. 5.根据权利要求1所述的方法,其特征在于,还包括:5. The method of claim 1, further comprising: 判断所述移动终端处于灭屏状态的时长是否超过预设时间;Determine whether the duration of the screen-off state of the mobile terminal exceeds a preset time; 若是,则采用被动扫描模式扫描无线局域网。If so, scan the wireless LAN in passive scan mode. 6.根据权利要求1所述的方法,其特征在于,所述扫描无线局域网,包括:6. The method according to claim 1, wherein the scanning the wireless local area network comprises: 获取当前移动终端的位置信息;Obtain the location information of the current mobile terminal; 获取与所述位置信息相匹配的预设热点数据库;所述预设热点数据库中存储有能够覆盖当前位置区域的多个热点;Acquire a preset hotspot database matching the location information; the preset hotspot database stores a plurality of hotspots that can cover the current location area; 从所述预设热点数据库中选择对应的热点进行搜索。A corresponding hotspot is selected from the preset hotspot database for searching. 7.一种移动终端无线局域网扫描装置,其特征在于,包括:7. A mobile terminal wireless local area network scanning device, comprising: 判断模块,用于当移动终端的无线局域网功能开启时,判断当前移动终端是否处于锁屏状态;a judgment module for judging whether the current mobile terminal is in a locked screen state when the wireless local area network function of the mobile terminal is turned on; 扫描模块,用于当所述终端处于锁屏状态时,采用被动扫描模式扫描无线局域网;a scanning module, used for scanning the wireless local area network in a passive scanning mode when the terminal is in a locked screen state; 控制模块,用于当所述终端处于解锁亮屏状态时,根据预设扫描策略控制所述扫描模块扫描无线局域网;a control module, configured to control the scanning module to scan the wireless local area network according to a preset scanning strategy when the terminal is in an unlocked and bright screen state; 第一检测模块,用于当所述终端处于解锁亮屏状态时,检测当前移动终端的移动速度;a first detection module, configured to detect the moving speed of the current mobile terminal when the terminal is in an unlocked and bright screen state; 所述扫描模块,还用于当所述移动速度小于等于第二预设速度时,根据第二预设扫描策略扫描无线局域网;The scanning module is further configured to scan the wireless local area network according to a second preset scanning strategy when the moving speed is less than or equal to a second preset speed; 还包括:Also includes: 第二检测模块,用于当所述终端处于解锁亮屏状态时,且当所述移动速度小于等于第二预设速度时,检测移动终端是否接收到应用程序发送的无线扫描请求,所述无线扫描请求携带所述应用程序的历史属性;The second detection module is configured to detect whether the mobile terminal receives a wireless scanning request sent by an application when the terminal is in an unlocked and bright screen state and when the moving speed is less than or equal to a second preset speed, the wireless The scan request carries the historical attributes of the application; 确定模块,用于当接收到应用程序发送的无线扫描请求时,根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式;a determining module, configured to determine the current scanning mode of the mobile terminal according to the mapping relationship between the preset historical attribute and the scanning mode when receiving the wireless scanning request sent by the application; 其中,所述扫描模块,还用于根据所述确定的所述扫描模式扫描无线局域网,其中,所述扫描模式包括主动扫描和被动扫描;Wherein, the scanning module is further configured to scan the wireless local area network according to the determined scanning mode, wherein the scanning mode includes active scanning and passive scanning; 其中,所述根据预设历史属性与扫描模式的映射关系,确定当前所述移动终端的扫描模式包括:Wherein, determining the current scan mode of the mobile terminal according to the mapping relationship between the preset historical attribute and the scan mode includes: 若在预设周期内接入无线局域网的历史时长大于预设时长时,所述扫描模式为主动扫描;否则,所述扫描模式为被动扫描;If the historical duration of accessing the wireless local area network within the preset period is greater than the preset duration, the scanning mode is active scanning; otherwise, the scanning mode is passive scanning; 或者,若在预设周期内接入无线局域网的历史频率大于预设频率时,所述扫描模式为主动扫描;否则,所述扫描模式为被动扫描。Alternatively, if the historical frequency of accessing the wireless local area network within a preset period is greater than the preset frequency, the scanning mode is active scanning; otherwise, the scanning mode is passive scanning. 8.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至6中任一项所述的移动终端无线局域网扫描方法的步骤。8. A computer-readable storage medium on which a computer program is stored, wherein when the computer program is executed by a processor, the method for scanning a wireless local area network of a mobile terminal according to any one of claims 1 to 6 is implemented A step of. 9.一种计算机设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至6中任一项所述的移动终端无线局域网扫描方法。9. A computer device comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor is made to perform any one of claims 1 to 6 The mobile terminal wireless local area network scanning method described in item.
CN201711240802.XA 2017-11-30 2017-11-30 Mobile terminal wireless local area network scanning method and device, computer equipment Expired - Fee Related CN108040357B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711240802.XA CN108040357B (en) 2017-11-30 2017-11-30 Mobile terminal wireless local area network scanning method and device, computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711240802.XA CN108040357B (en) 2017-11-30 2017-11-30 Mobile terminal wireless local area network scanning method and device, computer equipment

Publications (2)

Publication Number Publication Date
CN108040357A CN108040357A (en) 2018-05-15
CN108040357B true CN108040357B (en) 2019-10-18

Family

ID=62094920

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711240802.XA Expired - Fee Related CN108040357B (en) 2017-11-30 2017-11-30 Mobile terminal wireless local area network scanning method and device, computer equipment

Country Status (1)

Country Link
CN (1) CN108040357B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019237356A1 (en) * 2018-06-15 2019-12-19 华为技术有限公司 Method and device for scanning wireless fidelity network
CN108601066B (en) * 2018-06-20 2021-09-21 上海尚往网络科技有限公司 Wireless access point connection and connection efficiency calculation method, device, equipment and medium
CN109088687A (en) * 2018-09-29 2018-12-25 中国科学院上海微系统与信息技术研究所 A kind of spectrum scan mode configuration method
CN109587325B (en) * 2018-11-01 2021-01-15 Oppo(重庆)智能科技有限公司 Application operation control method and device, storage medium and electronic equipment
CN109474979A (en) * 2018-12-29 2019-03-15 联想(北京)有限公司 Information processing method and electronic equipment
WO2020164096A1 (en) * 2019-02-15 2020-08-20 Qualcomm Incorporated Adaptive network search strategy based on user equipment active state
CN109905911B (en) * 2019-03-18 2023-09-19 努比亚技术有限公司 WiFi control method and device, wearable intelligent equipment and storage medium
CN114189798A (en) * 2020-09-15 2022-03-15 青岛海信移动通信技术股份有限公司 Method and equipment for determining scanning interval of Wireless Local Area Network (WLAN) network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101606405A (en) * 2006-10-24 2009-12-16 捷讯研究有限公司 Wlan network information caching
CN106792984A (en) * 2016-11-29 2017-05-31 努比亚技术有限公司 A kind of WIFI hot spot scanning connection control method and terminal
CN107071865A (en) * 2016-12-07 2017-08-18 广东欧珀移动通信有限公司 Method and device for fast wireless fidelity connection

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101836486B (en) * 2007-10-22 2014-04-30 马维尔国际贸易有限公司 Location aware background access point scanning for WLAN
US9973969B2 (en) * 2015-09-25 2018-05-15 Qualcomm Incorporated Dynamic frequency selection channel scan optimizations
CN105407473B (en) * 2015-10-22 2019-07-05 小米科技有限责任公司 WLAN finds method and device
CN106604277B (en) * 2016-12-07 2020-03-10 Oppo广东移动通信有限公司 A wireless network access method and mobile terminal
CN106879055B (en) * 2017-01-19 2020-12-29 北京安云世纪科技有限公司 A wireless network scanning control method and related equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101606405A (en) * 2006-10-24 2009-12-16 捷讯研究有限公司 Wlan network information caching
CN106792984A (en) * 2016-11-29 2017-05-31 努比亚技术有限公司 A kind of WIFI hot spot scanning connection control method and terminal
CN107071865A (en) * 2016-12-07 2017-08-18 广东欧珀移动通信有限公司 Method and device for fast wireless fidelity connection

Also Published As

Publication number Publication date
CN108040357A (en) 2018-05-15

Similar Documents

Publication Publication Date Title
CN108040357B (en) Mobile terminal wireless local area network scanning method and device, computer equipment
US10142845B2 (en) Network connection method and apparatus, and computer storage medium
CN107949040B (en) Wireless local area network scanning method, device, computer equipment and storage medium
CN107820331B (en) Call method, device, computer equipment and readable storage medium
EP3531737B1 (en) Method for setting wifi roaming and terminal device
EP3624404B1 (en) Method and device for establishing wireless communication connection
US10813058B2 (en) Method for processing information and terminal device
CN108471626B (en) A UE capability reporting method, detection method, mobile terminal and server
CN107846723B (en) Wireless local area network scanning method and device, computer equipment and storage medium
WO2017080378A1 (en) Method implementing licensed-assisted access, network equipment, and terminal equipment
CN107820302B (en) Mobile terminal wireless local area network scanning method and device and computer equipment
CN107820303B (en) Mobile terminal wireless local area network scanning method and device and computer equipment
CN107820301B (en) Control method, device, terminal and storage medium of wireless local area network switch
CN106131930A (en) A WiFi network access control method, device and terminal
CN107969025B (en) Mobile terminal wireless local area network scanning method and device and computer equipment
CN108391277A (en) Signal connection method, device, mobile terminal and computer readable storage medium
CN107896385B (en) Mobile terminal wireless local area network scanning method and device and computer equipment
CN108012304B (en) Wireless local area network scanning method and device, computer equipment and storage medium
CN106028316A (en) A network search method and device for international roaming
CN111818593A (en) A kind of network switching method and terminal
CN107896381B (en) Mobile terminal wireless local area network scanning method and device, computer equipment
CN106604277A (en) Wireless network access method and mobile terminal
CN106851690A (en) Wireless network scanning method, device and computer equipment
CN107508931B (en) Wireless network communication method, device, storage medium and computer equipment
CN112740827B (en) Network communication processing method, computer-readable storage medium, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20191018

CF01 Termination of patent right due to non-payment of annual fee