Channel selection method, electronic equipment, chip system and storage medium

CN121646969APending Publication Date: 2026-03-10HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

How to ensure the higher concurrency efficiency of Wi-Fi P2P services and STA services of electronic devices, while complying with communication regulations of various countries, especially in the use of DFS channels in the 5GHz band, to avoid radar signal interference.

Method used

By adopting DFS channels in the Wi-Fi P2P service and STA service of electronic devices, the radar signal is dynamically monitored and switched to a legal non-DFS channel when interference is detected, ensuring the concurrency efficiency and compliance of the service.

Benefits of technology

It realizes that the Wi-Fi P2P service and STA service of electronic devices are efficiently concurrent on the same frequency and channel, and complies with the communication regulations of various countries, avoids radar signal interference, and improves the legality, compliance and stability of the service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121646969A_ABST
    Figure CN121646969A_ABST
Patent Text Reader

Abstract

The invention provides a channel selection method, electronic equipment, a chip system and a storage medium. In the method, when the STA service of the electronic equipment is realized by adopting a DFS channel, the Wi-Fi P2P service and / or the Wi-Fi hotspot service of the electronic equipment are / is selected to be started on the DFS channel. Therefore, not only can the working channel of the Wi-Fi P2P service and / or the Wi-Fi hotspot service accord with national regulations, but also the service concurrence efficiency of the electronic equipment can be ensured to be higher.
Need to check novelty before this filing date? Find Prior Art

Description

Channel selection method, electronic device, chip system and storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on December 4, 2023, with application number 202311659198.X and application name “Channel selection method, electronic device, chip system and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of smart terminal technology, and in particular to a channel selection method, electronic equipment, chip system and storage medium. Background Art

[0003] Wi-Fi (wireless fidelity) is a wireless communication technology and an implementation of a WLAN (Wireless Local Area Network). A Wi-Fi-enabled electronic device can connect to a Wi-Fi wireless access point (AP) and become a STA (Station) of the Wi-Fi AP.

[0004] Electronic devices can connect to each other via Wi-Fi peer-to-peer (P2P) to implement related functional services, such as wireless screen projection, wireless transmission, and smart home services.

[0005] When an electronic device connects to a Wi-Fi wireless AP and becomes a STA, it also establishes a Wi-Fi P2P connection with other devices to perform related P2P services. In this case, how to make the concurrent STA and P2P services of the electronic device more efficient is a problem that needs to be solved.

[0006] Summary of the Invention

[0007] This application provides a channel selection method, electronic device, chip system, and storage medium. In this method, Wi-Fi P2P services can be started on the DFS channel following STA services, which not only complies with communication regulations but also ensures higher service concurrency efficiency of electronic devices.

[0008] In a first aspect, an embodiment of the present application provides a channel selection method. The method is applied to a first electronic device and includes:

[0009] When establishing a Wi-Fi point-to-point P2P connection with a second electronic device, the first electronic device determines whether the first electronic device currently has a station STA service; when the first electronic device currently has a first STA service, the first electronic device determines that the bearer channel of the first STA service is the first channel, and the first channel is a dynamic frequency selection DFS channel; the first electronic device sends information of the first channel to the second electronic device; and a Wi-Fi P2P connection is established between the first electronic device and the second electronic device on the first channel.

[0010] Exemplarily, the first electronic device is a PC, and the second electronic device is a mobile phone.

[0011] In this way, when the STA service of an electronic device is implemented using a DFS channel, the Wi-Fi P2P service of the electronic device is also started on the same DFS channel. This not only makes the working channel of the Wi-Fi P2P service comply with national regulations, but also ensures that the service concurrency efficiency of the electronic device is higher.

[0012] According to the first aspect, the method also includes: the first electronic device receives first information sent by the wireless access point; the first information is used to instruct the first electronic device to switch the first STA service to the second channel, wherein the second channel is a non-DFS channel; the first electronic device switches the bearer channel of the first STA service to the second channel; the first electronic device sends second information to the second electronic device, the second information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the second channel; and the Wi-Fi P2P service between the first electronic device and the second electronic device is switched to the second channel.

[0013] Exemplarily, the first information is information including a channel switching notification. For example, when the AP detects that the frequency band of its working channel is interfered by a radar signal, the AP sends a channel switching notification to a terminal device connected to the AP.

[0014] In this way, when the STA service of the first electronic device switches channels, the first electronic device determines that the channel carrying the Wi-Fi P2P service will be switched accordingly, so that the STA service and the Wi-Fi P2P service of the first electronic device continue to be implemented on the same frequency and channel, while ensuring the compliance of the Wi-Fi P2P service channel.

[0015] According to the first aspect, or any implementation of the first aspect above, the method further includes: the first electronic device determines that the first STA service is interrupted; the first electronic device selects a third channel and sends third information to the second electronic device, where the third information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the third channel, where the third channel is a non-DFS channel; and the first electronic device switches the Wi-Fi P2P service between the first electronic device and the second electronic device to the third channel.

[0016] After the STA service of the first electronic device is interrupted, the first electronic device cannot receive the radar signal forced back-off event sent by the wireless access point, and therefore cannot know whether there is radar signal interference on the current operating channel (i.e., the DFS channel) of the Wi-Fi P2P service. Therefore, after determining that the connection between the first electronic device and the wireless access point is disconnected, the first electronic device reselects a valid operating channel for the Wi-Fi P2P service.

[0017] According to the first aspect, or any implementation of the first aspect above, the first electronic device selects the third channel, including: the first electronic device selects a legal third channel according to the country code information and a preset channel selection strategy.

[0018] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0019] When the first electronic device currently has a first STA service, the first electronic device determines that the bearer channel of the first STA service is the fourth channel, and the fourth channel is a non-DFS channel; the first electronic device sends information of the fourth channel to the second electronic device; on the fourth channel, a Wi-Fi P2P connection is established between the first electronic device and the second electronic device.

[0020] In this way, when the STA service bearer channel of the first electronic device is a non-DFS channel, the Wi-Fi P2P service can also be started on the same non-DFS channel, so that the STA service and the Wi-Fi P2P service are implemented on the same frequency and channel.

[0021] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0022] When no STA service currently exists on the first electronic device, the first electronic device selects the fifth channel according to the country code information and a preset channel selection policy; the fifth channel is a non-DFS channel; the first electronic device sends information on the fifth channel to the second electronic device; and a Wi-Fi P2P connection is established between the first electronic device and the second electronic device on the fifth channel.

[0023] In this way, when the STA service does not exist, the Wi-Fi P2P service cannot be implemented on the same frequency and channel as the STA service. The first electronic device can select a legal and compliant working channel for the Wi-Fi P2P service based on the country code information and the preset channel selection strategy.

[0024] According to the first aspect, or any implementation of the first aspect above, after a Wi-Fi P2P connection is established between the first electronic device and the second electronic device on the fifth channel, the method further includes: the first electronic device accesses the wireless access point to perform a second STA service; the first electronic device determines that the bearer channel for the second STA service is the sixth channel; the first electronic device sends fourth information to the second electronic device, where the fourth information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the sixth channel; and the first electronic device switches the Wi-Fi P2P service between the first electronic device and the second electronic device to the sixth channel.

[0025] In this way, before the Wi-Fi P2P service ends, if the STA service is started, the Wi-Fi P2P service channel can still be switched following the STA service channel, so that the STA service and Wi-Fi P2P service of the first electronic device can continue to be implemented on the same frequency and channel, while ensuring the compliance of the Wi-Fi P2P service channel.

[0026] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first electronic device switches the second STA service to another channel, the first electronic device switches the Wi-Fi P2P service between the first electronic device and the second electronic device to the corresponding channel.

[0027] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the second STA service of the first electronic device is interrupted, the first electronic device reselects a channel for the Wi-Fi P2P service and switches the Wi-Fi P2P service between the first electronic device and the second electronic device to the reselected channel.

[0028] According to the first aspect, or any implementation of the first aspect, the sixth channel is a DFS channel or a non-DFS channel.

[0029] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0030] When the first electronic device turns on the Wi-Fi hotspot service of the first electronic device, it determines whether the first electronic device currently has a site STA service; when the first electronic device currently has a third STA service, the first electronic device determines that the bearer channel of the third STA service is the seventh channel, and the seventh channel is a DFS channel; the first electronic device broadcasts information on the seventh channel; on the seventh channel, a Wi-Fi hotspot connection is established between the first electronic device and the third electronic device.

[0031] In this way, when the STA service of an electronic device is implemented using a DFS channel, the Wi-Fi hotspot service of the electronic device is also started on the same DFS channel. This not only makes the working channel of the Wi-Fi hotspot service comply with national regulations, but also ensures that the service concurrency efficiency of the electronic device is higher.

[0032] According to the first aspect, or any implementation of the first aspect above, the method further includes:

[0033] The first electronic device receives fifth information sent by the wireless access point, where the fifth information is used to instruct the first electronic device to switch the third STA service to the eighth channel, which is a non-DFS channel; the first electronic device switches the bearer channel of the third STA service to the eighth channel; the first electronic device sends sixth information to the third electronic device, where the sixth information is used to instruct the third electronic device to switch the Wi-Fi hotspot service to the eighth channel; the first electronic device switches the Wi-Fi hotspot service between the first electronic device and the second electronic device to the eighth channel.

[0034] Exemplarily, the fifth information includes a channel switching notification. For example, when the AP detects that the frequency band of its working channel is interfered by a radar signal, the AP sends a channel switching notification to a terminal device connected to the AP.

[0035] In this way, when the STA service of the first electronic device switches channels, the first electronic device determines that the channel carrying the Wi-Fi hotspot service will be switched accordingly, so that the STA service of the first electronic device and the Wi-Fi hotspot service can continue to be implemented on the same frequency and channel, while ensuring the compliance of the Wi-Fi hotspot service channel.

[0036] According to the first aspect, or any implementation of the first aspect above, the method further includes: the first electronic device determines that the third STA service is interrupted; the first electronic device selects the ninth channel and sends seventh information to the second electronic device, where the seventh information is used to instruct the second electronic device to switch the Wi-F hotspot service to the ninth channel, where the ninth channel is a non-DFS channel; the first electronic device switches the Wi-F hotspot service between the first electronic device and the third electronic device to the ninth channel.

[0037] After the STA service of the first electronic device is interrupted, the first electronic device cannot receive the radar signal forced back-off event sent by the wireless access point, and therefore cannot know whether there is radar signal interference on the current operating channel of the Wi-Fi hotspot service (i.e., the DFS channel). Therefore, after determining that the connection between the first electronic device and the wireless access point is disconnected, the first electronic device reselects a valid operating channel for the Wi-Fi hotspot service.

[0038] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the first electronic device currently does not have an STA service, the first electronic device selects the tenth channel according to the country code information and a preset channel selection policy; the tenth channel is a non-DFS channel; the first electronic device broadcasts information on the tenth channel; and on the tenth channel, a Wi-Fi hotspot connection is established between the first electronic device and the third electronic device.

[0039] In this way, when the STA service does not exist, the Wi-Fi hotspot service cannot be implemented on the same frequency and channel as the STA service. The first electronic device can select a legal and compliant working channel for the Wi-Fi hotspot service based on the country code information and the preset channel selection strategy.

[0040] According to the first aspect, or any implementation of the first aspect above, after a Wi-Fi hotspot connection is established between the first electronic device and the third electronic device, the method further includes: the first electronic device accesses the wireless access point to perform a fourth STA service; the first electronic device determines that the bearer channel for the fourth STA service is the eleventh channel; the first electronic device sends eighth information to the second electronic device, where the eighth information is used to instruct the second electronic device to switch the Wi-Fi hotspot service to the eleventh channel; and the first electronic device switches the Wi-Fi hotspot service between the first electronic device and the second electronic device to the eleventh channel.

[0041] In a second aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the channel selection method of the first aspect and any one of the first aspects.

[0042] According to a second aspect, the electronic device is a PC.

[0043] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0044] In a third aspect, an embodiment of the present application provides a computer-readable storage medium comprising a computer program, which, when executed on an electronic device, causes the electronic device to execute the channel selection method of the first aspect and any one of the first aspects.

[0045] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0046] In a fourth aspect, an embodiment of the present application provides a chip system for use in an electronic device (e.g., a PC). The chip system includes instructions and at least one processor. The at least one processor executes the instructions to enable the PC to execute the channel selection method of the first aspect and any one of the first aspects.

[0047] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0048] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium comprising a computer program, which, when executed on an electronic device, causes the electronic device to execute the channel selection method of the first aspect and any one of the first aspects.

[0049] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] FIG1 is an exemplary diagram of a Wi-Fi P2P service application scenario;

[0051] FIG2 exemplarily illustrates an application scenario in which an electronic device simultaneously performs STA services and Wi-Fi P2P services;

[0052] FIG3 is a schematic diagram showing an exemplary hardware structure of an electronic device;

[0053] FIG4 is a schematic diagram illustrating a software structure of an electronic device;

[0054] FIG5a is one of the exemplary schematic diagrams of module interaction;

[0055] FIG5 b is one of the exemplary module interaction diagrams;

[0056] FIG5c is one of the schematic diagrams of exemplary traffic channel switching;

[0057] FIG5 d is one of the exemplary schematic diagrams of module interaction;

[0058] FIG5e is one of the schematic diagrams of exemplary traffic channel switching;

[0059] FIG6a is one of the exemplary schematic diagrams of module interaction;

[0060] FIG6 b is one of the exemplary schematic diagrams of module interaction;

[0061] FIG6c is one of the schematic diagrams of exemplary traffic channel switching;

[0062] FIG6 d is one of the exemplary schematic diagrams of module interaction;

[0063] FIG6e is one of the schematic diagrams of exemplary traffic channel switching;

[0064] FIG7 is a schematic diagram illustrating a service channel when an electronic device executes a STA service and a Wi-Fi P2P service simultaneously;

[0065] FIG8 is one of the schematic diagrams of exemplary module interactions;

[0066] FIG9 is a flow chart showing an exemplary channel selection method. DETAILED DESCRIPTION

[0067] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0068] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0069] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.

[0070] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0071] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.

[0072] Wi-Fi (wireless fidelity) is a wireless communication technology and an implementation of WLAN (Wireless Local Area Network). Currently, Wi-Fi technology is mainly implemented in high-frequency bands such as 2.4 GHz and 5 GHz. In Wi-Fi technology, an AP is the creator of a Wi-Fi wireless network and is the central node of a Wi-Fi wireless network. As you can understand, a wireless router is an AP. In Wi-Fi technology, a STA is an electronic device connected to a Wi-Fi wireless network. As you can understand, every electronic device connected to a wireless router (such as a mobile phone, tablet computer, PC (Personal Computer), etc.) can be called a STA.

[0073] With the continuous development of science and technology, there are more and more interconnected applications between electronic devices, such as wireless screen projection, wireless transmission, smart home, data cloning, etc. These interconnected applications can realize device interconnection based on Wi-Fi Direct technology. Among them, Wi-Fi Direct technology is a point-to-point connection technology based on the IEEE 802.11 protocol. Wi-Fi Direct can also be called Wi-Fi P2P (Peer to Peer, point-to-point) connection. After establishing a Wi-Fi P2P connection, electronic devices can share data with each other. Taking the wireless screen projection scenario as an example, as shown in Figure 1, after PC 100 and mobile phone 200 establish a Wi-Fi P2P connection, mobile phone 200 can share its screen to PC 100.

[0074] When an electronic device accesses a Wi-Fi wireless AP and becomes a STA, the electronic device can also establish a Wi-Fi P2P connection with other terminal devices to perform P2P services, such as wireless screen projection services, wireless mutual transmission services, etc. As shown in Figure 2, when the PC 100 accesses the wireless router 300 and becomes a STA, the PC 100 can also establish a Wi-Fi P2P connection with the mobile phone 200 to perform wireless screen projection services. In this case, the user can use the PC 100 to surf the Internet (such as watching videos, etc.), and can also cast the screen of the mobile phone 200 to the PC 100 end, so as to view the screen of the mobile phone 200 on the display screen of the PC 100 at the same time.

[0075] Compared to the 2.4GHz channel, the 5GHz channel has higher data transmission efficiency. Therefore, in order to improve the concurrent efficiency of the STA service and P2P service of the PC 100, the PC 100 can access the wireless router 300 based on the 5GHz channel, and also establish a Wi-Fi P2P connection with the mobile phone 200 based on the 5GHz channel. It can be understood that the 2.4GHz channel mentioned herein refers to the channel in the 2.4GHz frequency band, and the 5GHz channel (abbreviated as 5G channel) refers to the channel in the 5GHz frequency band.

[0076] The 5GHz band, commonly known as the 5G Wi-Fi band, is a free-to-use radio frequency band (5150MHz-5825MHz). This band has 201 channels, but only a few are usable by the Wi-Fi protocol. This is because it's a special band that overlaps with military radar frequencies. Consequently, many countries have reservations about using the 5GHz band for national security reasons.

[0077] Because relevant authorities in China have opened up more channels in the 5GHz band for Wi-Fi transmission, the China Communications Commission has approved the unlicensed use of Wi-Fi equipment in the UNII-2 bands (5.25GHz to 5.35GHz and 5.47GHz to 5.725GHz). These bands are also used for military equipment and weather radar, making DFS (Dynamic Frequency Selection) a prerequisite for Wi-Fi equipment to use the 5GHz band.

[0078] DFS dynamically adjusts the communication channels between APs and terminals in a wireless LAN. It is a mechanism that dynamically monitors radar signals and avoids interference with radar systems. Some radar systems operate in the 5.25GHz to 5.35GHz and 5.47GHz to 5.725GHz frequency bands, which can interfere with AP radio signals operating in the 5GHz band. When an AP detects radar signal interference on its operating channel, it automatically switches to another operating channel. The DFS channels mentioned in this article refer to the 5GHz channels shared by Wi-Fi and radar.

[0079] The number of 5GHz channels opened varies from country to country. Some countries, with their advanced anti-interference technology, open more frequency bands, while others open fewer or even none. Different countries have different DFS channel allocation strategies. Different countries also have different strategies for opening up 5GHz channels. Table 1 shows the 5GHz channel development status of some countries. As can be seen from Table 1, different countries have different 5GHz restricted channel allocations.

[0080] Table 1

[0081] A country code (also known as a country code) is a code that identifies a country, independent organization, or specific geopolitical region. When selecting a 5GHz channel, electronic devices need to obtain the country code to understand the country's 5GHz channel usage policy and avoid violating national regulations.

[0082] It is understandable that DFS channels are not completely prohibited for electronic devices to use. When electronic devices use DFS channels, they need to limit the transmission power. If corresponding radar signals are detected during their use, they need to immediately stop using the current channel and find an idle channel for access.

[0083] The present application provides a channel selection method. In this method, when the STA service of an electronic device is implemented using a DFS channel, the P2P service and / or hotspot service of the electronic device is also selected to be started on the DFS channel. This not only complies with national regulations, but also ensures higher service concurrency efficiency of the electronic device due to the larger bandwidth of the DFS channel.

[0084] It can be understood that the STA service of an electronic device refers to various Internet services performed after the electronic device is connected to a wireless AP and becomes a station.

[0085] The electronic device may be a mobile phone, a tablet computer, a PC (such as a laptop computer, a desktop computer), etc. This embodiment does not limit the type of the electronic device.

[0086] FIG3 is a schematic diagram illustrating the structure of an electronic device. It should be understood that the electronic device shown in FIG3 is merely an example of an electronic device, and that the electronic device may have more or fewer components than shown, may combine two or more components, or may have a different component configuration. The various components shown in FIG3 may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.

[0087] The electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, a wireless communication module 150, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a camera 193, and a display screen 194. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

[0088] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0089] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface.

[0090] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only for illustrative purposes and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0091] The wireless communication module 150 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), etc. applied to electronic devices. The wireless communication module 150 can be one or more devices that integrate at least one communication processing module. The wireless communication module 150 receives electromagnetic waves through the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 150 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna. Exemplarily, the wireless communication module 150 can be a communication chip with Wi-Fi function and Bluetooth function.

[0092] In some implementations, taking a PC as an example, the PC may include a primary communication chip and a secondary communication chip. The primary communication chip includes a Bluetooth module and a Wi-Fi module, while the secondary communication chip also includes a Bluetooth module and a Wi-Fi module. The primary communication chip can be used solely to carry Wi-Fi P2P services, while the secondary communication chip can also be used solely to carry Wi-Fi P2P services.

[0093] It should be noted that the Bluetooth module included in the main communication chip can be a Bluetooth chip (tentatively referred to as the main Bluetooth chip), and the Wi-Fi module included in the main communication chip can be a Wi-Fi chip (tentatively referred to as the main Wi-Fi chip). Specifically, the main Bluetooth chip and the main Wi-Fi chip can be integrated in the same chip, and this integrated chip is the main communication chip. Of course, the main Bluetooth chip and the main Wi-Fi chip may not be integrated in the same chip, and the combination of the main Bluetooth chip and the main Wi-Fi chip is called the main communication chip. Similarly, the Bluetooth module included in the auxiliary communication chip can be a Bluetooth chip (tentatively referred to as the auxiliary Bluetooth chip), and the Wi-Fi module included in the auxiliary communication chip can be a Wi-Fi chip (tentatively referred to as the auxiliary Wi-Fi chip). Specifically, the auxiliary Bluetooth chip and the auxiliary Wi-Fi chip can be integrated in the same chip, and this integrated chip is the auxiliary communication chip. Of course, the auxiliary Bluetooth chip and the auxiliary Wi-Fi chip may not be integrated in the same chip, and the combination of the auxiliary Bluetooth chip and the auxiliary Wi-Fi chip is called the auxiliary communication chip.

[0094] The primary communication chip can be understood as the existing communication chip of the electronic device, and the secondary communication chip can be understood as a small communication chip added on the basis of the existing communication chip. In other words, in addition to the existing primary communication chip, the PC also has a new secondary communication chip (or small communication chip). The primary communication chip has Wi-Fi communication capabilities and Bluetooth communication capabilities, and the secondary communication chip also has Wi-Fi communication capabilities and Bluetooth communication capabilities.

[0095] The electronic device implements display functionality through a GPU, display screen 194, and an application processor. Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The electronic device can implement camera functionality through an ISP, camera 193, a video codec, a GPU, display screen 194, and an application processor. The ISP processes data fed back by camera 193. In some embodiments, the ISP may be incorporated into camera 193. Camera 193 is used to capture still images or videos.

[0096] Electronic devices can implement audio functions such as music playback and recording through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor. Audio module 170 is used to convert digital audio information into analog audio signal output and also to convert analog audio input into digital audio signals. Audio module 170 can also be used to encode and decode audio signals.

[0097] In some embodiments, the processor 110 may further include a modem processor. The modem processor may include a modulator and a demodulator. The modulator is used to modulate a low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The electronic device may further include a mobile communication module, a SIM (Subscriber Identity Module) card interface, and the like. The mobile communication module may provide wireless communication solutions for electronic devices, including 2G / 3G / 4G / 5G.

[0098] Figure 4 illustrates an exemplary software structure of an electronic device. As shown in Figure 4, the layered architecture of an electronic device divides the software into several layers, each with clear roles and divisions of labor. Layers communicate with each other via software interfaces. In some embodiments, the software structure of an electronic device can be divided into an application layer and an operating system (OS). In addition, the software structure of the electronic device also includes a software module for a communication chip (or a network card of the electronic device).

[0099] As shown in Figure 4, the application layer may include a service layer, middleware, Bluetooth connection tools, and Wi-Fi connection tools. For example, the service layer may include a series of application packages, such as wireless sharing, wireless screen projection, and wireless companion applications. For example, when these application packages establish a Wi-Fi P2P connection between the electronic device and other terminals, data can be transmitted between the electronic device and other terminals based on the Wi-Fi P2P connection.

[0100] Middleware (or interconnected middleware) is independent system software or service programs that enable distributed applications to share resources across different technologies. Middleware resides on top of the client / server operating system, managing computer resources and network communications. Middleware is software that connects two independent applications or systems. Connected systems, even with different interfaces, can still exchange information through middleware. A key component of middleware execution is information transfer. Middleware enables applications to operate across multiple platforms or operating systems.

[0101] The Bluetooth connection tool is used to implement Bluetooth connection-related functions, such as Bluetooth scanning, Bluetooth off / on / status monitoring, Bluetooth name reading / MAC address reading, Bluetooth broadcast sending, Bluetooth broadcast packet assembly, start / stop broadcasting, Bluetooth broadcast packet processing, etc. The Bluetooth connection tool can also be used to generate instructions corresponding to the Bluetooth chip and send them to the communication chip through the communication chip application API (Application Program Interface).

[0102] For example, the application of the business layer can query the Bluetooth status and control the Bluetooth chip to perform Bluetooth scanning and Bluetooth broadcasting through the middleware and Bluetooth connection tool.

[0103] Wi-Fi connection tools are used to implement Wi-Fi connection-related functions, including but not limited to STA management, SAP (Soft Access Point) management, P2P management, and Wi-Fi connection-related channel selection.

[0104] Among them, SAP (or Soft-AP) management can be used to manage SAP in the Wi-Fi chip, such as creating SAP, deleting SAP, etc.

[0105] STA management is used to manage Wi-Fi chips connected to wireless APs.

[0106] P2P management is used to manage Wi-Fi P2P connections.

[0107] Exemplarily, the channel selection module in the Wi-Fi connection tool is used to implement channel selection or channel switching related to Wi-Fi connection. In an embodiment of the present application, when the STA service is implemented on the DFS channel, the channel selection module can select the DFS channel to carry the Wi-Fi P2P service and / or HOTSPOT service. The channel selection module can also switch the bearer channel of the Wi-Fi P2P service and / or HOTSPOT service to the same channel when the STA service is switched from the DFS channel to other channels. The channel selection module can also switch the bearer channel of the Wi-Fi P2P service and / or HOTSPOT service from the DFS channel to other non-DFS channels when the STA service communication is disconnected. In addition, when the STA service is not implemented on the DFS channel, the channel selection module can select a compliant 5G Hz channel as the bearer channel for the Wi-Fi P2P service based on the country code information.

[0108] The Wi-Fi connection tool can also be used to generate instructions corresponding to the Wi-Fi chip and send them to the communication chip through the communication chip application API to implement the corresponding Wi-Fi communication functions. For example, the business layer application can instruct the communication chip to establish a Wi-Fi P2P connection and monitor the Wi-Fi link status through the middleware and Wi-Fi connection tool.

[0109] An operating system (OS) is a large program system that allocates and schedules all of a computer's software and hardware resources, controls and coordinates the activities of multiple tasks, and enables information access and protection. It also provides a user interface, ensuring a comfortable working environment.

[0110] For example, as shown in Figure 4, the OS may include a communication chip application API, a local Wi-Fi function module, a Bluetooth service module, a network service module, a local API, a system driver API, a Wi-Fi component, a Bluetooth protocol stack, and a network protocol stack. The communication chip application API can be used to manage and control the communication chip.

[0111] As can be understood, the local Wi-Fi function module is used to provide services related to the Wi-Fi function, the Bluetooth service module is used to provide services related to the Bluetooth function, and the network service module is used to provide services related to the network. The local API can be used to manage and control local functions, and the system driver API can be used to manage and control system driver functions.

[0112] Continuing to refer to Figure 4, the software module of the communication chip refers to the functional module corresponding to the communication chip, including the Bluetooth miniport (mini port) driver, the Wi-Fi miniport (mini port) driver, the HAL (Hardware Abstraction Layer) corresponding to the main communication chip, and the firmware corresponding to the main communication chip.

[0113] Among them, HAL is the interface layer located between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and provides a virtual hardware platform for the operating system.

[0114] Firmware is typically stored in EEPROM (Electrically Erasable Programmable ROM) or Flash memory chips and can be updated by the user through a specific flash program. Firmware is the underlying code that connects the hardware and the operating system during computer startup. It enables the operating system to operate according to standard device drivers to implement specific machine behaviors.

[0115] It is understood that the layers in the software structure shown in FIG4 and the components contained in each layer do not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer layers than shown, and each layer may include more or fewer components, and this application does not limit this.

[0116] It is understandable that, in order to implement the channel selection method in the embodiment of the present application, the electronic device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0117] The channel selection method provided in the embodiment of the present application is explained below by taking a PC as an example of an electronic device.

[0118] Scene 1

