Peripheral device control method, electronic device, and system
By creating a peripheral agent in the kernel layer of the electronic device and using a distributed input subsystem to synchronize peripheral information, the limitations of the peripheral control method in the existing technology are solved, and efficient sharing of peripherals across devices and improved user experience are achieved.
Patent Information
- Application Number
- CN202210461245.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-04-28
AI Technical Summary
Existing peripheral control methods rely on dedicated software or hardware, which leads to significant limitations in use and affects user experience.
By creating a peripheral agent in the kernel layer of the electronic device, cross-device peripheral control is achieved, avoiding dependence on dedicated software or hardware, and using the distributed input subsystem to synchronize peripheral information, process input events and perform operations.
It enables peripheral sharing between any electronic devices, improves peripheral control efficiency, reduces system development difficulty, and enhances user experience.
Smart Images

Figure CN115033295B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of terminal technology, and in particular to a peripheral control method, electronic device, and system. Background Art
[0002] With the development of terminal technology, electronic devices are becoming more and more diverse in form, including mobile phones, tablets, laptops and other forms. Users may use various forms of electronic devices in their daily lives or office work. For example, while using a laptop to edit a document, you use a tablet to search for information and need to insert photos from your mobile phone into the document being edited. It is very cumbersome for users to operate the peripherals of multiple electronic devices separately, and the peripherals of multiple electronic devices (such as keyboards and mice) are all placed on the desktop, taking up desktop space and easily cluttering the desktop.
[0003] In response to this, developers have proposed a method to control multiple electronic devices through a set of peripherals. For example, A mouse with flow function can control multiple electronic devices as the cursor moves, and supports data transmission between multiple electronic devices. The flow function depends on the corresponding software and Peripheral hardware. For example, by installing synergy Software allows multiple electronic devices to share a keyboard and mouse. However, this method also relies on dedicated software, and as a purely software-based application layer solution, it has high latency during use and is prone to lag. For example, two electronic devices can also share a keyboard and mouse by connecting them via a cable. However, this method only supports sharing keyboards and mice between two electronic devices and relies on dedicated hardware.
[0004] It can be seen that the current peripheral control method has great limitations, which affects the user experience. Summary of the Invention
[0005] To address the aforementioned technical issues, embodiments of the present application provide a peripheral control method, electronic device, and system. The technical solutions provided by embodiments of the present application enable electronic devices to create peripheral proxies corresponding to other electronic devices based on acquired peripheral information, and share the peripherals of other electronic devices through the peripheral proxies. This addresses the issue of peripheral control methods being limited in use and impacting the user experience.
[0006] Furthermore, through the peripheral agent, any electronic device can share the peripherals of other electronic devices without relying on dedicated software or hardware, thereby improving the efficiency of peripheral control.
[0007] In order to achieve the above technical objectives, the embodiments of the present application provide the following technical solutions:
[0008] In a first aspect, a peripheral control method is provided, the method comprising: a first electronic device obtains peripheral information of one or more second electronic devices. The first electronic device creates a peripheral agent corresponding to the peripherals of the one or more second electronic devices based on the peripheral information. The first electronic device receives an input event sent by a second distributed input subsystem of a target second electronic device in one or more second electronic devices through a first distributed input subsystem, the input event being an event determined after the target second electronic device collects a user input operation through a peripheral. The first electronic device processes the input event via a target peripheral agent corresponding to the target second electronic device. The first electronic device executes a target operation corresponding to the input event.
[0009] In some embodiments, the first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
[0010] In this way, each electronic device in the communication system synchronizes peripheral information and creates corresponding peripheral proxies at the kernel layer, enabling cross-device calls of electronic device peripherals. This solves the problem of peripheral control methods being limited in use and affecting the user experience.
[0011] According to the first aspect, or any implementation of the first aspect above, the first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices based on the peripheral information, including: the first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices at the kernel layer based on the peripheral information.
[0012] According to the first aspect, the first electronic device processes input events via the target peripheral agent corresponding to the target second electronic device, including: the target peripheral agent in the first electronic device receives the input event forwarded by the first distributed input subsystem. The target peripheral agent in the first electronic device sends the input event to the first input subsystem. The first input subsystem is a subsystem that is located at the same layer of the operating system of the first electronic device as the first distributed input subsystem, or the first input subsystem and the first distributed input subsystem are the same subsystem. After the first input subsystem in the first electronic device identifies the first application where the input focus is located, it sends the input event to the first application. Alternatively, after the first input subsystem in the first electronic device determines the second application corresponding to the input event according to preset rules, it starts the second application and sends the input event to the second application.
[0013] In this way, the first electronic device reuses the existing input event software processing logic framework to the greatest extent possible. Specifically, the input event is uploaded from the peripheral agent in the kernel layer to the input subsystem in the application framework layer. The input subsystem then identifies and distributes the input event, and the application in the application layer performs the corresponding operation. This satisfies the user's need for cross-device peripheral calls while reducing the difficulty of system development.
[0014] According to the first aspect, or any implementation of the above first aspect, the first electronic device saves a first combination key configuration whitelist of one or more second electronic devices, and the first combination key configuration whitelist is used to indicate whether the received combination key input event is effective in one or more second electronic devices.
[0015] According to the first aspect, or any implementation of the first aspect above, the first electronic device processes an input event via a target peripheral agent corresponding to a target second electronic device; the first electronic device performs a target operation corresponding to the input event, including: the target peripheral agent in the first electronic device sends the input event to the first input subsystem. The first electronic device determines that the input event is a combination key input event through the first input subsystem. The first electronic device determines whether the combination key input information in the combination key input event is in the first combination key configuration whitelist through the first input subsystem. If the combination key input information is not in the first combination key configuration whitelist, the first electronic device performs the target operation.
[0016] According to the first aspect, or any implementation of the first aspect above, the method also includes: the first electronic device sends a second combination key configuration whitelist of the first electronic device to one or more second electronic devices, and the second combination key configuration whitelist is used to indicate whether the combination key input event is effective in the first electronic device.
[0017] In this way, electronic devices transmit their respective combination key whitelists, making the combination keys more suitable for cross-device peripheral control scenarios, meeting user usage needs, reducing user operation difficulty, and improving user experience.
[0018] According to the first aspect, or any implementation of the first aspect above, the first electronic device obtains peripheral information of one or more second electronic devices, including: the first electronic device obtains peripheral information of one or more second electronic devices from a distributed database. Alternatively, the first electronic device receives a broadcast message sent by one or more second electronic devices, and the broadcast message carries peripheral information. Alternatively, the first electronic device downloads peripheral information of one or more second electronic devices from a cloud server. Alternatively, the first electronic device receives peripheral information of one or more second electronic devices sent by a central node of a communication system, and the communication system includes the first electronic device and one or more second electronic devices.
[0019] In this way, electronic device peripheral information synchronization can be flexibly achieved through multiple methods. Thus, the first electronic device can create a peripheral proxy or use a peripheral proxy based on the latest peripheral information, thereby avoiding cross-device peripheral call failures and improving user experience.
[0020] According to the first aspect, or any implementation of the first aspect above, after the first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices based on the peripheral information, the method also includes: the first electronic device initializes an event injection thread and an event transmission thread, the event injection thread is used to inject the received input events into the corresponding peripheral agent, and the event transmission thread is used to receive input events.
[0021] In this way, the first and second electronic devices complete the initialization of their respective threads. Subsequently, the first electronic device can, based on user instructions, cross-devicely call the peripherals of the second electronic device. Furthermore, the second electronic device can also send corresponding input events to the first electronic device based on the input events received by the peripherals. This allows the first electronic device to be controlled by the peripherals of the second electronic device.
[0022] According to the first aspect, or any one of the implementations of the first aspect above, the method further includes: the first electronic device disconnecting the communication connection with the target second electronic device. The first electronic device deletes the target peripheral device agent.
[0023] In this way, the first electronic device updates the corresponding peripheral agent in real time according to the device connection status, thereby avoiding cross-device peripheral call failures and improving user experience.
[0024] According to the first aspect, or any implementation of the first aspect above, the peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
[0025] In a second aspect, a peripheral control method is provided, the method comprising: a second electronic device obtaining peripheral information of a first electronic device; the second electronic device creating a peripheral proxy corresponding to the first electronic device based on the peripheral information; the second electronic device determining, in response to a user operation on the peripheral device, an input event to be forwarded to the first electronic device, the input event being used to instruct the first electronic device to perform a target operation; and the second electronic device sending the input event to a first distributed input subsystem of the first electronic device via a second distributed input subsystem.
[0026] According to a second aspect, the second electronic device stores a first combination key configuration whitelist, where the first combination key configuration whitelist is used to indicate whether a combination key input event is effective in the second electronic device.
[0027] According to the second aspect, or any implementation of the second aspect above, the second electronic device sends an input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem, including: the second input subsystem in the second electronic device determines that the input event is a combination key input event. The second input subsystem in the second electronic device determines that the combination key input information in the combination key input event is not in the first combination key configuration whitelist, and the second electronic device sends the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem; wherein the second input subsystem is a subsystem located at the same layer of the operating system of the second electronic device as the second distributed input subsystem, or the second input subsystem and the second distributed input subsystem are the same subsystem.
[0028] According to the second aspect, or any implementation of the second aspect above, the method further includes: the second electronic device sending the first combination key configuration whitelist to the first electronic device.
[0029] According to the second aspect, or any implementation of the second aspect above, the second electronic device obtaining the peripheral device information of the first electronic device includes: the second electronic device obtaining the peripheral device information of the first electronic device from a distributed database. Alternatively, the second electronic device receives a broadcast message sent by the first electronic device, the broadcast message carrying the peripheral device information. Alternatively, the second electronic device downloads the peripheral device information of the first electronic device from a cloud server. Alternatively, the second electronic device receives the peripheral device information of the first electronic device from a central node of the communication system.
[0030] According to the second aspect, or any implementation of the second aspect above, after the second electronic device creates a peripheral agent corresponding to the first electronic device based on the peripheral information, the method also includes: the second electronic device initializes an event collection thread and an event transmission thread, the event collection thread is used to collect input events through the peripheral, and the event transmission thread is used to send input events.
[0031] According to the second aspect, or any implementation of the second aspect above, the method further includes: the second electronic device disconnecting the communication connection with the first electronic device, and the second electronic device deleting the peripheral device agent corresponding to the first electronic device.
[0032] According to the second aspect, or any implementation of the second aspect above, the first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
[0033] According to the second aspect, or any implementation of the second aspect above, the peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
[0034] The technical effects corresponding to the second aspect and any implementation method of the second aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0035] According to a third aspect, an electronic device is provided. The electronic device is a first electronic device, comprising: a processor and a memory, the memory being coupled to the processor, the memory being used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, the first electronic device executes: the first electronic device obtains peripheral information of one or more second electronic devices. The first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices based on the peripheral information. Afterwards, the first electronic device receives an input event sent by the second distributed input subsystem of the target second electronic device in one or more second electronic devices through the first distributed input subsystem, and the input event is an event determined after the target second electronic device collects the user input operation through the peripheral. The first electronic device processes the input event via the target peripheral agent corresponding to the target second electronic device. The first electronic device executes the target operation corresponding to the input event.
[0036] According to the third aspect, the first electronic device processes input events via the target peripheral agent corresponding to the target second electronic device, including: the target peripheral agent in the first electronic device receives the input event forwarded by the first distributed input subsystem. The target peripheral agent in the first electronic device sends the input event to the first input subsystem; wherein the first input subsystem is a subsystem located at the same layer of the operating system of the first electronic device as the first distributed input subsystem, or the first input subsystem and the first distributed input subsystem are the same subsystem. After the first input subsystem in the first electronic device identifies the first application where the input focus is located, it sends the input event to the first application. Alternatively, after the first input subsystem in the first electronic device determines the second application corresponding to the input event according to preset rules, it starts the second application and sends the input event to the second application.
[0037] According to the third aspect, or any implementation of the third aspect above, the first electronic device saves a first combination key configuration whitelist of one or more second electronic devices, and the first combination key configuration whitelist is used to indicate whether the received combination key input event is effective in one or more second electronic devices.
[0038] According to the third aspect, or any implementation of the third aspect above, the first electronic device processes an input event via a target peripheral agent corresponding to the target second electronic device; the first electronic device performs a target operation corresponding to the input event, including: the target peripheral agent in the first electronic device sends the input event to the first input subsystem. The first electronic device determines that the input event is a combination key input event through the first input subsystem. The first electronic device determines whether the combination key input information in the combination key input event is in the first combination key configuration whitelist through the first input subsystem. If the combination key input information is not in the first combination key configuration whitelist, the first electronic device performs the target operation.
[0039] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer-readable instructions from the memory, it also enables the electronic device to perform the following operations: sending a second combination key configuration whitelist of the first electronic device to one or more second electronic devices, where the second combination key configuration whitelist is used to indicate whether the combination key input event is effective in the first electronic device.
[0040] According to the third aspect, or any implementation of the third aspect above, the first electronic device obtains peripheral information of one or more second electronic devices, including: the first electronic device obtains peripheral information of one or more second electronic devices from a distributed database. Alternatively, the first electronic device receives a broadcast message sent by one or more second electronic devices, and the broadcast message carries peripheral information. Alternatively, the first electronic device downloads peripheral information of one or more second electronic devices from a cloud server. Alternatively, the first electronic device receives peripheral information of one or more second electronic devices sent by a central node of a communication system, and the communication system includes the first electronic device and one or more second electronic devices.
[0041] According to the third aspect, or any implementation of the third aspect above, when the processor reads computer-readable instructions from the memory, it also enables the electronic device to perform the following operations: initialize an event injection thread and an event transmission thread, the event injection thread is used to inject the received input events into the corresponding peripheral agent, and the event transmission thread is used to receive input events.
[0042] According to the third aspect, or any implementation of the third aspect, when the processor reads the computer-readable instructions from the memory, the processor further causes the electronic device to perform the following operations: the first electronic device disconnects the communication connection with the target second electronic device; and the first electronic device deletes the target peripheral device agent.
[0043] According to the third aspect, or any implementation of the third aspect above, the first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices based on the peripheral information, including: the first electronic device creates a peripheral agent corresponding to the peripherals of one or more second electronic devices at the kernel layer based on the peripheral information.
[0044] According to the third aspect, or any implementation of the third aspect above, the first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
[0045] According to the third aspect, or any implementation of the third aspect above, the peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
[0046] The technical effects corresponding to the third aspect and any implementation method of the third aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0047] In a fourth aspect, an electronic device is provided. The electronic device is a second electronic device, comprising: a processor, a memory, and a peripheral device, the memory and the peripheral device being coupled to the processor, the memory being used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, the second electronic device executes: the second electronic device obtains the peripheral information of the first electronic device. The second electronic device creates a peripheral agent corresponding to the first electronic device based on the peripheral information. The second electronic device determines an input event to be forwarded to the first electronic device in response to the user's operation on the peripheral device, and the input event is used to instruct the first electronic device to perform a target operation. The second electronic device sends an input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem.
[0048] According to a fourth aspect, the second electronic device stores a first combination key configuration whitelist, where the first combination key configuration whitelist is used to indicate whether a combination key input event is effective in the second electronic device.
[0049] According to the fourth aspect, or any implementation of the fourth aspect above, the second electronic device sends an input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem, including: the second input subsystem in the second electronic device determines that the input event is a combination key input event. The second input subsystem in the second electronic device determines that the combination key input information in the combination key input event is not in the first combination key configuration whitelist, and the second electronic device sends the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem; wherein the second input subsystem is a subsystem located at the same layer of the operating system of the second electronic device as the second distributed input subsystem, or the second input subsystem and the second distributed input subsystem are the same subsystem.
[0050] According to the fourth aspect, or any implementation of the fourth aspect above, when the processor reads the computer-readable instructions from the memory, it also causes the electronic device to perform the following operation: the second electronic device sends the first combination key configuration whitelist to the first electronic device.
[0051] According to the fourth aspect, or any implementation of the fourth aspect above, the second electronic device obtains the peripheral information of the first electronic device, including: the second electronic device obtains the peripheral information of the first electronic device from a distributed database. Alternatively, the second electronic device receives a broadcast message sent by the first electronic device, the broadcast message carrying the peripheral information. Alternatively, the second electronic device downloads the peripheral information of the first electronic device from a cloud server. Alternatively, the second electronic device receives the peripheral information of the first electronic device sent by a central node of the communication system.
[0052] According to the fourth aspect, or any implementation of the above fourth aspect, when the processor reads computer-readable instructions from the memory, it also enables the electronic device to perform the following operations: the second electronic device initializes an event acquisition thread and an event transmission thread, the event acquisition thread is used to collect input events through peripherals, and the event transmission thread is used to send input events.
[0053] According to the fourth aspect, or any implementation of the fourth aspect, when the processor reads the computer-readable instructions from the memory, the processor further causes the electronic device to perform the following operations: the second electronic device disconnects the communication connection with the first electronic device, and the second electronic device deletes the peripheral device agent corresponding to the first electronic device.
[0054] According to the fourth aspect, or any implementation of the fourth aspect above, the first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
[0055] According to the fourth aspect, or any implementation of the fourth aspect above, the peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
[0056] The technical effects corresponding to the fourth aspect and any implementation method of the fourth aspect can be found in the technical effects corresponding to the above-mentioned second aspect and any implementation method of the second aspect, and will not be repeated here.
[0057] In a fifth aspect, a peripheral control system is provided, which includes a first electronic device as described in the first aspect and any one of the implementations of the first aspect, and a second electronic device as described in the second aspect and any one of the implementations of the second aspect.
[0058] The technical effects corresponding to the fifth aspect and any implementation method of the fifth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0059] In a sixth aspect, an embodiment of the present application provides an electronic device having the function of implementing the peripheral control method described in the first aspect and any possible implementation thereof; or, the electronic device having the function of implementing the peripheral control method described in the second aspect and any possible implementation thereof. This function can be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules corresponding to the above functions.
[0060] The technical effects corresponding to the sixth aspect and any implementation method of the sixth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0061] In a seventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as instructions or code), which, when executed by an electronic device, causes the electronic device to perform the method of the first aspect or any one of the embodiments of the first aspect; or causes the electronic device to perform the method of the second aspect or any one of the embodiments of the second aspect.
[0062] The technical effects corresponding to the seventh aspect and any implementation method of the seventh aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0063] In an eighth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, it enables the electronic device to execute the method of the first aspect or any one of the implementation methods of the first aspect; or, it enables the electronic device to execute the method of the second aspect or any one of the implementation methods of the second aspect.
[0064] The technical effects corresponding to the eighth aspect and any one of the implementation methods of the eighth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here.
[0065] In the ninth aspect, an embodiment of the present application provides a circuit system, which includes a processing circuit, and the processing circuit is configured to execute the method of the first aspect or any one of the embodiments of the first aspect; or, the processing circuit is configured to execute the method of the second aspect or any one of the embodiments of the second aspect.
[0066] The technical effects corresponding to the ninth aspect and any implementation method of the ninth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any implementation method of the first aspect, and will not be repeated here.
[0067] In the tenth aspect, an embodiment of the present application provides a chip system comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the method of the first aspect or any one of the embodiments of the first aspect; or, the at least one processor executes the method of the second aspect or any one of the embodiments of the second aspect.
[0068] The technical effects corresponding to the tenth aspect and any one of the implementation methods of the tenth aspect can be found in the technical effects corresponding to the above-mentioned first aspect and any one of the implementation methods of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] Figure 1 A schematic diagram of a cross-device peripheral control scenario provided in an embodiment of the present application;
[0070] Figure 2 A schematic diagram of a communication system to which a peripheral device control method according to an embodiment of the present application is applied;
[0071] Figure 3 A schematic diagram of the hardware structure of the first electronic device or the second electronic device provided in an embodiment of the present application;
[0072] Figure 4A A schematic diagram of the software structure of the first electronic device or the second electronic device provided in the embodiment of the present application Figure 1 ;
[0073] Figure 4B A schematic diagram of the software structure of the first electronic device or the second electronic device provided in the embodiment of the present application Figure 2 ;
[0074] Figure 5 Schematic diagram of the peripheral control method provided in the embodiment of the present application Figure 1 ;
[0075] Figure 6 Schematic diagram of module interaction in the application scenario of the peripheral control method provided in the embodiment of the present application Figure 1 ;
[0076] Figure 7A Interface diagram provided for the embodiment of this application Figure 1 ;
[0077] Figure 7B Interface diagram provided for the embodiment of this application Figure 2 ;
[0078] Figure 8 Schematic diagram of the peripheral control method provided in the embodiment of the present application Figure 2 ;
[0079] Figure 9 Schematic diagram of the peripheral control method provided in the embodiment of the present application Figure 3 ;
[0080] Figure 10 Schematic diagram 4 of the peripheral control method flow chart provided in an embodiment of the present application;
[0081] Figure 11 Schematic diagram of module interaction in the application scenario of the peripheral control method provided in the embodiment of the present application Figure 2 ;
[0082] Figure 12 Schematic diagram of the peripheral control method provided in the embodiment of the present application Figure 5 ;
[0083] Figure 13 A schematic structural diagram of a first electronic device provided in an embodiment of the present application;
[0084] Figure 14 A schematic structural diagram of a second electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0085] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two).
[0086] References to "one embodiment" or "some embodiments" etc. described in this specification mean that the specific features, structures or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in another way. The term "connected" includes direct and indirect connections, unless otherwise stated. "First" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.
[0087] In the embodiments of this application, words such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplarily" or "for example" is intended to present the relevant concepts in a concrete manner.
[0088] In some scenarios, users may need to operate multiple electronic devices in their daily lives or work. If each electronic device is equipped with its own peripherals, users need to operate multiple peripherals one by one to control the corresponding electronic device. This operation is cumbersome, and multiple peripherals take up a lot of space, making the desktop cluttered.
[0089] In response to this, developers have proposed a method to control multiple electronic devices through a set of peripherals. For example, A mouse with flow function can control multiple electronic devices as the cursor moves, and supports data transmission between multiple electronic devices.
[0090] For example, Figure 1 As shown in (a), the laptop computer 101 detects the user's operation of moving the cursor 11 to the edge of the display screen, determines that there is a tablet 102 in the direction corresponding to the edge of the display screen, and can determine that the user instructed to move the mouse to the tablet 102. Figure 1 As shown in (b), in response to the user's operation of moving the cursor 11, the tablet 102 displays the cursor 11, and the user can control the tablet 102 using the mouse and keyboard of the laptop 101. In addition, in response to the user's copy operation on the tablet 102 and the paste operation on the laptop 101, the tablet 102 can send its stored data (such as text, images, files, etc.) to the laptop 101.
[0091] Thus, it is possible to control multiple electronic devices through a set of keyboard and mouse devices. The flow function depends on the corresponding software and Peripheral hardware. For example, only Logitech A set of keyboard and mouse devices with the function of controlling other electronic devices, while other devices are not equipped with Logitech Functional keyboard and mouse devices cannot control other electronic devices and have great limitations in use.
[0092] For example, by installing Software, multiple electronic devices can share a set of keyboards and mice. Among the multiple electronic devices, one electronic device acts as a server host, and the user uses its keyboard and mouse to control one or more electronic devices as client hosts. For example, after the server host's keyboard and mouse receive the user's operation, it uploads the corresponding input event to the input subsystem. After the input event is recognized and distributed by the input subsystem, the application layer The software can obtain the input events distributed to it. After that, the server host The software forwards the input events to the client host, completing the collection of keyboard and mouse input events across devices on the client host.
[0093] It can be seen that this method also relies on dedicated software (i.e. Software), and because input events require event recognition and distribution on the server, this time-consuming process results in a longer process for the client to receive input events. This, in turn, leads to higher latency in the overall keyboard and mouse device invocation process, which can easily cause lag. Furthermore, only one server keyboard and mouse can control the client, not the client's keyboard and mouse, nor can it control the server, or multiple keyboards and mice on multiple hosts control each other. This significantly limits its use and impacts the user experience.
[0094] For example, two electronic devices can be connected via a universal serial bus (USB) cable, sharing a keyboard and mouse to transfer data. The cable contains the necessary hardware and drivers, allowing each device to control the other.
[0095] However, the copy cable only supports sharing keyboard and mouse between two electronic devices, and relies on the copy cable as a dedicated hardware, which has great limitations in use.
[0096] Therefore, the embodiments of the present application provide a peripheral control method in which an electronic device creates a distributed peripheral proxy based on the peripheral information obtained from each electronic device in a distributed system. This distributed proxy enables any electronic device to share the peripherals of other electronic devices without relying on dedicated software or hardware, thereby improving peripheral control efficiency and enhancing the user experience.
[0097] Figure 2 Schematic diagram of a communication system to which the peripheral control method provided in the embodiment of the present application is applied. Figure 2 As shown in , the communication system includes a first electronic device 100 and a second electronic device 200. The number of the second electronic device 200 is one or more. Figure 2 The second electronic device 1, the second electronic device 2, etc. are shown.
[0098] In some embodiments, the first electronic device 100 can receive and respond to content input by a user through the peripheral devices of one or more second electronic devices 200. In addition, one or more second electronic devices 200 can also receive and respond to content input by a user through the peripheral devices of the first electronic device 100. Furthermore, any second electronic device 200 among the multiple second electronic devices 200 can also receive and respond to content input by a user through the peripheral devices of other second electronic devices 200, for example, second electronic device 1 can receive and respond to content input by a user through the peripheral devices of second electronic device 2.
[0099] Optionally, the first electronic device 100 or the second electronic device 200 may be, for example, a mobile phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a wearable device, an artificial intelligence (AI) device, a car computer, or other terminal devices. The operating system installed on the first electronic device 100 or the second electronic device 200 includes but is not limited to This application does not limit the specific type of the first electronic device 100 or the second electronic device 200 or the installed operating system.
[0100] In some embodiments, a communication connection is established between the first electronic device 100 and the second electronic device 200. The communication connection can be a wired connection (such as a USB connection) or a wireless communication connection. The wireless communication technology for establishing the wireless communication connection includes but is not limited to at least one of the following: Bluetooth (BT) (for example, traditional Bluetooth or Bluetooth low energy (BLE)), wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), nearfield communication (NFC), Zigbee, frequency modulation (FM), infrared (IR), etc.
[0101] Optionally, the first electronic device 100 and the second electronic device 200 may also establish a communication connection through a third-party device in the local area network, such as a router, a gateway, a smart device controller, a server, a wireless access point (AP) device, etc.
[0102] Optionally, the first electronic device 100 and the second electronic device 200 can also communicate via a distributed soft bus. It should be noted that the relevant contents of the distributed soft bus can be referred to the existing technology, and will not be described in detail in the embodiments of the present application.
[0103] In some embodiments, after the first electronic device 100 and the second electronic device 200 establish a communication connection, the first electronic device 100 can receive and respond to content input by the user through the peripherals of the second electronic device 200 (such as a keyboard and mouse device) through the communication connection between the first electronic device 100 and the second electronic device 200.
[0104] For example, both the first electronic device 100 and the second electronic device 200 support proximity discovery. For example, when the first electronic device 100 is brought close to the second electronic device 200, the first electronic device 100 and the second electronic device 200 can discover each other and then establish a wireless communication connection, such as a Wi-Fi peer-to-peer (P2P) connection and / or a Bluetooth connection. The user can then use the peripherals configured on the second electronic device 200 to operate the first electronic device 100.
[0105] For another example, the first electronic device 100 and the second electronic device 200 establish a wireless communication connection via a local area network. For example, the first electronic device 100 and the second electronic device 200 are both connected to the same router.
[0106] For another example, the first electronic device 100 and the second electronic device 200 establish a wireless communication connection via a cellular network, the Internet, etc. For example, the second electronic device 200 accesses the Internet via a router, and the first electronic device 100 accesses the Internet via a cellular network; thus, the first electronic device 100 and the second electronic device 200 establish a wireless communication connection.
[0107] For example, Figure 3 A structural diagram of the first electronic device 100 or the second electronic device 200 is shown.
[0108] The first electronic device 100 or the second electronic device 200 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 sensor module 180, a button 190, a motor 191, a peripheral module 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0109] It should be understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the first electronic device 100 or the second electronic device 200. In other embodiments of the present application, the first electronic device 100 or the second electronic device 200 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.
[0110] For example, when the first electronic device 100 is a PC, the first electronic device 100 may not include the mobile communication module 150 and the SIM card interface 195 .
[0111] 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 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.
[0112] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0113] 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 access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0114] In some embodiments, the processor 110 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, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0115] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C busses. The processor 110 may be coupled to a touch sensor, a charger, a flash, a camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to a touch sensor via an I2C interface, enabling communication between the processor 110 and the touch sensor via the I2C bus interface, thereby enabling touch functionality of the first electronic device 100 or the second electronic device 200.
[0116] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the first electronic device 100 or the second electronic device 200. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the first electronic device 100 or the second electronic device 200.
[0117] The USB interface 130 is an interface that complies with USB standards and specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the first electronic device 100 or the second electronic device 200, and can also be used to transfer data between the first electronic device 100 or the second electronic device 200 and a peripheral device. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as AR devices.
[0118] It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the first electronic device 100 or the second electronic device 200. In other embodiments of the present application, the first electronic device 100 or the second electronic device 200 may also adopt a different interface connection method from the above embodiments, or a combination of multiple interface connection methods.
[0119] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via a wireless charging coil on the first electronic device 100 or the second electronic device 200. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0120] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0121] The wireless communication function of the first electronic device 100 or the second electronic device 200 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0122] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the first electronic device 100 or the second electronic device 200 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 antennas can be used in conjunction with a tuning switch.
[0123] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the first electronic device 100 or the second electronic device 200. 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.
[0124] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs the sound signal through the audio device or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
[0125] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., which are applied to the first electronic device 100 or the second electronic device 200. 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 the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0126] In some embodiments, the antenna 1 of the first electronic device 100 or the second electronic device 200 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the first electronic device 100 or the second electronic device 200 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0127] The first electronic device 100 or the second electronic device 200 implements display functions through a GPU, display screen 194, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0128] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be manufactured using a liquid crystal display (LCD), for example, an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini-LED, a Micro-LED, a Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the first electronic device 100 or the second electronic device 200 may include one or N display screens 194, where N is a positive integer greater than 1.
[0129] The peripheral module 192 may include a mouse, a keyboard, a touchpad for realizing keyboard and mouse functions, etc. In some embodiments, a peripheral agent of the second electronic device 200 has been set in the first electronic device 100, and the first electronic device 100 can use the peripherals of the second electronic device 200. Then, after receiving the content input by the user through the peripheral module 192, the second electronic device 200 can display it on the display screen of the second electronic device 200, or on the display screen of the first electronic device 100 that has established a communication connection with the second electronic device 200. Optionally, the peripheral module 192 is an optional module. For example, if the first electronic device 100 is a PAD, it can be configured without the peripheral module 192 and directly receive the user's input operation through the display screen 194.
[0130] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the first electronic device 100 or the second electronic device 200 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0131] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the first electronic device 100 or the second electronic device 200. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0132] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the first electronic device 100 or the second electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the first electronic device 100 or the second electronic device 200 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0133] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be set in the processor 110, or some functional modules of the audio module 170 can be set in the processor 110. The first electronic device 100 or the second electronic device 200 can use the audio module 170, such as music playback, recording, etc. The audio module 170 may include a speaker, a receiver, a microphone, a headphone jack, and an application processor to implement audio functions.
[0134] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
[0135] A pressure sensor is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor can be located on the display screen 194. There are many types of pressure sensors, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When a force acts on the pressure sensor, the capacitance between the electrodes changes. The first electronic device 100 or the second electronic device 200 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen, the first electronic device 100 or the second electronic device 200 detects the intensity of the touch operation using the pressure sensor. The first electronic device 100 or the second electronic device 200 can also calculate the location of the touch based on the detection signal from the pressure sensor. In some embodiments, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0136] A touch sensor is also called a "touch device." The touch sensor can be provided on the display screen 194. The touch sensor and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided through the display screen 194. In other embodiments, the touch sensor can also be provided on the surface of the first electronic device 100 or the second electronic device 200, at a location different from that of the display screen 194.
[0137] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The first electronic device 100 or the second electronic device 200 may receive key inputs and generate key signal inputs related to user settings and function control of the first electronic device 100 or the second electronic device 200.
[0138] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0139] The SIM card interface 195 is used to connect a SIM card. A SIM card can be connected to or disconnected from the first electronic device 100 or the second electronic device 200 by inserting or removing the SIM card from the SIM card interface 195. The first electronic device 100 or the second electronic device 200 may support one or N SIM card interfaces, where N is a positive integer greater than one.
[0140] In some scenarios, the first electronic device 100 and the second electronic device 200 may be installed with the same or different operating systems. As an example, the software structure of the electronic device is described.
[0141] For example, it is assumed that the operating system installed in the first electronic device 100 or the second electronic device 200 is Figure 4A It is a software structure block diagram of the first electronic device 100 or the second electronic device 200 in an embodiment of the present application.
[0142] The software system of the first electronic device 100 or the second electronic device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the example, the software structure of the first electronic device 100 or the second electronic device 200 is exemplarily described.
[0143] 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, It is divided into three layers, from top to bottom: application layer, application framework layer, and kernel layer.
[0144] The application layer can include a series of application packages.
[0145] like Figure 4A As shown, the application package may include applications such as notepad, short message, camera, calendar, music, gallery, map, call, video, etc.
[0146] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0147] like Figure 4A As shown, the application framework layer may include an input subsystem, a distributed input subsystem, a content provider, a notification manager, a view system, a resource manager, and the like.
[0148] For example, Figure 4BAs shown, the input subsystem includes a local input device management module and a distributed input device management module. The local input device management module is used to manage its own configured input devices (i.e., peripherals), such as a keyboard and mouse. The distributed input device management module is used to manage the input devices of other electronic devices in the communication system.
[0149] The distributed input subsystem is used to synchronize peripheral information of other electronic devices in the communication system, create peripheral agents of other electronic devices, receive input events of peripherals of other electronic devices, and realize cross-device peripheral management and calling.
[0150] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0151] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0152] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0153] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0154] The kernel layer is the layer between hardware and software. The kernel layer includes peripheral drivers, display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0155] For example, Figure 4B As shown, the peripheral driver includes a local peripheral driver and a distributed peripheral driver. The local peripheral driver is used to manage local peripherals, while the distributed peripheral driver is used to manage peripheral agents of other electronic devices in the communication system created by the distributed input subsystem.
[0156] For example, electronic devices (such as the first electronic device 100 and / or the second electronic device 200) can create peripheral agents corresponding to other electronic devices in the communication system in the kernel layer. After receiving input events detected by peripherals of other electronic devices, the distributed input subsystem in the application framework layer injects the input events into the peripheral agents corresponding to the other electronic devices, and completes the uploading of the input events to the corresponding applications in the application layer through the corresponding peripheral agents. In this way, the software processing process of the electronic device for peripheral input events can reuse the existing logical framework to the greatest extent (that is, the input events are sent to the upper layer for processing in the order of the kernel layer, the application framework layer, and the application layer), while meeting the user's needs for calling peripherals across devices and reducing the difficulty of system development.
[0157] In addition, for the application layer of the electronic device, there is no need to distinguish whether the acquired peripheral input is from a peripheral of the electronic device or a peripheral of another electronic device. Instead, the electronic device can be directly instructed to perform corresponding operations based on the received peripheral input.
[0158] Optionally, after the electronic device creates a peripheral proxy, the application in the application layer can identify the peripheral proxy (i.e., the peripheral for which the peripheral proxy has been created is visible to the application layer), thereby enabling the selection and use of the corresponding peripheral proxy. Alternatively, the electronic device can display the peripherals for which the peripheral proxy has been created on the display screen through various means such as controls, allowing the user to select the peripheral to be used.
[0159] The following takes the first electronic device 100 as the first electronic device and the second electronic device 200 including the second electronic device 1 and the second electronic device 2 as an example to describe in detail the peripheral control method provided in the embodiment of the present application.
[0160] For example, Figure 5 This is a flow chart of a peripheral control method provided in an embodiment of the present application. Figure 5 As shown, the method includes the following steps.
[0161] S501: The first electronic device determines a global peripheral.
[0162] In some embodiments, after the first electronic device is connected to the communication system, it can synchronize the peripheral information of each second electronic device in the communication system through the input subsystem, and create or update the proxy node of the second electronic device peripheral, so that the first electronic device can subsequently receive and respond to the content input by the user through the peripheral of the second electronic device.
[0163] For example, Figure 6As shown, a first electronic device, a second electronic device 1, and a second electronic device 2 establish a communication connection. The first electronic device is configured with a keyboard 1 and a mouse 1, the second electronic device 1 is configured with a keyboard 2 and a mouse 2, and the second electronic device 3 is configured with a keyboard 3 and a mouse 3. The distributed input subsystem in the application framework layer of each electronic device includes a peripheral information synchronization module for synchronizing peripheral information. For example, the distributed input subsystem 62 in the first electronic device includes a peripheral information synchronization module 621, which can obtain peripheral information of the second electronic device 1 and the second electronic device 2.
[0164] Optionally, the peripheral information synchronization module writes the queried peripheral information into a distributed database, and the distributed database synchronizes the peripheral information of each electronic device, so that each electronic device can obtain the same peripheral information. Figure 6 In the scenario shown, the distributed database stores the same peripheral information of the first electronic device, the second electronic device 1 , and the second electronic device 2 .
[0165] Alternatively, the electronic device sends the peripheral information of its own configured peripherals to other electronic devices in the communication system by broadcasting, etc. After receiving the peripheral information, the other electronic devices synchronously update the stored peripheral information, thereby achieving synchronization of the peripheral information in the communication system.
[0166] Alternatively, an electronic device can upload the peripheral information of its configured peripherals to a cloud server, which then synchronizes and updates the acquired peripheral information for multiple electronic devices. Other electronic devices in the communication system can then synchronize the peripheral information in the communication system by downloading the peripheral information from the cloud server. Alternatively, the cloud server can synchronize the peripheral information in the communication system by sending synchronized peripheral information to electronic devices in the communication system at a preset period.
[0167] Alternatively, multiple electronic devices in the communication system elect a central node according to a preset election mechanism, and synchronize peripheral information through the central node. Optionally, the central node is, for example, an electronic device that can maintain communication in the communication system, or an electronic device with strong computing power, or a non-battery device (i.e., a device that can guarantee a long working time), etc. The electronic devices in the communication system exchange information and elect an electronic device that meets some or all of the above conditions as the central node. For example, the central node is a router. Optionally, if the central node is powered off, the electronic devices in the communication system can re-elect a central node for synchronizing peripheral information. Among them, the election method of the central node in the communication system can refer to the prior art, and the embodiments of the present application are not specifically limited to this. Afterwards, after the central node obtains the peripheral information broadcast or reported by each electronic device in the communication system, it synchronously updates the information of each peripheral. The electronic device can obtain the peripheral information of other electronic devices from the central node to achieve synchronization of peripheral information in the communication system.
[0168] It should be noted that Figure 6 The division of the modules in the application framework layer in the electronic device shown is used to illustrate the functions that can be realized by the application framework layer, and does not constitute a restriction on the division of the functional modules in the application framework layer. In other embodiments of the present application, the application framework layer may include more or fewer modules than shown in the figure, or combine certain modules, or split certain modules, or arrange the modules differently. For example, the input subsystem and the distributed input subsystem can form a module to realize the functions of the input subsystem and the distributed input subsystem. This will not be explained below.
[0169] In some embodiments, after obtaining peripheral information, the electronic device synchronizes the peripheral agent in the kernel layer based on the peripheral information. For example, the kernel layer determines whether the corresponding peripheral agent has already been created. If not, the kernel layer may create the corresponding peripheral agent based on the peripheral information. For another example, if the peripheral information does not include an existing peripheral agent, the kernel layer may delete the corresponding peripheral agent.
[0170] For example, Figure 6 As shown, the input subsystem in the electronic device application framework layer includes a distributed input management module, which includes a global peripheral management module for managing one or more peripheral agents of other electronic devices in the communication system. The global peripheral management module is also used to create peripheral agents in the kernel layer that can be recognized by upper-layer applications.
[0171] like Figure 6As shown, the global peripheral management module 6111 in the first electronic device receives the peripheral information (such as peripheral specifications, etc.) sent by the peripheral information synchronization module 621. Afterwards, the global peripheral management module 6111 creates a keyboard 2 proxy and a mouse 2 proxy corresponding to the second electronic device 1, as well as a keyboard 3 proxy and a mouse 3 proxy corresponding to the second electronic device 2 in the kernel layer based on the acquired peripheral information.
[0172] Optional, such as Figure 6 As shown, the distributed input subsystem 62 in the first electronic device also includes a service management module 622. The service management module 622 can also obtain the peripheral information sent by the peripheral information synchronization module 621, create a corresponding peripheral proxy in the local kernel layer based on the peripheral information, as a mapping of the peripherals of other electronic devices, and send the created peripheral proxy information to the global peripheral management module 6111.
[0173] Optionally, different operating systems have different ways of creating peripheral agents. Taking the system as an example, the input-related parameters and interface definitions are defined in the uinput.h and input-event-codes.h header files to create a keyboard agent. The specific code is as follows:
[0174]
[0175] In some embodiments, after the electronic device is disconnected from other electronic devices in the communication system, the other electronic devices may delete the peripheral agent corresponding to the electronic device. Taking the system as an example, the code for deleting the peripheral agent is as follows:
[0176] ioctl(fd,UI_DEV_DESTROY);
[0177] It should be noted that the above Taking the system as an example, the code for creating and deleting a peripheral agent is illustrated. The code for creating and deleting a peripheral agent in other operating systems can refer to the above code, and this embodiment of the application does not make specific restrictions on this.
[0178] In some embodiments, a corresponding mapping relationship can be established between the peripheral proxy created by the kernel layer and the peripherals actually configured in the electronic device of the communication system according to a preset mapping method. The number of preset mapping methods is one or more. Subsequently, after the electronic device receives input events sent by different peripherals, it injects the input events into the corresponding peripheral proxy according to the mapping relationship, thereby realizing the control of the device itself through the peripheral proxy corresponding to the peripheral of other electronic devices.
[0179] For example, the peripheral proxy created by the electronic device at the local end is matched one-to-one with the peripherals of other electronic devices. Figure 6 As shown, a keyboard 2 agent corresponding to the keyboard 2 of the second electronic device 1, a mouse 2 agent corresponding to the mouse 2 of the second electronic device 1, a keyboard 3 agent corresponding to the keyboard 3 of the second electronic device 2, and a mouse 3 agent corresponding to the mouse 3 of the second electronic device 2 are created in the kernel layer of the first electronic device.
[0180] For another example, an electronic device can create a peripheral proxy corresponding to all peripherals of the electronic device on its own end, thereby creating a corresponding number of peripheral proxies based on the number of other electronic devices in the communication system. For example, if a second electronic device 1 is equipped with a keyboard 2 and a mouse 2, after the first electronic device obtains the peripheral information of the second electronic device 1, it creates a peripheral proxy corresponding to the second electronic device 1. This peripheral proxy corresponds to the keyboard 2 and the mouse 2. After the keyboard 2 and the mouse 2 of the second electronic device 1 receive an input event, they input the input event into a corresponding peripheral proxy in the first electronic device.
[0181] For another example, the electronic device creates peripheral proxies corresponding to all peripherals of all other electronic devices in the communication system on its own side, and receives input events received by peripherals of other electronic devices through the peripheral proxies and performs corresponding operations.
[0182] S502: The first electronic device queries available peripheral devices.
[0183] In some embodiments, after the first electronic device determines the global peripherals, an upper-layer service (such as a control application) can choose to enable or disable the peripherals of a specified device as a local peripheral as needed.
[0184] Optionally, the control application is an application in the application layer of the electronic device that requires the use of peripherals or can implement the function of searching for peripherals. Such as a hyperterminal application, a computer manager application, a notepad application, a short message application, etc. For example, in response to the user's operation of searching for devices in the hyperterminal application, the first electronic device searches for and displays available peripherals and / or electronic devices located near the first electronic device. For another example, the first electronic device displays the notepad application interface and displays a cursor in the input box. Then, the first electronic device can query the available peripherals for receiving the display content input by the user.
[0185] For example, Figure 6 As shown, the peripheral control module 6112 in the distributed input management module 611 in the first electronic device input subsystem 61 is used to provide peripherals for use by upper-layer applications. For example, an application at the application layer may determine that the peripherals available to the local end include keyboard 1, mouse 1, keyboard 2, mouse 2, keyboard 3, and mouse 3.
[0186] For example, Figure 7AAs shown in (a), the first electronic device (such as a tablet) detects the user clicking the super terminal device search control 71 displayed in the drop-down notification bar, determines that the user's instruction to query available peripherals is received, and searches for electronic device peripherals nearby. Figure 7A As shown in (b), control 72 is an icon for representing the first electronic device itself, and icons of searched electronic device peripherals and / or electronic devices are displayed around control 72 (such as control 73 is an icon for representing a computer keyboard and mouse located near the first electronic device), so as to query the available peripherals of the first electronic device.
[0187] Optionally, the peripherals searched for by the first electronic device are peripherals for which corresponding peripheral agents have been created on the local end. In other words, the first electronic device first performs step S501 to determine global peripherals and create corresponding peripheral agents. Then, step S502 is performed to determine available peripherals based on the created peripheral agents.
[0188] Alternatively, after the first electronic device searches for an electronic device equipped with peripherals located nearby, the electronic device icon may be directly displayed. Afterwards, in response to the user's operation on the electronic device icon (such as dragging the electronic device icon to the first electronic device icon), the first electronic device may create a peripheral agent corresponding to the electronic device and determine that the peripheral of the electronic device is an available peripheral. That is, the first electronic device may first execute the above step S502 to search for available peripherals nearby (including electronic devices equipped with peripherals to which a connection can be established). Afterwards, the first electronic device executes the above step S501 again, and the global peripheral information synchronization process includes creating a peripheral agent corresponding to the available peripheral selected by the user in response to the user operation.
[0189] Optionally, the peripherals of the electronic device can be searched as a whole by other electronic devices, and / or different peripherals of the electronic device can be searched separately by other electronic devices.
[0190] For example, Figure 7A As shown in , the available peripherals searched by the first electronic device include computer keyboard and mouse (ie, computer keyboard and mouse). Or, Figure 7B As shown, the available peripherals searched by the first electronic device may include a study computer keyboard and mouse, a bedroom computer mouse, a bedroom computer keyboard, a PAD1 touchpad, and a laptop keyboard and mouse. The user can select the available peripherals according to needs.
[0191] It should be noted that Figure 7BIn the example scenario, the electronic device name can be a device name set by the user (e.g., a device name set by the user based on the location of the electronic device). Alternatively, the first electronic device can determine the location information of the other electronic device during the process of establishing a connection with the other electronic device, and then generate a corresponding device name to facilitate user differentiation. This process can be referred to in the prior art and is not described in detail in the embodiments of this application.
[0192] For example, in Figure 1 In the scenario shown, the laptop computer 101 responds to the user's operation of moving the cursor 11 to the edge of the display screen of the laptop computer 101 through its touchpad, queries the first electronic device (such as the tablet 102) located in the direction of the edge of the display screen, and sends a peripheral usage instruction to the first electronic device. After receiving the peripheral usage instruction, the first electronic device determines that the peripheral of the laptop computer 101 is an available peripheral (such as determining that a peripheral agent corresponding to the laptop computer 101 has been created locally; or after creating a peripheral agent corresponding to the laptop computer 101 peripheral according to the peripheral usage instruction, it determines that the peripheral is an available peripheral). As a result, the cursor 11 is displayed on the display screen of the first electronic device, and the user can subsequently use the peripheral of the laptop computer 101 to control the first electronic device.
[0193] In this way, each electronic device in the communication system synchronizes peripheral information and creates a corresponding peripheral agent in the kernel layer to implement cross-device calls of electronic device peripherals.
[0194] The following takes the example of the first electronic device calling the peripheral device of the second electronic device 1 to introduce in detail the thread initialization process in the process of cross-device calling the peripheral device.
[0195] For example, Figure 8 This is a flow chart of another peripheral control method provided in an embodiment of the present application. Figure 8 As shown, the method includes the following steps.
[0196] S801: A control application in a first electronic device sends an indication of querying available peripherals to a global peripheral management module in the first electronic device.
[0197] In some embodiments, the control application in the first electronic device queries available peripherals through the global peripheral management module in response to user operations. Optionally, the available peripherals include its own peripherals and peripherals of other electronic devices in the communication system.
[0198] For example, Figure 1 In the illustrated scenario, the control application is a PC manager application. After receiving the peripheral usage instruction sent by the laptop computer 101 through the PC manager application, the tablet 102 (i.e., the first electronic device) queries the available peripherals through the global peripheral management module to determine whether the laptop computer 101 peripherals are available.
[0199] Another example is Figure 7A In the scenario shown, the control application is the HyperTerminal application. Figure 7A As shown in (a), the first electronic device (ie, tablet) queries available peripherals through the global peripheral management module in response to the user clicking the device search control 71 in the hyperterminal application.
[0200] Optionally, for the remaining contents in step S801, reference may be made to the relevant contents in the above-mentioned step S502, which will not be repeated here.
[0201] S802: The control application in the first electronic device determines a peripheral device to be used.
[0202] In some embodiments, the first electronic device determines the peripheral device to be used in response to a user operation; or the first electronic device searches for an available peripheral device and determines the available peripheral device as the peripheral device to be used.
[0203] For example, corresponding to the above Figure 7A The scene shown, such as Figure 7A As shown in (b), after the first electronic device (such as a tablet) detects the user dragging the control 73 to move to the control 72, it determines that the user indicates to establish a communication connection with the computer keyboard and mouse, and determines that the external device to be used is the computer keyboard and mouse. Figure 7A As shown in (c), the computer keyboard and mouse icons displayed on the tablet change to the content shown in control 74, prompting the user that a communication connection has been established between the tablet and the computer keyboard and mouse.
[0204] Another example is Figure 1 In the scenario shown, the first electronic device detects that a user has moved the cursor to an edge of the display screen via the touchpad of laptop computer 101, queries the available peripherals in the direction corresponding to that edge, and determines that the user has indicated the use of the peripheral in that direction, i.e., the peripheral in that direction is the peripheral to be used. Optionally, if there are multiple peripherals available in the direction corresponding to the edge, the first electronic device may prompt the user to select one of the peripherals to be used by displaying a prompt in a pop-up window.
[0205] S803: The control application in the first electronic device sends an initialization peripheral device instruction to the peripheral device control module in the first electronic device.
[0206] In some embodiments, after the first electronic device determines the peripheral device to be used, it initializes a thread corresponding to a module that needs to be used in the process of calling the peripheral device across devices.
[0207] For example, Figure 6As shown, the distributed input management module 611 in the first electronic device input subsystem 61 includes a peripheral control module 6112 for controlling peripherals. After the control application determines the peripheral to be used, it can send an initialization instruction to the peripheral control module 6112 to instruct the peripheral control module 6112 to forward the initialization instruction to the corresponding module.
[0208] S804: The peripheral control module in the first electronic device forwards the peripheral initialization instruction to the service management module in the first electronic device.
[0209] In some embodiments, as Figure 6 As shown, the first electronic device distributed input subsystem 62 includes a service management module 622. The service management module 622 is configured to provide other modules with the ability to call a distributed peripheral agent. Upon receiving a peripheral initialization instruction from the control application, the peripheral control module 6112 forwards the peripheral initialization instruction to the relevant modules via the service management module 622.
[0210] In some embodiments, the peripheral to be used determined by the first electronic device in step S802 is a peripheral of the second electronic device 1. The initialization peripheral indication sent by the peripheral control module in the first electronic device to the service management module includes an identifier of the second electronic device 1, which is used to indicate the second electronic device 1 or to indicate a peripheral of the second electronic device 1.
[0211] S805: The first electronic device and the second electronic device 1 establish a communication connection through the service management module.
[0212] In some embodiments, after receiving the indication to initialize the peripheral device, the service management module in the first electronic device may determine that the peripheral device to be used is a peripheral device of the second electronic device 1 , and then establish a communication connection with the second electronic device 1 .
[0213] Optionally, the service management module determines that the peripheral device to be used is a peripheral device of the second electronic device 1 according to the identifier of the second electronic device 1 in the initialization peripheral device indication, and determines to establish a communication connection with the second electronic device 1 .
[0214] In some embodiments, after the first electronic device determines to establish a communication connection with the second electronic device 1, it can send an initialization thread indication to the modules needed to be used in the cross-device peripheral call process through the service management module to instruct each module to initialize the corresponding thread.
[0215] S806a: The service management module in the first electronic device sends an initialization event injection thread instruction to the event injection module in the first electronic device.
[0216] S807a: The event injection module in the first electronic device initializes an event injection thread.
[0217] S808a: The event injection module in the first electronic device sends an initialization event injection thread response to the service management module in the first electronic device.
[0218] In some embodiments, in steps S806a to S808a, Figure 6 As shown, the first electronic device distributed input subsystem 62 further includes an event injection module 625. The event injection module 625 is configured to inject input events received from other electronic device peripherals into corresponding peripheral agent (e.g., the peripheral agent corresponding to the second electronic device 1), so that the first electronic device can perform operations corresponding to the input events.
[0219] Therefore, during the cross-device peripheral call process, the first electronic device needs to use the event injection module, and the service management module sends an initialization event injection thread instruction to the event injection module. Correspondingly, the event injection module initializes the event injection thread according to the received initialization event injection thread instruction. And, after the initialization is completed, an initialization event injection thread response is sent to the service management module to notify the service management module that the event injection thread has completed initialization.
[0220] S806b: The service management module in the first electronic device sends an initialization event transmission thread instruction to the event transmission module in the first electronic device.
[0221] S807b: The event transmission module in the first electronic device initializes an event transmission thread.
[0222] S808b: The event transmission module in the first electronic device sends an initialization event transmission thread response to the service management module in the first electronic device.
[0223] In some embodiments, in steps S806b-S808b, as Figure 6 As shown, the first electronic device distributed input subsystem 62 further includes an event transmission module 626. The event transmission module 626 is used to provide input event cross-device transmission functions, such as encoding, sending, receiving, and decoding functions of input events.
[0224] Therefore, during the cross-device peripheral call process, the first electronic device needs to use the event transmission module, and the service management module sends an initialization event transmission thread instruction to the event transmission module. Accordingly, the event transmission module initializes the event transmission thread based on the received initialization event transmission thread instruction. And, after the initialization is completed, an initialization event transmission thread response is sent to the service management module to notify the service management module that the event transmission thread has been initialized.
[0225] S806c: The service management module in the second electronic device 1 sends an initialization event collection thread instruction to the event collection module in the second electronic device 1 .
[0226] S807c: The event collection module in the second electronic device 1 initializes an event collection thread.
[0227] S808c: The event collection module in the second electronic device 1 sends an initialization event collection thread response to the service management module in the second electronic device 1.
[0228] In some embodiments, in steps S806c to S808c, Figure 6 As shown, the distributed input subsystem 64 of the second electronic device 1 further includes an event acquisition module 643. The event acquisition module 643 is configured to acquire input events from peripherals connected to the local device, such as input events sent by the keyboard 2 and the mouse 2.
[0229] Therefore, if the second electronic device 1 needs to use the event collection module during the cross-device peripheral call process, the service management module in the second electronic device 1 will send an initialization event collection thread instruction to the event collection module. Accordingly, the event collection module initializes the event collection thread based on the received initialization event collection thread instruction. Furthermore, after initialization is complete, it sends an initialization event collection thread response to the service management module, notifying the service management module that the event collection thread has been initialized.
[0230] S806d: The service management module in the second electronic device 1 sends an initialization event transmission thread instruction to the event transmission module in the second electronic device 1 .
[0231] S807d: The event transmission module in the second electronic device 1 initializes an event transmission thread.
[0232] S808d: The event transmission module in the second electronic device 1 sends an initialization event transmission thread response to the service management module in the second electronic device 1.
[0233] In some embodiments, in steps S806d-S808d, as Figure 6 As shown, the distributed input subsystem 64 of the second electronic device 1 also includes an event transmission module 646. After the event acquisition module 643 acquires the input events sent by the keyboard 2 and the mouse 2, it sends the input events to the first electronic device through the event transmission module 646.
[0234] Therefore, during the cross-device peripheral call process, the second electronic device 1 needs to use the event transmission module, so the service management module in the second electronic device 1 sends an initialization event transmission thread instruction to the event transmission module. Correspondingly, the event transmission module initializes the event transmission thread according to the received initialization event transmission thread instruction. And, after the initialization is completed, it sends an initialization event transmission thread response to the service management module to notify the service management module that the event transmission thread has completed initialization.
[0235] It should be noted that the embodiment of the present application does not limit the order in which the threads are initialized, that is, the order in which steps S806a-S808a, S806b-S808b, S806c-S808c, and S806d-S808d are executed. After receiving the initialization instruction, the service management modules in the first electronic device and the second electronic device 1 initialize the corresponding threads according to the preset rules.
[0236] In addition, the thread initialization process may also not use the service management module. For example, the initialization process of the relevant modules can be directly completed through the interaction between the peripheral control module and the relevant modules in the electronic device.
[0237] S809: The second electronic device 1 sends an initialization completion indication to the first electronic device through the service management module.
[0238] In some embodiments, after the second electronic device 1 determines that the initialization of the thread to be used in the cross-device peripheral call process has been completed, it can send an initialization completion indication to the first electronic device through the business management module to indicate that the current relevant thread of the first electronic device has completed initialization, and cross-device peripheral calls can be realized.
[0239] S810: The service management module in the first electronic device sends a dual-end initialization completion indication to the peripheral control module in the first electronic device.
[0240] In some embodiments, the service management module in the first electronic device may determine that the event injection thread has completed initialization based on the initialization event injection thread response received in step S808a. Furthermore, based on the initialization event transmission thread response received in step S808b, the service management module may determine that the event transmission thread has completed initialization. This further determines that the thread required for the local end to call the peripheral device across devices has completed initialization.
[0241] In addition, the service management module in the first electronic device can determine that the thread required by the counterpart (ie, the second electronic device 1 ) in the cross-device peripheral call process has been initialized based on the initialization completion indication received in the above step S809 .
[0242] Then, the service management module can determine that during the cross-device peripheral call process, the threads required by both ends have been initialized, and can send a dual-end initialization completion indication to the peripheral control module.
[0243] S811: The peripheral control module in the first electronic device forwards a dual-end initialization completion indication to the global control management module and the control application in the first electronic device.
[0244] In some embodiments, upon receiving the initialization completion indication, the peripheral control module in the first electronic device may forward the dual-end initialization completion indication to the global control management module and the control application. The global peripheral management module may determine, based on the dual-end initialization completion indication, that the usage status of the corresponding peripheral agent is in an available state. The control application may determine, based on the dual-end initialization completion indication, that the corresponding peripheral device is available for use.
[0245] Optionally, the control application may display a prompt message in a pop-up window to prompt the user to use the corresponding peripheral device.
[0246] It should be noted that the above Figure 8 The initialization process shown here takes a considerable amount of time because it requires initializing multiple threads. Therefore, the first electronic device must complete the initialization process before determining whether to use the peripherals of other electronic devices across devices. This allows the other electronic devices to quickly respond to user input through the peripherals or control application instructions, sending input events to the first electronic device, ensuring a better user experience.
[0247] In this way, the first electronic device and the second electronic device 1 complete the initialization of their respective threads. Subsequently, the first electronic device can, based on user instructions, cross-devicely call the peripherals of the second electronic device 1. Furthermore, the second electronic device 1 can also send corresponding input events to the first electronic device based on the input events received by the peripherals. This allows the first electronic device to be controlled by the peripherals of the second electronic device 1.
[0248] The following takes the example of the first electronic device calling the peripherals of the second electronic device 1 as an example to introduce in detail the process of using the peripherals in the process of calling the peripherals across devices.
[0249] For example, Figure 9 This is another flow chart of a peripheral control method provided in an embodiment of the present application. Figure 9 As shown, the method includes the following steps.
[0250] S901: A control application in a first electronic device sends a peripheral device usage instruction to a peripheral device control module in the first electronic device.
[0251] In some embodiments, the control application in the first electronic device, in response to a user operation, sends a peripheral usage instruction to the peripheral control module in the input subsystem, for invoking the corresponding peripheral through the peripheral control module. Optionally, the peripheral usage instruction carries a corresponding peripheral identifier or electronic device identifier for indicating the corresponding peripheral or electronic device.
[0252] For example, Figure 1 In the illustrated scenario, the control application is a PC manager application. After a first electronic device (e.g., tablet 102) receives a peripheral usage instruction from laptop 101 via the PC manager application, it determines that a corresponding peripheral proxy for laptop 101 exists locally, or creates a corresponding peripheral proxy for laptop 101. The PC manager application in the first electronic device then forwards the peripheral usage instruction to the peripheral control module, instructing it to use the peripheral and peripheral proxy corresponding to laptop 101.
[0253] Another example is Figure 7A In the scenario shown, the control application is a hyperterminal application. The first electronic device (i.e., tablet) searches for the computer keyboard and mouse through the hyperterminal application. Figure 7A As shown in (b), the first electronic device detects, through the HyperTerminal application, that the user has moved the computer's keyboard and mouse icons and brought them into contact with the first electronic device icon (i.e., the tablet icon), and determines that the user has instructed to use the computer's peripherals. The HyperTerminal application then sends a peripheral usage instruction to the peripheral control module, instructing the user to use the computer's corresponding peripherals and peripheral agents.
[0254] S902: The peripheral control module in the first electronic device sends a peripheral usage instruction to the service management module in the first electronic device.
[0255] S903 : The service management module in the first electronic device sends a peripheral device usage instruction to the second electronic device 1 .
[0256] In some embodiments, in steps S902 and S903, after receiving the peripheral device usage instruction, the peripheral device control module determines the corresponding peripheral device based on the peripheral device identifier carried in the peripheral device usage instruction. Thereafter, the peripheral device control module sends the peripheral device usage instruction to the electronic device corresponding to the determined peripheral device (e.g., second electronic device 1) through the service management module.
[0257] S904 : The service management module in the second electronic device 1 sends an event collection instruction to the event collection module in the second electronic device 1 .
[0258] In some embodiments, after receiving the peripheral device usage indication, the second electronic device 1 sends an event collection indication to the event collection module through the service management module, for instructing the event collection module to obtain the user operation received by the local peripheral device.
[0259] It should be noted that in some scenarios, the peripheral usage process can also directly include the above Figure 8 The thread initialization process shown. After the event collection thread and event transmission thread are initialized, the second electronic device 1 can determine to start acquiring input events through the event collection module. In other words, the above steps S901-step S903 are optional steps, or the initialization peripheral device instruction sent by the control application in the above step S803 can be used as a peripheral device usage instruction.
[0260] S905: The event collection module in the second electronic device 1 obtains an input event.
[0261] In some embodiments, the second electronic device 1 collects user operations through its own peripherals and sends information corresponding to the user operations collected by the peripherals to the event collection module. The event collection module determines the input event based on the acquired information.
[0262] For example, Figure 6 As shown, the peripherals of the second electronic device 1 include a keyboard 2 and a mouse 2, and the user can operate the first electronic device through the keyboard 2 and the mouse 2. The event acquisition module 643 in the distributed input subsystem 64 of the second electronic device 1 can obtain input events of the user input detected by the keyboard 2 and the mouse 2.
[0263] S906 : The event collection module in the second electronic device 1 sends the input event to the first electronic device through the event transmission module in the second electronic device 1 .
[0264] In some embodiments, after acquiring the input event, the event acquisition module in the second electronic device 1 transmits the input event to the first electronic device via the event transmission module, thereby achieving cross-device transmission of the input event and further achieving cross-device control of the peripheral device.
[0265] For example, Figure 6 As shown, the event transmission module 646 in the distributed input subsystem 64 of the second electronic device 1 obtains the input event sent by the event collection module 643. The event transmission module 646 sends the obtained input event to the event transmission module 626 in the distributed input subsystem 62 of the first electronic device with which the communication connection has been established.
[0266] S907: The event injection module in the first electronic device receives the input event sent by the second electronic device 1 through the event transmission module in the first electronic device.
[0267] S908: The event injection module in the first electronic device injects the input event into the corresponding peripheral device agent.
[0268] In some embodiments, in step S907 and step S908, after the first electronic device obtains the input event through the event transmission module, it injects the input event into the corresponding peripheral agent through the event injection module to enable the input event to take effect on the local end.
[0269] For example, Figure 6 As shown, after receiving an input event, the event transmission module 626 in the distributed input subsystem 62 of the first electronic device sends the input event to the event injection module 625. The event injection module 625 then sends the received input event to the peripheral agent corresponding to the input event in the kernel layer, such as the keyboard 2 agent and the mouse 2 agent.
[0270] S909: The atomic event processing module in the first electronic device obtains an input event sent by the corresponding peripheral device agent.
[0271] In some embodiments, after acquiring the input event, the peripheral agent of the first electronic device sends the input event to the input subsystem, and the input subsystem recognizes the original input event, thereby performing a corresponding operation.
[0272] For example, Figure 6 As shown, the peripheral agent in the kernel layer of the first electronic device sends the received input event to the atomic event processing module 612 in the input subsystem 61 in the application framework layer. Accordingly, the atomic event processing module 612 performs original event recognition processing based on the received input event and determines the operation indicated by the input event.
[0273] In this way, the first electronic device reuses the existing input event software processing logic framework to the greatest extent possible. Specifically, the input event is uploaded from the peripheral agent in the kernel layer to the atomic event processing module in the application framework layer. The atomic event processing module then identifies and distributes the input event, and the application in the application layer performs the corresponding operation. This satisfies the user's need for cross-device peripheral calls while reducing the difficulty of system development.
[0274] In other embodiments, after receiving the input event sent by the second electronic device 1, the event transmission module in the first electronic device may also directly send the input event to the atomic event processing module to complete the identification and distribution of the input event, thereby improving the processing efficiency of the input event.
[0275] S910: The atomic event processing module in the first electronic device sends an input event processing instruction to an application corresponding to the input event.
[0276] In some embodiments, after the first electronic device determines the indication operation of the input event through the input subsystem, it sends an event processing indication to the corresponding application, thereby realizing the use of the peripheral device of the remote input device (such as the second electronic device 1).
[0277] For example, Figure 6 As shown, the atomic event processing module 612 in the first electronic device input subsystem 61 sends an event processing instruction to the corresponding application in the application layer.
[0278] For example, an input event is generated when a user clicks the "A" key on the keyboard. Atomic event processing module 612 determines that the window currently in input focus is the document application window and can send the input event to the document application, instructing the document application to process the input event. Accordingly, upon receiving the input event, the document application identifies the input content (e.g., "A") and displays the input content at the input focus location.
[0279] For example, an input event is generated by a user pressing the "Ctrl+P" key on the keyboard. Upon receiving this input event, the atomic event processing module 612 identifies the original event according to pre-defined rules and determines that the input event is for launching a printer application. The atomic event processing module 612 may then instruct the printer application to launch and send the input event to the printer application, instructing it to process the input event. Accordingly, after launching, the printer application determines the print content based on the original input event and prints it.
[0280] In this way, the first electronic device no longer relies on specific hardware or software, and can directly obtain input events sent by the second electronic device configured with peripherals through the distributed input subsystem in the application framework layer of the second electronic device through the distributed input subsystem in the application framework layer of the first electronic device.
[0281] In the prior art, the second electronic device needs to complete the identification and distribution of input events collected by the second electronic device's peripherals to the second electronic device's application layer at the second electronic device's application framework layer, and then send the input events from the second electronic device's application layer to the first electronic device's application layer. Afterwards, the first electronic device also needs to send the input events obtained from the first electronic device's application layer to the first electronic device's application framework layer, and the first electronic device's application framework layer will then identify the input events and distribute them to the corresponding application in the first electronic device's application layer.
[0282] The peripheral control method provided in this application effectively reduces the time it takes for the first electronic device to acquire and process input events, and implements system-level low-latency cross-device peripheral calls.
[0283] In addition, low-latency cross-device peripheral calls can also reduce the impact of other processes on input event transmission and processing, thereby ensuring the stability of cross-device peripheral calls.
[0284] Furthermore, the cross-device invocation of peripherals does not rely on specific hardware or software. The first electronic device can call one or more peripherals of the second electronic device by creating a global peripheral proxy.
[0285] In some scenarios, electronic devices are generally equipped with a keyboard combination key input function. Users can implement combination key input by continuously operating multiple input keys on the keyboard. Afterwards, the electronic device can quickly perform the corresponding operation to reduce the difficulty of user operation. For example, the combination of "Win key + L key" is the lock screen key, which is used to implement the quick lock screen function; the combination of "Fn key + F2 key" is the volume key, which is used to implement the volume adjustment function of the electronic device; the combination of "Ctrl key + C key" can realize the copy function; the combination of "Ctrl key + V key" can realize the paste function.
[0286] Among them, generally, when electronic devices control peripherals across devices, different combination key functions are implemented on the electronic device corresponding to the position of the mouse input focus, that is, the keyboard combination key is fully transmitted, which does not meet user expectations and affects the user experience.
[0287] For example, Figure 1 In the scenario shown, the user is working on a laptop computer 101 and needs to use a tablet computer 102 to search for information. The user uses the keyboard and mouse of the laptop computer 101 to operate the tablet computer 102. Figure 1 As shown in (b), when the tablet 102 displays the mouse cursor 11, the laptop 101 detects that the user performs a key combination operation on the laptop's 101 keyboard. The laptop 101 will also send the corresponding input event to the electronic device where the input focus is located (i.e., the tablet 102) for processing. Then, if the laptop 101 detects that the user clicks the "Fn key + F2 key" key combination operation on the laptop 101, the key combination event will be sent to the tablet 102, and the tablet 102 will adjust the volume in response to the key combination event. However, in the current example scenario, the user generally needs to instruct the laptop 101 to adjust the volume, rather than instructing the tablet 102 controlled by the peripheral device to adjust the volume.
[0288] Therefore, in this case, the user cannot simply use the key combination to control the volume of the peripheral device. The user may need to switch the mouse input focus back to the peripheral device and then use the key combination to control the peripheral device, which is cumbersome for the user.
[0289] Therefore, embodiments of the present application provide a peripheral control method that pre-sets a whitelist in an electronic device. Upon detecting a key combination operation, the electronic device determines whether it is within the whitelist and, therefore, whether the key combination is effective on the local or remote end. This makes the key combination more suitable for cross-device peripheral control scenarios, meeting user needs, reducing user operational difficulty, and improving the user experience.
[0290] The following still takes the example of the first electronic device calling the peripheral device of the second electronic device 1, through Figure 10 and Figure 12 The method flow shown provides a detailed introduction to the use of combination keys in the process of calling peripherals across devices.
[0291] For example, Figure 10 This is another flow chart of a peripheral control method provided in an embodiment of the present application. Figure 10 As shown, the method is applied to the second electronic device 1, and the method includes the following steps.
[0292] S1001: The second electronic device 1 determines that a received input event includes combination key input information.
[0293] In some embodiments, the second electronic device 1 is provided with a combination key configuration management module for managing a combination key configuration whitelist. Optionally, some combination key operations are more suitable for taking effect on this end, such as the lock screen key after the combination of (Win key + L key), the volume key after the combination of (Fn key + F2 key), etc. Some combination key operations are more suitable for taking effect on the remote end, such as the copy key after the combination of (Ctrl key + C key), the paste key after the combination of (Ctrl key + V key), etc. Thus, a combination key configuration whitelist corresponding to electronic devices of different roles can be created.
[0294] For example, Figure 11 As shown above, Figure 8 and Figure 9 In the process shown, the first electronic device implements cross-device calls to the peripherals of the second electronic device 1 (such as the keyboard 2). The distributed input subsystem 64 in the application framework layer of the second electronic device 1 also includes a combination key configuration management module 644 for managing the combination key configuration whitelist in the distributed system. For example, the combination key configuration management module 644 stores the combination key configuration whitelist effective on the local end and the combination key configuration whitelist corresponding to one or more remote devices (such as the first electronic device).
[0295] Optionally, during the above-mentioned process of synchronizing peripheral information (such as synchronizing peripheral information through a peripheral information synchronization module), the electronic devices may also synchronize their respective combination key configuration whitelists. The synchronization method of the combination key configuration whitelist can refer to the above-mentioned peripheral information synchronization process and will not be described in detail here. Thus, each electronic device in the distributed communication system can store the same combination key configuration whitelist, such as the combination key configuration whitelist effective on this end and the combination key configuration whitelist corresponding to one or more remote devices.
[0296] In some embodiments, the combination key configuration whitelist stored in the second electronic device 1 can be a manufacturer-preset whitelist. Optionally, upon detecting a user's operation of setting a combination key, the electronic device can update the corresponding combination key configuration whitelist accordingly. This allows the combination key whitelist to better meet user needs.
[0297] In some embodiments, the electronic device is further configured with a combination key filtering module for filtering input events including combination key input information. Furthermore, the combination key filtering module is further configured to determine whether the combination key operation is effective on the local terminal based on the combination key configuration whitelist of the local terminal.
[0298] For example, Figure 11 As shown, the input subsystem 63 in the application framework layer of the second electronic device 1 also includes a combination key filtering module 6313, which is used to receive input events detected by the keyboard 2 and determine whether the input events include combination key input information. If the input events include combination key input information, the combination key input information is filtered through the following step S1002.
[0299] S1002: The second electronic device 1 determines whether the key combination input information is in the local key combination configuration whitelist. If so, execute step S1003; if not, execute step S1004.
[0300] S1003: The second electronic device 1 determines that the combination key input information is effective on the local end, and sends an input event to the corresponding recipient.
[0301] S1004: The second electronic device 1 determines not to process the combination key input information locally, and discards the combination key input information.
[0302] In some embodiments, in steps S1002-S1004, after detecting an input event inputted by a local peripheral device, the second electronic device 1 identifies the input event as a key combination input event through the input subsystem, and may first determine whether the current key combination input information is within the local key combination configuration whitelist based on the local key combination configuration whitelist. If it is within the local key combination configuration whitelist, determine to execute the operation indicated by the detected key combination. If it is not within the local key combination configuration whitelist, determine to discard the key combination input information and no longer execute the operation indicated by the detected key combination.
[0303] For example, Figure 11 As shown, the keyboard 2 of the second electronic device 1 sends the detected input event to the combination key filtering module 6313. The combination key filtering module 6313 determines that the input event is a combination key input event generated after the user continuously operates the local keyboard, including the combination key input information, and requests the combination key configuration management module 644 in the distributed input subsystem 64 to obtain the local combination key configuration whitelist. Afterwards, the combination key filtering module 6313 determines whether the currently received combination key input information is within the local combination key configuration whitelist based on the local combination key configuration whitelist. If the combination key filtering module 6313 determines that the combination key input information is within the local combination key whitelist, it can be determined that the combination key input information is effective on the local side and the input event is sent to the corresponding recipient (such as to the application layer). For example, if the combination key is (Win key + L key), the combination key filtering module 6313 can send the input event to the local function module for locking the screen, thereby achieving the lock screen of the second electronic device 1. If the combination key filtering module 6313 determines that the combination key input information is not in the combination key whitelist of the local end, it can be determined not to process the combination key input information on the local end, and the combination key input information can be discarded.
[0304] For example, Figure 12 This is another flow chart of a peripheral control method provided in an embodiment of the present application. Figure 12 As shown, the method is applied to a first electronic device, and the method includes the following steps.
[0305] S1201: The first electronic device determines that the received input event includes combination key input information.
[0306] In some embodiments, the first electronic device is configured with a combination key configuration management module for managing a combination key configuration whitelist. Similarly, the combination key configuration whitelist includes a local combination key configuration whitelist and a remote combination key configuration whitelist (such as the combination key configuration whitelist of the second electronic device).
[0307] In some embodiments, after receiving an input event sent by a remote electronic device, the input subsystem in the first electronic device determines whether the received input event includes key combination input information. If the key combination input information is included, the key combination input information is filtered in step S1202.
[0308] For example, Figure 11 As shown above, Figure 8 and Figure 9 In the process shown, the first electronic device implements a cross-device call to a peripheral device (such as keyboard 2) of the second electronic device 1. After receiving an input event sent by the peripheral device agent in the kernel layer, the atomic event processing module 612 in the first electronic device input subsystem 61 can also send the input event to the combination key filtering module 6113 in the distributed input management module 611. The combination key filtering module 6113 determines whether the received input event includes combination key input information.
[0309] Optionally, for the remaining contents of step S1201, reference may be made to the relevant contents of the above-mentioned step S1001, which will not be repeated here.
[0310] S1202: The first electronic device determines whether the key combination input information is in the remote key combination configuration whitelist. If so, execute step S1203; if not, execute step S1204.
[0311] S1203: The first electronic device determines not to process the combination key input information locally, and discards the combination key input information.
[0312] S1204: The first electronic device determines that the key combination input information is effective on the local end, and sends an input event to the corresponding recipient.
[0313] In some embodiments, in steps S1202-S1204, after the first electronic device obtains the input event sent by the remote device, it identifies the input event as a combination key input event through the input subsystem, and can first determine whether the current combination key input information is in the remote combination key configuration whitelist based on the remote combination key configuration whitelist. If it is in the remote combination key configuration whitelist, it is determined to discard the combination key input information and no longer execute the indicated operation corresponding to the combination key in the received input event. If it is not in the remote combination key configuration whitelist, it is determined to execute the indicated operation corresponding to the combination key in the obtained input event. Optionally, if it is not in the remote combination key configuration whitelist, it can be further determined whether it is in the local combination key configuration whitelist, thereby determining the specific operation indicated by the user.
[0314] For example, Figure 11As shown, the combination key filtering module 6113 in the distributed input management module 611 in the input subsystem of the first electronic device receives an input event sent by a remote device and forwarded by the atomic event processing module 612, determines that the input event is a combination key input event generated by a user continuously operating the remote keyboard, including combination key input information, and requests the combination key configuration management module 624 in the distributed input subsystem 62 to obtain the corresponding remote combination key configuration whitelist. Subsequently, the combination key filtering module 6113 determines whether the currently received combination key input information is on the remote combination key configuration whitelist based on the remote combination key configuration whitelist. If the combination key filtering module 6113 determines that the combination key input information is on the remote combination key configuration whitelist, it can be determined that the combination key input information will not be processed on the local end and the combination key input information can be discarded. If the combination key filtering module 6113 determines that the combination key input information is not on the remote combination key whitelist, it can be determined that the combination key input information is valid on the local end and the input event is sent to the corresponding recipient (e.g., to the application layer). For example, the key combination is "Ctrl key + C key", and the key combination filtering module 6113 can send an input event to the functional module of the local end for implementing the copy function, thereby copying the display content of the first electronic device.
[0315] It should be noted that the above example Figure 10 and Figure 12 In the process, the application process of the combination key in the process of cross-device peripheral call is explained through the keyboard combination key. Among them, the combination key not only includes keyboard combination key, but also includes multiple inputs from multiple other electronic devices. For example, special gestures on the touch screen, combination configuration between the keyboard and mouse, etc. For related implementation methods, please refer to Figure 10 and Figure 12 The process shown is not described one by one in the embodiments of this application.
[0316] In this way, the combination key is more suitable for cross-device peripheral control scenarios, meeting user needs, reducing user operation difficulty, and improving user experience.
[0317] Combination of the above Figure 5-Figure 12 The peripheral control method provided by the embodiment of the present application is described in detail. Figure 13 and Figure 14 The first electronic device and the second electronic device provided in the embodiments of the present application are described in detail.
[0318] In one possible design, Figure 13 This is a schematic diagram of the structure of the first electronic device provided in the embodiment of the present application. Figure 13 As shown, the first electronic device 1300 may include: a transceiver unit 1301 and a processing unit 1302. The first electronic device 1300 may be used to implement the functions of the first electronic device involved in the above method embodiment.
[0319] Optionally, the transceiver unit 1301 is configured to support the first electronic device 1300 to execute Figure 5 S501 in; and / or, for supporting the first electronic device 1300 to execute Figure 8 S801, S805 and S809 in; and / or, for supporting the first electronic device 1300 to execute Figure 9 S903 and S906 in it.
[0320] Optionally, the processing unit 1302 is configured to support the first electronic device 1300 in executing Figure 5 S502 in; and / or, for supporting the first electronic device 1300 to execute Figure 8 S801-S804, S806a-S808a, S806b-S808b, and S810-S811 in; and / or, for supporting the first electronic device 1300 to execute Figure 9 S901, S902, and S907-S910 in; and / or, for supporting the first electronic device 1300 to execute Figure 12 S1201-S1203 in.
[0321] Among them, the transceiver unit may include a receiving unit and a sending unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the first electronic device 1300 are respectively to implement the corresponding processes of the peripheral control method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit. For the sake of brevity, they are not repeated here.
[0322] Optionally, Figure 13 The first electronic device 1300 shown may further include a storage unit ( Figure 13 (not shown), the storage unit stores a program or instruction. When the transceiver unit 1301 and the processing unit 1302 execute the program or instruction, Figure 13 The first electronic device 1300 shown can execute the peripheral device control method described in the above method embodiment.
[0323] Figure 13 The technical effects of the first electronic device 1300 shown can refer to the technical effects of the peripheral control method described in the above method embodiment, and will not be repeated here.
[0324] In addition to being in the form of the first electronic device 1300, the technical solution provided in this application may also be a functional unit or chip in the first electronic device, or a device used in conjunction with the first electronic device.
[0325] In one possible design, Figure 14 This is a schematic diagram of the structure of the second electronic device provided in the embodiment of the present application. Figure 14 As shown, the second electronic device 1400 may include a transceiver unit 1401 and a processing unit 1402. The second electronic device 1400 may be used to implement the functions of the second electronic device involved in the above method embodiment.
[0326] Optionally, the transceiver unit 1401 is configured to support the second electronic device 1400 to execute Figure 8 S805 and S809 in; and / or, for supporting the second electronic device 1400 to execute Figure 9 S903, S905, and S906.
[0327] Optionally, the processing unit 1402 is configured to support the second electronic device 1400 in executing Figure 8 S806c-S808c, and S806d-S808d; and / or, for supporting the second electronic device 1400 to execute Figure 9 S904 in; and / or, for supporting the second electronic device 1400 to execute Figure 10 S1001-S1003 in.
[0328] The transceiver unit may include a receiving unit and a transmitting unit, and may be implemented by a transceiver or a transceiver-related circuit component, and may be a transceiver or a transceiver module. The operations and / or functions of each unit in the second electronic device 1400 are respectively to implement the corresponding processes of the peripheral control method described in the above method embodiment. All relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional unit. For the sake of brevity, they are not repeated here.
[0329] Optionally, Figure 14 The second electronic device 1400 shown may further include a storage unit ( Figure 14 (not shown), the storage unit stores a program or instruction. When the transceiver unit 1401 and the processing unit 1402 execute the program or instruction, Figure 14 The second electronic device 1400 shown can execute the peripheral device control method described in the above method embodiment.
[0330] Figure 14 The technical effects of the second electronic device 1400 shown can refer to the technical effects of the peripheral control method described in the above method embodiment, and will not be repeated here.
[0331] In addition to being in the form of the second electronic device 1400, the technical solution provided in this application may also be a functional unit or chip in the second electronic device, or a device used in conjunction with the second electronic device.
[0332] An embodiment of the present application also provides a chip system, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the chip system implements the method in any of the above method embodiments.
[0333] Optionally, there may be one or more processors in the chip system. The processor may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, etc. When implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory.
[0334] Optionally, the memory in the chip system may be one or more. The memory may be integrated with the processor or may be provided separately from the processor, which is not limited in the embodiments of the present application. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or provided on different chips. The embodiments of the present application do not specifically limit the type of memory or the configuration of the memory and the processor.
[0335] Exemplarily, the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD) or other integrated chips.
[0336] It should be understood that each step in the above method embodiment can be completed by hardware integrated logic circuits in a processor or by software instructions. The method steps disclosed in the embodiments of the present application can be directly embodied as being executed by a hardware processor, or by a combination of hardware and software modules in a processor.
[0337] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a computer, the computer executes the above-mentioned related steps to implement the peripheral control method in the above-mentioned embodiment.
[0338] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the peripheral control method in the above-mentioned embodiment.
[0339] In addition, embodiments of the present application further provide a device. Specifically, the device may be a component or module, and may include one or more processors and a memory connected to each other. The memory is configured to store a computer program. When the computer program is executed by one or more processors, the device performs the peripheral device control method described in each of the aforementioned method embodiments.
[0340] The apparatus, computer-readable storage medium, computer program product, or chip provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the corresponding methods provided above and will not be repeated here.
[0341] The steps of the method or algorithm described in conjunction with the disclosure of the embodiments of the present application can be implemented in hardware or by executing software instructions by a processor. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, read-only compact discs (CD-ROMs), or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC).
[0342] Through the description of the above embodiments, those skilled in the art will clearly understand that for the sake of convenience and brevity, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed; that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working processes of the above-mentioned systems, devices, and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0343] In the several embodiments provided in this application, it should be understood that the disclosed methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of modules or units, which can be electrical, mechanical or other forms.
[0344] 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.
[0345] Computer-readable storage media include, but are not limited to, any of the following: 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, and other media that can store program code.
[0346] The above is only a specific embodiment of the present application, but the scope of protection of this application is not limited to this. Any changes or substitutions within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A peripheral control system, characterized in that: The system includes a first electronic device and a second electronic device; The first electronic device is used for: Acquire peripheral information of the second electronic device, and create a peripheral proxy corresponding to the peripheral of the second electronic device according to the peripheral information of the second electronic device; The second electronic device is used for: Acquire peripheral information of the first electronic device, and create a peripheral agent corresponding to the peripheral of the first electronic device according to the peripheral information of the first electronic device; The first electronic device is further configured to: querying available peripherals, where the available peripherals include peripherals of the first electronic device and peripherals of the second electronic device; determining the peripheral device of the second electronic device as the peripheral device to be used; receiving, through the first distributed input subsystem of the first electronic device, an input event sent by the second distributed input subsystem of the second electronic device; The input event is an event determined after the second electronic device collects a user input operation through a peripheral device of the second electronic device; Processing the input event via a peripheral device agent corresponding to the peripheral device of the second electronic device; Execute the target operation corresponding to the input event; The second electronic device is further configured to send a first combination key configuration whitelist to the first electronic device; The first electronic device is further configured to store a first combination key configuration whitelist of the second electronic device, where the first combination key configuration whitelist is used to indicate whether a received combination key input event is valid in the second electronic device.
2. The system according to claim 1, wherein: The first electronic device is further configured to: receiving, through the peripheral device agent corresponding to the peripheral device of the second electronic device, the input event forwarded by the first distributed input subsystem; Sending the input event to a first input subsystem through the peripheral agent in the first electronic device; wherein the first input subsystem is a subsystem located in the same layer of the operating system of the first electronic device as the first distributed input subsystem, or the first input subsystem and the first distributed input subsystem are the same subsystem; After the first input subsystem in the first electronic device identifies the first application where the input focus is located, sending the input event to the first application; or, After the first input subsystem in the first electronic device determines the second application corresponding to the input event according to a preset rule, the second application is started and the input event is sent to the second application.
3. The system according to claim 1 or 2, characterized in that The first electronic device is further configured to: Sending the input event to a first input subsystem through the peripheral device agent in the first electronic device; Determining, by the first input subsystem of the first electronic device, that the input event is a combination key input event; determining, by the first input subsystem of the first electronic device, whether the combination key input information in the combination key input event is in the first combination key configuration whitelist; If the key combination input information is not in the first key combination configuration whitelist, the target operation is executed.
4. The system according to claim 1 or 2, characterized in that The first electronic device is further configured to send a second combination key configuration whitelist of the first electronic device to the second electronic device, where the second combination key configuration whitelist is used to indicate whether a combination key input event is effective in the first electronic device.
5. The system according to claim 1 or 2, characterized in that The first electronic device is further configured to: Acquire peripheral device information of the second electronic device from a distributed database; Alternatively, receiving a broadcast message sent by the second electronic device, wherein the broadcast message carries the peripheral device information; Alternatively, downloading the peripheral device information of the second electronic device from a cloud server; Alternatively, the peripheral device information of the second electronic device is received from a central node of a communication system, where the communication system includes the first electronic device and the second electronic device.
6. The system according to claim 2, wherein: The first electronic device is further configured to: An event injection thread and an event transmission thread are initialized through the first input subsystem. The event injection thread is used to inject the received input event into the corresponding peripheral agent, and the event transmission thread is used to receive the input event.
7. The system according to claim 1, 2 or 6, characterized in that: The first electronic device is further configured to: disconnecting the communication connection with the target second electronic device; Delete the peripheral agent.
8. The system according to claim 1, 2 or 6, characterized in that: The first electronic device is further configured to: A peripheral agent corresponding to one or more peripherals of the second electronic device is created at the kernel layer according to the peripheral information.
9. The system according to claim 1, 2 or 6, characterized in that: The first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the second electronic device.
10. The system according to claim 1, 2 or 6, characterized in that: The peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
11. The system according to claim 1, 2 or 6, characterized in that: The second electronic device is further configured to: In response to a user operation on a peripheral device, determining an input event to be forwarded to the first electronic device, wherein the input event is used to instruct the first electronic device to perform a target operation; The input event is sent to the first distributed input subsystem of the first electronic device through the second distributed input subsystem of the second electronic device.
12. The system according to claim 1, 2 or 6, characterized in that: The second electronic device is further configured to store a first combination key configuration whitelist, where the first combination key configuration whitelist is used to indicate whether a combination key input event is valid in the second electronic device.
13. The system according to claim 12, wherein: The second electronic device is further configured to: Determining, by a second input subsystem in the second electronic device, that the input event is a combination key input event; The second input subsystem in the second electronic device determines that the combination key input information in the combination key input event is not in the first combination key configuration whitelist, and sends the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem; wherein, the second input subsystem is a subsystem located at the same layer of the operating system of the second electronic device as the second distributed input subsystem, or, the second input subsystem and the second distributed input subsystem are the same subsystem.
14. The system according to claim 1 or 2 or 6 or 13, characterized in that The second electronic device is further configured to: Acquire peripheral device information of the first electronic device from a distributed database; Alternatively, receiving a broadcast message sent by the first electronic device, where the broadcast message carries the peripheral device information; Alternatively, downloading peripheral device information of the first electronic device from a cloud server; Alternatively, the peripheral device information of the first electronic device is received from a central node of the communication system.
15. The system according to claim 13, wherein: The second electronic device is further configured to: An event collection thread and an event transmission thread are initialized through the second input subsystem. The event collection thread is used to collect the input events through the peripheral device, and the event transmission thread is used to send the input events.
16. The system according to claim 1 or 2 or 6 or 13 or 15, characterized in that The second electronic device is further configured to: disconnecting the communication connection with the first electronic device; The peripheral device agent corresponding to the first electronic device is deleted.
17. A peripheral device control method, characterized in that: The method comprises: The first electronic device obtains peripheral device information of one or more second electronic devices; The first electronic device creates, according to the peripheral device information, a peripheral device agent corresponding to the peripheral devices of the one or more second electronic devices; The first electronic device receives, through the first distributed input subsystem, an input event sent by a second distributed input subsystem of a target second electronic device among the one or more second electronic devices; the input event is an event determined after the target second electronic device collects a user input operation through a peripheral device; The first electronic device processes the input event via a target peripheral device agent corresponding to the target second electronic device; The first electronic device executes a target operation corresponding to the input event; The first electronic device stores a first combination key configuration whitelist of the one or more second electronic devices, where the first combination key configuration whitelist is used to indicate whether a received combination key input event is valid in the one or more second electronic devices.
18. The method according to claim 17, characterized in that The first electronic device processes the input event via a target peripheral device agent corresponding to the target second electronic device, including: The target peripheral device agent in the first electronic device receives the input event forwarded by the first distributed input subsystem; The target peripheral device agent in the first electronic device sends the input event to a first input subsystem; wherein the first input subsystem is a subsystem located in the same layer of the operating system of the first electronic device as the first distributed input subsystem, or the first input subsystem and the first distributed input subsystem are the same subsystem; After the first input subsystem in the first electronic device identifies the first application where the input focus is located, the first input subsystem sends the input event to the first application; or, After determining the second application corresponding to the input event according to a preset rule, the first input subsystem in the first electronic device starts the second application and sends the input event to the second application.
19. The method according to claim 17 or 18, characterized in that The first electronic device processes the input event via a target peripheral device agent corresponding to the target second electronic device; The first electronic device performing a target operation corresponding to the input event includes: The target peripheral device agent in the first electronic device sends the input event to the first input subsystem; The first electronic device determines, through the first input subsystem, that the input event is a combination key input event; The first electronic device determines, through the first input subsystem, whether the combination key input information in the combination key input event is in the first combination key configuration whitelist; If the combination key input information is not in the first combination key configuration whitelist, the first electronic device performs the target operation.
20. The method according to claim 17 or 18, characterized in that The method further comprises: The first electronic device sends a second combination key configuration whitelist of the first electronic device to the one or more second electronic devices, where the second combination key configuration whitelist is used to indicate whether a combination key input event is valid in the first electronic device.
21. The method according to claim 17 or 18, characterized in that The first electronic device obtains peripheral device information of one or more second electronic devices, including: The first electronic device obtains the peripheral device information of the one or more second electronic devices from a distributed database; Alternatively, the first electronic device receives a broadcast message sent by the one or more second electronic devices, where the broadcast message carries the peripheral device information; Alternatively, the first electronic device downloads the peripheral device information of the one or more second electronic devices from the cloud server; Alternatively, the first electronic device receives peripheral information of the one or more second electronic devices sent by a central node of a communication system, and the communication system includes the first electronic device and the one or more second electronic devices.
22. The method according to claim 17 or 18, characterized in that After the first electronic device creates, according to the peripheral device information, peripheral device proxies corresponding to the peripheral devices of the one or more second electronic devices, the method further includes: The first electronic device initializes an event injection thread and an event transmission thread, the event injection thread is used to inject the received input event into the corresponding peripheral device agent, and the event transmission thread is used to receive the input event.
23. The method according to claim 17 or 18, characterized in that The method further comprises: The first electronic device disconnects the communication connection with the target second electronic device; The first electronic device deletes the target peripheral device agent.
24. The method according to claim 17 or 18, characterized in that The first electronic device creates, according to the peripheral device information, a peripheral device agent corresponding to the peripheral devices of the one or more second electronic devices, including: The first electronic device creates, at a kernel layer, a peripheral agent corresponding to the peripherals of the one or more second electronic devices according to the peripheral information.
25. The method according to claim 17 or 18, characterized in that The first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
26. The method according to claim 17 or 18, characterized in that The peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
27. A peripheral control method, characterized in that: The method comprises: The second electronic device obtains the peripheral device information of the first electronic device; The second electronic device creates a peripheral device proxy corresponding to the first electronic device according to the peripheral device information; The second electronic device determines, in response to a user operation on a peripheral device, an input event to be forwarded to the first electronic device, where the input event is used to instruct the first electronic device to perform a target operation; The second electronic device sends the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem; The second electronic device sends a first combination key configuration whitelist to the first electronic device, where the first combination key configuration whitelist is used to indicate whether a combination key input event is valid in the second electronic device.
28. The method according to claim 27, characterized in that The second electronic device stores a first combination key configuration whitelist.
29. The method according to claim 28, characterized in that The second electronic device sending the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem includes: The second input subsystem in the second electronic device determines that the input event is a combination key input event; The second input subsystem in the second electronic device determines that the combination key input information in the combination key input event is not in the first combination key configuration whitelist, and the second electronic device sends the input event to the first distributed input subsystem of the first electronic device through the second distributed input subsystem; wherein, the second input subsystem is a subsystem located at the same layer of the operating system of the second electronic device as the second distributed input subsystem, or, the second input subsystem and the second distributed input subsystem are the same subsystem.
30. The method according to any one of claims 27 to 29, characterized in that The second electronic device acquiring the peripheral device information of the first electronic device includes: The second electronic device obtains the peripheral device information of the first electronic device from a distributed database; Alternatively, the second electronic device receives a broadcast message sent by the first electronic device, where the broadcast message carries the peripheral device information; Alternatively, the second electronic device downloads the peripheral device information of the first electronic device from the cloud server; Alternatively, the second electronic device receives the peripheral device information of the first electronic device sent by a central node of the communication system.
31. The method according to any one of claims 27 to 29, characterized in that After the second electronic device creates a peripheral device proxy corresponding to the first electronic device according to the peripheral device information, the method further includes: The second electronic device initializes an event collection thread and an event transmission thread, the event collection thread is used to collect the input event through the peripheral device, and the event transmission thread is used to send the input event.
32. The method according to any one of claims 27 to 29, characterized in that The method further comprises: The second electronic device disconnects the communication connection with the first electronic device; The second electronic device deletes the peripheral device agent corresponding to the first electronic device.
33. The method according to any one of claims 27 to 29, characterized in that The first distributed input subsystem is located in the application framework layer of the first electronic device, and the second distributed input subsystem is located in the application framework layer of the target second electronic device.
34. The method according to any one of claims 27 to 29, characterized in that The peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
35. An electronic device, characterized in that: The electronic device is a first electronic device, including: a processor and a memory, the memory is coupled to the processor, the memory is used to store computer-readable instructions, and when the processor reads the computer-readable instructions from the memory, the electronic device executes the method described in any one of claims 17-26.
36. An electronic device, characterized in that: The electronic device is a second electronic device, including: a processor, a memory and a peripheral device, the memory is coupled to the processor, and the memory is used to store computer-readable instructions. When the processor reads the computer-readable instructions from the memory, the electronic device executes the method described in any one of claims 27-34.
37. The electronic device according to claim 36, wherein: The peripheral device includes one or more of a keyboard, a mouse, and a touchpad.
38. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a computer program, which, when executed on an electronic device, enables the electronic device to execute the method according to any one of claims 17 to 26; or enables the electronic device to execute the method according to any one of claims 27 to 34.
39. A computer program product, characterized in that When the computer program product is run on a computer, the computer is enabled to execute the method according to any one of claims 17 to 26; or the computer is enabled to execute the method according to any one of claims 27 to 34.
40. A chip system, characterized in that: The chip system includes at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor. When the at least one processor executes the instructions, the at least one processor executes the method described in any one of claims 17 to 26; or, the at least one processor executes the method described in any one of claims 27 to 34.
Citation Information
Patent Citations
Terminal and function sharing method thereof
CN106161741A
Equipment sharing method, device and system
CN110287036A
System and method of transmitting keystroke information to a client terminal
US6523072B1