CN109618421B - Method and device for reconnecting AP, terminal and storage medium - Google Patents
Method and device for reconnecting AP, terminal and storage medium Download PDFInfo
- Publication number
- CN109618421B CN109618421B CN201910032986.3A CN201910032986A CN109618421B CN 109618421 B CN109618421 B CN 109618421B CN 201910032986 A CN201910032986 A CN 201910032986A CN 109618421 B CN109618421 B CN 109618421B
- Authority
- CN
- China
- Prior art keywords
- candidate
- connection
- terminal
- score value
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 66
- 238000006243 chemical reaction Methods 0.000 claims abstract description 17
- 230000005540 biological transmission Effects 0.000 claims description 24
- 238000013507 mapping Methods 0.000 claims description 22
- 230000004044 response Effects 0.000 claims description 11
- 238000010248 power generation Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 7
- 230000000903 blocking effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 238000004891 communication Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000006399 behavior Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/19—Connection re-establishment
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/16—Discovering, processing access restriction or access information
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/20—Selecting an access point
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the application discloses a method and a device for reconnecting an AP, a terminal and a storage medium, wherein the method comprises the following steps: if the AP needs to be reconnected, acquiring numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP; converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule; determining a target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP; and sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
Description
Technical Field
The embodiment of the application relates to electronic technology, and relates to, but is not limited to, a method and device for reconnecting an AP, a terminal, and a storage medium.
Background
In a complex environment, especially in an Extended Service Set (ESS) network, a Station (STA) is easily blocked by a Deauth packet from connecting to a current Service Access Point (AP) due to interference or other reasons, so that the STA frequently drops.
At present, after receiving the Deauth packet, the STA usually selects an appropriate target AP according to the signal strength of each candidate AP in the candidate AP set obtained by scanning, thereby completing the AP reconnection function. Therefore, how to select a better target AP becomes a problem to be solved currently.
Disclosure of Invention
In view of the above, embodiments of the present application provide a method and apparatus for reconnecting an AP, a terminal, and a storage medium to solve at least one problem in the related art.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for reconnecting an AP, where the method is applied to a terminal, and the method includes:
if the AP needs to be reconnected, acquiring numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP;
converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
determining a target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP;
and sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
In a second aspect, an embodiment of the present application provides an apparatus for reconnecting an AP, including:
the acquisition module is configured to acquire numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning if the AP needs to be reconnected; the connection parameters are parameters that affect the stability of the connection between the device and the corresponding candidate AP;
a conversion module configured to convert the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
a determining module configured to determine a target AP from the set of candidate APs based on a score value of each connection parameter of each of the candidate APs;
a sending module configured to send a connection request to the target AP, where the connection request is used to request to establish a connection with the target AP.
In a third aspect, an embodiment of the present application provides a terminal, including a memory and a processor, where the memory stores a computer program executable on the processor, and the processor implements the steps in the method for reconnecting an AP when executing the program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps in the above-mentioned method for reconnecting an AP.
In the embodiment of the application, the target AP can be selected based on the numerical values of the at least two connection parameters of each candidate AP and the corresponding score value, so that after the terminal connects to the target AP, the connection link between the terminal and the target AP is not easily interfered, thereby enhancing the connection stability of the terminal.
Drawings
Fig. 1 is a schematic structural diagram of a network architecture according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a method for reconnecting an AP according to an embodiment of the present application;
fig. 3 is a schematic diagram of a score mapping table corresponding to each connection parameter according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a display interface according to an embodiment of the present application;
fig. 5 is a schematic structural diagram illustrating an apparatus for reconnecting an AP according to an embodiment of the present application;
fig. 6 is a schematic diagram of a hardware entity of a terminal according to an embodiment of the present application.
Detailed Description
The technical solution of the present application is further elaborated below with reference to the drawings and the embodiments.
In this embodiment, a network architecture is provided first, and fig. 1 is a schematic view of a composition structure of the network architecture in the embodiment of the present application, as shown in fig. 1, the network architecture includes a plurality of terminals 11 to 1N, a plurality of APs 21 to 2M, and a wireless network 31, where the terminals 11 to 1N establish a connection with one AP of the APs 21 to 2M, so as to access the wireless network 31, and implement data interaction with the wireless network 31. Generally, a terminal may be various types of devices having the capability of reconnecting an AP, for example, the terminal may include a mobile phone, a tablet, a desktop, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, and the like, and may further include a personal computer, a server, a network device, and the like. Note that, in the art, the terminal is also referred to as an STA.
The embodiment provides a method for reconnecting an AP, the method is applied to a terminal, the functions implemented by the method can be implemented by a processor in the terminal calling a program code, of course, the program code can be stored in a computer storage medium, and the terminal at least comprises the processor and the storage medium.
Fig. 2 is a schematic flow chart illustrating an implementation process of a method for reconnecting an AP according to an embodiment of the present application, as shown in fig. 2, the method includes steps S201 to S204:
s201, if the AP needs to be reconnected, obtaining values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP;
for example, if the signal strength (i.e., the received signal strength) of a signal transmitted by the current serving AP received by the terminal is less than a preset strength threshold, it is determined that an AP needs to be reconnected, and the reconnected AP is generally another AP except the current serving AP; for another example, if the terminal receives the Deauth packet, it is determined that the AP needs to be reconnected.
It is understood that the parameters affecting the connection stability between the terminal and the corresponding candidate AP generally include at least two of the following: the working frequency of the candidate AP, the received signal strength when the terminal receives the signal sent by the candidate AP, the first power forming rate of data transmission between the terminal and the candidate AP, the data transmission speed of the candidate AP and the second power forming rate of the terminal connected with the candidate AP; wherein the received signal strength is a main parameter affecting connection stability between the terminal and a corresponding AP.
S202, converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
it should be noted that, because different connection parameters have different degrees of influence on the connection stability between the corresponding AP and the terminal, for example, the received signal strength and the operating frequency of the candidate AP are main parameters influencing the connection stability. Therefore, in practical applications, the conversion rule configured for each connection parameter is generally different, that is, each connection parameter has a corresponding conversion rule.
S203, determining a target AP from the candidate AP set based on the score value of each connection parameter of each candidate AP;
it is understood that the higher the score value, the stronger the connection stability between the corresponding AP and the terminal. In other embodiments, the total score value of the corresponding candidate AP may be determined based on the score value of each connection parameter of each candidate AP, and then the target AP may be determined from the candidate AP set based on the total score value of each candidate AP, for example, the candidate AP with the highest total score value may be determined as the target AP. In this way, the terminal can obtain better connection link quality after establishing connection with the target AP.
S204, sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
In the embodiment of the application, the target AP is selected from the candidate AP set based on the score values of the plurality of connection parameters of each candidate AP, so that the terminal can obtain better connection link quality after establishing connection with the target AP.
The embodiment of the present application provides another method for reconnecting an AP, where the method is applied to a terminal, and the method includes steps S301 to S306:
s301, pre-loading a score mapping table corresponding to each connection parameter, wherein the score mapping table is used for recording a preset range to which the numerical value of the corresponding connection parameter belongs and a score value corresponding to the preset range;
since different connection parameters have different degrees of influence on the connection stability between the corresponding AP and the terminal, when a corresponding score mapping table is configured for each connection parameter, the configuration ranges of the score values are different. For example, fig. 3 is a score mapping table corresponding to each connection parameter in the embodiment of the present application, as shown in fig. 3, table 301 is a score mapping table corresponding to the operating frequency, table 302 is a score mapping table corresponding to the received signal strength, table 303 is a score mapping table corresponding to the first power component, table 304 is a score mapping table corresponding to the data transmission speed, and table 305 is a score mapping table corresponding to the second power component.
As can be seen from fig. 3, the configuration range of the score value corresponding to the working frequency is 90-100 points, wherein the lowest score of the working frequency is 90 points; the configuration range of the score value corresponding to the received signal strength is 70-90 minutes, wherein the lowest score of the received signal strength is 70 minutes; the configuration range of the score value corresponding to the first power component is 60-70 minutes, wherein the lowest score of the first power component is 60 minutes; the configuration range of the score value corresponding to the data transmission speed is 50-60 minutes, wherein the lowest score of the data transmission speed is 50 minutes; the configuration range of the score value corresponding to the second power generation rate is 40-50 minutes, wherein the lowest score of the second power generation rate is 40 minutes; it can be seen that, the corresponding score value ranges are configured for the corresponding connection parameters according to the influence degree of each connection parameter on the connection stability between the terminal and the corresponding candidate AP, that is, the minimum score values configured for each connection parameter are sequentially decreased according to the order of the influence degrees from large to small. In this way, when determining the score value of each connection parameter through step S303 and step S304, it can be ensured that: the score value of the working frequency is more than or equal to the score value of the received signal strength and more than or equal to the score value of the first power component and more than or equal to the score value of the second power component, so that the score value of each connection parameter is more in line with the actual situation.
Of course, in other embodiments, the configuration ranges of the score values may also be the same, so that when the step S305 is implemented, that is, when the target AP is determined from the candidate AP set based on the score value of each connection parameter of each candidate AP, the total score value of the corresponding candidate AP needs to be determined based on the score value of each connection parameter of each candidate AP and the influence factor of the corresponding connection parameter; then, determining a target AP from the candidate AP set based on the total score value of each candidate AP; the influence factor is used for characterizing the influence degree of the corresponding connection parameter on the connection stability between the terminal and the corresponding candidate AP. For example, the influence factors sequentially allocated to the operating frequency, the received signal strength, the first power component, the data transmission speed, and the second power component are: 1.0, 0.8, 0.6, 0.4 and 0.2. In this way, when calculating the total score value of each candidate AP, the product of the score value of each connection parameter and the corresponding influence factor may be determined first, and then the sum of the products of all the connection parameters of the candidate AP may be determined as the total score value of the corresponding candidate AP.
S302, if the AP needs to be reconnected, obtaining the numerical values of at least two connection parameters of each candidate AP in the scanned candidate AP set;
s303, determining a target range to which each value belongs from the corresponding score mapping table based on the value of each connection parameter of each candidate AP;
s304, determining the score value of the corresponding connection parameter from the corresponding score mapping table based on the target range;
for example, the obtained operating frequency of the candidate AP is 5.725GHz, and as shown in fig. 3, it may be determined from the corresponding score mapping table 301 that the operating frequency belongs to the 5G frequency band, and the corresponding score value is 100 points.
Here, it should be noted that step S303 and step S304 are actually an example of implementing step S202 in the above-described embodiment.
S305, determining a target AP from the candidate AP set based on the score value of each connection parameter of each candidate AP;
s306, sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
The embodiment of the present application provides another method for reconnecting an AP, where the method is applied to a terminal, and the method includes steps S401 to S405:
s401, if the AP needs to be reconnected, obtaining the numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP;
s402, converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
s403, determining a total score value of the corresponding candidate AP based on the score value of each connection parameter of each candidate AP;
here, it should be noted that, when the score mapping table corresponding to each connection parameter is configured, if the score value configuration ranges corresponding to each connection parameter are different, the sum of the score values of all the connection parameters of each candidate AP is directly determined as the total score value of the corresponding candidate AP; if the configuration range of the score value corresponding to each connection parameter is the same, the product of the score value of each connection parameter and the corresponding influence factor may be determined first, and then the sum of the products of all the connection parameters of the candidate AP is determined as the total score value of the corresponding candidate AP.
S404, determining a target AP from the candidate AP set based on the total score value of each candidate AP;
in general, the candidate AP with the highest total score value is determined as the target AP. It should be noted that step S403 and step S404 are actually an example of implementing step S203 or step S305 in the above-described embodiment.
S405, sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
The embodiment of the present application provides another method for reconnecting an AP, where the method is applied to a terminal, and the method includes steps S501 to S511:
s501, acquiring first sending times, wherein the first sending times are times of sending data to the candidate AP by the terminal in a preset time period;
s502, acquiring a first receiving frequency, wherein the first receiving frequency is the frequency of recording the data sent by the candidate AP received by the terminal in a preset time period;
s503, determining the first power forming rate based on the first sending times and the first receiving times;
it should be noted that the first sending times and the first receiving times are generally interaction information that has been recorded in advance by the terminal. When determining the first power contribution, these mutual information may be directly obtained, thereby determining the first power contribution. For example, a ratio of the first number of receptions to the first number of transmissions may be determined as the first power.
S504, obtaining a second sending frequency, wherein the second sending frequency is the frequency of sending a connection request to the candidate AP by the terminal in a preset time period;
s505, obtaining a second receiving frequency, wherein the second receiving frequency is the frequency of receiving the connection response sent by the candidate AP by the terminal in a preset time period;
s506, determining the second power based on the second sending times and the second receiving times;
similarly, the second sending times and the second receiving times are also interaction information that has been recorded in advance by the terminal. In determining the second power rating, such interaction information may be directly obtained to determine the second power rating. For example, the ratio of the second number of receptions to the second number of transmissions may be determined as the second power.
S507, saving the first power forming rate and the second power forming rate;
it should be noted that, in other embodiments, step S504 to step S506 may be executed first, and then step S501 to step S503 may be executed, wherein the execution sequence of step S504 and step S505 is not limited when step S504 to step S506 is executed; the execution order of step S501 and step S502 is not limited when step S501 to step S503 are executed. After the steps S501 to S507 are executed, the following steps S508 to S511 do not need to be executed immediately, and when the condition that the AP needs to be reconnected is satisfied, the steps S508 to S511 are started to be executed.
S508, if the AP needs to be reconnected, obtaining the numerical values of a plurality of connection parameters of each candidate AP in the scanned candidate AP set; wherein, the connection parameters at least include two of the following: the working frequency of the candidate AP, the received signal strength when the terminal receives the signal sent by the candidate AP, the data transmission speed of the candidate AP, the first power forming and the second power forming;
s509, converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
s510, determining a target AP from the candidate AP set based on the score value of each connection parameter of each candidate AP;
s511, sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
The embodiment of the present application provides another method for reconnecting an AP, where the method is applied to a terminal, and the method includes steps S601 to S608:
s601, if an attack message is received, forbidding to generate a disconnection notification, determining that the AP needs to be reconnected, and at the moment, entering the step S602; the attack message is used for blocking the connection between the terminal and the current service AP, the disconnection notification is used for notifying a user of the terminal, and the terminal and the current service AP are disconnected;
it should be noted that, in practical applications, after receiving the attack message, the procedure of generating the disconnection notification is not executed, but step S602 is directly executed, that is, the values of the at least two connection parameters of each candidate AP in the scanned candidate AP set are obtained.
Generally, the attack message is frequently sent, and particularly when the attack message is a Deauth packet, a large number of Deauth packets may cause the terminal to frequently drop, and at this time, if the terminal generates a disconnection notification after receiving the Deauth packet each time, and displays the disconnection notification on a screen of the terminal, the terminal may consume electric power of the terminal and may also affect a user sense corresponding to the terminal. Therefore, after the attack message is received, the disconnection notification is not generated for the moment, so that the power consumption of the terminal is saved, and the frequent interference to the user is avoided.
S602, obtaining values of at least two connection parameters of each candidate AP in the candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP;
s603, converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
s604, determining a target AP from the candidate AP set based on the score value of each connection parameter of each candidate AP;
s605, sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP;
s606, determining whether a connection response is received within a preset time length; if yes, go to step S607; otherwise, go to step S608; wherein the connection response is used for informing the terminal that the target AP and the terminal successfully establish the connection.
It can be understood that, if the connection response is not received within the preset time period, which indicates that the connection between the terminal and the target AP is failed, then step S608 is executed, that is, a disconnection notification is generated, and the disconnection notification is output to notify the user of the terminal that the terminal and the current serving AP are disconnected; if the connection response is received within the preset time length, the connection between the terminal and the target AP is successfully established, and the disconnection notice is not required to be generated and output, so that the power consumption of the terminal is saved.
S607, determining to successfully establish connection with the target AP;
s608, generating a disconnection notice, and outputting the disconnection notice to notify a user of the terminal that the terminal is disconnected from the current service AP.
It should be noted that the manner in which the terminal outputs the disconnection notification is not limited here, for example, the terminal may broadcast the disconnection notification by voice, and as shown in fig. 4, the terminal may further display a disconnection notification 401 on a current interface 40 of the terminal to notify a user of the terminal that the terminal is disconnected from the current service AP. It is understood that the current serving AP is an AP that is currently providing a connection service for the terminal.
In a complex environment, especially in an ESS network, due to interference or other reasons, an STA is easily sent an AP Deauth packet, so that a connection between the STA and a current serving AP is released. In a conventional scheme, an STA uploads a Deauth packet to a Kernel (Kernel), and the Kernel transmits the Deauth packet to a framework layer (i.e., an FWK layer) of the STA through a WiFi connection program (i.e., wpa _ notice), so that the STA presents a disconnection behavior (i.e., outputs a disconnection notification) on a User Interface (UI), which causes a problem that the STA immediately presents the disconnection behavior on the UI after receiving the Deauth packet, thereby consuming power consumption of the STA and making a User sense bad.
If the STA receives the Deauth packet, a WIFI driver layer (i.e., a WIFI driver layer) of the STA directly connects to a suitable target AP according to the previous connection record, so that the automatic connection recovery function can be completed. However, the key to the problem here is how to select a suitable target AP so that the connection link between the STA and the target AP is stable after the STA connects to the target AP.
Based on this, in the embodiment of the application, the WIFI driver layer of the STA does not directly upload the AP Deauth packet to the upper layer after receiving the AP Deauth packet, but searches for a suitable target AP in the WIFI driver layer and automatically initiates reconnection to complete the function of automatically recovering the connection. For example, after receiving the AP Deauth packet, the STA does not immediately send a disconnection notification to the kernel, but selects a suitable target AP from the AP scan list (i.e., the candidate AP set) according to a relevant condition to connect, and starts a timer at the same time; before the timer reaches the preset time length, if the STA successfully establishes connection with the target AP, the timer is cancelled; otherwise, if the STA still does not find a suitable target AP when the timer reaches the preset time length, or the STA fails to establish a connection with the target AP, reporting a disconnection notification to an upper layer.
It should be noted that, in other embodiments, a suitable target AP is selected from the AP scan list according to a relevant condition, a scoring mechanism may be generally adopted, and reference may be mainly made to whether the AP in the AP scan list is a 5G channel, RSSI, a transmission success rate of previously transmitted and received data (i.e., the first power generation rate in the above embodiment), a selection speed (i.e., the data transmission rate of the candidate AP in the above embodiment), and a connection success rate of the previous 3 times (i.e., the second power generation rate in the above embodiment); in the score values of the connection parameters, the score value of 5G > the score value of RSSI > the score value of transmission success rate, and the score value of speed > the score value of connection success rate is selected.
Based on the foregoing embodiments, the present application provides an apparatus for reconnecting an AP, where the apparatus includes modules included in the apparatus and units included in the modules, and the modules may be implemented by a processor in a terminal; of course, the implementation can also be realized through a specific logic circuit; in implementation, the processor may be a Central Processing Unit (CPU), a Microprocessor (MPU), a Digital Signal Processor (DSP), a Field Programmable Gate Array (FPGA), or the like.
Fig. 5 is a schematic structural diagram of an apparatus for reconnecting an AP according to an embodiment of the present application, and as shown in fig. 5, the apparatus 500 includes:
an obtaining module 501 configured to: if the AP needs to be reconnected, acquiring numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the apparatus 500 and the corresponding candidate AP;
a conversion module 502 configured to: converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
a first determining module 503 configured to: determining a target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP;
a sending module 504 configured to: and sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP.
In other embodiments, the apparatus 500 further comprises a loading module 505, and the loading module 505 is configured to: pre-loading a score mapping table corresponding to each connection parameter, wherein the score mapping table is used for recording a preset range to which the numerical value of the corresponding connection parameter belongs and a score value corresponding to the preset range; correspondingly, the conversion module 502 is configured to: determining a target range to which each connection parameter of each candidate AP belongs from a corresponding score mapping table based on the value of the value; based on the target range, a score value of the corresponding connection parameter is determined from the corresponding score mapping table.
In other embodiments, the first determination module 503 is configured to: determining a total score value of the corresponding candidate AP based on the score value of each connection parameter of each candidate AP; determining a target AP from the set of candidate APs based on a total score value for each of the candidate APs.
In other embodiments, the connection parameters include at least two of: the working frequency of the candidate AP, the received signal strength when the apparatus 500 receives the signal sent by the candidate AP, the first power consumption for transmitting data between the apparatus 500 and the candidate AP, the data transmission speed of the candidate AP, and the second power consumption for connecting the apparatus 500 to the candidate AP;
correspondingly, the score value of the working frequency is more than or equal to the score value of the received signal strength and more than or equal to the score value of the first power component and more than or equal to the score value of the data transmission speed and more than or equal to the score value of the second power component.
In other embodiments, the apparatus 500 further comprises a first obtaining module 506 and a second determining module 507; wherein,
a first obtaining module 506 configured to: acquiring a first sending frequency, where the first sending frequency is a frequency of sending data to the candidate AP by the apparatus 500 within a preset time period;
a first obtaining module 506, further configured to: acquiring a first receiving frequency, where the first receiving frequency is the frequency of recording the data sent by the candidate AP and received by the device 500 within a preset time period;
a second determination module 507 configured to: determining the first power generation rate based on the first transmission times and the first reception times.
In other embodiments, the apparatus 500 further comprises a second obtaining module 508 and a third determining module 509; wherein,
a second obtaining module 508 configured to: acquiring a second sending frequency, where the second sending frequency is the frequency of sending a connection request to the candidate AP by the device 500 in a preset time period;
a second obtaining module 508, further configured to: acquiring a second receiving frequency, where the second receiving frequency is a frequency of receiving, by the apparatus 500, a connection response sent by the candidate AP within a preset time period;
a third determining module 509 configured to: determining the second power based on the second number of transmissions and the second number of receptions.
In other embodiments, the first determining module 503 is further configured to: if the attack message is received, determining that the AP needs to be reconnected; the attack message is used to block the connection between the device 500 and the current serving AP.
In other embodiments, the apparatus 500 further comprises a disabling module 510, the disabling module 510 configured to: and if the attack message is received, forbidding generating a disconnection notice, wherein the disconnection notice is used for informing the user of the device 500 that the device 500 is disconnected from the current service AP.
In other embodiments, the apparatus 500 further comprises:
a generating module 511 configured to: if a connection response is not received within a preset time length, generating a disconnection notification, where the connection response is used to notify the device 500 that the target AP and the device 500 successfully establish a connection;
an output module 512 configured to: the disconnect notification is output to notify a user of the device 500 that the device 500 has disconnected from the currently serving AP.
The above description of the apparatus embodiments, similar to the above description of the method embodiments, has similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be noted that, in the embodiment of the present application, if the method for reconnecting an AP is implemented in the form of a software functional module and is sold or used as a standalone product, it may also be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially embodied in the form of a software product, which is stored in a storage medium and includes several instructions to enable a terminal (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read Only Memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
Correspondingly, an embodiment of the present application provides a terminal, fig. 6 is a schematic diagram of a hardware entity of the terminal according to the embodiment of the present application, and as shown in fig. 6, the hardware entity of the terminal 600 includes: comprising a memory 601 and a processor 602, said memory 601 storing a computer program operable on the processor 602, said processor 602 implementing the steps in the method of reconnecting an AP provided in the above embodiments when executing said program.
The Memory 601 is configured to store instructions and applications executable by the processor 602, and may also buffer data (e.g., image data, audio data, voice communication data, and video communication data) to be processed or already processed by the processor 602 and modules in the terminal 600, and may be implemented by a FLASH Memory (FLASH) or a Random Access Memory (RAM).
Correspondingly, the present application provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps in the method for reconnecting an AP provided in the above embodiments.
Here, it should be noted that: the above description of the storage medium and device embodiments is similar to the description of the method embodiments above, with similar advantageous effects as the method embodiments. For technical details not disclosed in the embodiments of the storage medium and apparatus of the present application, reference is made to the description of the embodiments of the method of the present application for understanding.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in the various embodiments of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
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, method, article, or apparatus 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, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units; can be located in one place or distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for realizing the method embodiments can be completed by hardware related to program instructions, the program can be stored in a computer readable storage medium, and the program executes the steps comprising the method embodiments when executed; and the aforementioned storage medium includes: various media that can store program codes, such as a removable Memory device, a Read Only Memory (ROM), a magnetic disk, or an optical disk.
Alternatively, the integrated units described above in the present application may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as independent products. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially embodied in the form of a software product stored in a storage medium, and include instructions for enabling a terminal (which may be a personal computer, a server, or a network device, and may also be a mobile phone, a tablet computer, a desktop computer, a personal digital assistant, a navigator, a digital phone, a video phone, a television, a sensing device, and the like) to execute all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, a ROM, a magnetic or optical disk, or other various media that can store program code.
The above description is only for the embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (9)
1. A method for reconnecting an Access Point (AP), the method being applied to a terminal, the method comprising:
if the AP needs to be reconnected, acquiring numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the terminal and the corresponding candidate AP;
converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
the connection parameters at least include two of the following: the working frequency of the candidate AP, the received signal strength when the terminal receives the signal sent by the candidate AP, the first power forming rate of data transmission between the terminal and the candidate AP, the data transmission speed of the candidate AP and the second power forming rate of the terminal connected with the candidate AP; wherein, in case the connection parameters include the operating frequency and the received signal strength, the connection parameters further include at least one of: the first power component, the data transmission speed, and the second power component; the score value of the working frequency is more than or equal to the score value of the received signal strength and more than or equal to the score value of the first power generation rate and more than or equal to the score value of the second power generation rate;
determining a target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP;
sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP;
before obtaining values of at least two connection parameters of each candidate AP in the scanned candidate AP set, the method further includes:
if the attack message is received, determining that the AP needs to be reconnected, and forbidding generating a disconnection notice; wherein the attack message is used for blocking the connection between the terminal and the current service AP; the disconnection notification is used for notifying a user of the terminal that the terminal is disconnected from the current service AP.
2. The method of claim 1, further comprising:
pre-loading a score mapping table corresponding to each connection parameter, wherein the score mapping table is used for recording a preset range to which the numerical value of the corresponding connection parameter belongs and a score value corresponding to the preset range; in a corresponding manner, the first and second electrodes are,
converting the value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule, including:
determining a target range to which each connection parameter of each candidate AP belongs from a corresponding score mapping table based on the value of the value;
based on the target range, a score value of the corresponding connection parameter is determined from the corresponding score mapping table.
3. The method of claim 1, wherein the determining the target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP comprises:
determining a total score value of the corresponding candidate AP based on the score value of each connection parameter of each candidate AP;
determining a target AP from the set of candidate APs based on a total score value for each of the candidate APs.
4. The method of claim 1, further comprising:
acquiring first sending times, wherein the first sending times are times of sending data to the candidate AP by the terminal within a preset time period;
acquiring first receiving times, wherein the first receiving times are times of recording data sent by the candidate AP received by the terminal in a preset time period;
determining the first power generation rate based on the first transmission times and the first reception times.
5. The method of claim 1, further comprising:
acquiring second sending times, wherein the second sending times are the times of sending a connection request to the candidate AP by the terminal in a preset time period;
acquiring second receiving times, wherein the second receiving times are the times of receiving the connection response sent by the candidate AP by the terminal in a preset time period;
determining the second power based on the second number of transmissions and the second number of receptions.
6. The method of claim 1, wherein after sending the connection request to the target AP, the method further comprises:
if a connection response is not received within a preset time length, generating a disconnection notification, wherein the connection response is used for notifying the terminal that the target AP and the terminal are successfully connected;
outputting the disconnection notification to notify a user of the terminal that the terminal is disconnected from the current serving AP.
7. An apparatus for reconnecting an Access Point (AP), comprising:
an acquisition module configured to: if the AP needs to be reconnected, acquiring numerical values of at least two connection parameters of each candidate AP in a candidate AP set obtained by scanning; the connection parameters are parameters that affect the stability of the connection between the device and the corresponding candidate AP;
a conversion module configured to: converting the numerical value of each connection parameter of each candidate AP into a corresponding score value according to a corresponding conversion rule;
the connection parameters at least include two of the following: the working frequency of the candidate AP, the received signal strength when the device receives the signal sent by the candidate AP, the first power forming rate of data transmission between the device and the candidate AP, the data transmission speed of the candidate AP and the second power forming rate of connection between the device and the candidate AP; wherein, in case the connection parameters include the operating frequency and the received signal strength, the connection parameters further include at least one of: the first power component, the data transmission speed, and the second power component; the score value of the working frequency is more than or equal to the score value of the received signal strength and more than or equal to the score value of the first power generation rate and more than or equal to the score value of the second power generation rate;
a first determination module configured to: determining a target AP from the set of candidate APs based on the score value of each connection parameter of each candidate AP;
the first determination module is further configured to: if an attack message is received, determining that the AP needs to be reconnected, wherein the attack message is used for blocking the connection between the device and the current service AP;
a sending module configured to: sending a connection request to the target AP, wherein the connection request is used for requesting to establish connection with the target AP;
a disabling module configured to: before obtaining the values of at least two connection parameters of each candidate AP in the scanned candidate AP set, if the attack message is received, the forbidding module forbids to generate a disconnection notice; the outage notification is used to notify a user of the device that the device has disconnected from the current serving AP.
8. A terminal comprising a memory and a processor, the memory storing a computer program operable on the processor, wherein the processor when executing the program performs the steps in the method of reconnecting an AP of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of reconnecting an AP according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910032986.3A CN109618421B (en) | 2019-01-14 | 2019-01-14 | Method and device for reconnecting AP, terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910032986.3A CN109618421B (en) | 2019-01-14 | 2019-01-14 | Method and device for reconnecting AP, terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109618421A CN109618421A (en) | 2019-04-12 |
CN109618421B true CN109618421B (en) | 2021-04-30 |
Family
ID=66018756
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910032986.3A Active CN109618421B (en) | 2019-01-14 | 2019-01-14 | Method and device for reconnecting AP, terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109618421B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110290563A (en) * | 2019-05-28 | 2019-09-27 | 菜鸟智能物流控股有限公司 | Wireless access switching method, device and system and electronic equipment |
CN112672385A (en) * | 2019-09-30 | 2021-04-16 | 广州慧睿思通科技股份有限公司 | Device connection method, device, storage medium and device |
CN113163407A (en) * | 2021-05-24 | 2021-07-23 | 青岛中科英泰商用系统股份有限公司 | Android device-based wifi communication security defense method and device |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101022342A (en) * | 2007-03-19 | 2007-08-22 | 杭州华为三康技术有限公司 | Attack information processing method and device |
CN101594695A (en) * | 2008-05-30 | 2009-12-02 | 富士通株式会社 | Wireless communication system, radio communication device, its method for disconnection process, storage medium |
CN103874097A (en) * | 2014-01-26 | 2014-06-18 | 上海自仪泰雷兹交通自动化系统有限公司 | CBTC (communication based train control system) wireless communication system and method |
KR101447469B1 (en) * | 2013-12-31 | 2014-10-06 | 한국정보보호시스템(주) | System and method of wireless intrusion prevention and wireless service |
CN105307224A (en) * | 2014-06-19 | 2016-02-03 | 中国移动通信集团公司 | Method and device for intelligently switching terminal between access points and terminal |
CN105491632A (en) * | 2016-01-15 | 2016-04-13 | 北京小米移动软件有限公司 | Wireless access point switching method and wireless access point switching device |
CN106658484A (en) * | 2016-11-15 | 2017-05-10 | 乐视控股(北京)有限公司 | Method for preventing wireless network attacks, terminal and wireless access point |
CN107241782A (en) * | 2017-06-16 | 2017-10-10 | 广东欧珀移动通信有限公司 | Method for network access, mobile terminal and computer-readable recording medium |
CN107920359A (en) * | 2017-07-01 | 2018-04-17 | 宇龙计算机通信科技(深圳)有限公司 | Connection method, device and the user terminal of wireless access points |
CN108055690A (en) * | 2017-10-31 | 2018-05-18 | 深圳平安讯科技术有限公司 | Wi-Fi hotspot recommends method, application server and computer readable storage medium |
CN109040958A (en) * | 2018-08-16 | 2018-12-18 | Oppo广东移动通信有限公司 | Method for connecting network, device, electronic equipment and computer readable storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10159039B2 (en) * | 2017-04-19 | 2018-12-18 | Fortinet, Inc. | Steering wireless local area network (WLAN) clients |
-
2019
- 2019-01-14 CN CN201910032986.3A patent/CN109618421B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101022342A (en) * | 2007-03-19 | 2007-08-22 | 杭州华为三康技术有限公司 | Attack information processing method and device |
CN101594695A (en) * | 2008-05-30 | 2009-12-02 | 富士通株式会社 | Wireless communication system, radio communication device, its method for disconnection process, storage medium |
KR101447469B1 (en) * | 2013-12-31 | 2014-10-06 | 한국정보보호시스템(주) | System and method of wireless intrusion prevention and wireless service |
CN103874097A (en) * | 2014-01-26 | 2014-06-18 | 上海自仪泰雷兹交通自动化系统有限公司 | CBTC (communication based train control system) wireless communication system and method |
CN105307224A (en) * | 2014-06-19 | 2016-02-03 | 中国移动通信集团公司 | Method and device for intelligently switching terminal between access points and terminal |
CN105491632A (en) * | 2016-01-15 | 2016-04-13 | 北京小米移动软件有限公司 | Wireless access point switching method and wireless access point switching device |
CN106658484A (en) * | 2016-11-15 | 2017-05-10 | 乐视控股(北京)有限公司 | Method for preventing wireless network attacks, terminal and wireless access point |
CN107241782A (en) * | 2017-06-16 | 2017-10-10 | 广东欧珀移动通信有限公司 | Method for network access, mobile terminal and computer-readable recording medium |
CN107920359A (en) * | 2017-07-01 | 2018-04-17 | 宇龙计算机通信科技(深圳)有限公司 | Connection method, device and the user terminal of wireless access points |
CN108055690A (en) * | 2017-10-31 | 2018-05-18 | 深圳平安讯科技术有限公司 | Wi-Fi hotspot recommends method, application server and computer readable storage medium |
CN109040958A (en) * | 2018-08-16 | 2018-12-18 | Oppo广东移动通信有限公司 | Method for connecting network, device, electronic equipment and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109618421A (en) | 2019-04-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10314098B2 (en) | Method and apparatus for connecting short-range wireless communication in terminal | |
CN107360635B (en) | Data transmission method, device, terminal and computer readable storage medium | |
US8478273B2 (en) | Method and apparatus for intelligently reporting neighbor information to facilitate automatic neighbor relations | |
CN109618421B (en) | Method and device for reconnecting AP, terminal and storage medium | |
US11178624B2 (en) | Method of adjusting transmission power of terminal, mobile terminal, and storage device | |
US10681200B2 (en) | Message processing method and system, and related device | |
EP3860305A1 (en) | Mobile terminal, display apparatus and control method thereof | |
JP2023527843A (en) | Cell reselection method, cell reselection device and storage medium | |
WO2021238404A1 (en) | Data card switching method and apparatus, and terminal, and storage medium | |
US20170195626A1 (en) | Method for smart television audio and video communication | |
US20170094703A1 (en) | Communication apparatus, control method thereof and storage medium | |
CN105704106B (en) | A kind of visualization IVR implementation method and mobile terminal | |
CN111083764B (en) | Device control method, device, storage medium and electronic device | |
CN109195226B (en) | Data transmission method and device, electronic equipment and computer readable storage medium | |
US20070249385A1 (en) | Information Terminal Device | |
CN101119593A (en) | Apparatus and method for ccbs service in mobile communication system | |
CN113767683B (en) | Beam management method and device, communication equipment and storage medium | |
CN115515254A (en) | Point-to-point connection establishing method and device, storage medium and electronic equipment | |
KR101665184B1 (en) | Communication Proxy System, Communication Terminal and Communication Method, Communication Proxy Terminal and Proxy Method, Communication Relay Terminal and Relay Method | |
CN113068193B (en) | Information processing method, device and equipment and storage medium | |
US8351381B1 (en) | System and method for switching from a first radio link to a second radio link for sending or receiving a message via the second radio link | |
US9031542B2 (en) | Mobile terminal for multi-party call and multi-party call method | |
CN111698571B (en) | Public network mirroring method, terminal and computer readable storage medium | |
CN117376847A (en) | Method and device for sending equipment information, electronic equipment and storage medium | |
JP2015213266A (en) | Communication carrier proposing server, communication carrier selection terminal, communication carrier proposing method and communication carrier proposing program |
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 |