Disclosure of Invention
The present disclosure aims to solve, at least to some extent, one of the technical problems in the related art.
An embodiment of a first aspect of the present disclosure provides a method for determining a wireless network, which is applied to a terminal device, including:
receiving network parameters sent by network equipment of each wireless network in a non-connection state currently;
Determining a reference network rate of each wireless network according to a preset received signal strength threshold and each first parameter in the network parameters;
and determining the current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters.
Optionally, after the determining the current target wireless network, the method further includes:
Controlling the terminal equipment to be connected with the target wireless network under the condition that the terminal equipment is not connected with any wireless network;
Or alternatively
And under the condition that the network rate of the wireless network currently connected with the terminal equipment is smaller than the reference network rate of the target wireless network, controlling the terminal equipment to disconnect the wireless network currently connected with the terminal equipment and connect with the target wireless network.
Optionally, after said determining the reference network rate of each of the wireless networks, further comprises:
And displaying each wireless network and the corresponding reference network rate on a display interface according to the sequence of the reference network rate from high to low.
Optionally, after displaying each wireless network and the corresponding reference network rate on the display interface according to the order of the reference network rates from high to low, the method further includes:
Under the condition that the wireless network is in a connection state with any wireless network, determining the actual network rate of any wireless network according to the data volume of the data transmitted by the terminal equipment in a preset period;
And updating the reference network rate corresponding to any wireless network in a display interface based on the actual network rate of any wireless network.
Optionally, the determining the reference network rate of each wireless network according to the preset received signal strength threshold and each first parameter of the network parameters includes:
Determining a target transmission rate according to the uplink transmission rate and the downlink transmission rate in the first parameter;
and determining the reference network rate of each wireless network according to a preset received signal strength threshold, the target transmission rate, the total bandwidth in the first parameter, the residual available bandwidth and the received signal strength.
Optionally, the determining the current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters includes:
Determining a score corresponding to the wireless network according to a first weight corresponding to the reference network rate and a second weight corresponding to each second parameter;
And determining the current target wireless network according to the corresponding score of each wireless network.
Optionally, the receiving the network parameter sent by the network device of each wireless network currently in the non-connected state includes:
Receiving a broadcast data packet corresponding to each wireless network in a non-connection state, wherein the data packet comprises network parameters of the wireless network;
And analyzing each data packet to determine the network parameters of each wireless network.
Optionally, the receiving the network parameter sent by the network device of each wireless network currently in the non-connected state includes:
Transmitting a probe request frame to each wireless network currently in a non-connected state;
receiving a detection response frame returned by the network equipment of each wireless network;
And analyzing each detection response frame to determine network parameters of each wireless network.
Optionally, the sending the probe request frame to each wireless network currently in the non-connection state includes:
And in the case that the network rate of the wireless network currently in the connected state is smaller than the threshold value, transmitting a probe request frame to each wireless network currently in the disconnected state.
An embodiment of a second aspect of the present disclosure provides a method for determining a wireless network, applied to a network device, including:
Determining network parameters of the wireless network;
And sending the network parameters to a terminal device, so that the terminal device determines a reference network rate of the wireless network according to the received network parameters, and determines a target wireless network according to the reference network rate and the network parameters.
Optionally, before the sending the network parameter to the terminal device, the method further includes:
Receiving a detection request frame sent by terminal equipment;
the sending the network parameters to the terminal device includes:
and sending the network parameters to the terminal equipment through the detection response frame.
An embodiment of a third aspect of the present disclosure provides a determining apparatus of a wireless network, configured on a terminal device side, including:
The receiving module is used for receiving network parameters sent by the network equipment of each wireless network in a non-connection state currently;
The first determining module is used for determining the reference network rate of each wireless network according to a preset received signal strength threshold value and each first parameter in the network parameters;
and the second determining module is used for determining the current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters.
Optionally, the method further comprises:
And the display module is used for displaying each wireless network and the corresponding reference network rate on the display interface according to the sequence of the reference network rate from high to low.
Optionally, the method further comprises:
A third determining module, configured to determine, when the third determining module is in a connection state with any wireless network, an actual network rate of the any wireless network according to a data amount of data transmitted by the terminal device in a preset period of time;
and the updating module is used for updating the reference network rate corresponding to any wireless network in the display interface based on the actual network rate of any wireless network.
Optionally, the device further comprises a connection module for:
Controlling the terminal equipment to be connected with the target wireless network under the condition that the terminal equipment is not connected with any wireless network;
Or alternatively
And under the condition that the network rate of the wireless network currently connected with the terminal equipment is smaller than the reference network rate of the target wireless network, controlling the terminal equipment to disconnect the wireless network currently connected with the terminal equipment and connect with the target wireless network.
An embodiment of a fourth aspect of the present disclosure provides a determining apparatus of a wireless network, configured on a network device side, including:
a determining module for determining network parameters of the wireless network;
And the sending module is used for sending the network parameters to the terminal equipment, so that the terminal equipment determines the reference network rate of the wireless network according to the received network parameters, and determines the target wireless network according to the reference network rate and the network parameters.
An embodiment of a fifth aspect of the present disclosure proposes an electronic device, including a processor, and a memory for storing executable instructions of the processor, where the processor is configured to invoke and execute the executable instructions stored in the memory, to implement the method for determining a wireless network according to the embodiment of the first aspect of the present disclosure, or implement the method for determining a wireless network according to the embodiment of the second aspect of the present disclosure.
An embodiment of a sixth aspect of the present disclosure proposes a non-transitory computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method for determining a wireless network proposed by the embodiment of the first aspect of the present disclosure, or to perform the method for determining a wireless network proposed by the embodiment of the second aspect of the present disclosure.
An embodiment of a seventh aspect of the present disclosure proposes a computer program product, which when executed by a processor of an electronic device, enables the electronic device to perform the method for determining a wireless network proposed by the embodiment of the first aspect of the present disclosure, or to perform the method for determining a wireless network proposed by the embodiment of the second aspect of the present disclosure.
The method, the device, the electronic equipment and the storage medium for determining the wireless network can firstly receive the network parameters sent by the network equipment of each wireless network in the non-connection state, then determine the reference network rate of each wireless network according to the preset received signal strength threshold and each first parameter in the network parameters, and then determine the current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters. Therefore, the terminal equipment can firstly determine the corresponding reference network rate based on the first parameter in the network parameters of the wireless network, then determine the target wireless network with better network quality based on the second parameter in the reference network rate and the network parameters, thereby improving the accuracy of determining the target wireless network, avoiding the process of determining the target wireless network by multiple attempts, saving time and improving efficiency.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the disclosure.
Detailed Description
Embodiments of the present disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and intended for the purpose of explaining the present disclosure and are not to be construed as limiting the present disclosure.
The following describes a method, an apparatus, an electronic device, and a storage medium for determining a wireless network according to an embodiment of the present disclosure with reference to the accompanying drawings.
The method for determining a wireless network according to the embodiments of the present disclosure may be performed by the apparatus for determining a wireless network according to the embodiments of the present disclosure, where the apparatus may be configured in an electronic device.
Fig. 1 is a flowchart of a method for determining a wireless network according to an embodiment of the present disclosure, where the method may be performed by a terminal device.
As shown in fig. 1, the method for determining a wireless network may include the steps of:
step 101, receiving network parameters of each wireless network currently in a non-connection state.
The wireless network in the non-connection state may be any unconnected wireless network from a searchable range of the terminal device, and the disclosure is not limited thereto.
In addition, the network parameter may be various, for example, may be a parameter that may be used to characterize the performance of the wireless network, for example, may be an uplink transmission rate (tx speed), a downlink transmission rate (rx speed), a total bandwidth (bandwidth), a remaining available bandwidth (remainingbandwidth), or the like of the wireless network, or may be another parameter that is irrelevant to the performance of the network, for example, may be an encryption manner, a received signal strength (RECEIVED SIGNAL STRENGTH indicato, RSSI), or the like of the wireless network, that is, the network parameter may include at least one of an uplink rate, a downlink rate, a total bandwidth, a remaining available bandwidth, and a received signal strength, which is not limited in the disclosure.
It may be understood that the network parameter received by the terminal device may be determined by the network device of the wireless network after the wireless network is measured, and then the network device may send the determined network parameter of the wireless network to the terminal device. The network device may periodically broadcast the measured network parameters to the terminal device, or may send the determined network parameters to the terminal device through a probe response frame after receiving a probe request frame sent by the terminal device, which is not limited in this disclosure.
Step 102, determining a reference network rate of each wireless network according to a preset received signal strength threshold and each first parameter of network parameters.
The first parameter of the network parameters may be one or more, which is not limited in this disclosure.
For example, the first parameter in the network parameters may be one or more of an uplink transmission rate, a downlink transmission rate, a total bandwidth, a remaining available bandwidth, and a received signal strength, which is not limited in the present disclosure.
It can be appreciated that after network parameters of the wireless network in the non-connected state are obtained, a reference network rate of the wireless network can be determined according to attenuation of signal strength to network quality.
Alternatively, the target transmission rate may be determined according to the uplink transmission rate and the downlink transmission rate in the network parameters, and then the reference network rate of each wireless network may be determined according to the preset received signal strength threshold, the target transmission rate, the total bandwidth in the network parameters, the remaining available bandwidth, and the received signal strength.
For example, the uplink transmission rate and the downlink transmission rate in the network parameters may be compared first, and the maximum value of the two may be determined as the target transmission rate. For example, if the uplink transmission rate in the network parameter is 2 megabits per second (megabits per second, M/s) and the downlink transmission rate is 0.8M/s, the uplink transmission rate "2M/s" can be determined as the target transmission rate. The present disclosure is not limited in this regard.
For example, if the first parameters in the network parameters are the uplink transmission rate and the downlink transmission rate, the total bandwidth, the remaining available bandwidth, and the received signal strength, the target transmission rate may be determined according to the uplink transmission rate and the downlink transmission rate in the network parameters, and then the reference network rate of each wireless network may be determined according to the preset received signal strength threshold, the target transmission rate, the total bandwidth, the remaining available bandwidth, and the received signal strength in the network parameters. The above procedure may be characterized using a relationship as shown in the following equation (1), and the reference network rate of the wireless network may be expressed as:
Wherein PREDICT SPEED is a reference network rate of the wireless network, tx speed is an uplink transmission rate of the wireless network, rx speed is a downlink transmission rate of the wireless network, bandwidth is a total bandwidth of the wireless network, REMAINING BANDWIDTH is a remaining available bandwidth of the wireless network, RSSI is a received signal strength of the wireless network, and RSSI max is a preset received signal strength threshold.
It is to be understood that the value of the RSSI max may be set in advance according to a communication standard or protocol, or may be adjusted according to an actual communication situation, which is not limited in this disclosure.
It should be noted that the foregoing examples are only illustrative, and are not intended to limit the manner in which the reference network rate of the wireless network is determined in the embodiments of the present disclosure.
Step 103, determining the current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters.
The second parameter in the network parameter may be one or more, for example, may be one or more of a received signal strength, an encryption manner of the wireless network, an uplink rate of the link layer, a downlink rate, and the like, which is not limited in the disclosure.
Optionally, a second parameter of the network parameters, which is a first parameter of the network parameters, may or may not be a partially overlapping parameter, i.e. the first parameter does not fully overlap with the second parameter. For example, each first parameter in the network parameters can be uplink transmission rate, downlink transmission rate and received signal strength, and each second parameter in the network parameters can be encryption mode and received signal strength of the wireless network. The present disclosure is not limited in this regard.
For example, if the reference network rate of the wireless network 1 currently in the non-connected state is 2.5M/s, the reference network rate of the wireless network 2 is 2.45M/s, the received signal strength of the wireless network 1 is smaller than the received signal strength of the wireless network 2, the encryption mode of the wireless network 1 is wireless fidelity (WIRELESS FIDELITY, wiFi) protected access (WiFi protected access, WPA), and the encryption mode of the wireless network 2 is effective equivalent privacy (wired equivalent privacy, WEP). Because the cracking difficulty of the WPA is higher than that of the WEP, the received signal strength of the wireless network 2 is higher than that of the wireless network 1, the reference network rate of the wireless network 1 is 2.5M/s, and the reference network rate of the wireless network 2 is 2.45M/s, the wireless network 2 can be determined as the current target wireless network.
It should be noted that the above examples are only illustrative, and should not be taken as limiting the reference network rate, the second parameter among the network parameters, etc. in the embodiments of the present disclosure.
It can be understood that in the process of determining the target wireless network, the reference network rate and each second parameter of each wireless network are fully considered, so that the determined network quality of the target wireless network is better, the accuracy and reliability of determining the target wireless network are improved, and the time consumption for determining the wireless network is saved. Optionally, when determining the current target wireless network, the terminal device can be controlled to be connected to the target wireless network, so that the terminal device can be ensured to be connected to a wireless network with better network quality, and the quality of network communication performed by the terminal device is further improved.
According to the embodiment of the disclosure, the network parameters sent by the network device of each wireless network in the non-connection state can be received first, then the reference network rate of each wireless network can be determined according to the preset received signal strength threshold and each first parameter in the network parameters, and then the current target wireless network can be determined according to the reference network rate of each wireless network and each second parameter in the network parameters. Therefore, the terminal equipment can firstly determine the corresponding reference network rate based on the first parameter in the network parameters of the wireless network, then determine the target wireless network with better network quality based on the second parameter in the reference network rate and the network parameters, thereby improving the accuracy of determining the target wireless network, avoiding the process of determining the target wireless network by multiple attempts, saving time and improving efficiency.
Fig. 2 is a flowchart of a method for determining a wireless network according to an embodiment of the present disclosure, where the method may be performed by a terminal device. As shown in fig. 2, the method for determining a wireless network may include the steps of:
Step 201, receiving a broadcast data packet corresponding to each wireless network currently in a non-connection state, where the data packet includes network parameters of the wireless network.
Wherein the network parameters may include parameters for characterizing network performance.
Optionally, the network device of the wireless network may periodically broadcast the network parameters, so that the terminal device may monitor each wireless network currently in the non-connected state to obtain the broadcasted data packet corresponding to the wireless network.
The type of the data packet may be configured for the network device, or may also be pre-agreed for the network device and the terminal device, for example, may be a beacon frame, or may also be other types of data packets, etc., which is not limited in this disclosure.
For example, in the case where the data packet including the network parameters of the wireless network is a beacon frame, if the terminal device determines that the wireless network currently in the non-connection state is the wireless network 1, the wireless network 2, and the wireless network 3, respectively. The terminal device may then listen to wireless network 1, wireless network 2 and wireless network 3 to obtain beacon frame 1 broadcast by wireless network 1, beacon frame 2 broadcast by wireless network 2 and beacon frame 3 broadcast by wireless network 3.
The above examples are only illustrative, and should not be construed as limiting the wireless network, the data packet, and the like in the embodiments of the present disclosure.
Step 202, parse each data packet to determine network parameters of each wireless network.
Optionally, the network device and the terminal device may agree in advance to add a field to the data packet to characterize the network parameters of the wireless network. Therefore, after receiving the data packet broadcast by the wireless network, the terminal equipment can determine the network parameters corresponding to the wireless network by analyzing the newly added field.
For example, if the data packet is a beacon frame, it has been agreed that the newly added field in the beacon frame is used to characterize the network parameters of the wireless network. If the terminal device listens to the beacon frame of the wireless network 1 currently in the non-connection state, then the newly added field in the beacon frame may be parsed to determine the network parameters of the wireless network 1, and so on. The present disclosure is not limited in this regard.
Step 203, determining a reference network rate of each wireless network according to the preset received signal strength threshold and each first parameter of the network parameters.
It should be noted that, the specific content and implementation manner of step 203 may refer to the descriptions of other embodiments of the disclosure, and are not repeated herein.
And 204, displaying each wireless network and the corresponding reference network rate on the display interface according to the sequence of the reference network rate from high to low.
For example, the reference network rate of the wireless network 1"AAA" is 1.5M/s, the reference network rate of the wireless network 2"BBB" is 2.1M/s, the reference network rate of the wireless network 3"CCC" is 0.6M/s, the wireless network 2"BBB", 2.1M/s, the wireless network 1"AAA", 1.5M/s, the wireless network 3"CCC", 0.6M/s, the respective wireless network and the reference network rate are displayed on the display interface in the order of the reference network rate from high to low, and the schematic diagram of the display interface can be as shown in FIG. 2A
It should be noted that the foregoing examples are only illustrative, and should not be taken as limiting the wireless network and the reference network rates and the like in the embodiments of the present disclosure.
It can be understood that the wireless network and the reference network rate are displayed, so that the network quality of each wireless network can be clearly and intuitively known, the user can switch and select the wireless network independently, the efficiency and accuracy of switching the wireless network are improved, the user time is saved, and the user experience is improved.
Step 205, determining the current target wireless network according to the reference network rate and the second parameters of the network parameters of each wireless network.
It should be noted that, for the specific content and implementation of step 205, reference may be made to the descriptions of other embodiments of the present disclosure, and details are not repeated here.
Optionally, when the wireless network is in a connection state with any wireless network, the actual network rate of any wireless network may be determined according to the data amount of the data transmitted by the terminal device in the preset period, and then the reference network rate corresponding to any wireless network may be updated in the display interface based on the actual network rate of any wireless network.
The preset period may be a duration set in advance, for example, may be 60 seconds, 300 seconds, or the like, which is not limited in the present disclosure.
It can be understood that after the terminal device is successfully connected with any wireless network, the reference network rate can be updated according to the actual network rate of the wireless network, so that the network rate displayed by the display interface is more accurate and reliable.
For example, if the data amount of the terminal device in the preset period T is N in the case where the terminal device is in a connection state with any wireless network "WWW", the actual network rate of any wireless network "WWW" may be expressed as v=n/T. The reference network rate corresponding to any wireless network "WWW" in the display interface may then be updated to v. If v is 3.3M/s, the updated display interface diagram may be as shown in FIG. 2B. As can be seen from FIG. 2B, the network rate of the currently connected wireless network "WWW" is 3.3M/s, the reference network rate of the nearby wireless network "BBB" in the disconnected state is 1.5M/s, and the reference network rate of the wireless network "CCC" is 0.6M/s.
It should be noted that the above examples are only illustrative, and should not be taken as limiting the manner in which the actual network rate of the wireless network is determined in the embodiments of the present disclosure.
According to the embodiment of the disclosure, the broadcasted data packet corresponding to each wireless network in the non-connection state can be acquired first, then each data packet can be analyzed to determine the network parameter of each wireless network, then the reference network rate of each wireless network is determined according to the preset received signal strength threshold and each first parameter in the network parameters, and then each wireless network and the corresponding reference network rate can be displayed on the display interface according to the sequence of the reference network rate from high to low. Therefore, the network parameters of each wireless network can be determined by analyzing the received data packet, then the reference network rate corresponding to the wireless network can be determined according to the first parameter of the network parameters, and each wireless network is displayed based on the reference network rate, namely, in the process of determining the target wireless network, the network state of the wireless network is fully considered, and then the target wireless network with better network quality can be determined, so that the accuracy of determining the target wireless network is improved, the process of determining the target wireless network by multiple attempts is avoided, the time is saved, and the efficiency is improved.
Fig. 3 is a flowchart of a method for determining a wireless network according to an embodiment of the present disclosure, where the method may be performed by a terminal device. As shown in fig. 3, the method for determining a wireless network may include the steps of:
step 301, a probe request frame is sent to each wireless network currently in a non-connected state.
The terminal device may periodically send a probe request frame (probe request) to the network device of each wireless network currently in the non-connected state, or may send a probe request frame to the network device of each wireless network currently in the non-connected state, or the like, as required, which is not limited in the present disclosure.
For example, the terminal device may send probe request frames in its supported channel list at set periods to scan for wireless networks. Or in case the terminal device configures a wireless network to be connected or has successfully connected to a certain wireless network, a probe request frame may be sent to actively scan a designated wireless network, etc., which is not limited in the present disclosure.
Optionally, in a case that the network rate of the wireless network currently in the connected state is less than the threshold, a probe request frame is sent to each wireless network currently in the disconnected state.
The threshold may be a value set in advance, for example, may be 3.5M/s, 5M/s, or the like, which is not limited in this disclosure.
For example, the threshold is 2M/s, the terminal device is successfully connected to the wireless network 1, the network rate of the wireless network 1 is 0.65M/s, which is less than the threshold 2M/s, and the network quality of the wireless network 1 may be considered to be poor, and at this time, a probe request frame may be sent to each wireless network currently in a non-connected state. For example, the wireless network 2 is currently in a non-connected state, a probe request frame may be sent to a network device of the wireless network 2, and so on.
It should be noted that the above examples are only illustrative, and should not be taken as limiting the threshold values, network rates, wireless networks, etc. in the embodiments of the present disclosure.
Step 302, a probe response frame returned by a network device of each wireless network is received.
It will be appreciated that after sending the probe request frame to the network device of any wireless network, the terminal device may monitor the wireless network to receive a probe request frame (probe response) returned by the network device of the wireless network.
Alternatively, the network device in the embodiments of the present disclosure may be an entity on the network side for transmitting or receiving signals. For example, the network device may be an evolved NodeB (eNB), a transmission point (transmission reception point, TRP), a next generation NodeB (gNB) in an NR system, a base station in other future mobile communication systems, or an access node in a wireless fidelity (WIRELESS FIDELITY, wiFi) system, etc. The embodiments of the present disclosure do not limit the specific technology and specific device configuration employed by the network device.
Alternatively, the terminal device in the present disclosure may be an entity on the user side for receiving or transmitting signals, such as a mobile phone. It is understood that a terminal device (terminal) may also be referred to as a User Equipment (UE), a Mobile Station (MS), a mobile terminal device (MT), etc. The terminal device may be an automobile with communication function, a smart car, a mobile phone (mobile phone), a wearable device, a tablet computer (Pad), a computer with wireless transceiving function, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal device in industrial control (industrial control), a wireless terminal device in unmanned-driving (self-driving), a wireless terminal device in teleoperation (remote medical surgery), a wireless terminal device in smart grid (SMART GRID), a wireless terminal device in transportation security (transportation safety), a wireless terminal device in smart city (SMART CITY), a wireless terminal device in smart home (smart home), or the like. The embodiment of the present disclosure does not limit the specific technology and the specific device configuration adopted by the terminal device.
In step 303, each probe response frame is parsed to determine network parameters of each wireless network.
Optionally, a field may be added to the probe response frame to represent a network parameter of the wireless network, or a specific field in the probe response frame may be used to represent a network parameter of the wireless network, or the like, where the specific field may be configured for the network device, or may be agreed for the network device and the terminal device, or the like. The present disclosure is not limited in this regard.
For example, the network device and the terminal device agree that a particular field in the probe response frame is used to characterize network parameters of the wireless network. Therefore, after receiving the probe response frame returned by the network device of the wireless network, the terminal device can determine the network parameters and the like corresponding to the wireless network by analyzing the specific fields in the probe response frame, which is not limited in the disclosure.
Step 304, determining a reference network rate of each wireless network according to the preset received signal strength threshold and each first parameter of the network parameters.
Step 305, determining a score corresponding to the wireless network according to the first weight corresponding to the reference network rate and the second weight corresponding to each second parameter.
The first weight corresponding to the network rate and the second weight corresponding to each second parameter may be set in advance, or may be adjusted according to an actual situation, or the like, which is not limited in the disclosure.
For example, in the case where the second parameter is the received signal strength, the first weight corresponding to the reference network rate may be set to be 0.7, and the second weight of the received signal strength may be set to be 0.3. If the received signal strength of the wireless network 1 currently in the non-connected state is a, the reference network rate is 3M/s, the received signal strength of the wireless network 2 is a, the reference network rate is 1M/s, the score of the wireless network 1 can be determined to be 3×0.7+0.3×a, and the score of the wireless network 2 is 1×0.7+0.3×a.
Or if the second parameter is the received signal strength and the encryption mode of the wireless network, the first weight corresponding to the reference network rate may be set to be 0.6, the second weight corresponding to the received signal strength is set to be 0.25, and the second weight corresponding to the encryption mode of the wireless network is set to be 0.15. And then, respectively carrying out weighted fusion on the reference network rate corresponding to the wireless network in the non-connection state, each second parameter and the corresponding weight so as to determine the corresponding score of each wireless network.
It should be noted that the foregoing examples are only illustrative, and should not be taken as limiting the first weight of the reference network rate, the second weight of the second parameter, the manner of determining the corresponding score of the wireless network, and the like in the embodiments of the present disclosure.
And step 306, determining the current target wireless network according to the corresponding score of each wireless network.
It will be appreciated that after determining the score corresponding to each wireless network, the target wireless network may be determined from the plurality of wireless networks based on the score corresponding to each wireless network.
Alternatively, the wireless network with the highest score among the plurality of wireless networks may be determined as the current target wireless network. Or the score threshold value can be set in advance, each wireless network with the score larger than the score threshold value is determined to be the wireless network to be selected, and then any wireless network can be selected from the wireless networks to be selected and used as the current target wireless network. Or the wireless networks can be ranked according to the value of the score, and any wireless network is selected from the preset number of wireless networks as the target wireless network.
The above examples are merely illustrative, and are not intended to limit the manner in which the current target wireless network is determined in the embodiments of the present disclosure.
In step 307, the terminal device is controlled to connect with the target wireless network when the terminal device is not connected with any wireless network.
It can be understood that after the target wireless network is determined, if the terminal device is not currently in a connection state with any wireless network, the terminal device can be controlled to connect with the target wireless network, and the network quality of the target wireless network is better, so that if the terminal device is connected with the target wireless network, the network quality on the connection can be ensured to be better as much as possible, the process of selecting the wireless network by the terminal device can be reduced as much as possible, and the accuracy and efficiency of wireless network connection are improved.
Optionally, in the case that the network rate of the wireless network to which the terminal device is currently connected is smaller than the reference network rate of the target wireless network, the terminal device is controlled to disconnect from the currently connected wireless network and connect to the target wireless network.
For example, if the reference network rate of the target wireless network is 3.8M/s and the network rate of the wireless network 1 currently connected to the terminal device is 0.9M/s, it may be determined that the network quality of the wireless network 1 currently connected to the terminal device may be poor, so that the connected wireless network may be switched, for example, the connection with the wireless network 1 may be disconnected and the target wireless network may be connected, so that the network quality of the wireless network connected to the terminal device may be as good as possible.
It should be noted that the foregoing examples are only illustrative, and are not intended as limitations on the reference network rate, network rate of any wireless network, etc. in the embodiments of the present disclosure.
According to the embodiment of the disclosure, a probe request frame can be sent to each wireless network in a non-connection state at first, then a probe response frame returned by network equipment of each wireless network can be received, then each probe response frame is analyzed to determine network parameters of each wireless network, then a reference network rate of each wireless network can be determined according to a preset received signal strength threshold and each first parameter in the network parameters, and a score corresponding to the wireless network is determined according to a first weight corresponding to the reference network rate and a second weight corresponding to each second parameter, then a current target wireless network is determined according to the score corresponding to each wireless network, and then the terminal equipment can be controlled to connect with the target wireless network under the condition that the terminal equipment is not in a connection state with any wireless network. Therefore, the network parameters of each wireless network can be determined by sending the detection request frame to the wireless network and analyzing the received detection response frame, then the reference network rate corresponding to the wireless network can be determined according to the first parameter in the network parameters, then the target wireless network with better network quality is determined and connected based on the weight of the reference network rate and the weight of the second parameter in the network parameters, thereby improving the accuracy of determining and connecting the target wireless network, avoiding the process of connecting the target wireless network by multiple attempts, saving time and improving efficiency.
Fig. 4 is a flowchart of a method for determining a wireless network according to an embodiment of the present disclosure, where the method may be performed by a network device. As shown in fig. 4, the method for determining a wireless network may include the steps of:
in step 401, network parameters of a wireless network are determined.
The network parameter may be various, for example, may be a parameter characterizing the network performance of the wireless network, for example, may be an uplink transmission rate, a downlink transmission rate, or may be a total bandwidth, a remaining available bandwidth, a received signal strength, or the like of the wireless network, which is not limited in this disclosure.
Optionally, the network device may first monitor the network status to obtain the total bandwidth and the used bandwidth of the wireless network, and then subtract the used bandwidth from the total bandwidth, where the obtained value is the remaining available bandwidth, which is not limited in this disclosure.
Optionally, the network device may detect the network state according to a set period to obtain a network parameter of the wireless network, or may detect the network state according to a requirement to obtain a network parameter of the wireless network, or the like, which is not limited in this disclosure.
Step 402, the network parameters are sent to the terminal device, so that the terminal device determines a reference network rate of the wireless network according to the received network parameters, and determines a target wireless network according to the reference network rate and the network parameters.
After determining the network parameters of the wireless network, the network device may send the network parameters to the terminal device, so that the terminal device may determine a reference network rate of the wireless network based on the received network parameters, and further determine a target wireless network to be connected according to the reference network rate and the network parameters of each wireless network, so as to connect the target wireless network. The present disclosure is not limited in this regard.
Alternatively, the network parameters may be sent to the terminal device according to a set period.
For example, if the set period is 3 minutes, the network device may detect the network state of the wireless network every 3 minutes to obtain the corresponding network parameter, and then send the network parameter to the terminal device. Or if the set period is 100 seconds, the network device may send the acquired network parameters to the terminal device every 100 seconds.
The above examples are illustrative only, and are not intended to limit the period and the like set in the embodiments of the present disclosure.
Alternatively, the network parameters may be sent to the terminal device by broadcasting the data packets.
The network device may be configured to add a field in the data packet to represent a network parameter of the wireless network, or the network device and the terminal device may be agreed in advance to pass through a specific field in the data packet to represent a network parameter of the wireless network, or the like, which is not limited in the present disclosure.
Alternatively, the data packet may be a beacon frame (beacon frame), or may be another set data packet, or the like, which is not limited in this disclosure.
For example, after determining the network parameters of the wireless network, the network device may add a specific field to the beacon frame to characterize the network parameters of the wireless network, and then may send the beacon frame in a broadcast form, so that the terminal device may obtain the data packet broadcast by the network device by listening and parse the data packet to obtain the network parameters of the wireless network, which is not limited in this disclosure.
Optionally, the network device may further determine a network parameter of the wireless network after receiving the probe request frame sent by the terminal device, and may then send the network parameter to the terminal device through the probe response frame.
It is to be appreciated that the network device can also add fields in the probe response frame to characterize network parameters of the wireless network, as the disclosure is not limited in this regard.
For example, after receiving a probe request frame (probe request) sent by a terminal device, the network device may monitor a network state of the wireless network to determine a network parameter, then may add a field in a probe response frame (probe response) to characterize the network parameter of the wireless network, and then may send the probe response frame to the terminal device, so that the terminal device may obtain the network parameter of the wireless network by analyzing the probe response frame. The present disclosure is not limited in this regard.
The method for determining a wireless network provided by the present disclosure may be applied to any wireless network connection scenario, and the process for determining a wireless network provided by the present disclosure is described below with a schematic diagram shown in fig. 4A.
Firstly, the network device may monitor the network status of the wireless network periodically, for example, it may first detect the external network rate and calculate the remaining available bandwidth, and then may carry the determined network parameters such as the uplink rate, the downlink rate, the total bandwidth, and the remaining available bandwidth into a beacon or probe response, and send the network parameters to the terminal device. In the scanning and monitoring process, the terminal device can receive the beacon or probe response sent by the network device, and then can obtain the network parameters corresponding to the wireless network by analyzing the beacon or probe response. Then, the terminal device may determine, based on the network parameters and the attenuation of the signal strength to the network quality, a reference network rate of the wireless network without being connected to the wireless network, and then display each wireless network and the reference network rate on the display interface in order from high to low of the reference network rate. And then, the reference network rate can be added into an automatic network selection algorithm according to a certain weight, so that when the connection and roaming are automatically switched, the target wireless network can be determined according to a new automatic network selection algorithm, and the target wireless network with the best network quality can be selected and connected. After the terminal device is connected to the target wireless network, the actual network rate of the target wireless network can be further determined, and the actual network rate is used for updating the reference network rate.
It should be noted that the above examples are only illustrative, and are not intended to limit the determination procedure of the wireless network and the like in the embodiments of the present disclosure.
According to the method and the device for determining the wireless network, the network device can determine the network parameters of the wireless network first, and then the network parameters can be sent to the terminal device, so that the terminal device can determine the reference network rate of each wireless network based on the received network parameters, and therefore the terminal device fully considers the network state of each wireless network in the process of determining the target wireless network to be connected, the target wireless network with good network quality is determined, and conditions are provided for improving the accuracy and efficiency of wireless network connection.
The embodiment of the disclosure also provides a determining device of the wireless network, which is configured at the terminal equipment side, and fig. 5 is a schematic structural diagram of the determining device of the wireless network according to the embodiment of the disclosure.
As shown in fig. 5, the wireless network determining apparatus 500 includes a receiving module 510, a first determining module 520, and a second determining module 530.
The acquiring module 510 is configured to receive a network parameter sent by a network device of each wireless network currently in a non-connected state.
The first determining module 520 is configured to determine a reference network rate of each wireless network according to a preset received signal strength threshold and each first parameter of the network parameters.
A second determining module 530, configured to determine a current target wireless network according to a reference network rate of each of the wireless networks and each of the second parameters.
Optionally, the device further comprises a connection module for:
Controlling the terminal equipment to be connected with the target wireless network under the condition that the terminal equipment is not connected with any wireless network;
Or alternatively
And under the condition that the network rate of the wireless network currently connected with the terminal equipment is smaller than the reference network rate of the target wireless network, controlling the terminal equipment to disconnect the wireless network currently connected with the terminal equipment and connect with the target wireless network.
Optionally, the method further comprises:
And the display module is used for displaying each wireless network and the corresponding reference network rate on the display interface according to the sequence of the reference network rate from high to low.
Optionally, the method further comprises:
A third determining module, configured to determine, when the third determining module is in a connection state with any wireless network, an actual network rate of the any wireless network according to a data amount of data transmitted by the terminal device in a preset period of time;
and the updating module is used for updating the reference network rate corresponding to any wireless network in the display interface based on the actual network rate of any wireless network.
Optionally, the first determining module 520 is specifically configured to:
Determining a target transmission rate according to the uplink transmission rate and the downlink transmission rate in the first parameter;
and determining the reference network rate of each wireless network according to a preset received signal strength threshold, the target transmission rate, the total bandwidth in the first parameter, the residual available bandwidth and the received signal strength.
Optionally, the second determining module 530 is specifically configured to:
Determining a score corresponding to the wireless network according to a first weight corresponding to the reference network rate and a second weight corresponding to each second parameter;
And determining the current target wireless network according to the corresponding score of each wireless network.
Optionally, the receiving module 510 is specifically configured to:
Receiving a broadcast data packet corresponding to each wireless network in a non-connection state, wherein the data packet comprises network parameters of the wireless network;
And analyzing each data packet to determine the network parameters of each wireless network.
Optionally, the receiving module 510 includes:
A transmitting unit for transmitting a probe request frame to each wireless network currently in a non-connection state;
the receiving unit is used for receiving the detection response frames returned by the network equipment of each wireless network;
And the determining unit is used for analyzing each detection response frame so as to determine the network parameters of each wireless network.
Optionally, the sending unit is specifically configured to:
And in the case that the network rate of the wireless network currently in the connected state is smaller than the threshold value, transmitting a probe request frame to each wireless network currently in the disconnected state.
The functions and specific implementation principles of the foregoing modules in the embodiments of the present disclosure may refer to the foregoing method embodiments, and are not repeated herein.
The determining device for wireless networks in the embodiment of the present disclosure may first receive a network parameter sent by a network device of each wireless network currently in a non-connected state, then determine a reference network rate of each wireless network according to a preset received signal strength threshold and each first parameter in the network parameters, and then determine a current target wireless network according to each second parameter in the reference network rate and the network parameters of each wireless network. Therefore, the terminal equipment can firstly determine the corresponding reference network rate based on the first parameter in the network parameters of the wireless network, then determine the target wireless network with better network quality based on the second parameter in the reference network rate and the network parameters, thereby improving the accuracy of determining the target wireless network, avoiding the process of determining the target wireless network by multiple attempts, saving time and improving efficiency.
Fig. 6 is a schematic structural diagram of a determination apparatus of a wireless network according to an embodiment of the present disclosure, which is configured on a network device side.
As shown in fig. 6, the determining apparatus 600 of the wireless network includes a determining module 610 and a transmitting module 620.
Wherein, the determining module 610 is configured to determine a network parameter of the wireless network.
And a sending module 620, configured to send the network parameter to a terminal device, so that the terminal device determines a reference network rate of the wireless network according to the received network parameter, and determines a target wireless network according to the reference network rate and the network parameter.
Optionally, the sending module 620 is specifically configured to:
and sending the network parameters to the terminal equipment according to the set period.
Optionally, the sending module 620 is further specifically configured to:
And transmitting the network parameters to the terminal equipment through broadcasting data packets.
Optionally, the method further comprises:
the receiving module is used for receiving the detection request frame sent by the terminal equipment;
the sending module 620 is specifically configured to send the network parameter to a terminal device through a probe response frame.
The functions and specific implementation principles of the foregoing modules in the embodiments of the present disclosure may refer to the foregoing method embodiments, and are not repeated herein.
According to the wireless network determining device, the network equipment can firstly determine the network parameters of the wireless network, and then the network parameters can be sent to the terminal equipment, so that the terminal equipment can determine the reference network rate of each wireless network based on the received network parameters, and the terminal equipment fully considers the network state of each wireless network in the process of determining the target wireless network to be connected, so that the target wireless network with better network quality is determined, and conditions are provided for improving the accuracy and efficiency of wireless network connection.
Fig. 7 is a block diagram of an electronic device according to an embodiment of the present disclosure.
As shown in fig. 7, the electronic device 200 includes a memory 210 and a processor 220, and a bus 230 connecting the different components, including the memory 210 and the processor 220.
Wherein the memory 210 is configured to store executable instructions of the processor 220, and the processor 201 is configured to invoke and execute the executable instructions stored in the memory 202 to implement the method for determining a wireless network according to the above embodiments of the present disclosure.
Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. By way of example, and not limitation, such architectures include Industry Standard Architecture (ISA) bus, micro channel architecture (MAC) bus, enhanced ISA bus, video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 200 typically includes a variety of electronic device readable media. Such media can be any available media that is accessible by electronic device 200 and includes both volatile and nonvolatile media, removable and non-removable media.
Memory 210 may also include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 240 and/or cache memory 250. The electronic device 200 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 260 may be used to read from or write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, commonly referred to as a "hard disk drive"). Although not shown in fig. 7, a magnetic disk drive for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), and an optical disk drive for reading from or writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In such cases, each drive may be coupled to bus 230 via one or more data medium interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the various embodiments of the disclosure.
Program/utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment. Program modules 270 generally perform the functions and/or methods in the embodiments described in this disclosure.
The electronic device 200 may also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), one or more devices that enable a user to interact with the electronic device 200, and/or any device (e.g., network card, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may occur through an input/output (I/O) interface 292. Also, electronic device 200 may communicate with one or more networks such as a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet, through network adapter 293. As shown, network adapter 293 communicates with other modules of electronic device 200 over bus 230. It should be appreciated that although not shown, other hardware and/or software modules may be used in connection with electronic device 200, including, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAI D systems, tape drives, and data backup storage systems, among others.
The processor 220 executes various functional applications and data processing by running programs stored in the memory 210.
It should be noted that, the implementation process of the electronic device in the embodiment of the present disclosure refers to the foregoing explanation of the method for determining the wireless network in the embodiment of the present disclosure, and will not be repeated herein.
The electronic device in the embodiment of the present disclosure may first receive a network parameter sent by a network device of each wireless network currently in a non-connected state, then determine a reference network rate of each wireless network according to a preset received signal strength threshold and each first parameter in the network parameters, and then determine a current target wireless network according to the reference network rate of each wireless network and each second parameter in the network parameters. Therefore, the terminal equipment can firstly determine the corresponding reference network rate based on the first parameter in the network parameters of the wireless network, then determine the target wireless network with better network quality based on the second parameter in the reference network rate and the network parameters, thereby improving the accuracy of determining the target wireless network, avoiding the process of determining the target wireless network by multiple attempts, saving time and improving efficiency.
To achieve the above embodiments, the embodiments of the present disclosure also propose a non-transitory computer-readable storage medium, instructions in which, when executed by a processor of an electronic device, enable the electronic device to perform the method of determining a wireless network as described above.
To achieve the above embodiments, the disclosed embodiments also provide a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to perform the method of determining a wireless network as described above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.