Method for sharing input device and electronic device

Through Wi-Fi P2P multiplexing technology and interface interaction, input device sharing among multiple electronic devices is achieved, solving the user's need to connect multiple devices at the same time and improving device utilization.

CN117666854BActive Publication Date: 2025-09-19HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211064485.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-09-19
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

Existing technologies cannot meet the needs of users to connect multiple electronic devices at the same time, resulting in reduced utilization of multiple electronic devices.

Method used

By establishing a connection between the first electronic device and at least two second electronic devices, using Wi-Fi P2P multiplexing technology as the Group Owner, the input device is shared across the target electronic devices and interface interaction is provided for convenient connection.

Benefits of technology

It realizes the sharing of keyboard and mouse among multiple electronic devices, meets the needs of users to connect multiple devices at the same time, and improves the utilization rate of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117666854B_ABST
    Figure CN117666854B_ABST
Patent Text Reader

Abstract

An embodiment of the present application provides a method and electronic device for sharing an input device. The method is performed by a first electronic device, the first electronic device including an input device. The method includes: after the first electronic device establishes a connection with at least two second electronic devices, determining a target electronic device for the currently shared input device based on a first event, the target electronic device being one of the at least two second electronic devices, the first event being an event that triggers the sharing of the input device; intercepting a second event of the input device, and sending the second event to the target electronic device, the second event being any event input by the input device. This method can meet the user's needs for connecting multiple electronic devices simultaneously and also improve the utilization rate of multiple electronic devices.
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 method for sharing an input device and an electronic device. Background Art

[0002] With the development of electronic technology, the types of electronic devices are increasing. A user may own a mobile phone, tablet computer, laptop computer, personal computer (PC), smart home device (such as smart TV), etc. In some scenarios, users need to connect a laptop computer to a mobile phone, a PC to a mobile phone, or a PC to a tablet computer.

[0003] For example, when connecting a PC to a mobile phone, the phone can share the PC's keyboard and mouse functionality. This means the user can use the PC's keyboard and mouse to operate the phone, conveniently and quickly switching between the two electronic devices. However, this sharing method cannot meet the user's need to connect multiple electronic devices simultaneously, significantly reducing the utilization rate of multiple electronic devices. Summary of the Invention

[0004] The present application provides a method for sharing an input device and an electronic device, which can meet the user's needs of connecting multiple electronic devices at the same time and improve the utilization rate of multiple electronic devices.

[0005] In a first aspect, the present application provides a method for sharing an input device, which is performed by a first electronic device, the first electronic device including an input device, and the method comprising: after the first electronic device establishes a connection with at least two second electronic devices, determining the target electronic device of the currently shared input device based on a first event, the target electronic device being one of the at least two second electronic devices, the first event being an event that triggers the shared input device; intercepting a second event of the input device, and sending the second event to the target electronic device, the second event being any event input by the input device.

[0006] The first electronic device may be a PC, and the second electronic device may be a mobile phone or a tablet computer. At least two second electronic devices may establish a connection with the first electronic device and share the input device of the first electronic device after the connection is established.

[0007] After the first electronic device establishes a connection with at least two second electronic devices, the user can use the mouse to move on the display screen of the first electronic device to cross to a second electronic device, or the user can input the cross command by voice, or the user can use the keyboard's arrow keys "←" or "→" to input the cross command. These events can be referred to as first events, and this application does not limit the input method of the first event. After the first electronic device receives the first event, it needs to determine the target electronic device corresponding to the event, that is, which second electronic device the input device currently needs to be shared with. Then, when the input device inputs the second event, the first electronic device can intercept the second event and send the data of the second event to the target electronic device, which realizes the process of the input device crossing to the target electronic device. It can be understood that the user can cross the input device to any second electronic device as needed, but at the same time, only one second electronic device can share the input device of the first electronic device.

[0008] In one implementation, a first electronic device may establish connections with at least two second electronic devices through Wi-Fi P2P multiplexing technology, wherein the first electronic device may serve as a Group Owner and the at least two second electronic devices may serve as Group Clients.

[0009] With the above implementation, the first electronic device can establish a connection with at least two second electronic devices at the same time, and share the input device to one second electronic device according to user needs. In this way, two or more electronic devices can share the keyboard and mouse with another electronic device, meeting the user's needs to connect multiple electronic devices at the same time and improving the utilization rate of multiple electronic devices.

[0010] In combination with the first aspect, in some implementations of the first aspect, the above method also includes: displaying a first interface, the first interface including an identifier of the first electronic device and identifiers of at least two second electronic devices; if a first operation on the identifiers of at least two second electronic devices is received, establishing a connection with the at least two second electronic devices.

[0011] Among them, the present application provides an interface for operating a first electronic device and establishing a connection with at least two second electronic devices. The interface displays the identifier of the first electronic device and the identifiers of at least two second electronic devices. The identifiers here can be icons of electronic devices, etc. If the user needs to establish a connection between the second electronic device and the first electronic device, the user can input a first operation to the identifier of the second electronic device, such as a drag operation, a click operation, etc. After the first electronic device receives the operation, it can establish a connection with the second electronic device. Optionally, the user can also input a connection instruction through voice to trigger the first electronic device to establish a connection with the second electronic device.

[0012] The above implementation improves the interactivity with the user by providing an interface for the user to operate to establish a connection between electronic devices.

[0013] In combination with the first aspect, in some implementations of the first aspect, the identifiers of the at least two second electronic devices are icons of the at least two second electronic devices, and the first operation is an operation of dragging the icons of the at least two second electronic devices to the target area on the first interface.

[0014] Among them, the above-mentioned first interface also includes a target area. If the user uses a mouse to drag the icons of at least two electronic devices into the target area, it can be determined that the above-mentioned first operation has been input, and the first electronic device can establish a connection with at least two second electronic devices.

[0015] In one implementation, the number of the target areas is at least two, and the target areas are located outside the area where the identifier of the first electronic device is located.

[0016] In this implementation, an icon of a second electronic device can be dragged into a target area. For example, if a user uses a mouse to drag an icon of a second electronic device on the first interface to a target area to the left of the icon of the first electronic device, subsequent mouse movement to the left will move the icon to the second electronic device; if a user uses a mouse to drag an icon of another second electronic device to the target area to the right of the icon of the first electronic device, subsequent mouse movement to the right will move the icon to the second electronic device.

