Method for coexistence of hotspot and p2p connections, terminal, storage medium, and program product
By reusing or separating channels to configure hotspots and P2P connections on terminal devices, the problem of hotspots and P2P connections being unable to coexist is solved, enabling smooth execution of services across all scenarios and improving user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2025-12-15
- Publication Date
- 2026-07-16
AI Technical Summary
Existing terminal devices cannot simultaneously enable hotspots and establish P2P connections, resulting in limited functionality.
By multiplexing channels on the same channel to configure hotspots and P2P connections, or by configuring hotspots and P2P connections on different channels respectively, the coexistence of hotspots and P2P connections can be achieved. Specific methods include channel reconfiguration, encryption methods, and adjustments to the number of accessible devices.
It achieves compatibility between hotspot and P2P connections, ensuring smooth operation and user experience across all scenarios, reducing signaling overhead, and improving device access efficiency.
Smart Images

Figure CN2025142649_16072026_PF_FP_ABST
Abstract
Description
Methods, terminals, storage media, and software products for coexistence of hotspots and P2P connections
[0001] This application claims priority to Chinese patent application filed on January 10, 2025, with application number 202510057139.8, entitled "Method, Terminal, Storage Medium and Program Product for Coexistence of Hotspot and P2P Connections", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminals, and in particular to a method, terminal, storage medium, and program product for coexisting hotspot and P2P connection. Background Technology
[0003] For terminal devices with hotspot functionality, the terminal device can provide network access to other devices by turning on its hotspot, and other devices can connect to the terminal device's hotspot to access the internet. Additionally, the terminal device can establish P2P connections with other devices to conduct various business activities across different scenarios.
[0004] However, currently, terminal devices cannot simultaneously open a hotspot and establish a P2P connection; that is, hotspots and P2P connections cannot coexist, which limits the functionality of terminal devices. Summary of the Invention
[0005] This application provides a method, terminal, storage medium, and program product that allow hotspots and P2P connections to coexist.
[0006] In a first aspect, a method for coexisting hotspot and P2P connection is provided, the method being applied to a terminal device, comprising: receiving a first operation input by a user, the first operation being used to open a hotspot; receiving a second operation input by the user, the second operation being used to establish a P2P connection; and responding to the first operation and the second operation, performing the following operations: if the terminal device does not support DBDC, configuring a first hotspot on a first channel and multiplexing the first channel to establish a P2P connection, the first channel being a 5G channel; if the terminal device supports DBDC, configuring a second hotspot on a second channel and establishing a P2P connection on a third channel, the second channel and the third channel being the same channel or different channels.
[0007] This application proposes two solutions to address the need for coexistence of hotspots and P2P connections. If the terminal device does not support DBDC, a first hotspot can be configured first, and then the channel of this first hotspot (i.e., the first channel) can be reused to establish a P2P connection. In other words, hotspots and P2P connections share a single channel, thus achieving coexistence. If the terminal device supports DBDC, since the terminal device can operate two channels simultaneously, it can configure hotspots and establish P2P connections on different channels respectively. Alternatively, the terminal device can simultaneously configure hotspots and establish P2P connections on a single channel, thereby achieving coexistence of hotspots and P2P connections.
[0008] In some implementations, if the terminal device does not support DBDC and the first operation occurs before the second operation, the method further includes: after receiving the first operation and before receiving the second operation, configuring a third hotspot on the 2.4G channel in response to the first operation; the configuration of the first hotspot on the first channel includes: after receiving the second operation, reconfiguring the third hotspot as the first hotspot in response to the second operation.
[0009] If the terminal device is configured as a third hotspot on the 2.4G channel after receiving the first operation, then after receiving the second operation, to ensure P2P connection compatibility, the terminal device can reconfigure the third hotspot as the first hotspot and establish a P2P connection on the reconfigured first hotspot. Since the first hotspot is configured on the 5G channel, reusing the 5G channel to establish a P2P connection can guarantee the smoothness of services across all scenarios.
[0010] In some implementations, reconfiguring the third hotspot as the first hotspot includes: setting the encryption method of the first hotspot to WPA2 encryption; and setting the number of accessible devices for the first hotspot to a value greater than 1.
[0011] To ensure smooth operation of all-scenario services and improve user experience, when hotspot reconfiguration is required, the encryption method can be directly changed to WPA2 encryption. Additionally, setting the number of accessible devices to the system maximum value when hotspot reconfiguration ensures that terminal devices can establish P2P connections with a sufficient number of devices, preventing other devices from being unable to connect due to quantity limitations and thus avoiding service interruptions across all scenarios.
[0012] In some implementations, reconfiguring the third hotspot as the first hotspot includes: determining whether there are currently any STA devices connected to the terminal device; if there are currently no STA devices connected to the terminal device, then reconfiguring the third hotspot as the first hotspot; or, if there are currently any STA devices connected to the terminal device, then determining the frequency bands supported by the STA devices connected to the terminal device; if all STA devices connected to the terminal device support the 5G frequency band, then reconfiguring the third hotspot as the first hotspot.
[0013] When hotspot reconfiguration is required, first determine if there are any STA devices currently connected to the terminal device. If there are no STA devices connected to the terminal device, hotspot reconfiguration can be performed directly. If there are STA devices currently connected to the terminal device, first determine if the STA devices support the 5G frequency band. Only if all STA devices support the 5G frequency band should hotspot reconfiguration be performed to avoid P2P connections affecting the communication of the STA devices.
[0014] In some implementations, the method further includes: if there is a device among the STA devices currently connected to the terminal device that does not support the 5G frequency band, or if there is a device whose support for the 5G frequency band is uncertain, then a first prompt message is displayed on the terminal device, the first prompt message being used to prompt the user whether to reconfigure the third hotspot as the first hotspot.
[0015] If any of the currently connected STA devices does not support the 5G frequency band, or if it is uncertain whether a device supports the 5G frequency band, the user can be shown a first prompt message so that the user can choose whether to reconfigure the hotspot.
[0016] In some implementations, if the terminal device does not support DBDC and the first operation occurs before the second operation, the method further includes: after receiving the first operation and before receiving the second operation, configuring the first hotspot on the 5G channel in response to the first operation; after receiving the second operation, in response to the second operation, if the encryption method of the first hotspot is not WPA2 encryption, displaying a second prompt message on the terminal device, the second prompt message being used to prompt the user to change the encryption method of the first hotspot to WPA2 encryption.
[0017] In scenarios where the terminal device is already established as a 5G hotspot, that is, in response to the first operation, the terminal device directly configures the first hotspot on the 5G channel. If the encryption method of the first hotspot configured by the terminal device is not WPA2 encryption, then after receiving the second operation input by the user, a second prompt message can be displayed on the terminal device to prompt the user to change the encryption method of the hotspot to WPA2 encryption to ensure the smooth execution of services in all scenarios.
[0018] In some implementations, if the terminal device does not support DBDC and the second operation occurs before the first operation, the method further includes: after receiving the second operation, establishing a P2P connection with the GC device in response to the second operation; and after receiving the first operation, disconnecting the P2P connection with the GC device; configuring the first hotspot on the first channel includes: after receiving the first operation, configuring the first hotspot on the first channel in response to the first operation; and multiplexing the first channel to establish a P2P connection includes: receiving a P2P access request sent by the GC device on the first channel; and sending a P2P access response to the GC device on the first channel.
[0019] If the second operation occurs before the first operation, i.e., the user triggers the establishment of a P2P connection before the establishment of a hotspot, since the data between P2P connections is limited to transmission between terminal devices and cannot be transmitted to the network, in order to be compatible with P2P connections and hotspots, after receiving the first operation, the terminal device needs to disconnect the previous P2P connection and re-establish the first hotspot. On the newly established hotspot, a new P2P connection is established with the previous GC device to achieve the coexistence of P2P and hotspots.
[0020] In some implementations, the method further includes: after configuring the first hotspot on the first channel, sending the information of the first hotspot to the GC device through a trust loop.
[0021] After obtaining information about the first hotspot, the GC device can directly use this information to establish a P2P connection with the terminal device. This eliminates the communication process of probe requests and responses, which helps reduce signaling overhead and the interruption time when the terminal device establishes a P2P connection with the GC device, thus improving the user experience.
[0022] The step of configuring the first hotspot on the first channel includes: after receiving the first operation, in response to the first operation, if the hotspot information configured by the user is 5G hotspot information, then configuring the first hotspot on the first channel according to the hotspot information configured by the user; if the hotspot information configured by the user is 2.4G hotspot information, then the method further includes: displaying a third prompt message on the terminal device, the third prompt message being used to prompt the user to configure the hotspot in the 5G frequency band.
[0023] If the user first enters the second operation, since the signal in the P2P connection is limited to transmission within the P2P group and cannot be transmitted to the network, the hotspot needs to be rebuilt to ensure compatibility between the hotspot and P2P. The rebuilt hotspot will then be compatible with P2P connections. If the user configures a 5G hotspot, it can be configured directly according to the user's settings. If the user configures a 2.4G hotspot, to ensure smooth operation of services across all scenarios, the user can be prompted to configure the hotspot on the 5G band.
[0024] In some implementations, the method further includes: if the encryption method in the user-configured hotspot information is not WPA2 encryption, then displaying a fourth prompt message on the terminal device, the fourth prompt message being used to prompt the user to set the encryption method of the hotspot to WPA2 encryption; and / or if the number of accessible devices in the user-configured hotspot information is 1, then displaying a fifth prompt message on the terminal device, the fifth prompt message being used to prompt the user to set the number of accessible devices to a value greater than 1.
[0025] Additionally, to meet the execution requirements of all-scenario services, if the user configures the hotspot with a non-WPA2 encryption method, the user can be prompted to change the encryption method to WPA2. To reduce the mutual interference between hotspot services and all-scenario services, if the user configures the hotspot to support only one connected device, the user can be prompted to set the number of connected devices to a larger value.
[0026] In this embodiment, the terminal device can identify messages in both P2P connections and hot services on the first channel, thereby achieving coexistence of hot services and P2P.
[0027] In some implementations, the method further includes: if the terminal device does not support DBDC, then counting the number of STA devices and GC devices connected to the terminal device respectively; if there are devices that cannot connect to the terminal device due to quantity limitations, then displaying a sixth prompt message on the terminal device, the sixth prompt message being used to prompt the user to modify the number of accessible devices.
[0028] If the terminal device does not support DBDC, it means that the hotspot and P2P connection need to reuse the same channel. In order to ensure that the hotspot service and all-scenario service of the terminal device can be executed smoothly, the number of STA devices and GC devices can be counted separately. As long as the current number of STA devices does not exceed the number of accessible devices, the subsequent devices can access the hotspot of the terminal device. As long as the current number of GC devices does not exceed the number of accessible devices, the subsequent devices can establish a P2P connection with the terminal device.
[0029] In some implementations, if the terminal device supports DBDC and the first operation precedes the second operation, then configuring the second hotspot on the second channel and establishing a P2P connection on the third channel includes: configuring the second hotspot on the second channel in response to the first operation; if the second channel is a 5G channel, establishing a P2P connection on the second channel in response to the second operation, wherein the second channel and the third channel are the same channel; if the second channel is a 2.4G channel, establishing a P2P connection on the third channel in response to the second operation, wherein the third channel is a 5G channel.
[0030] If the terminal device supports DBDC, and the terminal device receives the first operation and configures a hotspot, if the hotspot is configured on a 5G channel, the terminal device can directly establish a P2P connection on the 5G channel after receiving the second operation. If the hotspot is configured on a 2.4G channel, the terminal device can establish a P2P connection on the 5G channel after receiving the second operation, so as to ensure that the P2P connection is established on the 5G channel first, and to ensure the smooth execution of services in all scenarios.
[0031] In some implementations, if the terminal device supports DBDC and the second operation precedes the first operation, then configuring the second hotspot on the second channel and establishing a P2P connection on the third channel includes: in response to the second operation, establishing a P2P connection on the third channel; if the third channel is a 5G channel, configuring the second hotspot on the third channel in response to the first operation, wherein the third channel and the second channel are the same channel; if the third channel is a 2.4G channel, configuring the second hotspot on the second channel in response to the first operation, wherein the second channel is a 5G channel.
[0032] If the terminal device supports DBDC, and the terminal device receives the second operation and establishes a P2P connection first, if the P2P connection is established on the 5G channel, the terminal device can directly configure a hotspot on the 5G channel after receiving the first operation. If the P2P connection is established on the 2.4G channel, the terminal device can configure a hotspot on the 5G channel after receiving the first operation, so as to ensure that the hotspot is configured on the 5G channel first.
[0033] In a second aspect, a terminal device is provided, comprising a unit consisting of software and / or hardware, the unit being used to perform any one of the methods in the technical solution of the first aspect.
[0034] Thirdly, a chip is provided, including a processor; the processor is used to read and execute a computer program stored in a memory to perform any of the methods described in the first aspect.
[0035] Optionally, the chip further includes a memory, which is connected to the processor via a circuit or wire.
[0036] Optionally, the chip also includes a communication interface.
[0037] Fourthly, a terminal device is provided, comprising: a processor, a memory, and an interface; the processor, memory, and interface cooperate with each other to enable the terminal device to execute any one of the technical solutions described in the first aspect; or to include any one of the chips described in the third aspect.
[0038] Fifthly, a computer-readable storage medium is provided, wherein a computer program is stored therein, and when the computer program is executed by a processor, the processor performs any one of the methods described in the first aspect.
[0039] In a sixth aspect, a computer program product is provided, the computer program product comprising: computer program code, which, when run on a terminal device, causes the terminal device to execute any one of the methods described in the first aspect. Attached Figure Description
[0040] Figure 1 is a schematic diagram of the hardware structure of a terminal device 100 provided in an embodiment of this application;
[0041] Figure 2 is a software system architecture diagram of the terminal device provided in an embodiment of this application;
[0042] Figure 3 is a schematic diagram of a scenario in which a router is used as an AP device according to an embodiment of this application;
[0043] Figure 4 is a schematic diagram of a scenario where a mobile phone is used as an AP device according to an embodiment of this application;
[0044] Figure 5 is a schematic flowchart of the hotspot connection process provided in an embodiment of this application;
[0045] Figure 6 is a schematic diagram of a P2P connection scenario provided in an embodiment of this application;
[0046] Figure 7 is a schematic diagram of a scenario in which the terminal device provided in the embodiment of this application is used as a GO device or a GC device;
[0047] Figure 8 is a schematic diagram of a scenario in which the terminal device provided in the embodiment of this application functions as both a GO device and a STA device.
[0048] Figure 9 is a schematic diagram of a scenario in which the terminal device provided in the embodiment of this application functions as both a GO device and a GC device.
[0049] Figure 10 is a schematic flowchart of the P2P connection establishment process provided in an embodiment of this application;
[0050] Figure 11 is a schematic flowchart of a method for coexistence of hotspot and P2P connection provided in an embodiment of this application;
[0051] Figure 12 is a schematic flowchart of the coexistence method when opening a hotspot first and then establishing a P2P connection provided in the embodiments of this application;
[0052] Figure 13 is a schematic flowchart of a coexistence method for establishing a P2P connection first and then opening a hotspot, provided in an embodiment of this application.
[0053] Figure 14 is a schematic block diagram of a terminal device provided in an embodiment of this application;
[0054] Figure 15 is a schematic diagram of a device that allows hotspot and P2P connections to coexist, according to an embodiment of this application. Detailed Implementation
[0055] The solution in this application relates to a scenario where hotspots and P2P connections coexist in a terminal device. The terminal device will be described first.
[0056] The terminal device in this application embodiment can be a terminal device capable of interacting with a user, such as a mobile phone, tablet computer, computer, or other devices.
[0057] For example, Figure 1 is a schematic diagram of the structure of a terminal device 100 provided in an embodiment of this application. The terminal device 100 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, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, etc.
[0058] The mobile communication module 150 may include one or more of second-generation (2G), 3G, 4G, and 5G communication modules. The mobile communication module 150 may include one or more of a filter, a switch, a power amplifier, and a low-noise amplifier (LNA).
[0059] The wireless communication module 160 may include one or more of the following: Bluetooth (BT) module, wireless local area network (WLAN) module, global navigation satellite system (GNSS) module, near field communication (NFC) module, infrared (IR) module, and frequency modulation (FM) module. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering on the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification on them, and then convert them into electromagnetic waves for radiation via antenna 2.
[0060] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0061] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.
[0062] The software system architecture of the terminal device in this embodiment of the application will be described below with reference to Figure 2. The software system of the terminal device in this embodiment of the application can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the application takes the layered architecture Android system as an example to illustrate the software structure of the device.
[0063] Figure 2 is a software structure block diagram of the terminal device provided in an embodiment of this application. The layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system can be divided into four layers, from top to bottom: the application (APP) layer, the application framework (framework) layer, the system layer, and the driver layer.
[0064] As shown in Figure 2, the application layer can include a series of application packages, which may include applications such as SMS, calendar, navigation, gallery, calling, WLAN, screen mirroring, and file sharing.
[0065] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0066] As shown in Figure 2, the application framework layer may include a window manager, a resource manager, a view system, a phone manager, etc.
[0067] The window manager is used to manage window applications, including managing the window hierarchy and display order. The window manager can obtain the screen size, determine if a status bar is present, lock the screen, and capture the screen, among other things.
[0068] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, etc.
[0069] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface may include the display interface for a text notification icon, and views may include views for displaying text and views for displaying images.
[0070] A phone manager is used to provide communication functions for terminal devices. For example, a phone manager can be used to manage call status (including when a call is connected, when a call is disconnected, etc.).
[0071] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0072] The system layer can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0073] The Surface Manager is used to manage the display subsystem and provides the blending of two-dimensional and three-dimensional layers for multiple applications.
[0074] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.164, MP3, AAC, AMR, JPG, and PNG.
[0075] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0076] A 2D graphics engine is a drawing engine for 2D drawing.
[0077] The kernel layer is the layer between hardware and software. It includes at least display drivers, sensor drivers, and wireless fidelity (WiFi) drivers. The display driver drives the display screen; the sensor driver drives the sensors; and the WiFi driver drives the WiFi module to establish a WiFi connection.
[0078] The hardware layer includes at least physical components such as a display screen, sensors, and a WiFi module. The sensors may include pressure sensors, gyroscopes, accelerometers, distance sensors, proximity sensors, fingerprint sensors, etc. The functions of each sensor are not described in detail in this embodiment.
[0079] With the continuous development of internet technology, the use of wireless networks, especially WiFi networks, is becoming increasingly common. WiFi hotspots, due to their portability, are favored by more and more users.
[0080] In today's digital age, WiFi hotspots have become an indispensable part of people's lives. Whether at home, in the office, in public places, or while traveling, we can easily connect to WiFi hotspots and enjoy high-speed wireless network connections.
[0081] A WiFi hotspot, also known as a wireless access point (AP), is a device that provides wireless network connectivity. It shares internet access with nearby devices, such as smartphones, tablets, and laptops, via wireless signals. WiFi hotspots can be standalone devices or integrated into other devices, such as wireless routers or mobile hotspots. Furthermore, an increasing number of terminal devices now support hotspot functionality, providing WiFi signals to surrounding devices, such as mobile phones, laptops, and tablets.
[0082] Access point (AP) devices transmit wireless signals via antennas, which propagate within a certain range. Nearby devices can receive these signals and establish connections with the AP through their wireless network cards.
[0083] Access point (AP) devices typically connect to wired or mobile networks, such as broadband internet, 4G networks, and 5G networks. An AP can share the received network connection information wirelessly with connected devices, enabling them to access the internet.
[0084] The module that performs signal conversion in an AP device is a WiFi module (or WiFi chip). The WiFi module can convert received network signals into wireless signals.
[0085] Devices that provide WiFi signals can be called APs or service access points (SAPs), and devices connected to APs can be called stations (STAs).
[0086] Figure 3 illustrates a scenario where a router acts as an access point (AP). In this scenario, STA devices include a mobile phone 310, a laptop 320, and a television 330. Router 340 connects to a wired network and converts the wired network signal into a WiFi signal for transmission. STA devices can access the network by connecting to the WiFi signal provided by the router. As an intermediary node, the router can forward data between the STA devices and server 350. For example, router 340 can receive data sent by server 350 and forward it to the STA devices, or router 340 can receive data sent by the STA devices and forward it to them.
[0087] Figure 4 illustrates a scenario where a mobile phone acts as an Access Point (AP) device, also known as an SAP device. In this scenario, the STA (Standard Access Point) devices include a computer 410 and a mobile phone 420. The mobile phone 430 connects to a 4G or 5G network and converts the received network signal into a WiFi signal for transmission. The laptop 410 and mobile phone 420 can access the network by connecting to the WiFi signal provided by the mobile phone 430. As an intermediary node, the mobile phone 430 can forward data between the STA devices and the server 440. For example, the mobile phone 430 can receive data sent by the server 440 and forward it to the STA device, or it can receive data sent by the STA device and forward it to the server 440.
[0088] As shown above, all data transmitted between the STA device and the Internet needs to be forwarded through the AP. To ensure communication security, the AP needs to use encryption technology to protect the security of data transmission.
[0089] Wireless communication security standards mainly include WEP, WPA, and WPA2. The WEP standard only supports WEP authentication and encryption. The WPA standard supports PSK and 802.1x authentication, but only supports TKIP encryption. The WPA2 standard supports PSK and 802.1x authentication, and supports both CCMP (AES) and TPIK encryption.
[0090] Both the WPA and WPA2 standards use dynamic key generation, which makes it less likely for third parties to obtain the keys, thus helping to ensure communication security.
[0091] The encryption method used by the hotspot can be WPA2 or a non-WPA2 encryption method (such as WEP and WPA). This application embodiment does not specifically limit this. The encryption method used by the hotspot can be the system default encryption method or an encryption method manually set by the user.
[0092] The maximum number of devices that can be connected to the AP can be one or more. The maximum number of devices that can be connected to the AP can be set by the user or preset by the manufacturer before the terminal devices leave the factory.
[0093] For example, if a user only allows one device to connect to the hotspot, the maximum number of accessible devices can be set to 1. If a user allows multiple devices to connect to the hotspot, the maximum number of accessible devices can be set to multiple. Typically, there is a system maximum number of accessible devices, and users cannot exceed this maximum number when setting the number of accessible devices.
[0094] The connection establishment process of the hotspot is described below with reference to Figure 5. The connection establishment process of the hotspot includes three stages: the scanning stage (steps S510 and S520), the link authentication stage (steps S530 and S540), and the association stage (steps S550 and S560).
[0095] In step S510, the STA device sends a probe request frame. This probe request frame is used to discover surrounding wireless networks. When the STA device is powered on and needs to connect to a hotspot, it broadcasts a probe request frame on various channels to inquire whether there are any available access points (APs). The probe request frame includes the STA device's MAC address, supported network types, and requested parameter information, etc.
[0096] In step S520, after receiving the probe request frame sent by the STA device, if the AP device allows the STA device to access, it can send a probe response frame to the STA device. The probe response frame includes network information, such as the AP's SSID, supported speeds, supported authentication types, beacon intervals, and capability information.
[0097] In step S530, the STA device sends an authentication request frame to the AP device. This authentication request frame is used to prove that the STA device is qualified to establish a connection.
[0098] In step S540, the AP device sends an authentication response frame to the STA device. This authentication response frame is used to inform the STA device whether authentication has been successful.
[0099] In step S550, if the STA device passes authentication, the STA device sends an association request frame to the AP device. This association request frame is used to request the establishment of a connection with the AP. The association request frame includes the STA device's MAC address, supported speeds, and capability information, including whether WPA2 encryption is supported.
[0100] In step S560, after the AP device receives the association request frame sent by the STA device, if the AP device accepts the connection request from the STA device, the AP device can send an association response frame to the STA device, thereby establishing a connection between the AP device and the STA device.
[0101] The following describes the user's operation process during hotspot creation.
[0102] Users can select the "Personal Hotspot" option in the phone's settings and turn it on.
[0103] Configure the hotspot name and set a password. In the personal hotspot settings interface, users can set a name and password for their personal hotspot. Setting a password can prevent unauthorized users from connecting to the hotspot.
[0104] Limit the number of connected devices. In the personal hotspot settings, you can set the maximum number of connections to limit the number of devices that can connect simultaneously.
[0105] Enable encryption. In your personal hotspot settings, enable WPA2 or another encryption method to ensure the security of data transmission. Encryption prevents unauthorized users from intercepting or accessing transmitted data.
[0106] For devices that want to connect to a hotspot, the following steps can be taken.
[0107] Turn on WiFi and search for available networks or devices.
[0108] Select Personal Hotspot. In your device's Wi-Fi settings, locate and select your phone's Personal Hotspot, enter the password, and connect to the Personal Hotspot.
[0109] Waiting for connection. Once the device successfully connects to the personal hotspot, it will automatically obtain the network connection provided by the mobile phone, enabling internet access and resource sharing.
[0110] The Wi-Fi signal emitted by the hotspot can be either a 2.4GHz or 5GHz frequency band. Users can manually set the frequency band used by the hotspot, or the hotspot can use the default frequency band.
[0111] Point-to-point (P2P) is a WiFi-based technology introduced by the Wi-Fi Alliance that allows devices to connect directly, enabling one-to-one or one-to-many communication without the need for a local area network (LAN) or access point (AP). In other words, P2P allows two or more devices to connect and communicate directly without a central server or intermediary.
[0112] WiFi P2P can establish connections between devices without a network, and it features high transmission speed and low latency. This technology has numerous applications; as long as the devices support the WiFi P2P protocol, various services can be implemented across all scenarios.
[0113] P2P, also known as WiFi P2P or WiFi Direct, is widely used in applications such as file sharing, online gaming, and music playback between terminal devices. Compared to Bluetooth communication, WiFi P2P offers faster search speeds, faster transmission speeds, and longer transmission distances. Furthermore, terminal devices only need to have WiFi enabled; they do not need to join any network or access point (AP) to establish a P2P connection. This is particularly useful for applications that require data sharing between users (such as multiplayer games or photo sharing).
[0114] Nodes in a P2P network can include group owners (GOs) and group clients (GCs). GOs have active control, while GCs do not. The role of a GO is similar to that of an Access Point (AP) in an Infrastructure BSS, while the role of a GC is similar to that of a Standby Entity (STA) in an Infrastructure BSS.
[0115] Once two devices connect via P2P, one device can be randomly or manually designated, or negotiated to be the GO (Go) and the other the GC (GC). The GO and GC can form a P2P group, with the GO managing the group. A GO can support one or more GCs connecting to it. Other devices can join the group by connecting to the GO, but cannot connect directly to the GC. Typically, the device with the higher processing power is designated as the GO.
[0116] Taking Figure 6 as an example, after device 1 and device 2 establish a P2P connection, if device 1 is designated as GO and device 2 as GC, then if device 3 wants to join the P2P group, it needs to connect with device 1 to join the P2P group, and cannot connect directly with device 2.
[0117] GO can provide network resources (such as allocating IP addresses) for each GC within a P2P group. When there are more than two GCs in a group (assuming GC1 and GC2), communication between GC1 and GC2 is usually achieved by GO acting as an intermediary to distribute data.
[0118] The process of establishing a P2P connection is described below.
[0119] The sending device can initiate P2P connection requests to other devices within a certain radius. Upon receiving a P2P connection request from the sending device, other devices can choose whether to establish a P2P connection with it. These other devices that establish a P2P connection with the sending device can also be referred to as peer devices.
[0120] The peer device can be pre-configured with a P2P connection scheme. Upon receiving a P2P connection request, it will automatically establish a P2P connection according to the pre-configured scheme or automatically reject the P2P connection. Alternatively, the peer device can also be configured with a P2P connection scheme manually selected by the user. For example, after receiving a P2P connection request from the sending device, the peer device can display the request in a pop-up window on its display interface, allowing the user to choose whether to establish a P2P connection with the sending device via remote control, touchscreen, or voice control.
[0121] The sending device has a built-in P2P module, which is responsible for initiating P2P connection requests and, after establishing a P2P connection with the peer device, negotiating and determining which device among the multiple devices in the P2P connection is the GO (Go) and which is the GC (GC). Generally speaking, the GO has active control permissions, while the GC does not. Therefore, in screen mirroring operations, the screen mirroring device can act as the GO, and the device being mirrored to can act as the GC.
[0122] The aforementioned P2P connection request can be a probe request frame. If the peer device agrees to establish a P2P connection, it can send a P2P connection response to the sender, which can be a probe response frame.
[0123] P2P connections have diverse applications and are widely used in various file-sharing software. For example, P2P connections can be applied to all-scenario services. All-scenario services utilize distributed technology for multi-device collaboration, enabling cross-device and cross-system collaboration among multiple terminal devices to achieve resource sharing and collaborative operation. All-scenario services can be applied between terminal devices of the same or different types.
[0124] The full-scenario services in this application embodiment may include various collaborative services such as screen extension, screen casting, trust loop, super call, screen mirroring, super notification, multi-screen collaboration, keyboard and mouse sharing, file sharing, and remote control. The implementation process of these services is described below.
[0125] Screen mirroring, also known as wireless screen sharing, screen mirroring, or screen sharing, allows the screen of device A (such as a mobile phone, tablet, laptop, or computer) to be displayed "in real time" on the screen of another device B (such as a tablet, laptop, computer, TV, all-in-one machine, or projector) by establishing a P2P connection. The output content includes various media information and real-time operation screens.
[0126] For trust loop services, multiple terminal devices can establish a trust relationship through trusted authentication, forming a trust loop. There are several ways for multiple terminal devices to form a trust loop. For example, multiple terminal devices can log in to the same account, and these terminal devices under the same account can trust each other, thus forming a trust loop. Another example is that multiple terminal devices, although not logged into the same account, can establish a trust relationship and form a trust loop through trusted authentication via a protocol.
[0127] By establishing a trust loop across multiple devices, a seamless, multi-pronged approach can be used to create a natural and unobstructed experience. For example, when a user approaches a subway station, the terminal device automatically recognizes them and pops up a travel card; when a user wearing a watch or bracelet approaches a tablet, it can automatically unlock. Key service nodes can appear in front of the user at the right time, without being too frequent or missed.
[0128] For file sharing, after device A and device B establish a P2P connection, they can share data. For example, device A can share files, videos, pictures, recordings, etc., stored on device A with device B.
[0129] To ensure communication security across all business scenarios, data in all business scenarios is generally encrypted using WPA2.
[0130] Because full-scenario services have high requirements for data transmission speed, they typically operate in the 5G frequency band.
[0131] The prerequisite for multiple devices to establish a full-scenario service is that the WiFi connection switches of all devices are turned on. Devices can connect to WiFi, or they can simply have the WiFi connection switch on but not connect to WiFi. In this embodiment, the WiFi can be provided by a router, or it can be a hotspot network provided by other terminal devices, etc.
[0132] The aforementioned P2P connections are generally created on demand when a user initiates a P2P service. In some cases, P2P services and all-scenario services can be interchanged. For example, a user can click to start an all-scenario service on their terminal device, and in response, the terminal device can establish a P2P connection with other devices. As another example, a user can click to enable WLAN Direct on their terminal device, and in response, the terminal device can establish a P2P connection with other devices. Establishing a P2P connection between a terminal device and other devices includes the terminal device sending a P2P connection request to other devices.
[0133] After a user initiates a P2P service, the terminal device can locate devices with P2P connection capabilities and display the found devices on the terminal device. The user can click on the device they wish to connect to, and in response to the user's click, the terminal device establishes a P2P connection with that device. After establishing a P2P connection, the terminal device can conduct P2P services with the peer device.
[0134] The terminal device in this application embodiment may have one function (or role) or multiple functions. For example, the terminal device may only function as a GO device. Another example is that the terminal device may only function as a GC device. Yet another example is that the terminal device may function as both a GO device and an STA device. Yet another example is that the terminal device may function as both a GC device and an STA device. Yet another example is that the terminal device may function as both a GO device and a GC device. Examples are given below.
[0135] Taking Figure 7 as an example, in the scenario where mobile phone 710 projects its screen to laptop 720 via P2P connection, mobile phone 710 is the GO device and laptop 720 is the GC device.
[0136] Taking Figure 8 as an example, mobile phone 810 and laptop 820 establish a P2P connection to execute full-scenario services. In this process, mobile phone 810 is a GO device. Additionally, mobile phone 810 also connects to the WiFi of router 830 and accesses the internet through router 830. In this process, mobile phone 810 is a STA device. In other words, in the scenario shown in Figure 8, mobile phone 810 is both a GO device and a STA device.
[0137] Continuing with Figure 8 as an example, mobile phone 810 and laptop 820 establish a P2P connection to perform full-scenario services. During this process, laptop 820 acts as a GC (Controller) device. Additionally, laptop 820 connects to the WiFi of router 830 and accesses the internet through router 830. In this process, laptop 820 acts as a STA (Standard Controller) device. In other words, in the scenario shown in Figure 8, laptop 820 is both a GC device and a STA device.
[0138] Taking Figure 9 as an example, mobile phone 910 projects its screen to laptop 920 via a P2P connection. During this process, mobile phone 910 acts as a GO device. Additionally, mobile phone 910 also receives images shared by mobile phone 920 via a P2P connection; during this process, mobile phone 910 acts as a GC device. In other words, in the scenario shown in Figure 9, mobile phone 910 is both a GO device and a GC device.
[0139] The P2P connection establishment process is described below with reference to Figure 10. The P2P connection establishment process can include three stages: device discovery, device authentication, and group formation.
[0140] In step S1010, the GC device sends a probe request frame. This probe request frame is used to find available GOs. The probe request frame includes relevant information such as the GC's MAC address and the supported WiFi Direct protocol version.
[0141] In step S1020, after receiving the probe request frame sent by the GC device, if the GO device allows the GC device to access, it sends a probe response frame to the GC device. This probe response frame includes the GO device name, supported services (such as file sharing, printing services, etc.), and WiFi Direct configuration information.
[0142] In step S1030, the GC device sends an authentication request frame to the GO device. This authentication request frame is used to prove that the STA device is qualified to establish a connection.
[0143] In step S1040, the GO device sends an authentication response frame to the GC device. This authentication response frame is used to inform the STA device whether authentication has been successful.
[0144] In step S1050, if the GC device passes authentication, the GC device sends a P2P connection request to the GO device.
[0145] In step S1060, the GO device sends a P2P connection response to the GC device. After the GO device sends the P2P connection response to the GC device, the P2P connection between the GO device and the GC device is established.
[0146] Depending on the frequency band of the WiFi signal, WiFi networks can include 2.4G WiFi and 5G WiFi. The following is an introduction to these two WiFi types.
[0147] 2.4G WiFi is based on the IEEE 802.11b standard, operating in the 2.400GHz to 2.4835GHz frequency band. 2.4G WiFi can also be referred to as 2.4G wireless technology. 5G WiFi, on the other hand, refers to wireless technology developed based on the IEEE 802.11ac standard. Because it operates in the 5GHz frequency band, it is called 5G WiFi.
[0148] There are differences in transmission speed and coverage between 2.4G WiFi and 5G WiFi.
[0149] 5G WiFi has a clear advantage in close-range, unobstructed situations. However, when the distance to the router is greater or there are more obstacles such as walls in between, 2.4G WiFi is more advantageous. 2.4G WiFi has a narrower bandwidth and a lower frequency, but a longer transmission distance.
[0150] Because of its lower frequency, 2.4GHz WiFi signals experience less attenuation during propagation, allowing for wider coverage. Typically, the coverage radius of 2.4GHz WiFi can reach tens or even hundreds of meters. This enables it to provide a certain level of network coverage even in large areas such as large offices and villas.
[0151] 5G WiFi signals have a higher frequency and shorter wavelength, resulting in greater signal attenuation when encountering air or obstacles. Therefore, its coverage range is generally shorter than that of 2.4G WiFi. Typically, the coverage radius of 5G WiFi may only be a few tens of meters.
[0152] Both the 2.4GHz and 5GHz frequency bands can be divided into multiple channels, allowing terminal devices to communicate with other devices on one or more channels. The following explanation uses the 2.4GHz band as an example to illustrate the channel allocation method.
[0153] The commonly used 2.4 GHz band can be divided into 14 channels, each with an effective bandwidth of 20 MHz. Table 1 shows the bandwidth and center frequency of the 14 commonly used channels.
[0154] Table 1
[0155] Currently, some wireless routers support dual-band Wi-Fi signals (2.4GHz and 5GHz) to meet the needs of different usage scenarios. With continuous technological advancements, more and more devices are supporting dual-band Wi-Fi to provide users with a more convenient and efficient network experience.
[0156] The terminal device can connect to two WiFi hotspots to operate, one on the 2.4GHz band and the other on the 5GHz band. Using dual-band WiFi increases the communication bandwidth and thus enhances network transmission speed.
[0157] The WiFi circuitry system of a terminal device can include a baseband processing module and a radio frequency (RF) front-end circuit. The baseband processing module can include processing sections for the physical layer and the medium access control (MAC) layer. The RF front-end circuit includes antennas, power amplifiers (PAs), and low noise amplifiers (LNAs). The WiFi circuitry system determines the WiFi support capabilities.
[0158] Since WiFi devices can operate on both 2.4GHz and 5GHz frequency bands, based on their concurrent operating modes for these two frequency bands, WiFi devices can be divided into single-band single concurrent (SBSC) devices, dual-band single concurrent (DBSC) devices, and dual-band dual concurrent (DBDC) devices.
[0159] An SBSC device comprises a complete circuitry, including a complete baseband processing unit and a complete RF front-end. SBSC devices can operate on a single frequency band (e.g., the 2.4 GHz band).
[0160] DBSC devices can also be called VSDB devices. A DBSC device consists of two complete baseband processing modules and an RF front-end. This RF front-end can operate in either the 2.4GHz or 5GHz band. Although the DBSC baseband supports both 2.4GHz and 5GHz bands, because the RF front-end can only stably operate in one band at a time, the DBSC device can only transmit single signals. DBSC can operate in both the 2.4GHz and 5GHz bands using time-division multiplexing.
[0161] The DBDC device integrates two complete pathways, including two complete baseband processors and two RF front-ends. Because it has two independent pathways, the DBDC device can simultaneously support operation on both the 2.4 GHz and 5 GHz frequency bands.
[0162] Currently, hotspots (or SAP) and P2P connections on terminal devices cannot coexist. For example, when a user turns on a hotspot, it is impossible to establish a full-scenario service, or once a user has established a full-scenario service, it is impossible to turn on a hotspot again.
[0163] As mentioned above, both hotspots and P2P connections use WiFi signals. The transmission of WiFi signals is handled by the WiFi module (or WiFi chip), meaning that both services utilize the same WiFi module in their hardware implementation. If the WiFi module in a terminal device executes the hotspot service first, it cannot execute the P2P service; conversely, if the WiFi module in a terminal device executes the P2P service first, it cannot execute the hotspot service.
[0164] For example, a terminal device might want to create a hotspot to provide network services to other devices while simultaneously engaging in screen mirroring, sharing, or trust loop services with them. However, current technology cannot achieve this functionality.
[0165] Based on this, embodiments of this application provide a method and apparatus for the coexistence of hotspot and P2P connections. By reusing the first channel used by the hotspot, a P2P connection is established on the first channel, achieving the coexistence of hotspot and P2P. In other words, embodiments of this application can execute both hotspot services and P2P services on a single channel, achieving concurrency and compatibility between hotspot and P2P.
[0166] In some implementations, embodiments of this application propose two schemes based on whether the terminal device supports DBDC. If the terminal device supports DBDC, hotspot and P2P connections can coexist according to dual P2P capabilities; if the terminal device does not support DBDC, the hotspot's channel can be reused to establish a P2P connection.
[0167] The method for coexistence of hotspot and P2P connection provided in this application embodiment will be described in detail below with reference to Figure 11. The solution of this application embodiment can be applied to terminal devices. The terminal device can be any device with hotspot and GO functions. For example, the terminal device can be a mobile phone, laptop computer, tablet computer, etc.
[0168] Referring to Figure 11, in step S1110, a first operation input by the user is received. This first operation is used to turn on the hotspot.
[0169] For example, users can select the "Turn on hotspot" button in the settings interface.
[0170] In step S1120, a second operation input by the user is received. This second operation is used to establish a P2P connection.
[0171] In some implementations, the second operation can be any operation that initiates a full-scenario service. For example, the second operation could be selecting "screen sharing," "file sharing," or "trust ring service." In some implementations, the second operation can also be enabling "WLAN Direct." Upon receiving the user's second operation, the terminal device will be triggered to establish a P2P connection.
[0172] In response to the first operation and the second operation, the terminal device may execute steps S1130 and S1140.
[0173] In step S1130, if the terminal device does not support DBDC, a first hotspot is configured on the first channel, and a P2P connection is established by reusing the first channel.
[0174] This application embodiment establishes a P2P connection by reusing the channel of the first hotspot, that is, by having the hotspot and the P2P connection share a single channel, enabling the coexistence of the hotspot and the P2P connection. Hotspot services and P2P services can use the first channel through time-division multiplexing or alternation, thereby allowing the terminal device to simultaneously execute both hotspot services and P2P services.
[0175] In some implementations, the first channel can be either a 2.4G channel or a 5G channel. In other words, a P2P connection can reuse either a 2.4G hotspot channel or a 5G hotspot channel. Since P2P services (such as full-scenario services) require significant bandwidth, while the bandwidth of the 2.4G channel is relatively small, to ensure the smooth execution of P2P services and improve user experience, P2P connections are typically established on a 5G channel. That is, the P2P connection reuses a 5G hotspot channel, meaning the first channel is a 5G channel. The following description will use a 5G channel as the first channel as an example.
[0176] After configuring a first hotspot on the first channel, the terminal device can activate the hotspot. For example, the terminal device can send a WiFi signal on the first channel or generate an SAP (Signal for Access Points) on the first channel. The WiFi module can convert the cellular network into a WiFi signal and send that WiFi signal on the first channel.
[0177] In some implementations, the terminal device can establish a connection with the STA device on the first channel as shown in Figure 5.
[0178] Establishing a P2P connection by reusing the first channel may include: sending a P2P connection request on the first channel and receiving a P2P connection response sent by the peer device on the first channel. The P2P connection request may be a probe request frame, and the P2P connection response may be a P2P probe response frame. For example, a terminal device may establish a P2P connection with a peer device (such as a GC device) on the first channel as shown in Figure 10. The terminal device may receive a P2P connection request sent by the GC device on the first channel and send a P2P connection response to the GC device.
[0179] The terminal device in this embodiment can have SAP and GO functions. On the first channel, the terminal device can identify messages during both hotspot connection processes and P2P connection processes. In other words, the terminal device can execute both the process shown in Figure 5 and the process shown in Figure 10 on the first channel.
[0180] If the terminal device does not support DBDC, it means that the terminal device can only operate one channel at a time. In this case, the embodiments of this application can achieve the coexistence of SAP and P2P by reusing channels. That is, both hot services and P2P services are executed on the first channel to be compatible with SAP and P2P, and to achieve compatibility and concurrency of SAP and P2P.
[0181] The following example illustrates the multiplexing process of the first channel. For the connection establishment process of a hotspot, the terminal device can receive a probe request frame sent by the STA device on the first channel. This probe request frame is used to discover surrounding wireless networks. After receiving the probe request frame, the terminal device can send a probe response frame to the STA device on the first channel. The terminal device receives an authentication request frame sent by the STA device on the first channel and sends an authentication response frame to the STA device on the first channel. The terminal device receives an association request frame sent by the STA device on the first channel and sends an association response frame to the STA device on the first channel.
[0182] During the P2P connection establishment process, the terminal device can receive a probe request frame sent by the GC device on the first channel. This probe request frame is used to find available GOs. After receiving the probe request frame, the terminal device sends a probe response frame to the GC device on the first channel. The terminal device also receives an authentication request frame sent by the GC device on the first channel and sends an authentication response frame to the GC device on the first channel. Finally, the terminal device receives a P2P connection request sent by the GC device on the first channel and sends a P2P connection response to the GC device on the first channel.
[0183] In step S1140, if the terminal device supports DBDC, a second hotspot is configured on the second channel, and a P2P connection is established on the third channel.
[0184] As mentioned earlier, if the terminal device supports DBDC, it means that the terminal device can operate simultaneously on both the 2.4GHz and 5GHz frequency bands, which also means that the terminal device can run two channels at the same time. Therefore, if the terminal device supports DBDC, it can execute hotspot services and P2P services on different channels respectively, that is, the second channel and the third channel are different channels. Of course, if the terminal device supports DBDC, it can also execute both hotspot services and P2P services on the same channel, that is, the second channel and the third channel are the same channel. To ensure the smooth operation of P2P services, the third channel is a 5GHz channel.
[0185] Configuring a second hotspot on the second channel can include transmitting a WiFi signal on the second channel or generating an SAP on the second channel. The WiFi module can convert the cellular network into a WiFi signal and transmit that WiFi signal on the first channel. The terminal device can establish a connection with the STA device according to the process shown in Figure 5.
[0186] The second channel can be a 2.4G channel or a 5G channel.
[0187] Establishing a P2P connection on the third channel can include: sending a P2P connection request on the third channel, and receiving a P2P connection response sent by the peer device on the third channel. The P2P connection request can be a probe request frame, and the P2P connection response can be a P2P probe response frame.
[0188] The third channel can be a 2.4G channel or a 5G channel.
[0189] In the P2P connection established above, the terminal device can be a GO device or a GC device, or the terminal device can be both a GO device and a GC device. This application embodiment does not specifically limit this.
[0190] For example, in the scenario shown in Figure 7, if the terminal device is a mobile phone 710, then the terminal device is a GO device; if the terminal device is a laptop 720, then the terminal device is a GC device.
[0191] For example, in the scenario shown in Figure 9, if the terminal device is a mobile phone 910, then the terminal device is both a GO device and a GC device.
[0192] This application does not specifically limit the execution order of the first and second operations in its embodiments. For example, the first operation can precede the second operation, that is, the user inputs the first operation first, and then inputs the second operation. Alternatively, the second operation can precede the first operation, that is, the user inputs the second operation first, and then inputs the first operation.
[0193] If the first operation precedes the second operation, the terminal device can configure a hotspot after receiving the first user input. The terminal device can configure a hotspot on either the 2.4G channel or the 5G channel (i.e., the first channel).
[0194] For example, after receiving the first operation but before receiving the second operation, the terminal device can respond to the first operation by configuring a first hotspot on the 5G channel, i.e., activating SAP on the 5G network. Then, after receiving the second operation, the terminal device can directly reuse the 5G channel to establish a P2P connection. The terminal device can reuse the previously established hotspot for full-scenario services, and the peer device GC in the full-scenario service can also reuse the 5G channel to communicate with the terminal device.
[0195] If the terminal device has already configured the first hotspot on the 5G channel before receiving the second operation, and if the current encryption method of the 5G channel is not WPA2 encryption, the terminal device can respond to the second operation by displaying a second prompt message on the terminal device after receiving the second operation. The second prompt message is used to prompt the user to change the encryption method of the first hotspot to WPA2 encryption in order to better complete the full-scenario service.
[0196] When a user changes the encryption method, they can be reminded that non-WPA2 encryption methods will affect the reuse of SAP and all-scenario services, and should be changed to WPA2 encryption method as much as possible.
[0197] For example, after receiving the first operation but before receiving the second operation, the terminal device can respond to the first operation by configuring a third hotspot on the 2.4G channel. After receiving the second operation, to ensure the smooth operation of services across all scenarios, the terminal device can respond to the second operation by reconfiguring the third hotspot as the first hotspot. After reconfiguring the hotspot, the first channel can be reused to establish a P2P connection. After reconfiguring the hotspot, the terminal device can restart the hotspot.
[0198] To enable multiple devices to connect and ensure smooth operation of services across all scenarios, when reconfiguring the primary hotspot, the number of devices that can be connected to the primary hotspot can be set to a value greater than 1. For example, the number of devices that can be connected to the primary hotspot can be set to the system's maximum value.
[0199] In some implementations, if the primary hotspot is manually configured by the user, a prompt message can be displayed on the terminal device. This message prompts the user to set the number of accessible devices to the system maximum or a value greater than 1. The system maximum refers to the maximum number of access devices that the terminal device can configurable. For example, if the range of the number of access devices that can be configured on the terminal device is 1 to 5, then the system maximum is 5.
[0200] In addition, to ensure data security across all business scenarios, when reconfiguring the primary hotspot, its encryption method can be set to WPA2. This way, all data in P2P communication will be encrypted using WPA2, thus ensuring data security across all business scenarios.
[0201] In some implementations, if the first hotspot is manually configured by the user, a prompt message can also be displayed on the terminal device, prompting the user to set the encryption method of the first hotspot to WPA2 encryption.
[0202] To ensure that existing hotspot services (or original STA devices) are not affected, when a terminal device reconfigures a third hotspot as the first hotspot, it can do so only if there are no STA devices currently connected to the terminal device, or if all STA devices currently connected to the terminal device support the 5G frequency band. The previously connected STA devices can then reconnect to the terminal device on the first hotspot and communicate with it.
[0203] If any of the STA devices currently connected to the terminal device does not support the 5G frequency band, or if it is uncertain whether the device supports the 5G frequency band, a first prompt message will be displayed on the terminal device. The first prompt message is used to prompt the user whether to reconfigure the third hotspot as the first hotspot.
[0204] For example, if the currently activated hotspot is the third hotspot (i.e., SAP starts at 2.4G), after receiving the second operation, the terminal device can determine whether there are any STA devices currently connected to the terminal device. If there are no STA devices currently connected to the terminal device, the third hotspot is reconfigured as the first hotspot, and the hotspot is restarted. If there are STA devices currently connected to the terminal device, the frequency bands supported by the STA devices are further determined, i.e., whether they support the 5G frequency band; if all connected STA devices support the 5G frequency band, the third hotspot is reconfigured as the first hotspot, and the hotspot is restarted.
[0205] If any of the currently connected STA devices does not support the 5G band, or if it is unclear whether a device supports the 5G band (such as a third-party device), a pop-up window will be displayed on the terminal device. This pop-up window prompts the user to make a choice, namely whether to reconfigure the third hotspot as the first hotspot. The pop-up window includes a first prompt message, which may include the following: (1) If you want to ensure good performance of the full-scenario service, you need to switch the hotspot to the 5G channel and restart the hotspot. This may cause the previously connected STA service to experience a lag or even a disconnection (for STA devices that do not support the 5G band); (2) If you want to ensure that the existing STA devices are not affected as much as possible, you can choose to directly reuse the 2.4G channel, but the performance of the full-scenario service will be poor; (3) If you want to ensure that the existing STA service is not affected at all, you can start the full-scenario service after the STA service ends.
[0206] Before reconfiguring a hotspot, the current hotspot information can be backed up so that it can be restored after all business scenarios have ended. For example, before reconfiguring a third hotspot as the first hotspot, the information of the third hotspot can be backed up so that it can be restored as the third hotspot after all business scenarios have ended.
[0207] The information for the third hotspot may include one or more of the following: the name of the third hotspot, the password of the third hotspot, the encryption method of the third hotspot, and the number of devices that can be connected.
[0208] In some implementations, a third operation is received from the user, which is used to disconnect the P2P connection. In response to this third operation, the terminal device can restore the hotspot to a third hotspot.
[0209] The third operation can be any operation to terminate the full-scenario service. For example, the third operation can be to terminate screen sharing. Another example is to terminate file sharing. Yet another example is to terminate the trust ring service. And yet another example is to disconnect the WLAN direct connection.
[0210] Devices accessing the terminal via a hotspot are designated as STA devices, while devices accessing the terminal via P2P are designated as GC devices. To ensure successful access for both STA and GC devices, the terminal device can separately track the number of connected STA and GC devices. This is especially important in scenarios where the terminal device does not support DBDC (Deep-Depth DC), as P2P connections reuse the channel where the hotspot is located. Failure to separately track the number of STA and GC devices will affect the number of connected terminal devices, thus impacting the smooth operation of both hotspot and P2P services.
[0211] If the number of accessible devices configured for the first hotspot is a first number, then the number of STA devices allowed to access the terminal device and the number of GC devices allowed to access the terminal device are also the first number. For example, if the number of accessible devices configured for the hotspot is 1, then 1 STA device and 1 GC device can be allowed to access the terminal device. If the number of accessible devices configured for the hotspot is 2, then 2 STA devices and 2 GC devices can be allowed to access the terminal device.
[0212] The terminal device's settings interface allows you to display the number of each type of access device individually. For example, you can display the number of STA devices and the number of GC devices separately.
[0213] Assuming the number of STA devices is counted as count1 and the number of GC devices is counted as count2, when an STA device connects to a terminal device, count1 is incremented by 1; when a GC device connects to a terminal device, count2 is incremented by 1. When count1 reaches its first count, no further STA devices can connect to the terminal device; when count2 reaches its first count, no further GC devices can connect to the terminal device.
[0214] It should be noted that the number of STA devices does not affect the access of GC devices, and vice versa. For example, if the number of currently connected STA devices reaches a certain threshold, but the number of currently connected GC devices has not yet reached that threshold, then subsequent STA devices cannot access the terminal device, but subsequent GC devices can still access the terminal device. Conversely, if the number of currently connected STA devices has not yet reached that threshold, but the number of currently connected GC devices has reached that threshold, then subsequent GC devices cannot access the terminal device, but subsequent STA devices can still access the terminal device.
[0215] For cases where hotspot reconfiguration is not required (i.e., the first hotspot has already been configured before receiving the second operation), if the number of accessible devices configured for the first hotspot is 1, then the number of STA devices and GC devices accessing the terminal device is distinguished, and the number of STA devices and GC devices accessing the terminal device is counted separately to avoid affecting the access of GC devices. If, after distinguishing between STA devices and GC devices, there are still devices that cannot access the terminal due to the number limit, then a sixth prompt message is displayed on the terminal device. The sixth prompt message is used to prompt the user to modify the number of accessible devices, such as setting the number of accessible devices to a value greater than 1.
[0216] If the second operation occurs before the first operation—that is, the terminal device establishes a P2P connection before opening the hotspot—the hotspot cannot directly reuse the P2P connection channel because the P2P connection only involves communication between terminal devices and cannot communicate with the network (such as a base station). The hotspot needs to be rebuilt. In this case, to open the hotspot, it needs to be restarted and its channel reused to re-establish the P2P connection, or the rebuilt hotspot needs to be compatible with the original GO functionality.
[0217] In some implementations, if the user inputs a second operation first and then inputs a first operation, the terminal device can rebuild the hotspot after receiving the first operation, and the terminal device can configure the hotspot according to the hotspot information configured by the user.
[0218] If the user configures the hotspot information as 5G hotspot information (or in other words, the user configures the hotspot information in the 5G frequency band), the terminal device can directly configure the first hotspot on the 5G channel according to the user's configured hotspot information.
[0219] If the user configures a 5G hotspot, but the hotspot's encryption method is not WPA2, a fourth prompt message can be displayed on the terminal device. This fourth prompt message is used to prompt the user to change the hotspot's encryption method to WPA2.
[0220] If the user configures a 5G hotspot, but the number of devices that can access the hotspot is 1, a fifth prompt message can be displayed on the terminal device. This fifth prompt message is used to remind the user that the number of devices that can access the hotspot should be set to a value greater than 1.
[0221] If the user configures the hotspot information as a 2.4G hotspot (or in other words, the user configures the hotspot information in the 2.4G frequency band), a third prompt message will be displayed on the terminal device. This third prompt message is used to prompt the user to configure the hotspot in the 5G frequency band to ensure the smooth execution of services across all scenarios.
[0222] If the user configures a 2.4G hotspot, since the user needs to reconfigure the hotspot, the system can also prompt the user to set the encryption method to WPA2 and the number of accessible devices to a value greater than 1. In other words, the third prompt is used to remind the user to configure the hotspot on the 5G band, set the encryption method to WPA2, and set the number of accessible devices to a value greater than 1.
[0223] After configuring the first hotspot, the terminal device can restart the hotspot and re-establish the P2P connection with the original GC device to continue executing the original P2P service.
[0224] In some implementations, after receiving the second operation, the terminal device can establish a P2P connection with the GC device in response. After receiving the first operation, to ensure compatibility with both P2P and hotspots, the terminal device needs to first disconnect the P2P connection with the GC device and configure a first hotspot on the first channel. After configuring the first hotspot on the first channel, the terminal device can re-establish the P2P connection with the GC device on the first channel. For example, the terminal device can receive a P2P access request from the GC device on the first channel and send a P2P access response to the GC device on the first channel.
[0225] In some implementations, after configuring the first hotspot, the terminal device can establish a P2P connection with the GC device by executing the process shown in Figure 10.
[0226] For example, a terminal device can receive a probe request frame sent by a GC device, which is used to find available GOs. After receiving the probe request frame, the terminal device can send a probe response frame to the GC device. The terminal device can also receive a P2P access request sent by the GC device and send a P2P access response to the GC device.
[0227] In some implementations, after configuring the first hotspot, the terminal device can send the first hotspot information to the GC device through the trust ring. After obtaining the first hotspot information, the GC device can directly use this information to establish a P2P connection with the terminal device. This eliminates the communication process of probe requests and responses, reducing signaling overhead and the interruption time during P2P connection establishment between the terminal device and the GC device, thus improving user experience. For example, after the terminal device sends the first hotspot information to the GC device through the trust ring, a P2P connection can be established between the terminal device and the GC device through steps S1030-S1060 as shown in Figure 10, or through steps S1050-S1060 as shown in Figure 10. The terminal device can be understood as the GO device in Figure 10.
[0228] The information for the first hotspot includes one or more of the following: the name of the first hotspot, supported speeds, supported authentication types, and capability information.
[0229] Before receiving the first operation, the terminal device can have various service types. For example, the terminal device's service type is single GO. Another example is GO+GC. Yet another example is GO+STA. Regardless of the terminal device's service type, when configuring the first hotspot, the terminal device needs to be compatible with the existing GO functionality; that is, the terminal device must be able to perform both hotspot services and P2P services.
[0230] When a user manually configures the primary hotspot, a prompt message can be displayed on the terminal device. This prompt message may include the following: reminding the user to set the hotspot to the 5G frequency band, set the encryption method to WPA2 encryption, and set the number of accessible devices to a value of 1, in order to better support hotspot and concurrent services across all scenarios.
[0231] In some implementations, to ensure that both STA and GC devices can successfully connect to the terminal device, the number of devices that can be connected to the first hotspot can be set to the system maximum value or a value greater than 1 when configuring the first hotspot. If the first hotspot is manually configured by the user, a prompt message can also be displayed on the terminal device to remind the user to set the number of connectable devices to the system maximum value.
[0232] In some implementations, to ensure data security across all business scenarios, the encryption method for the primary hotspot can be set to WPA2. If the primary hotspot is manually configured by the user, a prompt message can be displayed on the terminal device to remind the user that failure to set the encryption method to WPA2 will result in the unavailability of all business scenarios.
[0233] In some implementations, the STA devices and GC devices connected to the terminal device can be counted separately to ensure that both STA devices and GC devices can successfully connect to the terminal device, thus avoiding the impact of the number of STA devices connected on the number of GC devices connected.
[0234] The above section introduced solutions for terminal devices that do not support DBDC. The following section introduces solutions for terminal devices that support DBDC.
[0235] If the terminal device supports DBDC, then the analysis is divided into two cases based on the order of the first and second operations.
[0236] If the first operation precedes the second operation—that is, if the user starts the hotspot before initiating the P2P connection—the terminal device can respond to the first operation by configuring a second hotspot on the second channel after receiving the first operation. The second channel can be either a 2.4GHz channel or a 5GHz channel.
[0237] If the second channel is a 5G channel, upon receiving the second operation, the terminal device can directly establish a P2P connection on the second channel in response. In this case, the second and third channels are the same channel, which saves channel resources. Alternatively, the terminal device can establish a P2P connection on a different 5G channel than the second channel, meaning the second and third channels are different 5G channels. This approach ensures sufficient bandwidth resources for both hotspot and full-scenario services, guaranteeing their smooth operation. The terminal device can support both hotspot and P2P (or GO) coexistence with dual P2P capabilities. Establishing a P2P connection on a 5G channel guarantees the smooth execution of full-scenario services.
[0238] If the second channel is a 2.4G channel, then upon receiving the second operation, the terminal device can establish a P2P connection on the third channel, which is a 5G channel, in response to that operation. In this case, the second and third channels are different channels. The 5G channel has a wider bandwidth and higher throughput; therefore, establishing a P2P connection on the 5G channel can better support services across all scenarios.
[0239] The following describes the solutions of this application embodiment based on the service type of the terminal device, under several scenarios. As mentioned above, the terminal device may function solely as an SAP device, or it may function as both an SAP device and a STA device. When the terminal device functions as an SAP device, it can be either a 2.4G SAP device or a 5G SAP device. When the terminal device functions as a STA device, it can be either a 2.4G STA device or a 5G STA device.
[0240] 2.4G SAP indicates that the terminal device generates SAP in the 2.4G frequency band, and 5G SAP indicates that the terminal device generates SAP in the 5G frequency band. 2.4G STA indicates that the terminal device accesses WiFi in the 2.4G frequency band, and 5G STA indicates that the terminal device accesses WiFi in the 5G frequency band.
[0241] Before receiving the second operation, if the terminal device's service type is single SAP, then after receiving the second operation, the terminal device can choose to establish a P2P connection on the 5G channel, that is, initiate GO on the 5G channel.
[0242] Before receiving the second operation, if the service type of the terminal device is 2.4G SAP+2.4G STA, then after receiving the second operation, the terminal device can choose to directly establish a P2P connection on the 5G channel, that is, start GO on the 5G channel.
[0243] Before receiving the second operation, if the service type of the terminal device is 2.4G SAP+5G STA, after receiving the second operation, the terminal device can choose to establish a P2P connection with the STA on the same channel in the 5G band, that is, start GO on the 5G channel; or, the terminal can also choose to establish a P2P connection on a channel different from the STA channel in the 5G band.
[0244] Before receiving the second operation, if the service type of the terminal device is 5G SAP+2.4G STA, after receiving the second operation, the terminal device can choose to establish a P2P connection with SAP on the same channel in the 5G band, that is, start GO on the 5G channel; or, the terminal device can also choose to establish a P2P connection on a channel different from the SAP channel in the 5G band.
[0245] Before receiving the second operation, if the terminal device's service type is 5G SAP+5G STA, then after receiving the second operation, the terminal device can choose to establish a P2P connection with SAP on the same channel in the 5G band, i.e., initiate GO on the 5G channel. Of course, the terminal device can also choose to establish a P2P connection on a different channel in the 5G band than the SAP channel.
[0246] If the second operation occurs before the first operation—that is, if the user establishes a P2P connection before starting the hotspot—the terminal device can respond to the second operation by establishing a P2P connection on the third channel upon receiving the second operation. The third channel can be a 2.4G channel or a 5G channel.
[0247] If the third channel is a 5G channel, then upon receiving the first operation, in response to that operation, the terminal device can directly configure a second hotspot on the third channel. In this case, the second and third channels are the same channel. Alternatively, the terminal device can also configure a hotspot on a different 5G channel than the third channel, i.e., the second and third channels are different 5G channels. The terminal device can enable the coexistence of hotspots and P2P (or GO) according to dual P2P capabilities.
[0248] If the third channel is a 2.4G channel, then upon receiving the first operation, in response to the first operation, the terminal device can configure a second hotspot on the second channel, which is a 5G channel. In this case, the second and third channels are different channels.
[0249] The following describes the solutions of this application embodiment under several scenarios based on the service type of the terminal device. As mentioned above, the terminal device may function solely as a GO device, or it may function as both a GO device and a GC device, or both a GO device and a STA device. When the terminal device functions as a GO device, it can be either a 2.4G GO device or a 5G GO device. When the terminal device functions as a GC device, it can be either a 2.4G GC device or a 5G GC device. When the terminal device functions as a STA device, it can be either a 2.4G STA device or a 5G STA device.
[0250] 2.4G GO indicates that when the terminal device acts as a GO device, it communicates with the peer device in the 2.4G frequency band; 5G GO indicates that when the terminal device acts as a GO device, it communicates with the GC device in the 5G frequency band; 2.4G GC indicates that when the terminal device acts as a GC device, it communicates with the GO device in the 2.4G frequency band; 5G GC indicates that when the terminal device acts as a GC device, it communicates with the GO device in the 5G frequency band; 2.4G STA indicates that the terminal device accesses WiFi in the 2.4G frequency band; 5G STA indicates that the terminal device accesses WiFi in the 5G frequency band.
[0251] Before receiving the first operation, if the service type of the terminal device is single GO, the terminal device can choose to configure a second hotspot on the 5G channel after receiving the first operation, that is, the terminal device can launch SAP on the 5G channel.
[0252] Before receiving the first operation, if the service type of the terminal device is 2.4G GO+2.4G GC / STA, then after receiving the first operation, the terminal device can choose to configure a second hotspot on the 5G channel, that is, the terminal device can launch SAP on the 5G channel.
[0253] Before receiving the first operation, if the service type of the terminal device is 5G GO+2.4G GC / STA, after receiving the first operation, the terminal device can configure a second hotspot on the channel where GO is located, that is, GO and the second hotspot share the same channel, or the terminal device can configure a second hotspot on a 5G channel different from the GO channel.
[0254] Before receiving the first operation, if the service type of the terminal device is 2.4G GO+5G GC / STA, then after receiving the first operation, the terminal device can choose to configure a second hotspot on the 5G channel, that is, the terminal device can launch SAP on the 5G channel.
[0255] Before receiving the first operation, if the service type of the terminal device is 5G GO+5G GC / STA, then after receiving the first operation, the terminal device can configure a second hotspot on the channel where GO is located, that is, GO and the second hotspot share the same channel, or the terminal device can configure a second hotspot on a 5G channel different from the GO channel.
[0256] In some implementations, when users manually configure hotspots, for terminal devices that do not support DBDC, the following reminders can be given to users: remind users to set the hotspot to the 5G band, set the encryption method to WPA2, and set the number of accessible devices to a value of 1, to better support hotspot and concurrent services across all scenarios. For terminal devices that support DBDC, since they can execute different services on two channels, no user reminders are required.
[0257] The following section, in conjunction with Figures 12 and 13, provides a detailed description of the solution for the coexistence of hotspots and P2P connections provided in the embodiments of this application.
[0258] Figure 12 shows the scheme of first opening the hotspot and then establishing a P2P connection, while Figure 13 shows the scheme of first establishing a P2P connection and then opening the hotspot. The scheme shown in Figure 12 will be introduced first below.
[0259] Referring to Figure 12, in step S1202, it is determined whether the hotspot is turned on. If the hotspot is turned on, proceed to step S1204; if the hotspot is not turned on, the process ends.
[0260] In step S1204, determine whether there is a full-scenario service currently available. If there is no full-scenario service currently available, the process ends; if there is a full-scenario service currently available, proceed to step S1206.
[0261] In step S1206, it is determined whether the terminal device supports DBDC. If the terminal device supports DBDC, then proceed to steps S1208 to S1216; if the terminal device does not support DBDC, then proceed to steps S1218 to S1238.
[0262] In step S1208, if the current service type is single SAP, then select to start GO on the 5G channel.
[0263] In step S1210, if the current service type is 2.4G SAP+2.4G STA, then GO is initiated directly on the 5G channel.
[0264] In step S1212, if the current service type is 2.4G SAP+5G STA, then GO is initiated on the same channel as the STA channel in the 5G band.
[0265] In step S1214, if the current service type is 5G SAP+2.4G STA, then GO is initiated on the same channel as the SAP channel in the 5G band.
[0266] In step S1216, if the current service type is 5G SAP+5G STA, then GO is initiated on the same channel as the SAP channel in the 5G frequency band.
[0267] If the terminal device does not support DBDC, determine whether the SAP is located on the 2.4G or 5G frequency band. If the SAP is located on the 5G frequency band, continue to execute steps S1218 to S1224; if the SAP is located on the 2.4G frequency band, continue to execute steps S1226 to S1238.
[0268] In step S1218, the 5G channel is reused for full-scenario services.
[0269] In step S1220, it is determined whether the number of accessible devices for the hotspot is 1, and whether the encryption method of the hotspot is non-WPA2.
[0270] In step S1222, if the number of accessible devices for the hotspot is 1, a pop-up window will remind the user to set the number of accessible devices to a value greater than 1; if the encryption method of the hotspot is not WPA2 encryption, a pop-up window will remind the user to set the encryption method to WPA2 encryption.
[0271] If it is necessary to modify the configuration information of the hotspot, the original hotspot information should be backed up and restored after the full-scenario business ends.
[0272] If the number of devices that can access the hotspot is greater than 1, and the hotspot is encrypted using WPA2 encryption, then proceed to step S1224.
[0273] In step S1224, the number of STA devices and the number of GC devices accessing the terminal device are counted separately.
[0274] In step S1226, it is determined whether there is a STA device currently connected to the terminal device. If there is a STA device currently connected to the terminal device, then proceed to steps S1228 to S1232; if there is no STA device currently connected to the terminal device, then proceed to step S1234.
[0275] In step S1228, if the STA device and the terminal device are devices of the same brand, then query whether the STA device supports the 5G frequency band.
[0276] In step S1230, if all STA devices support the 5G band, the hotspot is reconfigured as a 5G hotspot.
[0277] In step S1232, if the STA device contains devices that do not support the 5G frequency band, a pop-up window will remind the user whether to reconfigure the hotspot as a 5G hotspot. If the STA device and the terminal device are from different brands, i.e., the STA device includes third-party devices, a pop-up window will remind the user whether to reconfigure the hotspot as a 5G hotspot.
[0278] In step S1234, when reconfiguring the hotspot, the number of accessible devices is set to a value greater than 1, and the encryption method is set to WPA2 encryption.
[0279] In step S1236, execute the full-scenario business.
[0280] In step S1238, after the full-scenario service ends, the original hotspot is restored.
[0281] The scheme shown in Figure 13 will be described below.
[0282] Referring to Figure 13, in step S1302, it is determined whether the terminal device has established a P2P connection. If the terminal device has established a P2P connection, then proceed to step S1304; if the terminal device has not established a P2P connection, then the process ends.
[0283] In step S1304, it is determined whether the user has turned on the hotspot. If the user has not turned on the hotspot, the process ends; if the user has turned on the hotspot, proceed to step S1306.
[0284] In step S1306, it is determined whether the terminal device supports DBDC. If the terminal device supports DBDC, steps S1308 to S1316 are executed. If the terminal device does not support DBDC, step S1318 is executed.
[0285] In step S1308, if the service type of the terminal device is single GO, it is preferable to activate SAP on the channel of 5G band.
[0286] In step S1310, if the service type of the terminal device is 2.4G GO+2.4G GC / STA, then SAP is activated on the channel in the 5G band.
[0287] In step S1312, if the service type of the terminal device is 2.4G GO+5G GC / STA, SAP is preferably activated on the channel of the 5G band.
[0288] In step S1314, if the service type of the terminal device is 5G GO+2.4G GC / STA, it is preferred to activate SAP on the same channel as GO in the 5G band, or preferably to activate SAP on a channel in the 5G band.
[0289] In step S1316, if the service type of the terminal device is 5G GO+5G GC / STA, then SAP is activated on the same channel as the GO channel in the 5G band.
[0290] In step S1318, regardless of the service type of the terminal device, SAP can be regenerated according to the information configured by the user. The new SAP is compatible with the original GO role, or in other words, the new SAP has GO function and / or GC function.
[0291] For example, if the terminal device's service type is single GO, the SAP is regenerated according to the user-configured information, and the new SAP is compatible with the original GO role. If the terminal device's service type is 2.4G GO + 2.4G GC / STA, the SAP is regenerated according to the user-configured information, and the new SAP is compatible with the original GO role. If the terminal device's service type is 5G GO + 2.4G GC / STA, the SAP is regenerated according to the user-configured information, and the new SAP is compatible with the original GO role. If the terminal device's service type is 2.4G GO + 5G GC / STA, the SAP is regenerated according to the user-configured information, and the new SAP is compatible with the original GO role. If the terminal device's service type is 5G GO + 5G GC / STA, the SAP is regenerated according to the user-configured information, and the new SAP is compatible with the original GO role.
[0292] The foregoing has detailed examples of the methods provided in this application. It is understood that the corresponding apparatus, in order to achieve the above functions, includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware 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, but such implementation should not be considered beyond the scope of this application.
[0293] This application can divide the device for realizing the coexistence of hotspot and P2P connections into functional modules based on the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0294] The device for enabling the coexistence of hotspot and P2P connection in the embodiments of this application can be a terminal device, or the device for enabling the coexistence of hotspot and P2P connection can be a chip or the like used to implement the above method.
[0295] The device embodiments of this application will now be described with reference to Figures 14 and 15. It should be noted that the device embodiments correspond to the method embodiments; for details not described in detail, please refer to the method embodiments.
[0296] Figure 14 is a schematic block diagram of a terminal device provided in an embodiment of this application. The terminal device 1400 includes a first receiving module 1410, a second receiving module 1420, and an execution module 1430.
[0297] The first receiving module 1410 is used to receive a first operation input by the user, the first operation being used to turn on a hotspot.
[0298] The second receiving module 1420 is used to receive a second operation input by the user, the second operation being used to establish a P2P connection.
[0299] The execution module 1430 is configured to perform the following operations in response to the first operation and the second operation: if the terminal device does not support DBDC, configure a first hotspot on a first channel and establish a P2P connection using the first channel, wherein the first channel is a 5G channel; if the terminal device supports DBDC, configure a second hotspot on a second channel and establish a P2P connection on a third channel, wherein the second channel and the third channel are the same channel or different channels.
[0300] In some implementations, if the terminal device does not support DBDC and the first operation occurs before the second operation, the execution module 1430 is configured to: after receiving the first operation and before receiving the second operation, configure a third hotspot on the 2.4G channel in response to the first operation; and after receiving the second operation, reconfigure the third hotspot as the first hotspot in response to the second operation.
[0301] In some implementations, the execution module 1430 is used to: set the encryption method of the first hotspot to WPA2 encryption; and set the number of accessible devices of the first hotspot to the system maximum value.
[0302] In some implementations, the execution module 1430 is configured to: determine whether there is a STA device currently connected to the terminal device; if there is no STA device currently connected to the terminal device, reconfigure the third hotspot as the first hotspot; or, if there is a STA device currently connected to the terminal device, determine the frequency band supported by the STA device connected to the terminal device; if all STA devices connected to the terminal device support the 5G frequency band, reconfigure the third hotspot as the first hotspot.
[0303] In some implementations, the terminal device further includes an explicit module, which is used to: if there is a device that does not support the 5G frequency band among the STA devices currently connected to the terminal device, or if there is a device that is uncertain whether it supports the 5G frequency band, then display a first prompt message on the terminal device. The first prompt message is used to prompt the user whether to reconfigure the third hotspot as the first hotspot.
[0304] In some implementations, if the terminal device does not support DBDC, and the first operation occurs before the second operation, and after receiving the first operation and before receiving the second operation, the execution module 1430 is configured to: configure the first hotspot on the 5G channel in response to the first operation; the terminal device further includes an explicit module, which is configured to: after receiving the second operation, in response to the second operation, if the encryption method of the first hotspot is not WPA2 encryption, display a second prompt message on the terminal device, the second prompt message being used to prompt the user to change the encryption method of the first hotspot to WPA2 encryption.
[0305] In some implementations, if the terminal device does not support DBDC and the second operation occurs before the first operation, the execution module 1430 is further configured to: upon receiving the second operation, establish a P2P connection with the GC device in response to the second operation; upon receiving the first operation, disconnect the P2P connection with the GC device; upon receiving the first operation, configure the first hotspot on the first channel in response to the first operation; receive a P2P access request sent by the GC device on the first channel; and send a P2P access response to the GC device on the first channel.
[0306] In some implementations, the terminal device further includes a sending module, configured to: after configuring the first hotspot on the first channel, send the information of the first hotspot to the GC device through a trust loop.
[0307] In some implementations, the execution module 1430 is configured to: if the user-configured hotspot information is 5G hotspot information, configure the first hotspot on the first channel according to the user-configured hotspot information; the terminal device further includes an explicit module, which is configured to: if the user-configured hotspot information is 2.4G hotspot information, display a third prompt message on the terminal device, the third prompt message being used to prompt the user to configure the hotspot in the 5G frequency band.
[0308] In some implementations, the terminal device further includes an explicit module, which is used to: display a fourth prompt message on the terminal device if the encryption method in the user-configured hotspot information is not WPA2 encryption, the fourth prompt message being used to prompt the user to set the encryption method of the hotspot to WPA2 encryption; and / or display a fifth prompt message on the terminal device if the number of accessible devices in the user-configured hotspot information is 1, the fifth prompt message being used to prompt the user to set the number of accessible devices to a value greater than 1.
[0309] In some implementations, the terminal device further includes a counting module and an explicit module. The counting module is used to: count the number of STA devices and the number of GC devices connected to the terminal device if the terminal device does not support DBDC; the explicit module is used to: display a third prompt message on the terminal device if there are devices that cannot be connected to the terminal device due to quantity limitations, the third prompt message being used to prompt the user to modify the number of connectable devices.
[0310] In some implementations, if the terminal device supports DBDC and the first operation precedes the second operation, the execution module 1430 is configured to: in response to the first operation, configure the second hotspot on the second channel; if the second channel is a 5G channel, in response to the second operation, establish a P2P connection on the second channel, wherein the second channel and the third channel are the same channel; if the second channel is a 2.4G channel, in response to the second operation, establish a P2P connection on the third channel, wherein the third channel is a 5G channel.
[0311] In some implementations, if the terminal device supports DBDC and the second operation precedes the first operation, the execution module 1430 is configured to: establish a P2P connection on the third channel in response to the second operation; if the third channel is a 5G channel, configure the second hotspot on the third channel in response to the first operation, wherein the third channel and the second channel are the same channel; if the third channel is a 2.4G channel, configure the second hotspot on the second channel in response to the first operation, wherein the second channel is a 5G channel.
[0312] Figure 15 is a schematic structural diagram of the apparatus according to an embodiment of this application. The dashed lines in Figure 15 indicate that the unit or module is optional. The apparatus 1500 can be used to implement the methods described in the above method embodiments. The apparatus 1500 can be a chip or a terminal device.
[0313] Apparatus 1500 may include one or more processors 1510. The processor 1510 may support apparatus 1500 in implementing the methods described in the preceding method embodiments. The processor 1510 may be a general-purpose processor or a special-purpose processor. For example, the processor may be a central processing unit (CPU). Alternatively, the processor may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0314] The apparatus 1500 may further include one or more memories 1520. The memories 1520 store a program that can be executed by the processor 1510, causing the processor 1510 to perform the methods described in the preceding method embodiments. The memories 1520 may be independent of the processor 1510 or integrated into the processor 1510.
[0315] The device 1500 may also include a transceiver 1530. The processor 1510 can communicate with other devices or chips via the transceiver 1530. For example, the processor 1510 can send and receive data with other devices or chips via the transceiver 1530.
[0316] This application also provides a chip including a processor, which is used to read and execute a computer program stored in a memory to perform the method of hotspot and P2P connection coexistence described in any of the above embodiments.
[0317] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the method for coexistence of hotspots and P2P connections as described in any of the above embodiments.
[0318] This application also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to achieve the method of coexistence of hotspots and P2P connections as described in the above embodiments.
[0319] In this embodiment, the terminal device, computer-readable storage medium, computer program product or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0320] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units. The replaced units may or may not be physically separate. The component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0321] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0322] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0323] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0324] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for coexistence of hotspot and peer-to-peer (P2P) connections, characterized in that, The method is applied to a terminal device and includes: The system receives a first user input, which is used to turn on a hotspot. The second operation, which receives user input, is used to establish a P2P connection. In response to the first operation and the second operation, perform the following operations: If the terminal device does not support dual-band concurrent DBDC, then the first hotspot is configured on the first channel, and the first channel is reused to establish a P2P connection. The first channel is a 5G channel. If the terminal device supports DBDC, a second hotspot is configured on the second channel and a P2P connection is established on the third channel, wherein the second channel and the third channel are the same channel or different channels.
2. The method according to claim 1, characterized in that, If the terminal device does not support DBDC, and the first operation precedes the second operation, the method further includes: After receiving the first operation and before receiving the second operation, in response to the first operation, a third hotspot is configured on the 2.4G channel; The configuration of the first hotspot on the first channel includes: Upon receiving the second operation, in response to the second operation, the third hotspot is reconfigured as the first hotspot.
3. The method according to claim 2, characterized in that, The step of reconfiguring the third hotspot as the first hotspot includes: Set the encryption method of the first hotspot to WPA2 encryption. Set the number of accessible devices for the first hotspot to a value greater than 1.
4. The method according to claim 2 or 3, characterized in that, The step of reconfiguring the third hotspot as the first hotspot includes: Determine if there is a site STA device currently connected to the terminal device; If there is currently no STA device connected to the terminal device, then the third hotspot will be reconfigured as the first hotspot; or, If there is a STA device currently connected to the terminal device, then determine the frequency band supported by the STA device connected to the terminal device; If all STA devices connected to the terminal device support the 5G frequency band, then the third hotspot will be reconfigured as the first hotspot.
5. The method according to claim 4, characterized in that, The method further includes: If any of the STA devices currently connected to the terminal device does not support the 5G frequency band, or if it is uncertain whether the device supports the 5G frequency band, a first prompt message will be displayed on the terminal device. The first prompt message is used to prompt the user whether to reconfigure the third hotspot as the first hotspot.
6. The method according to claim 1, characterized in that, If the terminal device does not support DBDC, and the first operation precedes the second operation, the method further includes: After receiving the first operation and before receiving the second operation, in response to the first operation, the first hotspot is configured on the 5G channel; Upon receiving the second operation, in response to the second operation, if the encryption method of the first hotspot is not WPA2 encryption, a second prompt message is displayed on the terminal device. The second prompt message is used to prompt the user to change the encryption method of the first hotspot to WPA2 encryption.
7. The method according to claim 1, characterized in that, If the terminal device does not support DBDC, and the second operation occurs before the first operation, the method further includes: Upon receiving the second operation, in response to the second operation, a P2P connection is established with the group member GC device; Upon receiving the first operation, the P2P connection with the GC device is disconnected; The configuration of the first hotspot on the first channel includes: After receiving the first operation, in response to the first operation, the first hotspot is configured on the first channel; The process of establishing a P2P connection by multiplexing the first channel includes: The first channel receives the P2P access request sent by the GC device; Send a P2P access response to the GC device via the first channel.
8. The method according to claim 7, characterized in that, The method further includes: After configuring the first hotspot on the first channel, the information of the first hotspot is sent to the GC device through the trust loop.
9. The method according to claim 7 or 8, characterized in that, Configuring the first hotspot in the first channel includes: If the user-configured hotspot information is 5G hotspot information, then the first hotspot is configured on the first channel according to the user-configured hotspot information; If the user-configured hotspot information is 2.4G hotspot information, then the method further includes: A third prompt message is displayed on the terminal device, which prompts the user to configure the hotspot on the 5G band.
10. The method according to claim 9, characterized in that, The method further includes: If the encryption method configured in the user's hotspot information is not WPA2, a fourth prompt message will be displayed on the terminal device. This fourth prompt message will prompt the user to set the hotspot's encryption method to WPA2; and / or If the number of accessible devices in the user-configured hotspot information is 1, a fifth prompt message will be displayed on the terminal device. The fifth prompt message is used to prompt the user to set the number of accessible devices to a value greater than 1.
11. The method according to any one of claims 1-10, characterized in that, The method further includes: If the terminal device does not support DBDC, then the number of STA devices and the number of GC devices connected to the terminal device are counted respectively. If there are devices that cannot be connected to the terminal device due to quantity limitations, a sixth prompt message will be displayed on the terminal device. The sixth prompt message is used to prompt the user to modify the number of devices that can be connected.
12. The method according to claim 1, characterized in that, If the terminal device supports DBDC, and the first operation precedes the second operation, then configuring the second hotspot on the second channel and establishing a P2P connection on the third channel includes: In response to the first operation, the second hotspot is configured on the second channel; If the second channel is a 5G channel, then in response to the second operation, a P2P connection is established on the second channel, and the second channel and the third channel are the same channel; If the second channel is a 2.4G channel, then in response to the second operation, a P2P connection is established on the third channel, which is a 5G channel.
13. The method according to claim 1, characterized in that, If the terminal device supports DBDC, and the second operation precedes the first operation, then configuring the second hotspot on the second channel and establishing a P2P connection on the third channel includes: In response to the second operation, a P2P connection is established on the third channel; If the third channel is a 5G channel, then in response to the first operation, the second hotspot is configured on the third channel, wherein the third channel and the second channel are the same channel; If the third channel is a 2.4G channel, then in response to the first operation, the second hotspot is configured on the second channel, which is a 5G channel.
14. A terminal device, characterized in that, include: It includes a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the method as described in any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the method as described in any one of claims 1 to 13.
16. A computer program product, characterized in that, Includes a program that causes a computer to perform the method as described in any one of claims 1 to 13.