Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Referring to fig. 1, a schematic diagram of an implementation environment provided by an embodiment of the present application is shown. The implementation environment includes: first network device 110 and second network device 120.
Network devices (including first network device 110 and second network device 120) are devices that have the capability to establish WLAN links with other network devices. Illustratively, the network device may be a terminal device, such as a mobile phone, a tablet computer, an e-book reader, a multimedia playing device, etc.; or wearable devices such as smart watches, smart bracelets, smart glasses, and the like; the toy can also be an intelligent toy, such as an unmanned aerial vehicle, an intelligent fighting trolley and the like; or other devices with the function of establishing a WLAN link, such as a Wireless Access Point (Wireless Access Point).
For example, first network device 110 is a cell phone and second network device 120 is also a cell phone. As another example, the first network device 110 is a drone and the second network device 120 is a remote control or a cell phone. Also for example, the first network device 110 is a handset and the second network device 120 is an AP.
For convenience of description, in the embodiments of the present application, the above-mentioned devices having the function of establishing a WLAN link with other network devices are collectively referred to as network devices.
Referring to fig. 2A, a flowchart of a WLAN link establishment method according to an embodiment of the present application is shown. The method may be applied in the implementation environment shown in fig. 1. The method may include several steps as follows.
In step 201, a first network device broadcasts a probe request with an initial bandwidth.
The first network device broadcasts a probe request at an initial bandwidth, the probe request for discovering other network devices capable of establishing a WLAN link with the first network device. The initial bandwidth is a first bandwidth employed by the first network device to broadcast the probe request. Optionally, the initial bandwidth is 20 MHz.
Step 202, a first network device detects whether a probe response corresponding to a probe request sent by a second network device is received; if not, the following step 203 is executed; if so, the following step 204 is performed.
The signals with different bandwidths have different coverage areas, and the bandwidth and the coverage area are in a negative correlation relationship. The larger the bandwidth is, the smaller the coverage area is; conversely, the smaller the bandwidth, the larger the coverage. Therefore, if the distance between the other network device and the first network device exceeds the coverage of the probe request sent by the first network device, the other network device cannot receive the probe request sent by the first network device, and thus cannot send a corresponding probe response.
And if the other network equipment receives the detection request, sending a detection response corresponding to the detection request to the first network equipment. And the other network equipment which sends the detection response is the second network equipment. The number of the second network devices may be one or more. Optionally, the second network device sends the probe response by using the bandwidth used when the first network device sends the probe request. For example, a first network device broadcasts a probe request using 20MHz, and if another network device receives the probe request, the network device sends a probe response to the first network device using 20 MHz.
In step 203, the first network device broadcasts the probe request with the adjusted bandwidth, and starts to execute from step 202 again.
After the first network device does not receive the probe response from other network devices within the preset time, the first network device sends the probe request with the adjusted bandwidth, wherein the adjusted bandwidth is smaller than the last used bandwidth, so as to obtain a larger coverage area. Bandwidths typically employed in WLANs include 1MHz, 5MHz, 10MHz, 20MHz, 40MHz, 80MHz, 160MHz, and so forth. Alternatively, the adjustment bandwidth is a bandwidth that is one level lower than the last employed bandwidth. Illustratively, if the probe request is broadcast by the first network device with an initial bandwidth of 20MHz, if no probe response is received, the probe request is broadcast again with an adjusted bandwidth of 10MHz, and so on until a probe response is received or a minimum bandwidth (e.g., 1MHz) has been used as the adjusted bandwidth.
Optionally, the initial bandwidth used by the first network device is 20MHz, and the bandwidth is adjusted to 1MHz when a probe response corresponding to a probe request sent with the initial bandwidth is not received. The first network device directly adopts the minimum bandwidth of 1MHz as the adjustment bandwidth to obtain the maximum coverage range of the detection request, thereby avoiding adjusting the bandwidth used for sending the detection request for multiple times, saving the processing overhead and being beneficial to improving the efficiency of establishing the WLAN link.
Step 204, the first network device establishes a WLAN link with the second network device.
After the first network device receives a probe response corresponding to the probe request sent by the second network device, the first network device and the second network device establish a WLAN link, wherein the bandwidth of the WLAN link is the bandwidth adopted when the probe response is received.
Optionally, after receiving the probe response sent by the second network device, the first network device sends an association request to the second network device, where the association request is used to request to establish the WLAN link. The bandwidth of the association request is the same as the bandwidth adopted by the probe response. And after receiving the association request, the second network equipment sends an association response by adopting the same bandwidth as the association request. And after receiving the association response, the first network establishes a WLAN link with the second network equipment.
Optionally, the first network device sends first bandwidth capability information to the second network device, where the first bandwidth capability information is used to indicate bandwidth types supported by the first network device, and the second network device records the bandwidth types supported by the first network device. The first network device receives second bandwidth capability information sent by the second network device, the second bandwidth capability information is used for indicating bandwidth types supported by the second network device, and the first network device records the bandwidth types supported by the second network device. Illustratively, the first bandwidth capability information indicates that the first network device is capable of using bandwidths of 1MHz, 5MHz, 10MHz, and 20MHz, and the second bandwidth capability information indicates that the second network device is capable of using bandwidths of 1MHz, 5MHz, 10MHz, 20MHz, and 40 MHz. The first network device and the second network device record the bandwidth capability of the other side, so that the bandwidth which can be supported by both sides is used for data transmission in the subsequent bandwidth adjustment process. Optionally, the first network device carries the first bandwidth capability information in the association request and sends the association request to the second network device, and the second network device can carry the second bandwidth capability information in the association response and send the association response to the first network device.
Optionally, when the first network device receives probe responses sent by a plurality of second network devices, the first network device selects one network device from the plurality of second network devices as a target second network device according to a user requirement, and establishes a WLAN link with the target second network device. Illustratively, the first network device displays names of a plurality of second network devices to the user, and the user selects one second network device from the names, wherein the selected second network device is the target second network device.
Referring to fig. 2B, an interaction diagram of a WLAN link establishment procedure is illustrated. The first network device broadcasts a probe request using a 20MHz bandwidth as an initial bandwidth. The second network device does not receive the probe request sent by the first network device by using the 20MHz bandwidth. And under the condition that the first network equipment does not receive the probe response corresponding to the probe request, adopting the 1MHz bandwidth as the bandwidth adjustment broadcast probe request. And the second network equipment receives the detection request sent by the first network equipment by adopting the 1MHz bandwidth and sends the detection response by adopting the same bandwidth. And after receiving the detection response, the first network equipment sends an association request to the second network equipment by adopting the 1MHz bandwidth. And after receiving the association request, the second network equipment sends an association response to the first network equipment by adopting the same bandwidth. And after receiving the association response, the first network device establishes a WLAN link with the second network device, wherein the bandwidth of the WLAN link is 1 MHz.
In the scheme provided by the embodiment of the application, the detection request is sent again by adopting smaller adjustment bandwidth under the condition that the detection response corresponding to the detection request is not received, so that the detection range is expanded, and the WLAN link is ensured to be established successfully.
After the first network device and the second network device establish the WLAN link for data transmission, the bandwidth needs to be adjusted to meet the throughput requirement or avoid disconnection of the WLAN link, and the first network device can dynamically adjust the bandwidth through two ways, namely active adjustment or passive adjustment.
In an alternative embodiment provided based on the embodiment of fig. 2A, as shown in fig. 3A, the step 204 further includes the following steps. In this embodiment, an active adjustment method will be described.
Step 301, in the process of transmitting data by using the WLAN link, the first network device obtains the transceiving state information.
The transceiving state information is used for indicating the state of transceiving data by using the WLAN link. Optionally, the transceiving status information comprises at least one of: received signal strength, transmission success rate. The Received Signal Strength represents the Signal Strength of data Received by the first network device, and the first network device obtains the Received Signal Strength according to a Received Signal Strength Indication (RSSI). The transmission success rate indicates a success rate of the first network device transmitting data to the second network device.
Step 302, if the transceiving state information meets the preset condition, the first network device adjusts the bandwidth of the WLAN link to a first bandwidth, and sends a first information frame to the second network device by using the first bandwidth.
The preset condition is set according to at least one of the following conditions: received signal strength, transmission success rate. If the receiving and sending state information meets the preset condition, the first network equipment adjusts the bandwidth of the WLAN link; if the receiving and sending state information does not meet the preset condition, the first network equipment does not adjust the bandwidth of the WLAN link, and the original bandwidth is kept for data transmission.
In addition, it has been introduced above that the first network device records the bandwidth capability of the second network device, and the first bandwidth adopted is the kind of bandwidth that the second network device can support. As also described above, the bandwidths generally adopted in the WLAN include 1MHz, 5MHz, 10MHz, 20MHz, 40MHz, 80MHz, 160MHz, and the like, and the first network device adjusts the bandwidth step by step according to the division of the bandwidths when adjusting the bandwidth, illustratively, the current bandwidth is 10MHz, and if the bandwidth is increased by the first network device, the first bandwidth is 20 MHz; if the first network device throttles down the bandwidth, the first bandwidth is 5 MHz.
In the embodiment of the application, the first network device ensures the stationarity of bandwidth adjustment by recording the bandwidth capability of the second network device and adjusting the bandwidth step by step so as to reduce the influence on data transmission.
The first information frame is a message transmitted by the first network device and the second network device on the WLAN link, and the information frame may be a data frame or a management frame.
Optionally, if the transceiving state information meets a first preset condition, the first network device increases the bandwidth of the WLAN link; and if the receiving and sending state information meets the second preset condition, the first network equipment reduces the bandwidth of the WLAN link. If the receiving and sending state information does not accord with the first preset condition or the second preset condition, the first network equipment does not adjust the bandwidth of the WLAN link and keeps the original bandwidth for data transmission.
The first preset condition includes at least one of: the received signal strength is greater than a first signal strength threshold value, and the sending success rate is greater than a first power forming threshold value. The second preset condition includes at least one of: the received signal strength is less than a second signal strength threshold and the transmission success rate is less than a second power threshold. The first signal strength threshold value is larger than the second signal strength threshold value, and the first power forming threshold value is larger than the second power forming threshold value. The signal strength threshold and the success rate threshold may be preset based on practical experience or experimental data. Illustratively, the first signal strength threshold is 80dBm, the second signal strength threshold is 40dBm, the first power contribution is 90%, and the second power contribution is 70%. The received signal strength of the first network device is 90dBm, the sending success rate is 95%, and then the receiving and sending state information of the first network device meets the first preset condition, and the bandwidth of the WLAN link is increased.
Step 303, if the first network device receives a first acknowledgement signal corresponding to the first information frame sent by the second network device, the first network device determines to transmit data using the first bandwidth.
After receiving a first information frame sent by a first network device by using a first bandwidth, a second network device sends a first acknowledgement signal to the first network device if the second network device agrees to use the first bandwidth for subsequent data transmission. The first acknowledgement signal is used to indicate that the second network device agrees to adjust the bandwidth of the WLAN link. The bandwidth used by the second network device to send the first acknowledgement signal is the same as the first bandwidth used by the first network device to send the first information frame.
In one possible implementation, the second network device sends the first acknowledgement signal directly to the first network device after receiving the first information frame sent by the first network device. In another possible implementation manner, after receiving a first information frame sent by a first network device, a second network device detects whether the received signal strength of the first information frame is greater than a preset threshold, if so, sends a first acknowledgement signal corresponding to the first information frame to the first network device, and if not, does not send the first acknowledgement signal corresponding to the first information frame to the first network device. The preset threshold value can be preset according to actual experience or experimental data. The second network device ensures that data sent by the first bandwidth adopted by the first network device can be correctly received by the second network device by detecting whether the received signal strength of the first information frame is greater than a preset threshold value.
Optionally, if the first network device does not receive the first acknowledgement signal corresponding to the first information frame sent by the second network device, the first network device still uses the original bandwidth for data communication.
Optionally, the first acknowledgement signal is used to indicate that the second network device has correctly received the first information frame, and is also used to indicate that the second network device agrees to adjust the bandwidth of the WLAN link.
Referring to fig. 3B, an interaction diagram of a bandwidth adjustment process is illustrated. The WLAN link is already established between the first network device and the second network device, and data transmission is carried out at the bandwidth of 20 MHz. The first network equipment transmits the data _ sn1000 in a 20MHz bandwidth, and if the transmission fails, the first network equipment reduces the bandwidth to 10MHz and retransmits the data _ sn1000 in a 10MHz bandwidth. After the second network device receives the data _ sn1000 sent by the first network device in the 10MHz bandwidth, if the bandwidth is agreed to be adjusted from 20MHz to 10MHz, the acknowledgement signal ack _ sn1000 is sent in the 10MHz bandwidth, which indicates that the second network device has correctly received the data _ sn 1000. After receiving the acknowledgement signal ack _ sn1000, the first network device performs data transmission with the second network device in a bandwidth of 10 MHz.
In the scheme provided by the embodiment of the application, the network device can dynamically adjust the bandwidth of the WLAN link according to the transceiving state information, and balance between the throughput rate requirement and the signal coverage requirement is kept. The requirement of throughput rate is met to the maximum extent on the premise of ensuring that the WLAN link is not disconnected.
In another alternative embodiment provided based on the embodiment of fig. 2A, as shown in fig. 4A, the step 204 further includes the following steps. In the present embodiment, a passive adjustment method will be described.
Step 401, in the process of transmitting data by using the WLAN link, the second network device obtains the transceiving state information.
The transceiving state information is used for indicating the state of transceiving data by using the WLAN link. Optionally, the transceiving status information comprises at least one of: received signal strength, transmission success rate. The received signal strength represents the signal strength of the data received by the second network device. The transmission success rate indicates a success rate at which the second network device transmits data to the first network device.
Step 402, if the transceiving state information meets the preset condition, the second network device adjusts the bandwidth of the WLAN link to a second bandwidth, and sends a second information frame to the first network device by using the second bandwidth.
For the bandwidth adjustment process of the second network device, reference may be made to the bandwidth adjustment process of the first network device in the embodiment of fig. 3A, which is not described in detail in this embodiment.
Step 403, if the first network device receives a second information frame sent by the second network device using the second bandwidth, sending a second acknowledgement signal corresponding to the second information frame to the second network device.
After receiving a second information frame sent by a second network device by using a second bandwidth, if the first network device agrees to use the second bandwidth for subsequent data transmission, sending a second acknowledgement signal to the second network device. The second acknowledgement signal is used to indicate that the first network device agrees to adjust the bandwidth of the WLAN link. The bandwidth used by the first network device to send the second acknowledgement signal is the same as the second bandwidth used by the second network device to send the second information frame.
In one possible implementation, the first network device sends the second acknowledgement signal directly to the second network device after receiving the second information frame sent by the second network device. In another possible implementation, after receiving a second information frame sent by a second network device, a first network device detects whether the received signal strength of the second information frame is greater than a preset threshold, if so, sends a second acknowledgement signal corresponding to the second information frame to the second network device, and if not, does not send the second acknowledgement signal corresponding to the second information frame to the second network device. The preset threshold value can be preset according to actual experience or experimental data. The first network device ensures that the data sent by the second bandwidth adopted by the second network device can be correctly received by the first network device by detecting whether the received signal strength of the second information frame is greater than a preset threshold value.
Optionally, if the second network device does not receive the second acknowledgement signal corresponding to the second information frame sent by the first network device, the second network device still uses the original bandwidth for data communication.
Optionally, the second acknowledgement signal is used to indicate that the first network device has correctly received the second information frame, and at the same time, is used to indicate that the first network device agrees to adjust the bandwidth of the WLAN link.
Referring to fig. 4B, an interaction diagram of a bandwidth adjustment process is illustrated. The WLAN link is already established between the first network device and the second network device, and data transmission is carried out at the bandwidth of 10 MHz. The second network equipment transmits the data _ sn1000 in a bandwidth of 10MHz, and if the transmission fails, the second network equipment reduces the bandwidth to 5MHz and retransmits the data _ sn1000 in a bandwidth of 5 MHz. After the first network device receives the data _ sn1000 sent by the second network device in the 5MHz bandwidth, if the bandwidth is agreed to be adjusted from 10MHz to 5MHz, the first network device sends an acknowledgement signal ack _ sn1000 in the 5MHz bandwidth, which indicates that the first network device has correctly received the data _ sn 1000. And after receiving the acknowledgement signal ack _ sn1000, the second network equipment performs data transmission with the first network equipment in a bandwidth of 5 MHz.
In the scheme provided by the embodiment of the application, the network device can dynamically adjust the bandwidth of the WLAN link according to the transceiving state information, and balance between the throughput rate requirement and the signal coverage requirement is kept. The requirement of throughput rate is met to the maximum extent on the premise of ensuring that the WLAN link is not disconnected.
In the following, the scheme provided by the embodiments of the present application is described by two examples.
Referring to fig. 5, in an example, an application scenario in which the smart phone 51 is used to control the drone 52 is taken as an example. Adopt different bandwidth at different distances, guarantee that the operator can obtain bigger control range, in time retrieve unmanned aerial vehicle 52. When the distance between the unmanned aerial vehicle 52 and the smart phone 51 is less than 0.1km, transmitting a high-definition video by using a 40MHz bandwidth; when the distance between the unmanned aerial vehicle 52 and the smart phone 51 becomes 0.1km to 0.5km, the smart phone 51 reduces the bandwidth according to the receiving and sending state information, and reduces the bandwidth to 20MHz to transmit the common video; when the distance between the unmanned aerial vehicle 52 and the smart phone 51 exceeds 0.5km, the smart phone 51 further reduces the bandwidth according to the transceiving state information, reduces the bandwidth to 1MHz, and ensures that the control message for controlling the unmanned aerial vehicle 52 can be correctly received by the unmanned aerial vehicle 52. By the method, the transmission distance of the control message can be further ensured, the reliability is improved, and the accident caused by the loss of the control message is avoided.
Referring to fig. 6, in another example, an application scenario of communication between two smartphones 61 and 62 is taken as an example. When the distance between the smart phone 61 and the smart phone 62 exceeds 1000 meters, text communication is carried out by using a 1MHz bandwidth; when the distance between the smart phone 61 and the smart phone 62 is 50-1000 m, voice communication is carried out by using a 5MHz bandwidth; when the distance between the smart phone 61 and the smart phone 62 is less than 50 meters, video communication is performed by using a 10MHz bandwidth. By the mode, different bandwidths are adopted at different distances, and therefore the communication is carried out by adopting a proper communication mode.
The above description mainly introduces the solutions provided in the embodiments of the present application from the perspective of interaction between the first network device and the second network device. It is understood that the network devices (e.g., the first network device, the second network device) include corresponding hardware structures and/or software modules for performing the above functions. The elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein may be embodied in hardware or in a combination of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present teachings.
In the embodiment of the present application, the network devices (e.g., the first network device and the second network device) may be divided according to the above method examples, for example, each functional unit may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 7A shows a schematic diagram of a possible structure of the network device involved in the above embodiments, in the case of an integrated unit. The network device 700 includes: a processing unit 702 and a communication unit 703. The processing unit 702 is configured to control and manage actions of the network device 700. For example, when network device 700 is a first network device, processing unit 702 is configured to enable network device 700 to perform steps 201 through 204 in fig. 2A, steps 301 through 303 in fig. 3A, and/or to perform other steps of the techniques described herein. When network device 700 is a second network device, processing unit 702 is configured to enable network device 700 to perform steps 401 through 403 in fig. 4A, and/or to perform other steps of the techniques described herein. The communication unit 703 is used to support communication between the network device 700 and other network devices. The network device 700 may also include a storage unit 701 for storing program codes and data of the network device 700.
The Processing Unit 702 may be a Processor or a controller, such as a Central Processing Unit (CPU), a general-purpose Processor, a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, DSPs, and microprocessors, among others. The communication unit 703 may be a communication interface, a transceiver circuit, etc., wherein the communication interface is a generic term and may include one or more interfaces, such as an interface between a first network device and a second network device. The memory unit 701 may be a memory.
When the processing unit 702 is a processor, the communication unit 703 is a communication interface, and the storage unit 701 is a memory, the network device according to the embodiment of the present application may be the network device shown in fig. 7B.
Referring to fig. 7B, the network device 710 includes: a processor 712, a communication interface 713, and a memory 711. Optionally, network device 710 may also include a bus 714. Wherein the communication interface 713, the processor 712, and the memory 711 may be connected to each other by a bus 714; the bus 714 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 714 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 7B, but this is not intended to represent only one bus or type of bus.
The network device shown in fig. 7A or fig. 7B may be the first network device or the second network device.
The steps of the method described in connection with the disclosure of the embodiments of the present application may be implemented in hardware or may be implemented by a processor executing software instructions. The software instructions may be comprised of corresponding software modules that may be stored in Random Access Memory (RAM), flash Memory, Read Only Memory (ROM), Erasable Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), registers, a hard disk, a removable disk, a compact disc Read Only Memory (CD-ROM), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be integral to the processor. The processor and the storage medium may reside in an ASIC. Additionally, the ASIC may reside in a network device. Of course, the processor and the storage medium may reside as discrete components in a network device.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the embodiments of the present application in further detail, and it should be understood that the above-mentioned embodiments are only specific embodiments of the present application, and are not intended to limit the scope of the embodiments of the present application, and any modifications, equivalent substitutions, improvements and the like made on the basis of the technical solutions of the embodiments of the present application should be included in the scope of the embodiments of the present application.