[0017] In the above implementation, the first electronic device divides the target area on the first interface, allowing the user to quickly and easily trigger the establishment of a connection between electronic devices, and the target area dragged can correspond to the direction of subsequent mouse crossings, which also improves the efficiency of sharing input devices.

[0018] In combination with the first aspect, in some implementations of the first aspect, the input device may be a mouse, and the first event may be an event input via the mouse.

[0019] In this implementation, determining the target electronic device of the currently shared input device based on the first event includes: determining the target electronic device based on the position and movement direction of the mouse pointer on the display screen of the first electronic device.

[0020] Among them, in the case where the above-mentioned first event is an event input through a mouse, the user uses the mouse to move on the display screen of the first electronic device. If the mouse pointer slides over the edge of the display screen of the first electronic device, it can be confirmed that the mouse crossing condition has been met, and the first electronic device can determine the target electronic device based on the position and movement direction of the mouse pointer on the display screen of the first electronic device.

[0021] In one implementation, the above-mentioned determining the target electronic device based on the position and movement direction of the mouse pointer on the display screen of the first electronic device includes: if the mouse pointer is located at the edge of the display screen of the first electronic device and continues to move outside the edge, then determining the target electronic device based on the movement direction of the mouse pointer.

[0022] For example, if the mouse pointer is located at the left edge of the display screen of the first electronic device and continues to move to the left, it can be determined that the mouse pointer is crossing to the left; if the mouse pointer is located at the right edge of the display screen of the first electronic device and continues to move to the right, it can be determined that the mouse pointer is crossing to the right. The first electronic device can then determine the target electronic device based on the movement direction of the mouse pointer.

[0023] In one implementation, the above-mentioned determination of the target electronic device based on the movement direction of the mouse pointer includes: if the movement direction of the mouse pointer is the same as the direction of the identifier of the first target area on the first interface relative to the first electronic device, then the second electronic device corresponding to the icon placed in the first target area is determined as the target electronic device, and the first target area is an area in the target area.

[0024] For example, if the mouse pointer is crossing to the left and the second target area in the target area is located to the left of the first electronic device's identifier, it can be determined that the mouse is about to cross to the second electronic device corresponding to the first target area; if the mouse pointer is crossing to the right and the second target area in the target area is located to the right of the first electronic device's identifier, it can be determined that the mouse is about to cross to the second electronic device corresponding to the second target area. In this way, the specific second electronic device of the target electronic device is determined, and the first electronic device can subsequently send the intercepted second event to the second electronic device.

[0025] In the above implementation, the first electronic device determines the target electronic device with which the input device is currently to be shared through the position and movement direction of the mouse pointer, so that the user can use the mouse to quickly execute the crossing process.

[0026] In combination with the first aspect, in some implementations of the first aspect, after determining the target electronic device, the above method also includes: sending a first message of sharing the input device to the target electronic device, and receiving a confirmation message replied by the target electronic device based on the first message.

[0027] Among them, after determining the target electronic device, the first electronic device can send a message to the target electronic device to inform the target electronic device to prepare to share the input device. If the target electronic device is ready to receive the crossing event, it can reply a confirmation message to the first electronic device to prepare data for the subsequent sharing process.

[0028] In a second aspect, the present application provides a device, which is included in an electronic device and has the function of implementing the electronic device behavior described in the first aspect and possible implementations of the first aspect. The function can be implemented through hardware or through hardware executing corresponding software implementations. 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.

[0029] In a third aspect, the present application provides an electronic device, which includes: 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.

[0030] In a fourth aspect, the present application provides a chip including a processor, wherein the processor is configured to read and execute a computer program stored in a memory to perform the method of the first aspect and any possible implementation thereof.

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

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

[0033] In a fifth aspect, the present application 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 any one of the methods in the technical solution of the first aspect.

[0034] In a sixth 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a schematic diagram of an application scenario provided by the related art, in which a PC keyboard and mouse are used to operate a mobile phone.

[0036] Figure 2 This is a schematic diagram of an application scenario of a method for sharing an input device provided in an embodiment of the present application;

[0037] Figure 3This is a schematic diagram of a P2P architecture provided in an embodiment of the present application;

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

[0039] Figure 5 is a structural diagram of another electronic device provided in an embodiment of the present application;

[0040] Figure 6 This is a software structure diagram of an electronic device provided in an embodiment of the present application;

[0041] Figure 7 This is a flowchart of a method for sharing an input device provided in an embodiment of the present application;

[0042] Figure 8 This is a schematic diagram of an interface of a computer manager application provided in an embodiment of the present application;

[0043] Figure 9 This is a schematic diagram of an operation of connecting an electronic device provided in an embodiment of the present application;

[0044] Figure 10 This is another example of an operation diagram for connecting an electronic device provided in an embodiment of the present application;

[0045] Figure 11 This is a schematic diagram of an interface of a connected electronic device provided in an embodiment of the present application;

[0046] Figure 12 This is another example of an operation diagram for connecting an electronic device provided in an embodiment of the present application;

[0047] Figure 13 This is a schematic diagram of the interface of another computer manager application provided in an embodiment of the present application;

[0048] Figure 14 is a schematic diagram of a coordinate system on a display screen provided in an embodiment of the present application;

[0049] Figure 15 This is a module timing flow chart of a method for sharing an input device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying 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 merely a description of the association relationship of associated objects, indicating that three relationships can exist, 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.

[0051] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.

[0052] Currently, a user may own multiple electronic devices simultaneously, such as a mobile phone, tablet computer, laptop computer, and PC. In some office or entertainment scenarios, users may need to connect their laptop computer to a mobile phone, a laptop computer to a tablet computer, a PC to a mobile phone, or a PC to a tablet computer. Keyboard and mouse sharing technology provides a solution for connecting these electronic devices. It allows one electronic device's input device (such as a mouse or keyboard) to control other electronic devices.

[0053] Take the connection between PC and mobile phone as an example. After the connection between mobile phone and PC is successful, the mobile phone can share the keyboard and mouse capabilities of PC, that is, the user can use the keyboard and mouse of PC to operate the mobile phone. Figure 1 As shown in Figure (a), the mobile phone has established a connection with the PC, and the user can use the PC's mouse to click on the controls on the mobile phone, or, as shown in Figure Figure 1 As shown in Figure (b), the user can use the PC keyboard to enter text in the input box on the mobile phone. It is understood that the mobile phone and PC can establish a connection based on wireless communication protocols such as wireless fidelity (Wi-Fi), Bluetooth, ZigBee, or near field communication (NFC).

