Service conflict prompting method and related device
By judging and prompting for conflicting business reasons, the failure problem caused by the busy device when sharing files across devices is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202310801333.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
When users try to share files across devices, electronic devices are conducting other cross-device services, causing file sharing services to fail, and users cannot accurately understand the reasons for the failure, which affects the user experience.
By determining whether the electronic device has an unoccupied p2p channel, if it does not exist, find and prompt the cause of conflicting services, use pop-up window to prompt the user for the reason for the failure of cross-device services, and guide the user to operate to solve the problem.
It realizes accurate tips on the reasons for cross-device business failure, improves user experience, and helps users understand and solve the problem of file sharing failures.
Smart Images

Figure CN119225915A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a service conflict prompting method and related devices. Background Art
[0002] With the rapid development of science and technology, users use electronic devices of different sizes and functions to meet the needs of different scenarios. At the same time, different data will be scattered on different electronic devices of users. In specific scenarios, resource sharing and collaborative operations between two or more electronic devices are realized based on cross-device services. For example, if a user needs to use an electronic device to process a file stored in another electronic device, the file needs to be sent from one electronic device to another. In this case, electronic devices can directly transfer files based on a peer-to-peer (p2p) connection, which can simplify the complexity of file transfer. For example, mobile phones share pictures through Honor Share (a peer-to-peer transmission application).
[0003] Currently, when a user needs to transfer a file from one electronic device to another electronic device through a p2p connection (that is, when the user currently requests a cross-device service), the electronic device may be performing other cross-device services, such as smart interconnection services. Other cross-device services may conflict with the file sharing service (the cross-device service currently requested), thereby causing the file sharing service to fail.
[0004] In the current technology, when an electronic device is performing other cross-device services, it may conflict with the cross-device service currently requested, causing the cross-device service currently requested to fail, affecting the user experience. Summary of the invention
[0005] The present application provides a service conflict prompting method and related devices, which can accurately prompt the user the reason for the cross-device service failure, thereby guiding the user's operation and improving the user's experience.
[0006] In order to achieve the above objectives, this application adopts the following technical solutions:
[0007] In the first aspect, the present application provides a service conflict prompting method, which is applied to a first electronic device, and includes: in response to a service startup operation input by a user, determining whether there is an unoccupied p2p channel on the local side, and when there is no unoccupied p2p channel on the local side, searching for conflicting services in the cross-device services of the first electronic device, the connection status of the conflicting services is not unconnected, and the connection type of the conflicting services is p2p, and based on the conflicting services found, prompting the reason for the failure of the cross-device services through a pop-up window. When all the p2p channels on the local side are occupied, the conflicting services occupying the p2p channels are found, and the reason for the failure of the cross-device services is accurately prompted based on the conflicting services, thereby guiding the user's operation and improving the user's experience.
[0008] In a possible implementation, the communication framework of the first electronic device responds to a service start operation input by a user to determine whether there is an unoccupied p2p channel on the local end, and the communication framework is located in the application framework layer of the operating system of the first electronic device.
[0009] In one possible implementation, when there is no unoccupied p2p channel on the local end, the cross-device application of the first electronic device searches for conflicting services in the cross-device services of the first electronic device. The cross-device application of the first electronic device prompts the reason for the failure of the cross-device service through a pop-up window based on the conflicting services found; the cross-device application is an application for implementing the cross-device service corresponding to the service startup operation; the cross-device application is located in the application layer of the operating system of the first electronic device.
[0010] In a possible implementation, the connection attribute value of the cross-device service is used to search for conflicting services in the cross-device service of the first electronic device; the connection attribute value is used to indicate the connection state of the service and the connection type of the service. The conflicting services are searched by using the originally stored connection attribute value, thereby avoiding duplicate storage of data and saving storage space.
[0011] In a possible implementation, the connection attribute value of the cross-device service is obtained by a cross-device application of the first electronic device from a control center of the first electronic device; the cross-device application is located in an application program layer of an operating system of the first electronic device.
[0012] In one possible implementation, the connection attribute value of the cross-device service is obtained in the following manner: the communication framework of the first electronic device sends a first status code to the cross-device application of the first electronic device; the first status code is used to indicate that there is no unoccupied p2p channel of the first electronic device; the cross-device application of the first electronic device sends a connection attribute acquisition request to the control center of the first electronic device based on the first status code; the control center of the first electronic device returns the connection attribute value of the cross-device service to the cross-device application of the first electronic device in response to the connection attribute acquisition request.
[0013] In a possible implementation, in response to a service start operation input by a user, it is determined whether the local end enables a two-way p2p connection, and whether the first p2p channel and the second p2p channel are occupied; wherein: when the local end enables a two-way p2p connection, and the first p2p channel and the second p2p channel are both occupied, there is no unoccupied p2p channel on the local end; when the local end enables a two-way p2p connection, and the first p2p channel and the second p2p channel are not both occupied, there is an unoccupied p2p channel on the local end; when the local end does not enable a two-way p2p connection, and the first p2p channel is occupied, there is no unoccupied p2p channel on the local end; when the local end does not enable a two-way p2p connection, and the first p2p channel is not occupied, there is an unoccupied p2p channel on the local end. Taking full account of the differences in hardware configurations of electronic devices, corresponding to different p2p connection modes, the method has a wider range of applications.
[0014] In a possible implementation, the method further includes: when no conflicting service is found, prompting a cross-device service failure through a pop-up window. When a problem occurs in the control center, the cross-device service status is not updated in time, and the conflicting service cannot be correctly found, the cross-device service failure can still be prompted to improve the user experience.
[0015] In a possible implementation, when there is an unoccupied p2p channel on the local end, a p2p connection request is sent to a second electronic device; the second electronic device responds to the p2p connection request and determines whether the second electronic device is allowed to establish a p2p connection with the first electronic device; when the second electronic device is not allowed to establish a p2p connection with the first electronic device, a pop-up window prompts the user that the cross-device service has failed.
[0016] In a possible implementation, a second status code sent by a second electronic device is received, where the second status code is used to indicate that the second electronic device is not allowed to establish a p2p connection with the first electronic device, and based on the second status code, a pop-up window is displayed to prompt that the cross-device service has failed.
[0017] In a possible implementation, when the second electronic device allows to establish a p2p connection with the first electronic device, the first electronic device establishes a p2p connection with the second electronic device, and based on the p2p connection, a cross-device service between the first electronic device and the second electronic device is implemented.
[0018] In a second aspect, the present application provides an electronic device, which includes a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the method of the first aspect above.
[0019] In a third aspect, the present application provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method of the first aspect described above is implemented.
[0020] In a fourth aspect, the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1A A desktop interface diagram of a first electronic device in the current technology;
[0022] Figure 1B This is a photo album interface diagram of a first electronic device in the current technology;
[0023] Figure 1C A picture interface diagram of a first electronic device in the current technology;
[0024] Figure 1D A picture sharing interface diagram of a first electronic device in the current technology;
[0025] Figure 1E This is another picture sharing interface diagram of a first electronic device in the current technology;
[0026] Figure 1F This is another picture sharing interface diagram of a first electronic device in the current technology;
[0027] Figure 2 A schematic diagram of an interactive process of a service conflict prompting method in the current technology;
[0028] Figure 3A An exemplary diagram of the composition of an electronic device provided in an embodiment of the present application;
[0029] Figure 3B An example diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0030] Figure 4 A schematic diagram of an interactive process of a service conflict prompting method provided in an embodiment of the present application;
[0031] Figure 5 A flow chart of a communication framework 102 of a first electronic device 10 determining whether it has an unoccupied p2p channel provided in an embodiment of the present application;
[0032] Figure 6 A picture sharing interface diagram of a first electronic device 10 provided in an embodiment of the present application;
[0033] Figure 7 A schematic diagram of a flow chart of a communication framework 202 of a second electronic device 20 determining whether a p2p connection can be established with a first electronic device 10 provided in an embodiment of the present application;
[0034] Figure 8 A method for re-performing a file sharing service based on a pop-up window prompt provided in an embodiment of the present application;
[0035] Fig. 9 A flowchart of another service conflict prompting method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.
[0037] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0038] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:
[0039] Cross-device services are services implemented between two or more electronic devices, such as: multi-device collaboration services, file sharing services, mobile phone cloning services, etc.
[0040] Multi-device collaboration is a technology applied between multiple electronic devices. Using multi-device collaboration technology, two or more electronic devices can collaborate across systems and devices to achieve resource sharing and collaborative operations. Multi-device collaboration can be applied between electronic devices of the same or different types. Among them, the types of electronic devices include but are not limited to mobile phones, tablets, laptops, large-screen devices (for example: smart TVs, smart screens), personal computers (persona1computer, PC), handheld computers, netbooks, personal digital assistants (personal digital assistant, PDA), wearable electronic devices, vehicle-mounted devices, virtual reality devices and other devices. Generally, the services implemented by multi-device collaboration technology are called multi-device collaboration services. For example, electronic devices can implement the following multi-device collaboration services based on multi-device collaboration technology:
[0041] Screen projection: Project the content (e.g., videos, photos, etc.) on the screen of the first electronic device to the screen of the second electronic device for display. When projecting, the user can select part or all of the content on the screen of the first electronic device to be projected to the screen of the second electronic device for display. Some screen projection methods also allow users to switch the screen to other pages during projection without affecting the second electronic device from continuing to play the projected content, such as DLNA projection.
[0042] Screen mirroring: All contents on the screen of the first electronic device are completely mirrored on the screen of the second electronic device. The contents of the first electronic device displayed on the second electronic device are the same as those displayed on the first electronic device, and change as the contents displayed on the first electronic device change.
[0043] Screen extension: The screen of the second electronic device is used as the secondary screen of the first electronic device. The first electronic device can transfer part of the content it needs to display to the secondary screen for display. The screen of the first electronic device and the screen of the second electronic device can display content together, thereby expanding the display capability of the first electronic device.
[0044] Screen sharing: Projecting the user interface of the first electronic device onto the screen of the second electronic device for display, allowing the user to operate the user interface of the first electronic device in the second electronic device, and transferring files from the second electronic device to the first electronic device by performing specific operations in the second electronic device (for example, dragging files from the user interface of the second electronic device to the user interface of the first electronic device), thereby realizing cross-device operations and cross-device file transfers between the first and second electronic devices. The user interface of the first electronic device can be displayed in any area of the screen of the second electronic device, or in full screen.
[0045] Keyboard and mouse collaboration: The first electronic device can share the input device of the second electronic device. For example, if the first electronic device is an Android device and the second electronic device is a Windows device, the Android device can share the input devices of the Windows device, such as the mouse, keyboard and other input devices. In addition, in the keyboard and mouse sharing type, files can also be transferred between the first electronic device and the second electronic device.
[0046] Continuation collaboration: When a user runs an application on the first electronic device, the interface of the second electronic device may prompt the user to open the application running on the first electronic device on the second electronic device, so as to transfer to the second electronic device for continued operation, such as watching videos, editing documents, etc. For example: A document application is running on the first electronic device, and the document application may be a memo, word, etc. The user is editing a document on the first electronic device. When the second electronic device is close to the first electronic device, a prompt message is displayed on the second electronic device, and the user clicks the prompt message on the second electronic device. In response to the user's click operation, the second electronic device opens the document application and displays the location where the user is editing, so as to transfer to the second electronic device to continue editing, etc.
[0047] Call collaboration: When the first electronic device receives an incoming voice call or video call, the incoming call interface can be synchronously displayed on the second electronic device, so that the user can choose to answer or hang up the call on the second electronic device.
[0048] Notification collaboration: When the first electronic device receives a notification message, the notification message can be synchronously displayed in the second electronic device, and the user can also perform operations such as reply, delete, read, etc. on the notification message in the second electronic device.
[0049] It is understandable that the first electronic device in the above description can also be referred to as a master device, which refers to the side that initiates the status message synchronization. The second electronic device can also be referred to as a slave device, which refers to the side that receives the status message synchronization. For ease of understanding, the electronic device that initiates the status message synchronization is referred to as the first electronic device, and the electronic device that receives the status message synchronization is referred to as the second electronic device for further explanation.
[0050] The above functions are implemented based on the communication between electronic devices, including near-field communication, far-field communication or multi-channel communication. Near-field communication refers to the communication between multiple electronic devices through short-range methods such as Wireless Fidelity (WIFI), Wireless Local Area Networks (WLAN) and Near Field Communication (NFC); far-field communication refers to the communication between multiple electronic devices through forwarding through the device cloud; when two electronic devices perform near-field communication and far-field communication at the same time, it is called multi-channel communication.
[0051] The advantages of the service conflict prompting method provided by the present application are compared and explained below in combination with the existing service conflict prompting method. For the convenience of explanation, the cross-device service is explained below by taking the file sharing service as an example.
[0052] When it is necessary to transfer a file stored in a first electronic device to a second electronic device, the electronic devices can directly transfer files based on a peer-to-peer (p2p) connection (i.e., implement file sharing services based on a peer-to-peer connection). At the same time, when the first electronic device and / or the second electronic device is performing other cross-device services, the p2p channel will be occupied, thereby conflicting with the file sharing service and causing the file transfer to fail. In current technology, file sharing failure only prompts the user of file transfer failure by displaying prompts such as "transmission channel occupied" or "sending failed" in a pop-up window on the first electronic device (i.e., the electronic device sending the file). The user cannot clearly understand the cause of the transmission failure from the prompt, and thus cannot clearly understand how to solve the problem of transmission failure, which affects the user's experience.
[0053] For ease of understanding, the following detailed description of the existing file sharing conflict prompt method is provided in conjunction with Figures 1 to F. The first electronic device 10 sends a picture to the second electronic device 20 through "Honor Share" as an example. The first electronic device 10 is described by taking a mobile phone as an example, which is not specifically limited in this application.
[0054] like Figure 1A The desktop interface diagram of the first electronic device 10 shown in the figure, after the user unlocks the first electronic device, the first electronic device 10 can present a desktop 100 to the user, and the desktop 100 includes icons of various applications, such as: phone icons, contact icons, Internet icons, SMS icons, settings icons, and album icons 101. The user can trigger operations on the application icons, such as: click, long press, slide, etc. The user clicks the album icon 101 on the desktop interface 100 of the first electronic device 10, which will start the album application and enter the album interface of the first electronic device (such as Figure 1B ). The user clicks the album icon 101 on the desktop interface 100 of the first electronic device 10, and the first electronic device 10 presents the album interface 110 to the user.
[0055] The album interface 110 of the first electronic device 10 includes pictures or videos, which are regularly distributed on the album interface 110, for example, including pictures 111, videos, etc. When a user clicks on the picture 11, an interface including detailed information about the picture 111 and related processing options is launched, which is also called the picture interface 120 (e.g., Figure 1C The user clicks on the picture 111 on the album interface 110 of the first electronic device 10, and the first electronic device 10 presents the picture interface 120 to the user.
[0056] The picture interface 120 includes a variety of operation icons for the picture 111, such as: a share icon 121, an edit icon, a delete icon, etc. After the first electronic device 10 receives the operation triggered by the user, it will perform the corresponding operation on the picture 111. When the user clicks the share icon 121 on the picture interface 120 of the first electronic device 10, the picture sharing function is activated, and the first electronic device 10 presents the picture sharing interface 130 (such as Figure 1D shown).
[0057] The picture sharing interface 130 includes modules corresponding to multiple picture sharing types, including: a glory sharing part 131, a WeChat icon, an information icon, a QQ icon, etc. If you click on the WeChat icon, the information icon or the QQ icon, the corresponding application will be started and sent to the recipient through the application. For the situation mentioned in this application, the second electronic device 20 nearby is searched through communication between devices (taking Bluetooth communication as an example). When the first electronic device 10 searches for the second electronic device 20 through Bluetooth communication, the name 132 of the second electronic device 20 will be displayed in the glory sharing part 131. The user clicks on the name 132 of the second electronic device 20, and at this time the first electronic device 10 requests to establish a p2p connection with the second electronic device 20. If the p2p connection between the first electronic device 10 and the second electronic device 20 is successfully established, the picture 111 is directly transmitted from the first electronic device 10 to the second electronic device 20 through Honor Share (p2p connection); if the p2p connection between the first electronic device 10 and the second electronic device 20 fails to be established, the picture 111 cannot be transmitted through Honor Share. There are two reasons for the failure to establish the p2p connection between the first electronic device 10 and the second electronic device 20: one is that the p2p channel of the first electronic device 10 is occupied; the other is that the p2p channel of the second electronic device 20 is occupied. Because the p2p channel of the electronic device is occupied, there is no idle channel to establish a p2p connection with another electronic device, resulting in the failure of sharing files through the p2p connection.
[0058] When the reason for the failure of establishing the p2p connection between the first electronic device 10 and the second electronic device 20 is that the p2p channel of the first electronic device 10 is occupied, the first electronic device 10 will display a pop-up window to the user "WLAN transmission channel is occupied, sending failed" to prompt the user that the picture sharing failed. Figure 1E The prompt pop-up window 141 shown in another picture sharing interface 140 of the first electronic device 10 shown in the figure includes the text "WLAN transmission channel is occupied, sending failed", thereby prompting the user.
[0059] When the reason for the failure of establishing a p2p connection between the first electronic device 10 and the second electronic device 20 is that the p2p channel of the second electronic device 20 is occupied, the first electronic device 10 will display a pop-up window to the user that "the other party's WLAN transmission channel is occupied, and the transmission fails" to prompt the user that the picture sharing fails. Figure 1F The prompt pop-up window 151 shown in another picture sharing interface 150 of the first electronic device 10 shown in the figure includes the text "the other party's WLAN transmission channel is occupied, and the transmission fails", thereby prompting the user.
[0060] Combination Figure 2 The interactive process diagram of the existing service conflict prompt method is shown, wherein the cross-device service requested by the user is explained by taking the file sharing service as an example, and the application that implements the file sharing service is explained by taking the "Honor Share" application as an example.
[0061] It can be seen that the current existing service conflict prompt method is specifically: when the user requests the first electronic device 10 to send a picture to the second electronic device 20 through "Honor Share", in response to the user's operation (for example, clicking the name of the second electronic device 20, clicking the send icon on the Honor Share application interface, etc.), the communication framework of the first electronic device 10 determines whether its own p2p channel is occupied. If so, it returns a 1014 status code to the Honor Share application of the first electronic device. According to the 1014 status code, the first electronic device 10 displays "WLAN transmission channel is occupied, sending failed" through a pop-up window to prompt the user that the picture sharing failed; if not, it sends a p2p connection request to the second electronic device 20. After receiving the p2p connection request, the communication framework of the second electronic device 20 determines whether it allows itself to establish a p2p connection with the first electronic device 10. If not, it transparently transmits the 1013 status code to the Honor Share of the first electronic device 10 through the communication framework of the first electronic device 10. According to the 1013 status code, the first electronic device 10 displays "the other party's WLAN transmission channel is occupied, sending failed" through a pop-up window to prompt the user that the picture sharing failed. It can be seen from this that in the current technology, file sharing failure is only prompted to the user by a pop-up window displaying prompts such as "transmission channel occupied" or "sending failed" on the first electronic device (that is, the electronic device sending the file). The user cannot clearly understand the cause of the transmission failure from the prompt, and thus cannot clearly understand how to solve the problem of transmission failure, which affects the user's experience.
[0062] The present application provides a service conflict prompt method, which responds to the service startup operation input by the user, determines whether there is an unoccupied p2p channel on the local end (first electronic device), and when there is no unoccupied p2p channel, searches for conflicting services in the cross-device services in the first electronic device, and prompts the reason for the failure of the cross-device service through a pop-up window according to the conflicting services. The reason for the failure of the cross-device service is accurately prompted, thereby guiding the user's operation and improving the user's experience.
[0063] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 3A As shown, Figure 3A A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0064] like Figure 3A As shown, the electronic device may include a processor 110, a display screen 120, an internal memory 130, a touch sensor 140, an antenna 1, an antenna 2, a mobile communication module 150, and a wireless communication module 160, etc.
[0065] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0066] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and / or a neural-network processing unit (neural-network processing unit, NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. For example, in the present application, when it is determined that there is no unoccupied p2p channel on the local side, conflicting services in cross-device services can be searched, and the reason for the failure of the cross-device service can be prompted based on the conflicting services found.
[0067] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0068] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0069] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0070] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 140, the charger, the flash, the camera, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 140 through the I2C interface, so that the processor 110 communicates with the touch sensor 140 through the I2C bus interface to realize the touch function of the electronic device.
[0071] The UART interface is a universal serial data bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 through the UART interface to implement the Bluetooth function.
[0072] The MIPI interface can be used to connect the processor 110 with the display screen 120, a camera and other peripheral devices. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the display screen 120 communicate via the DSI interface to realize the display function of the electronic device.
[0073] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with a camera, a display screen 120, a wireless communication module 160, a touch sensor 140, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0074] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0075] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0076] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0077] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0078] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or video through the display screen 120. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0079] The wireless communication module 160 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0080] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0081] The electronic device implements the display function through a GPU, a display screen 120, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 120 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0082] The display screen 120 is used to display images, videos, etc. The display screen 120 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 120, where N is a positive integer greater than 1.
[0083] A series of graphical user interfaces (GUIs) can be displayed on the display screen 120 of the electronic device, and these GUIs are the main screen of the electronic device. Generally speaking, the size of the display screen 120 of the electronic device is fixed, and only limited controls can be displayed on the display screen 120 of the electronic device. A control is a GUI element, which is a software component included in an application. It controls all data processed by the application and interactive operations on these data. Users can interact with the controls through direct manipulation to read or edit relevant information of the application. Generally speaking, controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. For example: In an embodiment of the present application, a prompt is displayed in a pop-up window to prompt the user of the reason for the failure of cross-device business.
[0084] The internal memory 130 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 130. For example, in this embodiment, the processor 110 can execute the instructions stored in the internal memory 130, and when there is no unoccupied p2p channel on the local end, search for conflicting services in the cross-device services of the first electronic device. The internal memory 130 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a file sharing function, etc.). The data storage area may store data created during the use of the electronic device (such as audio data, picture data, etc.). In addition, the internal memory 130 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functions of the electronic device by running the instructions stored in the internal memory 130, and / or the instructions stored in the memory provided in the processor.
[0085] The touch sensor 140 is also called a "touch control device". The touch sensor 140 can be arranged on the display screen 120. The touch sensor 140 and the display screen 120 form a touch screen, also called a "touch control screen". The touch sensor 140 is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 120. In other embodiments, the touch sensor 140 can also be arranged on the surface of the electronic device, which is different from the position of the display screen 120.
[0086] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.
[0087] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0088] Figure 3B It is a software structure block diagram of the electronic device according to an embodiment of the present application.
[0089] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0090] The application layer can include a series of application packages. Figure 3B As shown, the application package may include cross-device services, gallery, WLAN, Bluetooth, video, short message and other applications.
[0091] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3B As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a communication framework (Nearby), and the like.
[0092] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0093] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0094] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0095] The phone manager is used to provide communication functions for electronic devices, such as the management of call status (including answering, hanging up, etc.).
[0096] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0097] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0098] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0099] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0100] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0101] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0102] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0103] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0104] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0105] A 2D graphics engine is a drawing engine for 2D drawings.
[0106] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0107] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.
[0108] Embodiment 1:
[0109] Combine the following Figure 4-Figure 7 , a service conflict prompting method provided by an embodiment of the present application is introduced in detail. Among them, the cross-device service requested by the user is explained by taking the file sharing service as an example. The first electronic device 10 requests to share the file with the second electronic device 20, that is, the first electronic device 10 requests to transfer the file to the second electronic device 20 through the p2p channel. The first electronic device 10 can also be called the sending end, and the second electronic device 20 can be called the receiving end.
[0110] S401: A user performs a file sharing operation.
[0111] The file sharing operation is a service start operation for instructing the first electronic device 10 to perform a file sharing service with the second electronic device 20 .
[0112] Specifically, the user triggers a file sharing operation when using the file sharing application 101 of the first electronic device 10. For example, the file sharing operation may be clicking a preset icon on the screen of the first electronic device 10, or other preset file sharing operations. The file sharing application 101 is a preset application for executing a file sharing service, which may exist as an independent application or as a preset functional module of a certain application, and this application does not make specific limitations.
[0113] In order to facilitate the understanding of file sharing operations, Figure 1B-Figure 1D Let me explain this with an example.
[0114] Users in Figure 1B Select the picture (file) to be shared in the album interface 110 shown, click the picture icon 111, and enter the picture interface 120. The user clicks the share icon 121 on the picture interface 120 to enter the picture sharing interface 130, and clicks the name 132 of the second electronic device 20 searched by Honor Share to trigger the file sharing operation.
[0115] S402: The communication framework 102 of the first electronic device 10 determines whether it has an unoccupied p2p channel in response to the file sharing operation.
[0116] The communication framework 102 is located in the application framework layer of the operating system of the first electronic device 10 .
[0117] If the communication framework 102 of the first electronic device 10 determines that it does not have an unoccupied p2p channel, it proceeds to S403.
[0118] Specifically, if the first electronic device 10 does not have an unoccupied p2p channel (that is, all the p2p channels of the first electronic device 10 are occupied), it means that the first electronic device 10 is performing / preparing to perform other cross-device services (for example: keyboard and mouse collaboration, call collaboration, cloning, etc.) while performing the file sharing service. The cross-device services that are being performed / prepared to be performed occupy the p2p channel of the first electronic device 10, which will conflict with the file sharing service. That is, the first electronic device 10 cannot provide an idle p2p channel to establish a p2p connection with the second electronic device 20 to implement the file sharing service, which will cause the file sharing service to fail.
[0119] If the communication framework 102 of the first electronic device 10 determines that it has an unoccupied p2p channel, S410 is performed.
[0120] Specifically, if the first electronic device 10 has an unoccupied p2p channel (ie, not all p2p channels of the first electronic device 10 are occupied), it means that the first electronic device 10 has an idle p2p channel for establishing a p2p connection with the second electronic device 20 to implement a file sharing service.
[0121] For ease of understanding, the following Figure 5 The specific process of the communication framework 102 of the first electronic device 10 determining whether it has an unoccupied p2p channel is described in detail. The communication framework 102 applied to the first electronic device 10.
[0122] S501: Determine whether the first electronic device 10 enables a two-way p2p connection.
[0123] Due to different hardware configurations of electronic devices, different electronic devices support different types of p2p connections. Some hardware configurations support electronic devices to enable two-way p2p connections (two-way point-to-point connections), while some hardware configurations cannot support electronic devices to enable two-way p2p connections.
[0124] Specifically, based on the hardware configuration of the first electronic device 10 , it is determined whether the first electronic device 10 enables the two-way p2p connection.
[0125] If enabled, proceed to S502. When the two-way p2p connection is enabled, the first electronic device 10 has two-way p2p channels, including a first p2p channel and a second p2p channel. For the convenience of description, the first p2p channel is referred to as a p2p0 channel, and the second p2p channel is referred to as a p2p1 channel.
[0126] If not enabled, proceed to S503. When the dual-path p2p connection is not enabled, the first electronic device 10 has only a single-path p2p channel, that is, only the first p2p channel (p2p0 channel) exists.
[0127] S502: Determine whether both the p2p0 channel and the p2p1 channel are occupied.
[0128] If both the p2p0 channel and the p2p1 channel are occupied, it means that the first electronic device 10 has no unoccupied p2p channel; if both the p2p0 channel and the p2p1 channel are not occupied, it means that the first electronic device 10 has an unoccupied p2p channel.
[0129] It should be noted that the situations where both the p2p0 channel and the p2p1 channel are not occupied include: only the p2p0 channel (the first p2p channel) is not occupied, only the p2p1 channel (the second p2p channel) is not occupied, and neither the p2p0 channel nor the p2p1 channel is occupied, and this application does not make specific limitations.
[0130] S503: Determine whether the p2p0 channel is occupied.
[0131] If the p2p0 channel is not occupied, it means that the first electronic device 10 has an unoccupied p2p channel; if the p2p0 channel is occupied, it means that the first electronic device 10 does not have an unoccupied p2p channel.
[0132] Since the first electronic device 10 does not enable dual-path p2p connection, that is, the first electronic device 10 only has a single-path p2p channel, that is, the first p2p channel (p2p0 channel), whether the p2p0 channel is occupied directly corresponds to whether the first electronic device 10 has an unoccupied p2p channel.
[0133] S403 : The communication framework 102 of the first electronic device 10 returns a first status code to the file sharing application 101 .
[0134] The first status code is used to indicate that the first electronic device 10 does not have an unoccupied p2p channel, and thus cannot establish a p2p connection with the second electronic device to implement a file sharing service.
[0135] In a possible implementation, the first status code is preconfigured as status code 1014. Generally, status code 1014 is used to indicate that file sharing fails due to a problem with the local electronic device (ie, first electronic device 10) during the file sharing process.
[0136] S404 : The file sharing application 101 of the first electronic device 10 sends a connection attribute value acquisition request to the control center 103 of the first electronic device 10 .
[0137] Among them, the control center 103 is located in the application layer of the operating system of the first electronic device 10, and exists in the form of an Android installation package (Android Package, APK). The control center 103 stores a data configuration file (profile) corresponding to each cross-device service. The profile records the starting state of the cross-device service and continuously updates the current state of the cross-device service (for example: connection state, connection type, etc.). The data configuration file (profile) corresponding to each service stores the profile attribute value of the corresponding service. The profile attribute value of the service includes: the configuration information corresponding to the service (for example: service name, service unique identifier, index position of the service, etc.), the connection attribute value of the cross-device service, and the connection attribute value can represent: the connection state of the cross-device service and the connection type across devices.
[0138] Among them, the cross-device service refers to the cross-device service supported by the first electronic device 10, such as: keyboard and mouse collaboration, connection collaboration, call collaboration, notification collaboration, etc.
[0139] Among them, the connection status of the cross-device service can indicate the running status of the cross-device service, including: not connected, running, and connecting. When the connection status of the cross-device service is not connected, it means that the cross-device service is not connected in any state, that is, the cross-device service is not allocated and does not occupy the communication channel; when the connection status of the cross-device service is running, it means that the cross-device service is in a connected state, and the electronic device is running the cross-device service with other electronic devices through the communication channel, that is, the cross-device service occupies the communication channel; when the connection status of the cross-device service is connecting, it means that the cross-device service is in the process of connecting, and the electronic device is ready to run with other electronic devices through the communication channel but has not yet run the cross-device service, that is, the cross-device service has occupied the communication channel but has not yet completed the connection.
[0140] The connection type of the cross-device service corresponds to the physical connection type of the cross-device service, and is used to indicate the physical communication channel to which the service is currently connected. The connection types of the cross-device service include: WIFI, p2p, WLAN, BR, etc. In general, the appropriate service connection type is determined according to different situations to connect, thereby realizing the cross-device service.
[0141] The connection attribute value acquisition request is used to request the control center 103 to acquire the stored connection attribute values corresponding to each service, so as to analyze the reasons why the p2p channel is occupied according to the connection attribute values corresponding to each service.
[0142] S405 : The control center 103 of the first electronic device 10 returns the connection attribute value of the cross-device service of the first electronic device 10 to the file sharing application 101 of the first electronic device 10 based on the connection attribute value acquisition request.
[0143] In a possible implementation, the control center 103 of the first electronic device 10 can return the connection attribute value corresponding to the cross-device service to the file sharing application 101 of the first electronic device 10 in a table form. The connection attribute value includes: the connection status of the cross-device service and the connection type of the cross-device service. The attribute value of the connection status of the cross-device service is generally expressed as a numerical value, "0" indicates that the connection status of the cross-device service is not connected; "1" indicates that the connection status of the cross-device service is running; "2" indicates that the connection status of the cross-device service is connecting.
[0144] For ease of understanding, the connection attribute values of each cross-device service returned in a tabular form are described in detail below in conjunction with Table 1. Among them, the cross-device service is only described by keyboard and mouse collaboration, screen sharing, and notification collaboration as examples, and this application does not make specific limitations; and in Table 1, the service name is used as the identifier of each service, and other identifiers can also be used to represent the service, and this application does not make specific limitations.
[0145] Table 1
[0146] Business Name Connection Status Connection Type Keyboard and mouse collaboration 2 p2p Screen Sharing 0 —— Notification collaboration 0 ——
[0147] See Table 1 for the connection attribute values of the cross-device service returned by the control center 103 of the first electronic device 10 to the file sharing application 101. In Table 1, the connection status of the keyboard and mouse collaboration service is running, and the connection type is p2p connection; the connection status of the screen sharing service is not connected; and the connection status of the notification collaboration service is not connected.
[0148] S406: The file sharing application 101 of the first electronic device 10 traverses the connection attribute values of each service to find conflicting services among the cross-device services.
[0149] The connection state of the conflicting service is not disconnected, and the connection type of the conflicting service is a p2p service.
[0150] If the connection status of the conflicting service is not "disconnected", it means that the current connection status of the conflicting service is "running" or "connecting", that is, while the file sharing service is in progress, the conflicting service is also in progress or ready to run. If the service connection type of the conflicting service is p2p, it means that the conflicting service occupies the p2p channel during the process of running / preparing to run, resulting in the first electronic device 10 not having an unoccupied p2p channel to implement the file sharing service, that is, the conflicting service conflicts with the file sharing service, resulting in the failure of file sharing.
[0151] Specifically, when the file sharing application 101 of the first electronic device 10 finds (determines) a conflicting service, S407 is performed; when the file sharing application 101 of the first electronic device 10 traverses the connection attribute values of each service and does not find (determine) a conflicting service, S408 is performed.
[0152] S407 . The file sharing application 101 of the first electronic device 10 prompts the reason for the file sharing failure through a pop-up window based on the found conflicting services.
[0153] In a possible implementation, the first electronic device 10 displays a prompt message such as "This device is using a conflicting service, please disconnect and try again" through a tosta pop-up window to prompt the user the reason for the failure of the file sharing service. For example: Taking the connection attribute values of each service shown in Table 1 as an example, the first electronic device 10 traverses the connection attribute values of each service and determines that the conflicting service is keyboard and mouse collaboration. Then the first electronic device 10 displays a prompt message such as "This device is using a keyboard and mouse collaboration service, please disconnect and try again" through a tosta pop-up window to prompt the user (such as Figure 6 The reason for the failure of the file sharing service is that the first electronic device 10 is performing keyboard and mouse collaboration.
[0154] Among them, the tosta pop-up window is a non-modal pop-up window. The non-modal pop-up window will not affect the user's operation, and the user can choose not to respond to it. Non-modal pop-ups usually have a time limit and will disappear automatically after a period of time. Non-modal pop-ups are generally used to prompt users to provide feedback information.
[0155] Based on the determined conflicting services, the first electronic device 10 can accurately prompt the user the reason for the failure of the file sharing service, so that the user can clearly understand how to solve the problem of the failure of the file sharing service, thereby improving the user's usage experience.
[0156] It should be noted that the first electronic device 10 can prompt the user by displaying the reason for the failure of the file sharing service through a tosta pop-up window. In addition, other pop-up windows or other prompting methods can be used to prompt the user the reason for the failure of the file sharing service. This application does not make specific limitations.
[0157] S408: When no conflicting service is found, the first electronic device 10 prompts through a pop-up window that the file sharing service has failed.
[0158] In a possible implementation, the first electronic device 10 displays "the local WLAN transmission channel is occupied, and the transmission fails" through a toast pop-up window, thereby prompting the user that the file sharing service fails because the local p2p channel is occupied.
[0159] S409 : The communication framework 102 of the first electronic device 10 sends a p2p connection request to the communication framework 202 of the second electronic device 20 .
[0160] The p2p connection request is used to request to establish a p2p connection with the second electronic device 20 , and the connection request carries an available channel list of the first electronic device 10 .
[0161] If there is an unoccupied p2p channel on the first electronic device 10, it means that the first electronic device 10 has an idle p2p channel to establish a p2p connection with the second electronic device 20, so a connection request is sent to the communication framework 202 of the second electronic device 20 to request to establish a p2p connection with the second electronic device 20.
[0162] S410 : The communication framework 202 of the second electronic device 20 determines whether to allow the establishment of a p2p connection with the first electronic device 10 in response to the p2p connection request.
[0163] If the communication framework 202 of the second electronic device 20 determines that the p2p connection cannot be established with the first electronic device 10, S411 is performed.
[0164] Specifically, if the communication framework 202 of the second electronic device 20 determines that it cannot establish a p2p connection with the first electronic device 10, it means that the second electronic device 20 is performing / preparing to perform other cross-device services (for example: keyboard and mouse collaboration, call collaboration, etc.), occupying the p2p channel that allows the second electronic device 20 to establish a p2p connection with the first electronic device 10, making it impossible for the second electronic device 20 to establish a p2p connection with the first electronic device 10, thereby causing the file sharing service to fail.
[0165] If the communication framework 202 of the second electronic device 20 determines that a p2p connection can be established with the first electronic device 10 , S413 is performed.
[0166] Specifically, if the communication framework 202 of the second electronic device 20 determines that it can establish a p2p connection with the first electronic device 10, it means that the p2p channel through which the second electronic device 20 allows the establishment of a p2p connection with the first electronic device 10 is in an idle state (i.e., not occupied by other cross-device services), so that the second electronic device 20 allows the establishment of a p2p connection with the first electronic device 10 to implement a file sharing service.
[0167] For ease of understanding, the following Figure 7 The specific process of the communication framework 202 of the second electronic device 20 determining whether to allow the establishment of a p2p connection with the first electronic device 10 is described in detail. The communication framework 202 applied to the second electronic device 20.
[0168] S701: Determine whether the second electronic device 20 enables a two-way p2p connection.
[0169] Specifically, based on the hardware configuration of the second electronic device 20, it is determined whether the first electronic device 20 enables the two-way p2p connection.
[0170] If yes, proceed to S702. The second electronic device 20 enables the two-way p2p connection, and the second electronic device 20 has a two-way p2p channel, including: a first p2p channel and a second p2p channel. For convenience of description, the first p2p channel is called p2p0 channel, and the second p2p channel is called p2p1 channel.
[0171] If not, proceed to S703. If the second electronic device 20 does not enable the dual-path p2p connection, the second electronic device 20 only has a single-path p2p channel, that is, only the first p2p channel (p2p0 channel) exists.
[0172] S702: Determine whether both the p2p0 channel and the p2p1 channel are occupied.
[0173] If yes, the second electronic device 20 cannot establish a p2p connection with the first electronic device 10. When both the p2p0 channel and the p2p1 channel of the second electronic device 20 are occupied, it means that the second electronic device 20 does not have an idle p2p channel to establish a p2p connection with the first electronic device 10, so it cannot establish a p2p connection with the first electronic device 10.
[0174] If not, proceed to S704.
[0175] S703: Determine whether the p2p0 channel is occupied.
[0176] If yes, the second electronic device 20 cannot establish a p2p connection with the first electronic device 10. When the p2p0 channel of the second electronic device 20 is occupied, it means that the second electronic device 20 does not have an idle p2p channel to establish a p2p connection with the first electronic device 10, so it cannot establish a p2p connection with the first electronic device 10.
[0177] If not, proceed to S704.
[0178] S704 : Based on the available channel list of the first electronic device 10 , perform p2p rule negotiation with the first electronic device.
[0179] If the negotiation is successful, it means that the second electronic device 20 allows the establishment of a p2p connection with the first electronic device 10 .
[0180] If the negotiation fails, it means that the second electronic device 20 cannot establish a p2p connection with the first electronic device 10 .
[0181] Specifically, when an electronic device uses a p2p connection to transmit a file, the sending end (the first electronic device 10) and the receiving end (the second electronic device 20) need to be in the same frequency band and the same channel.
[0182] The p2p negotiation rule can be understood as the intersection of the available channels of the sender (first electronic device 10) and the available channels of the receiver (second electronic device 20). If there is an intersection, the negotiation is successful, indicating that the sender (first electronic device 10) and the receiver (second electronic device 20) have available channels in the same frequency band, allowing the establishment of a p2p connection; if there is no intersection, the negotiation fails, indicating that the sender (first electronic device 10) and the receiver (second electronic device 20) do not have available channels in the same frequency band, and the p2p connection cannot be established.
[0183] S411 : The communication framework 202 of the second electronic device 20 transparently transmits the second status code to the file sharing application 101 of the first electronic device 10 through the communication framework 102 of the first electronic device 10 .
[0184] The second status code indicates that the second electronic device 20 is not allowed to establish a p2p connection with the first electronic device 10, so that the file sharing service cannot be implemented with the first electronic device. That is, due to the p2p occupancy of the second electronic device 20, the p2p connection cannot be established with the first electronic device 10.
[0185] In a possible implementation, the second status code is preconfigured as status code 1013 to indicate that the file sharing fails due to a problem with the peer electronic device (the second electronic device 20) during the file sharing process.
[0186] S412: The file sharing application 101 of the first electronic device 10 prompts the failure of the file sharing service through a pop-up window based on the second status code.
[0187] In a possible implementation, the first electronic device 10 displays a prompt message such as "the other party's WLAN transmission channel is occupied, and the transmission fails" through a tosta pop-up window to prompt the user that the file sharing service has failed.
[0188] S413: The communication framework 202 of the second electronic device 20 successfully establishes a p2p connection with the communication framework 102 of the first electronic device 10.
[0189] The first electronic device 10 and the second electronic device 20 successfully establish a p2p connection, so that a file sharing service can be implemented through the p2p connection.
[0190] The present application provides a service conflict prompt method, in which the file sharing application (application layer application) searches for the connection status and connection type of the cross-device service based on the first status code returned by the control center, determines the conflicting service that affects the file sharing service, that is, the conflicting service occupies the p2p channel of the first electronic device (sender), thereby causing the file sharing to fail; based on the conflicting service, a pop-up window prompts the reason for the failure of the file sharing service, that is, the first electronic device (sender) prompts the user through a pop-up window that the reason for the failure of the file sharing service is that the local end is carrying out the conflicting service, occupying the p2p channel, thereby causing the file sharing service to fail. It can accurately prompt the user the reason for the failure of file sharing, guide the user to operate and thus solve the problem of the file failure, and improve the user's experience.
[0191] Further, combined with Figure 8 , a detailed description is given of how to transfer files with the second electronic device 20 through a p2p connection after the file sharing application 101 of the first electronic device 10 prompts the user through a pop-up window based on the conflicting service found, indicating the reason for the failure of the file sharing service. The conflicting service found is explained by taking the keyboard and mouse collaboration service as an example, and a pop-up window is used to display "The computer is using the keyboard and mouse collaboration service, please disconnect and try again" as an example.
[0192] When the file sharing application 101 of the first electronic device 10 displays a pop-up window stating that "this device is using the keyboard and mouse collaborative service, please disconnect and try again", the user immediately disconnects the keyboard and mouse collaborative service according to the prompt displayed in the pop-up window, and then uses the file sharing application 101 of the first electronic device 10 again to trigger the file sharing operation. After receiving the file sharing operation, the communication framework 102 of the first electronic device 10 directly sends a p2p connection request to the communication framework 102 of the second electronic device 20. The second electronic device 20 responds to the p2p connection request and determines whether to allow a p2p connection to be established with the first electronic device 10. If so, the p2p connection between the first electronic device 10 and the second electronic device 20 is successful, so that files can be transferred using the p2p connection. If not, the second status code is transparently transmitted to the file sharing application 101 of the first electronic device 10 through the communication framework 102 of the first electronic device 10. Based on the status code 1013, the file sharing application 101 of the first electronic device 10 prompts the user through a pop-up window that the file sharing service has failed.
[0193] The sharing conflict prompt method provided by the embodiment of the present application can accurately prompt the user what the reason for the current transmission failure is, guide the user's operation according to the accurate prompt, thereby solving the problem of file sharing failure and improving the user's experience. For example: it is displayed that "this machine is using the keyboard and mouse collaborative service, please disconnect and try again", which prompts the user that the file sharing failed because the keyboard and mouse collaborative service is being used, so the keyboard and mouse collaborative service is disconnected and the file sharing operation is re-performed, that is, the file sharing service is re-performed, which improves the user's experience.
[0194] Embodiment 2:
[0195] Combination Fig. 9 , another service conflict prompting method provided by an embodiment of the present application is introduced in detail. The method is applied to a first electronic device, which is the initiator of the cross-device service.
[0196] S901: The first electronic device determines whether there is an unoccupied p2p channel at the local end in response to a service start operation input by a user.
[0197] Among them, the service start operation is used to start the corresponding cross-device service. For example, when starting the multi-screen collaboration service between a mobile phone and a laptop, the mobile phone and the laptop are within the preset range, and the "Connect Now" icon is clicked on the laptop, then the user has performed the service start operation to start the multi-screen collaboration service.
[0198] Specifically, the communication framework of the first electronic device responds to the service start operation input by the user to determine whether there is an unoccupied p2p channel on the local end; the communication framework of the first electronic device is located in the application framework layer of the operating system of the first electronic device.
[0199] When there is no unoccupied p2p channel, proceed to S902.
[0200] When there is an unoccupied p2p channel, proceed to S904.
[0201] S902: When there is no unoccupied p2p channel on the local end, the first electronic device searches for conflicting services among the cross-device services of the first electronic device.
[0202] The connection state of the conflicting service is not disconnected, and the connection type of the conflicting service is p2p.
[0203] Specifically, when there is no unoccupied p2p channel on the local end, the cross-device application of the first electronic device searches for conflicting services in the cross-device services of the first electronic device. The cross-device application of the first electronic device is located in the application program layer of the operating system of the first electronic device.
[0204] Furthermore, the conflicting services among the cross-device services of the first electronic device are searched by using the connection attribute value of the cross-device service. The connection attribute value is used to indicate the connection state and connection type of the service.
[0205] In a possible implementation, the connection attribute value of the cross-device service is obtained in the following manner:
[0206] The communication framework of the first electronic device sends a first status code to the cross-device application of the first electronic device; the cross-device application of the first electronic device sends a connection attribute acquisition request to the control center of the first electronic device based on the first status code; the control center of the first electronic device responds to the connection attribute acquisition request and returns the connection attribute value of the cross-device service to the cross-device application of the first electronic device. The first status code is used to indicate that the first electronic device does not have an unoccupied p2p channel.
[0207] S903: The first electronic device prompts the reason for the cross-device service failure through a pop-up window based on the found conflicting service.
[0208] Specifically, the cross-device application of the first electronic device prompts the reason for the failure of the cross-device service through a pop-up window based on the found conflicting service.
[0209] Furthermore, when no conflicting service is found, a pop-up window prompts that the cross-device service has failed.
[0210] The reason why the conflicting service is not found is that a control center of the first electronic device fails and cannot update the connection status and connection type of the cross-device service in time.
[0211] S904: When there is an unoccupied p2p channel at the local end, the first electronic device sends a p2p connection request to the second electronic device.
[0212] When the second electronic device receives the p2p connection request, the second electronic device responds to the p2p connection request and determines whether the second electronic device is allowed to establish a p2p connection with the first electronic device.
[0213] S905: When the second electronic device does not allow the establishment of a p2p connection with the first electronic device, the first electronic device prompts the user through a pop-up window that the cross-device service has failed.
[0214] Furthermore, when the second electronic device allows to establish a p2p connection with the first electronic device, the first electronic device establishes a p2p connection with the second electronic device, and based on the p2p connection, a cross-device service between the first electronic device and the second electronic device is implemented.
[0215] The embodiment of the present application provides a service conflict prompt method, which includes: in response to the service start operation input by the user, determining whether there is an unoccupied p2p channel on the local side; when there is no unoccupied p2p channel on the local side, searching for conflicting services in the cross-device services of the first electronic device; the connection state of the conflicting services is not unconnected, and the connection type of the conflicting services is p2p; based on the conflicting services found, prompting the reason for the failure of the cross-device services through a pop-up window. When the cross-device services fail because all the p2p channels on the local side are occupied, searching for conflicting services in the cross-device services on the local side, and then accurately prompting the reason for the failure of the cross-device services through a pop-up window based on the conflicting services, thereby guiding the user's operation and improving the user's experience.
[0216] Furthermore, by utilizing the connection attribute values of cross-device services stored in the control center of the application layer of the operating system of the first electronic device, conflicting services can be searched for, and accurate indication of the cause of cross-device service failure can be achieved without additional program modification or configuration, thereby simplifying the complexity of updates.
[0217] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the electronic device implements the above-mentioned functions or steps.
[0218] An embodiment of the present application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, enables an electronic device to implement the above-mentioned functions or steps.
[0219] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A service conflict prompting method, characterized in that: Applied to a first electronic device, the method includes: In response to a service start operation input by a user, determining whether there is an unoccupied p2p channel on the local end; the service start operation is used to start a corresponding cross-device service; When there is no unoccupied p2p channel at the local end, searching for conflicting services among the cross-device services of the first electronic device; the connection state of the conflicting services is not unconnected, and the connection type of the conflicting services is p2p; Based on the conflicting services found, a pop-up window is displayed to indicate the reason for the cross-device service failure.
2. The method according to claim 1, characterized in that The step of judging whether there is an unoccupied p2p channel at the local end in response to the service start operation input by the user includes: The communication framework of the first electronic device responds to the service start operation input by the user to determine whether there is an unoccupied p2p channel on the local end; the communication framework is located in the application framework layer of the operating system of the first electronic device.
3. The method according to claim 1, characterized in that When there is no unoccupied p2p channel at the local end, searching for conflicting services among the cross-device services of the first electronic device; Based on the conflicting services found, a pop-up window is used to prompt the user with the reasons for the cross-device service failure, including: When there is no unoccupied p2p channel on the local end, the cross-device application of the first electronic device searches for conflicting services among the cross-device services of the first electronic device; the cross-device application of the first electronic device prompts the reason for the failure of the cross-device service through a pop-up window based on the conflicting services found; the cross-device application is an application for implementing the cross-device service corresponding to the service startup operation; the cross-device application is located in the application layer of the operating system of the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that: The searching for conflicting services among the cross-device services of the first electronic device includes: The conflicting services in the cross-device services of the first electronic device are searched by using the connection attribute value of the cross-device service; the connection attribute value is used to indicate the connection state and connection type of the service.
5. The method according to claim 4, characterized in that The connection attribute value of the cross-device service is acquired by a cross-device application of the first electronic device from a control center of the first electronic device; the cross-device application is located in an application program layer of an operating system of the first electronic device.
6. The method according to claim 5, characterized in that The connection attribute value of the cross-device service is obtained in the following manner: The communication framework of the first electronic device sends a first status code to the cross-device application of the first electronic device; the first status code is used to indicate that there is no unoccupied p2p channel of the first electronic device; The cross-device application of the first electronic device sends a connection attribute acquisition request to a control center of the first electronic device based on the first status code; The control center of the first electronic device returns the connection attribute value of the cross-device service to the cross-device application of the first electronic device in response to the connection attribute acquisition request.
7. The method according to claim 1, characterized in that The step of judging whether there is an unoccupied p2p channel at the local end in response to the service start operation input by the user includes: In response to a service start-up operation input by a user, determining whether the local end enables a dual-path p2p connection, and determining whether the first p2p channel and the second p2p channel are occupied; Wherein: when the local end enables dual-path p2p connection, and both the first p2p channel and the second p2p channel are occupied, there is no unoccupied p2p channel on the local end; When the local end enables dual-path p2p connection, and the first p2p channel and the second p2p channel are not both occupied, then the local end has an unoccupied p2p channel; When the local end does not enable the dual-path p2p connection and the first p2p channel is occupied, there is no unoccupied p2p channel on the local end; When the local end does not enable the dual-path p2p connection and the first p2p channel is not occupied, the local end has an unoccupied p2p channel.
8. The method according to claim 1, characterized in that After searching for conflicting services in the cross-device services of the first electronic device, the method further includes: When no conflicting services are found, a pop-up window will pop up to indicate that the cross-device service has failed.
9. The method according to claim 1, characterized in that: The method further comprises: When there is an unoccupied p2p channel at the local end, sending a p2p connection request to a second electronic device, so that the second electronic device responds to the p2p connection request and determines whether the second electronic device is allowed to establish a p2p connection with the first electronic device; When the second electronic device does not allow the establishment of a p2p connection with the first electronic device, a pop-up window prompts the user that the cross-device service has failed.
10. The method according to claim 9, characterized in that When the second electronic device does not allow the establishment of a p2p connection with the first electronic device, prompting a cross-device service failure through a pop-up window includes: receiving a second status code sent by the second electronic device; the second status code is used to indicate that the second electronic device is not allowed to establish a p2p connection with the first electronic device; Based on the second status code, a pop-up window is displayed to prompt that the cross-device service has failed.
11. The method according to claim 9, characterized in that The method further comprises: When the second electronic device allows to establish a p2p connection with the first electronic device, establishing a p2p connection with the second electronic device; Based on the p2p connection, a cross-device service between the first electronic device and the second electronic device is implemented.
12. An electronic device, characterized in that: including a processor and a memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the method according to any one of claims 1 to 11 is implemented.
