[go: up one dir, main page]

CN107835520B - Wifi hotspot connection method and device and storage medium - Google Patents

Wifi hotspot connection method and device and storage medium Download PDF

Info

Publication number
CN107835520B
CN107835520B CN201710884576.2A CN201710884576A CN107835520B CN 107835520 B CN107835520 B CN 107835520B CN 201710884576 A CN201710884576 A CN 201710884576A CN 107835520 B CN107835520 B CN 107835520B
Authority
CN
China
Prior art keywords
wifi
wifi hotspots
hotspots
scores
hotspot
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
CN201710884576.2A
Other languages
Chinese (zh)
Other versions
CN107835520A (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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen 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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201710884576.2A priority Critical patent/CN107835520B/en
Priority to PCT/CN2018/076180 priority patent/WO2019061993A1/en
Publication of CN107835520A publication Critical patent/CN107835520A/en
Application granted granted Critical
Publication of CN107835520B publication Critical patent/CN107835520B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F17/00Digital computing or data processing equipment or methods, specially adapted for specific functions
    • G06F17/10Complex mathematical operations
    • G06F17/18Complex mathematical operations for evaluating statistical data, e.g. average values, frequency distributions, probability functions, regression analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Mathematical Optimization (AREA)
  • Theoretical Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computational Mathematics (AREA)
  • Signal Processing (AREA)
  • Mathematical Analysis (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Evolutionary Biology (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Operations Research (AREA)
  • Probability & Statistics with Applications (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Algebra (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a wifi hotspot connection method, a wifi hotspot connection device and a storage medium, wherein the method comprises the following steps: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time; updating the predetermined logistic regression model every second preset time; calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model; reading the connection failure times of the wifi hotspots in a third preset time, and obtaining second scores of the wifi hotspots according to a predetermined weight reduction rule; sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score; and sequentially trying to connect the plurality of wifi hotspots according to the sequencing result. According to the invention, the optimal wifi hotspot is selected for the user and the connection operation is carried out by utilizing the historical data of the wifi hotspot, so that the user internet experience is improved.

Description

Wifi hotspot connection method and device and storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a wifi hotspot connecting method, an electronic device and a computer readable storage medium.
Background
When the mobile terminal starts the function of the wireless local area network, the scanned wifi hotspots can be displayed in the wireless local area network interface, the user can manually connect the scanned wifi hotspots, and if the scanned hotspots have the wifi hotspots which are connected once, the system can automatically connect the wifi hotspots. The wifi hotspot is usually provided with a connection password, which can prevent network rubbing and ensure communication safety. In the wifi hotspot connection process, the password needs to be input for the wifi hotspot with the password.
According to the position of the mobile terminal, free wifi hotspots can exist in the scanned wifi hotspot list, such as: operator wifi hotspots (china mobile, china telecom, china unicom), public wifi, merchant wifi hotspots, etc. The user usually selects and connects manually for the free wifi hotspot that is scanned out at will, and the wifi hotspot that leads to connecting at will is usually not optimal, and manual connection is also inconvenient, influences the user experience of surfing the net. Therefore, how to select a good wifi hotspot for a user to automatically connect is a very valuable and urgent problem to be solved.
Disclosure of Invention
The invention provides a wifi hotspot connection method, an electronic device and a computer readable storage medium, and mainly aims to utilize historical data of wifi hotspots and a real-time updated model to calculate scores of the wifi hotspots, select an optimal wifi hotspot for a user and perform connection operation, and improve the user internet experience.
In order to achieve the above object, the present invention provides a wifi hotspot connection method, which comprises:
a receiving step: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time;
and (3) updating the model: updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the model file of the updated logistic regression model into a memory;
grading: calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model;
and (3) score adjustment: reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots;
a sorting step: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score; and
a connection step: and sequentially trying to connect the plurality of wifi hotspots according to the sequencing result.
Preferably, the method further comprises the steps of:
and after the client successfully connects a wifi hotspot within the fourth preset time, detecting whether the wifi hotspot is really available, and if the wifi hotspot is unavailable, continuing to connect the wifi hotspot arranged behind the wifi hotspot.
Preferably, the predetermined right-reducing rule comprises:
reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time;
when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots;
when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots; and
and when the connection failure times are larger than a second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
Preferably, the sorting step comprises:
sequencing the plurality of wifi hotspots according to the current signal intensity sequence of the plurality of wifi hotspots; and
and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sequencing according to the high-low sequence of the second scores of the two or more wifi hotspots.
Preferably, the scoring step further comprises:
and assigning a default score or an average score of second scores of other wifi hotspots to wifi hotspots in the plurality of wifi hotspots without historical data.
In addition, to achieve the above object, the present invention also provides an electronic device including: the device comprises a memory and a processor, wherein a wifi hotspot connecting program is stored in the memory, and when the wifi hotspot connecting program is executed by the processor, the following steps are realized:
a receiving step: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time;
and (3) updating the model: updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the model file of the updated logistic regression model into a memory;
grading: calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model;
and (3) score adjustment: reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots;
a sorting step: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score; and
a connection step: and sequentially trying to connect the plurality of wifi hotspots according to the sequencing result.
Preferably, the wifi hotspot connecting program further implements the following steps when executed by the processor:
and after the client successfully connects a wifi hotspot within the fourth preset time, detecting whether the wifi hotspot is really available, and if the wifi hotspot is unavailable, continuing to connect the wifi hotspot arranged behind the wifi hotspot.
Preferably, the predetermined right-reducing rule comprises:
reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time;
when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots;
when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots; and
and when the connection failure times are larger than a second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
Preferably, the sorting step comprises:
sequencing the plurality of wifi hotspots according to the current signal intensity sequence of the plurality of wifi hotspots; and
and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sequencing according to the high-low sequence of the second scores of the two or more wifi hotspots.
Preferably, the scoring step further comprises:
and assigning a default score or an average score of second scores of other wifi hotspots to wifi hotspots in the plurality of wifi hotspots without historical data.
In addition, to achieve the above object, the present invention further provides a computer readable storage medium, where a wifi hotspot connecting program is stored on the computer readable storage medium, and the wifi hotspot connecting program implements the steps of the wifi hotspot connecting method when executed by a processor.
Compared with the prior art, the wifi hotspot connection method, the electronic device and the computer readable storage medium provided by the invention calculate the probability of successful connection of the wifi hotspot in the future by acquiring historical data of the wifi hotspot, then sort the wifi hotspot according to the signal intensity of the wifi hotspot and the score in sequence, and finally select the optimal wifi hotspot for a user and perform connection operation, thereby improving the user internet experience.
Drawings
FIG. 1 is a diagram of an electronic device according to a preferred embodiment of the present invention;
FIG. 2 is a block diagram illustrating a preferred embodiment of the wifi hotspot connection process of FIG. 1;
FIG. 3 is a flowchart illustrating a wifi hot spot connection method according to a preferred embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The invention provides an electronic device 1. Referring to fig. 1, a schematic diagram of an electronic device 1 according to a preferred embodiment of the invention is shown. In this embodiment, the electronic device 1 includes a memory 11, a processor 12, a network interface 13, and a communication bus 14.
The electronic device 1 may be a server, a smart phone, a tablet computer, a portable computer, a desktop computer, or other terminal equipment with an operation function, and in some embodiments, the server may be a rack server, a blade server, a tower server, a cabinet server, or the like.
The network interface 13 may include a standard wired interface, a wireless interface (e.g., WI-FI interface). Typically for connecting clients (not shown in fig. 1). In the present embodiment, the electronic apparatus 1 is connected to a plurality of clients 2 through the network interface 13. The client 2 may be a terminal device with a wireless local area network configuration, such as a notebook, a tablet computer, a smart phone, an e-book reader, and the like.
The communication bus 14 is used to enable connection communication between these components.
The memory 11 includes at least one type of readable storage medium. The at least one type of readable storage medium may be a non-volatile storage medium such as a flash memory, a hard disk, a multimedia card, a card-type memory, and the like. In some embodiments, the readable storage medium may be an internal storage unit of the electronic apparatus 1, such as a hard disk of the electronic apparatus 1. In other embodiments, the readable storage medium may also be an external storage device of the electronic apparatus 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic apparatus 1.
In the embodiment, the readable storage medium of the memory 11 is generally used for storing a wifi hotspot connection program installed in the electronic device 1, historical data of recently connected wifi hotspots and users collected by the client 2, a predetermined and updated logistic regression model, and the like. The memory 11 may also be used to temporarily store data that has been output or is to be output.
The processor 12 may be, in some embodiments, a Central Processing Unit (CPU), microprocessor or other data Processing chip for running program code stored in the memory 11 or Processing data, such as executing a wifi hotspot connection program.
Fig. 1 shows only the electronic device 1 with components 11-14 and the wifi hotspot connection program 10, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
Optionally, the electronic device 1 may further comprise a user interface, the user interface may comprise an input unit such as a Keyboard (Keyboard), and the optional user interface may further comprise a standard wired interface, a wireless interface.
Optionally, the electronic device 1 may further include a Display (Display), which may be an LED Display, a liquid crystal Display, a touch-sensitive liquid crystal Display, an OLED (Organic Light-Emitting Diode) touch device, or the like in some embodiments. The display is used for displaying information processed in the electronic device and for displaying a visualized user interface.
Optionally, the electronic device 1 may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a wifi module, and the like, which are not described herein again.
In the embodiment of the apparatus shown in fig. 1, the memory 11 as a computer storage medium stores the wifi hot spot connection program 10, and the processor 12 executes the wifi hot spot connection program 10 stored in the memory 11 to implement the following steps:
a receiving step: the method includes the steps that a plurality of available wifi hotspots scanned by a client 2 and historical data of the wifi hotspots in a first preset time are received.
For example, a client 2 version (hereinafter abbreviated as APP) of a wifi hotspot connection program is installed on the client 2 used by each user, and the client 2 performs wifi hotspot connection operation through the APP. This APP passes through client 2 and continuously scans a plurality of wifi hotspots that are available in the current position, and electronic device 1 receives a plurality of wifi hotspots that APP scanned through client 2 to collect the historical data of these a plurality of wifi hotspots that each user visited in first preset time (nearly three months), include: the name of wifi, the time and duration of access, the operating status (connection success, connection failure, login success, login failure, etc.), the frequency of access, whether the operator provides, etc. The electronic device 1 uploads the history data to a log server, extracts key history data such as wifi identification, time, position, connection operation, internet surfing duration, connection success times, connection failure times, retry times, login success times, login failure times and the like through a data warehouse technology (Extract-Transform-Load, ETL for short), and stores the key history data in the memory 11 for subsequent model updating and scoring operations.
And (3) updating the model: and updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the updated model file of the logistic regression model into a memory.
Specifically, the predetermined logistic regression model is obtained by an offline training method: analyzing the key data, constructing model characteristics from the aspects of time dimension, operator/shared hotspot dimension, connection/login/retry/internet surfing duration statistics and the like, and determining a model label; counting the frequency and data volume of the wifi hot spot used by the user according to the month and the day, determining the dimension of the time length of the wifi hot spot of the last three months and the last week, and combining the dimensions of 'operator/shared hot spot' and 'connection/login/retry/internet surfing duration' into a series of characteristics, such as the connection power of the operator in the last month, the retry frequency of the wifi hot spot of the last week and the like. And then training the random forest model by taking the key historical data of the last three months as a training set to obtain a logistic regression model for grading wifi hotspots, and storing a model file of the logistic regression model in the memory 11. There are mature calculation methods for training the model and using it to calculate the score of each wifi hotspot, and no further description is given here.
It can be appreciated that the advantage of training the model offline is that there is a large amount of historical data and the samples are sufficient. The online training model has the advantages that the latest data can be utilized, the model can adapt to the change of real-time data, and the online model is more accurate under the condition of larger data distribution and historical difference. In order to make the scores of the wifi hotspots obtained by subsequent calculation more accurate, the logistic regression model is updated every second preset time (for example, one day). By combining the off-line training mode and the on-line training mode, the method and the device can obtain the advantages of the off-line training mode and the on-line training mode, improve the accuracy of the model, and simultaneously prevent the problems of failure in real-time model updating and the like caused by too small data volume or network and system problems in an on-line environment.
In one embodiment, model training is a process of iteratively solving model parameters using an optimization algorithm using sample data. The objective of iterative computation of an optimization algorithm is to minimize the loss function value of the model, and for a logistic regression model, an L-BFGS algorithm (Limited-memory Broyden-Fletcher-Goldfarb-Shanno) training is used in an offline environment to obtain a parameter set S0, namely an offline model result; in an online environment, using an FTRL-Proximal algorithm (Follow The regulated Leader), loading a set S0 as an initial value, using data of a wifi hotspot arriving in real time, and performing calculation once, wherein The calculation result is a new parameter value set S1; by analogy, when another piece of real-time data arrives, the result S2 is obtained by calculation using S1 as input, and the latest calculation result Sn is the latest model.
Grading: and calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model. After receiving a plurality of wifi hotspots sent by the client 2APP, calling the model file of the logistic regression model from the memory 11, calling historical data of the plurality of wifi hotspots in three months from the memory 11, inputting the historical data into the model, and obtaining first scores of the plurality of wifi hotspots, namely the probability that the plurality of wifi hotspots are possibly successfully connected in the future.
And (3) score adjustment: and reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots. In this embodiment, in order to further ensure the reliability of the first scores of the wifi hotspots, the first scores of the wifi hotspots are adjusted according to a predetermined weight reduction rule. The predetermined weight reduction rule comprises: reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time; when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots; when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots; and when the connection failure times are larger than a second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
Taking wifi hotspot A, B, C as an example, the first scores of wifi hotspot A, B, C are: 9.0, 8.5 and 9.5. Assuming that the third preset time is 30min, the first preset threshold is 5, the second preset threshold is 10, the first coefficient is 0.8, the second coefficient is 0.4, and the connection failure times of the wifi hotspot A, B, C within 30min are: 8. 3, 15, the connection failure times of the wifi hotspot A within 30min are greater than the first preset threshold and less than a second preset threshold, so that the second score of the wifi hotspot A is 7.2; the connection failure frequency of the wifi hotspot B within 30min is smaller than the first preset threshold, so that the second score of the wifi hotspot B is 8.5; the connection failure times of the wifi hotspot C within 30min are greater than a second preset threshold, so that the second score of the wifi hotspot C is 3.8.
Specifically, there is a case where one wifi hotspot among the wifi hotspots has no historical data, and then the logistic regression model cannot calculate a first score of the wifi hotspot and cannot calculate a second score of the wifi hotspot, and for this kind of wifi hotspot, a preset default score or an average value of the second scores of other wifi hotspots is taken and assigned to this kind of wifi hotspot. Further, when the default score is inconsistent with the average value of the second scores of the other wifi hotspots, the second score with the high score is taken as the second score of the wifi hotspot.
A sorting step: and sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the second score.
It should be noted that, for the same wifi hotspot, the signal intensities of the wifi hotspots scanned by different clients 2 at different positions are different, but the scores of the wifi hotspots are consistent, so that the wifi hotspots cannot be sorted only according to the scores of the wifi hotspots, and the signal intensity of the wifi hotspots needs to be considered. Taking wifi hotspot A, B, C as an example, the second scores of wifi hotspot A, B, C obtained according to the weight reduction rule are: 7.2, 8.5 and 3.8, wherein the signal intensity interval of the wifi hotspot A, B is between-35 dbm and-60 dbm, and the signal intensity interval of the wifi hotspot C is between-60 dbm and-85 dbm, specifically, the sorting step comprises the following steps:
sorting the wifi hotspots according to the current signal intensity sequence of the wifi hotspots (A ═ B > C); and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sorting according to the high-low order of the second scores of the two or more wifi hotspots (B is larger than A), so that the final sorting result is B, A, C.
A connection step: and sequentially trying to connect the plurality of wifi hotspots according to the sequencing result. According to the final sequencing result, the electronic device sequentially connects the wifi hotspots B, A, C according to the sequence of the wifi hotspots B, A, C.
Specifically, after the client 2 successfully connects to a wifi hotspot within the fourth preset time, whether the wifi hotspot is really available is detected, and if the wifi hotspot is unavailable, the connection operation of the wifi hotspot arranged behind the wifi hotspot is continued. Assuming that the fourth preset time is 10s, when the client 2 successfully connects to a wifi hotspot B within 10s, detecting whether the wifi hotspot B is really available, for example, checking whether the network of the wifi hotspot B is connected by using a "ping" command, and analyzing and determining whether the wifi hotspot B has a network fault. It can be understood that if the wifi hotspot B is not successfully connected for more than the fourth preset time 10s, or a network fault is detected to exist in the wifi hotspot B, it is understood that the wifi hotspot B is unavailable, and the connection operation continues to be performed on the wifi hotspot (A, C) arranged behind the wifi hotspot.
It should be noted that the user may adjust the parameters and rules to be preset, such as the first preset time to the fourth preset time, the preset default score, the predetermined right reduction rule, and the like, according to the actual situation.
The electronic device 1 that this embodiment provided, through the historical data who obtains the wifi hotspot, real-time update calculates the logistic regression model that the wifi hotspot scored, calculates the probability that the future of wifi hotspot probably connects successfully, then sorts the wifi hotspot according to wifi hotspot signal strength, score in proper order, selects the optimal wifi hotspot and connects the operation for the user at last, promotes user's experience of surfing the net.
Optionally, in other embodiments, the wifi hotspot connecting program 10 may also be divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors, such as the processor 12 in this embodiment, to complete the present invention. The modules referred to herein are referred to as a series of computer program instruction segments capable of performing specified functions.
For example, referring to fig. 2, a block diagram of the wifi hotspot connecting program 10 in fig. 1 is shown. In this embodiment, the wifi hotspot connecting program 10 can be divided into: the system comprises a receiving module 110, an updating module 120, a first scoring module 130, a second scoring module 140, a sorting module 150 and a connecting module 160. The functions or operation steps implemented by the modules 110 and 160 are similar to those described above, and are not detailed here, for example, where:
the receiving module 110 is configured to receive a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time;
the updating module 120 is configured to update the predetermined logistic regression model at intervals of a second preset time by using historical data of the wifi hotspots in the second preset time, and store a model file of the updated logistic regression model in a memory;
the first scoring module 130 is configured to calculate a first score of the wifi hotspots according to the historical data within a first preset time and the updated logistic regression model;
the second scoring module 140 is configured to read connection failure times of the wifi hotspots within a third preset time, and adjust the first score of the wifi hotspots according to a predetermined weight reduction rule to obtain a second score of the wifi hotspots;
a sorting module 150 for sorting the steps: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score; and
a connection module 160, configured to try to connect the wifi hotspots in sequence according to the sorting result.
In addition, the invention also provides a wifi hotspot connection method. Fig. 3 is a flowchart illustrating a wifi hotspot connection method according to a first embodiment of the present invention. The method may be performed by an apparatus, which may be implemented by software and/or hardware.
In this embodiment, the wifi hotspot connection method includes: step S10, step S20, step S30, step S40, step S50, and step S60.
Step S10, receiving a plurality of available wifi hotspots scanned by the client and historical data of the wifi hotspots in a first preset time.
For example, a client version (hereinafter abbreviated as APP) of a wifi hotspot connection program is installed on a client used by each user, and the client performs wifi hotspot connection operation through the APP. This APP passes through the client and lasts the scanning at the available a plurality of wifi hotspots in current position, and electronic device receives a plurality of wifi hotspots that APP scanned through the client to collect the historical data of these a plurality of wifi hotspots that each user visited in first preset time (nearly three months), include: the name of wifi, the time and duration of access, the operating status (connection success, connection failure, login success, login failure, etc.), the frequency of access, whether the operator provides, etc. The electronic device uploads the historical data to a log server, extracts key historical data such as wifi identification, time, position, connection operation, internet surfing time, connection success times, connection failure times, retry times, login success times, login failure times and the like through a data warehouse technology (ETL), and stores the key historical data in a memory for subsequent model updating and grading operations.
And step S20, updating the predetermined logistic regression model by using the historical data of the plurality of wifi hotspots in the second preset time every other second preset time, and storing the updated model file of the logistic regression model into a memory.
Specifically, the predetermined logistic regression model is obtained by an offline training method: analyzing the key data, constructing model characteristics from the aspects of time dimension, operator/shared hotspot dimension, connection/login/retry/internet surfing duration statistics and the like, and determining a model label; counting the frequency and data volume of the wifi hot spot used by the user according to the month and the day, determining the dimension of the time length of the wifi hot spot of the last three months and the last week, and combining the dimensions of 'operator/shared hot spot' and 'connection/login/retry/internet surfing duration' into a series of characteristics, such as the connection power of the operator in the last month, the retry frequency of the wifi hot spot of the last week and the like. And then training the random forest model by taking the key historical data of the last three months as a training set to obtain a logistic regression model for grading wifi hotspots, and storing a model file of the logistic regression model into a memory. There are mature calculation methods for training the model and using it to calculate the score of each wifi hotspot, and no further description is given here.
It can be appreciated that the advantage of training the model offline is that there is a large amount of historical data and the samples are sufficient. The online training model has the advantages that the latest data can be utilized, the model can adapt to the change of real-time data, and the online model is more accurate under the condition of larger data distribution and historical difference. In order to make the scores of the wifi hotspots obtained by subsequent calculation more accurate, the logistic regression model is updated every second preset time (for example, one day). By combining the off-line training mode and the on-line training mode, the method and the device can obtain the advantages of the off-line training mode and the on-line training mode, improve the accuracy of the model, and simultaneously prevent the problems of failure in real-time model updating and the like caused by too small data volume or network and system problems in an on-line environment.
In one embodiment, model training is a process of iteratively solving model parameters using an optimization algorithm using sample data. The objective of iterative computation of the optimization algorithm is to minimize the loss function value of the model, and for the logistic regression model, the L-BFGS algorithm training is used in the offline environment to obtain a parameter set S0, namely an offline model result; in an online environment, an FTRL-Proximal algorithm is used, a loading set S0 is used as an initial value, next wifi hotspot data arriving in real time are used for calculating for one time, and the calculation result is a new parameter value set S1; by analogy, when another piece of real-time data arrives, the result S2 is obtained by calculation using S1 as input, and the latest calculation result Sn is the latest model.
Step S30, calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model. After receiving a plurality of wifi hotspots sent by a client APP, calling the model file of the logistic regression model and historical data of the wifi hotspots in three months from a memory, inputting the model file into a model, and obtaining first scores of the wifi hotspots, namely the probability that the wifi hotspots are possibly successfully connected in the future.
Step S40, reading the connection failure times of the wifi hotspots in a third preset time, and adjusting the first scores of the wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the wifi hotspots. In this embodiment, in order to further ensure the reliability of the first scores of the wifi hotspots, the first scores of the wifi hotspots are adjusted according to a predetermined weight reduction rule. The predetermined weight reduction rule comprises: reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time; when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots; when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots; and when the connection failure times are larger than a second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
Taking wifi hotspot A, B, C as an example, the first scores of wifi hotspot A, B, C are: 9.0, 8.5 and 9.5. Assuming that the third preset time is 30min, the first preset threshold is 5, the second preset threshold is 10, the first coefficient is 0.8, the second coefficient is 0.4, and the connection failure times of the wifi hotspot A, B, C within 30min are: 8. 3, 15, the connection failure times of the wifi hotspot A within 30min are greater than the first preset threshold and less than a second preset threshold, so that the second score of the wifi hotspot A is 7.2; the connection failure frequency of the wifi hotspot B within 30min is smaller than the first preset threshold, so that the second score of the wifi hotspot B is 8.5; the connection failure times of the wifi hotspot C within 30min are greater than a second preset threshold, so that the second score of the wifi hotspot C is 3.8.
Specifically, there is a case where one wifi hotspot among the wifi hotspots has no historical data, and then the logistic regression model cannot calculate a first score of the wifi hotspot and cannot calculate a second score of the wifi hotspot, and for this kind of wifi hotspot, a preset default score or an average value of the second scores of other wifi hotspots is taken and assigned to this kind of wifi hotspot. Further, when the default score is inconsistent with the average value of the second scores of the other wifi hotspots, the second score with the high score is taken as the second score of the wifi hotspot.
And step S50, sorting the wifi hotspots according to the signal intensity of the wifi hotspots and the height of the second score.
It should be noted that, for the same wifi hotspot, the signal intensities of the wifi hotspot scanned by different clients at different positions are different, but the scores of the wifi hotspot are consistent, so that the wifi hotspots cannot be sorted only according to the scores of the wifi hotspots, and the signal intensity of the wifi hotspot needs to be considered. Taking wifi hotspot A, B, C as an example, the second scores of wifi hotspot A, B, C obtained according to the weight reduction rule are: 7.2, 8.5 and 3.8, wherein the signal intensity interval of the wifi hotspot A, B is between-35 dbm and-60 dbm, and the signal intensity interval of the wifi hotspot C is between-60 dbm and-85 dbm, specifically, the sorting step comprises the following steps:
sorting the wifi hotspots according to the current signal intensity sequence of the wifi hotspots (A ═ B > C); and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sorting according to the high-low order of the second scores of the two or more wifi hotspots (B is larger than A), so that the final sorting result is B, A, C.
And step S60, sequentially trying to connect the plurality of wifi hotspots according to the sorting result. According to the final sequencing result, the electronic device sequentially connects the wifi hotspots B, A, C according to the sequence of the wifi hotspots B, A, C.
Further, after the client successfully connects to a wifi hotspot within a fourth preset time, whether the wifi hotspot is really available is detected, and if the wifi hotspot is unavailable, the connection operation of the wifi hotspot arranged behind the wifi hotspot is continued. Assuming that the fourth preset time is 10s, when the client successfully connects to a wifi hotspot B within 10s, detecting whether the wifi hotspot B is really available, for example, checking whether the network of the wifi hotspot B is connected by using a "ping" command, and analyzing and determining whether the wifi hotspot B has a network fault. It can be understood that if the wifi hotspot B is not successfully connected for more than the fourth preset time 10s, or a network fault is detected to exist in the wifi hotspot B, it is understood that the wifi hotspot B is unavailable, and the connection operation continues to be performed on the wifi hotspot (A, C) arranged behind the wifi hotspot.
It should be noted that the user may adjust the parameters and rules to be preset, such as the first preset time to the fourth preset time, the preset default score, the predetermined right reduction rule, and the like, according to the actual situation.
According to the wifi hotspot connection method provided by the embodiment, the logistic regression model for calculating the score of the wifi hotspot is updated in real time by acquiring historical data of the wifi hotspot, the probability that the wifi hotspot is possibly successfully connected in the future is calculated, then the wifi hotspots are sequenced in sequence according to the signal intensity of the wifi hotspot and the score of the score, finally, the optimal wifi hotspot is selected for a user and connected, and the user internet experience is improved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a wifi hotspot connecting program is stored on the computer-readable storage medium, and when executed by a processor, the wifi hotspot connecting program implements the following operations:
a receiving step: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time;
and (3) updating the model: updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the model file of the updated logistic regression model into a memory;
grading: calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model;
and (3) score adjustment: reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots;
a sorting step: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score; and
a connection step: and sequentially trying to connect the plurality of wifi hotspots according to the sequencing result.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the above-mentioned wifi hotspot connecting method, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, apparatus, article, or method that includes the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments. Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A wifi hotspot connection method is applied to an electronic device, the electronic device is connected with one or more clients through a network, and the method is characterized by comprising the following steps:
a receiving step: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time; the historical data comprises wifi identification, time, position, connection operation, internet surfing duration, connection success times, connection failure times, retry times, login success times and login failure times;
and (3) updating the model: updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the model file of the updated logistic regression model into a memory;
grading: calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model;
and (3) score adjustment: reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots;
a sorting step: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score;
a connection step: sequentially trying to connect the plurality of wifi hotspots according to the sequencing result;
wherein the predetermined right reduction rule comprises:
reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time;
when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots;
when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots, wherein the first preset threshold is smaller than the second preset threshold; and
and when the connection failure times are larger than the second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
2. The wifi hotspot connection method of claim 1, further comprising the steps of:
and after the client successfully connects a wifi hotspot within the fourth preset time, detecting whether the wifi hotspot is really available, and if the wifi hotspot is unavailable, continuing to connect the wifi hotspot arranged behind the wifi hotspot.
3. The wifi hotspot connection method of claim 1, wherein the ordering step comprises:
sequencing the plurality of wifi hotspots according to the current signal intensity sequence of the plurality of wifi hotspots; and
and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sequencing according to the high-low sequence of the second scores of the two or more wifi hotspots.
4. The wifi hotspot connection method of claim 1, wherein the scoring step further comprises:
and assigning a default score or an average score of second scores of other wifi hotspots to wifi hotspots in the plurality of wifi hotspots without historical data.
5. An electronic device, comprising: the device comprises a memory and a processor, wherein a wifi hotspot connecting program is stored in the memory, and when the wifi hotspot connecting program is executed by the processor, the following steps are realized:
a receiving step: receiving a plurality of available wifi hotspots scanned by a client and historical data of the wifi hotspots in a first preset time; the historical data comprises wifi identification, time, position, connection operation, internet surfing duration, connection success times, connection failure times, retry times, login success times and login failure times;
and (3) updating the model: updating the predetermined logistic regression model by using historical data of the plurality of wifi hotspots in a second preset time every other second preset time, and storing the model file of the updated logistic regression model into a memory;
grading: calculating first scores of the wifi hotspots according to historical data in a first preset time and the updated logistic regression model;
and (3) score adjustment: reading the connection failure times of the plurality of wifi hotspots in a third preset time, and adjusting the first scores of the plurality of wifi hotspots according to a predetermined weight reduction rule to obtain second scores of the plurality of wifi hotspots;
a sorting step: sequencing the plurality of wifi hotspots according to the signal intensity of the plurality of wifi hotspots and the level of the second score;
a connection step: sequentially trying to connect the plurality of wifi hotspots according to the sequencing result;
wherein the predetermined right reduction rule comprises:
reading the connection failure times of the plurality of wifi hotspots in the historical data within a third preset time;
when the connection failure times are smaller than a first preset threshold value, keeping first scores of the wifi hotspots as second scores of the wifi hotspots;
when the connection failure times are larger than a first preset threshold and smaller than a second preset threshold, multiplying a first score of the wifi hotspots by a first coefficient to serve as a second score of the wifi hotspots; and
and when the connection failure times are larger than a second preset threshold value, multiplying the first scores of the wifi hotspots by a second coefficient to serve as second scores of the wifi hotspots.
6. The electronic device of claim 5, wherein the wifi hotspot connection program when executed by the processor further implements the steps of:
and after the client successfully connects a wifi hotspot within the fourth preset time, detecting whether the wifi hotspot is really available, and if the wifi hotspot is unavailable, continuing to connect the wifi hotspot arranged behind the wifi hotspot.
7. The electronic device of claim 5, wherein the ordering step comprises:
sequencing the plurality of wifi hotspots according to the current signal intensity sequence of the plurality of wifi hotspots; and
and for two or more wifi hotspots with the current signal intensity in the same signal intensity interval, sequencing according to the high-low sequence of the second scores of the two or more wifi hotspots.
8. A computer-readable storage medium, having stored thereon a wifi hotspot connection program which, when executed by a processor, implements the steps of the wifi hotspot connection method of any one of claims 1-4.
CN201710884576.2A 2017-09-26 2017-09-26 Wifi hotspot connection method and device and storage medium Active CN107835520B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710884576.2A CN107835520B (en) 2017-09-26 2017-09-26 Wifi hotspot connection method and device and storage medium
PCT/CN2018/076180 WO2019061993A1 (en) 2017-09-26 2018-02-10 Wi-fi hotspot connection method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710884576.2A CN107835520B (en) 2017-09-26 2017-09-26 Wifi hotspot connection method and device and storage medium

Publications (2)

Publication Number Publication Date
CN107835520A CN107835520A (en) 2018-03-23
CN107835520B true CN107835520B (en) 2021-01-05

Family

ID=61643447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710884576.2A Active CN107835520B (en) 2017-09-26 2017-09-26 Wifi hotspot connection method and device and storage medium

Country Status (2)

Country Link
CN (1) CN107835520B (en)
WO (1) WO2019061993A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108810916B (en) * 2018-04-17 2022-08-12 深圳平安通信科技有限公司 Wi-Fi hotspot recommendation method and device and storage medium
CN108848545A (en) * 2018-07-02 2018-11-20 晶晨半导体(上海)股份有限公司 A kind of method for intelligent connection and system of wireless access point
CN108601040B (en) * 2018-07-23 2022-03-04 上海尚往网络科技有限公司 Wireless access point ordering method and device
CN109195204B (en) * 2018-11-12 2021-02-12 Oppo广东移动通信有限公司 Wireless network access method and device, computer readable medium and communication terminal
CN110856233B (en) * 2019-11-14 2022-04-22 Oppo广东移动通信有限公司 Communication control method and related product
CN111866994B (en) * 2020-07-26 2021-02-05 广云物联网科技(广州)有限公司 Method and device for rapidly distributing network at hot spot
CN113839820B (en) * 2021-10-14 2023-08-11 福建天晴数码有限公司 Method and system for searching optimal network updating node during updating service
CN113810947B (en) * 2021-10-29 2023-05-09 中国联合网络通信集团有限公司 WiFi network quality assessment method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2362689A1 (en) * 2010-02-26 2011-08-31 Research In Motion Limited Storage of radio information on a removable memory
CN102907121A (en) * 2010-05-20 2013-01-30 At&T移动第二有限责任公司 WI-FI intelligent selection engine
CN104768156A (en) * 2015-04-30 2015-07-08 北京奇虎科技有限公司 Method and device for WiFi connection
CN105376700A (en) * 2015-11-23 2016-03-02 努比亚技术有限公司 An access device and method for a free Wi-Fi network
CN105657790A (en) * 2016-03-23 2016-06-08 深圳优克云联科技有限公司 Network connecting method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2362689A1 (en) * 2010-02-26 2011-08-31 Research In Motion Limited Storage of radio information on a removable memory
CN102907121A (en) * 2010-05-20 2013-01-30 At&T移动第二有限责任公司 WI-FI intelligent selection engine
CN104768156A (en) * 2015-04-30 2015-07-08 北京奇虎科技有限公司 Method and device for WiFi connection
CN105376700A (en) * 2015-11-23 2016-03-02 努比亚技术有限公司 An access device and method for a free Wi-Fi network
CN105657790A (en) * 2016-03-23 2016-06-08 深圳优克云联科技有限公司 Network connecting method, device and system

Also Published As

Publication number Publication date
CN107835520A (en) 2018-03-23
WO2019061993A1 (en) 2019-04-04

Similar Documents

Publication Publication Date Title
CN107835520B (en) Wifi hotspot connection method and device and storage medium
CN109992601B (en) To-do information pushing method and device and computer equipment
CN112328909B (en) Information recommendation method and device, computer equipment and medium
EP3001332A1 (en) Target user determination method, device and network server
CN110351115A (en) Reduce method, apparatus, computer equipment and the storage medium of network access time delay
CN111178147B (en) Screen crushing and grading method, device, equipment and computer readable storage medium
CN108566666B (en) Wi-Fi hotspot recommendation method and device and storage medium
CN108460346B (en) Fingerprint identification method and device
CN107734594B (en) Personalized wifi hotspot pushing method and device and storage medium
CN104869019A (en) Feedback method and apparatus for positioning faults, and server
CN110929057A (en) Image processing method, device and system, storage medium and electronic device
CN111882087A (en) Equipment maintenance processing method, device, computer system and readable storage medium
CN111224865A (en) User identification method based on payment session, electronic device and storage medium
CN110675219A (en) Page and order generation method, system, computer equipment and storage medium
CN117575518B (en) Method, device, equipment and medium for digital management of whole engineering construction process
CN111212434B (en) WIFI module quality prediction method, device, equipment and storage medium
CN117422229A (en) Algorithm model scheduling method, device, equipment and storage medium
KR101462858B1 (en) Methods for competency assessment of corporation for global business
CN111126923A (en) Material stagnation statistical method and device, storage medium and terminal equipment
CN110705382A (en) Electronic invoice management method, device, equipment and medium based on invoice categories
CN116881292A (en) Data matching method, device, medium and server based on rule template
CN110163657B (en) Insurance product recommendation method and related equipment based on manifold learning algorithm
CN115239996A (en) Article position correction method, apparatus, electronic device, and computer-readable medium
CN115187442A (en) AI-based library management method, device, equipment and storage medium
CN115329843A (en) Label processing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant