Input event transmission method, electronic device and storage medium

By filtering swipe input events in the remote control system, the network channel blocking problem caused by frequent reporting of input events in the remote desktop service is solved, achieving lower network load and faster remote control response.

CN117692483BActive Publication Date: 2024-09-24HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311052240.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-18
Publication Date
2024-09-24
Estimated Expiration
2043-08-18

AI Technical Summary

Technical Problem

Frequent reporting and high reporting rate of input events in remote desktop services lead to network channel congestion, resulting in input event transmission delays and slow remote control response.

Method used

By filtering swipe input events on the control end, events are only sent to the controlled device when preset conditions (such as speed, direction, position, and time difference) are met, reducing unnecessary input event transmission.

Benefits of technology

The network channel load is reduced, the transmission delay of input events and the response time of remote control are reduced, and the response speed of remote control is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117692483B
    Figure CN117692483B
Patent Text Reader

Abstract

The present application provides an input event transmission method, electronic device and storage medium, which relates to the field of information technology and is applied to a control terminal, including: when the control terminal remotely controls a controlled device, obtaining a current swipe input event, wherein the current swipe input event includes at least one of the following information: current swipe speed, current swipe direction, current sampling time, and current sampling position; when the current swipe input event meets a preset filtering condition, filtering the current swipe input event; otherwise, sending the current swipe input event to the controlled device. The embodiments of the present application achieve the goal of reducing the load on a network channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information technology, and in particular to an input event transmission method, an electronic device and a storage medium. Background Art

[0002] Remote control refers to connecting a local device with an electronic device to be controlled by dialing up a computer network or connecting both parties to the same network, displaying the desktop environment of the controlled device on the local device, and controlling the remote device by operating the local device. For example, the remote desktop service in the Windows system (a computer operating system) can control devices equipped with the Windows system by operating the local device.

[0003] A common application scenario of remote desktop services is to control a PC (Personal Computer) device running Windows system through a mobile device running Android system (Android system, an operating system for mobile devices), such as Figure 1 As shown, a computer is remotely controlled using mobile devices such as tablet computers and mobile phones, and data streams including audio and video on the computer side are transmitted to the mobile device through a network channel, and displayed using remote desktop services. At the same time, remote desktop services are used to capture input events on the mobile device side to generate a control stream, which is transmitted to the computer side through a network channel to achieve control of the computer.

[0004] However, in the process of remote desktop service, input events are often reported frequently or at a high reporting rate, which causes channel congestion in the network channel with limited load, resulting in transmission delays of input events and abnormal situations such as slow remote control response. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an input event transmission method, an electronic device and a storage medium to reduce the load of a network channel. The specific technical solution is as follows:

[0006] In a first aspect, an input event transmission method is applied to a first terminal device, wherein the first terminal device is communicatively connected with a second terminal device; the method comprises:

[0007] In a first time period, in response to a stylus pen being swiped on the first terminal device, the first terminal device sends a first input event and a second input event to the second terminal device, no other input event is sent between the first input event and the second input event, in the first time period, a difference in sending time between the first input event and the second input event is a first time length, and a speed of the stylus pen swiping is a first speed;

[0008] In a second time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a third input event and a fourth input event to the second terminal device, no other input event is sent between the third input event and the fourth input event, and the sending time of the third input event and the fourth input event differ by a second time duration; the speed of the stylus pen sliding is a second speed, the first speed is less than the second speed, and the first time duration is greater than the second time duration;

[0009] In a third time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a fifth input event and a sixth input event to the second terminal device, no other input events are sent between the fifth input event and the sixth input event, the sending time of the fifth input event and the sixth input event differ by a third duration, and in the third time period, the stylus pen moves at a third speed, the third speed is less than the second speed, and the third duration is greater than the second duration.

[0010] In one embodiment of the present application, no other input events are collected between the first input event and the second input event; other input events are collected between the third input event and the fourth input event; and no other input events are collected between the fifth input event and the sixth input event.

[0011] In one embodiment of the present application, a first number of input events are collected between the first input event and the second input event; a second number of input events are collected between the third input event and the fourth input event; a third number of input events are collected between the fifth input event and the sixth input event; the second number is greater than the first number, and the second number is greater than the third number.

[0012] In one embodiment of the present application, the method further includes:

[0013] In a fourth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a seventh input event and an eighth input event to the second terminal device, no other input event is sent between the seventh input event and the eighth input event, the sending time of the seventh input event and the eighth input event differ by a fourth time length, and in the fourth time period, the trajectory of the stylus pen is a fourth trajectory;

[0014] In the fifth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a ninth input event and a tenth input event to the second terminal device, no other input events are sent between the ninth input event and the tenth input event, the sending time of the ninth input event and the tenth input event differ by a fifth time length, and in the fifth time period, the trajectory of the stylus pen is the fifth trajectory; the curvature of the fourth trajectory is less than that of the fifth trajectory, and the fourth time length is greater than the fifth time length.

[0015] In one embodiment of the present application, no other input events are collected between the seventh input event and the eighth input event; and other input events are collected between the ninth input event and the tenth input event.

[0016] In one embodiment of the present application, a fourth number of input events are collected between the seventh input event and the eighth input event; a fifth number of input events are collected between the ninth input event and the tenth input event; and the fifth number is greater than the fourth number.

[0017] In one embodiment of the present application, the first terminal device collects input events according to a preset sampling frequency.

[0018] In one embodiment of the present application, the method further includes:

[0019] In response to the stylus pen being swiped on the first terminal device, a first swiping input event is acquired, wherein the first swiping input event includes at least one of the following information: a first swiping speed, a first swiping direction, a first point sampling time, and a first point sampling position;

[0020] If the first swipe input event meets a preset filtering condition, the first swipe input event is filtered; otherwise, the first swipe input event is sent to the second terminal device.

[0021] In a possible implementation manner, the first swiping input event includes the first swiping speed, the first swiping direction and the first sampling point position;

[0022] The filtering the first swipe input event if the first swipe input event satisfies a preset filtering condition; otherwise, sending the first swipe input event to the second terminal device includes:

[0023] When the first stroking speed exceeds a preset speed threshold, obtaining a previous stroking direction and a previous sampling point position of a previous stroking input event sent to the second terminal device before the first stroking input event;

[0024] determining a first angle difference according to the first swiping direction and the previous swiping direction;

[0025] Determine a first distance according to the first sampling point position and the last sampling point position;

[0026] determining a first bending degree according to the first distance and the first angle difference;

[0027] When the first bending degree exceeds a preset bending degree threshold, the first swiping input event is sent to the second terminal device.

[0028] In one embodiment of the present application, when the first swipe input event satisfies a preset filtering condition, filtering the first swipe input event; otherwise, sending the first swipe input event to the second terminal device includes:

[0029] When the first bending degree does not exceed a preset bending degree threshold and the first distance does not exceed a preset distance threshold, filtering the first swiping input event;

[0030] When the first bending degree does not exceed a preset bending degree threshold and the first distance exceeds a preset distance threshold, the first swiping input event is sent to the second terminal device.

[0031] In one embodiment of the present application, the first swiping input event includes the first swiping speed and the first point sampling time;

[0032] The filtering the first swipe input event if the first swipe input event satisfies a preset filtering condition; otherwise, sending the first swipe input event to the second terminal device includes:

[0033] When the first stroking speed does not exceed a preset speed threshold, obtaining a last sampling time of a last stroking input event sent to the second terminal device;

[0034] If the time difference between the first sampling time and the last sampling time does not exceed a preset time difference threshold, filtering the swiping input event;

[0035] When the time difference between the first sampling time and the previous sampling time exceeds a preset time difference threshold, the first swiping input event is sent to the second terminal device.

[0036] In a possible implementation manner, the first terminal device remotely controls the second terminal device via a wide area network.

[0037] In a second aspect, an embodiment of the present application provides an input event transmission method, which is applied to a control end, and the method includes:

[0038] In the case where the control end remotely controls the controlled device, obtaining a current swiping input event, wherein the current swiping input event includes at least one of the following information: current swiping speed, current swiping direction, current sampling time, and current sampling position;

[0039] If the current swipe input event meets a preset filtering condition, the current swipe input event is filtered; otherwise, the current swipe input event is sent to the controlled device.

[0040] In one embodiment of the present application, the current swiping input event includes the current swiping speed, the current swiping direction and the current sampling point position;

[0041] If the current swipe input event meets a preset filtering condition, filtering the current swipe input event; otherwise, sending the current swipe input event to the controlled device, includes:

[0042] When the current swiping speed exceeds a preset speed threshold, obtaining the last swiping direction and the last sampling point position of the last swiping input event sent to the controlled device;

[0043] Determining a current angle difference according to the current swiping direction and the previous swiping direction;

[0044] Determine the current distance according to the current sampling point position and the previous sampling point position;

[0045] Determine a current bending degree according to the current distance and the current angle difference;

[0046] When the current bending degree exceeds a preset bending degree threshold, the current swiping input event is sent to the controlled device.

[0047] In one embodiment of the present application, when the current swipe input event satisfies a preset filtering condition, filtering the current swipe input event; otherwise, sending the current swipe input event to the controlled device includes:

[0048] When the current bending degree does not exceed a preset bending degree threshold and the current distance does not exceed a preset distance threshold, filtering the current swiping input event;

[0049] When the current bending degree does not exceed a preset bending degree threshold and the current distance exceeds a preset distance threshold, the current swiping input event is sent to the controlled device.

[0050] In one embodiment of the present application, the current swiping input event includes the current swiping speed and the current point sampling time;

[0051] If the current swipe input event meets a preset filtering condition, filtering the current swipe input event; otherwise, sending the current swipe input event to the controlled device, includes:

[0052] When the current stroking speed does not exceed a preset speed threshold, obtaining the last sampling time of the last stroking input event sent to the controlled device;

[0053] If the time difference between the current sampling time and the previous sampling time does not exceed a preset time difference threshold, filtering the swiping input event;

[0054] When the time difference between the current sampling time and the previous sampling time exceeds a preset time difference threshold, the current swiping input event is sent to the controlled device.

[0055] In one embodiment of the present application, the control terminal remotely controls the controlled device via a wide area network.

[0056] In a third aspect, an embodiment of the present application provides an input event transmission device, which is applied to a control end, and the device includes:

[0057] An event acquisition module, used for acquiring a current swipe input event when the control end remotely controls the controlled device, wherein the current swipe input event includes at least one of the following information: current swipe speed, current swipe direction, current sampling time, and current sampling position;

[0058] The event processing module is used to filter the current swipe input event if the current swipe input event meets a preset filtering condition; otherwise, send the current swipe input event to the controlled device.

[0059] In one embodiment of the present application, the current swiping input event includes the current swiping speed, the current swiping direction and the current sampling point position;

[0060] The event processing module is specifically used for:

[0061] When the current swiping speed exceeds a preset speed threshold, obtaining the last swiping direction and the last sampling point position of the last swiping input event sent to the controlled device;

[0062] Determining a current angle difference according to the current swiping direction and the previous swiping direction;

[0063] Determine the current distance according to the current sampling point position and the previous sampling point position;

[0064] Determine a current bending degree according to the current distance and the current angle difference;

[0065] When the current bending degree exceeds a preset bending degree threshold, the current swiping input event is sent to the controlled device.

[0066] In one embodiment of the present application, the event processing module is specifically used to:

[0067] When the current bending degree does not exceed a preset bending degree threshold and the current distance does not exceed a preset distance threshold, filtering the current swiping input event;

[0068] When the current bending degree does not exceed a preset bending degree threshold and the current distance exceeds a preset distance threshold, the current swiping input event is sent to the controlled device.

[0069] In one embodiment of the present application, the current swiping input event includes the current swiping speed and the current point sampling time;

[0070] The event processing module is specifically used for:

[0071] When the current stroking speed does not exceed a preset speed threshold, obtaining the last sampling time of the last stroking input event sent to the controlled device;

[0072] If the time difference between the current sampling time and the previous sampling time does not exceed a preset time difference threshold, filtering the swiping input event;

[0073] When the time difference between the current sampling time and the previous sampling time exceeds a preset time difference threshold, the current swiping input event is sent to the controlled device.

[0074] In one embodiment of the present application, the control terminal remotely controls the controlled device via a wide area network.

[0075] In a fourth aspect, an embodiment of the present application provides an electronic device, including:

[0076] Memory, used to store computer programs;

[0077] The processor is used to implement any of the above-mentioned input event transmission methods when executing the program stored in the memory.

[0078] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the input event transmission method described above is implemented.

[0079] Beneficial effects of the embodiments of the present application:

[0080] The input event transmission method provided in the embodiment of the present application is applied to the control end. When the control end remotely controls the controlled device, the current swipe input event of the control end is obtained. The obtained current swipe input event includes at least one of the current swipe speed, the current swipe direction, the current sampling time, the current sampling position, etc. Then, if the current swipe input event meets the preset filtering condition, the current swipe input event is filtered, otherwise the current swipe input event is sent to the controlled device, thereby achieving control of the controlled device. Filtering the current swipe input event that meets the preset filtering condition can reduce the number of swipe input events sent to the controlled device, thereby reducing the load of the network channel. BRIEF DESCRIPTION OF THE DRAWINGS

[0081] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0082] Figure 1 An example diagram of a remote control scenario provided in an embodiment of the present application;

[0083] Figure 2 A schematic diagram of a first structure of an electronic device provided in an embodiment of the present application;

[0084] Figure 3 A framework diagram of a software implementation of an electronic device provided in an embodiment of the present application;

[0085] Figure 4 A software structure block diagram of an electronic device in remote control provided in an embodiment of the present application;

[0086] Figure 5 A schematic diagram of inputting an input event using a stylus provided in an embodiment of the present application;

[0087] Figure 6 A signaling flow diagram of an input event transmission method provided in an embodiment of the present application;

[0088] Figure 7 A schematic diagram of a flow chart of an input event transmission method provided in an embodiment of the present application;

[0089] Figure 8 An example diagram for explaining a current distance and a current angle difference provided in an embodiment of the present application;

[0090] Fig. 9 A schematic diagram of an input event transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0091] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0092] In the remote control process of the related technology, swiping input events often have frequent reporting and a high reporting rate. Too many input events cause channel blockage in the network channel with limited load, thereby causing transmission delays of input events and abnormal situations such as slow remote control response. In order to solve this problem, the embodiments of the present application provide an input event transmission method, an electronic device and a storage medium.

[0093] The input event transmission method provided in the embodiment of the present application can be applied to any electronic device that has remote control capability, can serve as a control terminal in the remote control process, and can input swipe-type input events. The electronic device can be an electronic device with display hardware and corresponding software support. For example, the electronic device can be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a household device, and the like. The present application does not impose any restrictions on the specific type of the electronic device.

[0094] In a possible embodiment, in order to more clearly describe the electronic device provided by the embodiment of the present application, a possible application scenario of the electronic device provided by the embodiment of the present application is exemplarily described below. It can be understood that the following example is only a possible application scenario of the electronic device provided by the embodiment of the present application. In other possible embodiments, the electronic device provided by the embodiment of the present application can also be applied to other possible application scenarios, and the following example does not impose any limitation on this.

[0095] The input event transmission method provided in the embodiment of the present application is applicable to any near-field transmission scenario and far-field transmission scenario, such as a local area network remote control scenario, and a far-field transmission scenario such as a wide area network remote control scenario. Since the near-field transmission scenario is often a WLAN (wireless local area network) direct connection, the delay is relatively low, and there are few situations where too many input events lead to excessive load on the network channel, channel blocking, slow response to input events, etc., so the embodiment of the present application can be mainly applied to far-field transmission scenarios.

[0096] Common input events include swipe input events and click input events. Swipe input events are often implemented by stylus, touchpad, mouse, etc. For example, a stylus or finger swipes on a touchpad, a mouse swipe in mid-air, or dragging after pressing the left / right mouse button. Click input events are often implemented by clicking on input devices such as a touch screen or mouse. The input events captured by the remote desktop service per unit time are determined by the reporting rate of these input devices, that is, the number of input events captured by the remote desktop service is the same as the number of events reported by the input device. Since swipe input events often report frequently and the reporting rate is too high, channel congestion occurs in network channels with limited load, resulting in abnormal situations.

[0097] For example, the PC device is a controlled device, the mobile phone / tablet is an electronic device at the control end, the display interface in the PC device display is projected onto the mobile phone / tablet, and the PC device is controlled by inputting a swipe input event on the mobile phone / tablet, and the swipe input event is input by, for example, a stylus. Due to the high reporting rate of the stylus, there are too many input events, resulting in network channel congestion, input delay, and the PC device's response to the input event becomes slow.

[0098] It should be understood that the above is an example of a scenario and does not limit the scenario of the present application.

[0099] First, in a first aspect of an embodiment of the present application, an electronic device is provided, such as Figure 2 As shown, the electronic device 200 may include a processor 201 and a communication module 202 , etc.

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

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

[0102] The processor 201 may also be provided with a memory for storing instructions and data.

[0103] In some embodiments, the memory in the processor 201 is a cache memory. The memory can store instructions or data that have just been used or cyclically used by the processor 201. If the processor 201 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 201, and thus improves the efficiency of the system.

[0104] In some embodiments, the processor 201 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0105] The communication module 202 may be a modem and may be connected to an antenna.

[0106] like Figure 2 As shown, in some embodiments, the electronic device 200 may further include an external memory interface 205, an internal memory 204, a USB interface 206, a charging management module 207, a power management module 208, a battery 209, and a sensor module 203, etc.

[0107] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the electronic device 200 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0108] The charging management module 207 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.

[0109] In some wired charging embodiments, the charging management module 207 may receive charging input from a wired charger through the USB interface 206 .

[0110] In some wireless charging embodiments, the charging management module 207 may receive wireless charging input via a wireless charging coil of the electronic device 200. While the charging management module 207 is charging the battery 209, it may also provide power to the electronic device 200 via the power management module 208.

[0111] The power management module 208 is used to connect the battery 209, the charging management module 207 and the processor 201. The power management module 208 receives input from the battery 209 and / or the charging management module 207, and supplies power to the processor 201, the internal memory 204, the external memory, and the communication module 202. The power management module 208 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status (leakage, impedance).

[0112] In some other embodiments, the power management module 208 may also be disposed in the processor 201 .

[0113] In other embodiments, the power management module 208 and the charging management module 207 may also be disposed in the same device.

[0114] The external memory interface 205 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 200. The external memory card communicates with the processor 201 through the external memory interface 205 to implement a data storage function. For example, files such as music and video streams are stored in the external memory card.

[0115] The internal memory 204 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 201 executes various functional applications and data processing of the electronic device 200 by running the instructions stored in the internal memory 204. The internal memory 204 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 200 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 204 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0116] The sensor module 203 in the electronic device 200 may include image sensors, touch sensors, pressure sensors, gyroscope sensors, air pressure sensors, magnetic sensors, acceleration sensors, distance sensors, proximity light sensors, ambient light sensors, fingerprint sensors, temperature sensors, bone conduction sensors and other components to realize the sensing and / or acquisition functions of different signals.

[0117] Optionally, the electronic device 200 may further include peripheral devices, such as a mouse, buttons, indicator lights, a keyboard, a speaker, a microphone, etc.

[0118] The buttons include a power button, a volume button, etc. The buttons may be mechanical buttons or touch buttons. The electronic device 200 may receive button inputs and generate key signal inputs related to user settings and function controls of the electronic device 200.

[0119] The indicator may be a light indicator, which may be used to indicate the charging status and the change in the power level, and may also be used to indicate messages, missed calls, and notifications, etc.

[0120] It is understandable that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 200 .

[0121] In other embodiments, the electronic device 200 may include more or fewer components than shown, or combine some components, or separate some components, or arrange the components differently. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0122] In electronic devices, the software system can be divided into several layers, such as Figure 3 As shown, Figure 3A framework diagram of an electronic device provided for an embodiment of the present application includes a framework diagram of software implementation and a framework diagram of a hardware abstraction layer. The layered architecture divides the software system of the electronic device into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the electronic device application system of the control end can be divided into an application layer (application), a framework layer (framework, fwk), and a driver layer (hardware abstract layer, HAL).

[0123] The application layer can include a series of application packages, and the application layer runs applications by calling the application programming interface (API) provided by the application framework layer. An application package can include multiple applications, such as applications with remote control functions, input method applications, call applications, and map applications.

[0124] The framework layer provides API and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3 As shown, the application framework layer may include an input event distribution module (InputDispatcher) and an input event reading module (Input Reader), etc. In addition, the application framework layer may also include an input event service module (service), an input event trigger service module (trigger service), an input event indication module (linger), etc. The input event reading module is used to obtain the structured data reported by the input device driver and parse it to obtain the input event, and the input event distribution module sends the input event to the remote control application. It can be understood that the remote control application in this application refers to an application with remote control function, and the application may also have other functions, such as instant messaging, screen recording, etc., and does not specifically refer to an application that is only used for remote control.

[0125] The driver layer is a layer between hardware and software, used to drive the hardware to make it work. The driver layer can be installed with multiple drivers for driving the hardware to work. For example, input device driver (input trigger hal) (input device driver can include input device driver corresponding to stylus, input device driver corresponding to mouse, input device driver corresponding to touch screen, etc.), input event trigger driver (input trigger driver) and event input driver, etc.

[0126] In addition, the electronic device also includes a hardware abstraction layer, including hardware that can realize input, including the hardware of the electronic device itself, such as a touch screen, and also includes external devices of the electronic device, such as a stylus and a mouse. The hardware abstraction layer is connected to the driver layer and is used to report the data input by the input hardware to the driver layer.

[0127] During remote control, Figure 4 As shown, the electronic device is a control terminal device, and the control terminal device runs a remote control application. In the hardware abstraction layer, the user uses input hardware to input, and the input device driver of the driver layer generates corresponding structured data based on the input of the input hardware.

[0128] The input event reading module of the framework layer obtains the structured data driven by the input device. Specifically, the structured data may include the sampling time information, sampling location information, etc. It may also include the pressure information of the input hardware during input, the input event type (such as downward swipe information (down), upward swipe information (up), movement information (move)), etc. The input event reading module converts the obtained structured data into a swipe input event, and the input event reading module parses the swipe input event based on the structured data. The input event reading module sends the swipe input event to the input event distribution module, and the input event distribution module sends the swipe input event to the remote control application.

[0129] The input event acquisition module in the remote control application obtains the current swipe input event sent by the input event distribution module, and sends the current swipe input event to the input event filtering module. The input event filtering module is used to filter the swipe input event: if the current swipe input event meets the preset filtering conditions, filter the current swipe input event, otherwise transmit the current swipe input event to the network channel sending end. The network channel sending end sends the unfiltered swipe input event to the controlled device. The software system of the controlled device is divided into several layers, including at least an application layer, a system core layer, a hardware abstraction layer and a hardware interface layer. The application layer includes a preset application with a remote control function, and the preset application includes a network channel receiving module and an input event injection module. The system core layer includes multiple system processes and managers. The preset application calls the system process and manager in the system core layer, thereby calling the hardware abstract resources in the hardware abstraction layer through the system process and manager. The hardware abstract resources are connected to the hardware interface layer, thereby finally realizing the call of the opinion resource. In one example, the network channel receiving module of the controlled device calls the network card and other opinion resources of the controlled device to receive the input events of the control end, and finally acts on the hardware through the input event injection module to realize the control of the controlled device.

[0130] In one example, most mobile phones / tablets contain multiple processors. The operating system, user interface, and application programs are all executed on the Application Processor (AP), which generally uses an ARM chip CPU. The mobile phone / tablet RF communication control software runs on another separate CPU, which is called the Baseband Processor (BP). The AP includes a RIL (Radio Interface Layer) that provides an interface for communication between the AP's software system and wireless devices, and provides an abstract layer for wireless communication between the AP and BP, responsible for reliable data transmission, sending requests on the AP side, and parsing responses on the BP side. Modem is a type of BP, used to send and receive data. When the control-end electronic device is a mobile phone / tablet, the control-end device includes an AP side (exemplarily, it can include a Linux system or an Android system (two operating systems)) and a Modem side (modem). The AP includes the above-mentioned software system, and the Modem is used to connect the local area network (LAN) to the wide area network (WAN).

[0131] So, if Figure 4 As shown in , the network channel sending end uses a modem to send a swipe input event. The modem sends the current swipe input event through an antenna and transmits it to the controlled device via the network channel. The network channel receiving end is used to receive the current swipe input event sent by the modem, and transmit the current swipe input event to the input event injection module. The input event injection module sends the current swipe input event to the input device driver in the driver layer, so that the input device driver completes its input in the controlled device based on the current swipe input event. Exemplarily, the controlled device can be a Windows system device.

[0132] It should be noted that the above-mentioned application layer, application framework layer, driver layer and hardware device layer may also include other contents, which are not specifically limited here.

[0133] By applying the method of the embodiment of the present application, after obtaining the current swipe input event, the current swipe input event can be reported layer by layer, so that the preset application with remote control function can filter the current swipe input event according to preset filtering conditions after receiving it, and only transmit the current swipe input event that does not meet the preset filtering conditions, thereby minimizing the event transmission of the control end to the controlled device during the remote control process, reducing the load on the network channel, and reducing the possibility of channel blocking to the network channel, thereby reducing the probability of transmission delay of the input event, and minimizing the occurrence of abnormal situations such as slow remote control response.

[0134] The control terminal and the controlled device can establish a remote control connection through a wide area network. The way in which the control terminal and the controlled device establish a remote control connection can refer to the communication method in the prior art. In one example, a unique identifier of the controlled device can be input in the control terminal. The unique identifier can be an account name, ID or address of the controlled device, etc. The control terminal obtains the IP address (Internet Protocol Address) of the controlled device based on the unique identifier. In some examples, the unique identifier can be directly the IP address of the controlled device. Based on the IP address of the controlled device, the control terminal establishes a WebRTC (Web Real-Time Communications) with the controlled device, and uses the established WebRTC to transmit data streams and control streams, thereby realizing a remote control connection.

[0135] In one embodiment of the present application, Figure 6 As shown, a signaling flow diagram of an input event transmission method is provided. In the figure, a control terminal is a tablet computer, an input device is a touch screen obtained by a stylus, and a controlled device is a PC as an example.

[0136] Step S601: The touch screen obtains a swipe input event of the stylus pen and reports it to the stylus pen driver in the driver layer.

[0137] The input device driver of the control end may include a stylus driver, a touch screen driver, and a mouse driver. In one example, the touch screen includes an EMR (Electro Magnetic Resonance technology) sensor circuit that is inductively coupled with the stylus. The stylus may be an electromagnetic pen. The electromagnetic sensor circuit switches between the transmission mode and the reception mode continuously. In the transmission mode, the electromagnetic sensor circuit generates alternating current. At this time, the coil in the electromagnetic sensor circuit and the coil in the stylus (electromagnetic pen) work like the primary and secondary of a transformer, generating an alternating voltage at both ends of the stylus coil. This forms a resonant circuit with the capacitor of the stylus coil, and accumulates electrical energy through the LC oscillation circuit. At this time, the electromagnetic sensor circuit is in the transmission mode. After the resonance is stable, the electromagnetic sensor circuit stops generating current and switches the working mode from the transmission mode to the reception mode. After entering the reception mode, the stylus coil becomes the primary side, and the electromagnetic sensor circuit coil becomes the secondary side. At this time, the energy stored in the stylus will be sent out in the form of electromagnetic signals (RF radio frequency), and the electromagnetic sensor circuit can detect the signal sent by the stylus; the correct position of the stylus can be calculated by the signal strength received by the multiple antenna coils in the electromagnetic sensor circuit. The electromagnetic sensor circuit of the touch screen obtains the input events of the stylus input and reports them to the stylus driver. In addition, the control end device can also be connected to the input device of the peripheral, such as a mouse, and the input events generated by the mouse will be directly reported to the mouse driver.

[0138] The first circuit part in the touch screen obtains the sensing signal sent by the components of the stylus itself, and calculates the sensing signal to obtain the input event, including the coordinates of the sampling point location where the swiping input event occurs, the sampling point time when the swiping input event occurs, and the pressure sense when the swiping input event is input.

[0139] The first circuit part in the touch screen reports the sliding input event to the input device driver in the driver layer. The specific input device driver is the input driver corresponding to the touch screen.

[0140] Step S602: The stylus driver encapsulates the swipe input event to obtain structured data, and sends the encapsulated structured data to the framework layer.

[0141] The input device driver encapsulates the swipe input event based on the driver protocol to obtain structured data. The stylus driver writes the structured data to the specified file node, and the inputreader in the framework layer periodically checks the file node and reads the newly written structured data.

[0142] In an example, the structured data of a touch screen driver can be as follows:

[0143] [8958.771941] / dev / input / event10:EV_ABS ABS_MT_POSITION_X 0000031d

[0144] [8958.771941] / dev / input / event10:EV_ABS ABS_MT_POSITION_Y 000002ff

[0145] [8958.771941] / dev / input / event10:EV_MSC MSC_TIMESTAMP 0002ee00

[0146] [8958.771941] / dev / input / event10:EV_SYN SYN_REPORT 00000000 rate118

[0147] Among them, 8958.771941 is the sampling time information in the hardware input process, event10 is the identifier of the hardware device that triggers the input event, that is, event10 represents the input event of the touch screen input. EV_ABS_MT_POSITION_X represents the X-axis coordinate information of the sampling position of the hardware input, and 0000031d represents the specific value of the X-axis coordinate information; EV_ABS_MT_POSITION_Y represents the Y-axis coordinate information of the sampling position of the hardware input, and 000002ff represents the specific value of the Y-axis coordinate information. EV_MSC MSC_TIMESTAMP is the timestamp information (the timestamp of the triggering moment), and 0002ee00 is the specific value of the timestamp information. EV_SYN SYN_REPORT is a segmentation event marker used to segment different input events. 00000000 is the preset value, indicating that the current input event ends, and rate 118 represents the current sampling rate, corresponding to the time difference between the previous input event.

[0148] In an example, the structured data of a stylus driver can be as follows:

[0149] [8958.771941] / dev / input / event9:EV_ABS ABS_X 0000031d

[0150] [8958.771941] / dev / input / event9:EV_ABS ABS_Y 000002ff

[0151] [8958.771941] / dev / input / event9:EV_MSC MSC_TIMESTAMP 0002ee00

[0152] [8958.771941] / dev / input / event9:EV_SYN SYN_REPORT 00000000 rate118

[0153] Among them, 8958.771941 is the sampling time information in the hardware input process, and event9 is the identifier of the hardware device that triggers the input event, that is, event9 represents the input event of the stylus input. EV_ABS ABS_X represents the X-axis coordinate information of the sampling point position of the hardware input, and 0000031d represents the specific value of the X-axis coordinate information; EV_ABS ABS_Y represents the Y-axis coordinate information of the sampling point position of the hardware input, and 000002ff represents the specific value of the Y-axis coordinate information. In an example, the X-axis is the horizontal axis of the touch screen, and the Y-axis is the vertical axis of the touch screen. The process of stylus input on the touch screen is as follows: Figure 5 shown.

[0154] EV_MSC MSC_TIMESTAMP is the timestamp information (the timestamp of the trigger moment), and 0002ee00 is the specific value of the timestamp information. EV_SYN SYN_REPORT is the segmentation event marker, used to segment different input events, 00000000 is the preset value, indicating the end of the current input event, and rate 118 indicates the current sampling rate, corresponding to the time difference between the previous input event.

[0155] Step S603: the input framework in the framework layer parses the structured data reported by the stylus driver, generates a swipe input event, and distributes the swipe input event to the remote control application in the application layer.

[0156] After reading the structured data, InputReader can parse the structured data, that is, analyze the type of each data in the structured data and convert it into a swipe input event (essentially an object) that can be recognized by the system application (such as the Android system application). InputDispatcher distributes the swipe input event to the remote control application. In an example, the process of generating a swipe input event can be: InputReader analyzes the type of the Kth data in the structured data, determines that the data represents an X coordinate, extracts the coordinate value of the X coordinate, and fills the coordinate value into the position of the X coordinate value of the swipe input event that meets the Android system application specification; after completing the analysis and filling of each data in the structured data, a swipe input event is obtained.

[0157] It is understandable that the remote control application in this application refers to an application with remote control function, which may also have other functions, such as instant messaging, screen recording, etc., and does not specifically refer to an application that is only used for remote control. In one example, the input framework may include an input event distribution module (Input Dispatcher) and an input event reading module (Input Reader). The input event reading module is used to obtain structured data reported by the input device driver (including stylus distinction) and parse it to obtain input events. The input event distribution module distributes the input events to the remote control application.

[0158] Step S604: the remote control application calls the speed listener to determine the parameters of the swipe input event, and determines whether to filter based on the parameters of the swipe input event.

[0159] The speed listener is a native tool class in the system. By calling the speed listener, you can get the parameters of the swipe input event. The parameters of the swipe input event may include the swipe speed (including the X direction in the XY coordinates), the swipe direction (the Y direction in the XY coordinates), etc.

[0160] Determining whether a swipe input event is filtered is actually determining whether to send the swipe input event to the remote end. When determining whether a swipe input event needs to be filtered, based on the parameters of the swipe input event obtained above, combined with the sampling point location and sampling time of the swipe input event obtained above, it is determined whether the swipe input event meets the preset filtering condition. The preset filtering condition is pre-set, indicating that the swipe input event that meets the condition needs to be filtered and does not need to be sent further.

[0161] Step S605: When the swipe input event is not filtered, the swipe input event is sent to the Modem side.

[0162] If the preset filtering condition is not met, it is determined that the swipe input event is not filtered. If the preset filtering condition is met, it is determined that the swipe input event needs to be filtered, and the swipe input event that needs to be filtered can be discarded. It is understandable that the filtered (discarded) input event will not be sent to the controlled device.

[0163] The above input device driver, framework layer, and remote control application are all located on the AP side. When it is determined that the swipe input event does not need to be filtered and needs to be sent, the remote control application sends the swipe input event to the hardware abstraction layer, which is then sent to the modem side through the hardware interface. If the swipe input event meets the preset filtering conditions, it means that it does not need to be sent further, and the swipe input event is filtered out.

[0164] Step S606: The modem sends the swipe input event to the controlled device.

[0165] In one example, the controlled device may be a PC.

[0166] The following is an explanation of the filtering determination of the swipe input event. In one embodiment of the present application, Figure 7 As shown, a flow chart of an input event transmission method is provided. In this embodiment, the step of determining whether the input event is filtered is a specific step example of the above steps S604-S605.

[0167] MotionEvent is the current swipe input event; v is the current swipe speed, which can be obtained through the tracker in an example. Figure 6 In, it is obtained by calling the speed listener (class) function. α is the preset speed threshold, which is one of the preset filtering conditions used to determine whether the swipe input event is filtered. Δt is the current time difference, which refers to the time difference between the sampling time of the current swipe input event and the previous swipe input event. β is the preset time difference threshold, which is one of the preset filtering conditions used to determine whether the swipe input event is filtered. Δθ is the current angle difference, which refers to the angle difference between the swipe angle of the current swipe input event and the previous swipe input event. Δd is the current distance, which refers to the distance difference between the sampling point position of the current swipe input event and the previous swipe input event. is the current bending degree, that is, the angle difference per unit swipe distance between the current swipe input event and the previous swipe input event. γ is the preset bending degree threshold, and δ is the preset distance threshold, both of which are one of the preset filtering conditions for determining whether to filter the swipe input event.

[0168] The above-mentioned preset speed threshold, preset time difference threshold, preset curvature threshold and preset distance threshold are all preset constants, and specifically, they may be empirical values ​​or measured through actual experiments.

[0169] Step S701, obtaining a first motion input event (MotionEvent).

[0170] The first swipe input event may be a swipe input event acquired at any time. For example, the first swipe input event may be a swipe input event acquired at a certain historical time, or may be a swipe input event acquired at the current time.

[0171] Step S702, determining whether the first stroking speed of the first MotionEvent satisfies v>α, wherein if v>α, executing step S706, otherwise executing step S703.

[0172] When v>α, it indicates that the swiping speed is high and the sampling point is in a high-speed motion scene. If it is filtered out, it may cause the loss of events and affect the control of the controlled end, so further judgment is needed.

[0173] If the first stroking speed v of the first stroking event MotionEvent is less than or equal to α, it indicates that the stroking speed is relatively low and is in a low-speed scene, and the next step of judgment is performed.

[0174] Step S703, calculating the difference Δt between the collection time of the first MotionEvent and the last unfiltered MotionEven, and determining whether Δt>β is satisfied, wherein if Δt>β, executing step S705, otherwise executing step S704.

[0175] If Δt>β, it means that the time difference between the first swipe input event and the last unfiltered swipe input event of the first swipe input event is larger, the first swipe input event has actual input meaning, and the first swipe input event is sent to the controlled device;

[0176] If Δt≤β, it means that the time difference between the first swipe input event and the last unfiltered swipe input event is smaller, the first swipe input event has no actual input meaning, and the first swipe input event is filtered.

[0177] Step S704: filter the first MotionEvent.

[0178] Step S705: Send the first MotionEvent to the controlled device.

[0179] Step S706, calculate the difference in speed direction between the first MotionEvent and the last unfiltered MotionEven to obtain a first angle difference Δθ; calculate the distance between the sampling point position of the first MotionEvent and the last unfiltered MotionEven to obtain a first distance Δd; determine whether the condition is satisfied. Among them, if Then execute step 5, otherwise execute step 7.

[0180] like It indicates that the bending degree (bending degree) of the first swipe input event is greater than that of the previous swipe input event, the first swipe input event has actual input significance, and the first swipe input event is sent to the controlled device;

[0181] like It indicates that the bending degree of the first swipe input event is smaller than that of the previous swipe input event, and the next step of judgment is performed.

[0182] Step S707, determining whether Δd>δ is satisfied, wherein if Δd>δ, executing step S705, otherwise executing step S704.

[0183] If Δd>δ, it means that the distance of the first swipe input event is greater than that of the previous swipe input event, and the first swipe input event has actual input significance, and the first swipe input event is sent to the controlled device;

[0184] If Δd≤δ, it means that the distance of the first swipe input event is smaller than that of the previous swipe input event, the first swipe input event has no actual input meaning, and the first swipe input event is filtered.

[0185] Specifically, the first angle difference and the first distance are described in detail as follows: Figure 8 shown.

[0186] Wherein, v1, v2, v3, and v4 represent the stroking directions and stroking speeds of the first stroking input event, the second stroking input event, the third stroking input event, and the fourth stroking input event, respectively. Δθ1 is the angular difference in stroking direction between the first stroking input event and the second stroking input event, and Δθ2 is the angular difference in stroking direction between the third stroking input event and the fourth stroking input event; Δd1 is the distance between the sampling point positions of the first stroking input event and the second stroking input event, and Δd2 is the distance between the sampling point positions of the third stroking input event and the fourth stroking input event.

[0187] The embodiment of the present application also provides an input event transmission method, which is applied to a first terminal device, and the first terminal device is in communication connection with a second terminal device; the method includes:

[0188] In a first time period, in response to the stylus pen being swiped on the first terminal device, the first terminal device sends a first input event and a second input event to the second terminal device, no other input event is sent between the first input event and the second input event, in the first time period, the sending time of the first input event and the second input event differ by a first time length, and the speed of the stylus pen swiping is a first speed;

[0189] In a second time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a third input event and a fourth input event to the second terminal device, no other input event is sent between the third input event and the fourth input event, and the sending time of the third input event and the fourth input event differ by a second time duration; the speed of the stylus pen sliding is the second speed, the first speed is less than the second speed, and the first time duration is greater than the second time duration;

[0190] In the third time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a fifth input event and a sixth input event to the second terminal device, no other input events are sent between the fifth input event and the sixth input event, the sending time of the fifth input event and the sixth input event differ by a third duration, and in the third time period, the stylus pen moves at a third speed, the third speed is less than the second speed, and the third duration is greater than the second duration.

[0191] The first terminal device may be a control terminal device, the second terminal device may be a controlled terminal device, and the first terminal device and the second terminal device may communicate via a wide area network. In a first time period, a user controls a stylus to slide at a first speed on the first terminal device, the first terminal device sends a first input event and a second input event to the second terminal device at an interval of a first time length, and the first terminal device does not send other input events to the second terminal device between the first input event and the second input event.

[0192] In a possible implementation, an example is given in which the first terminal device is a tablet computer, the input device is a stylus, and the second terminal device is a Windows system PC. The tablet computer and the PC are connected through a wide area network based on a WebRTC (Web Real-Time Communications) channel to achieve remote communication between the tablet computer and the PC. Both the tablet computer and the PC run a remote control application to achieve remote control of the PC by the tablet computer. The tablet computer can collect input events according to a preset sampling frequency; the preset sampling frequency can be customized according to actual conditions, such as collecting 5, 10, 20 input events per second, etc.

[0193] In an example, during a first time period, the stylus is swiped on the tablet computer at a first speed, and the first speed is less than a preset speed threshold, that is, the stylus moves slowly, and a first input event is collected at a first moment, and the sampling time of the last unfiltered input event (the second moment) is obtained. The interval time difference between the first input event and the last input event is large, and has exceeded the preset time difference threshold (the first moment - the second moment > the preset time difference threshold), and the tablet computer sends the first input event to the PC. At a third moment, an input event is collected, and the sampling time (the first moment) of the last unfiltered swiping input event (the first input event) is obtained. The interval time difference between the currently collected input event and the first input event is small, and does not exceed the preset time difference threshold (the third moment - the first moment ≤ the preset time difference threshold), and the tablet computer filters the currently collected input event. At the fourth moment, the second input event is collected, and the collection time (first moment) of the last unfiltered input event (first input event) is obtained. The time difference between the second input event and the first input event is large and has exceeded the preset time difference threshold (fourth moment - first moment > preset time difference threshold). The tablet computer sends the second input event to the PC, and the sending time of the first input event and the second input event differs by a first time length. This corresponds to the logic of S701, S702, S703, S704, and S705 in the above embodiment.

[0194] In the second time period, the user controls the stylus to slide on the first terminal device at a second speed, and the first terminal device sends a third input event and a fourth input event to the second terminal device at an interval of a second time length, and the first terminal device does not send other input events to the second terminal device between the third input event and the fourth input event. From the above logic of sliding input event filtering, it can be seen that based on the first speed being less than the second speed, the input events filtered in the first time period are more than the input events filtered in the second time period, so the time interval between two adjacent input events sent in the first time period is greater than the time interval between two adjacent input events sent in the second time period, that is, the first time length is greater than the second time length.

[0195] In one example, during the second time period, the stylus is swiped on the tablet computer at a second speed, and the second speed is greater than the preset speed threshold, that is, the stylus moves faster. At the fifth moment, the third input event is collected, and the sampling point position of the third input event is (x1, y1). The sampling point position of the last unfiltered input event is obtained as (x2, y2). The distance between (x1, y1) and (x2, y2) is calculated to obtain the first distance. The first distance is greater than the preset distance threshold, and the tablet computer sends the third input event to the PC. At the sixth moment, the fourth input event is collected, and the sampling point position of the fourth input event is (x4, y4). The sampling point position of the last unfiltered swiping input event (the third input event) is obtained as (x1, y1). The distance between (x1, y1) and (x4, y4) is calculated to obtain the third distance. The third distance is greater than the preset distance threshold, and the tablet computer sends the fourth input event to the PC. This corresponds to the logic of S707 in the above embodiment.

[0196] In the third time period, the user controls the stylus to slide on the first terminal device at a third speed, and the first terminal device sends the fifth input event and the sixth input event to the second terminal device at a third time interval, and the first terminal device does not send other input events to the second terminal device between the fifth input event and the sixth input event. Because the third speed is less than the second speed, the input events filtered in the third time period are more than the input events filtered in the second time period, so the time interval between two adjacent input events sent in the third time period is greater than the time interval between two adjacent input events sent in the second time period, that is, the third time period is greater than the second time period.

[0197] In one example, during the third time period, the stylus is swiped on the tablet computer at a third speed, and the third speed is greater than the preset speed threshold, that is, the stylus moves faster. At the seventh moment, the fifth input event is collected, and the sampling point position of the fifth input event is (x5, y5). The sampling point position of the last unfiltered input event is obtained as (x6, y6). The distance between (x5, y5) and (x6, y6) is calculated to obtain a fourth distance. The fourth distance is greater than the preset distance threshold, and the tablet computer sends the fifth input event to the PC. At the eighth moment, an input event is collected, and the sampling point position of the input event is (x7, y7). The sampling point position of the last unfiltered input event (fifth input event) is obtained as (x5, y5). The distance between (x5, y5) and (x7, y7) is calculated to obtain a fifth distance. The fifth distance is less than the preset distance threshold, and the tablet computer filters out the input event. At the ninth moment, the sixth input event is collected, and the sampling point position of the sixth input event is (x8, y8). The sampling point position of the last unfiltered swipe input event (fifth input event) is obtained as (x5, y5). The distance between (x5, y5) and (x8, y8) is calculated to obtain the sixth distance. The sixth distance is greater than the preset distance threshold, and the tablet computer sends the sixth input event to the PC. This corresponds to the logic of S707 in the above embodiment.

[0198] It can be understood that, in this embodiment, the filtering relationship between the sliding speed of the stylus pen and the input event is illustrated, and the curvature of the first trajectory (the trajectory of the stylus pen in the first time period) and the second trajectory (the trajectory of the stylus pen in the second time period) are not considered. It can be considered that the curvature of the two is the same or approximately the same.

[0199] In a possible implementation, the above method further includes:

[0200] In a fourth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a seventh input event and an eighth input event to the second terminal device, no other input event is sent between the seventh input event and the eighth input event, the sending time of the seventh input event and the eighth input event differ by a fourth time period, and in the fourth time period, the trajectory of the stylus pen is a fourth trajectory;

[0201] In the fifth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends the ninth input event and the tenth input event to the second terminal device, no other input events are sent between the ninth input event and the tenth input event, the sending time of the ninth input event and the tenth input event differ by a fifth time length, and in the fifth time period, the trajectory of the stylus pen is the fifth trajectory; the curvature of the fourth trajectory is less than that of the fifth trajectory, and the fourth time length is greater than the fifth time length.

[0202] In the fourth time period, the user controls the stylus to slide along a fourth trajectory on the first terminal device, and the first terminal device sends the seventh input event and the eighth input event to the second terminal device at an interval of a fourth time length, and the first terminal device does not send other input events to the second terminal device between the seventh input event and the eighth input event.

