Communication method, electronic device, and storage medium
By determining channel support between terminal devices and establishing P2P channels of the same channel, the problem of time-sharing switching caused by different channels of terminal devices is solved, and the stability of P2P communication and user experience are improved.
Patent Information
- Application Number
- PCT/CN2024/079369
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-17
- Filing Date
- 2024-02-29
- Publication Date
- 2025-01-23
AI Technical Summary
When terminal devices communicate with wireless routers and other terminal devices, different channels lead to time-sharing switching, resulting in short P2P data transmission time slices, resulting in stuttering and delaying screen projection screens, affecting user experience.
By determining whether the terminal device supports point-to-point communication on the same channel, if so, a P2P channel between terminal devices is established on the channel to ensure that the STA channel and P2P channel of at least one end device are the same, thereby reducing channel switching.
Effectively reduce the emergence of time switching scenes between the terminal devices in different channels, increase the time of P2P channel transmission data, avoid the screen stuttering and other phenomena, and improve the user experience.
Smart Images

Figure CN2024079369_23012025_PF_FP_ABST
Abstract
Description
Communication method, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on July 17, 2023, with application number 202310877207.6 and application name “A communication method, electronic device 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 communication technology, and in particular to a communication method, electronic equipment, and storage medium. Background Art
[0003] Currently, terminal devices (e.g., mobile phones, tablets, etc.) can directly exchange information based on peer-to-peer (P2P) technology to share computing resources and services. P2P technology refers to the direct transmission of information between two terminal devices over a channel without the intervention of an intermediary or server. For example, as shown in Figure 1, mobile phone 101 and computer 102 can use P2P technology to mirror their screens and share computing resources.
[0004] At present, there are some situations where the channel for communication between the terminal device and the wireless router is different from the channel for P2P communication between the two terminal devices, resulting in the terminal device needing to perform time-sharing transmission between two different channels. For example, the data sending device can transmit data with the wireless router within a preset first time period, and will switch to the P2P channel to perform P2P data transmission with the data receiving device within a preset second time period, and will switch to the channel for communication with the wireless router again within a preset third time period. The switching of the terminal device between different channels results in a shorter time slice for P2P data transmission between the terminal devices. For example, in the screen projection scenario, it is necessary to wait until the time slice of P2P data transmission between the two terminal devices corresponds to each other before the screen projection data can be transmitted, which can easily cause the screen projection image to appear stuck, delayed, etc., affecting the user experience.
[0005] Summary of the Invention
[0006] To solve the above problems, the present application provides a communication method, an electronic device and a storage medium.
[0007] In a first aspect, the present application provides a communication method, comprising: a first terminal device is connected to a first wireless access device based on a first channel; the first terminal device receives a first instruction to establish a point-to-point communication connection with a second terminal device; it is determined that both the first terminal device and the second terminal device support point-to-point communication based on the first channel; and point-to-point communication is established between the first terminal device and the second terminal device based on the above-mentioned first channel.
[0008] In the present application, the first channel may be any channel in the Dynamic Frequency Selection (DFS) channel; the first instruction may be the indication information for point-to-point communication received by the first terminal device and received by the second terminal device during the device discovery process. For example, if the first terminal device is a computer and the second terminal device is a mobile phone, the first instruction may be a request frame sent by the mobile phone to the computer after the screen projection of the mobile phone is turned on; the first terminal device may be any electronic device such as a mobile phone, a tablet, a computer, a virtual reality (VR) device, a wearable device, or an augmented reality (AR) device; the first wireless access device may be a wireless router, a wireless access point, etc. mentioned later; the second terminal device may be any electronic device such as a mobile phone, a tablet, a computer, a VR device, a wearable device, or an AR device.
[0009] It can be understood that in the present application, when the first terminal device has accessed the wireless network based on the first channel, it is necessary to determine whether the configurations of the first terminal device and the second terminal device both support point-to-point communication (i.e., P2P communication) on the first channel. When it is determined that the configurations of the first terminal device and the second terminal device both support the creation of P2P communication on the first channel, a P2P channel can be established between the two terminal devices based on the first channel of the above-mentioned access network.
[0010] Based on the above solution, it can be ensured that the channel for communication between at least one end device and the wireless access device is the same as the channel for P2P communication between two terminal devices, thereby effectively reducing the occurrence of time-sharing switching scenarios between different channels of terminal devices, increasing the time for P2P channel data transmission, avoiding screen freezes and other phenomena, and improving user experience.
[0011] In a possible implementation, the first channel is a dynamic frequency selection channel.
[0012] In this application, DFS channels are multiple channels with automatic switching function in the 5GHz wireless frequency band. When a device is connected to a DFS channel in the 5GHz frequency band, if a radar signal is detected in one of the channels, it can automatically switch to other channels to avoid interference from the radar signal.
[0013] It can be understood that, in the present application, the first channel can be any channel in the DFS channel.
[0014] It can be understood that in the present application, the first terminal device can be connected to the first wireless access device based on any channel in the DFS channel to access the wireless network.
[0015] In one possible implementation, the method further includes: if it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is connected to the second wireless access device based on the second channel, wherein the second channel includes any channel in a non-dynamic frequency selection channel; establishing point-to-point communication between the first terminal device and the second terminal device based on the second channel.
[0016] In the present application, the first channel may be any channel in the DFS channel; the second channel may be any channel in the non-DFS channel.
[0017] It can be understood that in this application, when it is determined that the first terminal device is connected to the first wireless access device based on any channel in the DFS channel, and it is also determined that the configuration of the first terminal device or the second terminal device does not support the establishment of P2P communication on the first channel, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is connected to the second wireless access device based on any channel in the non-DFS channel, P2P communication between the two terminal devices can be established based on the non-DFS channel. In this way, it can be ensured that the channel for communication between the second terminal device and the wireless access device is the same as the channel for P2P communication between the two terminal devices, thereby avoiding the occurrence of time-sharing switching between different channels by the second terminal device, improving channel transmission performance and user experience.
[0018] In one possible implementation, the method further includes: if it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is connected to the second wireless access device based on a third channel, wherein the third channel is a dynamic frequency selection channel; then establishing point-to-point communication between the first terminal device and the second terminal device based on a fourth channel, wherein the fourth channel includes any channel in a non-dynamic frequency selection channel.
[0019] In the present application, the first channel may be any channel in the DFS channels; the third channel may be any channel in the DFS channels; and the fourth channel may be any channel in the non-DFS channels.
[0020] It can be understood that in the present application, when it is determined that the first terminal device is connected to the first wireless access device based on any channel in the DFS channel, and at the same time it is determined that the configuration of the first terminal device or the second terminal device does not support the establishment of P2P communication on the first channel, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is connected to the second wireless access device based on any channel in the DFS channel, P2P communication between the two terminal devices can be established based on the fourth channel, that is, any channel in the non-DFS channel (for example, channel 149 configured by default by the system).
[0021] In one possible implementation, the method further includes: if it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is not connected to the second wireless access device; establishing point-to-point communication between the first terminal device and the second terminal device based on a fourth channel, wherein the fourth channel includes any channel in a non-dynamic frequency selection channel.
[0022] In the present application, the first channel may be any channel in the DFS channel; the fourth channel may be any channel in the non-DFS channel.
[0023] It can be understood that in the present application, when it is determined that the first terminal device is connected to the first wireless access device based on any channel in the DFS channel, and at the same time it is determined that the configuration of the first terminal device or the second terminal device does not support the establishment of P2P communication on the first channel, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is not connected to the second wireless access device, P2P communication between the two terminal devices can be established based on the fourth channel, that is, any channel in the non-DFS channel (for example, channel 149 configured by default by the system).
[0024] In one possible implementation, the method further includes: the first terminal device is not connected to the first wireless access device; if it is determined that the second terminal device is connected to the second wireless access device based on a second channel, wherein the second channel includes any channel in a non-DFS channel; establishing point-to-point communication between the first terminal device and the second terminal device based on the second channel.
[0025] In the present application, the second channel may be any non-DFS channel.
[0026] It can be understood that in this application, when it is determined that the first terminal device is not connected to the first wireless access device to access the wireless network, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is connected to the second wireless access device based on any channel in the non-DFS channel, P2P communication between the two terminal devices can be established based on the non-DFS channel. In this way, the first terminal device is single-channel communication, and the channel for communication between the second terminal device and the second wireless access device is the same as the channel for P2P communication between the two terminal devices. This can avoid time-sharing switching between different channels between the first and second terminal devices, effectively reducing the occurrence of time-sharing multiplexing scenarios, and improving channel transmission performance and user experience.
[0027] In one possible implementation, the method further includes: the first terminal device is not connected to the first wireless access device; if it is determined that the second terminal device is connected to the second wireless access device based on the third channel, and it is determined that both the first terminal device and the second terminal device support point-to-point communication based on the third channel, wherein the third channel is a dynamic frequency selection channel; establishing point-to-point communication between the first terminal device and the second terminal device based on the third channel.
[0028] In the present application, the third channel may be any channel in the DFS channel.
[0029] It can be understood that in the present application, when it is determined that the first terminal device is not connected to the first wireless access device to access the wireless network, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is connected to the second wireless access device based on any channel in the DFS channel, it is necessary to judge whether the configurations of the first terminal device and the second terminal device both support point-to-point communication (i.e., P2P communication) on the third channel. When it is determined that the configurations of the first terminal device and the second terminal device both support the creation of P2P communication on the third channel, a P2P channel between the two terminal devices can be established based on the third channel of the second terminal device to access the network.
[0030] Based on the above solution, the first terminal device uses a single-channel communication, and the channel used for communication between the second terminal device and the wireless access device is the same as the channel used for P2P communication between the two terminal devices. This can avoid time-sharing switching between different channels between the first terminal device and the second terminal device, effectively reducing the occurrence of time-sharing multiplexing scenarios and improving channel transmission performance and user experience.
[0031] In one possible implementation, the method further includes: the first terminal device is not connected to the first wireless access device; if it is determined that the second terminal device is connected to the second wireless access device based on the third channel, and it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the third channel, wherein the third channel is a dynamic frequency selection channel; establishing point-to-point communication between the first terminal device and the second terminal device based on a fourth channel, wherein the fourth channel includes any channel in a non-dynamic frequency selection channel.
[0032] In the present application, the third channel may be any channel in the DFS channels; and the fourth channel may be any channel in the non-DFS channels.
[0033] It can be understood that in the present application, when it is determined that the first terminal device is not connected to the first wireless access device to access the wireless network, it is necessary to judge the wireless network connection status of the second terminal device. If it is determined that the second terminal device is connected to the second wireless access device based on any channel in the DFS channel, it is necessary to judge whether the configurations of the first terminal device and the second terminal device both support P2P communication on the third channel. When it is determined that the configuration of the first terminal device or the second terminal device does not support the creation of P2P communication on the third channel, a P2P channel between the two terminal devices can be established based on the fourth channel, that is, any channel in the non-DFS channel.
[0034] In one possible implementation, the method further includes: if the first terminal device is not connected to the first wireless access device; if it is determined that the second terminal device is not connected to the second wireless access device; establishing point-to-point communication between the first terminal device and the second terminal device based on a fourth channel, wherein the fourth channel includes any channel in a non-dynamic frequency selection channel.
[0035] In the present application, the fourth channel may be any non-DFS channel.
[0036] It can be understood that in the present application, when it is determined that the first terminal device is not connected to the first wireless access device to access the wireless network, it is necessary to judge the wireless network connection status of the second terminal device. If it is also determined that the second terminal device is not connected to the second wireless access device, P2P communication between the two terminal devices can be established based on the fourth channel, that is, any channel in the non-DFS channel (for example, channel 149 configured by default by the system).
[0037] In one possible implementation, the method further includes: if the first terminal device is connected to the first wireless access device based on the fifth channel; establishing point-to-point communication between the first terminal device and the second terminal device based on the fifth channel, wherein the fifth channel includes any channel in the non-dynamic frequency selection channel.
[0038] In the present application, the fifth channel may be any non-DFS channel.
[0039] It is understood that in this application, when determining that the first terminal device is connected to the first wireless access device based on any channel in the non-DFS channel, there is no need to determine the configurations of the first terminal device and the second terminal device, and P2P communication between the first terminal device and the second terminal device can be directly established based on the fifth channel. This ensures that the channel used for communication between at least one terminal device and the wireless access device is the same as the channel used for P2P communication between the two terminal devices, thereby effectively reducing the occurrence of time-sharing switching between different channels by terminal devices, improving channel transmission performance and user experience.
[0040] In a possible implementation, the first terminal device is a group owner device, and the second terminal device is a group client device.
[0041] In the present application, the first terminal device may be a master device group owner (Group Owner, GO), and the second terminal device may be a slave device group client (Group Client, GC).
[0042] It can be understood that in this application, when the first terminal device and the second terminal device perform point-to-point communication, the role of the GO is similar to that of a wireless access device, the GC implements the functions of the terminal device, and the connection between the GC and the GO is similar to the connection between the terminal device and the wireless router.
[0043] In a second aspect, the present application provides an electronic device comprising: a memory and a processor, wherein the memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the communication method mentioned in the present application.
[0044] In a third aspect, the present application provides a readable storage medium, wherein the readable storage medium stores instructions, which, when executed on an electronic device, enable the electronic device to execute the communication method mentioned in the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] FIG1 shows a schematic diagram of a screen projection scenario according to some embodiments of the present application;
[0046] FIG2A is a schematic diagram illustrating a single-ended same-frequency, different-channel scenario according to some embodiments of the present application;
[0047] FIG2B shows a schematic diagram of a first scenario of time-division multiplexing of terminal devices according to some embodiments of the present application;
[0048] FIG3A is a schematic diagram showing a scenario of two-terminal same-frequency different-channel scenarios according to some embodiments of the present application;
[0049] FIG3B shows a schematic diagram of a second scenario of time-division multiplexing of terminal devices according to some embodiments of the present application;
[0050] FIG3C shows a schematic diagram of a third scenario of time-division multiplexing of terminal devices according to some embodiments of the present application;
[0051] FIG4A is a schematic diagram showing a first P2P communication scenario according to some embodiments of the present application;
[0052] FIG4B is a schematic diagram showing a second P2P communication scenario according to some embodiments of the present application;
[0053] FIG5 shows a schematic diagram of the hardware structure of a terminal device according to some embodiments of the present application;
[0054] FIG6 shows a flowchart of a first method of establishing a P2P channel according to some embodiments of the present application;
[0055] FIG7 shows a flowchart of a second method of establishing a P2P channel according to some embodiments of the present application. DETAILED DESCRIPTION
[0056] Illustrative embodiments of the present application include, but are not limited to, a communication method, an electronic device, and a storage medium.
[0057] In order to more clearly understand the solution of this application, the relevant field terms involved in this application are first explained.
[0058] A channel is the path through which signals travel within a communication system, consisting of the transmission medium through which signals travel from the transmitter to the receiver. For example, in Wireless Fidelity (WiFi), each commonly used WiFi frequency band is divided into multiple channels. For example, according to the IEEE 802.11 protocol, the 2.4 GHz WiFi band is divided into 13 overlapping channels, each 22 MHz wide, and the 5 GHz WiFi band is divided into 201 channels.
[0059] P2P: An end-to-end communication technology that communicates in a peer-to-peer manner without distinguishing between clients and servers. Network resources and services are distributed across all nodes. Information transmission and service implementation are carried out directly between nodes without the intervention of intermediaries or servers. For example, a first terminal device and a second terminal device can directly transmit data based on P2P technology.
[0060] Dynamic Frequency Selection (DFS) channels: DFS channels are multiple channels in the 5 GHz wireless band with automatic switching capabilities. When a device is connected to a DFS channel in the 5 GHz band and detects a radar signal on one of the channels, it can automatically switch to another channel to avoid radar signal interference.
[0061] The following is a brief description of the application background of the method provided in the embodiment of the present application.
[0062] Currently, there are some situations where the channel for communication between the terminal device and the wireless router (i.e., the station (STA) channel) is different from the channel for P2P communication between two terminal devices, resulting in the terminal device needing to perform time-sharing transmission between two different channels. For example, the time-sharing mode is 25ms / 25ms time-sharing, and the switching takes 5ms. This means that after the terminal device works on the STA channel for 25ms, it will switch to the P2P channel to transmit data with another terminal device. The switching process takes 5ms. After the terminal device switches to the P2P channel and works for 25ms, it will switch to the STA channel again to communicate with the wireless router. The switching of terminal devices between different channels results in a shorter time slice for data transmission between terminal devices. For example, in the screen projection scenario, it is necessary to wait until the P2P time slice between the two devices corresponds before data transmission can be performed, resulting in freezes and delays in the projection screen, affecting the user experience.
[0063] The following describes the transmission method using the scenario where one terminal device's P2P channel is the same as the STA channel, while the other terminal device's P2P channel is different from the STA channel (i.e., single-ended same-frequency, different-channel) as an example.
[0064] For example, as shown in Figure 2A, the mobile phone 101 and the wireless router 100 establish a communication connection based on the dynamic frequency selection (DFS) channel 60, and the tablet 201 and the wireless router 200 establish a communication connection based on the 5G band 40 channel. When the mobile phone 101 and the tablet 201 establish a P2P communication connection, the STA channel corresponding to the tablet 201 (5G band 40 channel) is selected as the P2P channel.
[0065] Because mobile phone 101's STA channel and P2P channel are different, mobile phone 101 needs to switch between the two channels in a time-sharing manner. As shown in Figure 2B , during the P2P time slice, mobile phone 101 communicates with tablet 201 via the P2P channel; during the STA time slice, mobile phone 101 communicates with wireless router 100 via DFS channel 60. Because mobile phone 101 needs to switch between different channels, and this switching process takes time, the P2P data transmission time with tablet 201 is too short, resulting in lags and timeouts, which affects the user experience.
[0066] The following describes the transmission method using the scenario where the P2P channels and STA channels of two terminal devices are different (i.e., the two terminals use the same frequency but different channels) as an example.
[0067] For example, as shown in Figure 3A, both mobile phone 101 and tablet 201 establish communication connections with wireless router 100 via DFS channel 60. At the same time, data is transmitted between mobile phone 101 and tablet 201 via the P2P channel (5G band channel 40). Because the STA channel and P2P channel of mobile phone 101 and tablet 201 are both on the same frequency but different channels, time-sharing switching between the two channels is required. As shown in Figure 3B, during the P2P time slice, mobile phone 101 and tablet 201 communicate via the P2P channel; during the STA time slice, mobile phone 101 communicates with wireless router 100 via the DFS channel, and tablet 201 communicates with wireless router 100 via the DFS channel. As can be seen from Figure 3B, when mobile phone 101 and tablet 201 communicate, the P2P working time is too short, which can cause lag and timeouts.
[0068] In some embodiments, since the time used for P2P time slice configuration, channel switching and STA time slice configuration of the mobile phone 101 and the tablet 201 may be different, the P2P time slices may not fully correspond during P2P communication. For example, as shown in Figure 3C, the mobile phone 101 uses 20ms / 20ms time sharing, and the tablet 201 uses 25ms / 25ms time sharing. Since the time-sharing time slices of the mobile phone 101 and the tablet 201 are different, the two terminal devices will switch to the P2P channel at the same time only in a very short period of time, resulting in a shorter time for the P2P channel to transmit data, and the phenomena of freeze, blurred image, video frame loss, timeout, etc. are more serious, affecting the user experience.
[0069] To solve the above problems, an embodiment of the present application provides a communication method. When a local device (such as a first terminal device) is preparing to establish a P2P connection with a peer device (such as a second terminal device), when the local device has accessed a wireless network based on a first channel, a P2P channel between the two terminal devices can be established based on the first channel of the access network. For example, the local device can send a request message for establishing a P2P channel to the peer device. The request message may include the first channel information of the access network, so as to establish a P2P channel between the two terminal devices based on the first channel of the access network. In this way, it can be ensured that the STA channel and the P2P channel of at least one end device are the same, thereby effectively reducing the occurrence of time-sharing switching scenarios of terminal devices between different channels, increasing the time for P2P channel to transmit data, avoiding screen freezes and other phenomena, and improving user experience.
[0070] In some embodiments, if the above-mentioned first channel is any channel in the DFS channel, that is, the local device has accessed the wireless network based on any channel in the DFS channel, since not all devices support the creation of P2P communication in the DFS channel, therefore, when determining that the local device accesses the wireless network based on any channel in the DFS channel, it can be judged whether the configurations of the local device and the opposite device both support the creation of P2P communication in the DFS channel. When it is determined that the configurations of the local device and the opposite device both support the creation of P2P communication in the DFS channel, a P2P channel between the two terminal devices can be established based on the DFS channel of the above-mentioned access network.
[0071] It is understood that in some embodiments, the local device and the peer device can configure a software program for implementing the establishment of P2P communication in the DFS channel at the framework layer in the software architecture to support the terminal device to establish P2P communication in the DFS channel. The local device can send a request to the peer device via a near field communication method such as Bluetooth or near field communication technology (NFC) to obtain whether the peer device supports the establishment of P2P communication in the DFS channel.
[0072] In some embodiments, as shown in FIG4A , taking the local device as mobile phone 101 and the remote device as tablet 201 as an example, if mobile phone 101 connects to a wireless access point (AP) to access a wireless network using any of the DFS channels, and the chips of both mobile phone 101 and tablet 201 support establishing P2P communication over the DFS channel, the DFS channel of mobile phone 101 can be added to the P2P channel list, and the P2P channel can be established on the DFS channel of mobile phone 101, so that the STA channel and P2P channel of mobile phone 101 are the same. In this way, at least one device can avoid time-sharing switching between the P2P channel and the DFS channel, reduce P2P channel data transmission anomalies, and improve the user experience.
[0073] In some embodiments, as shown in FIG4B , assuming that the local device is a mobile phone 101 and the peer device is a tablet 201, if mobile phone 101 is not connected to a wireless network, and if mobile phone 101 determines that tablet 201 is connected to an AP through any of the DFS channels, and if the chips of both mobile phone 101 and tablet 201 support establishing P2P communication on the DFS channel, the DFS channel of tablet 201 can be added to the P2P channel list, and the P2P channel can be established on the DFS channel of the peer device. In this way, the local device uses a single channel for communication, and the P2P channel and DFS channel of the peer device are on the same frequency and channel. This can avoid time-sharing switching between different channels between the local and peer devices, effectively reducing the occurrence of time-sharing multiplexing scenarios, and improving channel transmission performance and user experience.
[0074] In some embodiments, if the local device has accessed the wireless network based on any channel in the DFS channel, but if the chip of the local or opposite electronic device does not support the creation of P2P communication on the DFS channel, if the opposite device accesses the wireless network based on the DFS channel, or the opposite device has not accessed the wireless network, other channels (for example, the system default configuration channel 149, etc.) can be used as P2P channels to establish a P2P communication connection; if the opposite device accesses the wireless network by connecting to a non-DFS channel, the opposite device channel can be used as a P2P channel to establish a communication connection between the local device and the opposite device.
[0075] In some embodiments, if the local device establishes wireless communication with the AP through a non-DFS channel, when the two terminal devices use the P2P function to transmit data, the non-DFS channel for establishing wireless communication between the local device and the AP can be added to the P2P channel list, and the local device channel can be used as the P2P channel to establish a P2P communication connection.
[0076] In some embodiments, if the local device is not connected to the wireless network and the local device determines that the opposite device connects to the wireless network through a non-DFS channel connected to the wireless access point, the opposite device channel can be used as a P2P channel to establish a P2P communication connection between the local device and the opposite device.
[0077] In some embodiments, if the local device is not connected to the wireless network, and it is determined that the opposite device is connected to the wireless network through the DFS channel by connecting to the wireless access point, but if the chip of the local or opposite electronic device does not support the establishment of P2P communication in the DFS channel, any other channel (for example, the system default configuration channel 149, etc.) can be used as a P2P channel to establish a P2P communication connection between the local device and the opposite device.
[0078] In some embodiments, if neither the local device nor the opposite device is connected to a wireless network, any other channel (eg, the system default configured channel 149, etc.) can be used as a P2P channel to establish a P2P communication connection between the local device and the opposite device.
[0079] In this way, the method in this application can reduce P2P communication data transmission anomalies, improve P2P communication performance, and enhance user experience.
[0080] In some embodiments, before establishing a P2P channel, two devices generally need to first perform device discovery. For example, in the screen casting application scenario shown in Figure 1, when screen casting is enabled on mobile phone 101, mobile phone 101 sends a request frame, and computer 102 receives the request frame sent by the mobile phone and returns a response frame to the mobile phone, thus completing the mutual discovery between mobile phone 101 and computer 102. In some embodiments, the request frame and response frame may carry indication information, such as indicating that a P2P connection is to be established to complete screen casting and trigger the establishment of the P2P connection.
[0081] In some embodiments, during the device discovery process, the device serving as the slave device group client (Group Client, GC) and the device serving as the master device group owner (Group Owner, GO) may also be determined by pre-setting or two-way negotiation. For example, the pre-setting method may include: pre-setting a large-screen device as the GO, or pre-setting a terminal device that can support more functions as the GO, and the embodiments of the present application do not make specific limitations on this. For example, in the application scenario of multi-screen collaboration, a personal computer (PC) or tablet computer is generally used as the GO; in the application scenario of mirror projection, a large-screen device is generally used as the GO; in the application scenario of file sharing, the sending end is generally used as the GO, and the embodiments of the present application do not make specific limitations on this.
[0082] In some embodiments, the local device mentioned above in this application may be a GO device, and the peer device may be a GC device, for performing the aforementioned P2P channel confirmation step. In P2P mode, the GO functions similarly to a wireless access point (AP), while the GC implements the functions of a terminal device. Connecting a GC to a GO is similar to connecting a terminal device to a wireless router.
[0083] Before describing in detail the communication methods provided in the embodiments of the present application, the terminal devices mentioned in the embodiments of the present application will be first introduced. It is understood that the terminal devices in the embodiments of the present application can be any electronic device such as a mobile phone, a computer, a virtual reality (VR) device, a tablet computer, a wearable device, an augmented reality (AR) device, a laptop computer, etc. The form of the terminal device is not specifically limited in the embodiments of the present application.
[0084] Figure 5 is a schematic diagram illustrating the hardware structure of an electronic device 500 according to an embodiment of the present application. As shown in Figure 5, the electronic device 500 may include a processor 110 (or host), a power module 140, a memory 180, a mobile communication module 130, a wireless communication module 120, a sensor module 190, an audio module 150, a camera 170, an interface module 160, a button 101, a display screen 102, and a touch screen 103.
[0085] It should be understood that the structure illustrated in the embodiment of the present invention does not constitute the only possible implementation method for the electronic device 500. In other embodiments of the present application, the electronic device 500 may include more or fewer components than shown, or some components may be combined or separated, or the components may be arranged differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0086] The processor 110 may include one or more processing units, for example, a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor, a microprocessor (MCU), an artificial intelligence (AI) processor, or a processing module or processing circuit such as a programmable logic device (FPGA). Different processing units may be independent devices or integrated into one or more processors. A storage unit may also be provided in the processor 110 for storing instructions and data. In some embodiments, the storage unit in the processor 110 is a cache memory 180, which may store instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can be directly called from the storage unit, avoiding repeated access, reducing the waiting time of the processor 110, and thus improving the efficiency of the system.
[0087] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0088] It can be understood that in the embodiment of the present application, the processor can be used to execute the method steps performed by the first terminal device or the second terminal device in the communication method of the present application.
[0089] The power module 140 may include a power supply, a power management component, and the like. The power supply may be a battery. The power management component manages the charging of the power supply and the supply of power to other modules. In some embodiments, the power management component includes a charging management module and a power management module. The charging management module receives charging input from a charger; the power management module connects to a power supply and is connected to the processor 110. The power management module receives input from the power supply and / or the charging management module and provides power to the processor 110, the display 102, the camera 170, and the wireless communication module 120.
[0090] The mobile communication module 130 may include but is not limited to an antenna, a power amplifier, a filter, a low noise amplifier (LAN), etc. The mobile communication module 130 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 500. The mobile communication module 130 can receive electromagnetic waves through the antenna, filter, amplify and other processing on the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 130 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna. In some embodiments, at least some functional modules of the mobile communication module 130 can be set in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 130 can be set in the same device as at least some modules of the processor 110.
[0091] The wireless communication module 120 may include an antenna and realize the transmission and reception of electromagnetic waves via the antenna. The wireless communication module 120 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc. applied to the electronic device 500. The electronic device 500 can communicate with the network and other devices through wireless communication technology.
[0092] In some embodiments, the mobile communication module 130 and the wireless communication module 120 of the electronic device 500 may also be located in the same module.
[0093] Display screen 102 is used to display human-computer interaction interfaces, images, videos, etc. Display screen 102 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), a quantum dot light emitting diode (QLED), etc.
[0094] The sensor module 190 may include a proximity sensor, a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, an electromagnetic wave absorption rate sensor, a sound sensor, and the like.
[0095] The audio module 150 is used to convert digital audio signals into analog audio signals for output, or to convert analog audio input into digital audio signals. The audio module 150 can also be used to encode and decode audio signals. In some embodiments, the audio module 150 can be provided in the processor 110, or some functional modules of the audio module 150 can be provided in the processor 110. In some embodiments, the audio module 150 can include a speaker, an earpiece, a microphone, and a headphone jack.
[0096] Camera 170 is used to capture still images or videos. The lens generates an optical image of an object and projects it onto a photosensitive element. The photosensitive element converts the optical signal into an electrical signal, which is then passed to an image signal processing unit (ISP) for conversion into a digital image signal. Electronic device 500 can implement a camera function using the ISP, camera 170, video codec, graphics processing unit (GPU), display 102, and application processor.
[0097] Interface module 160 includes an external memory interface, a universal serial bus (USB) interface, and the like. The external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of electronic device 500. The external memory card communicates with processor 110 via the external memory interface to implement data storage. The USB interface is used for communication between electronic device 500 and other electronic devices.
[0098] In some embodiments, the electronic device 500 further includes a button 101, a motor, and an indicator. The button 101 may include a volume button, an on / off button, and the like. The motor is used to vibrate the electronic device 500. Different application scenarios (e.g., time reminders, receiving messages, alarms, games, etc.) may correspond to different vibration feedback effects. The indicator may include a laser pointer, a radio frequency indicator, a light-emitting diode (LED) indicator, and the like.
[0099] The following describes in detail the communication method in the embodiment of the present application based on the terminal device mentioned above in the embodiment of the present application.
[0100] First, the communication method in this application is described in detail based on the flowchart shown in FIG6 . Specifically, the method includes the following steps:
[0101] S601: A GO is created based on the first terminal device, and a GC is created based on the second terminal device.
[0102] It is understood that in the embodiments of the present application, when terminal devices share computing resources and services, data information can be directly transmitted through P2P technology, such as screen projection, multi-device collaboration, face-to-face quick transmission, etc. When connecting to P2P communication, the terminal device will scan and search for the peer device, and the two parties will negotiate to determine the GO end and the GC end. In the P2P mode, the role of the GO is similar to that of a wireless access point AP, and the GC implements the functions of the terminal device. The connection between the GC and the GO is similar to the connection between the terminal device and the wireless router.
[0103] In some embodiments, the terminal device can scan and search for the peer device through Bluetooth, near field communication (NFC), or other methods, and initiate a P2P communication request to the peer device. For example, after the terminal device turns on the Bluetooth function, it can discover the peer device through Bluetooth and initiate a P2P communication request to the peer device. For another example, after the NFC function of the terminal device is turned on, the user touches the NFC area with the handheld terminal device, and the terminal device will initiate a P2P communication request to the other party. This embodiment of the present application does not specifically limit this.
[0104] In some embodiments, the two devices can negotiate to determine the GO end and the GC end based on preset rules. For example, the preset rules may include: presetting a large-screen device as the GO, or presetting a terminal device that can support more functions as the GO. The embodiments of this application do not specifically limit this. For example, in a multi-screen collaboration application scenario, a personal computer (PC) or tablet computer is generally used as the GO; in a mirror projection application scenario, a large-screen device is generally used as the GO; in a file sharing application scenario, the sending end is generally used as the GO. The embodiments of this application do not specifically limit this.
[0105] This application takes the first terminal device as a GO device and the second terminal device as a GC device as an example to illustrate the following process.
[0106] S602: Determine whether the first terminal device is connected to a wireless access point. If yes, proceed to S603; if not, proceed to S607.
[0107] It can be understood that in the embodiment of the present application, when the first terminal device and the second terminal device establish a P2P connection channel, it is first necessary to determine whether the first terminal device has accessed the wireless network, for example, by connecting to a wireless router to access the wireless network. If the first terminal device has accessed the wireless network, then go to S603 to determine whether the first communication channel connecting the first terminal device to the wireless access point is a DFS channel; if the first terminal device is not connected to the wireless access point, then go to S607 to determine whether the second terminal device has accessed the wireless network by connecting to a wireless router.
[0108] In some embodiments, if the first terminal device has established a communication connection with the wireless router through a channel, if the first terminal device and the second terminal device establish P2P communication based on another channel, the first terminal device needs to switch between different channels, resulting in a time-sharing switching scenario as shown in Figure 2B, and the switching takes a long time, resulting in a decrease in data transmission capacity during P2P communication, causing freezes, timeouts, etc., affecting the user experience.
[0109] S603: Determine whether the first communication channel between the first terminal device and the wireless access point is DFS. If so, proceed to S605; if not, proceed to S604.
[0110] It can be understood that in an embodiment of the present application, after determining that the first terminal device accesses the wireless network, the first terminal device system needs to determine whether the first terminal device is connected to the DFS channel. If the first terminal device accesses the wireless network by connecting to any channel in the DFS channel, then go to S605 to determine whether the electronic device chip supports the DFS channel to create P2P communication; if the first terminal device is not connected to the DFS channel, that is, the first terminal device accesses the wireless network through any other non-DFS channel, then go to S604 to establish the P2P channel on the first terminal device channel.
[0111] S604: A P2P channel is established on the first terminal channel.
[0112] It can be understood that in an embodiment of the present application, after the first terminal device system determines that the first terminal device accesses the wireless network through a non-DFS channel, the first terminal device channel is added to the optional P2P channel list of the first terminal device and the second terminal device, and the P2P channel is established on the STA communication channel of the first terminal device.
[0113] In this way, the P2P channel and STA channel of the first terminal device are on the same frequency and channel, which avoids the time-sharing switching of the first terminal device between different channels, effectively improving the P2P communication performance and user experience.
[0114] S605: Determine whether the chips of the first terminal device and the second terminal device support DFS channel creation for P2P communication. If yes, proceed to S606; if not, proceed to S607.
[0115] It can be understood that in the embodiment of the present application, after determining that the first terminal device establishes a connection with the wireless router through any channel in the DFS channel, it is necessary to judge whether the electronic device chips of the first terminal device and the second terminal device support the creation of P2P communication on the DFS channel. If supported, go to S606 to establish the P2P channel on the DFS channel of the first terminal device; if not supported, go to S607 to judge whether the second terminal device is connected to the wireless network. In some embodiments, the chips of some terminal devices support the creation of P2P communication on the DFS channel, such as the software architecture corresponding to the chip of a mobile phone or a tablet, for example, the framework layer (Framework, FWK) of the terminal device can be configured with corresponding programs or functions to support the creation of P2P communication on the DFS channel. The embodiment of the present application does not limit this.
[0116] S606: The P2P channel is established on the DFS channel of the first terminal.
[0117] It can be understood that in an embodiment of the present application, when it is determined that the first terminal device establishes a connection with the wireless router through any channel in the DFS channel, and the electronic device chips of the first terminal device and the second terminal device support the creation of P2P communication on the DFS channel, the DFS channel of the first terminal device can be added to the P2P channel list, and the P2P channel can be established on the DFS channel of the first terminal device.
[0118] In this way, the P2P channel and STA channel of at least one of the first terminal device and the second terminal device are of the same frequency and channel, which effectively reduces the scenario of time-sharing switching of terminal devices between different channels and improves P2P communication performance and user experience.
[0119] S607: Determine whether the second terminal device is connected to the wireless access point. If yes, proceed to S608; if not, proceed to S612.
[0120] It can be understood that in an embodiment of the present application, when it is determined that the first terminal device has not connected to the wireless network; or when it is determined that the first terminal device has established a connection with the wireless router through any channel in the DFS channel, but the electronic device chip of the first terminal device or the second terminal device does not support the creation of P2P communication on the DFS channel, it is necessary to judge whether the second terminal device has connected to the wireless network. For example, by connecting to the wireless router to access the wireless network, if the second terminal device has already connected to the wireless network, go to S608 to determine whether the second terminal device is connected to the DFS channel; if the second terminal device is not connected to the wireless network, go to S612, and the P2P channel is established on channel 149.
[0121] S608: Determine whether the second communication channel between the second terminal device and the wireless access point is a DFS channel. If so, proceed to S609; if not, proceed to S611.
[0122] It can be understood that in an embodiment of the present application, after determining that the second terminal device has accessed the wireless network, the first terminal device needs to determine whether the second terminal device is connected to the DFS channel. If the second terminal device accesses the wireless network by connecting to any channel in the DFS channel, then go to S609 to determine whether the electronic device chip supports the DFS channel to create P2P communication; if the second terminal device is not connected to the DFS channel, that is, the second terminal device accesses the wireless network through any other non-DFS channel, then go to S611 to establish the P2P channel on the second terminal device channel.
[0123] S609: Determine whether the chips of the first terminal device and the second terminal device support DFS channel creation for P2P communication. If yes, proceed to S610; if not, proceed to S612.
[0124] It can be understood that in the embodiment of the present application, after determining that the second terminal device has established a connection with the wireless router through any channel in the DFS channel, it is necessary to judge whether the electronic device chips of the first terminal device and the second terminal device support the creation of P2P communication on the DFS channel. If supported, go to S610 and establish the P2P channel on the DFS channel of the second terminal device; if not supported, go to S612 and establish the P2P channel on any other non-DFS channel (for example, the system default configuration channel 149, etc.). In some embodiments, the chips of some terminal devices support the creation of P2P communication on the DFS channel, and the embodiment of the present application does not limit this.
[0125] S610: A P2P channel is established on the DFS channel of the second terminal.
[0126] It can be understood that in an embodiment of the present application, when it is determined that the first terminal device is not connected to the wireless network, the second terminal device establishes a connection with the wireless router through any channel in the DFS channel, and the electronic device chips of the first terminal device and the second terminal device support the creation of P2P communication on the DFS channel. The DFS channel of the second terminal device can be added to the P2P channel list, and the P2P channel can be established on the DFS channel of the second terminal device.
[0127] S611: A P2P channel is established on the second terminal channel.
[0128] It can be understood that in an embodiment of the present application, when the first terminal device system determines that the first terminal device has not accessed the wireless network, and at the same time determines that the second terminal device has accessed the wireless network through a non-DFS channel, the second terminal device channel can be added to the P2P channel list optional for GO and GC, and the P2P channel can be established on the STA communication channel of the second terminal device.
[0129] In some embodiments, when the first terminal device system determines that the first terminal device establishes a connection with the wireless router through any channel in the DFS channel, but the electronic device chip of the first terminal device or the second terminal device does not support the creation of P2P communication on the DFS channel, and the first terminal device determines that the second terminal device accesses the wireless network through a non-DFS channel, the second terminal device channel can be added to the P2P channel list optional for GO and GC, and the P2P channel can be established on the STA communication channel of the second terminal device.
[0130] S612: The P2P channel is established on channel 149.
[0131] It can be understood that in the embodiment of the present application, when it is determined that neither the first terminal device nor the second terminal device is connected to the wireless access point, the P2P channel can be established on any other channel (for example, the system default configured channel 149), and the embodiment of the present application does not limit this.
[0132] In some embodiments, if it is determined that the first terminal device and the second terminal device are both connected to the wireless router through any channel in the DFS channel, but the electronic device chip of the first terminal device or the second terminal device does not support the creation of P2P communication on the DFS channel, the P2P channel can be established on any other channel (for example, the system default configuration channel 149), and this embodiment of the present application does not limit this.
[0133] In some embodiments, the first terminal device system determines that the first terminal device establishes a connection with the wireless router through any channel in the DFS channel, but the electronic device chip of the first terminal device or the second terminal device does not support the creation of P2P communication on the DFS channel, and at the same time determines that the second terminal device is not connected to the wireless access point, the P2P channel can be established on any other channel (for example, channel 149 configured by default in the system). The embodiments of the present application are not limited to this.
[0134] In some embodiments, if the first terminal device system determines that the first terminal device is not connected to the wireless access point, and at the same time determines that the second terminal device establishes a connection with the wireless router through any channel in the DFS channel, but the electronic device chip of the first terminal device or the second terminal device does not support the creation of P2P communication on the DFS channel, the P2P channel can be established on any other channel (for example, the system default configuration channel 149), and the embodiments of the present application are not limited to this.
[0135] For ease of description, taking the local device as a GO device, the opposite device as a GC device, and the wireless access point as a wireless router as an example, FIG7 shows a schematic diagram of a specific process of establishing a P2P channel in an embodiment of the present application. Specifically, the method includes the following steps:
[0136] S701: Create GO.
[0137] It is understood that in the embodiment of the present application, after the local device scans and finds the opposite device, the two terminal devices can negotiate to determine the GO end and the GC end based on the preset rules, and the embodiment of the present application does not specifically limit this. The specific creation method can refer to the above step S601.
[0138] S702: The local device connects to DFS upstream.
[0139] It can be understood that in the embodiment of the present application, the GO terminal device can establish a communication connection with the wireless router based on the DFS channel.
[0140] S703: The local device is not connected uplink.
[0141] It can be understood that in the embodiment of the present application, the GO terminal device can detect that the local terminal device is not connected to the wireless network.
[0142] S704: The uplink connection of the local device is non-DFS.
[0143] It can be understood that in the embodiment of the present application, the GO end device can detect that the local end device establishes a communication connection with the wireless router based on any other non-DFS channel.
[0144] S705: Determine whether the chip supports DFS channel creation GO. If yes, proceed to S711; if not, proceed to S706.
[0145] It can be understood that in the embodiment of the present application, after determining that the GO end device has established a connection with the wireless router through any channel in the DFS channel, it is necessary to judge whether the electronic device chip supports the creation of P2P communication on the DFS channel. If it does, go to S711 and establish the P2P channel on the local device, that is, the GO end device channel; if it does not support, go to S706 to determine whether the opposite device is connected to DFS.
[0146] S706: Determine whether the peer device is connected to DFS. If yes, proceed to S707; if not, proceed to S710.
[0147] It can be understood that in the embodiment of the present application, when it is determined that the GO end device establishes a connection with the wireless router through any channel in the DFS channel, but the electronic device chip does not support the creation of P2P communication on the DFS channel, it is necessary to judge whether the opposite device, that is, the GC end device, is connected to the DFS channel. If the opposite device is connected to the DFS channel, go to S707 and establish P2P communication on channel 149; if the opposite device is not connected to the DFS channel, go to S710 and create P2P on the opposite device channel.
[0148] S707: P2P communication is established on channel 149.
[0149] It can be understood that in the embodiment of the present application, when it is determined that both the GO end and the GC end devices are not connected to the wireless access point, the P2P channel can be established on any other channel (for example, the 149 channel configured by default in the system), and the embodiment of the present application does not limit this.
[0150] In some embodiments, when it is determined that both the GO-end and GC-end devices establish a connection with the wireless router through any channel in the DFS channel, but the GO-end or GC-end electronic device chip does not support the creation of P2P communication on the DFS channel, the P2P channel can be established on any other channel (for example, the system default configuration channel 149), which is not limited in this embodiment of the present application.
[0151] In some embodiments, if the GO-end device system determines that the GO-end device is not connected to the wireless access point, and at the same time determines that the GC-end device establishes a connection with the wireless router through any channel in the DFS channel, but the GO-end or GC-end electronic device chip does not support the creation of P2P communication on the DFS channel, the P2P channel can be established on any other channel (for example, the system default configuration channel 149), and the embodiments of the present application are not limited to this.
[0152] S708: The peer device is not connected to WiFi.
[0153] It can be understood that in the embodiment of the present application, the GO device can detect that the opposite device is not connected to the wireless network.
[0154] S709: Determine whether the peer device is connected to DFS. If yes, proceed to S710; if not, proceed to S707.
[0155] It can be understood that in the embodiment of the present application, when it is determined that the first terminal device is not connected to the wireless network, it is necessary to judge whether the opposite device, that is, the GC end device, is connected to the DFS channel. If the opposite device is connected to the DFS channel, go to S710 and create P2P on the opposite device channel; if the opposite device is not connected to the DFS channel, go to S707 and establish P2P communication on the 149 channel.
[0156] S710: P2P is created on the peer device channel.
[0157] It can be understood that in the embodiment of the present application, when it is determined that the GO end device is not connected to the wireless network and the GC end device establishes a connection with the wireless router through any channel in the DFS channel, the P2P channel is established on the channel of the opposite device, namely the GC end device.
[0158] In some embodiments, when the GO-end device system determines that the GO-end device establishes a connection with the wireless router through any channel in the DFS channel, but the electronic device chip does not support the creation of P2P communication on the DFS channel, and the opposite device, that is, the GC-end device, accesses the wireless network through a non-DFS channel, the P2P channel can be established on the GC-end channel.
[0159] S711: P2P is created on the local device channel.
[0160] It can be understood that in an embodiment of the present application, when it is determined that the GO-end device establishes a connection with the wireless router through any channel in the DFS channel, and the electronic device chip supports the creation of P2P communication on the DFS channel, the DFS channel of the GO end can be added to the P2P channel list, and the P2P channel can be established on the DFS channel of the GO end.
[0161] It can be understood that in the embodiment of the present application, after the GO-end device system determines that the GO-end device accesses the wireless network through a non-DFS channel, the P2P channel is established on the GO-end channel.
[0162] In this way, the above process effectively reduces the occurrence of time-sharing switching scenarios of terminal devices between different channels, improving channel transmission performance and user experience.
[0163] The present application provides an electronic device, comprising: a memory and a processor, wherein the memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the communication method mentioned in the present application.
[0164] The present application provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the communication method mentioned in the present application.
[0165] The various embodiments disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0166] Program code can be applied to input instructions to perform the functions described herein and generate output information. The output information can be applied to one or more output devices in a known manner. For purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.
[0167] Program code can be implemented with a high-level programming language or an object-oriented programming language to communicate with the processing system. Where necessary, program code can also be implemented in assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0168] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, instructions can be distributed over a network or by other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical disks, magneto-optical disks, read-only memories (ROM), random access memories (RAM), magnetic or optical cards, flash memory, electrically erasable programmable read-only memories (EEPROM), or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signal digital signals, etc.) using the Internet in electrical, optical, acoustic or other forms of propagation signals. Therefore, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.
[0169] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or order may not be required. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of a structural or method feature in a particular figure does not imply that such feature is required in all embodiments, and in some embodiments, such features may not be included or may be combined with other features.
[0170] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems raised by this application. In addition, in order to highlight the innovative part of this application, the above-mentioned device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems raised by this application. This does not mean that other units / modules do not exist in the above-mentioned device embodiments.
[0171] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the presence of other identical elements in the process, method, article or device that includes the above elements.
[0172] While the present application has been shown and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.
Claims
1. A communication method, characterized in that: The method comprises: The first terminal device is connected to the first wireless access device based on the first channel; The first terminal device receives a first instruction to establish a point-to-point communication connection with a second terminal device; Determining that both the first terminal device and the second terminal device support point-to-point communication based on the first channel; Point-to-point communication between the first terminal device and the second terminal device is established based on the first channel.
2. The method according to claim 1, characterized in that The first channel is a dynamic frequency selection channel.
3. The method according to claim 2, characterized in that The method further comprises: If it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is connected to a second wireless access device based on a second channel, and the second channel includes any channel in a non-dynamic frequency selection channel; Point-to-point communication between the first terminal device and the second terminal device is established based on the second channel.
4. The method according to claim 2, characterized in that: The method further comprises: If it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is connected to the second wireless access device based on a third channel, and the third channel is a dynamic frequency selection channel; Point-to-point communication between the first terminal device and the second terminal device is established based on a fourth channel, and the fourth channel includes any channel in a non-dynamic frequency selection channel.
5. The method according to claim 2, characterized in that: The method further comprises: If it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the first channel, and it is determined that the second terminal device is not connected to the second wireless access device; Point-to-point communication between the first terminal device and the second terminal device is established based on a fourth channel, and the fourth channel includes any channel in a non-dynamic frequency selection channel.
6. The method according to claim 1, characterized in that The method further comprises: The first terminal device is not connected to the first wireless access device; If it is determined that the second terminal device is connected to the second wireless access device based on a second channel, the second channel includes any channel in a non-DFS channel; Point-to-point communication between the first terminal device and the second terminal device is established based on the second channel.
7. The method according to claim 1, characterized in that The method further comprises: The first terminal device is not connected to the first wireless access device; If it is determined that the second terminal device is connected to the second wireless access device based on the third channel, and it is determined that both the first terminal device and the second terminal device support point-to-point communication based on the third channel, and the third channel is a dynamic frequency selection channel; Point-to-point communication between the first terminal device and the second terminal device is established based on the third channel.
8. The method according to claim 1, characterized in that The method further comprises: The first terminal device is not connected to the first wireless access device; If it is determined that the second terminal device is connected to the second wireless access device based on the third channel, and it is determined that the first terminal device or the second terminal device does not support point-to-point communication based on the third channel, the third channel is a dynamic frequency selection channel; Point-to-point communication between the first terminal device and the second terminal device is established based on a fourth channel, and the fourth channel includes any channel in a non-dynamic frequency selection channel.
9. The method according to claim 1, characterized in that: The method further comprises: The first terminal device is not connected to the first wireless access device; If it is determined that the second terminal device is not connected to the second wireless access device; Point-to-point communication between the first terminal device and the second terminal device is established based on a fourth channel, and the fourth channel includes any channel in a non-dynamic frequency selection channel.
10. The method according to claim 1, characterized in that The method further comprises: If the first terminal device is connected to the first wireless access device based on the fifth channel; Point-to-point communication between the first terminal device and the second terminal device is established based on the fifth channel, and the fifth channel includes any channel in the non-dynamic frequency selection channel.
11. The method according to any one of claims 1 to 10, characterized in that: The first terminal device is a group owner device, and the second terminal device is a group client device.
12. An electronic device, characterized in that: include: A memory and a processor, wherein the memory is used to store instructions executed by one or more processors of the electronic device, and the processor is one of the one or more processors of the electronic device, and is used to execute the communication method described in any one of claims 1-11.
13. A readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on the electronic device, enable the electronic device to execute the communication method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Communication method, electronic equipment and storage medium
CN119325075A
Network transmission control method and device, terminal equipment and storage medium
CN111050368A
Channel determination method and device, terminal equipment and computer readable storage medium
CN112702803A
WiFi P2P connection method, electronic device, program product and medium
CN113645693A
Multi-device cooperation method and related device
CN115348630A