Service coexistence method and apparatus, electronic device, and storage medium
By determining whether electronic devices support service coexistence, and if so, establishing P2P and SoftAP services using the target available frequency bands, the conflict between P2P and SoftAP services is resolved, enabling both to run simultaneously and improving the user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2025-11-13
- Publication Date
- 2026-06-18
AI Technical Summary
In existing technologies, P2P services and SoftAP services of electronic devices conflict and cannot run simultaneously, affecting user experience.
A service coexistence method is provided, which determines whether the electronic device supports the service coexistence function, and if so, establishes P2P service and SoftAP service using the target available frequency band to ensure that both can run simultaneously.
It enables the simultaneous operation of P2P and SoftAP services, improving the user experience and avoiding frequent switching and interruptions between different services.
Smart Images

Figure CN2025134789_18062026_PF_FP_ABST
Abstract
Description
Business coexistence methods and apparatus, electronic devices, storage media
[0001] This application claims priority to Chinese Patent Application No. 202411853975.9, filed on December 13, 2024, entitled "Business Coexistence Method and Apparatus, Electronic Device, Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of communication technology, and includes, but is not limited to, a service coexistence method and apparatus, electronic equipment, and storage medium. Background Technology
[0003] With the development of technology, various electronic devices, such as mobile phones and tablets, are becoming increasingly sophisticated in terms of functionality. For example, users can use the personal hotspot function enabled by the Soft Access Point (SoftAP) service on their personal electronic devices to share their network with other nearby electronic devices, allowing them to access the internet by connecting to the hotspot. Users can also use the peer-to-peer (P2P) service to share data such as pictures and files with other nearby electronic devices without using social applications.
[0004] In related technologies, there is a conflict between the SoftAP service and the P2P service of electronic devices. That is, when users use the file transfer function of electronic devices, they need to turn off the personal hotspot function before they can proceed with the next interactive operation. Similarly, users need to turn off the file transfer function so that the hotspot function can be turned on normally to share the network. Users need to choose and operate between the two services, which affects the user experience. Summary of the Invention
[0005] A first aspect of this application provides a service coexistence method applied to a first electronic device, the method comprising:
[0006] Receive a first trigger operation, the first trigger operation is used to trigger the establishment of a first service, the first service includes a peer-to-peer (P2P) service or a soft access point (SoftAP) service;
[0007] Determine whether the first electronic device supports the service coexistence function, which includes the coexistence of the P2P service and the SoftAP service;
[0008] If the first electronic device supports the service coexistence function, the first service is established through the target available frequency band.
[0009] A second aspect of this application provides a service coexistence apparatus, comprising:
[0010] The detection module is used to receive a first trigger operation, which is used to trigger the establishment of a first service, including a peer-to-peer (P2P) service or a soft access point (SoftAP) service.
[0011] The coexistence determination module is used to determine whether the service coexistence device supports the service coexistence function, which includes the coexistence of the P2P service and the SoftAP service;
[0012] The service establishment module is used to establish the first service through the target available frequency band when the service coexistence device supports the service coexistence function.
[0013] A third aspect of this application provides a computer electronic device, including a memory and a processor. The memory stores a computer program that can run on the processor, and the processor executes the program to implement the method of this application.
[0014] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the embodiments of the present application.
[0015] In the service coexistence method, apparatus, electronic device, and storage medium provided in this application embodiment, the first electronic device receives a first trigger operation. The first trigger operation is used to trigger the establishment of a first service including P2P service or SoftAP service. The first electronic device needs to determine whether the first service can be actually established. To this end, it determines whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service. If the first electronic device supports the service coexistence function, then the first service can be created through the target available frequency band. The service established after implementation will not conflict with the existing service. P2P service and SoftAP service can run simultaneously on the first electronic device, improving the user experience. Attached Figure Description
[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.
[0017] Figure 1a is a schematic diagram of an application scenario of the service coexistence method provided in the embodiments of this application;
[0018] Figure 1b is a schematic diagram of another application scenario of the service coexistence method provided in the embodiments of this application;
[0019] Figure 2 is a schematic diagram of the software controls of the first electronic device provided in an embodiment of this application;
[0020] Figure 3 is a schematic diagram of the hardware structure of the first electronic device provided in an embodiment of this application;
[0021] Figure 4 is a flowchart illustrating a service coexistence method provided in an embodiment of this application.
[0022] Figure 5 is a schematic diagram of an application scenario where the first business is P2P business;
[0023] Figure 6 is a schematic diagram of a process where the first service is a P2P service in the service coexistence method provided in the embodiment of this application.
[0024] Figure 7 is a schematic diagram of a process for negotiating coexistence capability in the business coexistence method provided in the embodiments of this application;
[0025] Figure 8 is another schematic diagram of the process where the first service is a P2P service in the service coexistence method provided in the embodiments of this application;
[0026] Figure 9 is a schematic diagram of a process in which the second electronic device supports the service coexistence function and the available frequency band is the same as that of the first electronic device in the service coexistence method provided in the embodiments of this application.
[0027] Figure 10 is a schematic diagram of a process in which the second electronic device supports the service coexistence function and the available frequency band is different from that of the first electronic device in the service coexistence method provided in the embodiments of this application.
[0028] Figure 11 is a flowchart illustrating a scenario where the first electronic device has no available frequency band in the service coexistence method provided in this application embodiment.
[0029] Figure 12 is a flowchart illustrating a service coexistence method provided in this application where the second electronic device does not support the service coexistence function.
[0030] Figure 13 is a schematic diagram of a process where the first service is a SoftAP service in the service coexistence method provided in the embodiment of this application.
[0031] Figure 14 is a schematic diagram of a process for establishing STA service in the service coexistence method provided in the embodiments of this application;
[0032] Figure 15 is a schematic diagram of the service coexistence device provided in the embodiment of this application;
[0033] Figure 16 is a schematic diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation
[0034] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0035] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0036] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0037] It should be noted that the terms "first, second, third" used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0038] In related technologies, taking the Android system as an example, there is a conflict between P2P services and SoftAP services, preventing them from running simultaneously on the same electronic device. When a user has already started one service on an electronic device, if they need to start another service to meet different functional requirements, the electronic device may automatically close the currently running service or require the user to manually close it. This process not only requires the user to perform a series of complex manual operations but also interrupts the service they are using, impacting the user experience.
[0039] Peer-to-peer (P2P) communication is a type of computer network communication service that allows electronic devices to communicate directly with each other without the need for servers or other intermediary electronic devices. P2P technology is widely used in file sharing, online games, and real-time communication. In P2P technology, each electronic device is both a client and a server. Electronic devices can communicate directly with each other without being restricted by intermediary electronic devices. Because it allows communication between electronic devices without a server, P2P technology is often called serverless technology. Taking the Android system as an example, to implement P2P technology, Android applications can use Wi-Fi Direct technology. Wi-Fi Direct technology allows electronic devices to communicate directly with each other without a network connection. Within a local area network, Wi-Fi Direct technology can establish a direct connection between electronic devices through Wi-Fi. One common P2P service is the file transfer function between mobile phones or tablets, enabling fast and convenient transmission of data such as pictures and files, suitable for environments with no network coverage, unstable network connections, or where users do not want to rely on social applications.
[0040] Soft Access Point (SoftAP) service is also a computer network communication service. By simulating a wireless access point, electronic devices can create a Wi-Fi network even without a physical router, allowing other electronic devices to connect and share internet access. SoftAP has a wide range of applications, including but not limited to: providing internet access in areas without Wi-Fi coverage; serving as a temporary network solution for multiple users to share a network connection; and supplementing home or small office networks. For example, in the Android system, a common SoftAP service is the personal hotspot function of mobile phones or tablets, which can provide network sharing for nearby electronic devices.
[0041] In addition to the P2P and SoftAP services mentioned above, another important communication service exists in electronic devices: Station (STA) service, also known as STA mode or client mode. When the STA service of an electronic device is enabled, the device can connect to a wireless network and act as a client, accessing a local area network (LAN) or the Internet through a wireless access point (AP).
[0042] Since STA, P2P, and SoftAP services all consume radio resources when enabled, and their simultaneous operation can lead to frequency band and channel contention, affecting performance and stability, related technologies design P2P and SoftAP services as mutually exclusive modes to ensure the stable operation of STA services. This means that only one service can run at a time. While this design ensures a smooth STA experience, it also limits the user's ability to use P2P and SoftAP services simultaneously, thus impacting the user experience.
[0043] Taking the Android system as an example, traditional Android-based electronic devices do not support the coexistence (concurrent operation) of P2P services and SoftAP services.
[0044] In some cases, traditional electronic devices do not allow users to simultaneously enable controls for both P2P and SoftAP services (which can be understood as function switches displayed on the screen). For example, if a user has already enabled the SoftAP service control (which could correspond to the personal hotspot function) on the electronic device, and then clicks the P2P service control (which could also correspond to the personal hotspot function), the electronic device will forcibly close the already enabled SoftAP service, displaying the SoftAP service control as closed, and then re-enable the P2P service. Alternatively, it may output a conflict warning message, allowing the user to manually close the SoftAP service control before enabling the P2P service control.
[0045] In another scenario, existing electronic devices allow both P2P and SoftAP service controls to be displayed as active simultaneously. However, when actual data transmission occurs, one of the P2P or SoftAP services needs to be forcibly disabled, impacting the user experience. In practice, this can be determined by user selection or a preset priority, and is not limited here.
[0046] In view of this, to enable P2P services and SoftAP services to coexist in electronic devices and improve user experience, this application provides a service coexistence method. This method, upon receiving a user-triggered operation to establish a P2P service or SoftAP service, determines whether the electronic device supports service coexistence. If supported, it establishes the service through a target available frequency band, allowing P2P and SoftAP services to run simultaneously without interruption, thus improving user experience.
[0047] The following describes the actual scenarios in which the service coexistence method provided in the embodiments of this application is applied.
[0048] Please refer to Figure 1a. Figure 1a is a schematic diagram of an application scenario of the business coexistence method provided in the embodiment of this application. As shown in Figure 1a, the display screen of the first electronic device 100 displays a personal hotspot control 101, a mutual transmission control 102, and multiple functional controls.
[0049] Multiple function controls may include, but are not limited to, Wireless Local Area Network (WLAN) setting controls, mobile network setting controls, brightness setting controls, volume setting controls, Bluetooth controls, flashlight controls, Near Field Communication (NFC) controls, airplane mode controls, timer controls, and do-not-disturb controls. Users can trigger operations such as clicking or long-pressing each function control to use its corresponding function; this is not limited to specific actions. For example, a user can click the flashlight control to control the flashlight's operating state set in the first electronic device, thereby providing illumination when needed.
[0050] It should be noted that electronic devices can reflect the working status of their corresponding functions to the user by changing the display style of their function controls. The display style can include, but is not limited to, the color of the function control, background image, control shape, and text content. For example, an electronic device can use the color and text content of function controls to indicate the status of their corresponding functions to the user. As shown in Figure 1a, the first electronic device 100 can use the colors and text content corresponding to each function control to indicate the working status of that function to the user. As shown in Figure 1a, the first electronic device 100 uses dark or light colors for each function control to indicate whether the function is on or off; dark colors represent the function being on, and light colors represent the function being off. In practical applications, multiple colors can be set as needed to further refine the working status of functions, so that users can more intuitively understand the usage of each function.
[0051] For example, in Figure 1a, the personal hotspot function corresponding to the personal hotspot control 101 is in the enabled state and connected to one device, meaning the SoftAP service has been established and is in the enabled state. However, the mutual transfer function corresponding to the mutual transfer control 102 is in the disabled state, meaning the P2P service has not been established. Users can enable the mutual transfer function by clicking or other triggering operations on the mutual transfer control 102. Once enabled, the first electronic device 100 can establish a P2P connection with other electronic devices (such as the second electronic device) according to the service coexistence method provided in this application, thereby realizing the sharing of data such as pictures and files, without affecting the use of the personal hotspot function of the first electronic device 100.
[0052] Please refer to Figure 1b, which is a schematic diagram of another application scenario of the business coexistence method provided in the embodiment of this application. As shown in Figure 1b, the display screen of the first electronic device 100 displays a personal hotspot control 101, a data transfer control 102, and multiple functional controls.
[0053] For example, in Figure 1b, the file transfer function corresponding to the file transfer control 102 is enabled, while the personal hotspot function corresponding to the personal hotspot control 101 is disabled. Users can trigger the first electronic device 100 to enable its personal hotspot function (i.e., establish a SoftAP service) according to the service coexistence method provided in this application by clicking or performing other actions on the personal hotspot control 101, allowing network sharing with other devices without affecting the file transfer function of the first electronic device 100. After the personal hotspot function is enabled, users can configure other electronic devices that the first electronic device 100 needs to share the network with, as needed; this is not limited here.
[0054] It should be noted that the application scenarios of the business coexistence method shown in Figure 1a or Figure 1b and the interface displayed on the screen of the first electronic device are only examples. In actual applications, the interface layout, control display style and corresponding text content can be set as needed, which will not be listed here.
[0055] As can be seen from the above scenario, in order to ensure that the first electronic device can run P2P service and SoftAP service simultaneously, the first electronic device determines whether the user needs to establish P2P service or SoftAP service, and then processes it according to the service coexistence method provided in this application, so that the P2P service and SoftAP service of the electronic device can be carried out at the same time without interrupting each other, thereby improving the user experience.
[0056] The software controls of the first electronic device that apply the service coexistence method provided in this application are described below with reference to the accompanying drawings.
[0057] Please refer to Figure 2, which is a schematic diagram of the software controls of the first electronic device provided in the embodiment of this application. As shown in Figure 2, the software framework of the first electronic device may include an application layer 201, an application framework layer 202, a system layer 203, and a kernel layer 204. The layers communicate with each other through a software interface.
[0058] Application layer 201 may include a series of application packages. As shown in Figure 2, the application package may include the personal hotspot (corresponding to SoftAP service) and the mutual transmission (corresponding to P2P service) provided in this application for implementing service coexistence. The application package may also include applications such as Bluetooth, communication, navigation, video, and music.
[0059] In this embodiment, since the first electronic device needs to receive trigger operations to establish the service corresponding to the trigger operation, the application layer 201 of the first electronic device may also include applications such as a desktop launcher and a system application interface (systemUI) to realize user interaction and function display-related operations. Furthermore, the application or service names in the hierarchy shown in Figure 2 are only examples; for instance, the "Share" application could also be named "Quick Share." No restrictions are placed on the names of applications or services in the software framework.
[0060] Application Framework Layer 202 provides application programming interfaces (APIs) and programming frameworks for applications in Application Layer 201. This can include a window manager, content provider, phone manager, resource manager, notification manager, view system, and WiFi framework. The window manager manages window programs. Specifically, it can obtain screen size, determine the presence of a status bar, lock the screen, and capture the screen. The content provider stores and retrieves data, making this data accessible to applications. Data can include video, images, audio, made and received calls, browsing history and bookmarks, and phonebook entries. The phone manager provides communication functions for the primary electronic device, such as managing call status (including connection and disconnection). The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, and video files. The notification manager allows applications to display notifications in the status bar, conveying informational messages that can disappear automatically after a short pause without user interaction. For example, the notification manager can be used to notify of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the system's top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights. The view system includes visual controls, such as controls for displaying text and controls for displaying images. The view system can be used to build applications. The display interface can consist of one or more views. For example, a display interface including a text notification icon can include views for displaying text and views for displaying images.
[0061] The P2P service and SoftAP service involved in the method provided in this application are both communication services. Information such as the service status and frequency band used by the first electronic device can be obtained through the WiFi framework included in the application framework layer 202, which is not limited here.
[0062] System layer 203 may include a surface manager, a 2D graphics engine, an image processing library, a 3D graphics processing library, a media library, and the Android Runtime module. The Android Runtime module includes core libraries and a virtual machine, responsible for system scheduling and management. Application layer 201 and application framework layer 202 run within the virtual machine. The virtual machine executes the programming files of application layer 201 and application framework layer 202 into binary files and performs management functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of various common audio and video formats, as well as still image files. The media library supports various audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.
[0063] Kernel layer 204 is the layer between hardware and software. Kernel layer 204 can contain display drivers, sensor drivers, and audio drivers.
[0064] The above provides an example of the software architecture of a first electronic device.
[0065] It should be noted that, in this embodiment, the first electronic device can establish communication connections with other electronic devices. For example, the first electronic device can transmit data with other electronic devices by establishing a P2P service, or share the network with other electronic devices by establishing a SoftAP service. The software architecture of the other electronic devices communicating with the first electronic device can be the same as that of the first electronic device, and will not be elaborated here. The layers in the software structure shown in Figure 2 and the components contained in each layer do not constitute a specific limitation on the first electronic device. In other embodiments, the first electronic device may include more layers than shown in the figure. Each layer may include more or fewer components than shown in the figure. Furthermore, the various functional modules described above may also be combined into a single functional module, and a functional module may also consist of multiple functional modules.
[0066] Through the above software architecture, the first electronic device can enable P2P and SoftAP services to run simultaneously when the user triggers the establishment of P2P or SoftAP services, thereby improving the user experience.
[0067] After introducing the software architecture of the first electronic device, in order to provide a more comprehensive overview of its structure, we will now introduce its hardware structure.
[0068] Please refer to Figure 3, which is a schematic diagram of the hardware structure of the first electronic device provided in the embodiment of this application.
[0069] It should be noted that the first electronic device can be a mobile phone, tablet computer, virtual reality (VR) electronic device, augmented reality (AR) electronic device, electronic device in industrial control, electronic device in self-driving, electronic device in remote medical care, electronic device in smart grid, electronic device in transportation safety, electronic device in smart city, electronic device in smart home, etc. As shown in Figure 3, the first electronic device may include components such as processor 310, memory 320, transceiver 330, display unit 340, and input unit 350.
[0070] The processor 310 is the control center of the first electronic device. It connects various parts of the first electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 320, and by calling data stored in the memory 320, it performs various functions and processes data of the first electronic device, thereby providing overall monitoring of the first electronic device. Optionally, the processor 310 may include one or more processing units; optionally, the processor 310 may integrate an application processor, which mainly handles operating devices, user interfaces, and application programs, etc. Of course, it may also include other processors, which are not limited here.
[0071] The memory 320 can be used to store software programs and modules. The processor 310 executes various functional applications and data processing of the first electronic device by running the software programs and modules stored in the memory 320. The memory 320 mainly includes a program storage area and a data storage area. The program storage area can store the operating device and application programs required for at least one function (such as sound playback function, image playback function, etc.). The data storage area can store data created according to the use of the first electronic device (such as audio data, telephone book, etc.). In addition, the memory 320 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0072] Transceiver 330 can provide solutions for wireless communication applications in a first electronic device, including wireless local area networks (WLANs), such as wireless fidelity (WiFi) networks, Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. Transceiver 330 can be one or more devices integrating at least one communication processing module; for example, it can integrate an antenna with a baseband processor, or it can integrate an antenna with a modem processor, etc., without limitation.
[0073] The display unit 340 can be used to display information input by the user or information provided to the user, as well as various menus of the first electronic device. The display unit 340 can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like, and is not limited thereto.
[0074] The input unit 350 can be used to receive input digital or character information and generate signal inputs related to user settings and function control of the first electronic device. The input unit 350 can collect user operations on or near it and drive corresponding connected devices according to a pre-set program. Furthermore, the input unit 350 may include a touch panel, which can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave touch panels. In addition to the touch panel, the input unit 350 may also include other input devices. These other input devices may include, but are not limited to, one or more of the following: function keys (such as volume control buttons, power buttons, etc.), trackballs, joysticks, etc.
[0075] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the first electronic device. In other embodiments of this application, the first electronic device 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.
[0076] To address the shortcomings of the aforementioned related technologies, this application provides a business coexistence method. The specific implementation process of the application startup method will be described in detail below.
[0077] Please refer to Figure 4, which is a flowchart illustrating a service coexistence method provided in an embodiment of this application. This method is applied to a first electronic device, and as shown in Figure 4, it may include the following steps:
[0078] S401, Receive the first trigger operation, the first trigger operation is used to trigger the establishment of the first service, the first service includes point-to-point P2P service or soft access point (SoftAP) service.
[0079] It should be noted that P2P and SoftAP services are computer network communication services. P2P services enable direct communication between the first electronic device and other electronic devices without the need for a server or other intermediary electronic devices. This application uses file transfer as an example for explanation. In practical applications, P2P services can also correspond to real-time communication between the first electronic device and other electronic devices, online games (establishing connections directly between devices without going through a server), etc., which will not be elaborated further here. SoftAP services simulate a wireless access point. Even without a physical router, the first electronic device can create a Wi-Fi network for other electronic devices to connect to and share internet access. This application uses a personal hotspot function as an example for explanation.
[0080] In this embodiment of the application, the first electronic device first receives a first trigger operation on itself, which may be a trigger operation on the business control corresponding to the first business displayed on the display screen of the first electronic device.
[0081] For example, when the first service is a P2P service, the service control corresponding to the first service can be a data transfer control (also known as a P2P service control), and receiving the first trigger operation includes receiving a first trigger operation on the data transfer control (P2P service control). Receiving the first trigger operation can be performed when the SoftAP service is enabled (as shown in the scenario of Figure 1a) or when the SoftAP service is disabled; this is not limited here.
[0082] When the first service is a SoftAP service, the service control corresponding to the first service can be a personal hotspot control (also known as a SoftAP service control). Receiving the first trigger operation includes receiving the first trigger operation on the personal hotspot control (SoftAP service control). Receiving the first trigger operation can be performed when the SoftAP service is enabled (as shown in the scenario of Figure 1a) or when the SoftAP service is disabled; this is not limited here.
[0083] It is understandable that, since P2P services mainly involve data transmission between different electronic devices, in some possible embodiments, receiving the first trigger operation may include receiving the first trigger operation of the target mutual transfer control corresponding to the target object. The target object may be a target image, target video, or target file. Please refer to Figure 5, which is a schematic diagram of an application scenario where the first service is a P2P service. In the embodiment shown in Figure 5, the target object is a target image. The interface shown in part 5(1) is a schematic diagram of an interface of the album application of the first electronic device. The target image control 501 is the image control corresponding to "image 2" selected by the user. After the user triggers the target image control 501, the first electronic device switches to displaying the interface shown in part 5(2). After the user triggers the sharing control 502, the interface shown in part 5(3) is displayed. After the user triggers the mutual transfer control 503, the interface shown in part 5(4) is displayed. The user can trigger the target mutual transfer control 504 to determine the electronic device (device 2) to which the target object (image 2) is to be shared. In this way, after the user selects a series of objects and functions, the first electronic device receives the first trigger operation of the target communication control corresponding to the target object.
[0084] The application scenario diagram shown in Figure 5 is only an example. In actual applications, it can also be used to trigger the first operation for establishing the first service by triggering the controls associated with the first service in different interfaces displayed by different applications of the first electronic device. For example, the sharing function implemented by different applications based on P2P service or SoftAP service will not be listed here.
[0085] S402, determine whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service.
[0086] It should be noted that in the service coexistence method provided in this application, the function of the first operation received is to trigger the establishment of the first service, that is, the user attempts to establish the first service on the first electronic device. However, at this time, the first service has not yet been successfully established. It is still necessary to further determine whether the first electronic device supports the service coexistence capability. Only after confirming that the first electronic device supports the service coexistence function will the subsequent steps of establishing and running the first service continue.
[0087] In this embodiment of the application, the service coexistence capability includes the coexistence of P2P services and SoftAP services, that is, under certain circumstances, P2P services and SoftAP services in the first electronic device can run simultaneously.
[0088] In some possible embodiments, given that STA service is an important service in electronic device communication, the service coexistence capability includes the coexistence of P2P service, SoftAP service and STA service, that is, in some cases, P2P service and SoftAP service in the first electronic device can run simultaneously.
[0089] To determine whether a first electronic device supports service coexistence, the service coexistence method provided in this application can be implemented in various ways. For example, the corresponding identification information can be obtained by querying the system information or configuration file provided by the first electronic device to determine whether the first electronic device supports service coexistence. Alternatively, the system log of the device can be analyzed to query entries related to service coexistence in the historical system update records of the first electronic device to determine whether the device supports service coexistence; this is not limited to any particular method.
[0090] For example, in some possible embodiments, determining whether the first electronic device supports service coexistence includes:
[0091] Obtain the first identification information corresponding to the first electronic device. The first identification information is used to indicate whether the first electronic device supports the service coexistence function.
[0092] If the value of the first identification information is a preset value, it is determined that the first electronic device supports the service coexistence function.
[0093] It should be noted that the first identification information can be one or more Arabic numerals (such as 0, 1, 2, etc.), letters (such as a, b, c, etc.), or codes composed of numbers and letters, etc., used to indicate whether the first electronic device supports service coexistence capability. In this application, the format or content of the first identification information is not limited. When the value of the first identification information is a preset value, for example, both the first identification information and the preset value are "1" or "supported," it indicates that the first electronic device supports service coexistence functionality, and subsequent processes can be executed to establish the first service. In this way, the first electronic device can determine whether it supports service coexistence capability with only a small amount of computing resources.
[0094] In some possible embodiments, the first identification information can be obtained from a preset storage area of the first electronic device. The preset storage area can be a protected area in the same storage location as system data, pre-installed application data, and user data. For example, when a first electronic device that originally did not support service coexistence is changed to support service coexistence through a firmware upgrade, the first identification information can be obtained from the firmware version information stored in this protected area. Therefore, besides the first electronic device being set to support service coexistence at the factory, it can also support service coexistence through a later update, modifying the value of the first identification information stored in the device to a preset value.
[0095] In some possible embodiments, the first identification information can be obtained through the coexistence capability interface provided by the WiFi framework. The WiFi framework refers to the module in the system of the first electronic device responsible for managing WiFi connections and communications, providing a series of APIs and interfaces that enable applications to interact with the WiFi hardware of the first electronic device. It should be noted that if the first electronic device supports service coexistence functionality, the WiFi framework of the first electronic device includes a coexistence capability interface.
[0096] In some possible embodiments, if the value of the first identification information is not a preset value, or if the first identification information corresponding to the first electronic device does not exist, it is determined that the first electronic device does not support the service coexistence function. The traditional service establishment process can be followed, i.e., only one of the P2P service or the SoftAP service is allowed to run, which will not be elaborated further here. By setting a coexistence capability interface, the first identification information can be obtained by calling this interface.
[0097] S403, if the first electronic device supports the service coexistence function, establish the first service through the target available frequency band.
[0098] In this embodiment, the establishment and operation of P2P and SoftAP services require certain frequency band resources. If it is determined that the first electronic device supports service coexistence, the first electronic device can establish the first service through the target available frequency band.
[0099] For example, in the case where the first service is a P2P service, the first electronic device establishes the first service through the target available frequency band. This can be understood as a data transmission channel between the first electronic device and other electronic devices. The frequency band of this data transmission channel is the target available frequency band, thereby enabling the first electronic device to exchange data with other electronic devices through this data transmission channel.
[0100] For example, when the first service is a SofAP service, the first electronic device establishing the first service through the target available frequency band can be understood as the first electronic device activating the SofAP service corresponding to the target available frequency band, so that other electronic devices can share the network resources of the first electronic device in that target available frequency band. For example, if the SoftAP service is a hotspot service, the first electronic device establishing the first service through the target available frequency band can be understood as the first electronic device activating a hotspot, and the frequency band of the network resources corresponding to the hotspot is the target available frequency band.
[0101] It's important to note that in this field, a frequency band refers to a specific range of frequencies used for wireless communication. These frequencies are used to transmit data, such as for mobile phone calls and wireless network connections. Different frequency bands have different characteristics, such as transmission distance, penetration power (how many obstacles it can pass through), and bandwidth (the rate at which data is transmitted). Each frequency band is further divided into multiple channels, which are subdivisions of the frequency. For example, the 2.4 GHz band typically has multiple channels, each with a center frequency 5 MHz apart and a channel width of 20 MHz. In the 5 GHz band, there are even more channels, and each channel has a wider bandwidth. Different countries and regions have different regulations regarding the use of wireless communication frequency bands. For example, some frequency bands may only be permitted for specific users or services; examples are not listed here.
[0102] In some possible embodiments, the target available frequency band can be a pre-set frequency band. By reserving the frequency band, a target available frequency band is provided that can establish a service without conflicting with the already running service when the first electronic device needs to establish a first service.
[0103] In some possible embodiments, when the first electronic device supports service coexistence, establishing a first service through a target available frequency band may include: establishing a first service through a target available frequency band and a target available channel, wherein the target available channel is a channel contained in the target available frequency band.
[0104] It should be noted that, in the case of the first service being a P2P service or a SoftAP service, the preset target available frequency bands can be the same or different, and no limitation is made here.
[0105] In the service coexistence method provided in this application embodiment, a first electronic device receives a first trigger operation to trigger the establishment of a first service including P2P service or SoftAP service. The first electronic device needs to determine whether the first service can be actually established. This can be done by determining whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service. If the first electronic device supports the service coexistence function, then the first service can be created through the target available frequency band. The first service established after implementation will not conflict with existing services. That is, P2P service and SoftAP service can run simultaneously on the first electronic device, so that users can use functions such as file transfer and personal hotspot at the same time without having to select and close some functions. This improves the user experience of using the first electronic device and provides flexibility and convenience in using P2P service and SoftAP service.
[0106] The following example, taking the first service as a P2P service, illustrates how the service coexistence method provided in this application establishes a P2P service through a target available frequency band when it is determined that the first electronic device supports the service coexistence function.
[0107] Please refer to Figure 6. Figure 6 is a flowchart illustrating a service coexistence method provided in this application embodiment where the first service is a P2P service. This method is applied to a first electronic device, and as shown in Figure 6, it may include the following steps:
[0108] S601, Receive the first trigger operation, the first trigger operation is used to trigger the establishment of the first service, the first service is a peer-to-peer (P2P) service.
[0109] In some embodiments, the first service is a P2P service. The first triggering operation can be as shown in Figure 1a, where the user triggers a data transfer control to transmit data to a pre-defined electronic device. The first triggering operation is also shown in Figure 5, where the user, after a series of operations, initially triggers the target data transfer control to send the selected data to the designated device. For ease of understanding, the electronic device that triggers the establishment of the P2P service with the first electronic device is referred to as the second electronic device.
[0110] S602, determine whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service.
[0111] S603, obtain the available frequency bands of the first electronic device and the available frequency bands of the second electronic device.
[0112] In some possible embodiments, the first service is a peer-to-peer (P2P) service between a first electronic device and a second electronic device. The available frequency band corresponding to the first electronic device can be a preset available frequency band within the first electronic device. Alternatively, the available frequency band of the first electronic device can be obtained from a protected area in the same storage location as system data, pre-installed application data, and user data, similar to obtaining the first identification information in S402. Alternatively, spectrum sensing technology can be used to detect whether each frequency band is occupied, thereby finding available wireless spectrum resources. The first electronic device can be either a transmitter or a receiver for the P2P service.
[0113] Furthermore, if the first electronic device supports service coexistence capability, the first electronic device can also obtain the available frequency band of the first electronic device through the coexistence capability interface provided by the WiFi framework in the first electronic device system, without any limitation.
[0114] The method by which the second electronic device obtains its own available frequency bands can be the same as that of the first electronic device, and will not be elaborated here. It is understandable that, if the second electronic device also supports service coexistence, it can also obtain its available frequency bands through the coexistence capability interface provided by the WiFi framework within its system.
[0115] In some possible embodiments, the first electronic device can obtain the available frequency band of the second electronic device through a BLE connection that occupies less frequency band resources.
[0116] Before the first electronic device can actually use the P2P service to transmit data with the second electronic device, it needs to negotiate roles, frequency bands, channels, etc., and then determine whether the P2P service and SoftAP in the first electronic device can actually coexist (even if the first electronic device supports service coexistence, in some cases, such as when frequency band resources are occupied, the P2P service and SoftAP still cannot run simultaneously). Therefore, when the first service is a P2P service, the establishment of the P2P service can be divided into two stages: negotiating coexistence capability and determining whether coexistence is possible. Obtaining the available frequency band for the second electronic device is achieved during the coexistence capability negotiation stage.
[0117] S604, if the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
[0118] It is understandable that if the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the two devices can communicate on this frequency band, thereby realizing the interconnection between the devices. In this way, the same available frequency band can be identified as the target available frequency band.
[0119] In some possible embodiments, in order to ensure smooth and efficient communication, the target available frequency band can be spectrum managed and coordinated. For example, dynamic spectrum allocation technology can be used to enable the first electronic device and the second electronic device to dynamically adjust their operating frequencies according to the current spectrum usage when they subsequently implement P2P services through the target available frequency band, so as to avoid potential interference and improve the communication quality of P2P services.
[0120] S605, when the first electronic device supports service coexistence, establishes a first service through the target available frequency band.
[0121] If the first electronic device supports service coexistence, the available frequency band of the first electronic device in S604 above can be obtained through the coexistence capability interface set in the WiFi framework of the first electronic device.
[0122] If the first electronic device supports service coexistence and the available frequency bands of the first electronic device and the second electronic device are the same, the first electronic device can establish a P2P service with the second electronic device based on the target available frequency band determined by the same frequency band, and use the P2P service to transmit data.
[0123] It should be noted that in P2P services, the electronic device acting as the data sender needs to perform multiple operations, including data selection, protocol processing, connection management, and data transmission, while the receiving end passively receives data. In this application, when the first service is a P2P service, the first electronic device can act as either the data sender or the data receiver. The data flow differs depending on whether the first electronic device acts as the sender or receiver.
[0124] In some possible embodiments, establishing a first service via a target available frequency band includes:
[0125] Send a P2P negotiation request to the second electronic device, the P2P negotiation request including the target available frequency band;
[0126] Receive the response information from the second electronic device to the P2P negotiation request, and if the response information indicates that the negotiation is successful, establish the first service through the target available frequency band.
[0127] It should be noted that in P2P services, a P2P negotiation request refers to two devices exchanging information to determine their roles (such as sender or receiver) and resources (such as frequency bands) in the P2P service. The connection process is similar to a three-way handshake, which will not be elaborated here. In this application, when the first electronic device obtains the available frequency bands of both the first and second electronic devices and determines the target available frequency band, the first electronic device is the sender in the P2P service. Therefore, the first electronic device sends a P2P protocol request containing the target available frequency band to the second electronic device, which is the receiver. Upon receiving a response from the second electronic device indicating successful negotiation, a first service (P2P service) can be established between the first electronic device and the second electronic device through the target available frequency band.
[0128] In the service coexistence method provided in this application, when the first service is a P2P service between a first electronic device and a second electronic device, the first electronic device applying the method provided in this application obtains the available frequency bands of the first electronic device and the second electronic device. When the available frequency bands of the two electronic devices are the same and the first electronic device supports the service coexistence function, the first electronic device can establish a P2P service with the second electronic device. Moreover, the P2P service can coexist with the SoftAP running on the first electronic device to improve the user experience.
[0129] The following describes how, in the embodiments of this application, when the first service is a P2P service, if the first electronic device is the sender of the P2P service and the second electronic device is the receiver of the P2P service, the first electronic device and the second electronic device should negotiate their coexistence capabilities, that is, how the first electronic device can obtain the available frequency band of the second electronic device.
[0130] Please refer to Figure 7, which is a schematic flowchart of the negotiation of coexistence capability in the service coexistence method provided in this application embodiment. As shown in Figure 7, it may include the following steps:
[0131] S701 determines the transmission data for P2P services.
[0132] In some possible embodiments, the P2P service of the first electronic device (located in the application layer of the software architecture) first determines the transmission data to be sent via the P2P service.
[0133] S702 controls the BLE module to start BLE scanning.
[0134] In some possible embodiments, the P2P service controller BLE module of the first electronic device enables BLE scanning to search for a second electronic device that also has P2P service enabled.
[0135] S703, enable the file transfer control.
[0136] In some possible embodiments, the second electronic device needs to enable the inter-transmission control (also known as the P2P service control) so that the second electronic device can be scanned by the BLE module of the first electronic device.
[0137] S704, obtain the available frequency bands for the second electronic device.
[0138] In some possible embodiments, the P2P service of the second electronic device obtains the available frequency band of the second electronic device through the coexistence capability interface of the WiFi framework of the second electronic device.
[0139] S705, the available frequency band for transmitting a second electronic device.
[0140] In some possible embodiments, the WiFi framework of the second electronic device sends the available frequency bands of the second electronic device to its protocol module. It should be noted that both the first and second electronic devices use peer-to-peer (P2P) protocol modules.
[0141] S706, available frequency bands for transmitting second electronic devices.
[0142] In some possible embodiments, the protocol module of the second electronic device sends the available frequency bands of the second electronic device to the BLE module of the second electronic device.
[0143] S707 sends BEL protocol data packets, which include the available frequency bands of the second electronic device.
[0144] In some possible embodiments, the BLE module of the second electronic device sends a BEL protocol data packet to the BLE module of the first electronic device, the BEL protocol data packet including the available frequency bands of the second electronic device.
[0145] It should be noted that the BLE module of the second electronic device can add fields to the original BLE data packets to make the modified BLE data packets include the available frequency bands of the second electronic device.
[0146] S708 sends BLE protocol data packets.
[0147] In some possible embodiments, the BLE module of the first electronic device sends BLE protocol data packets to the P2P service of the first electronic device.
[0148] S709. Parse the BLE protocol data packets to obtain the available frequency bands of the second electronic device.
[0149] The BLE service of the first electronic device obtains the available frequency bands of the second electronic device by parsing the BLE protocol data packets.
[0150] It should be noted that when data is transmitted between the BLE module and the P2P service in the first electronic device in S702 and S708, the data can be transmitted one by one in the form of P2P service, WiFi framework, protocol module and BLE module, or the data can be transmitted directly between P2P service and BLE service through the interface set by the electronic device. No limitation is made here.
[0151] By implementing the above technical solution, the first electronic device and the second electronic device completed the negotiation of coexistence capability, and the first electronic device obtained the available frequency band of the second electronic device so that the first electronic device could make a subsequent judgment on whether coexistence was possible.
[0152] Please refer to Figure 8, which is another flowchart illustrating the service coexistence method provided in this application embodiment, where the first service is a P2P service. As shown in Figure 8, it may include the following steps:
[0153] S801, receive the first trigger operation, the first trigger operation is used to trigger the establishment of the first service, the first service includes peer-to-peer (P2P) service.
[0154] S802, determine whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service.
[0155] S803, obtain the available frequency bands of the first electronic device and the available frequency bands of the second electronic device.
[0156] The implementation methods of S801 to S803 are similar to those of S601 to S603, and will not be described in detail here.
[0157] S804, obtain the second identification information corresponding to the second electronic device. The second identification information is used to indicate whether the second electronic device supports the service coexistence function.
[0158] In some possible embodiments, where the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the method further includes the following before determining the same frequency band as the target available frequency band:
[0159] Obtain the second identification information corresponding to the second electronic device. The second identification information is used to indicate whether the second electronic device supports the service coexistence function.
[0160] It should be noted that the service coexistence method provided in this application, in addition to determining whether the first electronic device supports the service coexistence function, also detects whether the second service supports the service coexistence function. By detecting whether the first and second electronic devices support the service coexistence function, the frequency band coordination capability can be improved when determining the target available frequency band, and the target available frequency band that conforms to the actual situation can be determined, so as to maximize the protection against conflicts between P2P services and SoftAP services on the first and second electronic devices.
[0161] Refer to S402. The method for determining whether the second electronic device detection device itself supports the service coexistence function is similar to the method for determining whether the first electronic device detection device itself supports the service coexistence function in S402, and will not be repeated here.
[0162] For example, the second identification information can be obtained through the protocol module in the system of the second electronic device, or through the coexistence capability interface provided by the WiFi framework, without limitation.
[0163] In some possible implementations, where the second identification information is obtained through a protocol module in the system of the second electronic device, step S706, where the protocol module of the second electronic device sends the available frequency band of the second electronic device to the BLE module, further includes sending the second identification information to the BLE module. Thus, the BLE data packet sent by the second electronic device in S707 also includes the second identification information, and in S709, the P2P service of the first electronic device can obtain the available frequency band and the second identification information of the second electronic device when parsing the BLE protocol data packet.
[0164] S805, if the second identification information indicates that the second electronic device supports the service coexistence function and the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
[0165] In some possible embodiments, when the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, determining the same frequency band as the target available frequency band includes:
[0166] If the second identification information indicates that the second electronic device supports the service coexistence function and the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
[0167] It should be noted that the first electronic device may have more than one available frequency band, and the second electronic device may have more than one available frequency band. If the available frequency bands of the two devices overlap, then the common frequency band is determined as the target available frequency band.
[0168] S806, when the first electronic device supports service coexistence, establishes the first service through the target available frequency band.
[0169] If both the first electronic device and the second electronic device support service coexistence, and the available frequency bands of the first electronic device and the second electronic device are the same, then the first electronic device can send a P2P negotiation request containing the target available frequency band to the second electronic device. If the response information from the second electronic device to the P2P negotiation request indicates that the negotiation is successful, the first service can be established through the target available frequency band without conflicting with the SoftAP service that may be running on the first electronic device, thus improving the user experience.
[0170] By implementing the above technical solution, when the available frequency bands of the first electronic device and the second electronic device, which also applies the service coexistence method provided in this application, are the same, the first electronic device can establish a P2P service with the second electronic device, providing users with a more convenient and efficient mutual transmission function and improving the user experience.
[0171] It is understandable that, when the first electronic device supports the service coexistence function, by combining whether the second electronic device supports the service coexistence function and whether the available frequency bands of the first electronic device and the second electronic device are the same, we can obtain that there may be a variety of situations when the first electronic device establishes a P2P service. The following will explain the various situations with reference to the attached figures.
[0172] Please refer to Figure 9. Figure 9 is a flowchart illustrating a service coexistence method provided in this application where the second electronic device supports service coexistence functionality and its available frequency band is the same as that of the first electronic device. As shown in Figure 9, in some possible embodiments, when the first electronic device supports service coexistence functionality, establishing the first service through the target available frequency band may include the following steps:
[0173] S901, obtain available frequency bands and second identification information.
[0174] It should be noted that the available frequency bands include the available frequency bands of both the first and second electronic devices. The first electronic device may further include a protocol module and a BLE module, while the second electronic device may further include a BLE module, a protocol module, and a WiFi framework. Communication between the P2P services of the first and second electronic devices can be achieved through modules such as the protocol module and BLE module of both devices; this is not limited here.
[0175] S902, returns available frequency bands and second identification information.
[0176] Referring to S708, in some possible embodiments, the BLE protocol data packet containing the available frequency band of the second electronic device is transmitted from the BLE module of the second electronic device to the BLE module of the first electronic device, and then transmitted to the P2P service of the first electronic device via the protocol module and WiFi framework of the first electronic device. Furthermore, in some possible embodiments, the BLE protocol data packet may also include second identification information of the second electronic device. Therefore, the P2P service of the first electronic device can obtain the available frequency band and the second identification information through the WiFi framework.
[0177] S903, when the second electronic device supports service coexistence and the available frequency bands include the same frequency bands, performs P2P negotiation and connection establishment.
[0178] If the second electronic device supports service coexistence and the available frequency bands of the first electronic device and the second electronic device include the same frequency band, the same frequency band can be identified as the target available frequency band. The first electronic device can then negotiate and establish a connection with the second electronic device based on the target available frequency band.
[0179] S904, establish a P2P service to send data.
[0180] By implementing the above technical solution, the first electronic device can establish a P2P service and perform corresponding data transmission through the target available frequency band when the second electronic device supports the service coexistence function and the available frequency band is the same as that of the first electronic device.
[0181] Please refer to Figure 10. Figure 10 is a flowchart illustrating a service coexistence method provided in this application where the second electronic device supports service coexistence functionality and its available frequency band is different from that of the first electronic device. As shown in Figure 10, in some possible embodiments, when the first electronic device supports service coexistence functionality, establishing the first service through the target available frequency band may further include the following steps:
[0182] S1001, obtain available frequency bands and second identification information.
[0183] S1002, returns available frequency bands and second identification information.
[0184] The implementation methods of S1001 to S1002 are similar to those of S901 to S902, and will not be described in detail here.
[0185] S1003, if the second electronic device supports service coexistence and the available frequency bands do not include the same frequency bands, output a conflict warning message.
[0186] In some possible embodiments, if the available frequency bands of the first electronic device and the available frequency bands of the second electronic device do not include the same frequency bands, a conflict warning message is output. The conflict warning message is used to indicate whether to close the SoftAP service or stop the P2P service.
[0187] It should be noted that although the first electronic device supports service coexistence, it will still be unable to establish a P2P service if the available frequency bands of the first and second electronic devices do not overlap at all. A conflict warning message can be displayed to prompt the user to either disable the SoftAP service or stop the currently initiated P2P service.
[0188] S1004, disable SoftAP service and establish P2P service to send data.
[0189] In some possible embodiments, if the user decides to disable the SoftAP service, then there is no longer a service conflict issue when establishing a P2P service. In this case, the first electronic device can establish the P2P service using a traditional method.
[0190] By implementing the above technical solution, in some cases, if the first electronic device cannot simultaneously establish and operate P2P and SoftAP services based on the existing equipment's service coexistence capabilities and available frequency bands, it can output conflict warning information to inform users of the current situation and better meet the specific needs of different users.
[0191] Figure 11 is a flowchart illustrating a scenario where the first electronic device lacks an available frequency band in the service coexistence method provided in this application embodiment. As shown in Figure 11, in some possible embodiments, when the first electronic device supports the service coexistence function, establishing the first service through the target available frequency band may further include the following steps:
[0192] S1101, obtain available frequency bands and second identification information.
[0193] S1102, returns available frequency bands and second identification information.
[0194] The implementation methods of S1101 to S1102 are similar to those of S901 to S902, and will not be described in detail here.
[0195] S1103, if the first electronic device does not include an available frequency band, outputs a conflict warning message.
[0196] In some possible embodiments, if the first electronic device does not include an available frequency band, a conflict warning message is output, which is used to indicate whether to shut down the SoftAP service or stop the P2P service.
[0197] It should be noted that under certain circumstances, the first electronic device may not have available frequency bands for establishing P2P services. For example, the SoftAP service of the first electronic device may be in a debugging state, consuming a large amount of spectrum resources, or there may be insufficient available frequency bands due to hardware limitations of the device; however, this is not a specific limitation.
[0198] S1104, disable SoftAP service and establish P2P service to send data.
[0199] By implementing the above technical solution, in some cases where the first electronic device does not include available frequency bands, conflict warning information can be output to inform the user of the current situation and determine whether it is necessary to establish a P2P service by disabling the SoftAP service, so as to meet the specific needs of different users.
[0200] Please refer to Figure 12. Figure 12 is a flowchart illustrating a scenario where the second electronic device does not support the service coexistence function in the service coexistence method provided in this application embodiment. As shown in Figure 12, in some possible embodiments, when the first electronic device supports the service coexistence function, establishing the first service through the target available frequency band may further include the following steps:
[0201] S1201, obtain available frequency bands and second identification information.
[0202] S1202, returns available frequency bands and second identification information.
[0203] S1203, if the second electronic device does not support service coexistence, P2P negotiation and connection establishment are performed based on the available frequency band of the second electronic device.
[0204] In some possible embodiments, the method provided in this application further includes:
[0205] Obtain the second identification information corresponding to the second electronic device. The second identification information is used to indicate whether the second electronic device supports the service coexistence function.
[0206] If the second identification information indicates that the second electronic device does not support the service coexistence function, P2P negotiation is performed with the second electronic device based on the available frequency band of the second electronic device.
[0207] It should be noted that the first electronic device is the sender in the P2P service. If the second identification information of the second electronic device indicates that the second electronic device does not support the service coexistence function, in order to ensure that the second electronic device, as the receiver, can effectively obtain data, the first electronic device will attempt to conduct P2P negotiation and connection using the available frequency band of the second electronic device.
[0208] If the available frequency bands of the first electronic device include at least some of the same frequency bands as the available frequency bands of the second electronic device, the first electronic device can still establish a P2P service with the second electronic device. If the available frequency bands of the first electronic device do not include the same frequency bands as the available frequency bands of the second electronic device, a conflict prompt message is output. The conflict prompt message is used to indicate whether to close the SoftAP service or stop the P2P service.
[0209] S1204, Establish P2P service to send data.
[0210] In some possible embodiments, the first electronic device can negotiate and establish a P2P connection based on the available frequency band of the second electronic device. If successful, a P2P service is established, and data is sent to the second electronic device. Alternatively, after outputting a conflict warning message, if the user closes the SoftAP service, the first electronic device can use the frequency band resources released by the SoftAP service as its available frequency band to establish a P2P service with the second electronic device. This is not limited in scope.
[0211] By implementing the above technical solution, if the second electronic device does not support service coexistence, the first electronic device can still use the available frequency band of the second electronic device to conduct P2P negotiation with it. This ensures that the first electronic device can establish P2P services with electronic devices that have not yet adopted the service coexistence method provided in this application, thereby improving the versatility of the method.
[0212] The following example, using SoftAP service as the first service, illustrates how to establish SoftAP service through the target available frequency band in the service coexistence method provided in this application, when it is determined that the first electronic device supports service coexistence function.
[0213] Please refer to Figure 13. Figure 13 is a flowchart illustrating a service coexistence method provided in this application embodiment, where the first service is a SoftAP service. This method is applied to a first electronic device, and as shown in Figure 13, it may include the following steps:
[0214] S1301, Receive the first trigger operation, the first trigger operation is used to trigger the establishment of the first service, the first service is the SoftAP service.
[0215] S1302, determine whether the first electronic device supports the service coexistence function, which includes the coexistence of P2P service and SoftAP service.
[0216] S1303, if the first electronic device supports the service coexistence function, obtain the service status of the second service, the second service includes P2P service, and the service status includes on state and off state.
[0217] In some possible embodiments, establishing a first service through a target available frequency band includes: obtaining the service status of a second service, the second service including a P2P service, the service status including an on state and a off state; if the service status of the second service indicates that the second service is not on, establishing the first service through the target available frequency band; or, if the service status of the second service indicates that the second service is on and the first electronic device includes an available frequency band, establishing the first service through the target available frequency band, the available frequency band including the target available frequency band.
[0218] Understandably, unlike P2P services (taking data transfer as an example), which typically involve data exchange between two electronic devices, SoftAP services (taking personal hotspots as an example) do not rely on real-time data transmission with other electronic devices. They can be independently initialized on a single electronic device, creating a wireless LAN environment that allows other electronic devices to access network resources. Therefore, when the first service is a SoftAP service, it is not necessary to obtain the available frequency bands of other electronic devices; instead, the focus is on obtaining the activation status of the second service, which includes, in related technologies, P2P services that conflict with SoftAP services.
[0219] In some possible embodiments, the second service also includes STA service. In scenarios where the stability requirements for STA service are more stringent, the second service also includes STA service; that is, when establishing the SoftAP service, the impact of the first service on the STA service must also be considered. For example, when determining the available frequency bands for the first electronic device, if the STA service is enabled, a frequency band different from the STA service should be preferentially selected when allocating available frequency bands.
[0220] S1304, if the service status of the second service indicates that the second service is not enabled, the first service is established through the target available frequency band; or, if the service status of the second service indicates that the second service is enabled and the first electronic device includes the available frequency band, the first service is established through the target available frequency band, wherein the available frequency band includes the target available frequency band.
[0221] In some possible embodiments, if the service status of the second service indicates that the second service is not enabled, it means that the first electronic device is not running a P2P service that would conflict with the SoftAP service. In this case, the first service can be established through the target available frequency band, that is, the SoftAP service can be established to share the network with surrounding electronic devices.
[0222] In some possible implementations, if a P2P service conflicting with the SoftAP service is active, but available frequency bands still exist, it indicates that some spectrum resources are still available for the first service. The first electronic device can establish the first service through the target available frequency band. In this case, the target available frequency band is one of the available frequency bands and can be selected through preset priority or communication quality, which is not limited here.
[0223] In the service coexistence method provided in this application, when the first service is a SoftAP service, the first electronic device using the method provided in this application obtains the service status of the second service, and determines whether a SoftAP service can be established based on the service status of the second service and the available frequency bands, so as to enable the SoftAP service and the P2P service to run simultaneously on the first electronic device in some scenarios, thereby improving the user experience.
[0224] After introducing the service establishment process of the first electronic device when the first service is a P2P service or a SoftAP service, in order to more comprehensively introduce how to improve the stability of P2P services and SoftAP services coexisting on the first electronic device and improve the application scenarios of service coexistence, the following introduces a method for determining the available frequency band of the electronic device in a service coexistence method.
[0225] In some possible embodiments, the available frequency band of the first electronic device or the available frequency band of the second electronic device is determined based on the relationship between the first service and the preset frequency band combination. The preset frequency band combination relationship includes the frequency band combination supported by the preset service combination, which includes at least two of P2P service, SoftAP service and site STA service.
[0226] It should be noted that the preset frequency band combination relationship is implemented by modifying and compiling the existing WiFi framework. Before receiving the first trigger operation, the service coexistence method provided in this application further includes: compiling the preset frequency band combination relationship into the WiFi framework of the first electronic device, and modifying the port combination settings corresponding to the P2P service, SoftAP service and STA service, so that the P2P service, SoftAP service and STA service can be enabled simultaneously.
[0227] In some possible embodiments, the preset service combinations cover three types: P2P services, SoftAP services, and STA services. The different service combinations in the preset frequency band combination relationship are determined based on the hardware performance of different electronic devices and the corresponding actual test results.
[0228] For example, in some possible embodiments, the preset frequency band combination relationship may be as shown in Table 1.
[0229] Table 1
[0230] Using the preset frequency band combination relationships shown in Table 1, when the first electronic device receives the first trigger operation, it can determine the available frequency bands for establishing the first service based on the type of the first service (P2P service or SoftAP service), combined with the operating frequency bands of the already enabled service combinations in the first electronic device and the preset frequency band combination relationships. Meanwhile, if the electronic device operates using frequency band combinations other than those supported by the preset frequency band combination relationships, it may cause events affecting user experience such as connection failure and reduced transmission rates.
[0231] For example, when the first service is a P2P service, and the operating frequency band of the SoftAP service already enabled in the first electronic device is 5G, and the operating frequency band of the STA service already enabled is 2.4G, the available frequency band for the first electronic device to establish a P2P service is 2.4G or 5G.
[0232] In some possible embodiments, the preset service combination relationship may also include combinations of P2P service and SoftAP service, or P2P service and STA service, or SoftAP service and STA service, and frequency band combinations supported by different combinations. The first electronic device determines the available frequency band of the first electronic device through the first service and the preset frequency band combination relationship.
[0233] By implementing the above technical solution, the first electronic device can determine the available frequency bands of the first electronic device based on the type of the first service, the preset frequency band combination relationship, and the operating frequency bands of the services already enabled in the first electronic device. This provides a reference for the first electronic device to achieve coexistence of P2P services and SoftAP services, and improves the stability of each service operation when services coexist.
[0234] Please refer to Figure 14, which is a schematic diagram of a process for establishing STA service in the service coexistence method provided in this application embodiment. As shown in Figure 14, it may include the following steps:
[0235] S1401, when both P2P service and SoftAP service are enabled, detect the second trigger operation, which is used to trigger the establishment of site STA service.
[0236] S1402, determine whether the frequency bands used by P2P service and SoftAP service are the same.
[0237] It should be noted that before a STA service successfully connects to a network device such as a router, the frequency band used by the network device cannot be determined. When the P2P service and the SoftAP service use the same frequency band—for example, both using the 2.4GHz or 5GHz band—if the first electronic device wants to establish a STA service with a certain network device, the frequency band used by the established STA service may be the same as that used by the current P2P and SoftAP services. This could lead to STA connection failure or poor STA service quality, affecting the user's normal use of the first electronic device. Therefore, by proactively detecting whether the frequency bands used by the P2P and SoftAP services are the same when a second trigger operation for establishing a STA service is detected, and making corresponding adjustments, the successful establishment of the STA service and the first electronic device can be ensured, and the stability of the connection between the first electronic device and the network device can be improved.
[0238] S1403, Establish STA business.
[0239] If the frequency bands used by P2P services and SoftAP services are not the same (taking the frequency bands as an example including 2.4G and 5G), it will not affect which frequency band the STA service ultimately connects to. Therefore, there is no need to adjust the working channel of P2P services or SoftAP services.
[0240] S1404, switch the frequency band used by the SoftAP service and establish the STA service.
[0241] When P2P and SoftAP services use the same frequency band, Channel Switch Announcement (CSA) technology can be used to adjust the operating frequency band of the SoftAP service. Through CSA, the SoftAP service can switch to a different frequency band, thus avoiding sharing the same frequency band with the P2P service. In this way, when a STA service needs to be established, since the SoftAP service has already migrated to the new frequency band, the situation where P2P and SoftAP services occupy the same frequency band and cause STA service connection disruptions will not occur, thus ensuring the smooth establishment of the STA service and the stability of the network connection. This method effectively solves the connection problems caused by frequency band occupancy, improving the performance of the wireless network and the user experience. Furthermore, when adjusting the operating frequency band of the SoftAP service through Channel Switch Announcement, other client devices connected to the SoftAP service will also switch frequency bands along with the SoftAP service, without triggering a disconnection.
[0242] It should be understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0243] Based on the foregoing embodiments, this application provides a service coexistence device, which includes various modules and units included in each module, and can be implemented by a processor; of course, it can also be implemented by specific logic circuits; in the implementation process, the processor can be a central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate array (FPGA), etc.
[0244] Figure 15 is a schematic diagram of the service coexistence device provided in an embodiment of this application. As shown in Figure 15, the service coexistence device includes a detection module 1501, a coexistence judgment module 1502, and a service establishment module 1503, wherein:
[0245] The detection module 1501 is used to receive a first trigger operation, which is used to trigger the establishment of a first service, including a point-to-point (P2P) service or a soft access point (SoftAP) service.
[0246] The coexistence judgment module 1502 is used to determine whether the service coexistence device supports the service coexistence function, which includes the coexistence of P2P services and SoftAP services.
[0247] The service establishment module 1503 is used to establish a first service through a target available frequency band when the service coexistence device supports the service coexistence function.
[0248] In some possible embodiments, the coexistence determination module 1502 is further configured to obtain first identification information corresponding to the service coexistence device, the first identification information being used to indicate whether the service coexistence device supports the service coexistence function; and if the value of the first identification information is a preset value, it is determined that the service coexistence device supports the service coexistence function.
[0249] In some possible embodiments, the first service is a P2P service between the first electronic device and the second electronic device. The service establishment module 1503 is also used to obtain the available frequency bands of the service coexistence device and the available frequency bands of the second electronic device. If the available frequency bands of the service coexistence device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
[0250] In some possible embodiments, the service establishment module 1503 is further configured to send a P2P negotiation request to the second electronic device, the P2P negotiation request including a target available frequency band; receive response information from the second electronic device to the P2P negotiation request; and establish a first service through the target available frequency band if the response information indicates that the negotiation was successful.
[0251] In some possible embodiments, the service establishment module 1503 is further configured to output conflict warning information when the service coexistence device does not include an available frequency band, or when the available frequency band of the service coexistence device does not include the same frequency band as the available frequency band of the second electronic device. The conflict warning information is used to indicate that the SoftAP service is closed or the P2P service is stopped.
[0252] In some possible embodiments, the service establishment module 1503 is further configured to obtain second identification information corresponding to the second electronic device, the second identification information being used to indicate whether the second electronic device supports the service coexistence function; and if the second identification information indicates that the second electronic device supports the service coexistence function and the available frequency band of the service coexistence device includes the same frequency band as the available frequency band of the second electronic device, the same frequency band is determined as the target available frequency band.
[0253] In some possible embodiments, the service establishment module 1503 is further configured to obtain second identification information corresponding to the second electronic device, the second identification information being used to indicate whether the second electronic device supports the service coexistence function; if the second identification information indicates that the second electronic device does not support the service coexistence function, P2P negotiation is performed with the second electronic device based on the available frequency band of the second electronic device.
[0254] In some possible embodiments, the first service is a SoftAP service. The service establishment module 1503 is further configured to, when the service coexistence device supports the service coexistence function, obtain the service status of the second service, which includes a P2P service, and the service status includes an on state and a off state; if the service status of the second service indicates that the second service is not on, establish the first service through a target available frequency band; or, if the service status of the second service indicates that the second service is on and the service coexistence device includes an available frequency band, establish the first service through a target available frequency band, and the available frequency band includes the target available frequency band.
[0255] In some possible embodiments, the service establishment module 1503 is further configured to detect a second triggering operation when both the P2P service and the SoftAP service are enabled, the second triggering operation being used to trigger the establishment of the STA service; determine whether the frequency bands used by the P2P service and the SoftAP service are the same frequency band; and if the frequency bands used by the P2P service and the SoftAP service are the same frequency band, switch the frequency band used by the SoftAP service and establish the STA service.
[0256] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0257] It should be noted that the module division of the service coexistence device shown in Figure 15 of this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical units, or have two or more units integrated into one unit. The integrated units can be implemented in hardware, as software functional units, or a combination of software and hardware.
[0258] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in 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), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0259] This application provides a computer electronic device, which can be a server, and its internal structure is shown in Figure 16. The computer electronic device includes a processor, a memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the aforementioned methods.
[0260] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the method provided in the above embodiments.
[0261] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the method provided in the above-described method embodiments.
[0262] Those skilled in the art will understand that the structure shown in Figure 16 is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer electronic device to which the present application is applied. The specific computer electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0263] In one embodiment, the service coexistence apparatus provided in this application can be implemented as a computer program, which can run on a computer electronic device as shown in FIG16. The memory of the computer electronic device can store the various program modules constituting the above-described apparatus. The computer program, composed of the various program modules, causes the processor to execute the steps of the methods in the various embodiments of this application described in this specification.
[0264] It should be noted that the descriptions of the storage medium and electronic device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the embodiments of the storage medium, storage medium, and electronic device of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0265] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential 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. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.
[0266] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0267] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or electronic device. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or electronic device that includes that element.
[0268] In the several embodiments provided in this application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of electronic devices or modules can be electrical, mechanical, or other forms.
[0269] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0270] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.
[0271] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage electronic devices, read-only memory (ROM), magnetic disks, or optical disks.
[0272] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage electronic devices, ROMs, magnetic disks, or optical disks.
[0273] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0274] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0275] The features disclosed in the several method or electronic device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or electronic device embodiments.
[0276] The above description is merely an 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 business coexistence method, characterized in that, Applied to a first electronic device, the method includes: Receive a first trigger operation, the first trigger operation is used to trigger the establishment of a first service, the first service includes a peer-to-peer (P2P) service or a soft access point (SoftAP) service; Determine whether the first electronic device supports the service coexistence function, which includes the coexistence of the P2P service and the SoftAP service; If the first electronic device supports the service coexistence function, the first service is established through the target available frequency band.
2. The method according to claim 1, characterized in that, The step of determining whether the first electronic device supports service coexistence includes: Obtain first identification information corresponding to the first electronic device, wherein the first identification information is used to indicate whether the first electronic device supports the service coexistence function; If the value of the first identification information is a preset value, it is determined that the first electronic device supports the service coexistence function.
3. The method according to claim 1 or 2, characterized in that, The first service is the P2P service between the first electronic device and the second electronic device. Before establishing the first service through the target available frequency band, the method further includes: Obtain the available frequency bands of the first electronic device and the available frequency bands of the second electronic device; If the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
4. The method according to claim 3, characterized in that, The establishment of the first service via the target available frequency band includes: Send a P2P negotiation request to the second electronic device, the P2P negotiation request including the target available frequency band; The system receives the response information from the second electronic device to the P2P negotiation request, and if the response information indicates that the negotiation was successful, it establishes the first service through the target available frequency band.
5. The method according to claim 3, characterized in that, The method further includes: If the first electronic device does not include an available frequency band, or if the available frequency bands of the first electronic device and the available frequency bands of the second electronic device do not include the same frequency band, a conflict warning message is output. The conflict warning message is used to indicate that the SoftAP service should be turned off or the P2P service should be stopped.
6. The method according to claim 3, characterized in that, If the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, before determining the same frequency band as the target available frequency band, the method further includes: Obtain the second identification information corresponding to the second electronic device, the second identification information being used to indicate whether the second electronic device supports the service coexistence function; The step of determining the same frequency band as the target available frequency band when the available frequency bands of the first electronic device and the second electronic device include the following: If the second identification information indicates that the second electronic device supports the service coexistence function and the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, then the same frequency band is determined as the target available frequency band.
7. The method according to claim 3, characterized in that, The method further includes: Obtain the second identification information corresponding to the second electronic device, the second identification information being used to indicate whether the second electronic device supports the service coexistence function; If the second identification information indicates that the second electronic device does not support the service coexistence function, P2P negotiation is performed with the second electronic device based on the available frequency band of the second electronic device.
8. The method according to claim 1 or 2, characterized in that, The first service is the SoftAP service, and the step of establishing the first service through a target available frequency band when the first electronic device supports the service coexistence function includes: When the first electronic device supports the service coexistence function, the service status of the second service is obtained. The second service includes the P2P service, and the service status includes an on state and a off state. If the service status of the second service indicates that the second service is not enabled, the first service is established through the target available frequency band; or, if the service status of the second service indicates that the second service is enabled and the first electronic device includes an available frequency band, the first service is established through the target available frequency band, wherein the available frequency band includes the target available frequency band.
9. The method according to claim 3 or 8, characterized in that, The available frequency band of the first electronic device or the available frequency band of the second electronic device is determined based on the first service and the preset frequency band combination relationship. The preset frequency band combination relationship includes the frequency band combination supported by the preset service combination. The preset service combination includes at least two of the P2P service, the SoftAP service and the site STA service.
10. The method according to claim 1, characterized in that, The method further includes: When both the P2P service and the SoftAP service are enabled, a second triggering operation is detected. The second triggering operation is used to trigger the establishment of a site (STA) service. Determine whether the frequency bands used by the P2P service and the SoftAP service are the same; If the frequency band used by the P2P service and the SoftAP service is the same, switch the frequency band used by the SoftAP service and establish the STA service.
11. The method according to claim 1, characterized in that, The first triggering operation is a triggering operation of the business control corresponding to the first service displayed on the screen of the first electronic device. When the first service is the P2P service, the business control corresponding to the first service is the mutual transfer control. When the first service is the SoftAP service, the business control corresponding to the first service is the personal hotspot control.
12. The method according to claim 2, characterized in that, The step of obtaining the first identification information corresponding to the first electronic device includes: The first identification information is obtained from a preset storage area of the first electronic device, wherein the preset storage area is a protected area in the same storage location as system data, pre-installed application data, and user data; or, The first identification information is obtained through the coexistence capability interface provided by the WiFi framework.
13. A service coexistence device, characterized in that, include: The detection module is used to receive a first trigger operation, which is used to trigger the establishment of a first service, including a peer-to-peer (P2P) service or a soft access point (SoftAP) service. The coexistence determination module is used to determine whether the service coexistence device supports the service coexistence function, which includes the coexistence of the P2P service and the SoftAP service; The service establishment module is used to establish the first service through the target available frequency band when the service coexistence device supports the service coexistence function.
14. The service coexistence device according to claim 13, characterized in that, The service establishment module is further configured to obtain first identification information corresponding to the first electronic device, the first identification information being used to indicate whether the first electronic device supports the service coexistence function; and to determine that the first electronic device supports the service coexistence function when the value of the first identification information is a preset value.
15. The service coexistence device according to claim 13 or 14, characterized in that, The first service is the P2P service between the first electronic device and the second electronic device. The service establishment module is further configured to obtain the available frequency bands of the first electronic device and the second electronic device; if the available frequency bands of the first electronic device and the available frequency bands of the second electronic device include the same frequency band, the same frequency band is determined as the target available frequency band.
16. The service coexistence device according to claim 15, characterized in that, The service establishment module is also used to send a P2P negotiation request to the second electronic device, the P2P negotiation request including the target available frequency band; receive the response information of the second electronic device to the P2P negotiation request, and if the response information indicates that the negotiation is successful, establish the first service through the target available frequency band.
17. The service coexistence device according to claim 13 or 14, characterized in that, The first service is the SoftAP service. The service establishment module is further configured to, when the first electronic device supports the service coexistence function, obtain the service status of the second service, the second service including the P2P service, and the service status including an on state and a off state; when the service status of the second service indicates that the second service is not on, establish the first service through the target available frequency band; or, when the service status of the second service indicates that the second service is in the on state and the first electronic device includes an available frequency band, establish the first service through the target available frequency band, and the available frequency band includes the target available frequency band.
18. A computer electronic device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 12.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 12.
20. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 12.