[0054] However, conventional technologies only support keyboard and mouse sharing between one electronic device and another, such as sharing a keyboard and mouse between a mobile phone and a PC, or sharing a keyboard and mouse between a tablet and a PC. When users need to connect multiple electronic devices simultaneously, conventional technologies cannot meet this need. Furthermore, when only one electronic device shares a keyboard and mouse with another, resources of the other electronic devices are wasted, reducing the utilization of the multiple electronic devices.

[0055] In view of this, an embodiment of the present application provides a method for sharing an input device, which can realize keyboard and mouse sharing between two or more electronic devices and another electronic device, meet the user's needs for connecting multiple electronic devices at the same time, and improve the utilization rate of multiple electronic devices. It should be noted that the method for sharing an input device provided in the embodiment of the present application can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.

[0056] See also Figure 2 , which is a schematic diagram of an application scenario of the method for sharing an input device provided in an embodiment of the present application. The application scenario may at least include: a first electronic device 11, a second electronic device A12, and a second electronic device B13.

[0057] The first electronic device 11 may be a PC, and the first electronic device 11 has an input device 101. For example, the input device 101 may be a mouse, a keyboard, etc., and the following description will be made taking the input device 101 as a mouse as an example.

[0058] The second electronic device A12 may be a mobile phone or a tablet computer, and the second electronic device B13 may also be a mobile phone or a tablet computer. The figure takes the second electronic device A12 as a mobile phone and the second electronic device B13 as a tablet computer as an example.

[0059] In the embodiments of the present application, a connection can be established between the first electronic device 11 and the second electronic device A12, and between the first electronic device 11 and the second electronic device B13, via a wired or wireless method. Based on the established connection, the first electronic device 11 can be used in conjunction with the second electronic device A12 and the second electronic device B13. When establishing a connection wirelessly, the first electronic device 11 can simultaneously establish a connection with the second electronic device A12 and the second electronic device B13 based on WiFi P2P (peer to peer) multiplexing technology. The following briefly introduces WiFi P2P multiplexing technology.

[0060] like Figure 3 As shown in the figure, three components are defined in the P2P architecture: "one device, two roles". P2P Device: This is an entity in the P2P architecture and can be regarded as a Wi-Fi device. P2P Group Owner: Group Owner (GO) is a role similar to the wireless access point (AP) in the infrastructure BSS. P2P Group Client: Group Client (GC) is another role, and its function is similar to the station (STA) in the infrastructure BSS. Before the component P2P Group (P2P Network), electronic devices were all P2P Devices. After the P2P negotiation is completed between these P2PDevice devices, there will be one and only one P2P Device as the GO, and the other P2PDevice devices will act as GCs; because the function of the GO is similar to that of the AP, the surrounding STAs that do not support the P2P function can also discover and associate with the GO. This STA is called a Legacy Client. In combination with the embodiment of the present application, the first electronic device 11 acts as a GO, the second electronic device A12 and the second electronic device B13 act as GCs, and a WiFi P2P connection is established between the first electronic device 11 and the second electronic devices A12 and B13.

[0061] After the first electronic device 11 is connected to the second electronic device A12 and the second electronic device B13, using keyboard and mouse sharing technology, the user can use a set of input devices, such as the input device 101 described above, to control the first electronic device 11, the second electronic device A12, and the second electronic device B13. It should be noted that the embodiment of the present application does not limit the number of the second electronic devices A12 and B13 described above, that is, the first electronic device 11 can be connected not only to one second electronic device A12 and one second electronic device B13, but also to multiple second electronic devices A12 and multiple second electronic devices B13 to achieve control of multiple electronic devices.

[0062] For the above Figure 2 In the application scenario shown, the structures of the first electronic device 11, the second electronic device A12 and the second electronic device B13 are introduced below.

[0063] Taking the first electronic device 11 as a PC as an example, illustratively, Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device may include: a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, a wireless communication module 250, a display screen 260, etc.

[0064] It should be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0065] The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (AP), a modem processor, a graphics processing unit (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). The different processing units may be independent devices or integrated into one or more processors.

[0066] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0067] Processor 210 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 210 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 210. If processor 210 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 210 latency, and thus improves system efficiency.

[0068] In some embodiments, the processor 210 may include one or more interfaces. The interfaces 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, and / or a universal serial bus (USB) interface.

[0069] It is understood that the interface connection relationship between the modules illustrated in this embodiment is only for illustrative purposes and does not constitute a structural limitation on the electronic device. In other embodiments, the electronic device may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0070] The charging management module 240 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While charging the battery 242, the charging management module 240 can also power the electronic device through the power management module 141.

[0071] The power management module 241 is used to connect the battery 242, the charging management module 240, and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 and provides power to the processor 210, the internal memory 221, the external memory, the display 260, and the wireless communication module 250. In some embodiments, the power management module 241 and the charging management module 240 can also be provided in the same device.

[0072] The wireless communication module 250 can provide wireless communication solutions for electronic devices, including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth, global navigation satellite systems (GNSS), frequency modulation (FM), NFC, infrared technology (IR), etc. For example, in an embodiment of the present application, the electronic device can establish a Bluetooth connection with a terminal device (such as a wireless headset) through the wireless communication module 250.

[0073] Wireless communication module 250 can be one or more devices that integrate at least one communication processing module. Wireless communication module 250 receives electromagnetic waves via an antenna, frequency-modulates and filters the electromagnetic wave signals, and transmits the processed signals to processor 210. Wireless communication module 250 can also receive signals to be transmitted from processor 210, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via the antenna.

[0074] The electronic device implements its display functionality through a GPU, display screen 260, and an application processor. A GPU is a microprocessor for image processing that connects display screen 260 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or modify display information.

[0075] The display screen 260 is used to display images, videos, etc. The display screen 260 includes a display panel.

[0076] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 210 via the external memory interface 220 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0077] The internal memory 221 can be used to store computer executable program code, which includes instructions. The processor 210 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 221. For example, in an embodiment of the present application, the processor 210 can execute instructions stored in the internal memory 221, and the internal memory 221 can include a program storage area and a data storage area.

[0078] The program storage area may store an operating system, at least one application required for a 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 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 221 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.

[0079] For example, the second electronic device A12 is a mobile phone and the second electronic device B13 is a tablet computer. The mobile phone and the tablet computer may adopt the same or similar structure. For example, Figure 5 This is a structural diagram of another electronic device provided in an embodiment of the present application. Figure 5 As shown, the electronic device 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.

[0080] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors.

[0081] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on instruction operation codes and timing signals to complete the control of instruction fetching and execution.

[0082] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0083] In some embodiments, the processor 110 may include one or more interfaces, such as an I2C interface, an I2S interface, a PCM interface, a UART interface, a MIPI interface, a GPIO interface, a subscriber identity module (SIM) interface, and / or a USB interface.

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

[0085] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 5 The structures of antenna 1 and antenna 2 are merely examples. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antenna can be used in conjunction with a tuning switch.

[0086] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied in electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0087] The wireless communication module 160 can provide wireless communication solutions for electronic devices, including WLAN (such as Wi-Fi), Bluetooth, GNSS, FM, NFC, IR, and other wireless communication solutions. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, frequency modulates and filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be transmitted from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic waves for radiation via antenna 2.

[0088] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the electronic device can communicate with a network and other devices via wireless communication technologies. Wireless communication technologies 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. GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite-based augmentation system (SBAS).

[0089] Display screen 194 is used to display images, videos, and the like. 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLED, or a quantum dot light-emitting diode (QLED). In some embodiments, the electronic device can include one or N display screens 194, where N is a positive integer greater than one.

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

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

[0092] 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 by inserting it into or removing it from the SIM card interface 195. The electronic device 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. Electronic devices interact with the network through SIM cards to implement functions such as calls and data communications. In some embodiments, the electronic device uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device and cannot be separated from the electronic device.

[0093] It is understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0094] for Figure 4 and Figure 5 The electronic device shown in the figure should also have a method for sharing input devices in order to implement the method provided in the embodiment of the present application. Figure 6 The software architecture shown in Figure 1. Figure 6 Taking the software system of the first electronic device 11 being Windows system and the software system of the second electronic device A12 and the second electronic device B13 being Android system as an example, the software architecture of the first electronic device 11, the second electronic device A12 and the second electronic device B13 is exemplified.

[0095] Among them, such as Figure 6 As shown, the software architecture of the first electronic device 11 may include: an application layer and a driver layer. In some embodiments, the application layer may include various Windows applications installed on the first electronic device 11, and the Windows applications of the application layer may directly interact with the drivers of the driver layer. Exemplarily, the Windows application may include a computer manager application, and the computer manager application may include multiple modules, such as a first business management logic module, a keyboard and mouse capture module, an edge computing module, a keyboard and mouse Hook module, and a first data transmission module. The driver layer may include a first Wi-Fi driver for establishing a Wi-Fi P2P connection with the second electronic device A12 and the second electronic device B13.

[0096] The first service management logic module is used to manage the entire computer manager service and send instructions to other modules. The keyboard and mouse capture module is used to capture keyboard and / or mouse events and send event information (also known as keyboard and mouse events) to the edge computing module. The edge computing module is used to calculate based on the acquired event information to determine whether the mouse pointer has reached the edge of the display screen of the first electronic device 11. When the mouse reaches the edge, the first service management logic module determines whether the mouse crossover condition is met and which electronic device to cross over to. When the mouse crosses over, the first data transmission module can send a crossover message to the second electronic device A12 (or second electronic device B13). At the same time, the keyboard and mouse hook module intercepts (hooks) the keyboard and mouse events that continue to be captured by the keyboard and mouse capture module to prevent the first electronic device 11 from responding to the keyboard and mouse events. The intercepted keyboard and mouse events can be handed over to the edge computing module for further calculation, and the calculated data (such as mouse displacement) is sent to the second electronic device A12 (or second electronic device B13) via the first data transmission module. The second electronic device A12 (or second electronic device B13) processes the received data.

[0097] The software systems of the second electronic device A12 and the second electronic device B13 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. Taking the case where the software system of the second electronic device A12 is a layered architecture (the software architecture of the second electronic device B13 is similar), the layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, such as Figure 6 As shown, the second electronic device A12 may include an application layer and a driver layer. The application layer may include a series of application packages. For example, the application package may include settings, calculator, camera, short message, music player and other applications (not shown in the figure), and may also include a mobile phone manager APP (application), or a tablet manager APP, etc. Taking the mobile phone manager APP as an example, the mobile phone manager APP may include multiple modules, such as a second business management logic module, a keyboard and mouse event processing module, a command injection module, and a second data transmission module, etc. The driver layer may include a second Wi-Fi driver and a uinput driver. The second Wi-Fi driver is used to establish a Wi-Fi P2P connection with the first electronic device 11, and the uinput driver is used to receive event information sent by the command injection module and report it to the Android input subsystem.

[0098] The second business management logic module is used to manage the entire mobile phone butler business and send instructions to other modules. The second data transmission module is used to receive information or data sent by the first data transmission module of the first electronic device 11, such as receiving a crossing message or a mouse displacement. The keyboard and mouse event processing module is used to process the data received by the second data transmission module, and send it to the command injection module after processing, and then the command injection module injects it into the uinput driver. In addition, the keyboard and mouse event processing module can also determine whether the mouse pointer reaches the edge of the display screen of the second electronic device A, and when the mouse reaches the edge, the second business management logic module determines whether the mouse needs to return to cross, that is, cross back to the first electronic device 11.

[0099] Of course, the second electronic device A12 may also include other layers, such as an application framework layer, an Android runtime, and a system library (not shown). The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions, such as a window manager, content provider, view system, telephony manager, resource manager, and notification manager. The Android runtime includes a core library and a virtual machine. The Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one for function calls required by the Java language, and the other for the Android core library. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files in the application layer and application framework layer as binary files. The virtual machine is responsible for performing functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. The system library may include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (e.g., OpenGL ES), and a 2D graphics engine (e.g., SGL).

[0100] It can be understood that the functions of the modules in the second electronic device B13 are the same as or similar to those in the second electronic device A12, and are not described in detail here.

[0101] For ease of understanding, the following examples of this application will be described with Figures 4 to 6 Taking the electronic device with the structure shown as an example, the method of sharing input devices provided in the embodiment of the present application is specifically explained in combination with the accompanying drawings and application scenarios.

[0102] Figure 7 This is a flow chart of a method for sharing an input device provided in an embodiment of the present application. Taking the first electronic device as a PC, the second electronic device A as a mobile phone, and the second electronic device B as a tablet as an example, the method includes:

[0103] S11: The first electronic device establishes a connection with the second electronic device A and the second electronic device B.

[0104] In some embodiments, the first electronic device may establish a connection with the second electronic device A and the second electronic device B via a wired manner, for example, by connecting a data cable via a USB interface.

[0105] In some embodiments, a first electronic device may establish a wireless connection with a second electronic device A and a second electronic device B. In this implementation, the first electronic device may search for nearby electronic devices, or search for nearby electronic devices that are logged into the same account as the first electronic device. When a user inputs a connection operation to the first electronic device, the first electronic device may establish a connection with the second electronic device A and the second electronic device B.

[0106] For example, the first electronic device may be installed with a computer manager application, and the user may input a connection operation through the application. Figure 8 As shown in Figure (a), it can be seen from the figure that the computer manager application provides a super keyboard and mouse function (i.e. keyboard and mouse sharing) entrance, i.e. the function control on the left side of the interface. When the user clicks the super terminal control 31, as shown in Figure 8 As shown in Figure (b), the function interface of the super keyboard and mouse can be displayed on the right side of the interface. On this interface, there are 4 areas: Area 1, Area 2, Area 3 and Area 4. Among them, the icon of the electronic device (i.e., the first electronic device) is displayed in Area 1, Area 2 and Area 3 are currently blank (patterns similar to steps can also be displayed), and Area 4 displays the icons of electronic devices that have been searched and discovered by the first electronic device, such as the mobile phone icon (i.e., the icon of the second electronic device A) and the tablet icon (i.e., the icon of the second electronic device B) in the figure. It can be understood that the first electronic device can search and discover nearby electronic devices through Bluetooth signals, or search and discover nearby electronic devices through other near-field communication signals. After searching for nearby electronic devices, some device information of the electronic devices can also be obtained, such as the Internet Protocol (IP) address, port number or logged-in account, etc.

[0107] If the user wants to use the input device (such as a keyboard or mouse) of the first electronic device to control the corresponding electronic device in area 4, the user can use the mouse to drag the electronic device icon in area 4 to area 2 or area 3. It should be noted that if an electronic device icon is dragged to area 2, that is, to the left of area 1, then subsequent mouse movement to the left will move to the electronic device on the left; if an electronic device icon is dragged to area 3, that is, to the right of area 1, then subsequent mouse movement to the right will move to the electronic device on the right.

[0108] For example, see Figure 9 , the user uses the mouse to drag the mobile phone icon in area 4 to area 2, and the display interface changes to Figure 9 Jump to Figure 10 , now only the tablet icon remains in area 4, and the phone icon is already in area 2. Figure 10On the interface, the user uses the mouse to drag the tablet icon in area 4 to area 3, and the interface is displayed. Figure 10 Jump to Figure 11 , at this time there is no icon in area 4, and the tablet icon is already in area 3.

[0109] In one embodiment, when the user uses the mouse to drag the electronic device icon in area 4, a selection box may pop up to select the direction in which the mouse should cross to the electronic device. For example, when the user uses the mouse to drag the mobile phone icon in area 4 to area 2, a selection box may pop up, and the options in the selection box may include: "Cross to this device when the mouse crosses to the left" and "Cross to this device when the mouse crosses to the right." If the user selects "Cross to this device when the mouse crosses to the left," subsequent movements of the mouse to the left will be directed to the mobile phone; if the user selects "Cross to this device when the mouse crosses to the right," subsequent movements of the mouse to the right will be directed to the mobile phone.

[0110] The drag operation input by the user using the mouse can be understood as a connection operation input by the user. When the first electronic device receives the drag operation for the first time, the first electronic device can call the Wi-Fi driver's capabilities to create a simulated AP (SoftAP), generate the corresponding SSID and password, and send the SSID and password to the electronic device corresponding to the drag operation, and the corresponding electronic device connects to the SoftAP according to the SSID and password. For example, when the mobile phone icon is dragged into area 2, the first electronic device sends the SSID and password to the corresponding mobile phone. When the first electronic device receives the drag operation again, it can continue to send the previously created SSID and password to the electronic device corresponding to the drag operation. In this way, the connection between the first electronic device and the second electronic device A and the second electronic device B is established. See above Figure 11 , the phone icon is in area 2, and the tablet icon is in area 3, which means that both the phone and tablet are connected to the PC.

[0111] In some embodiments, to quickly establish a connection between the first electronic device and the other electronic device, the user can also use the mouse to continuously click or touch the edge of the screen of the first electronic device. Figure 12 , the user can use the mouse to click or touch continuously in area 5, and the first electronic device can establish a connection with the electronic device on the right; or the user can use the mouse to click or touch continuously in area 6, and the first electronic device can establish a connection with the electronic device on the left. The interface effect after the connection is established can also be as described above Figure 11 shown.

[0112] In some embodiments, if the user swaps the actual positions of the second electronic device A and the second electronic device B, the first electronic device can sense the swap operation through the near field communication signal. Figure 11 On the interface, the first electronic device can also swap the electronic device icons in area 2 and area 3. Even if the tablet icon is in area 2 and the mobile phone icon is in area 3, this swap process is no longer shown in the figure.

[0113] It can be understood that within the above-mentioned area 2 and / or area 3, there may be multiple sub-areas, for example Figure 13 As shown, there are multiple sub-areas from top to bottom in area 2, and multiple sub-areas from top to bottom in area 3, and each sub-area can be placed with an electronic device icon. Assuming that there are multiple electronic device icons in area 4, these multiple electronic device icons can be dragged and dropped into the sub-areas of area 2 and / or area 3 in sequence. It can also be understood that the relative positions of these sub-areas and area 1 correspond to the subsequent mouse crossing direction. For example, if the mouse is subsequently crossed to the upper left, it will cross to the electronic device corresponding to sub-area 7; if the mouse is subsequently crossed to the left, it will cross to the electronic device corresponding to sub-area 8; if the mouse is subsequently crossed to the lower left, it will cross to the electronic device corresponding to sub-area 9.

[0114] In some embodiments, after the first electronic device establishes a connection with the second electronic device A and the second electronic device B, the second electronic device A and the second electronic device B can each create a virtual input device. The virtual input device has the same function as the input device on the first electronic device, such as a virtual mouse, keyboard, or other input device, which can be used for the second electronic device A and the second electronic device B to simulate corresponding input events. For example, taking the input device as a mouse as an example, the virtual input device created by the mobile phone has the same function as a conventional mouse and can be regarded as a mouse shared by the PC to the mobile phone. It can be used to simulate mouse events on the mobile phone to enable the PC mouse to control the mobile phone. For example, taking the mobile phone operating system as the Android system as an example, the mobile phone can use the uinput capability of Linux to create a virtual input device. Among them, uinput can simulate an input device. By writing to the / dev / uinput (or / dev / input / uinput) device, a process can create a virtual input device with specific functions. Once the virtual input device is created, it can simulate corresponding events.

[0115] In some embodiments, if the user wants to cancel the connection between the second electronic device A or the second electronic device B and the first electronic device, the user can Figure 11 On the interface shown, drag the mobile phone icon in area 2 back to area 4, or drag the tablet icon in area 3 back to area 4.

[0116] S12: The first electronic device monitors a mouse event and determines whether a mouse crossing condition is met.

[0117] Among them, after the first electronic device establishes a connection with the second electronic device A and the second electronic device B, the mouse of the first electronic device is still controlling the first electronic device. At this time, the first electronic device can start a monitoring task to monitor mouse events, such as monitoring the position of the mouse pointer, to determine whether the mouse crossing condition is met based on the position of the mouse pointer.

[0118] For example, the mouse crossing condition may be when the mouse pointer slides over the edge of the display screen of the first electronic device. In other words, the user can move the mouse to cause the mouse to slide over the display screen of the first electronic device. When the mouse pointer slides over the edge of the display screen of the first electronic device, the mouse crossing condition is triggered, and the mouse then takes over control of the other electronic device.

[0119] In some embodiments, the first electronic device may determine the coordinate position of the mouse pointer on the display screen of the first electronic device based on the initial position and relative displacement of the mouse pointer, thereby determining whether the mouse pointer slides out of the edge of the display screen of the first electronic device.

[0120] Taking the first electronic device as a PC as an example, the initial position of the mouse pointer can be the coordinate position of the mouse pointer on the PC display screen when the mouse starts to move, or the coordinate position of the mouse pointer on the PC display screen before the mouse starts to move, or the initial position can be set to the center point of the PC display screen. For example, the specific process of the PC determining whether the mouse pointer slides out of the edge of the PC display screen can be: combining Figure 14 , the PC can establish a coordinate system with the initial coordinate position of the mouse pointer as the coordinate origin (such as Figure 14The positive direction of the X-axis is the direction from the coordinate origin o to the right edge of the PC display screen, and the positive direction of the Y-axis is the direction from the coordinate origin o to the upper edge of the PC display screen. The PC can determine the coordinate values ​​of each edge of the PC display screen in this coordinate system based on the resolution of the PC display screen and the initial position of the mouse pointer. For example, in this coordinate system, the coordinate value of the right edge of the PC display screen on the X-axis is x1, the coordinate value of the left edge on the X-axis is -x2, the coordinate value of the upper edge on the Y-axis is y1, and the coordinate value of the lower edge on the Y-axis is -y2. After the mouse moves, the mouse will report the relative displacement of the corresponding mouse pointer to the PC. The PC can calculate the coordinate position (x, y) of the mouse pointer on the PC display screen after the mouse moves based on the relative displacement reported by the mouse. Then, based on the coordinate position (x, y), the PC can determine whether the mouse pointer has slipped out of the edge of the PC display screen. For example, if the coordinate value x of the mouse pointer on the X-axis is greater than x1, it can be determined that the mouse pointer has slid out of the right edge of the PC display; if the coordinate value x of the mouse pointer on the X-axis is less than -x2, it can be determined that the mouse pointer has slid out of the left edge of the PC display; if the coordinate value y of the mouse pointer on the Y-axis is greater than y1, it can be determined that the mouse pointer has slid out of the upper edge of the PC display; if the coordinate value y of the mouse pointer on the Y-axis is less than -y2, it can be determined that the mouse pointer has slid out of the lower edge of the PC display.

[0121] If the first electronic device detects that the mouse pointer slides over the edge of the display screen of the first electronic device, it can be determined that the mouse crossing condition is currently met.

[0122] S13: When the mouse crossing condition is met, the first electronic device determines a target electronic device, which is one of the second electronic device A and the second electronic device B.

[0123] From the above description, we can know that the mouse can cross upward, downward, left or right. Figure 11 From the drag operation, it can be seen that the relative position of the dragged area and area 1 corresponds to the direction of the mouse crossing. Then, if the mouse pointer slides out of the left edge of the display screen of the first electronic device, the mouse crosses to the electronic device on the left, and if the mouse pointer slides out of the right edge of the display screen of the first electronic device, the mouse crosses to the electronic device on the right. For example, the second electronic device A is located on the left side of the first electronic device, and the second electronic device B is located on the right side of the first electronic device. That is, when the mouse pointer slides out of the left edge of the display screen of the first electronic device, the mouse crosses to the second electronic device A, and the second electronic device A is the target electronic device; when the mouse pointer slides out of the right edge of the display screen of the first electronic device, the mouse crosses to the second electronic device B, and the second electronic device B is the target electronic device.

[0124] In some embodiments, the first electronic device may also receive a voice command input by the user and determine the target electronic device based on the voice command. For example, if the user inputs the command "mouse cross left" by voice, the first electronic device receives the command and interprets it to determine that the electronic device on the left is the target electronic device.

[0125] S14: The first electronic device sends a crossing message to the target electronic device.

[0126] S15: The target electronic device sends a confirmation message to the first electronic device.

[0127] After the first electronic device confirms the target electronic device, it can send a pass-through message to the target electronic device to notify the target electronic device that the input device of the first electronic device is about to pass through. After receiving the pass-through message, if the target electronic device is ready to pass through, it can send a confirmation message to the first electronic device.

[0128] In some embodiments, the target electronic device can be prepared for traversal by having created a virtual input device. If, after the first electronic device establishes a connection with the second electronic device A and the second electronic device B, the second electronic device A and the second electronic device B have created a virtual input device, the target electronic device can then send a confirmation message to the first electronic device. If the second electronic device A and the second electronic device B have not yet created a virtual input device, the target electronic device must first create the virtual input device and then send a confirmation message to the first electronic device.

[0129] S16, the first electronic device intercepts the keyboard and mouse event.

[0130] S17: The first electronic device sends the intercepted keyboard and mouse events to the target electronic device.

[0131] In some embodiments, the first electronic device can intercept keyboard and mouse events by mounting a HOOK. The mounted HOOK can be used to intercept input keyboard and mouse events (or shield input keyboard and mouse events) after the mouse crossing starts. Taking the input device as a mouse as an example, the input event can be a mouse event (or shield the mouse event), so that the mouse event will not be responded to by the first electronic device after being received by the first electronic device. After intercepting the keyboard and mouse events, the mounted HOOK can also capture the operating parameters in the keyboard and mouse events, and send the captured operating parameters to the target electronic device so that the target electronic device can use the created virtual input device to simulate the corresponding keyboard and mouse events, and then respond to them. Optionally, the first electronic device can send the keyboard and mouse events to the target electronic device through the connection channel established above (such as the MagicLink channel).

[0132] Exemplarily, if the keyboard and mouse events intercepted by the first electronic device include the displacement of the mouse, the first electronic device may send the displacement to the target electronic device so that the target electronic device processes the displacement.

[0133] As another example, if the keyboard and mouse events intercepted by the first electronic device include text content input by the keyboard, the first electronic device can send the text content to the target electronic device for the target electronic device to process the text content.

[0134] S18: The target electronic device distributes and processes the received keyboard and mouse events.

[0135] Among them, after receiving the keyboard and mouse events, the target electronic device can parse the keyboard and mouse events and write them into the uinput device node. After the uinput driver corresponding to the uinput device node receives the keyboard and mouse events, it reports them to the Android input subsystem for processing through the Linux input mechanism.

[0136] For example, taking the movement of the mouse pointer as an example, after the first electronic device intercepts this movement event, it can send the movement event and the displacement of the mouse to the target electronic device. Taking the first electronic device as a PC and the target electronic device as an example, since the operating systems of the PC and the mobile phone are different, there are differences in the key values ​​of the mouse operation parameters in the mouse events input. Therefore, the mobile phone can convert the key code of the received mouse operation parameter (such as displacement) into a key code that the mobile phone can recognize according to the preset mapping relationship. Afterwards, the mobile phone can use the created virtual input device to simulate the input device that the mobile phone can recognize according to the converted key code, that is, it can simulate the movement event of the mouse.

[0137] Regarding the above-mentioned process from S14 to S18, when the target electronic device is the second electronic device A, the implementation process is as follows:

[0138] S141: The first electronic device sends a crossing message to the second electronic device A.

[0139] S151: The second electronic device A sends a confirmation message to the first electronic device.

[0140] S16, the first electronic device intercepts the keyboard and mouse event.

[0141] S171: The first electronic device sends the intercepted keyboard and mouse events to the second electronic device A.

[0142] S181: The second electronic device A distributes and processes the received keyboard and mouse events.

[0143] When the target electronic device is the second electronic device B, the implementation process is as follows:

[0144] S142: The first electronic device sends a crossing message to the second electronic device B.

[0145] S152: The second electronic device B sends a confirmation message to the first electronic device.

[0146] S16, the first electronic device intercepts the keyboard and mouse event.

[0147] S172: The first electronic device sends the intercepted keyboard and mouse events to the second electronic device B.

[0148] S182: The second electronic device B distributes and processes the received keyboard and mouse events.

[0149] The processing of the second electronic device A and the second electronic device B is the same as that of the target electronic device, and will not be described in detail here.

[0150] In some embodiments, if the mouse currently moves to the second electronic device A and the user wants to use the mouse to control the second electronic device B, the user can operate the mouse to move right, first move back to the first electronic device, and then move from the first electronic device to the second electronic device B.

[0151] The above-mentioned method of sharing input devices can realize keyboard and mouse sharing between two or more electronic devices and another electronic device through Wi-Fi P2P multiplexing technology, meeting the user's demand for connecting multiple electronic devices at the same time and improving the utilization rate of multiple electronic devices.

[0152] The implementation process of the above embodiment can also be combined with the above Figure 6 The software architecture shown is implemented as follows. Figure 6 The software architecture shown in FIG. 1 describes the method for sharing input devices provided in the embodiment of the present application. Figure 15 As shown, it is a timing flow diagram of a method for sharing an input device provided in an embodiment of the present application, which may specifically include:

[0153] S21: The first service management logic module receives a connection operation input by a user.

[0154] S22 : In response to the connection operation, the first service management logic module calls the first Wi-Fi driver to establish a Wi-Fi P2P connection with the second Wi-Fi driver of the second electronic device A.

[0155] It should be noted that the first service management logic module calls the first Wi-Fi driver and also establishes a Wi-Fi P2P connection with the third Wi-Fi driver of the second electronic device B. Due to the limitations of the diagram, Figure 15 Only the second electronic device A is taken as an example.

[0156] S23: The first service management logic module sends a connection success message to the keyboard and mouse capture module.

[0157] The messages sent between modules may be inter-process communication (IPC) messages, and the following messages are similar.

[0158] S24, the keyboard and mouse capture module monitors keyboard and mouse events.

[0159] S25, the keyboard and mouse capture module sends the monitored keyboard and mouse events to the edge computing module.

[0160] S26, the edge computing module calculates the coordinate position of the mouse pointer on the display screen of the first electronic device according to the keyboard and mouse events.

[0161] S27, the edge computing module sends the coordinate position of the mouse pointer on the display screen of the first electronic device to the first business management logic module.

[0162] S28: The first service management logic module determines whether a mouse crossing condition is satisfied based on the coordinate position of the mouse pointer on the display screen of the first electronic device.

[0163] The process of determining whether the mouse crossing condition is met can be referred to S12 in the above embodiment, and will not be repeated here.

[0164] S29: When the mouse crossing condition is met, the first service management logic module determines the target electronic device.

[0165] In this embodiment, for the convenience of description, the target electronic device is taken as the second electronic device A as an example.

[0166] S30: The first service management logic module sends a traversal message to the second service management logic module through the first data transmission module and the second data transmission module.

[0167] S31: The second service management logic module sends a confirmation message to the first service management logic module through the second data transmission module and the first data transmission module.

[0168] S32: The first service management logic module sends an interception instruction message to the keyboard and mouse Hook module.

[0169] The interception instruction message is used to instruct the keyboard and mouse Hook module to intercept the keyboard and mouse events captured by the keyboard and mouse capture module.

[0170] S33, the keyboard and mouse Hook module intercepts keyboard and mouse events.

[0171] S34, the keyboard and mouse Hook module sends the intercepted keyboard and mouse events to the edge computing module.

[0172] S35, the edge computing module parses and calculates the intercepted keyboard and mouse events to obtain parsed data.

[0173] For example, the edge computing module can parse the intercepted keyboard and mouse events to obtain the mouse displacement.

[0174] S36, the edge computing module sends the parsed data to the keyboard and mouse event processing module through the first data transmission module and the second data transmission module.

[0175] S37, the keyboard and mouse event processing module processes the received parsed data.

[0176] For example, the keyboard and mouse event processing module processes the mouse displacement in the parsed data, and then causes the mouse to move on the display screen of the second electronic device A by the corresponding displacement.

[0177] S38, the keyboard and mouse event processing module sends the processed data to the command injection module.

[0178] S39, the command injection module injects the processed data into the uinput driver.

[0179] Among them, after the uinput driver receives the processing data corresponding to the keyboard and mouse events, it can report it to the Android input subsystem through the Linux input mechanism for corresponding processing. The specific processing process can be found in the existing related technologies and will not be repeated here.

[0180] It can be understood that the processing process of the above S36 to S38 can also be: the edge computing module processes the analyzed data, for example, obtains the corresponding displacement of the mouse on the second electronic device A, and then the edge computing module sends the processed data to the keyboard and mouse event processing module through the first data transmission module and the second data transmission module. At this time, the keyboard and mouse event processing module no longer needs to execute the processing process of S37 (that is, the processing process is executed by the edge computing module of the first electronic device), and then the keyboard and mouse event processing module sends the processed data to the command injection module.

[0181] In addition to the above process, the keyboard and mouse event processing module of the second electronic device A can also determine whether the mouse pointer reaches the edge of the display screen of the second electronic device A based on the received analysis data. For example, if it reaches the right edge of the display screen, it can continue to move to the right to cross back to the first electronic device.

[0182] The above-mentioned method of sharing input devices can realize keyboard and mouse sharing between two or more electronic devices and another electronic device through Wi-Fi P2P multiplexing technology, meeting the user's demand for connecting multiple electronic devices at the same time and improving the utilization rate of multiple electronic devices.

[0183] The above describes in detail an example of a method for sharing an input device provided in 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 appreciate 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 a hardware or computer software driven hardware manner 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 be beyond the scope of the present application.

[0184] 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-mentioned 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.

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

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

[0187] When integrated, the electronic device may also include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operation of the electronic device. The storage module may be used to support the execution of program code and data stored in the electronic device. The communication module may be used to support communication between the electronic device and other devices.

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

[0189] 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 Or the device with the structure shown in 5.

[0190] 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 method for sharing an input device of any of the above embodiments.

[0191] An embodiment of the present application further 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 method of sharing an input device in the above-mentioned embodiment.

[0192] In addition, an embodiment of the present application also provides a device, which can 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-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the method of sharing an input device in the above-mentioned method embodiments.

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

[0194] 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 distributed and completed by 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.

[0195] In the several embodiments provided in this 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 merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, 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.

[0196] Units described as separate components may or may not be physically separate, and 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 places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0197] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0198] 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 and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0199] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A method for sharing an input device, characterized in that: The method is performed by a first electronic device, the first electronic device including the input device, and the method includes: Displaying a first interface, where the first interface displays area 1, area 2, area 3, and area 4, wherein area 1 displays an identifier of the first electronic device, and area 4 displays identifiers of at least two electronic devices, the at least two electronic devices being electronic devices that have been searched and discovered by the first electronic device. Area 2 and area 3 are located on either side of area 1, respectively, and are used to display identifiers of electronic devices that have established connections with the first electronic device. receiving a first operation on the identifiers of the at least two second electronic devices, where the first operation is an operation of dragging the identifiers of the at least two electronic devices from the area 4 to the area 2 and / or the area 3; In response to the first operation, creating a SoftAP, generating a corresponding service set identifier (SSID) and a password, sending the SSID and the password to the at least two second electronic devices, and establishing a WiFi P2P connection with the at least two second electronic devices; After the first electronic device establishes a WiFi P2P connection with at least two second electronic devices, determining, based on a first event, a target electronic device with which the input device is currently shared, the target electronic device being one of the at least two second electronic devices, the first event being an event that triggers sharing of the input device, and an area on the first interface where the identifier of the target electronic device is located is related to a direction of a triggering operation in the first event; A second event of the input device is intercepted, and the second event is sent to the target electronic device, where the second event is any event input by the input device.

2. The method according to claim 1, characterized in that The identifiers of the at least two second electronic devices are icons of the at least two second electronic devices.

3. The method according to claim 1 or 2, characterized in that The input device includes a mouse, and the first event is an event input through the mouse.

4. The method according to claim 3, characterized in that The step of determining, according to the first event, a target electronic device currently sharing the input device includes: The target electronic device is determined according to the position and movement direction of the mouse pointer on the display screen of the first electronic device.

5. The method according to claim 4, characterized in that The determining the target electronic device according to the position and movement direction of the mouse pointer on the display screen of the first electronic device includes: If the mouse pointer is located at the edge of the display screen of the first electronic device and continues to move toward the outside of the edge, the target electronic device is determined according to the moving direction of the mouse pointer.

6. The method according to claim 5, characterized in that The step of determining the target electronic device according to the moving direction of the mouse pointer includes: If the moving direction of the mouse pointer is the same as the direction of the area 2 relative to the area 1, determining the second electronic device corresponding to the marker placed in the area 2 as the target electronic device; If the moving direction of the mouse pointer is the same as the direction of the area 3 relative to the area 1, the second electronic device corresponding to the marker placed in the area 3 is determined as the target electronic device.

7. The method according to any one of claims 1 to 6, characterized in that After determining the target electronic device currently sharing the input device, the method further includes: A first message for sharing the input device is sent to the target electronic device, and a confirmation message is received from the target electronic device in response to the first message.

8. 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 7.

9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Input device sharing method, electronic device and system

    CN114579016A

  • Display method and device

    CN114816294A