[0119] In this scenario, before the PC starts Wi-Fi P2P services, it already has STA services, and the bearer channel for STA services is a DFS channel. In this case, the PC can use the DFS channel that carries STA services as the channel for Wi-Fi P2P services. When the bearer channel for STA services changes, the bearer channel for Wi-Fi P2P services also changes. If the STA services are interrupted, the PC reselects another compliant 5G channel for Wi-Fi P2P services.

[0120] Figure 5a is an exemplary flowchart of module interaction. As shown in Figure 5a, the process of the channel selection method provided in the embodiment of the present application includes:

[0121] S401: The PC connects to the AP as a station.

[0122] After a PC connects to an AP through its communication chip (specifically, a Wi-Fi chip), it becomes a station of the AP. The PC's communication chip operates in Wi-Fi Station mode and can perform STA services, allowing users to access the Internet through the PC.

[0123] S402: In response to a user operation, a Bluetooth connection is established between the mobile phone and the PC.

[0124] The user operation refers to the operation used to trigger the establishment of a Wi-Fi P2P connection between the mobile phone and the PC to implement Wi-Fi P2P services. Common scenarios for establishing a Wi-Fi P2P connection between a mobile phone and a PC include wireless screen projection and wireless data transmission. This embodiment uses the wireless screen projection scenario as an example to explain.

[0125] It is understandable that the initial step for a mobile phone and a PC to establish a Wi-Fi P2P connection is device scanning and discovery. The mobile phone and the PC can complete device discovery by sending a request frame at one end (such as a mobile phone) and returning a response frame after receiving the request frame at the other end (such as a PC). In this way, the PC can be displayed in the list of available devices for mobile phone screen projection. In some embodiments, the request frame and the response frame may carry indication information to indicate that a Wi-Fi P2P connection needs to be established to complete wireless screen projection, etc.

[0126] In an embodiment of the present application, before the mobile phone and the PC establish a Wi-Fi P2P connection, the device scanning and discovery process is implemented based on the Bluetooth function, and then the Bluetooth pairing and link establishment process is performed between the mobile phone and the PC, so that the mobile phone and the PC can exchange device information based on the Bluetooth connection, preparing for the establishment of a Wi-Fi P2P connection between the mobile phone and the PC.

[0127] In an optional embodiment, the user's operation in the mobile phone screen projection application can be, for example, the user's operation of scanning a QR code using the scanning function in the mobile phone screen projection application. When the user wants to project the display screen of the mobile phone to the PC for display, the screen projection application can be started on the mobile phone, and the scanning function of the screen projection application can be turned on. Based on the scanning function, the relevant QR code of the PC is scanned so that the mobile phone can discover the PC and perform Bluetooth pairing and link establishment with the PC. In this way, the PC can be used as a device to which the mobile phone can project the screen, and then the mobile phone can establish a Wi-Fi P2P connection with the PC.

[0128] In another optional embodiment, the user's operation in the mobile screen casting application can be, for example, the user's operation of opening the screen casting application, or the user's operation of holding the mobile phone close to the PC after opening the screen casting application. When the user wants to cast the display screen of the mobile phone to the PC for display, the screen casting application can be launched on the mobile phone. The screen casting application automatically scans the surrounding devices based on the Bluetooth function of the mobile phone to find the devices to which it can cast the screen.

[0129] For example, if a Bluetooth connection has been established between the mobile phone and one of the devices (such as a PC), when the mobile phone automatically scans and discovers the device based on the Bluetooth function, it automatically performs Bluetooth pairing and establishes a link with it. Optionally, after the mobile phone scans and discovers the PC, it automatically performs Bluetooth pairing and establishes a link with it. If the user needs to project the mobile phone display screen to other devices, the relevant operations can also be performed to disconnect the Bluetooth connection (or Wi-Fi P2P connection) between the mobile phone and the PC, and re-establish the Bluetooth connection between the mobile phone and the other device. This embodiment does not limit this.

[0130] For example, if the mobile phone has not established a Bluetooth connection with any nearby device, the mobile phone will automatically scan for devices based on the Bluetooth function and display a Bluetooth device discovery list. The user can then select the PC in the Bluetooth device discovery list to initiate Bluetooth pairing and link establishment between the mobile phone and the PC, completing the Bluetooth connection between the two.

[0131] It should be noted that in the embodiment of the present application, the Bluetooth function of the PC is set to be on so that the mobile phone can establish a Bluetooth connection with the PC, and then device information is exchanged based on the Bluetooth connection to complete the process of establishing a Wi-Fi P2P connection between the mobile phone and the PC.

[0132] It should be pointed out that the operations mentioned above for triggering the establishment of a Bluetooth connection between a mobile phone and a PC are all illustrative examples, and this embodiment does not limit this. In the embodiment of the present application, the establishment of a Bluetooth connection between a mobile phone and a PC is in preparation for the establishment of a Wi-Fi P2P connection between the mobile phone and the PC. For example, the mobile phone and the PC can exchange information related to the Wi-Fi P2P connection based on the Bluetooth connection between the two. Moreover, compared with the discovery of the peer device based on Wi-Fi scanning between the mobile phone and the PC, the discovery of the peer device based on Bluetooth scanning between the mobile phone and the PC takes less time and is more efficient, which can improve the overall time taken to establish a Wi-Fi P2P connection between the mobile phone and the PC.

[0133] Among them, the implementation of the above-mentioned Bluetooth scanning and device discovery process, Bluetooth device pairing and Bluetooth link establishment process requires the support of the Bluetooth connection tools and Bluetooth chip operations in the PC and mobile phone. The specific details can be referred to the existing technology, and this embodiment will not go into details.

[0134] S403: The mobile phone and the PC perform Wi-Fi P2P connection negotiation based on the Bluetooth connection.

[0135] After a Bluetooth connection is established between the mobile phone and the PC, the mobile phone and the PC can negotiate relevant information based on the Bluetooth connection to establish a Wi-Fi P2P connection between the two. The mobile phone can send a Wi-Fi P2P connection negotiation request to the PC, and the PC feeds back a Wi-Fi P2P connection negotiation response to the mobile phone. Exemplarily, the information carried in the Wi-Fi P2P connection negotiation request may include, but is not limited to, the device name, device type, Wi-Fi P2P service type, etc., which is not limited in this embodiment. The Wi-Fi P2P service type can be used to determine the channel bandwidth that matches the Wi-Fi P2P service.

[0136] Optionally, the mobile phone and PC can perform GO (Group Owner) negotiation based on the Bluetooth connection. After establishing a Bluetooth connection between the mobile phone and PC, the two can perform GO negotiation based on the Bluetooth connection to determine which device is the GO node, which device is the GC (Group Client) node, and the characteristics of the P2P group.

[0137] GO negotiation can ultimately determine which device is the GO node, which device is the GC node, and the characteristics of the P2P group through three frame interactions. These three frame interactions include GO Negotiation Request (GO Negotiation Request), GO Negotiation Response (GO Negotiation Response), and GO Negotiation Confirmation (GO Negotiation Confirmation). In the embodiment of the present application, these three frame interactions are performed between the mobile phone and the PC based on the direct Bluetooth connection between the two.

[0138] The GO negotiation request and GO negotiation response include a GO Intent, an integer value between 0 and 15. The magnitude of these two values ​​determines which device is the GO node. If the GO Intents of two devices are unequal, the device with the larger GO Intent becomes the GO node. If the GO Intents of two devices are equal and less than 15, the tie breaker in the GO negotiation request determines whether the local device becomes the GO node. If the tie breaker is 1, the local device becomes the GO node; otherwise, the remote device becomes the GO node. If the GO Intents of two devices are equal and equal to 15, the GO negotiation fails.

[0139] In the embodiment of the present application, the result of the GO negotiation between the mobile phone and the PC based on the Bluetooth connection is that the PC is the GO node. For any details not explained in detail about the GO negotiation, please refer to the existing technology and will not be repeated here.

[0140] S404 , application 1 of the PC sends a Wi-Fi P2P service channel selection request to the Wi-Fi connection tool.

[0141] Before establishing a Wi-Fi P2P connection between a mobile phone and a PC, you need to select a channel that corresponds to the Wi-Fi P2P service. Once the channel is determined, the mobile phone controls the communication chip to establish a Wi-Fi P2P connection with the mobile phone based on that channel.

[0142] Exemplarily, the Wi-Fi P2P service channel selection request may include but is not limited to the Wi-Fi P2P service type.

[0143] S405 : The Wi-Fi connection tool of the PC determines that the bearer channel of the STA service is a DFS channel.

[0144] When selecting a channel for Wi-Fi P2P services, the PC's Wi-Fi connection tool first determines whether the PC is performing STA services, that is, whether it is connected to a wireless router. In this scenario, the PC is already connected to a wireless router and performing STA services. If the Wi-Fi connection tool finds that the PC's communication chip is performing STA services, it then determines whether the PC's communication chip is using a DFS channel to carry STA services. This scenario uses the PC's communication chip using a DFS channel to carry STA services as an example.

[0145] S406 : The Wi-Fi connection tool of the PC selects the DFS channel carrying the STA service as the channel carrying the Wi-Fi P2P service.

[0146] Because the current bearer channel for the PC's STA service is a DFS channel, there is no radar signal on the DFS channel and it can be used for Wi-Fi P2P services. Therefore, the channel selection module in the Wi-Fi connection tool can use the DFS channel as the channel for carrying Wi-Fi P2P services.

[0147] This allows STA services and Wi-Fi P2P services to use DFS channels simultaneously, ensuring greater concurrency and efficiency. Furthermore, the use of DFS channels by Wi-Fi P2P services is currently legal and compliant.

[0148] S407: The Wi-Fi connection tool of the PC creates a GO role on the DFS channel and sends the GO role information and Wi-Fi P2P service channel information to the mobile phone.

[0149] The GO role information may include, but is not limited to, a device identifier, a MAC address, etc. The Wi-Fi P2P service channel information may include, but is not limited to, a channel number, a channel frequency band, a channel bandwidth, etc. Optionally, the Wi-Fi P2P service channel information may be included in the GO role information, which is not limited in this embodiment.

[0150] In this process, the PC acts as the GO node and sends link establishment information to the mobile phone. The link establishment information may include but is not limited to channel information, password, SSID (Service Set Identifier), and MAC address of the GO node.

[0151] S408, the mobile phone's Wi-Fi connection tool creates a GC role.

[0152] S409: On the DFS channel, the mobile phone connects to the PC and establishes a Wi-Fi P2P connection with the PC.

[0153] After the PC and mobile phone complete GO negotiation, select the DFS channel corresponding to the Wi-Fi P2P connection, and create a GO on that DFS channel, the PC, acting as the GO node, can exchange link establishment information with the mobile phone, acting as the GC node, completing the GC access to the GO. This establishes a Wi-Fi P2P connection between the PC and mobile phone, enabling them to perform Wi-Fi P2P services.

[0154] Regarding the GC access to the GO and the parts not explained in detail in the Wi-Fi P2P connection establishment process, you can refer to the existing technology and will not repeat them here.

[0155] Taking the wireless screen projection service as an example, after the Wi-Fi P2P connection between the mobile phone and the PC's auxiliary communication chip is established, the PC can use the Wi-Fi P2P connection between the auxiliary communication chip and the mobile phone to transmit data related to the wireless screen projection service to the mobile phone. This allows the mobile phone to automatically project the mobile screen interface to the PC interface, or project user-selected content to the PC interface. In this case, the PC's STA service and Wi-Fi P2P service are both implemented on the same DFS channel.

[0156] Based on the process shown in FIG5a , with continued reference to FIG5b , after the Wi-Fi P2P service between the PC and the mobile phone is started on the DFS channel, the process of the channel selection method provided in the embodiment of the present application may further include:

[0157] S410: The Wi-Fi connection tool of the PC receives a radar signal forced retreat event sent by the AP.

[0158] The AP periodically checks the frequency band of its operating channel for radar signal interference. When the AP detects radar signal interference on its operating channel, it sends a radar signal force-off event (also known as radar signal force-off information) to connected devices. The radar signal force-off event indicates that radar signal interference is present on the current operating channel and that a channel switch is required.

[0159] In step S411, the PC's Wi-Fi connection tool switches the STA service to 5G channel X1 based on the channel switching notification sent by the AP.

[0160] When the AP detects radar signal interference in the frequency band of its working channel, the AP sends a CSA (Channel Switch Announcement) to the terminal device connected to the AP, so that the terminal device can switch its STA service from one channel to another channel (such as 5G channel X1) according to the CSA. Among them, the AP can unicast CSA or broadcast CSA. CSA can be implemented in the following ways: one is an action frame, one is in the form of IE (Information Element) in the beacon frame, and one is in the Probe Response frame.

[0161] The elements related to CSA may include New Channel Number and Channel Switch Count. The New Channel Number indicates the channel after switching, and the Channel Switch Count indicates how long it will take to switch channels.

[0162] When the PC receives the CSA sent by the AP, it switches its STA service to the working channel indicated by the CSA. In this embodiment, the channel identified by the New Channel Number is a non-DFS channel. The following explanation uses the channel identified by the New Channel Number as 5G channel X1 as an example.

[0163] For details about STA service channel switching that are not fully explained, please refer to the existing technology and will not be repeated here.

[0164] S412: After the STA service switches to 5G channel X1, the PC's Wi-Fi connection tool determines to change the channel carrying the Wi-Fi P2P service to 5G channel X1, and sends P2P service channel switching information to the mobile phone.

[0165] In this embodiment of the present application, when the PC's STA service switches channels, the channel selection module in the Wi-Fi connection tool determines that the channel carrying the Wi-Fi P2P service will also switch. That is, when the PC's STA service switches to 5G channel X1 (a non-DFS channel), the channel selection module determines to also change the channel of the Wi-Fi P2P service to 5G channel X1, so that the PC's STA service and Wi-Fi P2P service continue to be implemented on the same frequency and channel.

[0166] Exemplarily, the P2P service channel switching information may include the channel information after switching (such as the channel number), the channel switching time, etc. The P2P service channel switching information may also be sent based on the Bluetooth connection between the mobile phone and the PC, or based on the Wi-Fi connection between the mobile phone and the PC, which is not limited in this embodiment.

[0167] In step S413, the PC switches the Wi-Fi P2P service between the PC and the mobile phone to 5G channel X1.

[0168] After the PC sends the P2P service channel switching information to the mobile phone, the PC and mobile phone re-establish a Wi-Fi P2P connection based on the switched channel information to switch the bearer channel for the Wi-Fi P2P service. The Wi-Fi P2P service channel switching process is not fully explained here, and can be referred to in existing technologies.

[0169] In an embodiment of the present application, as shown in Figure 5c, since the AP detects that the STA service channel of the PC (i.e., the DFS channel) is interfered by a radar signal, when the STA service of the PC is switched from the DFS channel to the non-DFS channel (such as 5G channel X1), the Wi-Fi P2P service between the PC and the mobile phone is also switched from the DFS channel to the corresponding non-DFS channel (such as 5G channel X1).

[0170] In this way, the working channel of the Wi-Fi P2P service between the PC and the mobile phone changes as the working channel of the STA service switches. STA service and Wi-Fi P2P service are implemented in the same frequency communication channel, ensuring higher concurrency efficiency of STA service and Wi-Fi P2P service. In addition, the working channel selected by the PC for Wi-Fi P2P service is also legal and compliant.

[0171] If the working channel of the PC's STA service is switched back to the DFS channel again, the working channel of the Wi-Fi P2P service between the PC and the mobile phone can also be switched back to the DFS channel along with the PC's STA service.

[0172] Based on the process shown in FIG5a , with continued reference to FIG5d , after the Wi-Fi P2P service between the PC and the mobile phone is started on the DFS channel, the process of the channel selection method provided in the embodiment of the present application may further include:

[0173] S414 , the Wi-Fi connection tool of the PC determines that the connection between the PC and the AP is disconnected.

[0174] Exemplarily, the Wi-Fi connection tool of the PC receives a STA disconnection event and determines that the connection between the PC and the AP is disconnected, that is, the STA service of the PC is interrupted.

[0175] In step S415 , the PC's Wi-Fi connection tool determines to change the channel carrying the Wi-Fi P2P service to the 5G channel X2, and sends P2P service channel switching information to the mobile phone.

[0176] When the AP detects radar signal interference on the DFS channel, the PC's STA service is interrupted, so the PC cannot receive the radar signal force-off event sent by the AP. Consequently, the PC cannot promptly learn whether there is radar signal interference on the current Wi-Fi P2P service operating channel (i.e., the DFS channel) and whether a channel switch is necessary. Therefore, after determining that the connection between the PC and the AP is disconnected, the PC's Wi-Fi connection tool must reselect the operating channel for the Wi-Fi P2P service to avoid any impact on the radar system due to delayed channel switching for the Wi-Fi P2P service.

[0177] Among them, the channel selection module in the Wi-Fi connection tool can reselect a non-DFS channel for the Wi-Fi P2P service according to the preset channel selection strategy, and generate P2P service channel switching information based on the reselected non-DFS channel (such as 5G channel X2), and send the P2P service channel switching information to the mobile phone.

[0178] Exemplarily, the P2P service channel switching information may include the channel information after switching (such as the channel number), the channel switching time, etc. The P2P service channel switching information may also be sent based on the Bluetooth connection between the mobile phone and the PC, or based on the Wi-Fi connection between the mobile phone and the PC, which is not limited in this embodiment.

[0179] In step S416, the PC switches the Wi-Fi P2P service between the PC and the mobile phone to 5G channel X2.

[0180] After the PC sends the P2P service channel switching information to the mobile phone, the PC and mobile phone re-establish a Wi-Fi P2P connection based on the switched channel information to switch the Wi-Fi P2P service channel. Regarding the Wi-Fi P2P service channel switching process, any details not fully explained here can be referred to existing technologies and will not be repeated here.

[0181] In an embodiment of the present application, as shown in FIG5e , when the STA service of the PC is interrupted, the Wi-Fi P2P service between the PC and the mobile phone is switched from the DFS channel to the non-DFS channel to ensure the legality and compliance of the Wi-Fi P2P service channel.

[0182] If the PC's STA service is restored, that is, the STA service is re-established, and the operating channel for the STA service is a DFS channel, the operating channel for the Wi-Fi P2P service between the PC and the mobile phone can also be switched back to the DFS channel along with the PC's STA service. Of course, if the PC's STA service is restored, that is, the STA service is re-established, and the operating channel for the STA service is a non-DFS channel, the operating channel for the Wi-Fi P2P service between the PC and the mobile phone can also be switched again along with the PC's STA service, so that the Wi-Fi P2P service and STA service are implemented on the same frequency channel.

[0183] Scene 2

[0184] In this scenario, before the PC starts the Wi-Fi P2P service, it already has STA services, and the bearer channel for STA services is a DFS channel. In this case, the PC can use the DFS channel carrying STA services as the channel for Wi-Fi HOTSPOT services. When the bearer channel for STA services changes, the bearer channel for Wi-Fi HOTSPOT services also changes. If the STA service is interrupted, the PC reselects a compliant 5G channel for Wi-Fi HOTSPOT services.

[0185] FIG6a is an exemplary flowchart of module interaction. As shown in FIG6a, the process of the channel selection method provided in the embodiment of the present application includes:

[0186] S501: A PC is connected to an AP as a station.

[0187] After a PC connects to an AP through its communication chip (specifically, a Wi-Fi chip), it becomes a station of the AP. The PC's communication chip operates in Wi-Fi Station mode and can perform STA services, allowing users to access the Internet through the PC.

[0188] S502 : In response to a user operation, the application 3 of the PC sends a Wi-Fi HOTSPOT service channel selection request to the Wi-Fi connection tool.

[0189] For example, application 3 may be a settings application, and the user operation may be an operation of the user turning on the PC hotspot function in the settings application.

[0190] S503: The Wi-Fi connection tool of the PC determines that the bearer channel of the STA service is a DFS channel.

[0191] After receiving the Wi-Fi HOTSPOT service channel selection request, the PC's Wi-Fi connection tool selects an operating channel for the PC's Wi-Fi HOTSPOT service based on the Wi-Fi HOTSPOT service channel selection request. The PC's Wi-Fi connection tool first determines whether the PC is executing the STA service, that is, whether the PC is connected to a wireless router.

[0192] In this scenario, the PC is connected to a wireless router and is performing STA services. After the Wi-Fi connection tool detects that the PC's communication chip is performing STA services, it then determines whether the PC's communication chip is using a DFS channel to carry STA services. This scenario uses the PC's communication chip using a DFS channel to carry STA services as an example.

[0193] S504: The Wi-Fi connection tool of the PC selects the DFS channel carrying the STA service as the channel carrying the Wi-Fi HOTSPO T service.

[0194] Because the current bearer channel for the PC's STA service is a DFS channel, indicating that there is no radar signal on the DFS channel, the channel can be used for the Wi-Fi hotspot service. Therefore, the channel selection module in the Wi-Fi connection tool can use the DFS channel as the channel to carry the Wi-Fi hotspot service.

[0195] This allows STA services and Wi-Fi Hotspot services to use DFS channels simultaneously, ensuring greater concurrency and efficiency. Furthermore, the use of DFS channels by Wi-Fi Hotspot services is currently legal and compliant.

[0196] S505 , the Wi-Fi connection tool of the PC creates a SAP (Soft Access Point) on the DFS channel and broadcasts SAP information and HOTSPOT service channel information.

[0197] SAP, also known as Soft-AP, is a wireless network created using a Wi-Fi module that allows other devices to connect to and communicate with it. The SAP creation process can be referenced in existing technologies and will not be detailed here.

[0198] After the PC's Wi-Fi connection tool creates a SAP, it broadcasts the SAP information and HOTSPOT service channel information. The SAP information includes, but is not limited to, the SSID and MAC address. Optionally, the HOTSPOT service channel information may also be included in the SAP information, which is not limited in this embodiment.

[0199] In the embodiment of the present application, the Wi-Fi HOTSPOT service channel information may include but is not limited to a channel number, a channel bandwidth, a channel frequency, and the like.

[0200] S506 , in response to the user operation, the mobile phone sends a Wi-Fi HOTSPOT service connection request to the PC.

[0201] For example, the user operation may be an operation in which the user selects a Wi-Fi HOTSPOT name corresponding to the PC in a Wi-Fi available list to trigger the mobile phone to connect to the PC hotspot.

[0202] In response to a user operation, the mobile phone's application 4 (e.g., the settings application) sends a Wi-Fi HOTSPOT service connection request to the Wi-Fi connection tool. The Wi-Fi connection tool then sends the Wi-Fi HOTSPOT service connection request to the PC via the Wi-Fi chip. After receiving the Wi-Fi HOTSPOT service connection request, the PC's Wi-Fi chip forwards it to the Wi-Fi connection tool.

[0203] S507: A Wi-Fi HOTSPOT connection is established between the PC and the mobile phone on the DFS channel.

[0204] In response to the received Wi-Fi HOTSPOT service connection request, the PC establishes a Wi-Fi HOTSPOT connection with the mobile phone on the DFS channel.

[0205] After establishing a Wi-Fi HOTSPOT connection between the PC and the mobile phone, the mobile phone can connect to the PC's Wi-Fi HOTSPOT network and perform data communication based on the Wi-Fi HOTSPOT network and the PC's Internet access service.

[0206] For any parts of the Wi-Fi HOTSPOT connection establishment process that are not fully explained in detail, you can refer to existing technologies and will not repeat them here.

[0207] Based on the process shown in FIG6a , with continued reference to FIG6b , after the Wi-Fi HOTSPOT service between the PC and the mobile phone is started on the DFS channel, the process of the channel selection method provided in the embodiment of the present application may further include:

[0208] S508 : The Wi-Fi connection tool of the PC receives a radar signal forced retreat event sent by the AP.

[0209] The AP periodically checks the frequency band of its operating channel for radar signal interference. If radar signal interference is detected, the AP sends a radar signal force-back event to connected devices. This radar signal force-back event indicates that radar signal interference is present on the current operating channel and requires a channel change.

[0210] In step S509 , the PC's Wi-Fi connection tool switches the STA service to 5G channel X3 based on the channel switching notification sent by the AP.

[0211] When the AP detects radar signal interference in the frequency band of its working channel, the AP sends a CSA to the terminal device connected to the AP, so that the terminal device switches its STA service from the DFS channel to a non-DFS channel (such as 5G channel X3) according to the CSA.

[0212] After receiving the CSA from the AP, the PC switches its STA service to the operating channel indicated by the CSA. In this embodiment, the operating channel indicated by the CSA is a non-DFS channel. For details about STA service channel switching that are not fully explained, please refer to existing technologies and will not be repeated here.

[0213] S510: After the STA service is switched to 5G channel X3, the PC's Wi-Fi connection tool determines to change the channel carrying the Wi-Fi HOTSPOT service to 5G channel X3, and sends HOTSPOT service channel switching information to the mobile phone.

[0214] In this embodiment of the present application, when the PC's STA service switches channels, the channel selection module in the Wi-Fi connection tool determines that the channel carrying the Wi-Fi HOTSPOT service will also switch. That is, when the PC's STA service switches to 5G channel X3 (non-DFS channel), the channel selection module determines to also change the channel of the Wi-Fi HOTSPOT service to 5G channel X3, so that the PC's STA service and Wi-Fi HOTSPOT service continue to be implemented on the same frequency and channel.

[0215] Exemplarily, the HOTSPOT service channel switching information may include the channel information after switching (such as the channel number), the channel switching time, etc. The HOTSPOT service channel switching information may also be sent based on a Bluetooth connection between the mobile phone and the PC, or based on a Wi-Fi connection between the mobile phone and the PC, which is not limited in this embodiment.

[0216] At step S511, the PC switches the Wi-Fi HOTSPOT service between the PC and the mobile phone to 5G channel X3.

[0217] After the PC sends the HOTSPOT service channel switching information to the mobile phone, the PC and mobile phone re-establish the Wi-Fi HOTSPOT connection based on the switched channel information to switch the Wi-Fi HOTSPOT service channel. Regarding the Wi-Fi HOTSPOT service channel switching process, any details not fully explained here can be referred to existing technologies and will not be repeated here.

[0218] In an embodiment of the present application, as shown in Figure 6c, since the AP detects that the STA service channel of the PC (i.e., the DFS channel) is interfered by a radar signal, when the STA service of the PC is switched from the DFS channel to the non-DFS channel (such as 5G channel X3), the Wi-Fi HOTSPOT service between the PC and the mobile phone is also switched from the DFS channel to the corresponding non-DFS channel (such as 5G channel X3).

[0219] In this way, the working channel of the PC's Wi-Fi HOTSPOT service changes as the working channel of the STA service switches. The STA service and the Wi-Fi HOTSPOT service are implemented in the same frequency communication channel, ensuring higher concurrency efficiency of the STA service and the Wi-Fi HOTSPOT service. The working channel selected by the PC for the Wi-Fi HOTSPOT service is also legal and compliant.

[0220] If the working channel of the PC's STA service is switched back to the DFS channel again, the working channel of the Wi-Fi HOTSPOT service between the PC and the mobile phone can also be switched back to the DFS channel along with the PC's STA service.

[0221] Based on the process shown in FIG6a , with continued reference to FIG6d , after the Wi-Fi HOTSPOT service between the PC and the mobile phone is started on the DFS channel, the process of the channel selection method provided in the embodiment of the present application may further include:

[0222] S512 , the Wi-Fi connection tool of the PC determines that the connection between the PC and the AP is disconnected.

[0223] Exemplarily, the Wi-Fi connection tool of the PC receives a STA disconnection event and determines that the connection between the PC and the AP is disconnected, that is, the STA service of the PC is interrupted.

[0224] In step S513 , the PC's Wi-Fi connection tool determines to change the channel carrying the Wi-Fi HOTSPOT service to 5G channel X4, and sends HOTSPOT service channel switching information to the mobile phone.

[0225] When the AP detects radar signal interference on the DFS channel, the PC cannot receive the radar signal withdrawal event sent by the AP because the PC's STA service is interrupted. Therefore, the PC cannot promptly learn whether there is radar signal interference on the current operating channel (i.e., the DFS channel) of the Wi-Fi HOTSPOT service and whether a channel switch operation is required. Therefore, after determining that the connection between the PC and the AP is disconnected, the PC's Wi-Fi connection tool needs to reselect the operating channel for the Wi-Fi HOTSPOT service to avoid affecting the radar system due to delayed channel switching for the Wi-Fi HOTSPOT service.

[0226] Among them, the channel selection module in the Wi-Fi connection tool can reselect a non-DFS channel for the Wi-Fi HOTSPOT service according to the preset channel selection strategy, and generate HOTSPOT service channel switching information based on the reselected non-DFS channel (such as 5G channel X4) and send it to the mobile phone.

[0227] Exemplarily, the HOTSPOT service channel switching information may include the channel information after switching (such as the channel number), the channel switching time, etc. The HOTSPOT service channel switching information may also be sent based on a Bluetooth connection between the mobile phone and the PC, or based on a Wi-Fi connection between the mobile phone and the PC, which is not limited in this embodiment.

[0228] In step S514 , the PC switches the Wi-Fi HOTSPOT service between the PC and the mobile phone to 5G channel X4.

[0229] After the PC sends the HOTSPOT service channel switching information to the mobile phone, the PC and mobile phone re-establish the Wi-Fi HOTSPOT connection based on the switched channel information to switch the Wi-Fi HOTSPOT service channel. Regarding the Wi-Fi HOTSPOT service channel switching process, any details not fully explained here can be referred to existing technologies and will not be repeated here.

[0230] In an embodiment of the present application, as shown in FIG6e , when the STA service of the PC is interrupted, the Wi-Fi HOTSPOT service between the PC and the mobile phone is switched from the DFS channel to the non-DFS channel to ensure the legality and compliance of the Wi-Fi HOTSPOT service channel.

[0231] If the PC's STA service is restored, that is, the STA service is re-established, and the operating channel of the STA service is a DFS channel, the operating channel of the Wi-Fi HOTSPOT service between the PC and the mobile phone can also be switched back to the DFS channel along with the PC's STA service. Of course, if the PC's STA service is restored, that is, the STA service is re-established, and the operating channel of the STA service is a non-DFS channel, the operating channel of the Wi-Fi HOTSPOT service between the PC and the mobile phone can also be switched again along with the PC's STA service, so that the Wi-Fi HOTSPOT service and STA service are implemented based on the same frequency communication channel.

[0232] In summary, as shown in Figure 7, before PC 100 starts the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, if PC 100 has a STA service and the bearer channel of the STA service is a DFS channel, PC 100 can use the DFS channel as a channel to carry the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, so that the STA service and the Wi-Fi P2P service (or Wi-Fi HOTSPOT service) of PC 100 can be implemented based on the same frequency and channel.

[0233] In another implementation, before PC 100 starts the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, if PC 100 has a STA service but the bearer channel of the STA service is a non-DFS channel, PC 100 may also use the non-DFS channel as the channel for bearing the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, so that the STA service and the Wi-Fi P2P service (or Wi-Fi HOTSPOT service) of PC 100 are implemented based on the same frequency and channel.

[0234] Scenario 3

[0235] In this scenario, before the PC starts the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, there is no STA service on the PC. In this case, the PC can select a legal and compliant non-DFS channel for the Wi-Fi P2P service or the Wi-Fi HOTSPOT service based on the country code information. After the PC starts the Wi-Fi P2P service or the Wi-Fi HOTSPOT service, if the PC also starts the STA service, and the working channel of the STA service is a DFS channel, the PC's Wi-Fi P2P service or the Wi-Fi HOTSPOT service can be switched to the DFS channel along with the STA service, so that the PC's STA service and the Wi-Fi P2P service (or Wi-Fi HOTSPOT service) are implemented based on the same frequency and channel.

[0236] Taking Wi-Fi P2P service as an example, Figure 8 shows an exemplary module interaction flow chart. As shown in Figure 8, the process of the channel selection method provided in the embodiment of the present application includes:

[0237] S601: In response to a user operation, a Bluetooth connection is established between the mobile phone and the PC.

[0238] A user operation is an action used to trigger a Wi-Fi P2P connection between a mobile phone and a PC to implement Wi-Fi P2P services. Common scenarios for establishing a Wi-Fi P2P connection between a mobile phone and a PC include wireless screen mirroring and wireless data transmission.

[0239] This embodiment is explained using the wireless screen projection scenario as an example. For example, the user's operation in the mobile screen projection application can be the user's operation of scanning a QR code using the scan code function in the mobile screen projection application. For example, the user's operation in the mobile screen projection application can be the user's operation of opening the screen projection application, or the user's operation of holding the phone close to the PC after opening the screen projection application, etc.

[0240] In the embodiment of the present application, establishing a Bluetooth connection between the mobile phone and the PC is to prepare for establishing a Wi-Fi P2P connection between the mobile phone and the PC. For example, the mobile phone and the PC can exchange information related to the Wi-Fi P2P connection based on the Bluetooth connection between the two.

[0241] S602: The mobile phone and the PC perform Wi-Fi P2P connection negotiation based on the Bluetooth connection.

[0242] After the Bluetooth connection is established between the mobile phone and the PC, the mobile phone and the PC can negotiate related information based on the Bluetooth connection to establish a Wi-Fi P2P connection between the two.

[0243] Optionally, the mobile phone and PC perform a GO negotiation based on a Bluetooth connection. After establishing a Bluetooth connection between the mobile phone and PC, the two can perform a GO negotiation based on the Bluetooth connection to determine which device is the GO node, which device is the GC node, and the characteristics of the P2P group. In the embodiment of the present application, the result of the GO negotiation between the mobile phone and PC based on the Bluetooth connection is that the PC is the GO node. For any details not explained in detail about the GO negotiation, please refer to the existing technology and will not be repeated here.

[0244] S603 , the application 5 of the PC sends a Wi-Fi P2P service channel selection request to the Wi-Fi connection tool.

[0245] S604: The PC's Wi-Fi connection tool selects a valid non-DFS channel according to the country code as a channel for carrying Wi-Fi P2P services.

[0246] Among them, the PC's Wi-Fi connection tool can obtain the country code information from the AP side, or obtain the corresponding country code information based on the PC's current IP address, or determine the corresponding country code information based on the national location identification information (such as country code information, geographic location information, operator information) obtained from the mobile phone. This embodiment does not limit the way in which the PC obtains the country code information.

[0247] In this embodiment, the PC's Wi-Fi connection tool determines the channel usage policy of the 5G band based on the country code, and selects a permitted non-DFS channel on the 5G band based on the channel usage policy as the channel for carrying Wi-Fi P2P services.

[0248] The channel usage policy specifies prohibited channels, allowing the Wi-Fi connection tool to avoid these prohibited channels when selecting operating channels for Wi-Fi P2P services. For example, if the country code determined by the PC's Wi-Fi connection tool is China's, it can select a 5G channel not prohibited by China, such as channel 165, according to Table 1, as the operating channel for Wi-Fi P2P services with the mobile phone.

[0249] Regarding the channel selection process, any details not explained here can be found in the existing technology and will not be repeated here.

[0250] S605: The Wi-Fi connection tool of the PC creates a GO role on the non-DFS channel and sends the GO role information and Wi-Fi P2P service channel information to the mobile phone.

[0251] S606, the mobile phone's Wi-Fi connection tool creates a GC role.

[0252] S607: On a non-DFS channel, the mobile phone connects to the PC and establishes a Wi-Fi P2P connection with the PC.

[0253] After the PC and mobile phone complete GO negotiation, select a valid non-DFS channel corresponding to the Wi-Fi P2P connection, and create a GO on that channel, the PC, acting as the GO node, can exchange link establishment information with the mobile phone, acting as the GC node, completing the GC access to the GO. This establishes a Wi-Fi P2P connection between the PC and mobile phone, enabling Wi-Fi P2P services to be carried out between them.

[0254] Regarding the GC access to the GO and the parts not explained in detail in the Wi-Fi P2P connection establishment process, you can refer to the existing technology and will not repeat them here.

[0255] S608: In response to the user operation, the PC accesses the AP as a Station.

[0256] The user operation may be an operation of connecting the PC to the wireless network of the AP. For example, the user operation may be an operation of the user clicking the Wi-Fi name corresponding to the AP in the available Wi-Fi list of the PC to trigger the mobile phone to connect to the PC hotspot.

[0257] For example, in response to a user operation, the PC sends a Wi-Fi access request to the AP. The AP establishes a Wi-Fi connection with the PC based on the Wi-Fi access request, so that the PC accesses the AP as a Station. The detailed process of the PC accessing the AP as a Station can be referred to in the existing technology and will not be repeated here.

[0258] It should be noted that when the PC is connected to the AP, the Wi-Fi P2P connection between the PC and the mobile phone is not terminated.

[0259] S609 : The Wi-Fi connection tool of the PC determines that the bearer channel of the STA service is a DFS channel.

[0260] After a PC is connected to an AP as a station, the PC's Wi-Fi connection tool determines whether the STA service bearer channel is a DFS channel. In this scenario, the STA service bearer channel is a DFS channel.

[0261] S610: The Wi-Fi connection tool of the PC determines to change the channel carrying the Wi-Fi P2P service to the DFS channel, and sends P2P service channel switching information to the mobile phone.

[0262] Because the current bearer channel for the PC's STA service is a DFS channel, there is no radar signal on the DFS channel and it can be used for Wi-Fi P2P services. Therefore, the channel selection module in the Wi-Fi connection tool can change the channel carrying Wi-Fi P2P services to the DFS channel.

[0263] Exemplarily, the P2P service channel switching information may include the channel information after switching (such as the channel number), the channel switching time, and the like.

[0264] S611: The PC switches the Wi-Fi P2P service between the PC and the mobile phone to the DFS channel.

[0265] After the PC sends the P2P service channel switching information to the mobile phone, the PC and mobile phone re-establish a Wi-Fi P2P connection based on the switched channel information, switching the Wi-Fi P2P service channel to the DFS channel. The Wi-Fi P2P service channel switching process is not fully explained here, and can be referred to in existing technologies.

[0266] This allows STA services and Wi-Fi P2P services to use DFS channels simultaneously, ensuring greater concurrency and efficiency. Furthermore, the use of DFS channels by Wi-Fi P2P services is currently legal and compliant.

[0267] Similar to scenario 1, after the PC switches the Wi-Fi P2P service bearer channel to a DFS channel along with STA services, if the PC receives a radar signal pushback event from the AP and switches the STA service bearer channel, the PC switches the Wi-Fi P2P service bearer channel to a non-DFS channel along with the STA services. If the PC's STA services are interrupted, the PC switches the Wi-Fi P2P service bearer channel to a valid non-DFS channel.

[0268] The same applies to the PC's Wi-Fi HOTSPOT service. Before the PC starts the Wi-Fi HOTSPOT service, if the PC does not have STA service, the PC can select a legal and compliant non-DFS channel for the Wi-Fi HOTSPOT service based on the country code information. After the PC starts the Wi-Fi HOTSPOT service, if the PC also starts the STA service, and the working channel of the STA service is a DFS channel, the PC's Wi-Fi HOTSPOT service can be switched to the DFS channel along with the STA service, so that the PC's STA service Wi-Fi HOTSPOT service is implemented based on the same frequency and channel.

[0269] Similar to scenario 2, after the PC switches the Wi-Fi hotspot service bearer channel to a DFS channel along with STA services, if the PC receives a radar signal pushback event from the AP and switches the STA service bearer channel, the PC switches the Wi-Fi hotspot service bearer channel to a non-DFS channel along with the STA services. If the STA services on the PC are interrupted, the PC switches the Wi-Fi hotspot service bearer channel to a valid non-DFS channel.

[0270] In another optional implementation, after the PC accesses the AP as a Station, if the bearer channel of the STA service is not a DFS channel, such as the bearer channel of the STA service is 5G channel X5, the PC can also switch the bearer channel of the Wi-Fi P2P service or Wi-Fi HOTSPOT service to 5G channel X5. This embodiment does not limit this.

[0271] FIG9 exemplarily shows a flow chart of a channel selection method. As shown in FIG9 , in the channel selection method provided in an embodiment of the present application, an electronic device selects a bearer channel for a Wi-Fi P2P service or a Wi-Fi HOTSPOT service, which may specifically include the following process steps:

[0272] S701, the electronic device determines whether there is currently a STA service, if so, executes S702, if not, executes S709.

[0273] S702 , the electronic device determines whether the bearer channel of the STA service is a DFS channel. If so, execute S703 ; if not, execute S708 .

[0274] S703 : The electronic device uses the DFS channel carrying the STA service as a bearer channel for the Wi-Fi P2P service or the Wi-Fi HOTSPOT service.

[0275] S704: Whether the electronic device receives the radar signal back-off event sent by the AP, if so, execute S705; if not, execute S706.

[0276] S705 : The electronic device determines a bearer channel after the STA service is switched, and switches the bearer channel of the Wi-Fi P2P service or the Wi-Fi HOTSPOT service to a bearer channel of the STA service.

[0277] The bearer channel after the STA service is switched can be a DFS channel or a non-DFS channel.

[0278] In this way, the bearer channel of the Wi-Fi P2P service or the Wi-Fi HOTSPOT service is switched together with the STA service, thereby ensuring the legitimacy of the bearer channel of the Wi-Fi P2P service or the Wi-Fi HOTSPOT service.

[0279] S706 , the electronic device determines whether the STA service is interrupted, and if so, executes S707 , and if not, executes S704 .

[0280] S707 : The electronic device switches the Wi-Fi P2P service or the Wi-Fi HOTSPOT service to a legal non-DFS channel.

[0281] The electronic device may select a legal non-DFS channel for the Wi-Fi P2P service or Wi-Fi HOTSPOT according to the country code information.

[0282] S708 : The electronic device uses the non-DFS channel carrying the STA service as a bearer channel for the Wi-Fi P2P service or the Wi-Fi HOTSPOT service.

[0283] S709: The electronic device obtains country code information and selects a legal non-DFS channel for the Wi-Fi P2P service or Wi-Fi HOTSPOT according to the country code information.

[0284] S710, the electronic device determines whether to start the STA service, if so, execute 702, if not, execute S710.

[0285] Before the Wi-Fi P2P service or Wi-Fi HOTSPOT service ends, the electronic device determines whether to start the STA service. If the electronic device starts the STA service, the bearer channel of the Wi-Fi P2P service or Wi-Fi HOTSPOT service can be switched along with the STA service, so that the Wi-Fi P2P service or Wi-Fi HOTSPOT service and the STA service are implemented on the same frequency and channel.

[0286] For any details not explained in this process, please refer to the previous article and I will not repeat them here.

[0287] This embodiment further provides a computer storage medium, which stores computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the channel selection method in the above-mentioned embodiment.

[0288] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the channel selection method in the above-mentioned embodiment.

[0289] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the channel selection method in the above-mentioned method embodiments.

[0290] Among them, the electronic device (such as a PC, etc.), computer storage medium, computer program product or chip provided in this embodiment is used to execute the corresponding method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here.

[0291] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0292] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0293] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A channel selection method, characterized in that: Applicable to a first electronic device, comprising: When establishing a Wi-Fi point-to-point P2P connection with a second electronic device, determining whether the first electronic device currently has a station STA service; When the first electronic device currently has a first STA service, determining that a bearer channel of the first STA service is a first channel, where the first channel is a dynamic frequency selection DFS channel; sending the information of the first channel to the second electronic device; A Wi-Fi P2P connection is established with the second electronic device on the first channel.

2. The method according to claim 1, characterized in that: Also includes: receiving first information sent by a wireless access point; The first information is used to instruct the first electronic device to switch the first STA service to a second channel; The second channel is a non-DFS channel; Switching the bearer channel of the first STA service to the second channel; sending second information to the second electronic device, where the second information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the second channel; The Wi-Fi P2P service between the second electronic device and the second electronic device is switched to the second channel.

3. The method according to claim 1 or 2, characterized in that: Also includes: Determining that the service of the first STA is interrupted; Selecting a third channel, and sending third information to the second electronic device, wherein the third information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the third channel, where the third channel is a non-DFS channel; The Wi-Fi P2P service between the second electronic device and the second electronic device is switched to the third channel.

4. The method according to claim 3, characterized in that The selecting the third channel comprises: The third channel is selected according to the country code information and a preset channel selection strategy.

5. The method according to claim 1, characterized in that Also includes: When the first STA service currently exists on the first electronic device, determining that the bearer channel of the first STA service is a fourth channel, and the fourth channel is a non-DFS channel; sending the information of the fourth channel to the second electronic device; A Wi-Fi P2P connection is established with the second electronic device on the fourth channel.

6. The method according to claim 1, characterized in that Also includes: When the first electronic device currently has no STA service, selecting the fifth channel according to the country code information and a preset channel selection strategy; The fifth channel is a non-DFS channel; sending the information of the fifth channel to the second electronic device; A Wi-Fi P2P connection is established with the second electronic device on the fifth channel.

7. The method according to claim 6, characterized in that After establishing a Wi-Fi P2P connection with the second electronic device on the fifth channel, the method further includes: Access the wireless access point to execute the second STA service; Determine that the bearer channel of the second STA service is the sixth channel; Sending fourth information to the second electronic device, where the fourth information is used to instruct the second electronic device to switch the Wi-Fi P2P service to the sixth channel; The Wi-Fi P2P service between the second electronic device and the second electronic device is switched to the sixth channel.

8. The method according to claim 7, characterized in that The sixth channel is a DFS channel or a non-DFS channel.

9. The method according to claim 1, characterized in that: Also includes: When the Wi-Fi hotspot service of the first electronic device is turned on, determining whether the first electronic device currently has a STA service; When the first electronic device currently has a third STA service, determining that the bearer channel of the third STA service is the seventh channel, and the seventh channel is a DFS channel; broadcasting the information of the seventh channel; A Wi-Fi hotspot connection is established with a third electronic device on the seventh channel.

10. The method according to claim 9, characterized in that Also includes: receiving fifth information sent by the wireless access point, where the fifth information is used to instruct the first electronic device to switch the third STA service to an eighth channel; The eighth channel is a non-DFS channel; Switching the bearer channel of the third STA service to the eighth channel; Sending sixth information to the third electronic device, where the sixth information is used to instruct the third electronic device to switch the Wi-Fi hotspot service to the eighth channel; The Wi-Fi hotspot service between the third electronic device and the third electronic device is switched to the eighth channel.

11. The method according to claim 9 or 10, characterized in that: Also includes: Determine that the service of the third STA is interrupted; Select a ninth channel, and send seventh information to the second electronic device, where the seventh information is used to instruct the second electronic device to switch the Wi-Fi hotspot service to the ninth channel, where the ninth channel is a non-DFS channel; The Wi-Fi hotspot service with the third electronic device is switched to the ninth channel.

12. The method according to claim 9, characterized in that Also includes: When the first electronic device currently has no STA service, selecting the tenth channel according to the country code information and a preset channel selection strategy; The tenth channel is a non-DFS channel; broadcasting the information of the tenth channel; A Wi-Fi hotspot connection is established with the third electronic device on the tenth channel.

13. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored on the memory, when When the computer program is executed by the one or more processors, the electronic device executes the channel selection method according to any one of claims 1 to 12.

14. A chip system, characterized in that: Applied in an electronic device, the chip system includes instructions and at least one processor, and the at least one processor runs the instructions so that the electronic device executes the channel selection method as described in any one of claims 1-12.

15. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device is enabled to execute the channel selection method according to any one of claims 1 to 12.