CN111083764B - Device control method, device, storage medium and electronic device - Google Patents

Device control method, device, storage medium and electronic device Download PDF

Info

Publication number
CN111083764B
CN111083764B CN201911349078.3A CN201911349078A CN111083764B CN 111083764 B CN111083764 B CN 111083764B CN 201911349078 A CN201911349078 A CN 201911349078A CN 111083764 B CN111083764 B CN 111083764B
Authority
CN
China
Prior art keywords
channel
electronic device
received signal
signal strength
working
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911349078.3A
Other languages
Chinese (zh)
Other versions
CN111083764A (en
Inventor
徐丰华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Jinsheng Communication Technology Co ltd
Original Assignee
Shanghai Jinsheng Communication Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Jinsheng Communication Technology Co ltd filed Critical Shanghai Jinsheng Communication Technology Co ltd
Priority to CN201911349078.3A priority Critical patent/CN111083764B/en
Publication of CN111083764A publication Critical patent/CN111083764A/en
Application granted granted Critical
Publication of CN111083764B publication Critical patent/CN111083764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application discloses a device control method, a device control apparatus, a storage medium and an electronic device. The method can be applied to an electronic device which is a Wi-Fi device, and comprises the following steps: acquiring the received signal strength of access points working on each channel in the environment; acquiring a numerical value of a channel idle parameter corresponding to each channel, wherein the channel idle parameter is used for expressing the idle degree of each channel; determining a target channel according to the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel; and determining the target channel as an operating channel when the electronic equipment is in Wi-Fi connection. The method and the device can improve the flexibility of selecting the Wi-Fi working channel by the electronic equipment.

Description

Device control method, device, storage medium and electronic device
Technical Field
The present application belongs to the field of Wi-Fi technologies, and in particular, to a device control method, apparatus, storage medium, and electronic device.
Background
Wi-Fi is a wireless local area network technology that is built into the IEEE 802.11 standard. Wi-Fi technology has become one of the most widely used wireless network transmission technologies at present. With Wi-Fi technology, a mobile terminal such as a smart phone, a notebook computer, etc. can connect to an Access Point (AP) and connect to the internet through the Access Point, thereby using a web service. However, in the related art, the electronic device has poor flexibility in selecting a Wi-Fi operating channel.
Disclosure of Invention
The embodiment of the application provides a device control method, a device, a storage medium and an electronic device, which can improve the flexibility of selecting a Wi-Fi working channel by the electronic device.
In a first aspect, an embodiment of the present application provides an apparatus control method, which is applied to an electronic apparatus, where the electronic apparatus is a Wi-Fi apparatus, and the method includes:
acquiring the received signal strength of access points working on each channel in the environment;
acquiring a numerical value of a channel idle parameter corresponding to each channel, wherein the channel idle parameter is used for expressing the idle degree of each channel;
determining a target channel according to the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel;
and determining the target channel as a working channel when the electronic equipment is in Wi-Fi connection.
In a second aspect, an embodiment of the present application provides an apparatus control device, which is applied to an electronic device, where the electronic device is a Wi-Fi device, and the apparatus includes:
the first acquisition module is used for acquiring the received signal strength of the access point working on each channel in the environment;
a second obtaining module, configured to obtain a value of a channel idle parameter corresponding to each channel, where the channel idle parameter is used to indicate an idle degree of each channel;
a first determining module, configured to determine a target channel according to the received signal strength of the access point operating on each channel and a value of a channel idle parameter corresponding to each channel;
and the second determining module is used for determining the target channel as a working channel when the electronic equipment performs Wi-Fi connection.
In a third aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer program is enabled to execute a flow in an apparatus control method provided in an embodiment of the present application.
In a fourth aspect, an embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the procedures in the device control method provided in the embodiment of the present application by calling the computer program stored in the memory.
In the embodiment of the application, when the electronic device performs Wi-Fi connection, a target channel can be determined according to the received signal strength of the access point working on each channel and the idle degree of each channel, and the target channel is used as a working channel of the Wi-Fi connection. Therefore, the flexibility of selecting the Wi-Fi working channel by the electronic equipment can be improved.
Drawings
The technical solutions and advantages of the present application will become apparent from the following detailed description of specific embodiments of the present application when taken in conjunction with the accompanying drawings.
Fig. 1 is a schematic flowchart of an apparatus control method provided in an embodiment of the present application.
Fig. 2 is another schematic flow chart of the device control method according to the embodiment of the present application.
Fig. 3 is a schematic view of Wi-Fi channel scanning by an electronic device that additionally returns a channel number (channel number), a channel idle time (channel idle slot time), and a scanning time (scan time) when performing channel scanning according to an embodiment of the present application.
Fig. 4 to fig. 5 are schematic scene diagrams of a device control method provided in an embodiment of the present application.
Fig. 6 is a schematic structural diagram of an apparatus control device according to an embodiment of the present application.
Fig. 7 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.
Fig. 8 is another schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Referring to the drawings, wherein like reference numbers refer to like elements, the principles of the present application are illustrated as being implemented in a suitable computing environment. The following description is based on illustrated embodiments of the application and should not be taken as limiting the application with respect to other embodiments that are not detailed herein.
It is understood that the execution subject of the embodiment of the present application may be an electronic device such as a smart phone or a tablet computer.
Referring to fig. 1, fig. 1 is a schematic flow chart of an apparatus control method according to an embodiment of the present disclosure. The device control method may be applied to an electronic device, which may be a Wi-Fi device. The flow of the device control method may include:
101. the received signal strength of an access point operating on each channel in an environment is obtained.
Wi-Fi is a wireless local area network technology that is built into the IEEE 802.11 standard. Wi-Fi technology has become one of the most widely used wireless network transmission technologies at present. With Wi-Fi technology, a mobile terminal such as a smart phone, a notebook computer, etc. can connect to an Access Point (AP) and connect to the internet through the Access Point, thereby using a web service. However, in the related art, the electronic device has poor flexibility in selecting a Wi-Fi operating channel. For example, in the related art, the electronic device may select a Wi-Fi operating channel completely randomly.
In the embodiment of the present application, for example, the electronic device may first acquire the Received Signal Strength (RSSI) of the access point operating on each Wi-Fi channel in the environment where the electronic device is located.
For example, 13 channels in the 2.4GHz band are respectively denoted as channel No. 1 (center frequency 2412MHz, channel bottom frequency 2401MHz, channel high end frequency 2423MHz), channel No. 2 (center frequency 2417MHz, channel bottom frequency 2406MHz, channel high end frequency 2428MHz), channel No. 3 (center frequency 2422MHz, channel bottom frequency 2411MHz, channel high end frequency 2433MHz), … …, and channel No. 13 (center frequency 2472MHz, channel bottom frequency 2461MHz, channel high end frequency 2483 MHz). The electronic device may first obtain the received signal strength of the access point operating on channel number 1 and then obtain the received signal strength of the access point operating on channel number 2, … … and obtain the received signal strength of the access point operating on channel number 13.
It should be noted that if there are 2 or more than 2 access points operating on a certain channel, the electronic device needs to acquire the received signal strength of each access point in the 2 or more than 2 access points. For example, if the electronic device is located in an environment where there are 2 access points operating on channel No. 1, which are a and B, respectively, the electronic device needs to acquire the received signal strength of access point a and the received signal strength of access point B, respectively.
102. And acquiring the numerical value of the channel idle parameter corresponding to each channel, wherein the channel idle parameter is used for expressing the idle degree of each channel.
For example, the electronic device may further obtain a value of a channel idle parameter corresponding to each channel, where the channel idle parameter is a parameter used to indicate an idle degree of each channel.
103. And determining a target channel according to the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel.
104. And determining the target channel as a working channel when the electronic equipment is in Wi-Fi connection.
For example, 103 and 104 may include:
after the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel are obtained, the electronic device can determine a target channel according to the received signal strength and the value of the channel idle parameter. The electronic device may then determine the target channel as a working channel for use by the electronic device in making Wi-Fi connections.
It can be understood that, in the embodiment of the present application, when the electronic device performs a Wi-Fi connection, a target channel may be determined according to the received signal strength of the access point operating on each channel and the vacancy degree of each channel, and the target channel is used as an operating channel of the Wi-Fi connection. Therefore, the flexibility of selecting the Wi-Fi working channel by the electronic equipment can be improved.
Referring to fig. 2, fig. 2 is another schematic flow chart of an apparatus control method according to an embodiment of the present disclosure. The device control method can be applied to electronic devices, and the electronic devices can be devices which are used as group owners in a Wi-Fi Direct function architecture. The flow of the device control method may include:
201. the electronic device obtains received signal strengths of access points operating on channels in the environment.
In the related art, the performance of data transmission by using Wi-Fi connection is poor. For example, in the related art, when selecting an operating channel, a Wi-Fi device selects an operating channel either completely randomly or according to the number of access points operating on each channel. The working channel selected in a random manner may be a crowded working channel, and the interference on the channel may be large, resulting in poor performance of subsequent Wi-Fi connection communication. Since the number of access points and the interference degree of the working channel are not absolute corresponding, the channel selected by selecting the working channel according to the number of access points working on each channel may also be a channel with large interference, which may also result in poor performance of subsequent Wi-Fi connection communication.
In an embodiment of the present application, the electronic device may be a device that is a group owner in a Wi-Fi Direct function architecture.
It should be noted that Wi-Fi Display (WFD) is a specification developed by Wi-Fi Alliance that enables a Wi-Fi based connection to be established and maintained between multimedia devices and used to facilitate the playback of video/audio presentations at the target device. An important technology in Wi-Fi Display is Wi-Fi Direct, i.e., Wi-Fi P2P. It supports two Wi-Fi devices to connect and communicate directly without accessing the access point AP. In the Wi-Fi Direct function structure, two roles of a Group Owner (GO) and a Group Client (GC) are defined. Wherein the group owner GO acts like an access point AP in an Infrastructure BSS. And the group client GC functions like a station STA in an Infrastructure BSS. Before the P2P Group (i.e., P2P Network) is established, the terminals are P2P devices one by one. When P2P negotiation is completed between these P2P Device devices, one and only one P2P Device will play the role of GO, and the other P2P Device will play the role of GC.
For example, before formal connection between the electronic device as GO device and the GC device, a full channel scan (Scanning) may be performed to determine the working channel when GO is used. When performing a full channel scan, the electronic device may obtain the Received Signal Strength (RSSI) of the access point AP operating on each channel.
For example, 13 channels in the 2.4GHz band are denoted as channel No. 1, channel No. 2, channel No. 3, … …, and channel No. 13, respectively. The electronic device may first obtain the received signal strength of the access point operating on channel number 1 and then obtain the received signal strength of the access point operating on channel number 2, … … and obtain the received signal strength of the access point operating on channel number 13.
It should be noted that if there are 2 or more than 2 access points operating on a certain channel, the electronic device needs to acquire the received signal strength of each access point in the 2 or more than 2 access points. For example, in an environment where the electronic device is located, there are 2 access points operating on channel No. 1, which are a and B, respectively, and then the electronic device needs to acquire the received signal strength corresponding to access point a and the received signal strength corresponding to access point B, respectively.
202. The electronic equipment acquires a channel idle ratio corresponding to each channel, wherein the channel idle ratio is the ratio of channel idle time acquired in each scanning process to scanning time.
For example, when the electronic device scans channels, it may also obtain channel idle time (channel idle slot time) and scan time (scan time) corresponding to each channel.
It should be noted that, in the related art, channel idle slot time (channel idle slot time) and scan time (scan time) are not returned when performing channel scanning. In the embodiment of the present application, information of channel idle time (channel idle slot time) and scan time (scan time) is additionally returned in the scan result of channel scanning.
For example, referring to fig. 3, fig. 3 is a schematic view of a Wi-Fi channel scan of an electronic device additionally returning a channel number (channel number), a channel idle time (channel slot time), and a scan time (scan time) when performing channel scan according to an embodiment of the present application. The Wi-Fi Driver is a Wi-Fi drive module, the Wi-Fi Firmware is Wi-Fi Firmware, the Wi-Fi Hardware is Wi-Fi Hardware, the Packet Tx is a sending data Packet, and the Packet Rx is a receiving data Packet. That is, the electronic device may additionally acquire and return a channel idle slot time (channel idle slot time) and a scan time (scan time) when scanning each channel. Therefore, when the electronic device scans channels, the electronic device can acquire the channel idle time and the scanning time of each channel.
After the channel idle time and the scanning time of each channel are obtained, the electronic device can calculate a channel idle slot ratio (channel idle slot ratio) corresponding to each channel, wherein the channel idle ratio is a ratio of the channel idle time to the scanning time. For example, the channel idle time of channel No. 1 is 30ms, the scanning time is 50ms, and the channel idle ratio of channel No. 1 is 30ms/50ms — 0.6.
203. For each channel, the electronic device calculates the sum of the received signal strength scores of the access points operating on the channel, wherein the electronic device sets different scores for different received signal strengths.
For example, in the embodiment, the electronic device may set different scoring values for different received signal strengths in advance. For example, when the value of the received signal strength is less than-75 dBm, the score of each received signal strength is 1 point. When the value of the received signal strength is [ -75dBm, -55dBm), each received signal strength is scored as 3 points. When the value of the received signal strength is [ -55dBm,0dBm), the score of each received signal strength is 5 points.
Based on this, after acquiring the received signal strengths of the access points operating on the respective channels, the electronic device may calculate the sum of the scores of the received signal strengths of the access points operating on the respective channels. For example, 2 ap's operate on channel 1, where the received signal strength corresponding to one ap is-50 dBm, and the corresponding score is 5, and the received signal strength corresponding to the other ap is-70 dBm, and the corresponding score is 3. Then, the sum of the received signal strength scores for channel number 1 is 5+3 to 8. For another example, if 1 access point operates on channel 6, and the received signal strength corresponding to the access point is-30 dBm, the corresponding score value is 5. Then the sum of the received signal strength scores for channel number 6 is 5.
Through the process of 203, the electronic device may calculate the sum of the scores of the received signal strengths corresponding to the channels.
204. The electronic equipment calculates the channel busy ratio of each channel, wherein the channel idle ratio is recorded as R1The channel busy ratio is denoted as R2Then R is2=1-R1
For example, after the channel idle ratio corresponding to each channel is calculated in 202, the electronic device may calculate the channel busy ratio of each channel, where the channel idle ratio is denoted as R1The channel busy ratio is denoted as R2Then R is2=1-R1. For example, the channel idle ratio of channel No. 1 is 0.6, and the channel busy ratio of channel No. 1 is 1-0.6-0.4.
Through the process of 204, the electronic device may calculate a channel busy ratio of each channel. The larger the value of the channel busy ratio, the more busy and congested the channel is.
205. The electronic device obtains a first weight corresponding to the sum of the credit values and a second weight corresponding to the channel busy ratio.
206. According to the first weight and the second weight, the electronic equipment calculates the weighted sum of the credit values of all the channels and the busy ratio of the channels.
207. The electronic device determines the channel with the smallest weighted sum as the target channel.
For example, 205, 206, and 207 may include:
after calculating the sum of the scores of the received signal strength corresponding to each channel and the channel busy ratio of each channel, the electronic device may obtain a first weight corresponding to the sum of the scores and a second weight corresponding to the channel busy ratio. Then, the electronic device may calculate a weighted sum of the credit values of the channels and the channel busy ratio according to the first weight and the second weight, and determine a channel with the smallest weighted sum as the target channel.
For example, the first weight is 30% and the second weight is 70%. For example, if the sum of the score values of channel number 1 is 8 and the channel busy ratio is 0.4, then their weighted sum is 8 × 30% +0.4 × 70% — 2.68. As another example, if the sum of the score values of channel No. 6 is 5 and the channel busy ratio is 0.5, then their weighted sum value is 5 × 30% +0.5 × 70% — 1.85.
Of course, in other embodiments, the first weight and the second weight may have other values, such as 40% for the first weight, 60% for the second weight, and so on. The present embodiment does not specifically limit the magnitude of the first weight and the second weight.
Through the process of 206, the electronic device may calculate a weighted sum of the channels. The electronic device may then determine the channel with the smallest weighted sum as the target channel. It will be appreciated that a smaller weighted sum indicates that the corresponding channel is more free and less interfered with. The target channel is subject to minimal interference.
208. The electronic device determines the target channel as the working channel when the Wi-Fi connection is made.
For example, after determining the target channel, the electronic device may determine the target channel as an operating channel used by the electronic device when making a Wi-Fi connection. That is, in this embodiment, when the electronic device is used as the group owner GO in the Wi-Fi Direct function architecture, the electronic device may select a channel with the minimum interference degree as the working channel. Because the target channel is minimally interfered, the electronic equipment can obtain better performance when data transmission is carried out by utilizing the Wi-Fi connection.
It can be understood that, in the embodiment of the present application, on one hand, when the electronic device performs a Wi-Fi connection, a target channel may be determined according to the received signal strength of the access point operating on each channel and the vacancy degree of each channel, and the target channel is used as an operating channel of the Wi-Fi connection. Therefore, the flexibility of selecting the Wi-Fi working channel by the electronic equipment can be improved. On the other hand, because the target channel is the channel with the minimum interference degree, in the embodiment of the application, the electronic device may select a working channel with the minimum interference degree and the most suitable working channel for the Wi-Fi connection, so as to improve the performance of the electronic device for data transmission by using the Wi-Fi connection.
In another embodiment, in addition to determining the target channel according to the sum of the credit values of the channels and the channel busy ratio, the electronic device may further obtain a value of a parameter medium ready count during channel scanning, and determine the target channel according to the received signal strength of the access point operating on each channel and the value of the parameter medium ready count.
It should be noted that the value of the parameter medium ready count represents the number of Wi-Fi packets detected by the Wi-Fi physical layer, and when the number is small, for example, the value of the parameter medium ready count within 500ms is less than 100, it can be considered that the interference on the corresponding channel is small.
For example, the electronic device may calculate a sum obtained by adding the sum of the credit values of the channels to the numerical value of the medium ready count, and determine the channel with the smallest sum as the target channel.
In yet another embodiment, in addition to determining the target Channel according to the sum of the credit values of the channels and the Channel busy ratio, the electronic device may obtain a value of Clear Channel Assessment (CCA) during Channel scanning, and determine the target Channel according to the received signal strength of the access point operating on each Channel and the value of the parameter CCA.
It should be noted that the value of the parameter CCA may also be effective to indicate whether the channel is clear. The channel may be considered more clear when the value of CCA is smaller. For example, the electronic device may calculate a sum of the credit values of the channels and the value of CCA, and determine the channel with the smallest sum as the target channel.
Of course, in some other embodiments, the electronic device may determine the target channel only according to the value of the parameter medium ready count or the value of the parameter CCA. For example, the electronic device may determine a channel with the smallest value of the parameter medium ready count or the smallest value of the parameter CCA as the target channel, and so on.
It should be noted that the channel selection scheme provided in the embodiment of the present application may also be applied in a non-Wi-Fi P2P application scenario, for example, at time T1, a certain access point AP is started, and at this time, the access point has not established a Wi-Fi connection with any station STA yet. Then, after the startup, the access point may select a target channel with the least interference as an operating channel using the channel selection scheme provided in the embodiment of the present application. At a time T2, which is a time after T1, when a station needs to connect to the access point for a Wi-Fi connection, the access point may establish a Wi-Fi connection with the station based on the selected working channel, thereby improving the performance of Wi-Fi connection communication between the access point AP and the station STA.
Referring to fig. 4 to 5, fig. 4 to 5 are schematic views of a scenario of an apparatus control method according to an embodiment of the present application.
For example, with the electronic device D1 and the electronic device D2, the user wants to wirelessly project the audiovisual file on the electronic device D2 onto the electronic device D1 for playing. The user may open the Wi-Fi functions of electronic devices D1 and D2, thereby establishing a Wi-Fi P2P connection between electronic devices D1 and D2, as shown in FIG. 4.
Through the negotiation, the electronic device D1 is determined to have the role of the group owner GO, and the electronic device D2 is determined to have the role of the group client GC. Before establishing the normal connection, the electronic device D1 may perform a full channel scan to determine its operating channel as the group owner GO.
In the channel scanning process, the electronic device D1 may first obtain the channel idle time and the scanning time corresponding to each channel, and calculate the channel idle ratio of each channel, where the channel idle ratio is a ratio of the channel idle time to the scanning time. For example, the channel idle time of the channel No. 1 acquired by the electronic device D1 is 30ms, the scanning time is 50ms, and the channel idle ratio of the channel No. 1 is 30ms/50ms — 0.6.
After acquiring the channel idle ratio of each channel, the electronic device D1 may calculate the channel busy ratio of each channel, where the channel idle ratio is denoted as R1The channel busy ratio is denoted as R2Then R2=1-R1. For example, the channel idle ratio of channel No. 1 is 0.6, and the channel busy ratio of channel No. 1 is 1-0.6-0.4.
Also, the electronic device D1 may acquire the received signal strength RSSI of the APs operating on the respective channels in the surrounding environment. For example, the electronic device D1 detects that 1 AP in the surrounding environment operates on channel number 6, and the received signal strength corresponding to the AP is-30 dBm. And the electronic device D1 detects that 2 APs in the surrounding environment operate in channel 1, and the received signal strengths of the two APs are-70 dBm and-50 dBm, respectively. In the embodiment of the present application, the electronic device D1 is preset with different scoring values for different received signal strengths. For example, when the value of the received signal strength is less than-75 dBm, the score of each received signal strength is 1 point. When the value of the received signal strength is [ -75dBm, -55dBm), each received signal strength is scored as 3 points. When the value of the received signal strength is [ -55dBm,0dBm), the score of each received signal strength is 5 points.
Then, for each channel, the electronic device D1 may calculate the sum of the scores corresponding to the received signal strengths of the access points operating on the channel. For example, the sum of the received signal strength scores for channel No. 1 is 5+3 to 8, and the sum of the received signal strength scores for channel No. 6 is 5.
Thereafter, the electronic device D1 may perform weighted summation on the sum of the scores of the channels and the channel busy ratio according to a first weight corresponding to the sum of the scores and a second weight corresponding to the channel busy ratio, and determine the channel with the smallest weighted sum as the target channel. For example, the first weight is 30% and the second weight is 70%. For example, if the sum of the score values of channel number 1 is 8 and the channel busy ratio is 0.4, then their weighted sum is 8 × 30% +0.4 × 70% — 2.68. As another example, if the sum of the score values of channel No. 6 is 5 and the channel busy ratio is 0.5, then their weighted sum value is 5 × 30% +0.5 × 70% — 1.85.
It will be appreciated that a smaller weighted sum indicates that the corresponding channel is more free and less interfered with. Therefore, the determined target channel is the channel with the least interference.
After determining the target channel, the electronic device D1 may determine the target channel as the working channel used by the electronic device when making a Wi-Fi connection. For example, the electronic device D1 determines channel No. 11 as the target channel, and the electronic device D1 and the electronic device D2 may perform Wi-Fi connection and communication based on channel No. 11, as shown in fig. 5.
It can be understood that, because the wireless screen projection has a high performance requirement on data transmission, the channel selection scheme provided by the embodiment of the application can enable the Wi-Fi communication connection performance between the devices to be better, so that the wireless screen projection performance is improved, for example, the speed and stability when data are transmitted through Wi-Fi connection, and the like, and better experience is brought to users.
Referring to fig. 6, fig. 6 is a schematic structural diagram of an apparatus control device according to an embodiment of the present disclosure. The device control apparatus may be applied to an electronic device, which may be a Wi-Fi device. The device control apparatus 300 may include: a first obtaining module 301, a second obtaining module 302, a first determining module 303, and a second determining module 304.
A first obtaining module 301, configured to obtain received signal strength of an access point operating on each channel in an environment.
A second obtaining module 302, configured to obtain a value of a channel idle parameter corresponding to each channel, where the channel idle parameter is used to indicate an idle degree of each channel.
A first determining module 303, configured to determine a target channel according to the received signal strength of the access point operating on each channel and the value of the channel idle parameter corresponding to each channel.
A second determining module 304, configured to determine the target channel as a working channel when the electronic device performs Wi-Fi connection.
In one embodiment, the value of the channel idle parameter is a channel idle ratio, and the channel idle ratio is a ratio of channel idle time to scanning time acquired at each scanning.
In one embodiment, the electronic device may be provided with different scoring values for different received signal strengths.
Then, the first determining module 303 may be configured to:
for each channel, calculating the sum of the scores of the received signal strength of the access points working on the channel;
calculating the channel busy ratio of each channel, wherein the channel idle ratio is recorded as R1The channel busy ratio is denoted as R2Then R is2=1-R1
And determining a target channel according to the sum of the credit values of all the channels and the channel busy ratio.
In one embodiment, the first determining module 303 may be configured to:
acquiring a first weight corresponding to the sum of the credit values and a second weight corresponding to the channel busy ratio;
calculating the weighted sum of the credit values of all the channels and the busy ratio of the channels according to the first weight and the second weight;
and determining the channel with the minimum weighted sum value as the target channel.
In one embodiment, the electronic device is a device that is a group owner in a Wi-Fi Direct functionality architecture.
An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed on a computer, the computer is caused to execute a flow in an apparatus control method provided in this embodiment.
The embodiment of the present application further provides an electronic device, which includes a memory and a processor, where the processor is configured to execute the flow in the device control method provided in this embodiment by calling the computer program stored in the memory.
For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Referring to fig. 7, fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The electronic device 400 may include components such as a Wi-Fi module 401, memory 402, processor 403, and so on. Those skilled in the art will appreciate that the electronic device configuration shown in fig. 7 does not constitute a limitation of the electronic device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
Wi-Fi module 401 may be used to implement Wi-Fi related functions such as channel scanning, authentication, connectivity, etc.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running an application program stored in the memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
In this embodiment, the processor 403 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, so as to execute:
acquiring the received signal strength of access points working on each channel in the environment;
acquiring a numerical value of a channel idle parameter corresponding to each channel, wherein the channel idle parameter is used for expressing the idle degree of each channel;
determining a target channel according to the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel;
and determining the target channel as a working channel when the electronic equipment is in Wi-Fi connection.
Referring to fig. 8, the electronic device 400 may include a Wi-Fi module 401, a memory 402, a processor 403, an input unit 404, an output unit 405, a power supply module 406, and the like.
Wi-Fi module 401 may be used to implement Wi-Fi related functions such as channel scanning, authentication, connectivity, etc.
The memory 402 may be used to store applications and data. The memory 402 stores applications containing executable code. The application programs may constitute various functional modules. The processor 403 executes various functional applications and data processing by running an application program stored in the memory 402.
The processor 403 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing an application program stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring of the electronic device.
The input unit 404 may be used to receive input numbers, character information, or user characteristic information, such as a fingerprint, and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The output unit 405 may be used to display information input by or provided to a user and various graphical user interfaces of the electronic device, which may be made up of graphics, text, icons, video, and any combination thereof. The output unit may include a display panel.
The power module 406 may provide power to the electronic device.
In this embodiment, the processor 403 in the electronic device loads the executable code corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 403 runs the application programs stored in the memory 402, so as to execute:
acquiring the received signal strength of access points working on each channel in the environment;
acquiring a numerical value of a channel idle parameter corresponding to each channel, wherein the channel idle parameter is used for expressing the idle degree of each channel;
determining a target channel according to the received signal strength of the access point working on each channel and the value of the channel idle parameter corresponding to each channel;
and determining the target channel as a working channel when the electronic equipment is in Wi-Fi connection.
In one embodiment, the value of the channel idle parameter is a channel idle ratio, and the channel idle ratio is a ratio of channel idle time to scanning time acquired at each scanning.
In one embodiment, different scoring values are set for different received signal strengths;
then processor 403 executes instructions in accordance with theWhen determining the target channel, the received signal strength of the access point operating on each channel and the value of the channel idle parameter corresponding to each channel may perform: for each channel, calculating the sum of the scores of the received signal strength of the access points working on the channel; calculating the channel busy ratio of each channel, wherein the channel idle ratio is recorded as R1The channel busy ratio is denoted as R2Then R is2=1-R1(ii) a And determining a target channel according to the sum of the credit values of all the channels and the channel busy ratio.
In one embodiment, when processor 403 determines the target channel according to the sum of the credit values of the channels and the channel busy ratio, it may perform: acquiring a first weight corresponding to the sum of the credit values and a second weight corresponding to the channel busy ratio; calculating the weighted sum of the credit values of all the channels and the busy ratio of the channels according to the first weight and the second weight; and determining the channel with the minimum weighted sum value as the target channel.
In one embodiment, the electronic device is a device that is a group owner in a Wi-Fi Direct functionality architecture.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed description of the device control method, and are not described herein again.
The device control apparatus provided in the embodiment of the present application and the device control method in the above embodiments belong to the same concept, and any method provided in the device control method embodiment may be run on the device control apparatus, and a specific implementation process thereof is described in the device control method embodiment in detail, and is not described herein again.
It should be noted that, for the apparatus control method described in the embodiment of the present application, it can be understood by those skilled in the art that all or part of the process of implementing the apparatus control method described in the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, where the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and during the execution, the process of the embodiment of the apparatus control method can be included. The storage medium may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like.
In the device control apparatus according to the embodiment of the present application, each functional module may be integrated into one processing chip, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium, such as a read-only memory, a magnetic or optical disk, or the like.
The above detailed description is provided for a device control method, apparatus, storage medium, and electronic device provided in the embodiments of the present application, and specific examples are applied herein to explain the principles and implementations of the present application, and the descriptions of the above embodiments are only used to help understand the method and core ideas of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (5)

1. An apparatus control method applied to an electronic apparatus, wherein the electronic apparatus is an apparatus that is a group owner in a Wi-Fi Direct function architecture, the method comprising:
performing channel scanning on each channel before the electronic device is connected with a group client as a group owner, wherein the group client is another electronic device used for establishing Wi-Fi P2P connection with the electronic device;
when each channel is scanned, the received signal strength of all access points working on the channel in the environment is obtained, and the channel number of the channel, the channel idle time of the channel and the scanning time are fed back;
calculating to obtain a channel busy ratio corresponding to each channel according to the channel idle time and the scanning time of each channel, wherein the channel busy ratio is used for indicating the busy degree of each channel;
calculating the sum of the scoring values of all access points of the channel according to the received signal strength of all the access points working on the channel, wherein the smaller the received signal strength of the access points is, the smaller the corresponding scoring value is, and the channel with the minimum sum of the scoring values and the busy ratio of the channel is determined as a target channel;
determining the target channel as a working channel when the electronic equipment is connected with Wi-Fi P2P;
and establishing a Wi-Fi P2P connection between the group owner and the group client by using the working channel so as to wirelessly project the audio and video files on the group client to the group owner for playing.
2. The device control method according to claim 1, wherein determining a channel having a smallest sum of the score values and the channel busy ratio as a target channel comprises:
acquiring a first weight corresponding to the sum of the credit values and a second weight corresponding to the channel busy ratio;
calculating the weighted sum of the credit values of all the channels and the busy ratio of the channels according to the first weight and the second weight;
and determining the channel with the minimum weighted sum value as the target channel.
3. An apparatus control device applied to an electronic device, wherein the electronic device is a device that is a group owner in a Wi-Fi Direct function architecture, the apparatus comprising:
a first obtaining module, configured to perform channel scanning on each channel before the electronic device is connected to a group client as a group owner, where the group client is another electronic device that is used to establish Wi-Fi P2P connection with the electronic device, and when performing channel scanning on each channel, obtain received signal strengths of all access points working on the channel in an environment;
the second acquisition module is used for feeding back the channel number of each channel, the channel idle time and the scanning time of each channel when each channel is scanned, and calculating a value of a channel busy ratio corresponding to each channel according to the channel idle time and the scanning time of each channel, wherein the channel busy ratio is used for indicating the busy degree of each channel, or acquiring the received signal strength of all access points working on each channel and the number of Wi-Fi packets detected by a Wi-Fi physical layer when each channel is scanned;
a first determining module, configured to calculate, according to the received signal strengths of all access points working on the channel, a sum of score values of all access points of the channel, where the smaller the received signal strength of the access point is, the smaller the corresponding score value is, and a channel with the smallest sum of the score values and the sum of channel busy ratios is determined as a target channel;
a second determining module, configured to determine the target channel as a working channel when the electronic device performs Wi-Fi P2P connection, and establish a Wi-Fi P2P connection between the group owner and the group client using the working channel, so as to wirelessly screen an audio/video file on the group client onto the group owner for playing.
4. A storage medium having stored thereon a computer program, characterized in that the computer program, when executed on a computer, causes the computer to execute the method according to claim 1 or 2.
5. An electronic device comprising a memory, a processor, wherein the processor is configured to perform the method of claim 1 or 2 by invoking a computer program stored in the memory.
CN201911349078.3A 2019-12-24 2019-12-24 Device control method, device, storage medium and electronic device Active CN111083764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911349078.3A CN111083764B (en) 2019-12-24 2019-12-24 Device control method, device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911349078.3A CN111083764B (en) 2019-12-24 2019-12-24 Device control method, device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111083764A CN111083764A (en) 2020-04-28
CN111083764B true CN111083764B (en) 2022-04-01

Family

ID=70317274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911349078.3A Active CN111083764B (en) 2019-12-24 2019-12-24 Device control method, device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111083764B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116560247B (en) * 2023-07-10 2023-09-08 贵州大学 Remote control method and device for realizing intelligent home based on Internet of things

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018080171A1 (en) * 2016-10-25 2018-05-03 삼성전자 주식회사 Electronic device and communication method for electronic device
CN108633030A (en) * 2017-03-24 2018-10-09 中兴通讯股份有限公司 Channel access method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5102319B2 (en) * 2008-02-21 2012-12-19 日本電信電話株式会社 Radio base station search method, radio base station search apparatus, and radio base station search program
US9433008B2 (en) * 2014-05-12 2016-08-30 Qualcomm Incorporated Methods and apparatus for channel selection in a wireless local area network
KR102275025B1 (en) * 2014-11-21 2021-07-08 삼성전자주식회사 Method for providing wireless lan service and electronic device thereof
CN105979572A (en) * 2016-06-30 2016-09-28 上海斐讯数据通信技术有限公司 Method of selecting network access device and network terminal
US10172014B2 (en) * 2016-12-18 2019-01-01 Dell Products, Lp Method and apparatus for optimizing selection of radio channel frequency and adaptive clear channel assessment threshold for WLAN access points
CN108200615A (en) * 2017-12-28 2018-06-22 生迪智慧科技有限公司 Control method, device and the LED light device of wireless router

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018080171A1 (en) * 2016-10-25 2018-05-03 삼성전자 주식회사 Electronic device and communication method for electronic device
CN108633030A (en) * 2017-03-24 2018-10-09 中兴通讯股份有限公司 Channel access method and device

Also Published As

Publication number Publication date
CN111083764A (en) 2020-04-28

Similar Documents

Publication Publication Date Title
JP5985767B2 (en) Method and apparatus for peer-to-peer Wi-Fi ranging using near-field communication
CN108770068B (en) WIFI frequency band selection method and device, storage medium and electronic equipment
CN106658652B (en) Method and device for connecting WiFi hotspot
CN107231159B (en) Radio frequency interference processing method, device, storage medium and terminal
CN106604403B (en) Miracast protocol-based channel selection method and system
CN104010351A (en) Method and apparatus for connecting short-range wireless communication in terminal
WO2020151743A1 (en) Random access method and terminal
US10291795B2 (en) Communication apparatus, method for controlling communication apparatus, and storage medium for selecting an apparatus in a wireless network
US11178624B2 (en) Method of adjusting transmission power of terminal, mobile terminal, and storage device
KR101489675B1 (en) Method for scanning and connecting wi-fi direct device, terminal device for the same
CN105792290A (en) Method and device for controlling intelligent terminal to perform wireless roaming
CN108055687B (en) Wireless network connection method and device and terminal equipment
CN111866976B (en) Network switching method and device
WO2011156117A2 (en) Channel discovery protocol
CN111148182B (en) Device control method, device, storage medium and electronic device
CN111083764B (en) Device control method, device, storage medium and electronic device
CN106330681B (en) Method, system and related equipment for sharing film watching information
CN108307485B (en) Wireless network scanning method and device, terminal equipment and storage medium
CN108337719B (en) Wireless network scanning method and device, terminal equipment and storage medium
CN109618421B (en) Method and device for reconnecting AP, terminal and storage medium
CN110933772A (en) Connection method of wireless device, mobile terminal and computer readable storage medium
CN106604363B (en) A kind of Wireless Fidelity Wi-Fi scan method, mobile terminal and storage medium
CN110688051B (en) Screen recording operation method and device, computer readable storage medium and terminal
CN108337715B (en) Wireless network connection method, device, terminal equipment and storage medium
WO2021128015A1 (en) Device control method and apparatus, and storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant