Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
The network connection method, apparatus, device and medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a flowchart illustrating a network connection method applied to a first electronic device according to an embodiment of the present disclosure. The network connection method applied to the first electronic device may include:
s101: under the condition that the signal strength of a first wireless signal is smaller than a first signal strength threshold value, sending first information to a first wireless access point, wherein the first wireless signal is a signal received by first electronic equipment and sent by the first wireless access point, the first wireless access point is a wireless access point connected with the first electronic equipment, and the first information is used for requesting first channel information meeting a first condition;
s102: receiving first channel information sent by the first wireless access point in response to the first information;
s103: determining a second wireless access point according to the first channel information;
s104: and connecting the second wireless access point, and networking through the second wireless access point.
Specific implementations of the above steps will be described in detail below.
In the embodiment of the application, when the signal strength of a first wireless signal transmitted by a first wireless access point connected with a first electronic device is less than a first signal strength threshold value, the first electronic device transmits first information for requesting first channel information meeting a first condition to the first wireless access point, receives the first channel information transmitted by the first wireless access point in response to the first information, determines a second wireless access point according to the first channel information, connects the second wireless access point, and is networked through the second wireless access point. The wireless access point needing to be connected can be determined only according to the channel corresponding to the first channel information meeting the first condition without scanning all channels corresponding to the wireless access frequency band, and the number of the channels corresponding to the first channel information meeting the first condition is smaller than the total number of all channels corresponding to the wireless access frequency band, so that the channel scanning time can be reduced, and the time of network abnormity and low internet speed can be further shortened.
Illustratively, the wireless access frequency band generally includes a 2.4GHz band and a 5GHz band, wherein the 2.4GHz band includes 14 channels, the number of channels available for wireless Wi-Fi in the 5GHz band of different countries is different, 13 in china, 9 in the united states, and 4 in japan.
The public Wi-Fi network has 3 wireless access points in total, and the 3 wireless access points are a wireless access point A, a wireless access point B and a wireless access point C respectively. The first electronic device is currently connected with the wireless access point B. When monitoring that the signal intensity of a wireless signal sent by a wireless access point B is smaller than a first signal intensity threshold value, first electronic equipment sends first information for requesting first channel information meeting a first condition to the wireless access point B; the wireless access point B responds to the first information and sends first channel information to the first electronic equipment, wherein the number of channels corresponding to the first channel information sent by the wireless access point B is smaller than the total number of all channels corresponding to a wireless access frequency band; and after receiving the first channel information, the first electronic device determines a second wireless access point, and if the determined second wireless access point is a wireless access point C, the first electronic device connects the wireless access point C and is networked through the wireless access point C.
In some possible implementations of the embodiment of the present application, the first electronic device first joins one of the channels corresponding to the first channel information, sends a Probe request frame, and after a minimum channel time (MinChannelTime), if no Probe response is received, it is determined that no wireless access point exists on the channel, and scanning of the next channel in the channel corresponding to the first channel information is started, otherwise, the first electronic device continues to wait to receive the Probe response returned by the wireless access point on the channel until the waiting time reaches the maximum channel time (MaxChannelTime), starting to scan the next channel in the channels corresponding to the first channel information, and after all the channels corresponding to the first channel information are scanned, that is, the number of available wireless access points corresponding to the channel corresponding to the first channel information can be calculated, and then the wireless access point with higher quality is selected.
In some possible implementations of the embodiment of the present application, the wireless Access points in the public Wi-Fi network are managed and controlled by an Access Controller (AC), and the Access Controller may obtain the installation position of each wireless Access point managed by the Access Controller, and further may obtain a correspondence between the installation position of each wireless Access point and a Basic Service Set Identifier (BSSID) of the wireless Access point. When the channel of a certain wireless access point is changed, the wireless access point sends the changed channel information to the access controller, and at this time, the access controller can acquire the corresponding relationship between the channel information of the wireless access point and the BSSID of the wireless access point. The access controller synchronizes the correspondence between the installation position of each wireless access point and the BSSID and the correspondence between the channel information of each wireless access point and the BSSID to each wireless access point managed by the access controller, and at this time, each wireless access point can acquire the correspondence between the installation position of each wireless access point and the BSSID and the correspondence between the channel information of each wireless access point and the BSSID. Wherein, BSSID generally refers to a network card address of the wireless access point, for identifying the wireless access point.
The method comprises the steps that under the condition that a first electronic device monitors that the signal intensity of a signal sent to the first electronic device by a first wireless access point connected with the first electronic device is smaller than a first signal intensity threshold value, the first electronic device sends first information used for requesting first channel information meeting a first condition to the first wireless access point; after the first wireless access point receives the first information, the distance between each wireless access point and the first wireless access point is determined according to the installation position of the wireless access point, the wireless access point with the distance from the first wireless access point being smaller than a first distance threshold is determined as the wireless access point to be accessed by the first electronic equipment, and the channel information of the channel where the wireless access point to be accessed by the first electronic equipment is located is determined according to the corresponding relation between the installation position of the wireless access point and the BSSID and the corresponding relation between the channel information of the wireless access point and the BSSID.
Based on the above, the first channel information satisfying the first condition in S101 includes: and channel information of a channel where a third wireless access point is located, wherein the third wireless access point is a wireless access point of which the distance from the first electronic equipment is smaller than a first distance threshold.
In some possible implementations of the embodiment of the present application, S103 may include: and determining the wireless access point meeting a second condition in the wireless access points corresponding to the first channel information as a second wireless access point, wherein the wireless access point meeting the second condition is the wireless access point with the strongest signal strength of the wireless signal provided to the first electronic equipment.
Illustratively, there are 5 wireless access points in the public Wi-Fi network, and the 5 wireless access points are wireless access point a, wireless access point B, wireless access point C, wireless access point D, and wireless access point E, respectively. The first electronic device is currently connected with the wireless access point B. When monitoring that the signal intensity of a wireless signal sent by a wireless access point B is smaller than a first signal intensity threshold value, first electronic equipment sends first information for requesting channel information meeting a first condition to the wireless access point B; the wireless access point B responds to the first information and sends channel information to the first electronic equipment; assuming that the channel information transmitted by the wireless access point B is information of two channels in a 2.4GHz band and information of one channel in a 5GHz band, wherein one channel in the two channels in the 2.4GHz band corresponds to the wireless access point C, the other channel in the two channels in the 2.4GHz band corresponds to the wireless access point D, one channel in the 5GHz band corresponds to the wireless access point E, and the signal strength of a wireless signal provided by the wireless access point C to the first electronic device is greater than that of a wireless signal provided by the wireless access point E to the first electronic device, the signal strength of a wireless signal provided by the wireless access point E to the first electronic device is greater than that of a wireless signal provided by the wireless access point D to the first electronic device, and the signal strength of a wireless signal provided by the wireless access point C to the first electronic device is strongest, determining the wireless access point C as the second wireless access point, connecting the wireless access point C, and networking through the wireless access point C.
It should be noted that, although the channel information fed back by the wireless access point B includes one channel in the 5GHz band, the first electronic device is not connected to the wireless access point using the one channel in the 5GHz band, which may be due to an obstacle existing between the wireless access point and the first electronic device, so that the signal strength of the wireless signal received by the first electronic device to the wireless access point is weak.
In some possible implementations of the embodiments of the present application, the first information may be transmitted or the first channel information may be received through a first management frame of a wireless local area network standard, where the first management frame is an unused management frame in the management frame of the wireless local area network standard.
The MAC header of all management frames in the standard IEEE 802.11 for wlan is the same, regardless of the sub-type of the frame. Management frames use information elements (data blocks with digital labels) to exchange data with other systems. An information element (information element) is a constituent element of a management frame, and its length is not constant. An information Element typically contains one Element identification code (Element ID) bit and two length bits, where one length is a fixed length bit and the other length bit is an indefinite length bit.
Illustratively, according to the 802.11 protocol, the management frames with the element identification numbers 43-49 in the management frame are not used, and the first information may be transmitted through the management frame with theelement identification number 44 and the first channel information may be received through the management frame with theelement identification number 45.
In some possible implementations of the embodiments of the present application, the management frame with theelement id number 44 may be referred to as a Channel query (Channel Request) frame, and the management frame with theelement id number 45 may be referred to as a Channel Response (Channel Response) frame.
The channel query frame is used for requesting first channel information meeting the first condition and can be represented through an element identification code of an information element of the channel query frame, so that the channel query frame does not need to carry other information, and the fixed length bit in the information element of the channel query frame takes a value of 0. The format of the information element corresponding to the channel query frame is shown in fig. 2.
In some possible implementations of the embodiment of the present application, it may be specified that the channel response frame supports feeding back channel information of 8 channels at maximum, a fixed length bit in an information element of the channel response frame is 8, and an indefinite length bit in the information element of the channel response frame is channel information of 8 channels. When the number of channels determined by the first wireless access point is less than 8, the bits with indefinite length in the information element of the channel response frame are the channel information of the channels. In some possible implementations of the embodiment of the present application, when the number of channels determined by the first wireless access point is greater than 8, the 8 channels may be channels where 8 wireless access points closest to the first wireless access point are located. The format of the information element corresponding to the channel response frame is shown in fig. 3.
In the embodiment of the present application, the transmission and reception of the first information and the first channel information can be realized by an unused management frame in a management frame of a wireless local area network standard.
It should be noted that, in the network connection method provided in the embodiment of the present application, the execution main body may be a network connection device, or a control module in the network connection device for executing the network connection method. In the embodiment of the present application, a network connection device executing a network connection method is taken as an example to describe the network connection device provided in the embodiment of the present application.
Fig. 4 is a schematic structural diagram of a network connection device applied to a first electronic device according to an embodiment of the present application. Thenetwork connection apparatus 400 applied to the first electronic device may include:
a sendingmodule 401, configured to send first information to a first wireless access point when signal strength of a first wireless signal is smaller than a first signal strength threshold, where the first wireless signal is a signal received by a first electronic device and sent by the first wireless access point, the first wireless access point is a wireless access point to which the first electronic device is connected, and the first information is used to request first channel information meeting a first condition;
areceiving module 402, configured to receive first channel information sent by a first wireless access point in response to first information;
a determiningmodule 403, configured to determine a second wireless access point according to the first channel information;
and aconnection module 404, configured to connect to a second wireless access point, and perform networking through the second wireless access point.
In the embodiment of the application, when the signal strength of a first wireless signal transmitted by a first wireless access point connected with a first electronic device is less than a first signal strength threshold value, the first electronic device transmits first information for requesting first channel information meeting a first condition to the first wireless access point, receives the first channel information transmitted by the first wireless access point in response to the first information, determines a second wireless access point according to the first channel information, connects the second wireless access point, and is networked through the second wireless access point. The wireless access point needing to be connected can be determined only according to the channel corresponding to the first channel information meeting the first condition without scanning all channels corresponding to the wireless access frequency band, and the number of the channels corresponding to the first channel information meeting the first condition is smaller than the total number of all channels corresponding to the wireless access frequency band, so that the channel scanning time can be reduced, and the time of network abnormity and low internet speed can be further shortened.
In some possible implementations of the embodiments of the present application, the first channel information satisfying the first condition includes: and channel information of a channel where a third wireless access point is located, wherein the third wireless access point is a wireless access point of which the distance from the first electronic equipment is smaller than a first distance threshold.
In some possible implementations of the embodiment of the present application, the determiningmodule 403 is specifically configured to:
and determining the wireless access point meeting a second condition in the wireless access points corresponding to the first channel information as a second wireless access point, wherein the wireless access point meeting the second condition is the wireless access point with the strongest signal strength of the wireless signal provided to the first electronic equipment.
In some possible implementations of the embodiments of the present application, the first information may be transmitted or the first channel information may be received through a first management frame of a wireless local area network standard, where the first management frame is an unused management frame in the management frame of the wireless local area network standard.
The network connection device applied to the first electronic device in the embodiment of the present application may be a device, and may also be a component, an integrated circuit, or a chip in a terminal. The first electronic device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The first electronic device in the embodiment of the present application may be an electronic device having an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The network connection device applied to the first electronic device according to the embodiment of the present application can implement each process in the network connection method applied to the first electronic device in fig. 1 to fig. 3, and for avoiding repetition, details are not described here again.
Optionally, as shown in fig. 5, anelectronic device 500 is further provided in this embodiment of the present application, and includes aprocessor 501, amemory 502, and a program or an instruction stored in thememory 502 and executable on theprocessor 501, where the program or the instruction is executed by theprocessor 501 to implement the processes of the network connection method embodiment applied to the first electronic device, and can achieve the same technical effects, and details are not repeated here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
In some possible implementations of embodiments of the present Application, theprocessor 501 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured to implement one or more Integrated circuits of embodiments of the present Application.
In some possible implementations of embodiments of the present application, theMemory 502 may include Read-Only Memory (ROM), Random Access Memory (RAM), magnetic disk storage media devices, optical storage media devices, flash Memory devices, electrical, optical, or other physical/tangible Memory storage devices. Thus, in general, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software comprising computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the network connection method applied to the first electronic device according to embodiments of the application.
Fig. 6 is a hardware configuration diagram of an electronic device implementing an embodiment of the present application.
Theelectronic device 600 includes, but is not limited to: aradio frequency unit 601, anetwork module 602, anaudio output unit 603, aninput unit 604, asensor 605, adisplay unit 606, auser input unit 607, aninterface unit 608, amemory 609, aprocessor 610, and the like.
Those skilled in the art will appreciate that theelectronic device 600 may further comprise a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to theprocessor 610 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is omitted here.
Wherein thenetwork module 602 is configured to: when the signal strength of a first wireless signal is smaller than a first signal strength threshold, sending first information to a first wireless access point, where the first wireless signal is a signal received by theelectronic device 600 and sent by the first wireless access point, the first wireless access point is a wireless access point to which theelectronic device 600 is connected, and the first information is used to request first channel information meeting a first condition; receiving first channel information sent by the first wireless access point in response to the first information;
theprocessor 610 is configured to: determining a second wireless access point according to the first channel information;
thenetwork module 602 is further configured to: and connecting the second wireless access point, and networking through the second wireless access point.
In this embodiment, in a case where theelectronic device 600 receives that the signal strength of a first wireless signal transmitted by a first wireless access point connected thereto is smaller than a first signal strength threshold, theelectronic device 600 transmits first information requesting first channel information satisfying a first condition to the first wireless access point, receives the first channel information transmitted by the first wireless access point in response to the first information, and then determines a second wireless access point according to the first channel information, connects to the second wireless access point, and networks through the second wireless access point. The wireless access point needing to be connected can be determined only according to the channel corresponding to the first channel information meeting the first condition without scanning all channels corresponding to the wireless access frequency band, and the number of the channels corresponding to the first channel information meeting the first condition is smaller than the total number of all channels corresponding to the wireless access frequency band, so that the channel scanning time can be reduced, and the time of network abnormity and low internet speed can be further shortened.
In some possible implementations of the embodiments of the present application, the first channel information satisfying the first condition includes:
and channel information of a channel where a third wireless access point is located, wherein the third wireless access point is a wireless access point of which the distance from the first electronic equipment is smaller than a first distance threshold.
In some possible implementations of embodiments of the present application, theprocessor 610 is specifically configured to:
and determining the wireless access point meeting the second condition from the wireless access points corresponding to the first channel information as a second wireless access point, wherein the wireless access point meeting the second condition is the wireless access point with the strongest signal strength of the wireless signal provided to theelectronic device 600.
In some possible implementations of the embodiments of the present application, the first information may be transmitted or the first channel information may be received through a first management frame of a wireless local area network standard, where the first management frame is an unused management frame in the management frame of the wireless local area network standard.
It is to be understood that, in the embodiment of the present application, theinput Unit 604 may include a Graphics Processing Unit (GPU) 6041 and amicrophone 6042, and theGraphics Processing Unit 6041 processes image data of a still picture or a video obtained by an image capturing apparatus (such as a camera) in a video capturing mode or an image capturing mode. Thedisplay unit 606 may include adisplay panel 6061, and thedisplay panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. Theuser input unit 607 includes atouch panel 6071 andother input devices 6072. Atouch panel 6071, also referred to as a touch screen. Thetouch panel 6071 may include two parts of a touch detection device and a touch controller.Other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. Thememory 609 may be used to store software programs as well as various data including, but not limited to, application programs and an operating system. Theprocessor 610 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into theprocessor 610.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements the processes of the network connection method embodiment applied to the first electronic device, and can achieve the same technical effects, and in order to avoid repetition, the detailed description is omitted here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, and examples of the computer readable storage medium include non-transitory computer readable storage media such as a ROM, a RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction, so as to implement the above processes applied to the embodiment of the network connection method for the first electronic device, and achieve the same technical effects, and in order to avoid repetition, the details are not repeated here.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
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. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.