[0203] In a possible implementation, an example is given in which the first terminal device is a tablet computer, the input device is a stylus, and the second terminal device is a Windows system PC. The tablet computer and the PC are connected through a wide area network based on a WebRTC (Web Real-Time Communications) channel to achieve remote communication between the tablet computer and the PC. Both the tablet computer and the PC run a remote control application to achieve remote control of the PC by the tablet computer. The tablet computer can collect input events according to a preset sampling frequency; the preset sampling frequency can be customized according to actual conditions, such as collecting 5, 10, 20 input events per second, etc.

[0204] In one example, the stylus is swiped on the tablet computer at a fourth speed during a fourth time period, and the fourth speed is greater than a preset speed threshold, that is, the stylus moves faster. The seventh input event is collected at the tenth moment, at which time the angle between the stylus's movement direction and the preset direction is θ1, and the sampling point position of the seventh input event is (x9, y9). The angle θ2 between the movement direction of the last unfiltered input event and the preset direction is obtained, and the sampling point position is (x10, y10). The distance between (x10, y10) and (x9, y9) is calculated to obtain the seventh distance, the angle between θ1 and θ2 is calculated to obtain the first angle difference, and the ratio of the first angle difference to the seventh distance is calculated to obtain the first bending degree; the first bending degree is greater than the preset bending degree threshold, that is, the bending degree of the seventh input event is greater than that of the last unfiltered input event, and the tablet computer sends the seventh input event to the PC.

[0205] At the eleventh moment, an input event is collected. At this time, the angle between the movement direction of the stylus and the preset direction is θ3. The sampling point position of the input event is (x11, y11). The angle between the movement direction of the last unfiltered input event (the seventh input event) and the preset direction is θ1, and the sampling point position is (x9, y9). The distance between (x11, y11) and (x9, y9) is calculated to obtain the eighth distance. The angle between θ1 and θ3 is calculated to obtain the second angle difference. The ratio of the second angle difference to the eighth distance is calculated to obtain the second bending degree. The second bending degree is ≤ the preset bending degree threshold, that is, the bending degree of the input event is smaller than that of the seventh input event, and the tablet computer filters out the input event.

[0206] At the twelfth moment, the eighth input event is collected. At this time, the angle between the movement direction of the stylus and the preset direction is θ4, and the sampling point position of the eighth input event is (x12, y12). The angle between the movement direction of the last unfiltered input event (the seventh input event) and the preset direction is θ1, and the sampling point position is (x9, y9). The distance between (x12, y12) and (x9, y9) is calculated to obtain the ninth distance, the angle between θ1 and θ4 is calculated to obtain the third angle difference, and the ratio of the third angle difference to the ninth distance is calculated to obtain the third bending degree; the third bending degree is greater than the preset bending degree threshold, that is, the bending degree of the eighth input event is greater than that of the seventh input event, and the tablet computer sends the eighth input event to the PC. This corresponds to the logic of S706 in the above embodiment.

[0207] In the fifth time period, the user controls the stylus to slide on the first terminal device along the fifth trajectory, and the first terminal device sends the ninth input event and the tenth input event to the second terminal device at an interval of the fifth time length, and the first terminal device does not send other input events to the second terminal device between the ninth input event and the tenth input event. From the above logic of sliding input event filtering, it can be seen that the input events filtered in the fourth time period are more than the input events filtered in the fifth time period because the curvature of the fourth trajectory is less than that of the fifth trajectory; therefore, the time interval between two adjacent input events sent in the fourth time period is greater than the time interval between two adjacent input events sent in the fifth time period, that is, the fourth time length is greater than the fifth time length.

[0208] In one example, the stylus is swiped on the tablet computer at a fifth speed during the fifth time period, and the fifth speed is greater than the preset speed threshold, that is, the stylus moves faster. At the thirteenth moment, the ninth input event is collected, and the angle between the movement direction of the stylus and the preset direction is θ5. The sampling point position of the ninth input event is (x13, y13). The angle θ6 between the movement direction of the last unfiltered input event and the preset direction is obtained, and the sampling point position is (x14, y14). The distance between (x13, y13) and (x14, y14) is calculated to obtain the tenth distance, the angle between θ6 and θ5 is calculated to obtain the fourth angle difference, and the ratio of the fourth angle difference to the tenth distance is calculated to obtain the fourth bending degree; the fourth bending degree is greater than the preset bending degree threshold, that is, the bending degree of the ninth input event is greater than that of the last unfiltered input event, and the tablet computer sends the ninth input event to the PC.

[0209] At the fourteenth moment, the tenth input event is collected. At this time, the angle between the movement direction of the stylus and the preset direction is θ7, and the sampling point position of the tenth input event is (x15, y15). The angle between the movement direction of the last unfiltered input event (the ninth input event) and the preset direction is θ5, and the sampling point position is (x13, y13). The distance between (x13, y13) and (x15, y15) is calculated to obtain the eleventh distance, the angle between θ7 and θ5 is calculated to obtain the fifth angle difference, and the ratio of the fifth angle difference to the eleventh distance is calculated to obtain the fifth bending degree; the fifth bending degree is greater than the preset bending degree threshold, that is, the bending degree of the tenth input event is greater than that of the ninth input event, and the tablet computer sends the tenth input event to the PC. This corresponds to the logic of S706 in the above embodiment.

[0210] It is understandable that, in this embodiment, the purpose is to illustrate the filtering relationship between the curvature of the stylus track and the input event, and the sliding speed is not considered. It can be considered that the sliding speed of the stylus in the fourth time period is the same or approximately the same as that in the fifth time period.

[0211] In an embodiment of the present application, by judging the current stroking speed of the current stroking event input by the control end, when the current stroking speed exceeds the preset speed threshold, it means that the current stroking event is in a high-speed scenario. At this time, the current bending degree of the current stroking event and the previous stroking input event sent to the controlled device for the last time is considered. When the current bending degree exceeds the preset bending degree threshold, it is considered that the bending degree is large, and the current stroking event does not meet the filtering condition and has actual input significance. The current stroking event is sent to the controlled device so that the controlled device can realize input. When the current bending degree does not exceed the preset bending degree threshold in the high-speed scenario, the current distance between the current sampling point position of the current stroking event and the previous sampling point position of the previous stroking input event is considered. When the current distance exceeds the preset distance threshold, it is also considered that the current stroking event does not meet the filtering condition and has actual input significance. The current stroking event is sent to the controlled device so that the controlled device can realize input.

[0212] When the current swipe speed does not exceed the preset speed threshold, it means that the current swipe event is in a low-speed scenario. At this time, only the current time difference between the current sampling time of the current swipe event and the previous sampling time of the previous swipe input event is considered. When the current time difference exceeds the preset time difference threshold, it is also considered that the current swipe event does not meet the filtering conditions and has actual input significance. The current swipe event is sent to the controlled device so that the controlled device can realize input. Except for the above situation, the current swipe event is considered to meet the filtering conditions and has no actual input significance, so it is filtered.

[0213] In this way, the main factors affecting the swiping accuracy during the swiping process can be grasped, and the event transmission from the control end to the controlled device during the remote control process can be reduced as much as possible while ensuring the swiping effect, thereby reducing the load on the network channel and the possibility of channel blockage in the network channel, thereby reducing the probability of transmission delay of input events and minimizing the occurrence of abnormal situations such as slow remote control response.

[0214] In one embodiment of the present application, in actual application, log verification can be added to the above input event transmission method, and for input devices with a high reporting rate (such as a stylus), most input events can be filtered in normal input scenarios. (Exemplarily, 60% of input events can be filtered).

[0215] Log verification can be performed by capturing the reporting data of the input device obtained by the control end device and the reporting data obtained by the controlled device. For example, the reporting data may include the sampling location coordinates and sampling time of the swipe input event. Specifically, when the control end device is an Android system device, the reporting data of the swipe input event reported by the input device driver in the driver layer can be captured through the adb (Android Debug Bridge) tool; when the controlled device is a Windows system device, the reporting data of the swipe input event received by the network channel receiving end can be captured through the Windows api (Windows system function) by writing a proprietary application.

[0216] In one embodiment of the present application, Fig. 9 As shown, an input event transmission device is also provided, which is applied to a control end, and the device includes:

[0217] The event acquisition module 901 is used to acquire the current swipe input event when the control end remotely controls the controlled device, wherein the current swipe input event includes at least one of the following information: current swipe speed, current swipe direction, current sampling time, and current sampling position;

[0218] The event processing module 902 is used to filter the current swipe input event if the current swipe input event meets a preset filtering condition; otherwise, send the current swipe input event to the controlled device.

[0219] The input event transmission device provided in the embodiment of the present application is applied to the control end. When the control end remotely controls the controlled device, the current swipe input event of the control end is obtained. The obtained current swipe input event includes at least one of the current swipe speed, the current swipe direction, the current sampling time, the current sampling position, etc. Then, if the current swipe input event meets the preset filtering condition, the current swipe input event is filtered, otherwise the current swipe input event is sent to the controlled device, thereby achieving control of the controlled device. Filtering the current swipe input event that meets the preset filtering condition can reduce the number of swipe input events sent to the controlled device, thereby reducing the load of the network channel.

[0220] In one embodiment of the present application, the current swiping input event includes the current swiping speed, the current swiping direction and the current sampling point position;

[0221] The event processing module 902 is specifically used for:

[0222] When the current swiping speed exceeds a preset speed threshold, obtaining the last swiping direction and the last sampling point position of the last swiping input event sent to the controlled device;

[0223] Determining a current angle difference according to the current swiping direction and the previous swiping direction;

[0224] Determine the current distance according to the current sampling point position and the previous sampling point position;

[0225] Determine a current bending degree according to the current distance and the current angle difference;

[0226] When the current bending degree exceeds a preset bending degree threshold, the current swiping input event is sent to the controlled device.

[0227] In one embodiment of the present application, the event processing module 902 is specifically used to:

[0228] When the current bending degree does not exceed a preset bending degree threshold and the current distance does not exceed a preset distance threshold, filtering the current swiping input event;

[0229] When the current bending degree does not exceed a preset bending degree threshold and the current distance exceeds a preset distance threshold, the current swiping input event is sent to the controlled device.

[0230] In one embodiment of the present application, the current swiping input event includes the current swiping speed and the current point sampling time;

[0231] The event processing module 902 is specifically used for:

[0232] When the current stroking speed does not exceed a preset speed threshold, obtaining the last sampling time of the last stroking input event sent to the controlled device;

[0233] If the time difference between the current sampling time and the previous sampling time does not exceed a preset time difference threshold, filtering the swiping input event;

[0234] When the time difference between the current sampling time and the previous sampling time exceeds a preset time difference threshold, the current swiping input event is sent to the controlled device.

[0235] In one embodiment of the present application, the control terminal remotely controls the controlled device via a wide area network.

[0236] The input event transmission device provided in the embodiment of the present application can grasp the main factors that affect the swiping accuracy during the swiping process, and minimize the event transmission of the control end to the controlled device during the remote control process while ensuring the swiping effect, thereby reducing the load on the network channel and the possibility of channel blocking to the network channel, thereby reducing the probability of transmission delay of the input event and minimizing the occurrence of abnormal situations such as slow remote control response.

[0237] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned voice input methods are implemented.

[0238] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the voice input methods in the above embodiments.

[0239] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0240] It should be noted that, in this article, 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 "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0241] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and electronic device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0242] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. An input event transmission method, characterized in that: Applied to a first terminal device, the first terminal device is communicatively connected with a second terminal device; The method comprises: In a first time period, in response to a stylus pen being swiped on the first terminal device, the first terminal device sends a first input event and a second input event to the second terminal device, no other input event is sent between the first input event and the second input event, in the first time period, a difference in sending time between the first input event and the second input event is a first time length, and a speed of the stylus pen swiping is a first speed; In a second time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a third input event and a fourth input event to the second terminal device, no other input event is sent between the third input event and the fourth input event, and the sending time of the third input event and the fourth input event differ by a second time length; the speed of the stylus pen stroke is a second speed, the first speed is less than the second speed, based on the first speed being less than the second speed, the time interval between two input events sent adjacently in the first time period is greater than the time interval between two input events sent adjacently in the second time period, and the first time length is greater than the second time length; In a third time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a fifth input event and a sixth input event to the second terminal device, no other input events are sent between the fifth input event and the sixth input event, the sending time of the fifth input event and the sixth input event differ by a third time length, and in the third time period, the stylus pen moves at a third speed, which is less than the second speed, based on the third speed being less than the second speed, the time interval between two adjacent input events sent in the third time period is greater than the time interval between two adjacent input events sent in the second time period, and the third time length is greater than the second time length.

2. The method according to claim 1, characterized in that The method further comprises: In a fourth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a seventh input event and an eighth input event to the second terminal device, no other input event is sent between the seventh input event and the eighth input event, the sending time of the seventh input event and the eighth input event differ by a fourth time length, and in the fourth time period, the trajectory of the stylus pen is a fourth trajectory; In the fifth time period, in response to the stylus pen sliding on the first terminal device, the first terminal device sends a ninth input event and a tenth input event to the second terminal device, no other input events are sent between the ninth input event and the tenth input event, the sending time of the ninth input event and the tenth input event differ by a fifth time length, and in the fifth time period, the trajectory of the stylus pen is the fifth trajectory; the curvature of the fourth trajectory is less than that of the fifth trajectory, and the fourth time length is greater than the fifth time length.

3. The method according to claim 1, characterized in that The method further comprises: In response to the stylus pen being swiped on the first terminal device, a first swiping input event is acquired, wherein the first swiping input event includes at least one of the following information: a first swiping speed, a first swiping direction, a first point sampling time, and a first point sampling position; If the first swipe input event meets a preset filtering condition, the first swipe input event is not sent to the second terminal device; otherwise, the first swipe input event is sent to the second terminal device.

4. The method according to claim 3, characterized in that The first swiping input event includes the first swiping speed, the first swiping direction and the first sampling point position; if the first swiping input event meets a preset filtering condition, not sending the first swiping input event to the second terminal device; Otherwise, sending the first swiping input event to the second terminal device includes: When the first stroking speed exceeds a preset speed threshold, obtaining a previous stroking direction and a previous sampling point position of a previous stroking input event sent to the second terminal device before the first stroking input event; determining a first angle difference according to the first swiping direction and the previous swiping direction; Determine a first distance according to the first sampling point position and the last sampling point position; determining a first bending degree according to the first distance and the first angle difference; When the first bending degree exceeds a preset bending degree threshold, the first swiping input event is sent to the second terminal device.

5. The method according to claim 4, characterized in that if the first swiping input event meets a preset filtering condition, not sending the first swiping input event to the second terminal device; Otherwise, sending the first swiping input event to the second terminal device includes: When the first bending degree does not exceed a preset bending degree threshold and the first distance does not exceed a preset distance threshold, not sending the first swiping input event to the second terminal device; When the first bending degree does not exceed a preset bending degree threshold and the first distance exceeds a preset distance threshold, the first swiping input event is sent to the second terminal device.

6. The method according to claim 3, characterized in that The first swiping input event includes the first swiping speed and the first point sampling time; if the first swiping input event meets a preset filtering condition, not sending the first swiping input event to the second terminal device; Otherwise, sending the first swiping input event to the second terminal device includes: When the first stroking speed does not exceed a preset speed threshold, obtaining a last sampling time of a last stroking input event sent to the second terminal device; If the time difference between the first sampling time and the previous sampling time does not exceed a preset time difference threshold, not sending the swiping input event to the second terminal device; When the time difference between the first sampling time and the previous sampling time exceeds a preset time difference threshold, the first swiping input event is sent to the second terminal device.

7. The method according to claim 1, characterized in that The first terminal device remotely controls the second terminal device via a wide area network.

8. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.

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