Device control method, electronic device and storage medium
By sending mouse preemption messages and updating the crossover status of key and mouse, the abnormal problems that occur after the terminal device's mouse cursor is disconnected, ensuring the normality of device response and user control.
Patent Information
- Application Number
- CN202310808015.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-03
- Publication Date
- 2025-01-03
AI Technical Summary
The mouse cursor of the terminal device may have an abnormality after the keyboard and mouse device is disconnected. For example, other devices still display the mouse cursor of the machine, and the device will not respond after reconnecting.
By sending a mouse preemption message, the mouse focus of the mouse cursor is regained from the second device to the first device, unbinding relationship, and update the key and mouse crossing status to avoid abnormalities.
Avoid device display exceptions and response problems, ensure that the mouse cursor returns to the correct device, and the user can control the device normally.
Smart Images

Figure CN119248140A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a device control method, an electronic device, and a storage medium. Background Art
[0002] With the development of terminal device technology, the types and number of terminal devices are increasing, such as mobile phones, tablet computers, laptops, wearable devices, etc. In order to meet the increasing needs of users, these devices can be connected to each other, and after the connection, for devices that support the keyboard and mouse pass-through function, keyboard and mouse pass-through can be realized. For example, for a tablet computer connected to a keyboard and mouse device and supporting the keyboard and mouse pass-through function, its mouse cursor can pass through to other terminal devices connected to it, and other terminal devices can be controlled through the keyboard and mouse of the tablet computer.
[0003] In some cases, when the mouse cursor of the terminal device (this machine) crosses over to other devices to display and control other devices, some abnormalities may occur after the keyboard and mouse device of this machine is disconnected. For example, other terminal devices still display the mouse cursor of this machine; the keyboard and mouse device cannot control this machine after reconnecting to the machine, etc. Summary of the invention
[0004] Some embodiments of the present application provide a device control method, an electronic device, and a computer-readable storage medium. The present application is introduced from multiple aspects below, and the embodiments and beneficial effects of the following aspects can be referenced to each other.
[0005] In a first aspect, the present application provides a device control method for an electronic device, the method comprising: a first control device is connected to a first input device, and a corresponding cursor of the first input device is displayed; the cursor moves from the first control device to a second control device for display, and the second control device establishes a binding relationship with the first input device; it is determined that the first control device is disconnected from the first input device, and the first control device sends a first message to the second control device; the second control device unbinds from the first input device in response to the first message.
[0006] Among them, the first control device may be the first device mentioned below, the second control device may be the second device mentioned below, the cursor may be the mouse cursor mentioned below, and the first message may be the keyboard and mouse preemption message mentioned below.
[0007] According to the method of the embodiment of the present application, the first device is connected to a first input device (for example, a keyboard and mouse device or a mouse) that can input a mouse cursor, and the first device is connected to the second device. When the mouse cursor of the first device (that is, the cursor input by the first input device on the first device) crosses to the screen of the second device and is displayed, and the second device is controlled by the first input device connected to the first device, if the first input device is disconnected from the first device, the first device sends a mouse grabbing message for retaking the mouse focus to the second device, so as to retake the mouse focus of the mouse cursor from the second device to the first device. In this way, some anomalies can be avoided after the first input device connected to the first device is disconnected. For example, it is avoided that the second device still displays the mouse cursor of the first device; it is avoided that the first device does not respond when the first device is used to operate on the first input device after reconnecting to the first input device.
[0008] It should be understood that when the mouse cursor of the first input device passes through the second device, the mouse focus of the first input device is located on the second device, and the first input device is bound to the second device, so that the first input device can control the second device. When the second device receives the mouse preemption message sent by the first device, the second device will lose the mouse focus of the first input device and release the binding with the first input device, so that the first input device can no longer control the second device, and the second device will no longer display the mouse cursor of the first input device, avoiding the abnormal display of the second device. After the second device loses the mouse focus of the first input device, the mouse focus returns to the first device. Since the mouse focus is the activation point of the mouse cursor, after the first input device is reconnected with the first device, the mouse cursor of the first input device will be activated on the first device. At this time, the first input device can also directly control the first device, avoiding the abnormality of the first device being unable to respond to the first input device.
[0009] In some scenarios, if the first input device is an input device used only for inputting a mouse cursor (e.g., an independent mouse), and the first device is also connected to a second input device other than the first input device for inputting key control commands (e.g., an independent keyboard), then after the mouse cursor of the first device passes through the second device, a mapping relationship between the second input device and the second device can be established. At this time, the user's operation on the second input device no longer controls the first device but controls the second device. After the first input device is disconnected from the first device, the first device can release the mapping relationship between the second input device and the second device, so that the user can control the first device through the second input device. In this way, it can be avoided that after the first input device is disconnected from the first device, the user cannot control the first device through the second input device.
[0010] In some embodiments, the method further includes: determining that the first control device is disconnected from the first input device, and updating the first control device from a current first state to a second state, wherein the first state indicates that the cursor has moved out of the first control device, and the second state indicates that the cursor has not moved out of the first control device.
[0011] The first state may be a state in which the keyboard and mouse of the first control device cross over to other devices, and the second state may be a state in which the keyboard and mouse of the first control device do not cross over to other devices. The state update of the first control device may be an update of the keyboard and mouse cross over state. The first control device updates the current keyboard and mouse cross over state from the first state to the second state, which may instruct the first control device to release the binding relationship between the first input device and the second control device, so that after the first input device is reconnected to the first control device, the user's operation on the first input device no longer controls the second control device, but controls the first control device. In this way, abnormalities in the keyboard and mouse cross over function of the first control device can be avoided.
[0012] In some implementations, the method further includes: the second control device updates from a current third state to a fourth state in response to the first message, wherein the third state indicates that the cursor moves into the second control device, and the fourth state indicates that the cursor does not move into the second control device.
[0013] The third state may be a state where the keyboard and mouse of other devices are passed through to the second control device, and the fourth state may be a state where the keyboard and mouse of other devices are not passed through to the second control device. If the second control device updates the current keyboard and mouse state to the fourth state, the second control device no longer receives or responds to input instructions sent by the first control device. If the second control device is not connected to an input device (e.g., a mouse, etc.), the cursor is no longer displayed.
[0014] In some implementations, the method further includes: based on the second control device being unbound from the first input device, the second control device no longer displays the cursor of the first input device.
[0015] After the first input device is disconnected from the first control device, the second control device is unbound from the first input device, and the cursor of the first input device is no longer displayed, so that the second control device can avoid display abnormalities. For example, in the case where the keyboard and mouse of a tablet computer are transferred to a mobile phone, when the keyboard and mouse device connected to the tablet computer is disconnected from the tablet computer, the mobile phone is unbound from the keyboard and mouse device of the tablet computer, and the mouse cursor of the keyboard and mouse device is no longer displayed, so that the mobile phone can avoid display abnormalities.
[0016] In some implementations, the method further includes: based on unbinding the second control device from the first input device, determining that the first control device is reconnected with the first input device, and the first control device redisplaying the cursor of the first input device.
[0017] After the second control device is unbound from the first input device, when the first control device is reconnected to the first input device, the first control device re-displays the cursor of the first input device, and the first device can directly control the first control device. In this way, the second control device can avoid abnormal response to the first input device.
[0018] In some embodiments, moving a cursor from a first control device to a second control device for display includes: determining a first direction of the second control device relative to the first control device; and moving the cursor out of the first control device along the first direction and onto the second control device for display.
[0019] In some embodiments, determining the first direction of the second control device relative to the first control device includes: in a scenario where the first control device and the second control device are connected for the first time, determining that the first control device is the device that initiates the connection with the second control device, and the first control device detecting the first direction of the second control device relative to the first control device; in a scenario where the first control device and the second control device are connected and the position of the first control device or the second control device changes, determining a target device for detecting the direction from the first control device and the second control device, and determining the first direction by the target device.
[0020] When the first control device and the second control device are connected for the first time, the device initiating the connection performs direction finding. For example, if the first control device is the device initiating the connection with the second control device, the first control device detects the first direction of the second control device relative to the first control device. In the case where the first control device and the second control device are connected and one of the devices moves so that its position changes, one of the first control device and the second control device is determined to initiate direction finding to avoid conflict in direction finding caused by double-end direction finding.
[0021] In some implementations, determining a target device for detecting direction from the first control device and the second control device includes: determining a magnitude relationship between the accuracy of detecting direction of the first control device and the second control device; and determining the target device based on the magnitude relationship.
[0022] The target device may be the device that initiates the direction finding.
[0023] In this application, the accuracy of device direction detection is referred to as direction finding accuracy, and different devices have different direction finding accuracy. For example, the direction finding accuracy of a laptop is higher than that of a tablet, and the direction finding accuracy of a tablet is higher than that of a mobile phone. The device that initiates direction finding, that is, the target device, can be determined based on the magnitude relationship between the direction finding accuracies of the first control device and the second control device.
[0024] In some embodiments, determining the magnitude relationship between the accuracy of detecting directions of the first control device and the second control device includes: determining device types of the first control device and the second control device; and based on the device types, determining the magnitude relationship between the accuracy of detecting directions of the first control device and the second control device.
[0025] Different types of devices have different direction finding accuracies. The magnitude relationship between the accuracy of the first control device and the second control device in detecting the direction can be determined according to the device type. For example, if the first control device is a laptop and the second control device is a tablet, the direction finding accuracy of the first control device is higher than that of the second control device; if the first control device is a tablet and the second control device is a mobile phone, the direction finding accuracy of the first control device is higher than that of the second control device; if the first control device and the second control device are both tablets, the direction finding accuracy of the first control device is equal to that of the second control device.
[0026] In some embodiments, the target device is determined based on the size relationship, including: if the accuracy of the first control device detecting the direction is higher than the accuracy of the second control device detecting the direction, determining the first control device as the target device; if the accuracy of the first control device detecting the direction is lower than the accuracy of the second control device detecting the direction, determining the second control device as the target device; if the accuracy of the first control device detecting the direction is equal to the accuracy of the second control device detecting the direction, determining whether the first control device is the device that initiates the connection with the second control device; if so, determining the first control device as the target device; if not, determining the second control device as the target device.
[0027] In this application, the device that initiates the connection is called the initiator. For example, the first control device initiates a keyboard and mouse connection to the second control device, so that after the first control device and the second control device are successfully connected, the keyboard and mouse of the first control device can pass through to the second control device and control the second control device.
[0028] If the direction finding accuracy of the first control device is higher than that of the second control device, the first control device is used as the target device for initiating direction finding. If the direction finding accuracy of the first control device is lower than that of the second control device, the second control device is used as the target device for initiating direction finding. If the direction finding accuracy of the first control device is equal to that of the second control device, it is determined whether the first control device is the initiator. If so, the first control device is used as the target device for initiating direction finding. If not, it means that the second control device is the initiator, and the second control device is used as the target device for initiating direction finding. In this way, in a scenario where re-direction finding is required, only one of the first control device and the second control device can perform direction finding, thereby avoiding direction finding conflicts.
[0029] In some embodiments, the target device determines a first direction, including: if the target device is a first control device, the first control device detects a first direction of the second control device relative to the first control device; if the target device is a second control device, the second control device detects a second direction of the first control device relative to the second control device, and determines that the opposite direction of the second direction is the first direction.
[0030] According to this embodiment, if the direction finding accuracy of the first control device is equal to that of the second control device, the initiator performs direction finding; if the direction finding accuracy of the first control device is not equal to that of the second control device, the device with higher direction finding accuracy performs direction finding, which is beneficial to improving the accuracy of direction finding.
[0031] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, when the processor executes the instructions in the memory, the electronic device can execute the method described in the first aspect of the present application. The beneficial effects that can be achieved in the second aspect can refer to the beneficial effects of the method provided in any embodiment of the first aspect, and will not be repeated here.
[0032] In a third aspect, the present application provides a computer-readable storage medium on which instructions are stored, and when the instructions are executed on a computer, the computer can execute the method described in any embodiment of the first aspect. The beneficial effects that can be achieved in the third aspect can refer to the beneficial effects of the method provided in any embodiment of the first aspect, and will not be repeated here.
[0033] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute a method in any possible implementation of the first aspect described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figures 1A to 1C An exemplary scenario of keyboard and mouse traversal of a laptop computer provided in an embodiment of the present application;
[0035] Figures 2A to 2C An exemplary scenario of keyboard and mouse traversal provided in the embodiments of the present application;
[0036] Figure 3A-3B Provide a scenario in which a tablet computer is disconnected from an input device for an embodiment of the present application;
[0037] Figure 4 FIG1 is an example of a process of a keyboard and mouse traversal method provided in an embodiment of the present application;
[0038] Figure 5An example diagram of a tablet computer connected to an input device and a laptop computer provided in an embodiment of the present application;
[0039] Figure 6 An example diagram of a keyboard and mouse of a tablet computer provided in an embodiment of the present application being transferred to a laptop computer;
[0040] Figure 7 An example flow chart of a device control method provided in an embodiment of the present application;
[0041] Figure 8 An example diagram of a scenario in which an input device of a tablet computer is disconnected is provided for an embodiment of the present application;
[0042] Fig. 9 An example diagram of the software architecture of a tablet computer provided in an embodiment of the present application;
[0043] Fig.10 This is an example diagram of the interface of a tablet computer provided in an embodiment of the present application;
[0044] Fig.11 FIG2 is an example of the process of the keyboard and mouse traversal method according to an embodiment of the present application;
[0045] Fig.12 An example diagram of a process of a first device monitoring a peripheral device provided in an embodiment of the present application;
[0046] Fig.13 An example diagram of a pop-up window reminder interface provided in an embodiment of the present application;
[0047] Fig.14 An example diagram of the process of initiating a keyboard and mouse connection provided in an embodiment of the present application;
[0048] Fig.15 An example diagram of a scenario in which the device position changes according to an embodiment of the present application;
[0049] Fig.16 An example flow chart of the direction finding process provided in an embodiment of the present application;
[0050] Fig.17 An example diagram of the version detection process provided in the embodiment of the present application;
[0051] Fig.18 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] The embodiment of the present application is used to provide a device control method. Through the method provided by the present application, when the mouse cursor of the terminal device passes through other devices and controls other devices, it can avoid abnormalities after the keyboard and mouse device of the terminal device is disconnected.
[0053] In order to better understand the embodiments of the present application, the keyboard and mouse traversal scenario is first introduced.
[0054] Figure 1A An exemplary scenario of keyboard and mouse traversal is shown. Figure 1A As shown, the laptop computer 101 is in the middle, connected to the tablet computer 102 on the left and the mobile phone 103 on the right. The operating system of the laptop computer 101 is Windows TM The operating system of the tablet computer 102 and the mobile phone 103 is Android TM ) system. It is understandable that the laptop computer 101 can also be connected to only the tablet computer 102 or the mobile phone 103, or to more terminal devices. The laptop computer 101 includes a screen H10, the tablet computer 102 includes a screen H20, and the mobile phone 103 includes a screen H30.
[0055] The laptop computer 101 includes an input device 10, which includes a keyboard 11 and a touch pad 12. The user can control a mouse cursor H11 on a screen H10 of the laptop computer 101 through the touch pad 12, and input key control instructions through the keyboard 11. It can be understood that the touch pad 12 is equivalent to a mouse.
[0056] The laptop computer 101 can realize keyboard and mouse crossover with the tablet computer 102 or the mobile phone 103. That is, the mouse cursor H11 of the laptop computer 101 can be moved to the screen of the tablet computer 102 or the mobile phone 103. And when the mouse cursor H11 is moved to the screen of the tablet computer 102 or the mobile phone 103, the user can use the input device 10 of the laptop computer 101 to control the tablet computer 102 or the mobile phone 103.
[0057] For example, Figure 1B As shown, after the user uses the touchpad 12 to control the mouse cursor H11 to move to the left edge of the screen H10, the user continues to move the mouse cursor H11 to the left, so that the mouse cursor H11 is moved to the screen H20 of the left tablet computer 102 for display. At this time, the user can perform single-click, double-click, drag, slide and other operations on the touchpad 12 to control the tablet computer 102. It is also possible to input key control instructions on the tablet computer 102 through the keyboard 11, for example, using the keyboard 11 to type on the tablet computer 102. In other words, the keyboard and mouse (i.e., keyboard and mouse) of the laptop computer 101 are transferred to the tablet computer 102.
[0058] For example, Figure 1CAs shown, after the user uses the touchpad 12 to control the mouse cursor H11 to move rightward to the right edge of the screen H10, the user continues to move the mouse cursor H11 to the right, so that the mouse cursor H11 is moved to the screen H30 of the right mobile phone 103 and displayed. At this time, the user can use the touchpad 12 and the keyboard 11 to control the mobile phone 103. In other words, the keyboard and mouse of the laptop computer 101 are transferred to the mobile phone 103.
[0059] In the present application, the mouse cursor H11 can be displayed in the shape of a circle on the screen H20 of the tablet computer 102 or the screen H30 of the mobile phone 103, or can be displayed in the shape of a rectangle, an ellipse, a diamond, etc., without limitation.
[0060] In the above scenario, the laptop 101 is the control device, and the tablet computer 102 and the mobile phone 103 are the controlled devices. The user can use the keyboard and mouse device of the laptop 101 to control the tablet computer 102 and the mobile phone 103, so that the laptop 101, the tablet computer 102 and the mobile phone 103 can work together, thereby facilitating the user's office and study. However, in other scenarios, the user wants to use the keyboard and mouse device of the tablet computer 102 to control other devices, that is, to use the tablet computer 102 as a control device. In order to meet the needs of users, the function of keyboard and mouse crossing can be added to the tablet computer 102, so that after the tablet computer 102 is connected to an external keyboard and mouse device, its keyboard and mouse can also cross to other terminal devices connected to it.
[0061] Figure 2A FIG. 1 shows an example of a scenario in which the tablet computer 102 is used as a control device. Figure 2A , the tablet computer 102 is in the middle, connected to the laptop computer 101 on the left and the mobile phone 103 on the right, respectively, and the tablet computer 102 is connected to the input device 20. The input device 20 includes a keyboard 21 and a touch pad 22. Since the tablet computer 102 has a keyboard and mouse crossing function, such as Figure 2B As shown, the user can use the touch pad 22 to move the mouse cursor H21 of the tablet computer 102 to the screen H10 of the laptop computer 101, or Figure 2C As shown, the mouse cursor H21 of the tablet computer 102 is moved to be displayed on the screen H30 of the mobile phone 103 .
[0062] Understandably, Figures 1A to 1CIn the scenario shown, the laptop computer 101 and its input device 10 are integrated, and its input device 10 generally does not disconnect. However, the input device 20 connected to the tablet computer 102 is an external input device (hereinafter, "external input device" is referred to as "peripheral device"), and the tablet computer 102 and the input device 20 are disconnected when the user does not need to use it. In some cases, after the mouse cursor H21 of the tablet computer 102 passes through the laptop computer 101 or the mobile phone 103, when the user disconnects the tablet computer 102 from the input device 20 or the input device 20 is disconnected due to other reasons such as failure, the laptop computer 101 or the mobile phone 103 may respond abnormally.
[0063] For example, refer to Figure 3A , when the mouse cursor H21 of the tablet computer 102 crosses to the screen H30 of the mobile phone 103, when the user disconnects the input device 20, the screen H30 of the mobile phone 103 still displays the mouse cursor H21, resulting in abnormal display. In addition, if the keyboard and mouse crossing function of the tablet computer 102 is not reset normally, when the input device 20 is reconnected to the tablet computer 102, when the user operates the input device 20, the tablet computer 102 does not respond. In this case, the mouse cursor H21 needs to be moved back to the tablet computer 102 in order to control the tablet computer 102, and the input device 20 cannot be used directly to control the tablet computer 102, and the operation is more complicated. Even after the input device 20 and the mobile phone 103 are both disconnected from the tablet computer 102, the mouse focus of the mouse cursor H21 may be lost. In this case, after the input device 20 is reconnected to the tablet computer 102, there is no response when the user operates the input device 20.
[0064] The mouse focus is the window that currently receives mouse input. When the mouse cursor moves or clicks on the screen, the operating system determines the window that currently has the mouse focus and sends the keyboard and mouse input events to that window. A window is a visual area in the operating system that is used to display the application interface. The mouse focus can be the entire window or a specific control or element in the window. The mouse focus can also be understood as the position of the mouse cursor when it is activated, that is, the position of the mouse cursor when the keyboard and mouse input event is triggered.
[0065] For example, refer to Figure 3B, the tablet computer 102 is connected to independent input devices: a keyboard M1 and a mouse M2, rather than an integrated keyboard and mouse input device 20. When the mouse cursor of the tablet computer 102 crosses over to the screen H10 of the laptop computer 101, after the mouse M2 is disconnected, the keyboard M1 still controls the laptop computer 101, but cannot control the tablet computer 102. Moreover, it is difficult to switch the keyboard M1 to the tablet computer 102 to control the tablet computer 102, which affects the user experience.
[0066] In order to solve the above technical problems, an embodiment of the present application provides a device control method. In the method provided in this embodiment, the first device is connected to a first input device (for example, input device 20 or mouse M2) that can input a mouse cursor, and the first device is connected to the second device. When the mouse cursor of the first device (that is, the mouse cursor input by the first input device on the first device) crosses to the screen of the second device and is displayed, and the second device is controlled by the first input device connected to the first device, if the first input device is disconnected from the first device, the first device sends a mouse grabbing message for retaking the mouse focus to the second device, so as to retake the mouse focus of the mouse cursor from the second device to the first device. In this way, some anomalies can be avoided after the first input device connected to the first device is disconnected. For example, it is avoided that the second device still displays the mouse cursor of the first device; it is avoided that the first device does not respond when the user operates on the first input device after the first device reconnects to the first input device, and other abnormal situations.
[0067] It should be understood that when the mouse cursor of the first input device passes through the second device, the mouse focus of the first input device is located on the second device, and the first input device is bound to the second device, so that the first input device can control the second device. When the second device receives the mouse preemption message sent by the first device, the second device will lose the mouse focus of the first input device and release the binding with the first input device, so that the first input device can no longer control the second device, and the second device will no longer display the mouse cursor of the first input device, avoiding the abnormal display of the second device. After the second device loses the mouse focus of the first input device, the mouse focus returns to the first device. Since the mouse focus is the activation point of the mouse cursor, after the first input device is reconnected with the first device, the mouse cursor of the first input device will be activated on the first device. At this time, the first input device can also directly control the first device, avoiding the abnormality of the first device being unable to respond to the first input device.
[0068] For example, for Figure 3AIn the illustrated situation, after the input device 20 is disconnected from the tablet computer 102, the tablet computer 102 can take back the mouse focus of the mouse cursor H21 from the mobile phone 103, so that the mobile phone 103 no longer displays the mouse cursor H21 of the tablet computer 102. Moreover, when the tablet computer 102 is reconnected to the input device 20, the input device 20 can directly control the tablet computer 102.
[0069] In some scenarios, if the first input device is an input device used only for inputting a mouse cursor (e.g., a mouse M2), and the first device is also connected to a second input device other than the first input device for inputting key control commands (e.g., a keyboard M1), then after the mouse cursor of the first device passes through the second device, a mapping relationship between the second input device and the second device can be established. At this time, the user's operation on the second input device no longer controls the first device but controls the second device. After the first input device is disconnected from the first device, the first device can release the mapping relationship between the second input device and the second device, so that the user can control the first device through the second input device. In this way, it can be avoided that after the first input device is disconnected from the first device, the user cannot control the first device through the second input device.
[0070] For example, for Figure 3B In the situation shown, after the mouse M2 is disconnected from the tablet computer 102 , the tablet computer 102 can take back the mouse focus of the mouse cursor H21 , and release the mapping relationship between M1 and the second device. At this time, the user can use M1 to control the tablet computer 102 .
[0071] To facilitate understanding, the principle of realizing the keyboard and mouse crossing function is first introduced.
[0072] The above-mentioned first device and second device can be devices that support the keyboard and mouse crossing function, such as a tablet computer, a laptop computer, a mobile phone, a wearable device, etc. For ease of understanding, the tablet computer 102 is taken as the first device and the laptop computer 101 is taken as the second device to exemplify the technical solution of the present application, but the present application is not limited to this.
[0073] Figure 4 A flowchart showing the keyboard and mouse traversal process is shown.
[0074] S101, a first device establishes a keyboard and mouse connection with a second device, wherein the first device is connected to an input device capable of inputting a mouse cursor.
[0075] For example, Figure 5 As shown, the tablet computer 102 (as the first device) connected to the input device 20 can initiate a keyboard and mouse connection to the notebook computer 101 (as the second device) to achieve keyboard and mouse traversal after the connection is successful.
[0076] It should be understood that the keyboard and mouse connection is a communication connection that supports keyboard and mouse crossing. That is, after the keyboard and mouse connection is established between the first device and the second device, the keyboard and mouse crossing function can be realized, that is, the function of the second device can be controlled through the input device connected to the first device by crossing the cursor of the first device to the second device.
[0077] S102: The first device determines a first direction of the second device relative to the first device.
[0078] The first device detects a first orientation of the second device relative to the first device.
[0079] It should be understood that after determining the first direction of the second device relative to the first device, the cursor of the first device can be moved along the first direction to be displayed on the screen of the second device, that is, the keyboard and mouse of the first device traverse to the second device along the first direction.
[0080] In some embodiments, the first device may use ultrasonic direction finding to detect the first direction of the second device relative to the first device. It should be understood that in other embodiments, the first device may also use radio frequency direction finding, microwave direction finding, optical direction finding, etc. to detect the first direction of the second device relative to the first device.
[0081] like Figure 5 As shown, the tablet computer 102 detects that the laptop computer 101 is in the left direction of the tablet computer 102 (as an example of the first direction).
[0082] It should be understood that in some scenarios, when the first device determines the first direction of the second device relative to the first device, the second device will also determine the second direction of the first device relative to the second device. If the relative position relationship between the first device and the second device represented by the first direction determined by the first device and the second direction determined by the second device is different, it may cause an abnormal determination of the relative position relationship between the first device and the second device. Therefore, in some embodiments, only the first device can determine the first direction of the second device relative to the first device, or the second device can determine the second direction of the first device. The specific process will be introduced below and will not be repeated here.
[0083] S103, the first device detects whether the mouse cursor moves out of the screen of the first device along the first direction. If yes, execute step S104. If no, execute step S105.
[0084] For example, Figure 5 As shown, the user can control the mouse cursor H21 to move on the screen H20 using the touch pad 22 of the tablet computer 102. When the tablet computer 102 detects that the user moves the mouse cursor H21 out of the screen H20 from the left side of the screen H20, the process goes to step S104.
[0085] S104: The mouse cursor moves to the screen of the second device for display.
[0086] For example, Figure 6 As shown, when the mouse cursor H21 moves along the left direction on the screen H20 of the tablet computer 102 and moves out of the screen H20 , the mouse cursor H21 crosses over to the screen H10 of the notebook computer 101 for display.
[0087] It should be understood that when the mouse cursor passes from the screen of the first device to the screen of the second device, the mouse cursor displayed on the second device will move to a second position relative to the first position where the mouse cursor moved from the screen of the first device. Figure 6 After the mouse cursor H21 moves out of point A on the screen H20, the cursor of the laptop computer 101 moves from point B to point C, wherein the ratio of the distance between point A and the upper edge of the screen H20 to the distance between point A and the lower edge of the screen H20 is the same as the ratio of the distance between point C and the upper edge of the screen H10 to the distance between point C and the lower edge of the screen H10.
[0088] It should be understood that the traversal direction of the mouse cursor of the first device is consistent with the first direction of the second device relative to the first device.
[0089] It should be understood that after the mouse cursor crosses over to the screen of the second device, the input device of the first device establishes a binding relationship with the second device, and the user's operation on the input device of the first device can be used to control the second device instead of the first device. Figure 6 In the situation shown, after the mouse cursor H21 passes through the screen H10 of the laptop computer 101 and is displayed, the input device 20 of the tablet computer 102 establishes a binding relationship with the laptop computer 101, and the user's operation on the input device 20 of the tablet computer 102 can control the laptop computer 101 instead of the tablet computer 102.
[0090] S105, the mouse cursor does not cross.
[0091] Exemplarily, when the mouse cursor H21 moves in a direction other than the left direction on the screen H20 of the tablet computer 102, or when the mouse cursor H21 moves in the left direction on the screen H20 of the tablet computer 102 but does not move out of the screen H20, the mouse cursor H21 does not cross and remains displayed on the screen H20.
[0092] In the above embodiment, the mouse cursor of the first device can cross over to the screen of the second device for display.
[0093] The following describes a method provided in an embodiment of the present application for preventing anomalies from occurring after an input device of a first device is disconnected.
[0094] Figure 7 A device control method is provided in an embodiment of the present application. Figure 7 , the device control method provided in the embodiment of the present application includes:
[0095] S201, the second device displays the mouse cursor of the first device.
[0096] After the mouse cursor of the first device passes to the second device, the second device can display the mouse cursor of the first device. For details, please refer to the aforementioned step S104, which will not be described in detail here.
[0097] The description is continued by taking the tablet computer 102 as the first device and the notebook computer 101 as the second device as an example.
[0098] As mentioned above Figure 6 As shown, after the mouse cursor H21 of the tablet computer 102 passes through the screen H10 of the laptop computer 101, the laptop computer 101 can display the mouse cursor H21. At this time, the mouse focus of the mouse cursor H21 is on the screen H10 of the laptop computer 101, and the user can control the laptop computer 101 through the input device 20 of the tablet computer 102.
[0099] S202: The first device detects that an input device for inputting a mouse cursor is disconnected.
[0100] The first device detects that the input device for inputting the mouse cursor is disconnected, triggering the first device to send a keyboard and mouse preemption message to the second device
[0101] For example, Figure 8 As shown, when the input device 20 is disconnected from the tablet computer 102 , the tablet computer 102 detects that the current connection state of the input device 20 is a disconnected state, triggering the tablet computer 102 to send a keyboard and mouse preemption message to the notebook computer 101 .
[0102] S203: The first device sends a keyboard and mouse preemption message to the second device.
[0103] When the input device connected to the first device is disconnected, the first device sends a keyboard and mouse preemption message to the second device.
[0104] For example, for Figure 8 In the illustrated scenario, after the tablet computer 102 detects that the input device 20 is disconnected from it, it sends a keyboard and mouse grabbing message to the laptop computer 101. The keyboard and mouse grabbing message is used to recapture the mouse focus of the mouse cursor, that is, to instruct the second device to release the binding relationship between the input device of the first device and the second device.
[0105] S204: The second device controls the mouse focus corresponding to the mouse cursor of the first device to return to the first device.
[0106] In response to the keyboard and mouse preemption message, the second device returns the mouse focus corresponding to the mouse cursor of the first device to the first device. For example, the second device can release the binding relationship between the input device of the first device and the second device, and no longer display the mouse cursor of the first device.
[0107] For example, for Figure 8 In the situation shown, the laptop computer 101 responds to the keyboard and mouse grabbing message sent by the tablet computer 102, and controls the mouse focus of the mouse cursor H21 to return from the screen H10 of the laptop computer 101 to the screen H20 of the tablet computer 102. At this time, the laptop computer 101 no longer displays the mouse cursor H21 of the tablet computer 102, but displays the mouse cursor H11 of the laptop computer. In addition, since the input device 20 is disconnected and the mouse cursor cannot be input, the tablet computer 102 does not display the mouse cursor H21 of the laptop computer at this time.
[0108] In the example of this embodiment, when the mouse cursor H21 of the tablet computer 102 passes through the laptop computer 101 and controls the laptop computer 101, if the input device 20 of the tablet computer 102 is disconnected from it, the mouse focus of the mouse cursor H21 of the tablet computer 102 can return to the laptop computer 101. In this way, when the tablet computer 102 is reconnected to the input device 20, the user can directly control the tablet computer 102 through the input device 20, avoiding the abnormality that the tablet computer 102 cannot respond to the input device 20.
[0109] In other examples, the first device is a tablet computer 102, which is connected to an independent keyboard M1 and mouse M2, and the second device is a laptop computer 101. When the mouse cursor H20 input by the mouse M2 passes through the screen H10 of the laptop computer 101, the keyboard M1 can control the laptop computer 101 because the mouse focus of the mouse cursor H20 is on the laptop computer 101. In the case where the mouse cursor H21 of the tablet computer 102 passes through the laptop computer 102 and controls the laptop computer 101, when the tablet computer 102 is disconnected from the mouse M2, the mouse focus of the mouse cursor H21 can return from the laptop computer 101 to the tablet computer 102. At this time, the keyboard M1 no longer controls the laptop computer 101, but controls the tablet computer 102. In this way, the loss of the mouse focus can be avoided, and the user's use is also convenient.
[0110] In other examples, the first device is a tablet computer 102, and the second device is a mobile phone 103. When the mouse cursor H21 of the tablet computer 102 crosses over to the screen H30 of the mobile phone 103 to display and control the mobile phone 103, after the tablet computer 102 is disconnected from the input device 20, the mouse focus of the mouse cursor H21 can be returned from the screen H30 of the mobile phone 103 to the screen H20 of the tablet computer 102, so that the mobile phone 103 no longer displays the mouse cursor H21, thereby avoiding abnormal display of the mobile phone 103.
[0111] S205: The first device updates the keyboard and mouse traversal status.
[0112] After the first device regains the mouse focus, it updates the current keyboard and mouse traversal state from the first state to the second state. The first state is the state in which the keyboard and mouse of the first device traverse to other devices, and the second state is the state in which the keyboard and mouse of the first device do not traverse to other devices. The first device updates the current keyboard and mouse traversal state from the first state to the second state, which can instruct the first device to release the binding relationship between the input device and the second device, so that after the input device is reconnected to the first device, the user's operation on the input device no longer controls the second device, but controls the first device.
[0113] For example, for Figure 8 In the scenario shown, after the input device 20 of the tablet computer 102 is disconnected, the tablet computer 102 takes back the focus of the mouse cursor H21 and updates the current keyboard and mouse crossing state from the first state to the second state, so as to instruct the tablet computer 102 to release the binding relationship between the input device 20 and the notebook computer 101. Therefore, after the input device 20 is reconnected to the tablet computer 102, it no longer controls the notebook computer 101, but controls the tablet computer 102.
[0114] It can be understood that when the current keyboard and mouse cross-over state of the tablet computer 102 is the second state, the keyboard and mouse of other devices cannot cross over to the tablet computer 102. Therefore, if the current keyboard and mouse cross-over state of the tablet computer 102 is not updated to the second state after the mouse focus of the mouse cursor H21 returns to the tablet computer 102, the keyboard and mouse of other devices can no longer cross over to the tablet computer 102, resulting in abnormal keyboard and mouse cross-over function of the tablet computer 102. Therefore, in this embodiment, after the mouse focus of the mouse cursor H21 returns to the tablet computer 102, the current keyboard and mouse cross-over state of the tablet computer 102 is updated to the second state, which can avoid abnormal keyboard and mouse cross-over function of the tablet computer 102.
[0115] S206: The second device updates the keyboard and mouse traversal status.
[0116] The second device updates the current keyboard and mouse state from the third state to the fourth state, wherein the third state is a state in which the keyboard and mouse of other devices are passed through to the second device, and the fourth state is a state in which the keyboard and mouse of other devices are not passed through to the second device.
[0117] If the second device updates the current keyboard and mouse state to the fourth state, the second device no longer receives or responds to the input instruction sent by the first device. If the second device is not connected to the input device, the cursor is no longer displayed.
[0118] For example, for Figure 8 In the scenario shown, the input device 20 of the tablet computer 102 is disconnected and sends a mouse grabbing message to the laptop computer 101. The laptop computer 101 updates the current keyboard and mouse crossing state from the third state to the fourth state in response to the keyboard and mouse grabbing message sent by the tablet computer 102. At this time, the laptop computer 101 no longer receives or responds to the input command sent by the tablet computer 102.
[0119] It should be understood that the laptop computer 101 also supports the keyboard and mouse pass-through function, but when the current keyboard and mouse pass-through state of the laptop computer 101 is the first state, the keyboard and mouse of the laptop computer 101 cannot pass through. If the current keyboard and mouse pass-through state of the laptop computer 101 is not updated from the first state to the second state after the mouse focus of the mouse cursor H21 returns to the tablet computer 102, it will cause the keyboard and mouse pass-through function of the laptop computer 101 to be abnormal, that is, the keyboard and mouse of the laptop computer 101 cannot pass through to other devices. Therefore, in this embodiment, after the mouse focus of the mouse cursor H21 returns to the tablet computer 102, the current keyboard and mouse pass-through state of the laptop computer 101 is updated to the second state, which can avoid the abnormality of the keyboard and mouse pass-through function of the laptop computer 101.
[0120] It should be noted that there is no order restriction between the above steps S205 and S206. In other embodiments, step S205 may also be placed between step S202 and step S203, or between step S203 and step S204. S206 may also be placed between step S203 and step S204. In summary, in this embodiment, when the mouse cursor of the first device passes through the second device and controls the second device, when the input device of the first device is disconnected, the first device can take back the mouse focus of the mouse cursor from the second device, thereby avoiding abnormalities.
[0121] The technical solution of the embodiment of the present application is further described below in conjunction with the software architecture of the tablet computer 102 .
[0122] It is understood that the software of the tablet computer 102 can be implemented using software such as Android, IOS TMThe following takes Android as an example to introduce the software architecture of the terminal device.
[0123] Fig. 9 This is an example diagram of the software architecture of a tablet computer 102 provided in an embodiment of the present application. Fig. 9 As shown, the software construction of the tablet computer 102 includes an office business middle platform, a smart middle platform, an interconnected middle platform, a security middle platform, a basic framework and a driver layer.
[0124] The office business middle platform includes a keyboard and mouse sharing service module and a control center service module. The keyboard and mouse sharing service module, also known as the keyboard and mouse business module, is used to provide specific keyboard and mouse business capabilities, and schedule basic capabilities to implement specific services. The keyboard and mouse sharing service module includes a discovery scheduling module, a direction recognition scheduling module, a virtual driver loading module, a human-computer interaction (user interface, UI) module, a drag management module, a connection scheduling module, a state management module, a keyboard and mouse management module, a settings management module, and a main service module.
[0125] The discovery scheduling module is used to call the device discovery capability and identify available devices, where available devices are devices that support keyboard and mouse traversal. Fig.10 As shown, after the keyboard and mouse sharing function of the tablet computer 102 is turned on, the discovery scheduling module of the tablet computer 102 can call a device discovery module with device discovery capability to detect nearby available devices, for example, devices named "YOYO computer", "YOYO tablet", and "YOYO mobile phone".
[0126] The direction identification scheduling module is used to call the direction identification capability to identify the direction of the available device relative to the local machine. For example, after the tablet computer 102 is successfully connected to the laptop computer 101, the direction identification scheduling module of the tablet computer 102 can call the direction identification module with direction identification capability to identify the direction of the laptop computer 101 relative to the tablet computer 102, and determine it as the keyboard and mouse crossing direction of the tablet computer 102. The keyboard and mouse crossing direction is the direction in which the mouse cursor passes out or in. For example, the tablet computer 102 recognizes that the laptop computer 101 is on its left side, and the mouse cursor H21 of the tablet computer 102 passes out from the left side of the screen H20 and enters from the right side of the screen H10 of the laptop computer 101. Then the keyboard and mouse crossing direction of the tablet computer 102 is the left direction, and the keyboard and mouse crossing direction of the laptop computer 101 is the right direction.
[0127] The virtual driver loading module is used to load the driver layer driver, for example, the virtual input driver (Uinputdriver).
[0128] The UI module is used to provide a visual interface for users, such as Fig.10The main interface shown in the figure provides interactive capabilities.
[0129] The drag management module is used to monitor the drag operation of the user, for example, the operation of dragging a file from the tablet computer 102 to the notebook computer 101 .
[0130] The connection scheduling module is used to call the keyboard and mouse connection capability and establish a keyboard and mouse connection with available devices. Fig.10 As shown, when the automatic connection function of the tablet computer 102 is turned on, the connection scheduling module of the tablet computer 102 can call the device connection module with keyboard and mouse connection capability to automatically establish a keyboard and mouse connection with an available device, for example, connect to a device named "YOYO Computer".
[0131] The state management module is used to manage the information of the traversable devices and the keyboard and mouse traversal directions. For example, the state management module can determine the number, location and traversal direction of the traversable devices.
[0132] The keyboard and mouse management module is used to manage keyboard and mouse functions and keyboard and mouse connection methods.
[0133] The settings module is used to provide settings entry for related functions, for example Fig.10 As shown, it provides settings for keyboard and mouse sharing, automatic connection, automatic direction switching and other functions.
[0134] The main service module can be used to provide autonomous startup services for keyboard and mouse services.
[0135] The control center service is used to schedule the keyboard and mouse service. The control center service includes a keyboard and mouse sharing scheduling module, a keyboard and mouse sharing display module, a keyboard and mouse status storage module, and a business scheduling management module. Among them, the keyboard and mouse sharing scheduling module is used to call the keyboard and mouse sharing capability to realize keyboard and mouse crossing. The keyboard and mouse sharing display module is used to realize the shared display of the mouse cursor. For example, the mouse cursor H21 of the tablet computer 102 is shared to the screen of the laptop computer 101 for display. The keyboard and mouse status storage module is used to store the keyboard and mouse crossing status, for example, the status of the keyboard and mouse of this machine crossing to other devices, the status of the keyboard and mouse of this machine not crossing to other devices, the status of the keyboard and mouse of other devices crossing to this machine, and the status of the keyboard and mouse of other devices not crossing to this machine. The business scheduling management module is used to schedule and manage each module in the keyboard and mouse sharing service module.
[0136] The smart middle station includes a direction recognition module and a smart engine. The direction recognition module, which can also be called a direction finding module, is used to provide direction recognition capabilities and can identify the direction of the connectable device relative to the local computer. For example, when the laptop 101 detects the tablet 102, the direction scheduling module of the laptop 101 can call the mode recognition module to detect the direction of the tablet 102 relative to the laptop 101. The smart engine is used to provide smart capabilities such as automatic connection, automatic recognition, automatic discovery, automatic direction switching, and automatic switching of connected devices.
[0137] The interconnection platform includes a device management module and a communication (MagicLink) module. Device management is used to provide device status and service status management. Device management includes a service status management module, a service attribute management module, and a device attribute management module. Among them, the service status management module is used to manage the status of the keyboard and mouse sharing service, such as the open or closed status. The service attribute management module is used to manage the attributes of the keyboard and mouse sharing service, such as UI interface parameters, keyboard and mouse function parameters, etc. The device attribute management module is used to manage the attributes of the device, such as the device name, etc.
[0138] The MagicLink module is used to provide connection discovery capabilities. The MagicLink module includes a device discovery module, a device connection module, a data transmission module, and a data optimization module. Among them, the device discovery module is used to provide the ability to discover available devices. The device connection module is used to provide keyboard and mouse connection capabilities. The data transmission module is used to transmit signaling, such as packaged keyboard and mouse events. The transmission optimization module is used to optimize the transmission of signaling.
[0139] The security center includes an identity authentication module and a device authentication module. The identity authentication module is used to authenticate the device, for example, to determine whether the device to be connected is logged in with the same user account as the local device. The device authentication module is used to perform security authentication on the device and determine whether the device to be connected is a trusted device.
[0140] The basic framework includes input framework, security management, transmission control protocol (TCP) TCP / Internet protocol address (IP) protocol, data system, etc. Among them, the input framework is used to report events, for example, reporting keyboard and mouse input events. Security management is used to provide security management capabilities. TCP / IP is used to provide data transmission protocols. The data system is used to manage the data of keyboard and mouse services.
[0141] The driver layer includes virtual input driver, human interface device (HID) driver, bluetooth (BT) driver and wireless fidelity (WIFI) driver. Among them, the virtual input driver is used to inject input events. The HID driver is used to provide time injection on the PC side. The BT driver is used to provide Bluetooth connection. The WIFI driver is used to provide WIFI connection.
[0142] Above Fig. 9 The software architecture shown is based on the Figure 1A to Figure 1C On the basis of the software architecture of the tablet computer 102 shown, a discovery scheduling module and a direction identification module are newly added, and the UI module, drag management module, connection scheduling module, status management module, keyboard and mouse management module, main service module, keyboard and mouse sharing scheduling module, keyboard and mouse sharing display module, keyboard and mouse status storage module, direction identification module, service status management module, service attribute management module, device attribute management module, device discovery module, device connection module, data transmission module, transmission optimization module, input framework and virtual input driver are modified to a certain extent, so that the tablet computer 102 has the keyboard and mouse crossing function.
[0143] The following is combined with the above Fig. 9 The software architecture shown introduces the device control method of the embodiment of the present application.
[0144] Fig.11 FIG. 1 shows an example flow chart of a device control method provided in an embodiment of the present application. Fig.11 As shown, the following steps are included:
[0145] S301: The keyboard and mouse service module of the first device detects that the first device is connected to an input device.
[0146] When the keyboard and mouse service module of the first device detects that the input device is connected to the first device, the current keyboard and mouse connection state is updated from the unconnected state to the connected state, and the mouse cursor input by the input device is displayed on its screen. For the sake of narrative coherence, the following describes the process of the keyboard and mouse service module of the first device detecting the connection of the input device.
[0147] S302: The keyboard and mouse service module of the first device initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device.
[0148] After the first device is connected to the input device, the keyboard and mouse service module of the first device initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device. For the sake of narrative coherence, the keyboard and mouse connection process is introduced below.
[0149] S303: The second device displays the mouse cursor of the first device.
[0150] After the keyboard and mouse service module of the first device initiates a keyboard and mouse connection with the keyboard and mouse service module of the second device, when the user moves the mouse cursor of the second device to the screen of the second device, the keyboard and mouse of the first device pass through to the second device. At this time, the second device displays the mouse cursor of the first device, and the user can use the input device of the first device to control the second device.
[0151] As mentioned above Figure 6 As shown, after the mouse cursor H21 of the tablet computer 102 passes through the screen H10 of the laptop computer 101, the laptop computer 101 can display the mouse cursor H21. At this time, the mouse focus of the mouse cursor H21 is on the screen H10 of the laptop computer 101, and the user can control the laptop computer 101 through the input device 20 of the tablet computer 102.
[0152] S304: The keyboard and mouse service module of the first device detects that the input device for inputting a mouse cursor is disconnected.
[0153] When the keyboard and mouse service module of the first device detects that the input device connected thereto is disconnected, the current keyboard and mouse connection state is updated to an unconnected state, triggering the keyboard and mouse service module of the first device to send a mouse preemption message to the keyboard and mouse service module of the second device.
[0154] As above Figure 8 As shown, when the input device 20 is disconnected from the tablet computer 102 , the tablet computer 102 detects that the current connection state of the input device 20 is a disconnected state, which triggers the tablet computer 102 to send a keyboard and mouse preemption message to the notebook computer 101 .
[0155] S305: The keyboard and mouse service module of the first device sends a keyboard and mouse preemption message to the keyboard and mouse service module of the second device.
[0156] The keyboard and mouse service module of the first device sends a keyboard and mouse grabbing message to the second device based on detecting that the input device connected thereto is disconnected, so as to grab the mouse focus of the mouse cursor back to the first device.
[0157] For example, for Figure 8 In the illustrated scenario, after the keyboard and mouse service module of the tablet computer 102 detects that the input device 20 is disconnected from it, it can send a keyboard and mouse preemption message to the keyboard and mouse service module of the notebook computer 101.
[0158] S306: The keyboard and mouse service module of the second device controls the mouse focus corresponding to the mouse cursor to return to the first device.
[0159] The keyboard and mouse service module of the second device returns the focus of the mouse cursor of the first device to the first device in response to the mouse preemption message sent by the keyboard and mouse service module of the first device.
[0160] For example, for Figure 8 In the situation shown, the keyboard and mouse service module of the laptop computer 101 responds to the mouse grabbing message and controls the mouse focus of the mouse cursor H21 to return from the screen H10 of the laptop computer 101 to the screen H20 of the tablet computer 102. At this time, the laptop computer 101 no longer displays the mouse cursor H21 of the tablet computer 102, but displays the mouse cursor H11 of the laptop computer. In addition, since the input device 20 is disconnected and the mouse cursor cannot be input, the tablet computer 102 does not display the mouse cursor H21 of the laptop computer at this time.
[0161] S307: The keyboard and mouse service module of the first device updates the keyboard and mouse crossing status.
[0162] After the first device regains the mouse focus, the current keyboard and mouse cross-function state is updated from the first state to the second state to avoid abnormal keyboard and mouse cross-function of the first device.
[0163] Step S2307 is substantially the same as the above-mentioned step S205 and will not be described again here.
[0164] S308: The keyboard and mouse service module of the second device updates the keyboard and mouse crossing status.
[0165] After the mouse focus is taken back from the first device, the second device updates the current keyboard and mouse cross-function state from the third state to the fourth state to avoid abnormal keyboard and mouse cross-function of the second device.
[0166] Step S308 is substantially the same as the above-mentioned step S206 and will not be described again here.
[0167] In this embodiment, when the keyboard and mouse of the first device pass through to the second device and the input device of the first device controls the second device, when the keyboard and mouse service module of the first device detects that the input device of the first device is disconnected, a keyboard and mouse preemption message can be sent to the keyboard and mouse service module of the second device to regain the mouse focus, thereby avoiding abnormalities.
[0168] The following introduces the process in which the keyboard and mouse service module of the first device detects the connection of the input device, that is, the process in which the keyboard and mouse service module of the first device monitors the peripheral device.
[0169] Fig.12 The flowchart of the keyboard and mouse service module of the first device monitoring the external device is shown. Fig.12 , the monitoring process includes the following steps:
[0170] S401, start the keyboard and mouse service module.
[0171] The keyboard and mouse service module can be automatically started after the first device is turned on.
[0172] For example, for Fig.10 In the illustrated situation, after the tablet computer 102 is turned on, its keyboard and mouse service module is automatically started.
[0173] S402, triggering the keyboard and mouse connection.
[0174] If the automatic connection function of the first device is turned on, when the keyboard and mouse service module of the first device detects a second device that can be connected, the keyboard and mouse service module of the first device can be automatically triggered to connect with the keyboard and mouse service module of the second device. If the automatic connection function of the first device is not turned on, when the user manually operates the first device to connect with the second device, the keyboard and mouse service module of the first device is triggered to connect with the keyboard and mouse service module of the second device.
[0175] For example, as above Fig.10 As shown, after the automatic connection function of the tablet computer 102 is turned on, the keyboard and mouse service module of the tablet computer 102 can automatically detect the notebook computer 101 named "YOYO's Computer" and connect with the keyboard and mouse service module of the notebook computer 101.
[0176] S403, the keyboard and mouse service module monitors whether the local device is connected to the peripheral device. If yes, execute step S404. If no, execute step S405.
[0177] After the keyboard and mouse connection between the keyboard and mouse service module of the first device and the keyboard and mouse service module of the second device is triggered, the keyboard and mouse service module of the first device can monitor whether the local device is connected to the peripheral device.
[0178] S404, initiate keyboard and mouse connection.
[0179] When the keyboard and mouse service module of the first device detects that the device has been connected to a peripheral device, it initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device. Figure 5 As shown, when the keyboard and mouse service module of the tablet computer 102 detects that the local input device 20 is connected, it initiates a keyboard and mouse connection to the keyboard and mouse service module of the notebook computer 101 .
[0180] S405, a pop-up window prompts that the use of the keyboard and mouse cross-function requires the connection of an external device.
[0181] When the keyboard and mouse service module of the first device detects that the device is not connected to the peripheral device, a pop-up window appears on the screen of the first device to remind the user that the keyboard and mouse pass-through function requires the connection of the peripheral device. Fig.13As shown, the tablet computer 102 displays a pop-up window C1 to remind the user that "this function requires the connection of external devices. Please connect a keyboard, mouse, touchpad and other devices before use."
[0182] In other embodiments, the first device may also prompt that the use of the keyboard and mouse crossing function requires the connection of a peripheral device in other ways, such as a voice reminder, etc., and there is no limitation to this.
[0183] In this embodiment, when the user wants to use the keyboard and mouse pass-through function of the first device but has not connected the first device to a peripheral device, the first device can remind the user, thereby improving the user's usage experience.
[0184] The following introduces a process in which the first device determines a first direction of the second device relative to the first device.
[0185] Fig.14 The following is an example diagram showing the process of initiating a keyboard and mouse connection by the keyboard and mouse service module of the first device. Fig.14 , the process of initiating a keyboard and mouse connection includes the following steps:
[0186] S501: A keyboard and mouse service module of a first device transmits an identifier of a second device to a direction finding module of the first device.
[0187] After the keyboard and mouse service module of the first device monitors that the first device has been connected to the peripheral device, it detects nearby available devices, and when a second device is detected, it reads the identifier of the second device and sends the identifier to the direction finding module of the first device. The identifier can be a device name, device serial number, etc.
[0188] S502: A direction finding module of a first device initiates direction finding to a direction finding module of a second device.
[0189] After receiving the identifier of the second device, the direction finding module of the first device initiates direction finding to the direction finding module of the second device indicated by the identifier, so as to detect the direction of the second device relative to the first device.
[0190] In some embodiments, the first device may determine the first direction by using an ultrasonic direction finding method. For example, the first device plays an ultrasonic wave, the second device collects the ultrasonic wave and determines the second direction of the first device relative to the second device based on the collected ultrasonic wave, and then returns the first direction opposite to the second direction to the first device. For example, if the second direction determined by the second device is the right direction, the left direction is returned to the first device as the first direction. Alternatively, the second device directly returns the second direction to the first device, and the first device determines that the opposite direction of the second direction is the first direction. In other embodiments, the first device may also determine the direction of the second device relative to the first device by using methods such as radio frequency direction finding, microwave direction finding, and optical direction finding.
[0191] S503: The direction finding module of the first device returns a first direction of the second device relative to the first device to the keyboard and mouse service module of the first device.
[0192] After the direction finding module of the first device detects the first direction of the second device relative to the first device, the direction finding module of the first device returns the first direction to the keyboard and mouse service module of the first device.
[0193] S504: The keyboard and mouse service module of the first device initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device based on the first direction.
[0194] After the keyboard and mouse service module of the first device receives the first direction of the second device returned by the direction finding module of the first device, it uses the first direction as the keyboard and mouse crossing direction to initiate a keyboard and mouse connection to the keyboard and mouse service module of the second device, so that after the keyboard and mouse connection between the first device and the second device, the keyboard and mouse of the first device can pass through to the second device along the first direction.
[0195] In this embodiment, the direction finding module of the first device can provide the first device with the direction of the second device, so that after the first device is connected to the second device, the keyboard and mouse crossing direction of the first device can be determined according to the direction of the second device, so that the keyboard and mouse of the first device can cross to the second device according to the determined keyboard and mouse crossing direction.
[0196] It is understandable that different terminal devices have different direction finding accuracy. For example, the direction finding accuracy of the laptop computer 101 is higher than that of the tablet computer 102 .
[0197] It can be understood that after the keyboard and mouse connection between the first device and the second device is completed, if the position of one of the devices moves, it is necessary to re-measure the direction to re-determine the keyboard and mouse crossing direction of the first device. Among them, both the first device and the second device have a direction finding function. After the position of one of the devices moves, if both the first device and the second device measure the direction, but the direction finding results of the first device and the second device do not correspond, it will cause a conflict in the direction finding results, making the keyboard and mouse crossing function of the first device abnormal.
[0198] For example, Fig.15As shown, after the tablet computer 102 is connected to the keyboard and mouse of the laptop computer 101 on the left as a control device, the laptop computer 101 remains stationary, and the tablet computer 102 is moved to the left side of the laptop computer 101. Since the position of the tablet computer 102 has moved, it is necessary to re-measure the direction. At this time, if both the tablet computer 102 and the laptop computer 101 measure the direction. If the direction finding result of the tablet computer 102 is wrong, its direction finding result is that the laptop computer 101 is located on its left side, while the direction finding result of the laptop computer 101 is correct, and its direction finding result is that the tablet computer 102 is located on its left side, it will cause the direction finding results of the tablet computer 102 and the laptop computer 101 to be inconsistent, resulting in conflict in the direction finding results, and the keyboard and mouse crossing direction of the tablet computer 102 cannot be determined, causing the keyboard and mouse crossing function of the tablet computer 102 to be abnormal.
[0199] In order to solve the above technical problem, in an embodiment of the present application, after the first device and the second device are connected by keyboard and mouse, when the position of one of the devices moves, only the first device is allowed to re-measure the direction, so that the direction measurement results conflict.
[0200] Fig.16 The following is an example of the process of re-finding the direction after the device moves. Fig.16 As shown in the figure, the process of re-direction finding of the device includes the following steps:
[0201] S601: A keyboard and mouse service module of a first device is connected to a keyboard and mouse service module of a second device.
[0202] In some embodiments, the keyboard and mouse service module of the first device may initiate a keyboard and mouse connection to the keyboard and mouse service of the second device, or the keyboard and mouse service module of the second device may initiate a keyboard and mouse connection to the keyboard and mouse service of the first device, and this is not limited thereto.
[0203] S602: A direction finding module of a first device determines that a position of the first device changes.
[0204] In some embodiments, when the position of the first device changes, the direction finding module of the first device may detect the change in the position of the first device by using a direction finding method such as ultrasound.
[0205] In other embodiments, the first device includes detection devices such as an accelerometer and a gyroscope, which can detect in real time whether the position of the first device changes. When the position of the first device changes, the change in the position of the first device can be reported to the direction finding module of the first device, which is not limited here.
[0206] S603: The direction finding module of the first device reports a device direction switching notification to the keyboard and mouse service module of the first device.
[0207] When the direction finding module of the first device determines that the position of the first device has changed, a notification of device direction switching is reported to the keyboard and mouse service module of the first device so as to perform direction finding again.
[0208] S604, the keyboard and mouse service module of the first device determines whether the direction finding accuracy of the first device is higher than the direction finding accuracy of the second device. If not, execute step S605; if yes, execute step S607.
[0209] It should be understood that different types of devices have different direction finding accuracies. In some embodiments, the magnitude relationship of direction finding accuracies between different types of devices can be predetermined. For example, the direction finding accuracy of a laptop is higher than that of a tablet computer, and the direction finding accuracy of a tablet computer is higher than that of a mobile phone.
[0210] Based on this, in some embodiments, the keyboard and mouse service module of the first device can determine the device types of the first device and the second device, and then determine the direction finding accuracy between the first device and the second device according to the size relationship between the direction finding accuracy of different types of devices.
[0211] For example, when the first device is a tablet computer and the second device is a laptop computer, it can be determined that the direction finding accuracy of the first device is lower than that of the second device.
[0212] For another example, when the first device is a tablet computer and the second device is a mobile phone, it can be determined that the direction finding accuracy of the first device is higher than the direction finding accuracy of the second device.
[0213] For another example, when the first device is a tablet computer and the second device is a tablet computer, it can be determined that the direction finding accuracy of the first device is equal to that of the second device.
[0214] S605, the keyboard and mouse service module of the first device determines whether the direction finding accuracy of the first device is equal to the direction finding accuracy of the second device. If yes, execute step S606; if no, execute step S613.
[0215] When the first device and the second device are of the same device type, it is determined that the direction finding accuracy of the first device and the second device are equal. For example, when the first device and the second device are both tablet computers, or both mobile phones, or both laptop computers, it is determined that the direction finding accuracy of the first device and the second device are equal.
[0216] S606, the keyboard and mouse service module of the first device determines whether the first device is an initiator. If yes, execute step S607; if no, execute step S613.
[0217] The initiator is the device that initiates the keyboard and mouse connection, that is, the input device of this device is used to control other devices.
[0218] In some embodiments, the device initiating the connection can record a flag indicating that it is the initiator when initiating the connection. The flag may include a first value (e.g., 1) and a second value (e.g., 0), the first value indicating that the device is the initiator, and the second value indicating that the device is not the initiator. The keyboard and mouse service module of the first device can determine whether it is the initiator based on the value of the flag. If the flag is currently the first value, it is determined that it is the initiator, and if the flag is currently the second value, it is determined that it is not the initiator.
[0219] S607: The keyboard and mouse service module of the first device sends a direction finding instruction to the direction finding module of the first device.
[0220] When the direction finding accuracy of the first device is higher than that of the second device, or the direction finding accuracy of the second device is equal to that of the second device and the first device is the initiator, the keyboard and mouse service module of the first device sends a direction finding instruction to the direction finding module of the first device, wherein the direction finding instruction is used to instruct the terminal device to perform direction finding.
[0221] For example, the first device is a laptop computer, and the second device is a tablet computer. Since the direction finding accuracy of the first device is higher than that of the second device, the first device performs direction finding.
[0222] For another example, the first device and the second device are both tablet computers, but the first device is an initiator. In this case, the direction finding accuracy of the first device is equal to that of the second device, and the first device as the initiator performs direction finding.
[0223] S608: A direction finding module of the first device detects a first direction of the second device relative to the first device.
[0224] In some embodiments, after the first device moves from the right side of the second device to the left side of the second device, the second device is located on the right side of the first device. At this time, the direction finding module of the first device can detect that the second device is in the right direction of the first device, and use the right direction (i.e., the first direction) as the direction finding result.
[0225] In some embodiments, the first device can detect the first direction of the second device relative to the first device by ultrasonic direction finding. That is, one device plays ultrasonic waves, and the other device collects the ultrasonic waves and determines the second direction of the device playing the ultrasonic waves relative to itself based on the collected ultrasonic waves, and then returns the opposite direction of the second direction to the first device. Alternatively, the second direction is directly returned to the first device, and the first device determines that the opposite direction of the second direction is the first direction.
[0226] For example, if the first device is a laptop and the second device is a tablet, the first device plays ultrasonic waves and the second device collects ultrasonic waves. If the first device is a tablet and the second device is a mobile phone, the first device plays ultrasonic waves and the second device collects ultrasonic waves. If both the first device and the second device are tablets, but the first device is the initiator, the first device plays ultrasonic waves and the second device collects ultrasonic waves.
[0227] S609: The direction finding module of the first device reports the direction finding result to the keyboard and mouse service module of the first device.
[0228] After the direction finding module of the first device detects the first direction of the second device relative to the first device, the first direction is sent to the keyboard and mouse service module of the first device.
[0229] S610: The keyboard and mouse service module of the first device sends a keyboard and mouse crossing direction switching notification to the keyboard and mouse service module of the second device.
[0230] The keyboard and mouse traversal direction switching notification is used to notify the device to switch the keyboard and mouse traversal direction.
[0231] In some embodiments, after receiving the direction finding result sent by the direction finding module of the first device, the keyboard and mouse service module of the first device sends a keyboard and mouse crossing direction switching notification to the keyboard and mouse service module of the second device, and the keyboard and mouse crossing direction switching notification includes the direction finding result of the first device.
[0232] S611: The keyboard and mouse service module of the first device switches the keyboard and mouse traversal direction.
[0233] In some embodiments, the keyboard and mouse service module of the first device switches the keyboard and mouse traversal direction from the left direction to the right direction based on that the second device is on the right side of the first device.
[0234] S612: The keyboard and mouse service module of the second device switches the keyboard and mouse traversal direction.
[0235] In some embodiments, after receiving the keyboard and mouse crossing direction switching notification, the keyboard and mouse crossing direction of the second device is switched from the right direction to the left direction based on the first device being on the left side of the second device.
[0236] S613: The keyboard and mouse service module of the first device reports a device direction switching notification to the keyboard and mouse service module of the second device.
[0237] When the direction finding accuracy of the first device is higher than that of the second device, or the direction finding accuracy of the second device is equal to that of the second device and the second device is an initiator, the keyboard and mouse service module of the first device reports a device direction switching notification to the keyboard and mouse service module of the second device. The device direction switching notification is used to indicate the direction finding of the terminal device.
[0238] For example, the first device is a tablet computer and the second device is a laptop computer. In this case, the direction finding accuracy of the second device is higher than the direction finding accuracy of the second device, and the direction finding is performed by the second device.
[0239] For another example, both the first device and the second device are tablet computers, but the first device is not an initiator and the second device is an initiator. In this case, the second device performs direction finding.
[0240] S614: The keyboard and mouse service module of the second device sends a direction finding instruction to the direction finding module of the second device.
[0241] After receiving the device direction switching notification, the keyboard and mouse service module of the second device sends a direction finding instruction to the direction finding module of the second device to instruct the second device to find the direction.
[0242] S615: The direction finding module of the second device detects a second direction of the first device relative to the second device.
[0243] S616: The direction finding module of the second device reports the direction finding result to the keyboard and mouse service module of the second device.
[0244] S617: The keyboard and mouse service module of the second device sends a keyboard and mouse cross-switching notification to the keyboard and mouse service module of the first device.
[0245] S618: The keyboard and mouse service module of the first device switches the keyboard and mouse traversal direction.
[0246] S619: The keyboard and mouse service module of the second device switches the keyboard and mouse traversal direction.
[0247] The principles of steps S615 to S619 are substantially the same as those of the above steps S607 to S619, and will not be repeated here.
[0248] It should be noted that there is no order restriction between step S611 and step S612, and between step S618 and step S619.
[0249] In this embodiment, after the first device and the second device are connected, when the position of the first device changes, the device with higher direction finding accuracy can perform direction finding to improve the accuracy of the direction finding result. If the direction finding accuracy of the first device and the second device are consistent, the initiator can perform direction finding. That is to say, in the solution of this embodiment, only one device performs direction finding, and there will be no situation where both devices perform direction finding, so that the conflict of direction finding results can be avoided, thereby avoiding abnormality of the keyboard and mouse crossing function of the device.
[0250] In other variant embodiments, after the first device and the second device are connected, when the position of the second device changes, in the above step S602, the direction finding module of the first device may also determine that the position of the second device has changed, and then execute subsequent steps.
[0251] It is understandable that different software versions may cause some terminal devices to support the keyboard and mouse pass-through function, while some terminal devices do not support the keyboard and mouse pass-through function. In this case, problems such as connection abnormality and function abnormality may occur due to the difference in software versions. Therefore, the first device needs to check the software version before initiating a keyboard and mouse connection with the second device to avoid abnormalities caused by version differences.
[0252] Fig.17 The following figure shows an example of the process of checking the version before connecting the keyboard and mouse. Fig.17 , the version check includes the following steps:
[0253] S701, a device management module of a first device is started.
[0254] In some embodiments, the device management module of the first device may be automatically started after the first device is started.
[0255] S702: The device management module of the first device launches the keyboard and mouse service module of the first device.
[0256] After the device management module of the first device is started, the keyboard and mouse service module of the first device can be actively pulled up.
[0257] S703: The keyboard and mouse service module of the first device writes the keyboard and mouse service version information.
[0258] After the keyboard and mouse service module of the first device is started, the keyboard and mouse service version information of the first device, for example, the version number and version name of the keyboard and mouse service, can be written.
[0259] S704: The device management module of the second device is started.
[0260] S705: The device management module of the second device launches the keyboard and mouse service module of the second device.
[0261] S706: The keyboard and mouse service module of the second device writes the keyboard and mouse service version information of the second device.
[0262] The principles of steps S704 to S706 are substantially the same as those of the above steps S701 to S706 and will not be repeated here.
[0263] S707: The keyboard and mouse service module of the first device requests the device management module of the first device to read available devices.
[0264] In some embodiments, after the keyboard and mouse connection function of the first device is triggered, the keyboard and mouse service module of the first device requests the device management module of the first device to read available devices.
[0265] S708: The device management module of the first device reads available devices from the device management module of the second device.
[0266] After receiving the request from the keyboard and mouse service module of the first device, the device management module of the first device reads the information of the second device from the device management module of the second device to determine whether the second device is an available device.
[0267] S709: The device management module of the second device sends a notification message to the keyboard and mouse service module of the second device.
[0268] The notification message is used to notify the keyboard and mouse service module of the second device to send the keyboard and mouse service version information to the device management module of the first device.
[0269] S710: The keyboard and mouse service module of the second device sends keyboard and mouse service version information to the device management module of the first device.
[0270] After receiving the notification message sent by the device management module of the second device, the keyboard and mouse service module of the second device sends the keyboard and mouse service version information of the second device to the device management module of the first device.
[0271] S711: The device management module of the first device sends keyboard and mouse service version information to the keyboard and mouse service module of the first device.
[0272] After receiving the keyboard and mouse service version information sent by the keyboard and mouse service module of the second device, the device management module of the first device sends the keyboard and mouse service version information to the keyboard and mouse service module of the first device.
[0273] S712, the keyboard and mouse service module of the first device determines whether the keyboard and mouse service versions of the first device and the second device match. If yes, execute step S713; if no, do not initiate a keyboard and mouse connection.
[0274] After receiving the keyboard and mouse service version information of the second device, the keyboard and mouse service module of the first device determines whether the keyboard and mouse service of the first device matches the keyboard and mouse service of the second device based on the keyboard and mouse service version information of the first device and the keyboard and mouse service version information of the second device.
[0275] S713: The keyboard and mouse service module of the first device initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device.
[0276] When the keyboard and mouse service of the first device matches the keyboard and mouse service of the second device, the keyboard and mouse service module of the first device initiates a keyboard and mouse connection to the keyboard and mouse service module of the second device.
[0277] In this embodiment, before the first device connects to the second device, the first device can check the keyboard and mouse service version of the second device, and only when the keyboard and mouse service version of the second device matches the keyboard and mouse service version of the first device, the first device will initiate a keyboard and mouse connection to the second device. In this way, abnormal problems caused by version mismatch can be avoided.
[0278] Fig.18 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) connector 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0279] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0280] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and a subscriber identity module (SIM) interface.
[0281] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB connector 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0282] 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 supplies power to the processor 110, the internal memory 121, the display screen 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 number, battery health status (leakage, impedance), etc. 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.
[0283] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0284] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0285] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can receive electromagnetic waves through 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.
[0286] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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 set in the same device as the mobile communication module 150 or other functional modules.
[0287] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0288] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0289] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0290] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0291] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0292] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0293] 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. Among them, the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0294] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0295] The various embodiments disclosed in the present application may be implemented in hardware, software, firmware, or a combination of these implementation methods. The embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0296] Program code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a digital signal processor, a microcontroller, an application specific integrated circuit, or a microprocessor.
[0297] Program code can be implemented with high-level programming language or object-oriented programming language to communicate with the processing system. When necessary, program code can also be implemented with assembly language or machine language. In fact, the mechanism described in this application is not limited to the scope of any specific programming language. In either case, the language can be a compiled language or an interpreted language.
[0298] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, instructions may be distributed over a network or through other computer-readable media. Therefore, a machine-readable medium may include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including, but not limited to, a floppy disk, an optical disk, an optical disk, a magneto-optical disk, a read-only memory (ROM), a random access memory (RAM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic card or an optical card, a flash memory, or a tangible machine-readable memory for transmitting information (e.g., a carrier wave, an infrared signal, a digital signal, etc.) using the Internet in an electrical, optical, acoustic, or other form of propagation signal. Accordingly, machine-readable media include any type of machine-readable media suitable for storing or transmitting electronic instructions or information in a form readable by a machine (eg, a computer).
[0299] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0300] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0301] It should be noted that the units / modules mentioned in the various device embodiments of the present application are all logical units / modules. Physically, a logical unit / module can be a physical unit / module, or a part of a physical unit / module, or can be implemented as a combination of multiple physical units / modules. The physical implementation method of these logical units / modules themselves is not the most important. The combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed by the present application. In addition, in order to highlight the innovative part of the present application, the above-mentioned device embodiments of the present application do not introduce units / modules that are not closely related to solving the technical problems proposed by the present application, which does not mean that there are no other units / modules in the above-mentioned device embodiments.
[0302] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "including one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0303] Although the present application has been illustrated and described with reference to certain preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the scope of the present application.
Claims
1. A device control method, characterized in that: The method comprises: The first control device is connected to the first input device and displays a corresponding cursor of the first input device; The cursor moves from the first control device to a second control device for display, and the second control device establishes a binding relationship with the first input device; Determining that the first control device is disconnected from the first input device, the first control device sending a first message to the second control device; The second control device unbinds from the first input device in response to the first message.
2. The method according to claim 1, characterized in that The method further comprises: It is determined that the first control device is disconnected from the first input device, and the first control device is updated from a current first state to a second state, wherein the first state represents that the cursor moves out of the first control device, and the second state represents that the cursor does not move out of the first control device.
3. The method according to claim 1, characterized in that The method further comprises: In response to the first message, the second control device updates from a current third state to a fourth state, wherein the third state indicates that the cursor has moved into the second control device, and the fourth state indicates that the cursor has not moved into the second control device.
4. The method according to claim 1, characterized in that The method further comprises: Based on the unbinding of the second control device from the first input device, the second control device no longer displays the cursor of the first input device.
5. The method according to claim 1, characterized in that The method further comprises: Based on the unbinding of the second control device from the first input device, it is determined that the first control device is reconnected to the first input device, and the first control device redisplays the cursor of the first input device.
6. The method according to claim 1, characterized in that The cursor is moved from the first control device to the second control device for display, comprising: determining a first direction of the second control device relative to the first control device; The cursor moves out of the first control device along the first direction, and moves onto the second control device for display.
7. The method according to claim 6, characterized in that The determining a first direction of the second control device relative to the first control device comprises: In a case where the first control device is connected to the second control device for the first time, determining that the first control device is the device that initiates the connection with the second control device, the first control device detecting the first direction of the second control device relative to the first control device; In the case where the first control device is connected to the second control device and the position of the first control device or the second control device changes, a target device for detecting direction is determined from the first control device and the second control device, and the first direction is determined by the target device.
8. The method according to claim 7, characterized in that The step of determining a target device for detecting a direction from the first control device and the second control device includes: Determining a magnitude relationship between the accuracy of detecting directions of the first control device and the second control device; Based on the size relationship, the target device is determined.
9. The method according to claim 8, characterized in that The determining the magnitude relationship between the accuracy of the first control device and the second control device in detecting the direction includes: Determining device types of the first control device and the second control device; Based on the device type, a magnitude relationship between the accuracy of detecting directions of the first control device and the second control device is determined.
10. The method according to claim 8, characterized in that The step of determining the target device based on the size relationship includes: If the accuracy of the direction detected by the first control device is higher than the accuracy of the direction detected by the second control device, determining that the first control device is the target device; If the accuracy of the direction detected by the first control device is lower than the accuracy of the direction detected by the second control device, determining that the second control device is the target device; If the accuracy of the direction detected by the first control device is equal to the accuracy of the direction detected by the second control device, determining whether the first control device is the device that initiates the connection with the second control device; If yes, determining that the first control device is the target device; If not, it is determined that the second control device is the target device.
11. The method according to claim 7, characterized in that The target device determines the first direction, including: If the target device is the first control device, the first control device detects the first direction of the second control device relative to the first control device; If the target device is the second control device, the second control device detects a second direction of the first control device relative to the second control device, and determines that an opposite direction of the second direction is the first direction.
12. An electronic device, characterized in that: include: a memory for storing instructions executed by one or more processors of the electronic device; A processor, when the processor executes the instructions in the memory, can enable the electronic device to execute the device control method according to any one of claims 1 to 11.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the device control method according to any one of claims 1 to 11.
