CN108966315B - Wireless network acquisition method and device and electronic equipment - Google Patents

Wireless network acquisition method and device and electronic equipment Download PDF

Info

Publication number
CN108966315B
CN108966315B CN201810580684.5A CN201810580684A CN108966315B CN 108966315 B CN108966315 B CN 108966315B CN 201810580684 A CN201810580684 A CN 201810580684A CN 108966315 B CN108966315 B CN 108966315B
Authority
CN
China
Prior art keywords
wireless network
wireless
list
scanning
network list
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.)
Active
Application number
CN201810580684.5A
Other languages
Chinese (zh)
Other versions
CN108966315A (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201810580684.5A priority Critical patent/CN108966315B/en
Publication of CN108966315A publication Critical patent/CN108966315A/en
Application granted granted Critical
Publication of CN108966315B publication Critical patent/CN108966315B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information

Abstract

The invention discloses a wireless network acquisition method, a wireless network acquisition device and electronic equipment. The method comprises the following steps: receiving an opening operation of a user on a target application page, and detecting whether application functions provided by the target application page comprise wireless network access functions or not; when the application function provided by the target application page comprises a wireless network access function, scanning to obtain an accessible wireless network, and obtaining and storing a corresponding wireless network list in a local cache; and receiving the starting operation of the user on the wireless network access function of the target application page, and reading the wireless network list from the local cache for displaying so that the user can select the target wireless network for access. According to the invention, the speed of acquiring the wireless network by the user can be improved.

Description

Wireless network acquisition method and device and electronic equipment
Technical Field
The present invention relates to the field of network communication technologies, and in particular, to a method and an apparatus for acquiring a wireless network, and an electronic device.
Background
With the development of network communication technology, it has become a common communication mode for people to access internet through a wireless network to obtain corresponding network services.
At present, when a user uses an electronic device (e.g., a mobile phone, a computer, etc.) to surf the internet through a wireless network, or when a used application program needs to provide an application function based on the wireless network (e.g., the application program providing a file transfer function needs to upload and download files), the user usually needs to manually open the wireless network function provided by the electronic device or the application program, trigger the electronic device to scan the wireless network of an accessory, obtain a corresponding returned wireless network list including network identifiers of nearby wireless networks, and select a suitable wireless network from the wireless network list to establish network connection.
However, in specific applications, the processing speed of the wireless network environment around the user or the operating system using the electronic device is limited, and the user usually waits for a long time to obtain the returned wireless network list for network access after starting the wireless network function, which brings a poor internet access experience to the user in an application scenario where the user desires to quickly access the internet or an application program needs to quickly connect to the network.
Disclosure of Invention
It is an object of the present invention to provide a new solution for acquiring a wireless network.
According to a first aspect of the present invention, there is provided a wireless network acquisition method, including:
receiving an opening operation of a user on a target application page, and detecting whether application functions provided by the target application page comprise wireless network access functions or not;
when the application function provided by the target application page comprises a wireless network access function, scanning to obtain an accessible wireless network, and obtaining and storing a corresponding wireless network list in a local cache;
wherein the wireless network list comprises identification information of a plurality of accessible wireless networks;
and receiving the starting operation of the user on the wireless network access function of the target application page, and reading the wireless network list from the local cache for displaying so that the user can select a target wireless network for accessing.
Optionally, the detecting whether the application function provided by the target application page includes a wireless network access function includes:
monitoring and determining the initialization opportunity of a page component corresponding to the target application page;
determining that the application function provided by the target application page includes a wireless network access function when the page component declares a function or method related to the wireless network access function during initialization.
Optionally, the scanning to acquire an accessible wireless network, and the step of acquiring a corresponding wireless network list and storing the wireless network list in a local cache includes:
starting an asynchronous thread to call a corresponding application interface for scanning the wireless network, and executing the step of scanning the accessible wireless network;
monitoring broadcast signals related to wireless network scanning, acquiring the latest wireless network list and storing the latest wireless network list in a local cache.
Optionally, the method comprises:
and according to a preset scanning period, executing the step of scanning to acquire the accessible wireless network, acquiring a corresponding wireless network list and storing the wireless network list.
Optionally, the method further comprises:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache, if the identification information of the wireless networks in the two wireless network lists is not changed, prolonging the duration of the scanning period, and updating to obtain a new scanning period;
and/or the presence of a gas in the gas,
and when the wireless network which can be accessed cannot be obtained in the latest scanning period, prolonging the duration of the scanning period, and updating to obtain a new scanning period.
Optionally, the step of obtaining the wireless network list includes:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache to obtain wireless signal change information of a plurality of wireless networks included in the latest wireless network list;
the wireless signal strength change information at least comprises the strength of a wireless signal, the wireless signal strength change type and the change amplitude of the wireless signal, and the wireless signal strength change type comprises wireless signal enhancement and wireless signal weakening;
selecting wireless networks which have wireless signal intensity variation meeting a selection rule and meet a preset number from a newly acquired wireless network list according to the wireless signal variation information, generating a corresponding wireless network list and storing the wireless network list in a local cache;
the selection rule is that the wireless signal intensity of the wireless network is greater than a preset intensity threshold value and the enhanced amplitude of the wireless signal intensity exceeds a preset amplitude threshold value.
Optionally, the step of obtaining the wireless network list includes:
and performing descending sorting on the wireless networks which are obtained by scanning and can be accessed according to the wireless signal intensity, selecting the wireless networks which are in the front of the sorting and accord with the preset number, generating the corresponding wireless network list and storing the wireless network list in a local cache.
Optionally, the method further comprises:
when the wireless network list cannot be read from the local cache, the step of scanning the accessible wireless networks is executed to obtain the corresponding wireless network list.
According to a second aspect of the present invention, there is provided a wireless network acquisition apparatus, comprising:
the device comprises a detection unit, a processing unit and a display unit, wherein the detection unit is used for receiving the opening operation of a target application page by a user and detecting whether the application function provided by the target application page comprises a wireless network access function or not;
the acquisition unit is used for scanning and acquiring an accessible wireless network, acquiring a corresponding wireless network list and storing the wireless network list in a local cache when the application function provided by the target application page comprises a wireless network access function;
wherein the wireless network list comprises identification information of a plurality of wireless networks available for access;
and the reading unit is used for receiving the starting operation of the wireless network access function of the target application page by the user, reading the wireless network list from the local cache and displaying the wireless network list so as to enable the user to select a target wireless network for access.
According to a third aspect of the present invention, there is provided an electronic apparatus, comprising:
the display device is used for displaying the application page;
a memory for storing executable instructions;
a processor, configured to operate the electronic device to perform the wireless network acquisition method according to any one of the methods provided in the first aspect of the present invention, according to the control of the executable instruction.
According to one embodiment of the disclosure, whether the application function provided by the application page comprises a wireless network access function is detected when the application page is opened by a user, when the application function provided by the application page comprises the wireless network access function is determined, a wireless network which can be accessed is scanned and obtained in advance and a corresponding wireless network list is stored in a local cache, and when the wireless network access function of the application page is started by the user, the wireless network list is directly read and displayed to the user for the user to select the accessed wireless network, so that the user can directly obtain the wireless network list without waiting after the wireless network access function is started, the waiting time of the user is greatly shortened, the speed of obtaining the wireless network by the user is improved, and the wireless network obtaining experience of the user is improved. The method is particularly suitable for application scenes that a user expects to quickly surf the internet or application programs need to quickly connect with the network.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a block diagram showing an example of a hardware configuration of an electronic apparatus 1000 that can be used to implement an embodiment of the present invention.
Fig. 2 shows a flow chart of a wireless network acquisition method of an embodiment of the invention.
Fig. 3 shows a flow chart of the steps of determining whether to include wireless network access functionality according to an embodiment of the invention.
Fig. 4 shows a flowchart of the steps of determining to scan for a list of wireless networks according to an embodiment of the present invention.
Fig. 5 shows a flowchart of the steps of obtaining a list of wireless networks of an embodiment of the present invention.
Fig. 6 shows a block diagram of a wireless network acquisition apparatus 3000 according to an embodiment of the present invention.
Fig. 7 shows a block diagram of an electronic device 4000 of an embodiment of the invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< hardware configuration >
Fig. 1 is a block diagram showing a hardware configuration of an electronic apparatus 1000 that can implement an embodiment of the present invention.
The electronic device 1000 may be a laptop, desktop, cell phone, tablet, etc. As shown in fig. 1, the electronic device 1000 may include a processor 1100, a memory 1200, an interface device 1300, a communication device 1400, a display device 1500, an input device 1600, a speaker 1700, a microphone 1800, and the like. The processor 1100 may be a central processing unit CPU, a microprocessor MCU, or the like. The memory 1200 includes, for example, a ROM (read only memory), a RAM (random access memory), a nonvolatile memory such as a hard disk, and the like. The interface device 1300 includes, for example, a USB interface, a headphone interface, and the like. The communication device 1400 is capable of wired or wireless communication, for example, and may specifically include Wifi communication, bluetooth communication, 2G/3G/4G/5G communication, and the like. The display device 1500 is, for example, a liquid crystal display panel, a touch panel, or the like. The input device 1600 may include, for example, a touch screen, a keyboard, a somatosensory input, and the like. A user can input/output voice information through the speaker 1700 and the microphone 1800.
The electronic device shown in fig. 1 is merely illustrative and is in no way meant to limit the invention, its application, or uses. In an embodiment of the present invention, the memory 1200 of the electronic device 1000 is configured to store instructions for controlling the processor 1100 to operate so as to execute any one of the wireless network acquisition methods provided in the embodiments of the present invention. It will be appreciated by those skilled in the art that although a plurality of means are shown for the electronic device 1000 in fig. 1, the present invention may relate to only some of the means therein, e.g. the electronic device 1000 relates to only the processor 1100 and the storage means 1200. The skilled person can design the instructions according to the disclosed solution. How the instructions control the operation of the processor is well known in the art and will not be described in detail herein.
< example >
The general concept of this embodiment is to provide a new technical scheme for acquiring a wireless network, where when an application function provided by an application page includes a wireless network access function, scanning in advance to acquire an accessible wireless network and storing a corresponding wireless network list in a local cache, and when a user starts the wireless network access function, directly reading the wireless network list and displaying the wireless network list to the user for the user to select an accessed wireless network, so that the user can directly acquire the wireless network list without waiting after starting the wireless network access function, thereby greatly shortening the waiting time of the user, improving the speed of acquiring the wireless network by the user, and improving the wireless network acquisition experience of the user. The method is particularly suitable for application scenes that a user expects to quickly surf the internet or application programs need to quickly connect with the network.
< method >
In the present embodiment, a wireless network acquisition method is provided. The wireless network is a communication network implemented by wireless communication technology. For example, the wireless network may be a wireless local area network, and more specifically, the wireless network may be a Wifi network.
The wireless network acquisition method, as shown in fig. 2, includes: steps S2100-S2300.
Step S2100 receives an opening operation of a target application page by a user, and detects whether an application function provided by the target application page includes a wireless network access function.
A target application page is a page that provides one or more application functions. The application function is a function of calling a function module related to the electronic device displaying the application page to provide an application service, and may include calling an audio or video playing function realized by an audio or video player, calling an image shooting function realized by a camera, or calling a wireless network access function realized by a wireless network communication module.
In this embodiment, the target application page may be a page displayed when an application program provides an application service, or may be a page displayed when an operating system of the electronic device implementing this embodiment provides a system service.
The opening operation of the target application page by the user can be an operation that the user opens the target application page by clicking a jump operation, or an operation that the user reopens the target application page by clicking a refresh operation.
After the target application page is opened, whether the application function provided by the target application page comprises a wireless network access function is detected, the wireless network which can be accessed can be obtained when the target application page comprises the wireless network access function in combination with the subsequent steps, and the corresponding wireless network list is stored in a local cache, so that the wireless network list can be directly read and displayed to a user to select a wireless network to be accessed when the user starts the wireless network access function, and the speed of obtaining the wireless network by the user is improved.
In one example, the step of detecting whether the application function provided by the target application page includes a wireless network access function, as shown in fig. 3, includes: steps S2110-S2120.
Step S2110, monitoring the initialization opportunity of the page component corresponding to the target application page.
In this embodiment, the page component corresponding to the target application page is a component that is implemented based on a development language used for developing the target application page or a supported operating system, and provides an application function of a display page for interacting with a user to provide the page. For example, the target application page is supporting an Android system, and the page component may be an Activity component of Android, which is a component for providing a User interaction UI (User Interface).
When the target application page is operated and opened by the user, the corresponding page component may be initialized, and in this embodiment, the initialization time of the page component may be determined by monitoring.
Step S2120, when the page component declares a function or method related to the wireless network access function in the initialization process, determining that the application function provided by the target application page includes the wireless network access function.
When the initialization opportunity of the page component is monitored and determined, the page component can be determined to declare the function or the method used in the initialization process, and when the page component declares the function or the method related to the wireless network access function in the initialization process, the application function provided by the target application page can be determined to comprise the wireless network access function.
In this example, the page component may be an Activity component of Android, and when the Activity component is initialized, declares methods such as "onCreate", "onAttachedToWindow", and the like, it may be determined that the target application page provides a wireless network access function.
After step S2100, the flow proceeds to:
step S2200 is that, when the application function provided by the target application page includes a wireless network access function, the accessible wireless network is scanned and acquired, and a corresponding wireless network list is acquired and stored in the local cache.
The wireless network list includes identification information of a plurality of wireless networks available for access. The identification information is used to uniquely identify the corresponding wireless network, and may be a network ID or a network name of the wireless network.
The list of wireless networks may also include other information such as the wireless signal strength of each wireless network available for access.
The local cache is a memory allocated to the target application page by the operating system of the electronic device in this embodiment, and is automatically released when the target application page is destroyed, so that the memory is not continuously occupied. The acquired wireless network list is stored in the local cache, so that the wireless network list can be prevented from continuously occupying the memory, and the use efficiency of the memory is improved.
When the target application page comprises a wireless network access function, a wireless network which can be accessed is scanned and obtained, and a corresponding wireless network list is stored in a local cache, so that the wireless network list can be directly read and displayed to a user to select a wireless network to be accessed when the user starts the wireless network access function in combination with the subsequent steps, and the speed of obtaining the wireless network by the user is improved.
In one example, step S2200 may be as shown in FIG. 4, including steps S2210-S2220.
Step S2210, starting an asynchronous thread to call a corresponding application interface for scanning a wireless network, and executing a step of scanning an accessible wireless network.
An asynchronous thread is a child thread that is distinct from the main thread running the target application page.
The wireless network which can be accessed can be asynchronously scanned by starting the asynchronous thread to call the corresponding application interface for scanning the wireless network, so that the phenomenon that the main thread runs because of excessive processing resource consumption in the process of scanning the wireless network is avoided, and page blockage is reduced.
In this example, the application interface for scanning for wireless networks may be provided by the operating system supported by the target application page. For example, the target Application page supports an Android operating system, the wireless network is a Wifi network, and the step of scanning for an accessible wireless network may be performed by calling "WifiManager # startScan" in an API (Application Programming Interface) provided by the Android system.
Step S2220, monitors broadcast signals related to scanning wireless networks, obtains the latest wireless network list, and stores the latest wireless network list in the local cache.
After the accessible wireless network is scanned by calling the corresponding application interface, the corresponding wireless network scanning result can be determined by monitoring the broadcast signal related to the scanned wireless network, and the latest wireless network list is obtained and stored in the local cache.
For example, scanning an accessible wireless network is performed by calling "WifiManager # startScan" in an API provided by the Android system, the Android system broadcasts "wifimanager.scan _ RESULTS _ AVAILABLE _ ACTION" to remind a user of a change in a wireless network list of the wifi network when the change in the wireless network list of the wifi network is found by scanning, and by monitoring the system broadcast, after receiving the system broadcast, the latest wireless network list is obtained by "wifimanager.scan _ RESULTS _ AVAILABLE _ ACTION" and is stored in a local cache.
One example of the implementation of step S2200 has been described above.
In this embodiment, the execution manner of step S2200 may be set according to the scene of the specific application or the application requirement. For example, in some application scenarios, it may be set that step S2200 is performed only once after the user opens the target application page, for the purpose of saving processing resources or power.
In other application scenarios, the user may start the wireless network access function of the target application page at a longer time interval after opening the target application page, and only once execute step S2200, the obtained wireless network list may lose timeliness, and the requirement of the user for quickly accessing the wireless network cannot be met.
Therefore, in one example, step S2200 may be performed according to a preset scanning period.
The scanning period can be set according to a specific application scene or application requirements.
Alternatively, the scanning period may be dynamically adjusted according to the specific wireless network scanning result.
For example, the wireless network list obtained by scanning in the latest scanning period is compared with the wireless network list stored in the local cache, and if the identification information of the wireless networks included in the two wireless network lists is not changed, the duration of the scanning period is prolonged, and a new scanning period is obtained by updating.
The wireless network lists stored in the local cache are obtained by scanning in the last scanning period, the wireless network lists obtained in the previous and next scanning periods are compared, if the identification information of the wireless networks in the two wireless network lists is not changed, the wireless network lists obtained in the previous and next scanning periods are the same, and the wireless network environment where the user is located between the two scanning periods can be estimated to be unchanged (for example, the position where the user is located is unchanged), so that the duration of the scanning period can be prolonged to obtain a new scanning period, the scanning is performed based on the scanning period with longer duration, and the processing resources or the electric quantity can be effectively saved on the basis of ensuring the timeliness of the wireless network lists.
The specific extended duration may be set according to the actual application requirement, and is not limited in this example.
For another example, when the wireless network for access cannot be acquired in the last scanning period, the duration of the scanning period is extended, and a new scanning period is obtained by updating.
Scanning fails to acquire an accessible wireless network, which means that wireless network signals are too weak or no wireless network exists in the environment where the user is located, and if continuous scanning acquisition is performed, processing resources or electric quantity waste may be caused, so that the duration of a scanning period can be prolonged to obtain a new scanning period, scanning is performed based on the longer-duration scanning period, and the processing resources or the electric quantity are effectively saved.
In an example, step S2200 is executed according to a preset scanning period, and the step of specifically acquiring the wireless network list may include, as shown in fig. 5: steps S2201-S2202.
Step S2201, comparing the wireless network list scanned and acquired in the latest scanning period with the wireless network list stored in the local cache, to obtain the wireless signal change information of the plurality of wireless networks included in the latest acquired wireless network list.
The wireless network list stored in the local cache is obtained by scanning in the last scanning period, and the wireless network lists obtained in the previous and next scanning periods are compared to obtain the wireless signal change information of a plurality of wireless networks included in the wireless network list which is obtained newly.
The wireless signal change information is information related to a wireless signal change of the corresponding wireless network. The wireless signal change information includes at least the strength of the wireless signal, the type of change in the strength of the wireless signal, and the magnitude of change in the wireless signal.
The wireless signal strength change types comprise wireless signal enhancement and wireless signal weakening.
It should be understood that, if a wireless network does not exist in the wireless network list scanned and acquired in the last scanning period appears in the latest wireless network list, the type of the change of the wireless signal strength of the corresponding wireless network belongs to wireless signal enhancement, and the change amplitude of the corresponding wireless signal is the wireless signal strength of the wireless network.
Step S2202, according to the wireless signal change information, selects a wireless network meeting a preset number of wireless signal strength changes meeting a selection rule from the newly acquired wireless network list, generates a corresponding wireless network list, and stores the wireless network list in a local cache.
The selection rule is that the wireless signal intensity of the corresponding wireless network is greater than a preset intensity threshold value and the enhanced amplitude of the wireless signal intensity exceeds a preset amplitude threshold value.
In this example, the preset number, the intensity threshold, and the amplitude threshold may be set according to a specific application scenario or an application requirement.
In this example, a wireless network with a wireless signal slightly greater than a preset intensity threshold and a wireless signal intensity enhancing amplitude greater than the preset amplitude threshold is selected, and a wireless network with a weakened wireless signal intensity between two scanning periods can be eliminated, so that only a wireless network with a stronger wireless signal intensity and a stronger wireless signal intensity with a reinforcing trend is reserved in a wireless network list, and after a user starts a wireless network function, the wireless network with the stronger wireless signal intensity and better network quality can be preferentially provided for the user, thereby improving the wireless network access efficiency, avoiding the wireless network list from including more redundant wireless networks, occupying local cache, and reducing the cache utilization efficiency.
In this embodiment, the step of acquiring the wireless network list may further include:
and performing descending sorting on the wireless networks which are obtained by scanning and can be accessed according to the wireless signal intensity, selecting the wireless networks which are in the front of the sorting and accord with the preset number, generating a corresponding wireless network list and storing the wireless network list in a local cache.
The preset number can be set according to a specific application scene or application requirements. The wireless networks which accord with the preset number and are in the wireless signal strength sequence before are selected to generate the corresponding wireless network list, so that the wireless networks with strong wireless signal strength and good network quality can be preferentially provided for the user after the user starts the wireless network function, the wireless network access efficiency is improved, the phenomenon that the wireless network list comprises more redundant wireless networks, the local cache is occupied can be avoided, and the cache utilization efficiency is reduced.
After step S2200, the process proceeds to:
step S2300, receiving an enabling operation of the user on the wireless network access function of the target application page, and reading the wireless network list from the local cache to display the wireless network list, so that the user can select a target wireless network to access the target wireless network.
The operation of enabling the wireless network access function is an operation that a user triggers the wireless network access function of the target application page to be enabled through preset clicking, sliding and other operations, for example, an operation of sliding a button of the wireless network access function in the target application page to a specified page position.
When the user starts the wireless network access function, the wireless network list is directly read from the local cache and displayed to the user so that the user can select a wireless network to be accessed, the user does not need to wait for scanning to obtain the wireless network list, the wireless network amount can be directly selected and counted, and the speed of obtaining the wireless network by the user is improved.
In practical application, if a user is in an environment where the wireless signal strength of a wireless network is weak or no wireless network exists after opening a target application page, the corresponding wireless network list cannot be acquired, so that the user cannot directly read the corresponding wireless network list from a local cache when starting a wireless network access function. For such an application scenario, the method provided in this embodiment further includes:
when the wireless network list cannot be read from the local cache, the step of scanning the accessible wireless networks is executed to acquire the corresponding wireless network list.
And when the corresponding wireless network list cannot be directly read from the local cache, the step of scanning the accessible wireless network is executed again to obtain the corresponding wireless network list, so that the user can still obtain the wireless network list to select the wireless network access, and the user experience is ensured.
< Wireless network acquisition apparatus >
In this embodiment, a wireless network acquiring apparatus 3000 is further provided, as shown in fig. 6, including: the detecting unit 3100, the obtaining unit 3200, and the reading unit 3300 are configured to execute any one of the wireless network obtaining methods provided in this embodiment, and details thereof are not repeated herein.
A detecting unit 3100, configured to receive an opening operation of a target application page by a user, and detect whether an application function provided by the target application page includes a wireless network access function.
Optionally, the detection unit 3100 is configured to:
monitoring and determining the initialization opportunity of a page component corresponding to the target application page;
determining that the application function provided by the target application page includes a wireless network access function when the page component declares a function or method related to the wireless network access function during initialization.
An obtaining unit 3200, configured to, when the application function provided by the target application page includes a wireless network access function, scan and obtain an accessible wireless network, obtain a corresponding wireless network list, and store the wireless network list in a local cache;
wherein the wireless network list comprises identification information of a plurality of wireless networks available for access.
Optionally, the obtaining unit 3200 is configured to:
starting an asynchronous thread to call a corresponding application interface for scanning the wireless network, and executing the step of scanning the accessible wireless network;
monitoring broadcast signals related to wireless network scanning, acquiring the latest wireless network list and storing the latest wireless network list in a local cache.
Optionally, the obtaining unit 3200 is configured to:
and according to a preset scanning period, executing the step of scanning to acquire the accessible wireless network, acquiring a corresponding wireless network list and storing the wireless network list.
Optionally, the obtaining unit 3200 is configured to:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache, if the identification information of the wireless networks in the two wireless network lists is not changed, prolonging the duration of the scanning period, and updating to obtain a new scanning period;
and/or the presence of a gas in the gas,
and when the wireless network which can be accessed cannot be obtained in the latest scanning period, prolonging the duration of the scanning period, and updating to obtain a new scanning period.
Optionally, the obtaining unit 3200 is configured to:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache to obtain wireless signal change information of a plurality of wireless networks included in the latest wireless network list;
the wireless signal strength change information at least comprises the strength of a wireless signal, the wireless signal strength change type and the change amplitude of the wireless signal, and the wireless signal strength change type comprises wireless signal enhancement and wireless signal weakening;
selecting wireless networks which have wireless signal intensity variation meeting a selection rule and meet a preset number from a newly acquired wireless network list according to the wireless signal variation information, generating a corresponding wireless network list and storing the wireless network list in a local cache;
the selection rule is that the wireless signal intensity of the wireless network is greater than a preset intensity threshold value and the enhanced amplitude of the wireless signal intensity exceeds a preset amplitude threshold value.
Optionally, the obtaining unit 3200 is configured to:
and performing descending sorting on the wireless networks which are obtained by scanning and can be accessed according to the wireless signal intensity, selecting the wireless networks which are in the front of the sorting and accord with the preset number, generating the corresponding wireless network list and storing the wireless network list in a local cache.
The reading unit 3300 is configured to receive an enabling operation of the wireless network access function of the target application page by the user, and read the wireless network list from the local cache for displaying, so that the user selects a target wireless network to access.
In one example, the wireless network acquiring apparatus 3000 is further configured to:
when the wireless network list cannot be read from the local cache, the step of scanning the accessible wireless networks is executed to obtain the corresponding wireless network list.
It will be appreciated by those skilled in the art that the wireless network acquisition device 3000 can be implemented in various ways. For example, the wireless network acquisition apparatus 3000 may be implemented by an instruction configuration processor. For example, the wireless network acquisition apparatus 3000 may be implemented by storing instructions in ROM and reading the instructions from ROM into a programmable device when the device is started. For example, the wireless network acquisition device 3000 may be solidified into a dedicated device (e.g., ASIC). The wireless network acquisition apparatus 3000 may be divided into units independent of each other, or may be implemented by combining them together. The wireless network acquisition apparatus 3000 may be implemented by one of the various implementations described above, or may be implemented by a combination of two or more of the various implementations described above.
In this embodiment, the wireless network acquisition apparatus 3000 may be a software module included in an application program that provides an application page, or may provide a plug-in or an insert that can be embedded in the application program, or may be a functional module included in an operating system that provides a system service, or the like.
< electronic apparatus >
In this embodiment, an electronic apparatus 4000 is further provided, as shown in fig. 7, including:
a display device 4100 for displaying application pages;
a memory 4200 for storing executable instructions;
the processor 4300 is configured to operate the electronic device to perform the wireless network acquisition method according to any one of the methods provided in this embodiment, according to the control of the executable instructions.
In this embodiment, the electronic device 4000 may be a device having a display device, a memory, and a processor, such as a mobile phone, a handheld computer, a tablet computer, a desktop computer, and a notebook computer.
The electronic device 4000 may further comprise modules in addition to the display means, the memory, the processor, e.g. the electronic device 1000 as shown in fig. 1, further comprising input means, etc.
Having described the embodiments of the present invention in conjunction with the accompanying drawings, according to the embodiments, there are provided a wireless network access method, apparatus and electronic device, by detecting whether the application functions provided by the application page include wireless network access functions when the user opens the application page, when the application function provided by the application page is determined to comprise a wireless network access function, scanning in advance to acquire wireless networks for access and storing a corresponding wireless network list in a local cache, when the user starts the wireless network access function of the application page, the wireless network list is directly read and displayed to the user for the user to select the wireless network to be accessed, after the wireless network access function is started, a user can directly acquire the wireless network list without waiting, so that the waiting time of the user is greatly shortened, the speed of acquiring the wireless network by the user is improved, and the wireless network acquisition experience of the user is improved. The method is particularly suitable for application scenes that a user expects to quickly surf the internet or application programs need to quickly connect with the network.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A wireless network acquisition method comprises the following steps:
receiving an opening operation of a user on a target application page, and detecting whether an application function provided by the target application page comprises a wireless network access function, wherein the target application page is a page displayed when an application service is provided in a certain application program, or a page displayed when an operating system of electronic equipment provides a system service;
when the application function provided by the target application page comprises a wireless network access function, scanning to obtain an accessible wireless network, and obtaining and storing a corresponding wireless network list in a local cache;
wherein the wireless network list comprises identification information of a plurality of accessible wireless networks;
and receiving the starting operation of the user on the wireless network access function of the target application page, and reading the wireless network list from the local cache for displaying so that the user can select a target wireless network for accessing.
2. The method of claim 1, wherein the detecting whether the application functionality provided by the target application page includes wireless network access functionality comprises:
monitoring and determining the initialization opportunity of a page component corresponding to the target application page;
determining that the application function provided by the target application page includes a wireless network access function when the page component declares a function or method related to the wireless network access function during initialization.
3. The method of claim 1, wherein the scanning for accessible wireless networks, the obtaining a corresponding list of wireless networks and saving in a local cache comprises:
starting an asynchronous thread to call a corresponding application interface for scanning the wireless network, and executing the step of scanning the accessible wireless network;
monitoring broadcast signals related to wireless network scanning, acquiring the latest wireless network list and storing the latest wireless network list in a local cache.
4. The method of claim 1, comprising:
and according to a preset scanning period, executing the step of scanning to acquire the accessible wireless network, acquiring a corresponding wireless network list and storing the wireless network list.
5. The method of claim 4, further comprising:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache, if the identification information of the wireless networks in the two wireless network lists is not changed, prolonging the duration of the scanning period, and updating to obtain a new scanning period;
and/or the presence of a gas in the gas,
and when the wireless network which can be accessed cannot be obtained in the latest scanning period, prolonging the duration of the scanning period, and updating to obtain a new scanning period.
6. The method of claim 4, wherein the step of obtaining a list of wireless networks comprises:
comparing the wireless network list obtained by scanning in the latest scanning period with the wireless network list stored in a local cache to obtain wireless signal change information of a plurality of wireless networks included in the latest wireless network list;
the wireless signal strength change information at least comprises the strength of a wireless signal, the wireless signal strength change type and the change amplitude of the wireless signal, and the wireless signal strength change type comprises wireless signal enhancement and wireless signal weakening;
selecting wireless networks which have wireless signal intensity variation meeting a selection rule and meet a preset number from a newly acquired wireless network list according to the wireless signal variation information, generating a corresponding wireless network list and storing the wireless network list in a local cache;
the selection rule is that the wireless signal intensity of the wireless network is greater than a preset intensity threshold value and the enhanced amplitude of the wireless signal intensity exceeds a preset amplitude threshold value.
7. The method of claim 1, wherein the step of obtaining a list of wireless networks comprises:
and performing descending sorting on the wireless networks which are obtained by scanning and can be accessed according to the wireless signal intensity, selecting the wireless networks which are in the front of the sorting and accord with the preset number, generating the corresponding wireless network list and storing the wireless network list in a local cache.
8. The method of claim 1, further comprising:
when the wireless network list cannot be read from the local cache, the step of scanning the accessible wireless networks is executed to obtain the corresponding wireless network list.
9. A wireless network acquisition apparatus, comprising:
the device comprises a detection unit, a processing unit and a processing unit, wherein the detection unit is used for receiving the opening operation of a target application page by a user and detecting whether the application function provided by the target application page comprises a wireless network access function, wherein the target application page is a page displayed when an application service is provided in a certain application program or a page displayed when an operating system of the electronic equipment provides a system service;
the acquisition unit is used for scanning and acquiring an accessible wireless network, acquiring a corresponding wireless network list and storing the wireless network list in a local cache when the application function provided by the target application page comprises a wireless network access function;
wherein the wireless network list comprises identification information of a plurality of wireless networks available for access;
and the reading unit is used for receiving the starting operation of the wireless network access function of the target application page by the user, reading the wireless network list from the local cache and displaying the wireless network list so as to enable the user to select a target wireless network for access.
10. An electronic device, comprising:
the display device is used for displaying the application page;
a memory for storing executable instructions;
a processor, configured to operate the electronic device to perform the wireless network acquisition method according to any one of claims 1 to 8, according to the control of the executable instructions.
CN201810580684.5A 2018-06-07 2018-06-07 Wireless network acquisition method and device and electronic equipment Active CN108966315B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810580684.5A CN108966315B (en) 2018-06-07 2018-06-07 Wireless network acquisition method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810580684.5A CN108966315B (en) 2018-06-07 2018-06-07 Wireless network acquisition method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108966315A CN108966315A (en) 2018-12-07
CN108966315B true CN108966315B (en) 2021-05-07

Family

ID=64494042

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810580684.5A Active CN108966315B (en) 2018-06-07 2018-06-07 Wireless network acquisition method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108966315B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109547996B (en) * 2019-01-11 2022-04-12 歌尔科技有限公司 Intelligent terminal, wireless pairing method thereof and wireless network pairing system
CN111083768B (en) * 2019-11-19 2022-05-31 Oppo(重庆)智能科技有限公司 Network connection control method, device, storage medium and electronic equipment
WO2023050400A1 (en) * 2021-09-30 2023-04-06 西门子股份公司 Mobile edge device, connection manager, system, method, apparatus, and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533670A (en) * 2013-10-15 2014-01-22 深圳市江波龙电子有限公司 Method and device for connecting wireless network equipment, and wireless network system
CN105472703A (en) * 2014-09-11 2016-04-06 中兴通讯股份有限公司 Wireless network access method and device
CN105744598A (en) * 2015-05-27 2016-07-06 维沃移动通信有限公司 Wireless local area network connection method and device
CN106658568A (en) * 2016-12-13 2017-05-10 上海掌门科技有限公司 Method and device for providing information of available wireless access point

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9167551B2 (en) * 2012-07-31 2015-10-20 Qualcomm Incorporated Mobile access point detection
EP2959701A4 (en) * 2013-02-22 2016-09-28 Intel Corp Location based advertisement system using wi-fi
CN103687075B (en) * 2013-12-11 2017-06-27 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN106488534B (en) * 2015-08-27 2019-12-20 腾讯科技(深圳)有限公司 Method and system for acquiring network access point
CN105744523A (en) * 2016-02-29 2016-07-06 宇龙计算机通信科技(深圳)有限公司 WIFI connection method and mobile terminal
CN107105329A (en) * 2017-06-20 2017-08-29 青岛海信电器股份有限公司 A kind of intelligent television WI FI connection methods, device and intelligent television
CN107295607A (en) * 2017-07-05 2017-10-24 上海连尚网络科技有限公司 Method and apparatus for connecting WAP
CN107172685B (en) * 2017-07-26 2019-12-27 上海连尚网络科技有限公司 Method and equipment for displaying information of wireless access point on mobile terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103533670A (en) * 2013-10-15 2014-01-22 深圳市江波龙电子有限公司 Method and device for connecting wireless network equipment, and wireless network system
CN105472703A (en) * 2014-09-11 2016-04-06 中兴通讯股份有限公司 Wireless network access method and device
CN105744598A (en) * 2015-05-27 2016-07-06 维沃移动通信有限公司 Wireless local area network connection method and device
CN106658568A (en) * 2016-12-13 2017-05-10 上海掌门科技有限公司 Method and device for providing information of available wireless access point

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于PhoneGap的Android平台引擎设计与实现;唐俊俊;《中国硕士论文全文数据库》;20150715;全文 *
针对3G上网用户的无线网络加速系统;王跃辉;《通信技术》;20111110;全文 *

Also Published As

Publication number Publication date
CN108966315A (en) 2018-12-07

Similar Documents

Publication Publication Date Title
EP3754490B1 (en) User interface rendering method and apparatus, and terminal
EP2945058B1 (en) Processing method and device for application program
JP2022529159A (en) How to add comments and electronic devices
CN107357483B (en) Data sharing method and device, computer equipment and computer readable storage medium
CN108966315B (en) Wireless network acquisition method and device and electronic equipment
CN107203425B (en) Switching method and device of light application and electronic device
RU2619089C2 (en) Method and device for multiple videos reproduction
CN106991018B (en) Interface skin changing method and device
CN104182122A (en) Method for taking notes
CN111124668A (en) Memory release method and device, storage medium and terminal
CN105573585A (en) Information display method and terminal
CN113301157A (en) Cloud mobile phone group control method, equipment and storage medium based on android system
CN111399625A (en) Refreshing frequency switching method and device, readable medium and communication terminal
CN110753251A (en) Video switching method and device and electronic equipment
CN111597009B (en) Application program display method and device and terminal equipment
CN106610828B (en) Android system-based GIF animation playing method and device
CN111324398A (en) Recent content processing method, device, terminal and storage medium
CA3069374A1 (en) View switching
US20170013118A1 (en) Electronic device and notification method thereof
CN107885444B (en) Instruction execution method and device
CN110730300A (en) Camera control method, device, storage medium and terminal
CN105573705A (en) Display control method and terminal
CN108228023B (en) Method and device for installing application program and electronic equipment
CN111782100A (en) Method, device, terminal and storage medium for previewing background picture
WO2019153986A1 (en) Application display method, application, 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
TA01 Transfer of patent application right

Effective date of registration: 20200526

Address after: 310051 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627, room 146-150, first floor, No. 07, Whampoa Avenue, Tianhe District, Guangdong, Guangzhou

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant