WIFI connection method and device, storage medium and mobile terminal

文档序号:516950 发布日期:2021-05-28 浏览:9次 中文

阅读说明:本技术 Wifi连接方法、装置、存储介质及移动终端 (WIFI connection method and device, storage medium and mobile terminal ) 是由 俞斌 于 2021-03-17 设计创作,主要内容包括:本申请实施例提供一种WIFI连接方法、装置、存储介质及移动终端,该WIFI连接方法包括:获取目的终端发送的WIFI连接请求,根据该WIFI连接请求从N个预设WIFI信道中随机选择一个预设WIFI信道作为第一目标信道,N≥1,然后通过该第一目标信道与目的终端建立WIFI连接,避免在同一区域内有大量移动设备同时使用同一信道进行通信,从而减少数据传输过程中受到的干扰,提高显示数据的传输效率,进而提升显示画面效果。(The embodiment of the application provides a WIFI connection method, a WIFI connection device, a storage medium and a mobile terminal, wherein the WIFI connection method comprises the following steps: the method comprises the steps of obtaining a WIFI connection request sent by a target terminal, randomly selecting a preset WIFI channel from N preset WIFI channels according to the WIFI connection request to serve as a first target channel, wherein N is larger than or equal to 1, and then establishing WIFI connection with the target terminal through the first target channel, so that a large number of mobile devices in the same area are prevented from simultaneously using the same channel to communicate, interference in a data transmission process is reduced, transmission efficiency of display data is improved, and a picture display effect is improved.)

1. A WIFI connection method is applied to a mobile terminal, and comprises the following steps:

acquiring a WIFI connection request sent by a target terminal;

randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and establishing WIFI connection with the target terminal through the first target channel.

2. The WIFI connection method of claim 1, further comprising:

establishing WIFI connection with a target terminal through a default WIFI channel according to the WIFI connection request;

the establishing of the WIFI connection with the destination terminal through the first target channel includes:

and switching the default WIFI channel to the first target channel so as to reestablish WIFI connection with the target terminal through the first target channel.

3. The WIFI connection method according to claim 1, wherein the randomly selecting one preset WIFI channel from N preset WIFI channels as the first target channel includes:

establishing a one-to-one corresponding relation between the N preset WIFI channels and numbers 0 to N-1;

generating a random number and calculating the remainder of dividing the random number by the N;

and taking the preset WIFI channel corresponding to the remainder as the first target channel.

4. The WIFI connection method according to claim 3, wherein N is 8, and the N preset WIFI channels include channel 2, channel 3, channel 4, channel 5, channel 7, channel 8, channel 9, and channel 10;

the taking the preset WIFI channel corresponding to the remainder as the first target channel includes:

if the remainder is 0, taking the corresponding channel 2 as a first target channel;

if the remainder is 1, taking the corresponding channel 3 as a first target channel;

if the remainder is 2, taking the corresponding channel 4 as a first target channel;

if the remainder is 3, taking the corresponding channel 5 as a first target channel;

if the remainder is 4, taking the corresponding channel 7 as a first target channel;

if the remainder is 5, taking the corresponding channel 8 as a first target channel;

if the remainder is 6, taking the corresponding channel 9 as a first target channel;

if the remainder is 7, the corresponding channel 10 is taken as the first target channel.

5. The WIFI connection method of claim 1, further comprising:

acquiring display state data fed back by the target terminal;

detecting whether the display state data meets a preset state condition;

if yes, randomly selecting one preset WIFI channel from the N preset WIFI channels as a second target channel;

and switching the first target channel into the second target channel so as to reestablish the WIFI connection with the target terminal through the second target channel.

6. The WIFI connection method according to claim 5, wherein the display state data comprises a maximum pixel difference value of all adjacent two pixels in a display image of the destination terminal;

the detecting whether the display state data meets a preset state condition includes:

judging whether the maximum pixel difference value is larger than a preset value or not;

if so, determining that the display state data meets a preset state condition;

if not, determining that the display state data does not meet the preset state condition.

7. The WIFI connection method according to claim 5, wherein the randomly selecting one preset WIFI channel from the N preset WIFI channels as a second target channel comprises:

acquiring the equipment access number of each preset WIFI channel in the N preset WIFI channels;

and randomly selecting one preset WIFI channel from the preset WIFI channels with the minimum access quantity of the equipment as the second target channel.

8. A WIFI connection device is applied to a mobile terminal, and comprises:

the WIFI connection request acquisition module is used for acquiring a WIFI connection request sent by a target terminal;

the first target channel selection module is used for randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and the WIFI connection module is used for establishing WIFI connection with the target terminal through the first target channel.

9. A computer-readable storage medium having stored thereon a plurality of instructions adapted to be loaded by a processor to perform the WIFI connectivity method of any of claims 1-7.

10. A mobile terminal comprising a processor and a memory, the processor being electrically connected to the memory, the memory being configured to store instructions and data, the processor being configured to perform the steps of the WIFI connectivity method of any one of claims 1-7.

Technical Field

The present application relates to the field of communications technologies, and in particular, to a WIFI connection method, apparatus, storage medium, and mobile terminal.

Background

With the rapid development of modern communication technology, the WIFI (Wireless Fidelity) display technology is widely applied in various fields. The principle of the WIFI display technology is to transmit the current display data of the mobile device to other devices (e.g., televisions, computers) by wireless, and then convert the display data into HDMI signals for displaying, so that the current display content of the mobile device can be displayed by the other devices in real time. However, in the process of using the mobile device, a default channel is usually selected as the WIFI connection channel, so that a large number of mobile devices in the same area use the default channel for communication, and are highly susceptible to signal interference of the same frequency in the process of transmitting display data, thereby affecting transmission of the display data, and further causing poor display picture effect.

Disclosure of Invention

The embodiment of the application provides a WIFI connection method, a WIFI connection device, a WIFI connection storage medium and a mobile terminal, which can reduce interference in a data transmission process so as to improve transmission efficiency of display data and improve a display picture effect.

The embodiment of the application provides a WIFI connection method, which is applied to a mobile terminal and comprises the following steps:

acquiring a WIFI connection request sent by a target terminal;

randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and establishing WIFI connection with the target terminal through the first target channel.

Wherein the method further comprises:

establishing WIFI connection with a target terminal through a default WIFI channel according to the WIFI connection request;

the establishing of the WIFI connection with the destination terminal through the first target channel includes:

and switching the default WIFI channel to the first target channel so as to reestablish WIFI connection with the target terminal through the first target channel.

Wherein, the randomly selecting one preset WIFI channel from the N preset WIFI channels as a first target channel comprises:

establishing a one-to-one corresponding relation between the N preset WIFI channels and numbers 0 to N-1;

generating a random number and calculating the remainder of dividing the random number by the N;

and taking the preset WIFI channel corresponding to the remainder as the first target channel.

Wherein N is 8, and the N preset WIFI channels include channel 2, channel 3, channel 4, channel 5, channel 7, channel 8, channel 9, and channel 10;

the taking the preset WIFI channel corresponding to the remainder as the first target channel includes:

if the remainder is 0, taking the corresponding channel 2 as a first target channel;

if the remainder is 1, taking the corresponding channel 3 as a first target channel;

if the remainder is 2, taking the corresponding channel 4 as a first target channel;

if the remainder is 3, taking the corresponding channel 5 as a first target channel;

if the remainder is 4, taking the corresponding channel 7 as a first target channel;

if the remainder is 5, taking the corresponding channel 8 as a first target channel;

if the remainder is 6, taking the corresponding channel 9 as a first target channel;

if the remainder is 7, the corresponding channel 10 is taken as the first target channel.

Wherein the method further comprises:

acquiring display state data fed back by the target terminal;

detecting whether the display state data meets a preset state condition;

if yes, randomly selecting one preset WIFI channel from the N preset WIFI channels as a second target channel;

and switching the first target channel into the second target channel so as to reestablish the WIFI connection with the target terminal through the second target channel.

The display state data comprises the maximum pixel difference value of all adjacent two pixels in the display image of the destination terminal;

the detecting whether the display state data meets a preset state condition includes:

judging whether the maximum pixel difference value is larger than a preset value or not;

if so, determining that the display state data meets a preset state condition;

if not, determining that the display state data does not meet the preset state condition.

Wherein, the randomly selecting one preset WIFI channel from the N preset WIFI channels as a second target channel includes:

acquiring the equipment access number of each preset WIFI channel in the N preset WIFI channels;

and randomly selecting one preset WIFI channel from the preset WIFI channels with the minimum access quantity of the equipment as the second target channel.

The embodiment of the application further provides a WIFI connecting device, which is applied to a mobile terminal, and the device comprises:

the WIFI connection request acquisition module is used for acquiring a WIFI connection request sent by a target terminal;

the first target channel selection module is used for randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and the WIFI connection module is used for establishing WIFI connection with the target terminal through the first target channel.

The embodiment of the application also provides a computer-readable storage medium, wherein a plurality of instructions are stored in the storage medium, and the instructions are suitable for being loaded by a processor to execute any one of the WIFI connection methods.

The embodiment of the application further provides a mobile terminal, which comprises a processor and a memory, wherein the processor is electrically connected with the memory, the memory is used for storing instructions and data, and the processor is used for executing the steps in any WIFI connection method.

The embodiment of the application provides a WIFI connection method, a WIFI connection device, a storage medium and a mobile terminal, a WIFI connection request sent by a target terminal is obtained, a preset WIFI channel is randomly selected from N preset WIFI channels according to the WIFI connection request to serve as a first target channel, N is larger than or equal to 1, then WIFI connection is established with the target terminal through the first target channel, a large number of mobile devices in the same area are prevented from simultaneously using the same channel for communication, interference in the data transmission process is reduced, the transmission efficiency of display data is improved, and the picture display effect is further improved.

Drawings

The technical solution and other advantages of the present application will become apparent from the detailed description of the embodiments of the present application with reference to the accompanying drawings.

Fig. 1 is a schematic flow diagram of a WIFI connection method provided in an embodiment of the present application.

Fig. 2 is a schematic diagram of a data transmission scenario provided in an embodiment of the present application.

Fig. 3 is another schematic flow diagram of a WIFI connection method provided in an embodiment of the present application.

Fig. 4 is a schematic structural diagram of a WIFI connection device provided in an embodiment of the present application.

Fig. 5 is another schematic structural diagram of a WIFI connection device according to an embodiment of the present application.

Fig. 6 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application.

Fig. 7 is another schematic structural diagram of a mobile terminal according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The embodiment of the application provides a WIFI connection method and device, a storage medium and a mobile terminal.

As shown in fig. 1, fig. 1 is a schematic flowchart of a WIFI connection method provided in an embodiment of the present application, where the WIFI connection method is applied to a mobile terminal, and the mobile terminal may be a device supporting WIFI connection, such as a smart phone and an iPad, and a specific flow may be as follows:

and S101, acquiring a WIFI connection request sent by a target terminal.

The mobile terminal in the embodiment of the present application may be a source terminal. The WIFI connection request is sent by the destination terminal, for example, the mobile terminal opens a WIFI hotspot, and when the destination terminal is located within a WIFI coverage range of the mobile terminal, the destination terminal can search and request to connect the WIFI hotspot, namely, the WIFI connection request is sent to the mobile terminal.

S102, randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1.

When the mobile terminal receives the WIFI connection request, the identity of the mobile terminal in the peer-to-peer connection equipment group needs to be converted into a group administrator through a configuration algorithm, at the moment, the mobile terminal obtains the permission of selecting the WIFI channel, and one preset WIFI channel can be selected from N preset WIFI channels to serve as a first target channel. The existing channels used for wireless communication include 14 channels (channel 1 to channel 14), and since the frequency range of all WIFI signals is between 2400-. Since the channel 1, the channel 6 and the channel 11 are far apart from each other, the frequencies of the channels are not easily overlapped with each other, that is, signal interference does not easily occur between the three channels, so that the three channels become default WIFI channels, but a large number of mobile terminals in the same area all use the default WIFI channels to perform data transmission, and are easily interfered by signals with the same frequency in the data transmission process, so that the data transmission speed is delayed, and even data loss is caused.

In order to avoid the foregoing situation, preferably, the mobile terminal in this embodiment of the application does not perform WIFI connection with the destination terminal through the default WIFI channel any more, that is, the N preset WIFI channels do not include channel 1, channel 6, and channel 11, that is, the N preset WIFI channels include channel 2, channel 3, channel 4, channel 5, channel 7, channel 8, channel 9, and channel 10, so that one preset WIFI channel may be selected from the 8 preset WIFI channels as the first target channel.

In order to avoid that a large number of mobile terminals in the same area simultaneously select the same WIFI channel from N preset WIFI channels and still cause interference of the same frequency signal in the data transmission process, in the embodiment of the present application, a random algorithm is adopted, and one preset WIFI channel is selected from the N preset WIFI channels as a first target channel, where the random algorithm is an algorithm that randomly selects a next calculation step in the execution process of the random algorithm by using a probability and a statistical method.

Optionally, the step S102 specifically includes:

establishing a one-to-one corresponding relation between the N preset WIFI channels and numbers 0 to N-1;

generating a random number and calculating the remainder of dividing the random number by the N;

and taking the preset WIFI channel corresponding to the remainder as the first target channel.

Each preset WIFI channel can correspond to one number, preferably, the value of N is 8, and then 8 preset WIFI channels correspond to 8 numbers (0 to 7) one to one. For example, the channel 2 is a preset WIFI channel with an operating frequency of 2417MHz, and corresponds to the number 0; the channel 3 is a preset WIFI channel with the working frequency of 2422MHz and corresponds to the number 1; the channel 4 is a preset WIFI channel with the working frequency of 2427MHz and corresponds to the number 2; the channel 5 is a preset WIFI channel with the working frequency of 2432MHz and corresponds to the number 3; the channel 7 is a preset WIFI channel with the working frequency of 2442MHz and corresponds to the number 4; the channel 8 is a preset WIFI channel with the working frequency of 2447MHz and corresponds to the number 5; the channel 9 is a preset WIFI channel with the working frequency of 2452MHz and corresponds to the number 6; the channel 10 is a preset WIFI channel with a working frequency of 2457MHz, and corresponds to the number 7. A random number may then be generated by the linear congruential random number generator and the remainder of the random number divided by 8, which is between the numbers 0 and 7, is calculated. Therefore, according to the corresponding relation between the 8 preset WIFI channels and the 8 numbers, a first target channel corresponding to the remainder is determined. Specifically, if the remainder is 0, the corresponding channel 2 is taken as the first target channel; if the remainder is 1, taking the corresponding channel 3 as a first target channel; if the remainder is 2, taking the corresponding channel 4 as a first target channel; if the remainder is 3, taking the corresponding channel 5 as a first target channel; if the remainder is 4, taking the corresponding channel 7 as a first target channel; if the remainder is 5, taking the corresponding channel 8 as a first target channel; if the remainder is 6, taking the corresponding channel 9 as a first target channel; if the remainder is 7, the corresponding channel 10 is taken as the first target channel.

For example, the generated random number is 68, since the remainder of division of 68 by 8 is 4, and the preset WIFI channel corresponding to the number 4 is channel 7, channel 7 is selected as the first target channel.

And S103, establishing WIFI connection with the target terminal through the first target channel.

Specifically, the mobile terminal and the destination terminal may be devices supporting WIFI connection, such as a mobile phone and an iPad, as shown in fig. 2, after the mobile terminal 2001 selects the first target channel, the mobile terminal 2001 and the destination terminal 2004 may establish WIFI connection through the selected first target channel.

In one embodiment, when a WIFI connection request sent by a destination terminal is received, a preset WIFI channel is randomly selected from N preset WIFI channels directly according to the WIFI connection request to serve as a first target channel, and a WIFI connection is established with the destination terminal through the first target channel.

In another embodiment, since a certain time is consumed in the process of determining the first target channel, when receiving a WIFI connection request sent by a target terminal, the mobile terminal establishes a WIFI connection with the target terminal through a default WIFI channel, and after determining the first target channel, switches the default WIFI channel to the first target channel, so as to reestablish the WIFI connection with the target terminal through the first target channel, thereby avoiding the problem of too long time consumed by the WIFI connection, and further improving the efficiency of the WIFI connection.

Optionally, after the mobile terminal and the destination terminal establish a WIFI connection through a default WIFI channel, whether the currently used default WIFI channel is switched to the first target channel may be randomly selected through a random algorithm, so as to balance the access number of the mobile devices of each preset WIFI channel, and avoid channel waste caused by no mobile device access of the default WIFI channel.

The mobile terminal and the target terminal can perform data transmission through the first target channel after the WIFI connection is established between the mobile terminal and the target terminal through the first target channel, optionally, the mobile terminal encodes data to be transmitted and transmits the encoded data to be transmitted to the target terminal through the first target channel, and the target terminal decodes the encoded data to be transmitted after receiving the encoded data to be transmitted, so that data transmission is completed. For example, the mobile terminal encodes image data and transmits the encoded image data to the destination terminal, and the destination terminal receives the image data and decodes and displays the image data.

In one embodiment, the method further comprises:

acquiring display state data fed back by a target terminal;

detecting whether the display state data meets a preset state condition;

if yes, randomly selecting one preset WIFI channel from the N preset WIFI channels as a second target channel;

and switching the first target channel into a second target channel so as to reestablish the WIFI connection with the target terminal through the second target channel.

The display state data comprises the maximum pixel difference value of all the adjacent two pixels in the display image. The destination terminal first obtains YUV values (including Y, U, V three components, "Y" represents a gray-scale value, "U" and "V" represent chrominance, which is used to describe the color of a designated pixel) or RGB values (including R, G, B three components, which are used to represent the luminance of a pixel) of each pixel in a display image, calculates pixel difference values of all adjacent two pixels, the pixel difference values refer to the difference values of Y component, U component, V component, R component, G component, and B component, then obtains the maximum pixel difference value of all adjacent two pixels, and sends the maximum pixel difference value to the mobile terminal.

The preset state condition may be whether the maximum pixel difference value between all two adjacent pixels is greater than a preset value, specifically, the maximum pixel difference value is the maximum difference value of any same component in any two pixels.

After the mobile terminal acquires the maximum difference value of any one of the same components in all the two adjacent pixels fed back by the target terminal, judging whether the maximum difference value is larger than a preset value, if the difference value of any one of the same components in all the two adjacent pixels is smaller than or equal to the preset value, determining that the display state data does not meet the preset state condition, namely that the display data received by the target terminal is normal, namely that no interference exists in the first target channel, and therefore, the first target channel can be continuously used for communication; if the difference value of any one of the same components of the two pixels is larger than the preset value, the display state data is determined to meet the preset state condition, the display data received by the target terminal is incomplete, namely the signal interference exists in the first target channel, at the moment, the mobile terminal switches the first target channel used currently to the second target channel, and then the WIFI connection is reestablished with the target terminal through the second target channel.

For example, the preset value is 50, and the mobile terminal determines that the maximum difference value of the Y components in all two adjacent pixels fed back by the destination terminal is 55, and then determines that the difference value is greater than 50, so that it is determined that the display state data meets the preset state condition, and therefore, one preset WIFI channel is randomly selected from the N preset WIFI channels as the second target channel, and the first target channel is switched to the second target channel, so that the WIFI connection is reestablished with the destination terminal through the second target channel.

Alternatively, the destination terminal may send a channel switch request to the mobile terminal. Specifically, when the destination terminal detects that the maximum difference value of any one of the same components in all the two adjacent pixels is greater than a preset value, the destination terminal sends a channel switching request to the mobile terminal, after receiving the channel switching request, the mobile terminal randomly selects one preset WIFI channel from the N preset WIFI channels as a second target channel, switches the first target channel into the second target channel, and reestablishes the WIFI connection with the destination terminal through the second target channel.

For example, the preset value is 50, the destination terminal detects that the maximum difference value of G components in all two adjacent pixels is 60, and determines that the maximum difference value is greater than the preset value, so that a channel switching request is sent to the mobile terminal, after receiving the channel switching request, the mobile terminal randomly selects one preset WIFI channel from the N preset WIFI channels as a second target channel, and switches the first target channel into the second target channel, so as to reestablish WIFI connection with the destination terminal through the second target channel.

Specifically, a specific implementation manner of randomly selecting one preset WIFI channel from the N preset WIFI channels as the second target channel is as follows:

in one embodiment, the mobile terminal randomly selects one WIFI channel as the second target channel through a random algorithm from other preset WIFI channels except the first target channel.

In another embodiment, the mobile terminal obtains the current access number of the mobile devices in all the preset WIFI channels, and randomly selects one preset WIFI channel from the preset WIFI channels with the smallest access number as the second target channel through a random algorithm.

In another embodiment, the mobile terminal detects the current access number of the mobile devices with other preset WIFI channels except the first target channel, and selects the preset WIFI channel with the smallest access number as the second target channel, and if there are a plurality of preset WIFI channels with the smallest access number, selects one of the preset WIFI channels with the smallest access number as the second target channel through a random algorithm.

As shown in fig. 3, fig. 3 is another schematic flow diagram of the WIFI connection method provided in the embodiment of the present application, and the specific flow may be as follows:

s201, establishing one-to-one corresponding relation between N preset WIFI channels and numbers 0 to N-1.

For example, the value of N is 8, and channel 2 is a preset WIFI channel with an operating frequency of 2417MHz, corresponding to the number 0; the channel 3 is a preset WIFI channel with the working frequency of 2422MHz and corresponds to the number 1; the channel 4 is a preset WIFI channel with the working frequency of 2427MHz and corresponds to the number 2; the channel 5 is a preset WIFI channel with the working frequency of 2432MHz and corresponds to the number 3; the channel 7 is a preset WIFI channel with the working frequency of 2442MHz and corresponds to the number 4; the channel 8 is a preset WIFI channel with the working frequency of 2447MHz and corresponds to the number 5; the channel 9 is a preset WIFI channel with the working frequency of 2452MHz and corresponds to the number 6; the channel 10 is a preset WIFI channel with a working frequency of 2457MHz, and corresponds to the number 7.

S202, when a WIFI connection request sent by a target terminal is received, a random number is generated, and the remainder of dividing the random number by N is calculated.

For example, as shown in fig. 2, a user clicks a "hotspot state" control 2003 on a mobile network sharing interface 2002 in a mobile terminal 2001 to open a WIFI hotspot, at this time, the mobile terminal 2001 serves as an access point of a WIFI network, and covers a WIFI hotspot signal within an effective range, a destination terminal 2004 within a range covered with the WIFI hotspot signal clicks a "WIFI" control 2006 on a WIFI interface 2005 to search for a nearby available WIFI network, after detecting the WIFI hotspot signal, a network selection control 2007 for accessing to the WIFI hotspot network of the mobile terminal 2001 is selected from an available network list in the WIFI interface 2005, and a WIFI network connection password is input, and when the password verification is passed, a WIFI connection request is sent to the mobile terminal 2001. After receiving the WIFI connection request, the mobile terminal generates a random number 325, and calculates a remainder obtained by dividing 325 by 8 to be 5.

And S203, taking the preset WIFI channel corresponding to the remainder as a first target channel.

For example, since the remainder obtained by dividing the random number 325 by 8 is 5, and the preset WIFI channel corresponding to the number 5 is the channel 8, the channel 8 is taken as the first target channel.

And S204, establishing WIFI connection with the target terminal through the first target channel.

For example, when it is determined that the channel 8 is the first target channel, the mobile terminal 2001 establishes a WIFI connection with the destination terminal 2004 through the channel 8, displays the number of connected devices on the mobile network sharing interface 2002 in the mobile terminal 2001, and displays the WIFI network identifier 2008 on the screen of the destination terminal 2004.

Optionally, when a WIFI connection request sent by the destination terminal is received, firstly, a WIFI connection is established with the destination terminal through a default WIFI channel, and then the default WIFI channel is switched to a first target channel, so that the WIFI connection is reestablished with the destination terminal through the first target channel.

For example, the mobile terminal 2001 sets a WIFI channel thereof as a channel 6 when leaving the factory, and after the mobile terminal 2001 receives a WIFI connection request sent by the destination terminal 2004, firstly, a WIFI connection is established with the destination terminal 2004 through the channel 6 by default, then, a channel 8 is selected as a first target channel through a random algorithm, and then, the channel 6 is switched to the channel 8, so that the WIFI connection is established with the destination terminal 2004 through the channel 8.

And S205, obtaining display state data fed back by the destination terminal through the first target channel.

For example, the mobile terminal 2001 encodes a picture data and transmits the picture data to the destination terminal 2004 through the channel 8, and the destination terminal 2004 decodes the picture data after receiving the picture data and feeds back the maximum difference value of any one same component of any two adjacent pixels in the picture data to the mobile terminal 2001.

S206, detecting whether the display state data meets the preset state condition, if so, executing the step S207, otherwise, returning to the step S205.

For example, if the preset condition is that the maximum difference value of any one same component of any two adjacent pixels in the picture data is greater than 50, the mobile terminal 2001 detects that the maximum difference value of V components of any two adjacent pixels in the picture data is 60, that is, it indicates that the picture data satisfies the preset condition, and step S207 is executed; if the maximum difference value of any identical component of any two adjacent pixels in the picture data is 35, that is, the picture data does not satisfy the preset state, the process returns to step S205.

S207, the device access number of each preset WIFI channel in the N preset WIFI channels is obtained, one preset WIFI channel is randomly selected from the preset WIFI channels with the minimum device access number to serve as a second target channel, the first target channel is switched to the second target channel, and WIFI connection is reestablished with the target terminal through the second target channel.

For example, if it is detected that the current mobile device in the 8 preset WIFI channels has the least number of access channels 4 and 7, channel 4 is selected as the second target channel through a random algorithm, channel 8 is switched to channel 4, and then the WIFI connection is reestablished with the destination terminal 2004 through channel 4.

Therefore, the WIFI connection method is applied to the mobile terminal, the WIFI connection request sent by the target terminal is obtained, one preset WIFI channel is randomly selected from N preset WIFI channels according to the WIFI connection request to serve as the first target channel, N is larger than or equal to 1, then the WIFI connection is established with the target terminal through the first target channel, a large number of mobile devices in the same area are prevented from simultaneously using the same channel for communication, interference in the data transmission process is reduced, the transmission efficiency of display data is improved, and the picture display effect is further improved.

According to the method described in the foregoing embodiment, the present embodiment will be further described from the perspective of a WIFI connection device, which may be specifically implemented as an independent entity, or integrated in a mobile terminal, where the mobile terminal may be a smart phone, an iPad, or other devices.

Referring to fig. 4, fig. 4 specifically describes the WIFI connection device provided in the embodiment of the present application, which is applied to a mobile terminal, and the WIFI connection device may include: WIFI connection request acquisition module 10, first target channel selection 20, and WIFI connection module 30, wherein:

(1) WIFI connection request acquisition module 10

And the WIFI connection request obtaining module 10 is configured to obtain a WIFI connection request sent by a destination terminal.

For example, the mobile terminal opens a WIFI hotspot, when the destination terminal searches for an available wireless network nearby, the destination terminal can search for and request to connect to the WIFI hotspot, and at this time, the mobile terminal can obtain the WIFI connection request.

(2) First target channel selection module 20

And the first target channel selection module 20 is configured to randomly select one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, where N is greater than or equal to 1. The first target channel selection module 20 specifically includes:

the corresponding relation establishing unit 21 is configured to establish a one-to-one corresponding relation between N preset WIFI channels and numbers 0 to N-1;

a remainder calculation unit 22 for generating a random number and calculating a remainder of dividing the random number by N;

the first target channel selecting unit 23 is configured to use the preset WIFI channel corresponding to the remainder as a first target channel, where if the remainder is 0, the corresponding channel 2 is used as the first target channel; if the remainder is 1, taking the corresponding channel 3 as a first target channel; if the remainder is 2, taking the corresponding channel 4 as a first target channel; if the remainder is 3, taking the corresponding channel 5 as a first target channel; if the remainder is 4, taking the corresponding channel 7 as a first target channel; if the remainder is 5, taking the corresponding channel 8 as a first target channel; if the remainder is 6, taking the corresponding channel 9 as a first target channel; if the remainder is 7, the corresponding channel 10 is taken as the first target channel.

(3) WIFI connection module 30

And the WIFI connection module 30 is configured to establish a WIFI connection with the destination terminal through the first target channel.

Wherein, WIFI connection module 30 specifically includes:

and a first target channel WIFI connection unit (not shown in the figure) for establishing a WIFI connection between the mobile terminal and the target terminal through the first target channel.

And a default WIFI channel WIFI connection unit (not shown in the figure) for establishing WIFI connection between the mobile terminal and the target terminal through the default WIFI channel when receiving the WIFI connection request sent by the target terminal.

As shown in fig. 5, fig. 5 is another schematic structural diagram of the WIFI connection device provided in the embodiment of the present application, and the device further includes a display status data obtaining module 40, a preset status condition determining module 50, and a channel switching module 60.

The display state data obtaining module 40 is configured to obtain display state data fed back by the destination terminal.

And a preset state condition judging module 50, configured to judge whether the display state data meets a preset state condition. Specifically, whether the maximum pixel difference value of all the two adjacent pixels in the display state data is greater than a preset value is judged, and if yes, the display state data is determined to meet a preset state condition; if not, determining that the display state data does not meet the preset state condition.

And a channel switching module 60, configured to switch the WIFI channel.

The channel switching module 60 specifically includes:

and an equipment access number obtaining unit (not shown in the figure) configured to obtain an equipment access number of each preset WIFI channel in the N preset WIFI channels.

And a first target channel switching unit (not shown in the figure), configured to randomly select one preset WIFI channel from the preset WIFI channels with the smallest device access number as a second target channel, and switch the first target channel to the second target channel, so as to reestablish WIFI connection with the target terminal through the second target channel.

And a default WIFI channel switching unit (not shown in the figure) configured to switch the default WIFI channel to a first target channel, so as to reestablish WIFI connection with the destination terminal through the first target channel.

In a specific implementation, the above units may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and the specific implementation of the above units may refer to the foregoing method embodiments, which are not described herein again.

According to the WIFI connection device, the WIFI connection device is applied to a mobile terminal, the WIFI connection request sent by a target terminal is obtained, one preset WIFI channel is randomly selected from N preset WIFI channels according to the WIFI connection request to serve as a first target channel, N is larger than or equal to 1, then the WIFI connection is established with the target terminal through the first target channel, the situation that a large number of mobile devices in the same area use the same channel to communicate is avoided, interference in the data transmission process is reduced, the transmission efficiency of display data is improved, and the picture display effect is improved.

Correspondingly, the embodiment of the invention also provides a data transmission system which comprises any one of the WIFI connection devices provided by the embodiment of the invention, and the WIFI connection device can be integrated in the mobile terminal.

The method comprises the steps of obtaining a WIFI connection request sent by a target terminal, randomly selecting one preset WIFI channel from N preset WIFI channels according to the WIFI connection request to serve as a first target channel, wherein N is larger than or equal to 1, and then establishing WIFI connection with the target terminal through the first target channel.

The specific implementation of each device can be referred to the previous embodiment, and is not described herein again.

Since the data transmission system may include any one of the WIFI connection devices provided in the embodiments of the present invention, beneficial effects that can be achieved by any one of the WIFI connection devices provided in the embodiments of the present invention can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.

In addition, the embodiment of the application also provides a terminal device, and the terminal device can be a smart phone and other devices. As shown in fig. 6, the terminal device 200 includes a processor 201 and a memory 202. The processor 201 is electrically connected to the memory 202.

The processor 201 is a control center of the terminal device 200, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or loading an application program stored in the memory 202 and calling data stored in the memory 202, thereby performing overall monitoring of the terminal device.

In this embodiment, the processor 201 in the terminal device 200 loads instructions corresponding to processes of one or more application programs into the memory 202 according to the following steps, and the processor 201 runs the application programs stored in the memory 202, thereby implementing various functions:

acquiring a WIFI connection request sent by a target terminal;

randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and establishing WIFI connection with the target terminal through the first target channel.

Fig. 7 is a specific block diagram of a terminal device according to an embodiment of the present invention, where the terminal device may be used to implement the WIFI connection method provided in the foregoing embodiment. The terminal device 300 may be a smart phone or a tablet computer.

The RF circuit 310 is used for receiving and transmitting electromagnetic waves, and performing interconversion between the electromagnetic waves and electrical signals, thereby communicating with a communication network or other devices. RF circuitry 310 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. RF circuit 310 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices over a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (e.g., Institute of Electrical and Electronics Engineers (IEEE) standard IEEE802.11 a, IEEE802.11 b, IEEE802.11g, and/or IEEE802.11 n), Voice over Internet Protocol (VoIP), world wide mail Access (Microwave Access for micro), wimax-1, other suitable short message protocols, and any other suitable Protocol for instant messaging, and may even include those protocols that have not yet been developed.

The memory 320 may be used to store software programs and modules, and the processor 380 executes various functional applications and data processing by operating the software programs and modules stored in the memory 320. The memory 320 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 320 may further include memory located remotely from processor 380, which may be connected to terminal device 300 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.

The input unit 330 may be used to receive input numeric or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control. In particular, the input unit 330 may include a touch-sensitive surface 331 as well as other input devices 332. The touch-sensitive surface 331, also referred to as a touch screen or touch pad, may collect touch operations by a user on or near the touch-sensitive surface 331 (e.g., operations by a user on or near the touch-sensitive surface 331 using a finger, a stylus, or any other suitable object or attachment), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch sensitive surface 331 may comprise two parts, a touch detection means and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch-sensitive surface 331 may be implemented using various types of resistive, capacitive, infrared, and surface acoustic waves. The input unit 330 may comprise other input devices 332 in addition to the touch sensitive surface 331. In particular, other input devices 332 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.

The display unit 340 may be used to display information input by or provided to the user and various graphic user interfaces of the terminal apparatus 300, which may be configured by graphics, text, icons, video, and any combination thereof. The Display unit 340 may include a Display panel 341, and optionally, the Display panel 341 may be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), or the like. Further, touch-sensitive surface 331 may overlay display panel 341, and when touch-sensitive surface 331 detects a touch operation thereon or thereabout, communicate to processor 380 to determine the type of touch event, and processor 380 then provides a corresponding visual output on display panel 341 in accordance with the type of touch event. Although in FIG. 7, touch-sensitive surface 331 and display panel 341 are implemented as two separate components for input and output functions, in some embodiments, touch-sensitive surface 331 and display panel 341 may be integrated for input and output functions.

The terminal device 300 may also include at least one sensor 350, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 341 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 341 and/or the backlight when the terminal device 300 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when the mobile phone is stationary, and can be used for applications of recognizing the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device 300, detailed descriptions thereof are omitted.

Audio circuitry 360, speaker 361, microphone 362 may provide an audio interface between a user and terminal device 300. The audio circuit 360 may transmit the electrical signal converted from the received audio data to the speaker 361, and the audio signal is converted by the speaker 361 and output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, which is then processed by the audio data output processor 380 and then transmitted to, for example, another terminal via the RF circuit 310, or the audio data is output to the memory 320 for further processing. The audio circuit 360 may also include an earbud jack to provide communication of peripheral headphones with the terminal device 300.

The terminal device 300 may assist the user in e-mail, web browsing, streaming media access, etc. through the transmission module 370 (e.g., a Wi-Fi module), which provides the user with wireless broadband internet access. Although fig. 7 shows the transmission module 370, it is understood that it does not belong to the essential constitution of the terminal device 300, and may be omitted entirely as needed within the scope not changing the essence of the invention.

The processor 380 is a control center of the terminal device 300, connects various parts of the entire mobile phone using various interfaces and lines, and performs various functions of the terminal device 300 and processes data by running or executing software programs and/or modules stored in the memory 320 and calling data stored in the memory 320, thereby performing overall monitoring of the mobile phone. Optionally, processor 380 may include one or more processing cores; in some embodiments, processor 380 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 processor 380.

Terminal device 300 also includes a power supply 390 (e.g., a battery) for powering the various components, which may be logically coupled to processor 380 via a power management system in some embodiments to manage charging, discharging, and power consumption management functions via the power management system. The power supply 390 may also include any component including one or more of a dc or ac power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.

Although not shown, the terminal device 300 may further include a camera (e.g., a front camera, a rear camera), a bluetooth module, and the like, which are not described in detail herein. Specifically, in this embodiment, the display unit of the terminal device is a touch screen display, the terminal device further includes a memory, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include instructions for:

acquiring a WIFI connection request sent by a target terminal;

randomly selecting one preset WIFI channel from N preset WIFI channels as a first target channel according to the WIFI connection request, wherein N is larger than or equal to 1;

and establishing WIFI connection with the target terminal through the first target channel.

In specific implementation, the above modules may be implemented as independent entities, or may be combined arbitrarily to be implemented as the same or several entities, and specific implementation of the above modules may refer to the foregoing method embodiments, which are not described herein again.

It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor. To this end, embodiments of the present invention provide a storage medium, in which a plurality of instructions are stored, where the instructions can be loaded by a processor to execute steps in any of the WIFI connection methods provided by the embodiments of the present invention.

Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.

Since the instructions stored in the storage medium may execute the steps in any of the WIFI connection methods provided by the embodiments of the present invention, beneficial effects that can be achieved by any of the WIFI connection methods provided by the embodiments of the present invention may be achieved, which are detailed in the foregoing embodiments and will not be described herein again.

The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.

In summary, although the present application has been described with reference to the preferred embodiments, the above-described preferred embodiments are not intended to limit the present application, and those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present application, so that the scope of the present application shall be determined by the appended claims.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种移动网络通话方法、终端及计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!