Equipment connection method and electronic equipment

By implementing an asynchronous mechanism between electronic devices to obtain and display the reasons for the failure of the device connection, the problem that users cannot understand the specific reasons when the device connection fails, and improves the user experience.

CN119136330APending Publication Date: 2024-12-13HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310696239.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the scenario where multiple electronic devices are interconnected, when the device connection fails, the existing technology only provides general failure prompts, and users cannot understand the specific reasons for the failure, which affects the user experience.

Method used

By implementing an asynchronous mechanism between electronic devices, we can obtain the reasons for the failure of the device and display the specific failure reasons on the user interface, so that users can understand the reasons for the failure and take corresponding recovery measures.

Benefits of technology

Improve the user experience, allow users to understand the specific reasons for failure and take corresponding recovery measures, reducing the number of retries caused by unknown errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119136330A_ABST
    Figure CN119136330A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment connection method and electronic equipment, the method is executed by first electronic equipment, and the method comprises the following steps: when a first operation input by a user is received, if the first electronic equipment has the capability of executing an instruction corresponding to the first operation, sending a request for establishing equipment connection to second electronic equipment, the first operation is used for instructing the first electronic equipment to establish equipment connection with the second electronic equipment to execute corresponding business; and under the condition that the establishment of the equipment connection fails, obtaining a cause of the execution failure, and displaying the cause of the execution failure. According to the method, the failure reason can be displayed when the equipment connection fails, so that a user can know the specific failure reason to adopt a corresponding recovery method, and the use experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic technology, and in particular to a device connection method and an electronic device. Background Art

[0002] With the development of electronic technology, there are more and more scenarios where multiple electronic devices are interconnected. For example, mobile phones are connected to tablet computers, mobile phones are connected to personal computers (PCs), mobile phones are connected to smart TVs, etc. After the electronic devices are connected, they can share information, collaborate with each other, and other functions.

[0003] In a scenario where multiple electronic devices are interconnected, when connecting between electronic devices, device connection failure may occur. For the current device connection methods, most of them only give a failure prompt when the device connection fails, but the user does not know what caused the device connection failure, which affects the user's experience. Summary of the invention

[0004] The present application provides a device connection method and an electronic device, which can display the failure reason when the device connection fails, so that the user can know the specific failure reason and take corresponding recovery methods, thereby improving the user's usage experience.

[0005] In a first aspect, the present application provides a device connection method, which is executed by a first electronic device, comprising: when receiving a first operation input by a user, if the first electronic device has the ability to execute the instruction corresponding to the first operation, sending a request to establish a device connection to a second electronic device, the first operation is used to instruct the first electronic device to establish a device connection with the second electronic device to execute a corresponding business; in the event that the device connection fails to be established, obtaining the reason for the execution failure, and displaying the reason for the execution failure.

[0006] The first electronic device may be electronic device A, i.e., the initiating end, and the second electronic device may be electronic device B, i.e., the passive end. The first operation is an operation input by a user to trigger the first electronic device to establish a device connection with the second electronic device to perform a corresponding service, and the corresponding service may be, for example, a device collaboration service, a super notification service, a super call service, a super keyboard and mouse service, etc. Before the user inputs the first operation, a physical channel may have been established between the first electronic device and the second electronic device.

[0007] In actual scenarios, whether an electronic device has the ability to execute corresponding instructions can usually be configured by a business application (business APK), for example, some business instructions can only be executed by mobile phones, some business instructions can only be executed by tablet computers, some business instructions can be executed by both mobile phones and tablet computers, etc. Therefore, the first electronic device may have the ability to execute the instructions corresponding to the first operation, or may not have the ability to execute the instructions corresponding to the first operation. If the first electronic device has the ability to execute the instructions corresponding to the first operation, the first electronic device can send a request to establish a device connection to the second electronic device. When establishing the device connection, the connection may be successful or may fail. Then, in the case of failure to establish the device connection, the first electronic device can obtain the reason for the execution failure from the business application and display the reason for the execution failure.

[0008] In the above implementation, when the user initiates a device connection operation at the initiating end, if the initiating end has the ability to initiate a device connection, the initiating end initiates a device connection to the passive end. In the event of a connection failure, the initiating end displays the reason for the execution failure. The reason for the execution failure can enable the user to know the specific reason for the failure so as to take corresponding recovery methods, thereby improving the user's experience.

[0009] In combination with the first aspect, in some implementations of the first aspect, upon receiving a first operation input by a user, the method further includes: generating a first message, the first message including a device identifier of the first electronic device and a device identifier of the second electronic device;

[0010] The sending of the request for establishing a device connection to the second electronic device includes: sending the request for establishing a device connection to the second electronic device according to the first message.

[0011] Among them, when the first electronic device receives the first operation, it can also generate a first message according to the first operation. The first message may include the device identification of the first electronic device and the device identification of the second electronic device, and can identify which device is the initiator and which device is the passive end. Then the first electronic device can send a request to establish a device connection to the second electronic device according to the first message. It can be understood that during a device connection process, the initiator and the passive end in the first message remain unchanged, that is, the first electronic device is always the initiator and the second electronic device is always the passive end, so as to compare which end is prompted when the prompt information is displayed later.

[0012] In one implementation, the first electronic device may cache the first message, so that when a message needs to be sent to the second electronic device later, the first message can be retrieved from the cache and sent.

[0013] In one implementation, the first message may also include a message generation time of the first message, and in the case of failure to establish a device connection, the method may further include: deleting the first message from the cache according to the message generation time. That is, if the device connection fails, the connection process no longer needs to continue, and the first electronic device may delete the first message in the cache to reduce the cache occupancy rate.

[0014] In combination with the first aspect, in some implementations of the first aspect, when establishing the device connection fails, the method further includes: obtaining a prompt type corresponding to a reason for the execution failure, the prompt type including at least one of a prompt on the local end, a prompt on the initiating end corresponding to the first operation, and no prompt;

[0015] The above-mentioned displaying of the reason for the execution failure includes: displaying the reason for the execution failure when the prompt type is a prompt at the local end and / or a prompt at the initiating end corresponding to the first operation.

[0016] Among them, in the case of failure to establish a device connection, the first electronic device can not only obtain the reason for the execution failure from the business application, but also obtain the prompt type corresponding to the reason for the execution failure. The prompt type indicates at which end the prompt is made, for example, it may include prompts on this end, prompts on the initiating end corresponding to the first operation, and no prompts, etc. The prompt type can also be defined by the business application. Then, when the prompt type is prompts on this end and / or prompts on the initiating end (here because the first electronic device is the initiating end), the reason for the execution failure is displayed on the display interface of the first electronic device, thereby improving the user experience.

[0017] In one implementation, when the connection fails, the first electronic device can also obtain the message generation time corresponding to the reason for the above-mentioned execution failure from the business application, that is, it can determine which message's execution result corresponds to the reason for the execution failure, and find the corresponding first message according to the message generation time.

[0018] In combination with the first aspect, in some implementations of the first aspect, the first electronic device includes a control center application; and the first operation received from the user includes: receiving the first operation through the control center application.

[0019] The first electronic device may include a control center application (control center APK) that can receive the first operation input by the user.

[0020] In one implementation, the control center application may also generate a first message according to the first operation, and cache the first message.

[0021] In combination with the first aspect, in some implementations of the first aspect, the first electronic device also includes a business application. After the first operation is received through the control center application, the method also includes: sending a first instruction to the business application through the control center application, the first instruction being an instruction generated based on the first message, and being used to instruct the business application to send a request to the second electronic device to establish a device connection.

[0022] Among them, the first electronic device may also include a business application (business APK). After generating the first message, the control center application may further generate a first instruction based on the first message, and send the first instruction to the business application APK. The first instruction may also carry the device identification of the first electronic device and the device identification of the second electronic device, which is used to instruct the business application to send a request to the second electronic device to establish a device connection.

[0023] That is to say, the device connection is initiated by the business application of the first electronic device, so when the device connection fails to be established, the business application should also first know the reason for the execution failure. Then, in one implementation, the above-mentioned acquisition of the reason for the execution failure includes: obtaining the reason for the execution failure from the business application through the control center application. After the control center application obtains the reason for the execution failure, the above-mentioned first message can be deleted, and the reason for the execution failure can be displayed on the display interface of the first electronic device.

[0024] In combination with the first aspect, in some implementations of the first aspect, if the first electronic device does not have the ability to execute instructions corresponding to the first operation, the method further includes: sending a first message to a second electronic device to instruct the second electronic device to establish a device connection with the first electronic device; receiving a second message from the second electronic device, the second message including an execution result when the second electronic device establishes a device connection with the first electronic device; if the execution result indicates a failure to establish the device connection, displaying the reason for the execution failure carried in the execution result.

[0025] From the above description, it can be known that the first electronic device may have the ability to execute the instruction corresponding to the first operation, or may not have the ability to execute the instruction corresponding to the first operation. If the first electronic device does not have the ability to execute the instruction corresponding to the first operation, the second electronic device is required to execute it. Then, the first electronic device can send a first message to the second electronic device to instruct the second electronic device to establish a device connection with the first electronic device. Since a physical channel has been established between the first electronic device and the second electronic device when the first electronic device discovers the second electronic device, the first electronic device can establish a data channel based on the physical channel to send the above-mentioned first message to the second electronic device.

[0026] After the second electronic device executes the process of establishing the device connection, the execution result can be returned to the first electronic device. If the device connection fails to be established, the first electronic device can display the reason for the execution failure carried in the execution result.

[0027] In the above implementation method, if the initiating end does not have the ability to initiate a device connection, the passive end initiates the device connection to the initiating end. In the event of a connection failure, the reason for the execution failure can be displayed on the passive end. At the same time, the passive end can also return the reason for the execution failure to the initiating end, so that the initiating end also displays the reason for the execution failure, further improving the user experience.

[0028] In combination with the first aspect, in some implementation methods of the first aspect, the above-mentioned execution result also carries a prompt type corresponding to the reason for the execution failure, and the above-mentioned display of the reason for the execution failure carried in the execution result includes: when the prompt type includes a prompt at the initiating end corresponding to the first operation, the reason for the execution failure is displayed.

[0029] In the scenario where the device connection is executed by the second electronic device, the execution result returned by the second electronic device may also carry a corresponding prompt type, so that the first electronic device determines whether it is necessary to display the reason for the execution failure on the device. Then, if the prompt type includes a prompt on the initiating end (the initiating end is the first electronic device), the first electronic device can display the reason for the above-mentioned execution failure.

[0030] In combination with the first aspect, in some implementations of the first aspect, the receiving of the second message from the second electronic device includes: receiving the second message from the second electronic device through a control center application.

[0031] That is, the first electronic device can receive the second message through the control center application to display the reason for the execution failure when the device connection fails.

[0032] In combination with the first aspect, in some implementations of the first aspect, before receiving a first operation input by a user, the method further includes: displaying a first interface, the first interface presenting an icon of a first electronic device and an icon of a second electronic device, the second electronic device being discovered by the first electronic device through a near field communication protocol, and a user account logged in on the second electronic device is the same as a user account logged in on the first electronic device, and the first operation is an operation input on the first interface.

[0033] Among them, the above-mentioned process of establishing device connection can be realized by the smart interconnection function. On the display interface of the smart interconnection (i.e., the first interface), the icon of the first electronic device (for example, the first electronic device is a mobile phone) can be located in the middle position, and the icons of other electronic devices (i.e., the second electronic device) scanned and discovered by the first electronic device can be displayed around the icon of the first electronic device. If the user wants to establish a connection between the first electronic device and the second electronic device, an operation indicating the establishment of a connection can be input on the first interface, such as clicking on the icon of the second electronic device, or inputting a voice command. It should be noted that the user account logged in on the above-mentioned first electronic device is the same as the user account logged in on the second electronic device.

[0034] In one implementation, the user may also drag the icon of the second electronic device to the location of the icon of the first electronic device, thereby triggering establishment of a connection between the first electronic device and the second electronic device.

[0035] In a second aspect, the present application provides a device connection method, which is executed by a second electronic device, including: receiving a first message from a first electronic device, the first message being used to instruct the second electronic device to establish a device connection with the first electronic device; sending a request to the first electronic device to establish a device connection; in the event of a failure to establish a device connection, obtaining and displaying the reason for the execution failure, and sending a second message to the first electronic device, the second message including an execution result when the second electronic device establishes a device connection with the first electronic device, the execution result carrying the reason for the execution failure.

[0036] Since the first electronic device may or may not have the ability to execute the instruction corresponding to the first operation, if the first electronic device does not have the ability to execute the instruction corresponding to the first operation, the second electronic device is required to execute it. Then, the second electronic device can receive the first message sent by the first electronic device, which is used to instruct the second electronic device to establish a device connection with the first electronic device. After the second electronic device receives the first message, it can optionally cache the first message and send a request to the first electronic device to establish a device connection.

[0037] In one implementation, the second electronic device may also include a control application and a service application. The control application of the second electronic device may receive the first message and send a second instruction to the service application based on the first message to instruct the service application to establish a device connection with the first electronic device.

[0038] When the second electronic device establishes a device connection with the first electronic device, the connection may also be successful or fail. In the case of failure to establish a device connection, the second electronic device may also display the reason for the execution failure. In one implementation, the second electronic device may also provide a prompt based on the prompt type corresponding to the reason for the execution failure. For example, when the prompt type includes a prompt on the local end, the second electronic device displays the reason for the execution failure.

[0039] At the same time, the second electronic device may also send the execution result to the first electronic device, where the execution result carries the reason for the execution failure, so that the first electronic device also displays the reason for the execution failure.

[0040] In the above implementation method, if the initiating end does not have the ability to initiate a device connection, the passive end initiates the device connection to the initiating end. In the event of a connection failure, the reason for the execution failure can be displayed on the passive end. At the same time, the passive end can also return the reason for the execution failure to the initiating end, so that the initiating end also displays the reason for the execution failure, further improving the user experience.

[0041] In a third aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the first aspect and the possible implementation of the first aspect, or the function of implementing the electronic device behavior in the second aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a receiving module or unit, a processing module or unit, etc.

[0042] In a fourth aspect, the present application provides an electronic device, comprising: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect, or executes any one of the methods in the technical solution of the second aspect.

[0043] In a fifth aspect, the present application provides a device connection system, including a first electronic device and a second electronic device, wherein the first electronic device executes any one of the methods in the technical solution of the first aspect, and the second electronic device executes any one of the methods in the technical solution of the second aspect.

[0044] In a sixth aspect, the present application provides a chip, including a processor. The processor is used to read and execute a computer program stored in a memory to execute the method in the first aspect and any possible implementation thereof, or execute the method in the second aspect and any possible implementation thereof.

[0045] Optionally, the chip also includes a memory, and the memory is connected to the processor via a circuit or wire.

[0046] Further optionally, the chip also includes a communication interface.

[0047] In the seventh aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect, or executes any one of the methods in the technical solution of the second aspect.

[0048] In an eighth aspect, the present application provides a computer program product, which includes: a computer program code, which, when the computer program code runs on an electronic device, enables the electronic device to execute any one of the methods in the technical solution of the first aspect, or execute any one of the methods in the technical solution of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 This is a schematic diagram of an interface for entering a smart interconnection interface provided in an embodiment of the present application;

[0050] Figure 2 This is a schematic diagram of an operation interface for establishing a device connection provided in an embodiment of the present application;

[0051] Figure 3 This is a schematic diagram of an interface for establishing a successful or failed device connection provided by the relevant technology;

[0052] Figure 4 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0053] Figure 5 is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0054] Figure 6 This is a schematic diagram of a process of establishing a device connection provided by an embodiment of the present application;

[0055] Figure 7 is another schematic diagram of a process for establishing a device connection provided by an embodiment of the present application;

[0056] Figure 8 This is a schematic diagram of a process of establishing a device connection provided by the related technology;

[0057] Fig. 9 It is an interface diagram of an example of a device connection process provided by the related technology;

[0058] Fig.10 It is another schematic diagram of the process of establishing device connection provided by the related technology;

[0059] Fig.11 This is another schematic diagram of a process for establishing a device connection provided by an embodiment of the present application;

[0060] Fig.12 This is another schematic diagram of a process for establishing a device connection provided by an embodiment of the present application;

[0061] Fig.13 It is a flowchart of a device connection method provided in an embodiment of the present application;

[0062] Fig.14 This is a schematic diagram of a prompt information interface when a device connection fails, provided in an embodiment of the present application;

[0063] Fig.15 is a flowchart of another device connection method provided in an embodiment of the present application;

[0064] Fig.16 It is a flowchart of a device connection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0066] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.

[0067] With the development of electronic technology, there are more and more scenarios where multiple electronic devices are interconnected. For example, mobile phones are connected to tablets, mobile phones are connected to PCs, mobile phones are connected to smart TVs, etc. In some scenarios, the interconnection of electronic devices can also be called smart interconnection, super terminals, etc., and the functions they implement are similar. For example, electronic devices can transmit information to each other and share information, or electronic devices can collaborate with each other and control another electronic device through one electronic device.

[0068] In scenarios where multiple electronic devices are interconnected, when connecting between electronic devices, device connection failure may occur. For the current device connection process, most of them only give a failure prompt when the device connection fails, such as only displaying the prompt message "Collaborative connection abnormality, please try again later", but the user does not know what caused the device connection failure, which affects the user experience.

[0069] For example, a user establishes a connection with other electronic devices through a mobile phone. Figure 1 As shown, on the display interface of the electronic device (such as a desktop interface or an application interface), when the user slides downward from the upper edge of the electronic device in the direction of the arrow, the electronic device can display a drop-down menu bar interface in response to the user's sliding operation. The drop-down menu bar interface includes one or more setting controls, such as WLAN setting controls, Bluetooth setting controls, mobile data setting controls, automatic rotation setting controls, and screen projection setting controls. In addition, the drop-down menu bar interface can also include cards such as smart interconnection and mobile phone usage information. If the user clicks on the "Smart Interconnection" card, the electronic device can jump to the following: Figure 2 The smart interconnection interface shown.

[0070] exist Figure 2 In the interface shown, the icon of the electronic device itself (for example, the mobile phone icon in this example) is located in the middle, and the icons of other electronic devices scanned and discovered by the electronic device are displayed around the mobile phone icon. If the user wants to establish a connection between the electronic device and other electronic devices, the user can drag the icon of the other electronic device and drag it to the position of the mobile phone icon to establish a connection between the electronic device and the other electronic device. For example, if the user wants to establish a connection between a mobile phone and tablet computer 1 (Pad1), the user can drag the icon of tablet computer 1 to the position of the mobile phone icon; if the connection between the mobile phone and tablet computer 1 is successfully established, it can be displayed Figure 3 The interface shown in Figure (a) is that the icon of the tablet computer 1 is attached to the side of the mobile phone icon. If the connection between the mobile phone and the tablet computer 1 fails, the related technology can display Figure 3 In the interface shown in Figure (b), the icon of the tablet computer 1 is bounced back and a prompt message "Collaborative connection abnormality, please try again later" is displayed.

[0071] That is to say, the current existing device connection process does not give a specific reason for the connection failure, so that the user cannot perceive the specific failure reason and recovery method, resulting in a poor user experience.

[0072] The device connection method provided in the embodiment of the present application can use an asynchronous mechanism to obtain the reason when the device connection fails, and display the reason when the device connection fails, so that the user can know the specific reason for the failure to take corresponding recovery methods, thereby improving the user's experience. It should be noted that the device connection method provided in the embodiment of the present application can be applied to mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA) and other electronic devices with device connection functions. The embodiment of the present application does not impose any restrictions on the specific types of electronic devices.

[0073] For example, Figure 4 1 is a schematic diagram of the structure of an example of an electronic device 100 provided in an embodiment of the present application. Taking the electronic device 100 as a mobile phone as an example, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

[0075] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0076] 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.

[0077] 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.

[0078] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0079] 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 the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0080] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0081] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0082] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0083] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 4 The structures of antenna 1 and antenna 2 in the electronic device 100 are only examples. Each antenna in the electronic device 100 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.

[0084] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. 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.

[0085] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. 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 it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0086] In some embodiments, the antenna 1 of the electronic device 100 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 100 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. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and / or the satellite based augmentation system (SBAS).

[0087] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 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 that execute program instructions to generate or change display information.

[0088] The display screen 194 is used to display images, videos, etc. The display screen 194 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 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0089] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0090] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0091] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 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 sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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.

[0092] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0093] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K 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 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.

[0094] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.

[0095] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0096] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 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.

[0097] The software system of the electronic device 100 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 100.

[0098] Figure 51 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role 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, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages, such as the Android application package (Android application package, APK).

[0099] like Figure 5 As shown, the application package may include a control center APK, a business APK, a device service management (device profile) APK, and a device connection APK (eg, MagicLink), etc.

[0100] Among them, the control center APK is used for device management, service management, conflict handling and service scheduling, etc. The control center APK may be integrated with a device service management software development kit (SDK), a device connection SDK, etc., so as to call the device service management APK or the device connection APK to implement the corresponding function when there is a demand. The service APK is used to implement the corresponding service functions, for example, it may include device collaboration services, super notification services, super call services, super keyboard and mouse services, etc. The service APK is integrated with the control center SDK, and the control center APK can issue instructions to the service APK to implement the scheduling of services. The service APK may also be integrated with the device service management SDK, and the device status may be updated to the device service management APK when the device status changes. The device service management APK may be used to manage the device status, for example, after the electronic device 100 establishes a connection with other electronic devices, the device status is updated to the idle state when there is no device connection, or the device status is updated according to the information of the service APK, etc. The device connection APK is used to realize the connection between electronic devices according to the connection protocol.

[0101] In addition, the application package can also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. Figure 5 Not shown yet.

[0102] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0103] like Figure 5 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, and the like.

[0104] 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.

[0105] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0106] 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.

[0107] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).

[0108] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0109] 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.

[0110] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0111] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0112] 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.

[0113] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0114] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0115] 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.

[0116] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0117] A 2D graphics engine is a drawing engine for 2D drawings.

[0118] 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.

[0119] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 4 and Figure 5 Taking the electronic device with the structure shown as an example, the device connection method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.

[0120] The method of entering the smart interconnection interface in the embodiment of the present application can refer to the above Figure 1 , that is, open the smart interconnection interface by means of a drop-down menu bar. In addition, optionally, in another implementation, the user can also enter the smart interconnection interface through the settings interface. The settings interface generally includes WLAN option controls, Bluetooth option controls, mobile network option controls, smart interconnection option controls, etc. When the user clicks on the smart interconnection option control, the user can enter the smart interconnection settings interface, on which the user can set the smart interconnection function and bind a new device. For example, if the user clicks on the bind new device control, the electronic device can jump to the above Figure 2 The smart interconnection interface shown in the figure, on which the icon of the electronic device itself (for example, the mobile phone icon in this example) is located in the middle, and the icons of other electronic devices scanned and discovered by the electronic device are displayed around the mobile phone icon. If the user wants to establish a connection between the electronic device and other electronic devices, he can drag the icon of the other electronic device and drag it to the position of the mobile phone icon, and the connection between the electronic device and the other electronic device can be established.

[0121] It can be understood that the other electronic devices scanned and discovered by the electronic device can be devices logged in with the same user account as the current device, and both the electronic device and the other electronic devices have turned on the Bluetooth switch and / or the WLAN switch, that is, they can be discovered through the near field communication protocol.

[0122] When the user drags the icon of other electronic devices through the above-mentioned smart interconnection interface to trigger the establishment of device connection, the electronic device can establish the device connection in at least the following two ways. For the convenience of description, the following embodiment refers to this device as electronic device A and other electronic devices as electronic device B.

[0123] The first method: Figure 6 As shown, after electronic device A receives the user input of dragging the icon of electronic device B, the control center APK of electronic device A can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device B to establish a device connection. That is, in this way, the business APK of electronic device A has the ability to execute the instruction to establish a device connection.

[0124] The second method: Figure 7 As shown, after electronic device A receives the user input operation of dragging the icon of electronic device B, the control center APK of electronic device A can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device B. If the business APK of electronic device A does not have the ability to execute the instruction to establish a device connection, the business APK can forward the instruction to the other end through the control center APK, so that the control center APK sends an instruction to the control center APK of electronic device B to instruct electronic device B to execute the establishment of a device connection. After receiving the instruction, the control center APK of electronic device B can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device A to establish a device connection, that is, in this method, the business APK of electronic device B needs to execute the instruction to establish a device connection.

[0125] For the above two methods, after the control center APK sends a scheduling instruction to the business APK, the control center APK usually does not block and wait for the execution result of the business APK, but listens to the status information changes of the device service management APK (which can be referred to as profileAPK for short). Among them, because the business APK is integrated with the device service management SDK (which can be referred to as profileSDK for short), when the device status changes, the business APK can update the device status information to the profile APK through the API interface, and then the profile APK can synchronize the device status information to the control center APK (the control center APK is also integrated with the profile SDK) through the status synchronization mechanism. Based on this mechanism, the process of the control center APK in the related technology for connecting the device according to the above two methods is respectively:

[0126] The first method: Figure 8 As shown, after electronic device A receives the user input of dragging the icon operation of electronic device B, the control center APK of electronic device A can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device B to establish a device connection. At the same time, the control center APK monitors the status information changes of the profile APK. When a device connection is not established between electronic device A and electronic device B, the device state of electronic device A can be recorded as an idle state. After the device connection is completed between the business APK of electronic device A and the business APK of electronic device B, the business APK of electronic device A can update the device status information (such as connected) to the profileAPK through the profile SDK and API interface. If the control center APK monitors the status information changes in the profile APK and the current device status is connected, the control center APK can also refresh the device status to connected, and update the display interface of electronic device A, for example, to the above Figure 3 The interface shown in Figure (a) in FIG. 1 shows that the icon of electronic device B is attached to the side of the icon of electronic device A. It can be understood that the profile APK of electronic device A can also synchronize the device status information to the profile APK of electronic device B, so that the control center APK of electronic device B also updates the device status.

[0127] During the process of establishing a device connection between electronic device A and electronic device B, since it usually takes a few seconds to establish a device connection, during this period, the business APK of electronic device A can also update the device status from idle to connected through the profile SDK and update it to the profile APK. When the control center APK monitors the status information in the profile APK to connect, it can confirm that the device is currently connected and can also update the display interface of electronic device A, for example, to Fig. 9 The interface shown, that is, the icon of electronic device B is not completely attached to the icon of electronic device A, or the message "connecting" is displayed. When the device status is subsequently updated to connected, the display interface of electronic device A changes to the above Figure 3 The interface shown in Figure (a).

[0128] Since the device connection may fail, if the device connection is not completed between the business APK of electronic device A and the business APK of electronic device B, the business APK of electronic device A can update the device status from connecting to idle again through the profile SDK and update it to the profile APK. When the control center APK monitors the status information in the profile APK to change to idle, it can confirm that the current device connection has failed, and can also update the display interface of electronic device A, for example, in the related art, it is updated to the above Figure 3 The interface shown in Figure (b) is where the icon of electronic device B is separated from the icon of electronic device A and a prompt message "Collaborative connection abnormality, please try again later" is displayed.

[0129] The second method: The implementation principle of this method is similar to the first method, except that Fig.10 As shown, the second method is that the business APK of electronic device B initiates the establishment of device connection, which requires the control center APK of electronic device A to send instructions to the control center APK of electronic device B (for example, sending instructions to electronic device B through the device connection APK), so that the control center APK of electronic device B sends scheduling instructions to the business APK, and the business APK and the business APK of electronic device A establish a device connection. At the same time, the control center APK of electronic device B monitors the status information changes in the profile APK, and the profile APK of electronic device B can also synchronize the device status information to the profile APK of electronic device A, so that the control center APK of electronic device A also updates the device status. In this way, if the device connection is not completed between the business APK of electronic device B and the business APK of electronic device A, the control center APK of electronic device B will update the display interface, and display a prompt message of connection failure on the interface of electronic device B.

[0130] From these two methods, it can be seen that the control center APK of the related technology only obtains the result of the device connection by monitoring the profile APK, and can only know whether the connection is successful or failed, but cannot know the reason for the connection failure. Accordingly, the control center APK cannot display sufficient prompt information to prompt the user. In addition, in the second method, the user initiates the connection operation on electronic device A. If the prompt information is displayed on electronic device B, the user needs to observe the execution status of electronic device B at the same time, which brings inconvenience to the user and further affects the user's experience.

[0131] Based on this, in the embodiment of the present application, after the control center APK sends the scheduling instruction to the business APK, the asynchronous mechanism is enabled so that the business APK returns the failure reason to the control center APK when the instruction fails to execute, and then displays the failure reason on the interface, thereby improving the user experience. For the above two methods, the process of the control center APK connecting the device in the embodiment of the present application is as follows:

[0132] The first method: Fig.11 As shown, after electronic device A receives the user input of dragging the icon operation of electronic device B, the control center APK of electronic device A can send a scheduling instruction to the service APK to instruct the service APK to interact with the service APK of electronic device B to establish a device connection. In the case of failure to establish a device connection, the service APK of electronic device A can return the failure reason to the control center APK, and then display the failure reason on the display interface of electronic device A, so that the user can know the failure reason and the corresponding recovery method.

[0133] The second method: Fig.12As shown, after electronic device A receives the user input operation of dragging the icon of electronic device B, the control center APK of electronic device A can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device B. If the business APK of electronic device A does not have the ability to execute the instruction to establish a device connection, the business APK can forward the instruction to the opposite end through the control center APK, so that the control center APK sends an instruction to the control center APK of electronic device B to instruct electronic device B to execute the establishment of device connection. After receiving the instruction, the control center APK of electronic device B can send a scheduling instruction to the business APK to instruct the business APK to interact with the business APK of electronic device A to establish a device connection. In the case of failure to establish a device connection, the business APK of electronic device B can return the failure reason to the control center APK, and display the failure reason on the display interface of electronic device B; and the control center APK of electronic device B can forward the failure reason to electronic device A, so that electronic device A also displays the failure reason, so that the user does not need to observe the execution of electronic device B, and can know the failure reason and the corresponding recovery method only through electronic device A.

[0134] For details about the specific process of the device connection method provided in the embodiment of the present application, please refer to the description of the following embodiment. Fig.13 : is a flow chart of a device connection method provided in an embodiment of the present application, and the method may include:

[0135] S11, the control center APK of electronic device A receives a first operation input by a user and generates a first message.

[0136] The first operation can be the above Figure 2 The operation of dragging the icon of the electronic device B shown in the figure may also be other forms of triggering operations, which are intended to trigger the electronic device A to establish a device connection with the electronic device B to execute the corresponding service. It can be understood that Figure 2 The electronic device B is discovered by the electronic device A through the near field communication protocol, and at this time, a physical channel may have been established between the electronic device A and the electronic device B.

[0137] The first message may include the device identification of electronic device A and the device identification of electronic device B, and identify which device is the initiator and which device is the passive end. Optionally, the device identification may be information such as device ID and device name.

[0138] Optionally, two data fields may be defined in the first message, one data field indicating the initiating end, and the other data field indicating the passive end. For example, sourceDeviceId indicates the initiating end, and destDeviceId indicates the passive end. In the embodiment of the present application, sourceDeviceId is the device identification of electronic device A, and destDeviceId is the device identification of electronic device B.

[0139] In addition, the first message may also include the generation time of the first message. Optionally, the generation time may be used as an identifier of the first message, so as to subsequently find the first message according to the generation time and perform corresponding operations.

[0140] Exemplarily, the data structure of the first message (CallBusinessMessage) can be expressed as:

[0141] public class CallBusinessMessage{

[0142] protected String sourceDeviceId; / / Initiator

[0143] protected String destDeviceId; / / passive end

[0144] protected long timestamp; / / message generation time

[0145] protected int operation;

[0146] …

[0147] }

[0148] It can be understood that during a device connection operation, the initiating end and the passive end in the first message remain unchanged, that is, electronic device A is always the initiating end, and electronic device B is always the passive end.

[0149] S12, the control center APK of electronic device A caches the first message.

[0150] The control center APK may cache the first message in the memory, for example, in a MsgCache container created by the control center APK.

[0151] S13, the control center APK of electronic device A sends a first instruction to the service APK according to the first message.

[0152] Among them, the first instruction can be an instruction obtained by converting the first message, and the first instruction carries the device identification of the device and the device identification of the opposite device, which is used to instruct the service APK to establish a device connection with the opposite device (i.e., electronic device B) to execute the corresponding service. The first instruction can also be understood as the scheduling instruction sent by the control center APK to the service APK described above. In this step, the device is electronic device A, and the opposite device is electronic device B.

[0153] Optionally, two data fields may be defined in the first instruction, one data field representing the local device and the other data field representing the peer device. For example, localDeviceId represents the local device and remoteDeviceId represents the peer device. In this step, localDeviceId is the device identifier of electronic device A and remoteDeviceId is the device identifier of electronic device B. In addition, the first instruction may also include the generation time of the first message.

[0154] Exemplarily, the data structure of the first instruction (CallBusinessCmd) can be expressed as:

[0155] public class CallBusinessCmd{

[0156] protected String localDeviceId; / / This device

[0157] protected String remoteDeviceId; / / Peer device

[0158] protected long timestamp; / / message generation time

[0159] protected int operation;

[0160] …

[0161] }

[0162] Optionally, the message generation time in the first instruction may be a unique identifier of the first instruction, that is, the message generation time may uniquely correspond to the first instruction.

[0163] Optionally, the control center APK of electronic device A may send the first instruction to the business APK via the API interface callInnerBusiness provided by the control center SDK.

[0164] S14, the service APK of electronic device A determines whether it has the ability to execute the first instruction. If it has the ability to execute the first instruction, S15 is executed; if it does not have the ability to execute the first instruction, S19 is executed.

[0165] In the embodiment of the present application, the service APK can determine whether it has the ability to execute the above-mentioned first instruction according to the configuration of the service itself, for example, some service instructions can only be executed by mobile phones, some service instructions can only be executed by tablet computers, some service instructions can be executed by both mobile phones and tablet computers, etc. For example, for a service of establishing a device connection between a mobile phone and a tablet computer for device collaboration, the tablet computer needs to execute the device connection establishment, and the service APK of the mobile phone does not have the ability to execute the device collaboration instruction.

[0166] S15, the service APK of electronic device A and the service APK of electronic device B establish a device connection.

[0167] During the process of establishing a device connection, the business APK of electronic device A can send a request to establish a connection to the business APK of electronic device B. After the business APK of electronic device B confirms that the connection request is legitimate, it can reply with a confirmation message to the business APK of electronic device A, thus establishing a device connection.

[0168] S16, the service APK of electronic device A replies the execution result to the control center APK.

[0169] When the service APK of electronic device A establishes a device connection with the service APK of electronic device B, the connection may be successful or failed. Then, the execution result replied by the service APK to the control center APK may be a successful execution or a failed execution. Optionally, different marks can be used to represent different execution results, for example, 1 indicates a successful execution and 0 indicates a failed execution.

[0170] In one implementation, the service APK may call the replyOperationResult method to reply the execution result to the control center APK.

[0171] In another implementation, the business APK may also reply the execution result, i.e., the failure result, to the control center APK only when the connection fails. Optionally, the execution result may include, but is not limited to, the following information: the message generation time corresponding to the first instruction, the error code of the execution failure, the reason for the execution failure, and the prompt type. Among them, the message generation time corresponding to the first instruction can be an identifier of the execution result, which is used to enable the control center APK to find the corresponding first message according to the message generation time; the error code of the execution failure can be defined by the business APK, which is used for subsequent operations such as marking when analyzing the error data; the reason for the execution failure is the information displayed on the interface of the electronic device for prompting the user; the prompt type indicates which end is prompted, for example, it can include prompts at the local end, prompts at the initiating end, and no prompts, and the prompt type can also be defined by the business APK. It can be understood that the message generation time can still be used as a unique identifier in the execution result to identify which message is the execution result, and it is not necessary to reply the entire content of the above-mentioned first instruction to the control center APK, thereby avoiding the risk of the instruction content being tampered with or modified during the reply process, and improving data security.

[0172] It should be noted that the process of the control center APK executing and obtaining the execution result returned by the business APK and the process of monitoring after sending a scheduling instruction to the business APK adopt an asynchronous mechanism, that is, the control center APK does not need to wait synchronously after sending a scheduling instruction to the business APK, and can start another thread to obtain the execution result returned by the business APK to avoid blocking caused by synchronous waiting. At the same time, the control center APK can also continue to monitor the status information changes of the profile APK, and the process remains unchanged. However, compared with the process of monitoring the status information changes of the profile APK to know whether the device connection is successful or failed, the delay of the control center APK obtaining the execution result returned by the business APK is shorter, and the execution result can be sent to the control center APK within about 1 millisecond, and its reliability is higher.

[0173] S17, if the execution result is execution failure, the control center APK of electronic device A deletes the cached first message, and displays the reason for the execution failure on the display interface of electronic device A according to the prompt type.

[0174] In the case where the execution result is an execution failure, because the execution result includes the message generation time corresponding to the first instruction, which is the generation time of the first message, the control center APK of electronic device A can find the corresponding first message from the cache according to the message generation time, and then delete the first message to reduce the cache occupancy rate. At the same time, because the current device connection has failed, electronic device A needs to prompt the user. Unlike the related art, the embodiment of the present application no longer only displays general information such as "Collaborative connection abnormality, please try again later", but displays the reason for the execution failure received by the control center APK.

[0175] For example, the reasons for the execution failure may include "Super Keyboard and Mouse supports connecting to up to 3 devices at the same time, please disconnect the existing connection and try again", "Smart Screen cannot establish a connection in the off screen state, please turn on the screen and try again", etc. Fig.14 As shown, it is a schematic diagram of an electronic device displaying a prompt message when a device connection fails in an embodiment of the present application. As can be seen from the figure, the user can know the specific cause of the failure and take corresponding recovery methods.

[0176] In one implementation, the control center APK of electronic device A can determine the need to display the reason for the execution failure based on the above-mentioned prompt type. For example, when the prompt type is a prompt on this end and / or a prompt on the initiating end (here because electronic device A is the initiating end), the reason for the execution failure is displayed on the display interface of electronic device A.

[0177] S18, the control center APK of electronic device A determines whether the device is an initiator, and if so, the process ends.

[0178] Among them, because the device in the first instruction is electronic device A, and the initiator in the first message is also electronic device A, the control center APK can determine that the device is the initiator, and then after the prompt information is displayed on the device, the process can be ended. For the case where the device is not the initiator, refer to the description of the following process.

[0179] The above process from S15 to S18 is a case where the service APK of electronic device A has the ability to execute the first instruction. If the service APK of electronic device A does not have the ability to execute the first instruction, the following process may be executed.

[0180] S19, the service APK of electronic device A forwards the instruction to the other end through the control center APK.

[0181] Among them, when the business APK of electronic device A does not have the ability to execute the first instruction, it can be executed by the business APK of electronic device B. The business APK of electronic device A can forward the instruction to the other end through the control center APK, and the control center APK sends a message to establish a device connection to electronic device B, so that electronic device B initiates the establishment of a device connection.

[0182] Optionally, when the business APK forwards the instruction to the other end through the control center APK, the above-mentioned first instruction may be forwarded to the other end, and the first instruction may carry the above-mentioned message generation time, so that the control center APK can subsequently determine which message needs to be sent to electronic device B according to the instruction, or the control center APK can then encapsulate the first instruction into a message form and send it to electronic device B.

[0183] Optionally, the business APK of electronic device A may call an API interface callDistributedBusiness provided by the control center SDK to enable the control center APK to forward the instruction to the peer end.

[0184] S20, the control center APK of electronic device A sends a first message to the control center APK of electronic device B.

[0185] Because a physical channel has been established between electronic device A and electronic device B when electronic device A discovers the electronic device B, electronic device A can establish a data channel based on the physical channel to send the above-mentioned first message to electronic device B.

[0186] In one implementation, the data channel established between electronic device A and electronic device B may be a Bluetooth channel, a WLAN channel, etc., or may be a data channel established based on a MagicLink mechanism, for example, a preferred method is selected from currently selectable communication methods to establish a data channel, and the embodiments of the present application do not impose any restrictions on this.

[0187] S21, the control center APK of electronic device B caches the first message.

[0188] The control center APK may cache the first message in the memory, for example, in a MsgCache container created by the control center APK.

[0189] S22, the control center APK of the electronic device B sends a second instruction to the service APK according to the first message.

[0190] The second instruction may be an instruction obtained by converting the first message, and the second instruction carries the device identification of the device and the device identification of the opposite device, and is used to instruct the service APK to establish a device connection with the opposite device. The second instruction may also be understood as a scheduling instruction sent by the control center APK to the service APK. In this step, the device is electronic device B, and the opposite device is electronic device A.

[0191] Optionally, two data fields may also be defined in the second instruction, one data field represents the current device, and the other data field represents the opposite device. For example, localDeviceId represents the current device, and remoteDeviceId represents the opposite device. In this step, localDeviceId is the device identifier of electronic device B, and remoteDeviceId is the device identifier of electronic device A, that is, the current device and the opposite device in the second instruction are opposite to those in the first instruction. In addition, the second instruction may also include the generation time of the first message, and the message generation time may also be the unique identifier of the second instruction.

[0192] S23, the service APK of electronic device B establishes a device connection with the service APK of electronic device A according to the second instruction.

[0193] During the process of establishing a device connection, the business APK of electronic device B can send a request to establish a connection to the business APK of electronic device A. After the business APK of electronic device A confirms that the connection request is legitimate, it can reply with a confirmation message to the business APK of electronic device B, thus establishing a device connection.

[0194] S24, the business APK of electronic device B replies the execution result to the control center APK.

[0195] When the service APK of electronic device B establishes a device connection with the service APK of electronic device A, the connection may be successful or failed. Then, the execution result replied by the service APK to the control center APK may be a successful execution or a failed execution. Optionally, different marks can be used to represent different execution results, for example, 1 indicates a successful execution and 0 indicates a failed execution.

[0196] In one implementation, the service APK may call the replyOperationResult method to reply the execution result to the control center APK.

[0197] In another implementation, the service APK may also reply the execution result, i.e., the failure result, to the control center APK only when the connection fails. Optionally, the execution result may include, but is not limited to, the following information: the message generation time corresponding to the second instruction, the error code of the execution failure, the reason for the execution failure, and the prompt type. The prompt type indicates which end is prompted, for example, it may include prompts at the local end, prompts at the initiating end, and no prompts, etc. The prompt type may also be defined by the service APK.

[0198] S25, if the execution result is execution failure, the control center APK of electronic device B deletes the cached first message, and displays the reason for the execution failure on the display interface of electronic device B according to the prompt type.

[0199] In the case where the execution result is an execution failure, because the execution result includes the message generation time corresponding to the second instruction, which is the generation time of the first message, the control center APK of the electronic device B can find the corresponding first message from the cache according to the message generation time, and then delete the first message to reduce the cache occupancy rate. At the same time, because the current device connection has failed, the electronic device B can prompt the user. Unlike the related art, the embodiment of the present application no longer only displays general information such as "Collaborative connection abnormality, please try again later", but displays the reason for the execution failure received by the control center APK.

[0200] In one implementation, the control center APK of the electronic device B can determine that the reason for the execution failure needs to be displayed according to the above prompt type. For example, when the prompt type includes prompting on the local end, the reason for the execution failure is displayed on the display interface of the electronic device B. It should be noted here that if the service APK defines that the prompt is only on the initiating end, the electronic device B does not need to display the reason for the execution failure.

[0201] S26, the control center APK of electronic device B determines whether the device is an initiator, if so, the process ends, if not, executes S27.

[0202] Among them, because the device in the above-mentioned second instruction is electronic device B, and the initiator in the first message is electronic device A, the control center APK can determine that the device is not the initiator, then the control center APK of electronic device B can then send the execution result to the control center APK of electronic device A, so that electronic device A (ie, the initiator) also displays the reason for the execution failure on the display interface, so that the user does not need to observe the prompt information of the electronic devices at both ends back and forth, thereby improving the user experience.

[0203] S27, the control center APK of electronic device B sends a second message to the control center APK of electronic device A.

[0204] The second message may carry the above-mentioned execution result.

[0205] S28, the control center APK of electronic device A determines that the execution result is execution failure according to the second message, deletes the cached first message, and displays the reason for the execution failure on the display interface of electronic device A according to the prompt type.

[0206] Because the execution result includes the message generation time corresponding to the first instruction, which is the generation time of the first message, the control center APK of electronic device A can find the corresponding first message from the cache according to the message generation time, and then delete the first message to reduce the cache occupancy rate. At the same time, because the current device connection has failed, electronic device A needs to prompt the user, and can determine the reason for the execution failure to be displayed based on the prompt type. For example, when the prompt type includes a prompt at the initiating end (here because electronic device A is the initiating end), the reason for the execution failure is displayed on the display interface of electronic device A.

[0207] In one implementation, if the above execution result is successful, electronic device B may also send the execution result to electronic device A, and the control center APK of electronic device A may update the display interface to the above when determining that the execution result is successful according to the second message. Figure 3 The interface shown in Figure (a).

[0208] S29, the control center APK of electronic device A determines whether the device is an initiator, and if so, the process ends.

[0209] Among them, since the device in the above-mentioned first instruction is electronic device A, and the initiator in the first message is also electronic device A, the control center APK can determine that this device is the initiator, then the above-mentioned process can be ended after the prompt information is displayed on this device.

[0210] In the above device connection method, when the user initiates the device connection operation at the initiating end, if the initiating end has the ability to initiate device connection, the initiating end initiates the device connection to the passive end, and in the case of a connection failure, the initiating end displays the reason for the execution failure, which can enable the user to know the specific reason for the failure so as to take corresponding recovery methods, thereby improving the user's experience. If the initiating end does not have the ability to initiate device connection, the passive end initiates the device connection to the initiating end, and in the case of a connection failure, the reason for the execution failure can be displayed on the passive end, and the passive end can also return the reason for the execution failure to the initiating end, so that the initiating end also displays the reason for the execution failure, thereby further improving the user's experience.

[0211] In one implementation, for the above implementation process, a MsgCache container is created in both electronic device A and electronic device B to cache the first message. The first message can be deleted when the device connection fails, but it is not deleted when the device connection is successful or it is not deleted immediately when the control center APK receives the execution result of success (because the control center APK may need to perform other forwarding instruction operations). This may cause the messages or instructions in the cache to increase infinitely and the cache occupancy rate to be high.

[0212] Therefore, electronic device A and electronic device B can delete the messages in the cache in the following cases: because the electronic device continues to monitor the status information changes of the profile APK when using an asynchronous mechanism to obtain the execution results returned by the business APK, then electronic device A or electronic device B can delete the message or instruction corresponding to the device in the cache when the status information changes. The scenarios of status information changes include but are not limited to scenarios such as device offline, successful device connection establishment, and device connection establishment failure; in addition, in the case of a connection timeout, for example, after the control center APK sends an instruction to the business APK and waits for N seconds (such as 30 seconds) and still does not monitor the status information changes of the profile APK, it is considered that the connection has timed out. At this time, the electronic device can also delete the message or instruction corresponding to the device in the cache. This can reduce cache occupancy and improve the processing performance of electronic devices.

[0213] Fig.15 FIG. 1 is a flow chart of another device connection method provided in an embodiment of the present application. The method is executed by electronic device A and may specifically include:

[0214] S101, electronic device A receives a first operation input by a user and generates a first message.

[0215] The first operation can be the above Figure 2 The operation of dragging the icon of electronic device B shown in the figure may also be other forms of triggering operations, which are intended to trigger electronic device A to establish a device connection with electronic device B to execute corresponding services. The first message may include the device identification of electronic device A and the device identification of electronic device B, and identify which device is the initiator and which device is the passive end. The data structure of the first message can refer to the description of the above embodiment, which will not be repeated here.

[0216] Optionally, after generating the first message, electronic device A may also cache the first message.

[0217] S102: If electronic device A has the ability to execute the instruction corresponding to the first message, it sends a request to electronic device B to establish a device connection.

[0218] The instruction corresponding to the first message may be a first instruction, that is, used to instruct the service APK in electronic device A to establish a device connection with electronic device B to execute the corresponding service. If electronic device A has the ability to execute the first instruction, it can initiate the establishment of a device connection to electronic device B according to the first message.

[0219] S103: When the device connection establishment fails, the electronic device A obtains the reason for the execution failure and displays the reason for the execution failure.

[0220] If electronic device A fails to establish a device connection with electronic device B, electronic device A can obtain the reason for the execution failure, such as obtaining the reason for the execution failure from the service APK, and displaying the reason for the execution failure. Exemplarily, the reason for the execution failure may include "Super Keyboard and Mouse supports up to 3 devices connected at the same time, please disconnect the existing connection and try again", "Smart Screen cannot establish a connection in the off state, please turn on the screen and try again", etc.

[0221] In one implementation, electronic device A may also obtain a prompt type, and when the prompt type is a prompt on the local end and / or a prompt on the initiating end, the reason for the execution failure is displayed on the display interface of electronic device A.

[0222] In another implementation, when establishing a device connection fails, electronic device A may also delete the first message generated above from the cache to reduce cache occupancy.

[0223] S104: If electronic device A does not have the ability to execute the instruction corresponding to the first message, the first message is sent to electronic device B.

[0224] That is to say, if electronic device A does not have the ability to execute the first instruction, the counterpart device (i.e., electronic device B) needs to execute the instruction corresponding to the first message. Then electronic device A can send the above-mentioned first message to electronic device B to instruct electronic device B to execute the instruction corresponding to the first message.

[0225] S105, electronic device A receives a second message sent by electronic device B, where the second message carries an execution result of electronic device B executing the instruction corresponding to the first message.

[0226] After electronic device B receives the first message, it can instruct the service APK to establish a device connection with electronic device A. If the execution result is an execution failure, electronic device B can display the reason for the execution failure on the display interface and return the execution result to electronic device A, where the execution result carries the reason for the execution failure.

[0227] S106: When the execution result is a failure to establish a device connection, electronic device A displays the reason for the execution failure carried in the execution result.

[0228] If electronic device B fails to execute the instruction corresponding to the first message, electronic device A may also display the reason for the execution failure on the display interface after receiving the execution result.

[0229] In one implementation, electronic device A may also delete the corresponding first message from the cache. In another implementation, the execution result may also carry a prompt type, and when the prompt type includes a prompt at the initiating end, the reason for the execution failure is displayed on the display interface of electronic device A.

[0230] In the above device connection method, when the user initiates the device connection operation at the initiating end, if the initiating end has the ability to initiate device connection, the initiating end initiates the device connection to the passive end, and in the case of a connection failure, the initiating end displays the reason for the execution failure, which can enable the user to know the specific reason for the failure so as to take corresponding recovery methods, thereby improving the user's experience. If the initiating end does not have the ability to initiate device connection, the passive end initiates the device connection to the initiating end, and in the case of a connection failure, the reason for the execution failure can be displayed on the passive end, and the passive end can also return the reason for the execution failure to the initiating end, so that the initiating end also displays the reason for the execution failure, thereby further improving the user's experience.

[0231] Fig.16 is a flow chart of another device connection method provided in an embodiment of the present application. The method is executed by electronic device B and may specifically include:

[0232] S201, receiving a first message sent by electronic device A.

[0233] S202: Send a request for establishing a device connection to electronic device A according to the first message.

[0234] S203: When the device connection establishment fails, the electronic device B obtains the reason for the execution failure and displays the reason for the execution failure.

[0235] S204: Send the execution result to electronic device A, so that electronic device A displays the reason for the execution failure carried in the execution result.

[0236] Since electronic device A may or may not have the ability to execute the first instruction, if electronic device A does not have the ability to execute the first instruction, electronic device B is required to execute it. Then, electronic device B can receive the first message sent by electronic device A, which is used to instruct electronic device B to establish a device connection with electronic device A. After receiving the first message, electronic device B can optionally cache the first message and send a request to electronic device A to establish a device connection.

[0237] When electronic device B establishes a device connection with electronic device A, the connection may also be successful or fail. In the case of failure to establish a device connection, electronic device B may also display the reason for the execution failure. In one implementation, electronic device B may also provide a prompt according to the prompt type corresponding to the reason for the execution failure. For example, when the prompt type includes a prompt on the local end, electronic device B displays the reason for the execution failure.

[0238] At the same time, electronic device B may also send the execution result to electronic device A, where the execution result carries the reason for the execution failure, so that electronic device A also displays the reason for the execution failure.

[0239] In the above implementation method, if the initiating end does not have the ability to initiate a device connection, the passive end initiates the device connection to the initiating end. In the event of a connection failure, the reason for the execution failure can be displayed on the passive end. At the same time, the passive end can also return the reason for the execution failure to the initiating end, so that the initiating end also displays the reason for the execution failure, further improving the user experience.

[0240] The above describes in detail an example of a device connection method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of the present application.

[0241] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0242] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0243] The electronic device provided in this embodiment is used to execute the above-mentioned device connection method, and thus can achieve the same effect as the above-mentioned implementation method.

[0244] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.

[0245] Among them, the processing module can be a processor or a controller. It can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, a Wi-Fi chip, etc.

[0246] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 4 Device of the structure shown.

[0247] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the device connection method of any of the above embodiments.

[0248] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the above-mentioned related steps to implement the device connection method in the above-mentioned embodiment.

[0249] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer execution instructions, and when the device is running, the processor may execute the computer execution instructions stored in the memory so that the chip executes the device connection method in the above-mentioned method embodiments.

[0250] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.

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

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

[0253] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0254] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0255] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.

[0256] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which 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 device connection method, the method being executed by a first electronic device, characterized in that: The method comprises: When receiving a first operation input by a user, if the first electronic device has the ability to execute the instruction corresponding to the first operation, a request to establish a device connection is sent to a second electronic device, wherein the first operation is used to instruct the first electronic device to establish a device connection with the second electronic device to execute a corresponding service; In the event of failure to establish a device connection, the reason for the execution failure is obtained, and the reason for the execution failure is displayed.

2. The method according to claim 1, characterized in that When receiving a first operation input by a user, the method further includes: Generate a first message, wherein the first message includes a device identification of the first electronic device and a device identification of the second electronic device; The sending a request to establish a device connection to the second electronic device includes: A request for establishing a device connection is sent to the second electronic device according to the first message.

3. The method according to claim 1 or 2, characterized in that: In the event that establishing the device connection fails, the method further comprises: Obtaining a prompt type corresponding to the reason for the execution failure, the prompt type including at least one of prompting on the local end, prompting on the initiating end corresponding to the first operation, and no prompting; The reason for the execution failure is displayed, including: When the prompt type is a prompt on the local end and / or a prompt on the initiating end corresponding to the first operation, the reason for the execution failure is displayed.

4. The method according to claim 2, characterized in that: After generating the first message, the method further includes: The first message is cached.

5. The method according to claim 4, characterized in that The first message also includes a message generation time of the first message. In the case where the device connection fails to be established, the method further includes: The first message is deleted from the cache according to the message generation time.

6. The method according to any one of claims 1 to 5, characterized in that The first electronic device includes a control center application; The first operation of receiving a user input includes: The first operation is received through the control center application.

7. The method according to claim 6, characterized in that The first electronic device further includes a service application. After the control center application receives the first operation, the method further includes: A first instruction is sent to the service application through the control center application, where the first instruction is an instruction generated according to the first message and is used to instruct the service application to send a request for establishing a device connection to the second electronic device.

8. The method according to claim 7, characterized in that The reasons for the failure of the acquisition execution include: The reason for the execution failure is obtained from the business application through the control center application.

9. The method according to any one of claims 1 to 8, characterized in that If the first electronic device does not have the ability to execute the instruction corresponding to the first operation, the method further includes: Sending a first message to the second electronic device, used to instruct the second electronic device to establish a device connection with the first electronic device; receiving a second message from the second electronic device, where the second message includes an execution result when the second electronic device establishes a device connection with the first electronic device; If the execution result indicates that the device connection establishment fails, the reason for the execution failure carried in the execution result is displayed.

10. The method according to claim 9, characterized in that The execution result also carries a prompt type corresponding to the reason for the execution failure, and the display of the reason for the execution failure carried in the execution result includes: In a case where the prompt type includes a prompt at the initiator corresponding to the first operation, the reason for the execution failure is displayed.

11. The method according to claim 9 or 10, characterized in that: The receiving a second message from the second electronic device includes: A second message from the second electronic device is received through the control center application.

12. The method according to any one of claims 1 to 11, characterized in that Before receiving the first operation input by the user, the method further includes: A first interface is displayed, wherein the first interface presents an icon of the first electronic device and an icon of the second electronic device, wherein the second electronic device is discovered by the first electronic device through a near field communication protocol, and a user account logged in to the second electronic device is the same as a user account logged in to the first electronic device, and the first operation is an operation input on the first interface.

13. The method according to claim 12, characterized in that The first operation is an operation of dragging the icon of the second electronic device to a location where the icon of the first electronic device is located.

14. A device connection method, the method being executed by a second electronic device, characterized in that: The method comprises: receiving a first message from a first electronic device, where the first message is used to instruct the second electronic device to establish a device connection with the first electronic device; Sending a request to establish a device connection to the first electronic device; In the event of a failure to establish a device connection, the reason for the execution failure is obtained and displayed, and a second message is sent to the first electronic device, wherein the second message includes an execution result when the second electronic device establishes a device connection with the first electronic device, and the execution result carries the reason for the execution failure.

15. An electronic device, characterized in that: include: one or more processors; one or more memories; The memory stores one or more programs, and when the one or more programs are executed by the processor, the electronic device executes the method according to any one of claims 1 to 13, or executes the method according to claim 14.

16. A computer-readable storage medium, characterized in that: A computer program is stored in the computer-readable storage medium. When the computer program is executed by a processor, the processor calls instructions so that the electronic device executes the method according to any one of claims 1 to 14.