Touch panel coordinate data reporting method, device, and storage medium
By filtering and controlling the timestamps of data transmission signals to filter touchscreen coordinate data, the problem of high power consumption in electronic devices during swiping operations is solved, improving device performance and user experience.
Patent Information
- Application Number
- PCT/CN2025/093928
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-06-25
- Filing Date
- 2025-05-09
- Publication Date
- 2026-01-02
AI Technical Summary
In swiping scenarios, the high power consumption of electronic devices causes them to remain in a high-power state, even becoming "hot to the touch," which affects the user experience.
By filtering the coordinate data collected by the touch screen based on the timestamp of the data transmission signal sent by the target application in the swipe operation scenario, and stopping the data transmission signal when the input event is UP, resampling processing is reduced and the power consumption of electronic devices is lowered.
This reduces the need for resampling multiple coordinate data points in the target application, improving the performance of electronic devices, reducing power consumption, and enhancing the user experience.
Smart Images

Figure CN2025093928_02012026_PF_FP_ABST
Abstract
Description
Touch screen coordinate data reporting method and device, and storage medium
[0001] The present application claims priority from a Chinese patent application No. 202410836398.6 filed on June 25, 2024, and entitled "Touch screen coordinate data reporting method and device, and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the field of mobile phones, and in particular to a touch screen coordinate data reporting method, device and storage medium. BACKGROUND
[0003] With the update iteration of electronic devices, users can now interact with electronic devices by inputting touch operations to the touch screen of the electronic device. The touch sensor in the touch screen (TP) receives the touch operation input by the user, and the touch sensor can trigger the touch screen driver to scan and obtain the touch parameters generated by the touch operation. The number of times of scanning by the touch screen driver in a unit time can be referred to as the TP sampling rate. Generally, the higher the TP sampling rate, the better the hand-following performance of the TP.
[0004] In some sliding operation scenarios, the electronic device continuously obtains touch parameters, and performs coordinate calculation and data reporting for each touch parameter, which can cause the device to be in a high power consumption state continuously, and even cause the electronic device to have a "hot hand" phenomenon during use. Therefore, how to reduce the power consumption of the electronic device in the sliding operation scenario is a problem to be solved. SUMMARY
[0005] Embodiments of the present application provide a touch screen coordinate data reporting method, device and storage medium, which aims to solve the problem of how to reduce the power consumption of the electronic device in the sliding operation scenario and improve the user experience.
[0006] In a first aspect, an embodiment of the present application provides a touch screen coordinate data reporting method. The method comprises: displaying a first interface of a first application; in response to a sliding operation acting on the first interface, obtaining an input event corresponding to the sliding operation; collecting each frame of sliding data corresponding to the sliding operation based on a preset touch screen sampling rate, and performing coordinate calculation on each frame of the sliding data to obtain coordinate data corresponding to each frame of the sliding data, and a first timestamp corresponding to each of the coordinate data; obtaining a data transmission signal, the data transmission signal corresponding to a second timestamp, the data transmission signal being a signal for instructing the coordinate data to be reported to the first application, the signal being issued by the first application based on the input event; and sending the coordinate data corresponding to the first timestamp matching the second timestamp to the first application, so that the first application updates the first interface.
[0007] It can be understood that the preset touch screen sampling rate is greater than the refresh rate of the first application, so that the sliding data collected by the touch screen in the sliding scenario is greater than the data required by the first application to update the interface, thereby causing the first application to need to perform resampling processing on the redundant data without processing the redundant sliding data, which consumes the performance of the electronic device and additionally increases the power consumption of the electronic device.
[0008] For example, the preset touch screen sampling rate is 120Hz, and the refresh rate of the first application is 60Hz.
[0009] It can be understood that the input event includes a DOWN event, an UP event, and a non-DOWN / UP event (corresponding to the MOVE event in the preceding paragraph).
[0010] For example, the data transmission signal corresponds to a tpVSync signal in each of the following embodiments.
[0011] Therefore, in the sliding scenario, the multiple coordinate data collected by the touch screen are filtered according to the timestamp of the data transmission signal sent by the target application, and the filtered coordinate data are sent to the target application, thereby reducing the step of resampling the multiple coordinate data by the target application, improving the performance of the electronic device, reducing the power consumption of the electronic device, and further improving the user experience.
[0012] According to the first aspect, the method further comprises, in the case that the input event is an UP event, the first application stops sending the data transmission signal.
[0013] For example, in the case that the input event is an UP event, it means that the current sliding scenario ends, and the first application does not need to obtain coordinate data any more, so the first application stops sending the data transmission signal to the daemon process.
[0014] According to the first aspect, or any one of the implementations of the first aspect, the method further includes, in a case that the input event is a DOWN event, sending a plurality of the coordinate data to the first application before the data transmission signal is acquired.
[0015] For example, in a case that the input event is a DOWN event, which represents the beginning of the current sliding scenario, at this time being the first frame of picture drawing, in order to balance the response and timeliness of the first frame of picture, the daemon actively reports a plurality of coordinate data to the first application before the first data transmission signal is received.
[0016] According to the first aspect, or any one of the implementations of the first aspect, the sending of the coordinate data corresponding to the first timestamp matching the second timestamp to the first application includes: comparing the second timestamp with a current system time; in a case that a comparison result is less than or equal to a preset timeout threshold, determining that the receiving of the data transmission signal is not overtime, matching the second timestamp with the first timestamp of each coordinate data, and sending the coordinate data corresponding to the first timestamp matching the second timestamp to the first application.
[0017] For example, in general, the daemon receives the signal within 2-3 milliseconds. If the data transmission signal is not received after the time period, it means that the time is up; otherwise, the time is not up.
[0018] It can be understood that, in a case that the data transmission signal is not overtime, the timestamp of the data transmission signal can be aligned with the timestamp of the coordinate data, and thus the coordinate data with the same timestamp as the timestamp of the data transmission signal can be directly sent to the first application.
[0019] According to the first aspect, or any one of the implementations of the first aspect, the method further includes, in a case that the comparison result is greater than the preset timeout threshold, determining that the receiving of the data transmission signal is overtime, and sending the coordinate data corresponding to the first timestamp with the smallest difference from the second timestamp to the first application.
[0020] It can be understood that, in a case that the data transmission signal is overtime, since the timestamp of the data transmission signal cannot be aligned with the timestamp of the coordinate data, the coordinate data with the smallest time interval from the timestamp of the data transmission signal needs to be sent to the first application.
[0021] According to the first aspect, or any one of the implementations of the first aspect, the method further includes: obtaining a package name of the first application, determining whether the first application is a game application based on the package name; and in a case where the first application is not a game application, performing the step of sending the coordinate data corresponding to the first timestamp matching the second timestamp to the first application.
[0022] According to the first aspect, or any one of the implementations of the first aspect, the method further includes: in a case where the first application is a game application, sending each of the coordinate data to the first application.
[0023] It can be understood that in some game scenes of instant battle games, a user wants to sacrifice device power consumption to obtain better hand tracking performance. Therefore, when such an application is running, the first application obtains more coordinate data by not sending a data transmission signal to the daemon process.
[0024] According to the first aspect, or any one of the implementations of the first aspect, the obtaining of the data transmission signal includes: in a case where a vertical synchronization signal request is received, obtaining the data transmission signal; and wherein the vertical synchronization signal request is a request generated by the first application after receiving the input event.
[0025] It can be understood that after the first application receives the input event, the first application sends a vertical synchronization signal request to the SF thread, and sends the data transmission signal to the SF thread, so that the SF thread forwards the data transmission signal in a cross-thread communication manner.
[0026] Exemplarily, the cross-thread communication manner includes a file node writing manner, a Soket manner, and the like.
[0027] Exemplarily, after the first application sends the vertical synchronization signal request to the SF thread, the SF thread generates a VSync_APP signal and returns the VSync_APP signal to the first application.
[0028] According to the first aspect, or any one of the implementations of the first aspect, the preset screen sampling rate is greater than a refresh rate of the first application.
[0029] According to the first aspect, or any one of the implementations of the first aspect, in a case where the first application enters an idle state, the first application stops sending the data transmission signal.
[0030] In a second aspect, an electronic device is provided. The electronic device includes a memory and a processor coupled to the memory; the memory stores program instructions which, when executed by the processor, cause the electronic device to perform the method of the first aspect or any possible implementation of the first aspect.
[0031] In a third aspect, a computer readable medium is provided for storing a computer program, the computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
[0032] In a fourth aspect, a computer program is provided, the computer program comprising instructions for performing the method of the first aspect or any possible implementation of the first aspect.
[0033] In a fifth aspect, a chip is provided, the chip comprising a processing circuit, a receiving pin and a sending pin. The receiving pin and the processing circuit communicate with each other through an internal connection path, and the processing circuit executes the method of the first aspect or any possible implementation of the first aspect to control the receiving pin to receive a signal and control the sending pin to send a signal. BRIEF DESCRIPTION OF DRAWINGS
[0034] FIG. 1 is a schematic diagram of a hardware structure of an electronic device;
[0035] FIG. 2 is a schematic diagram of a software structure of an electronic device;
[0036] FIGS. 3a and 3b are schematic diagrams of a game scene;
[0037] FIGS. 4a and 4b are schematic diagrams of a video live broadcast scene;
[0038] FIG. 5 is a schematic diagram of module interaction;
[0039] FIG. 6 is a schematic diagram of frame data processing before optimization;
[0040] FIG. 7 is a first interface of an electronic device power consumption optimization application;
[0041] FIGS. 8a and 8b are a second interface of an electronic device power consumption optimization application;
[0042] FIG. 9 is a schematic diagram of module interaction;
[0043] FIG. 10 is a schematic diagram of a touch screen coordinate data reporting method;
[0044] FIG. 11 is a schematic diagram of frame data processing after optimization. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0046] The term "and / or" in the present application is only used to describe the association relationship of the associated objects, and means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone.
[0047] The terms "first" and "second" and the like in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of the objects. For example, the first target object and the second target object are used to distinguish different target objects, rather than to describe a specific order of the target objects.
[0048] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Rather, the use of the words "exemplary" or "for example" is intended to present relevant concepts in a concrete manner.
[0049] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "a plurality of" is two or more. For example, a plurality of processing units means two or more processing units; a plurality of systems means two or more systems.
[0050] In order to better understand the technical solutions provided by the embodiments of the present application, before the technical solutions of the embodiments of the present application are described, first, the hardware structure of the mobile phone (such as a mobile phone, a tablet computer, a touchable PC, etc.) applicable to the embodiments of the present application is described with reference to the drawings. For ease of description, FIG. 1 takes a mobile phone as an example for description.
[0051] Referring to FIG. 1, the mobile phone 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0052] For example, in some implementations, the sensor module 180 can include a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc., which are not listed one by one here, and the present application does not limit this.
[0053] Specifically, in the technical solutions provided in the embodiments of the present application, the sensor module 180 can include a pressure sensor and a touch sensor. In this way, during use of the mobile phone, when the user operates the display screen 194, such as single-click, double-click, sliding, non-hand sliding, the current operation and the position of the operation, the report point information of the position, etc. can be accurately determined based on the pressure sensor and the touch sensor.
[0054] In order to better understand the working principle of each sensor described above, the following is a specific description:
[0055] The pressure sensor is configured to sense a pressure signal and convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor can be disposed on the display 194. There are many types of pressure sensors, such as a resistive pressure sensor, an inductive pressure sensor, a capacitive pressure sensor, etc. The capacitive pressure sensor can include at least two parallel plates made of conductive material. When a force is applied to the pressure sensor, the capacitance between the electrodes changes. The phone 100 determines the intensity of the pressure according to the change in capacitance. When a touch operation is applied to the display 194, the phone 100 detects the intensity of the touch operation according to the pressure sensor. The phone 100 can also calculate the position of the touch according to the detection signal of the pressure sensor. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity less than a first pressure threshold is applied to the short message application icon, an instruction to view short messages is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold is applied to the short message application icon, an instruction to create a new short message is executed.
[0056] The touch sensor, also referred to as a "touch panel". The touch sensor can be disposed on the display 194, and the touch sensor and the display 194 form a touch screen, also referred to as a "touch screen". The touch sensor is configured to detect a touch operation applied to or near the touch sensor. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event, which can include, for example, a sliding, clicking, long pressing, etc. Visual output related to the touch operation can be provided through the display 194. In other embodiments, the touch sensor can also be disposed on the surface of the phone 100, which is different from the position of the display 194. In the technical solutions provided in the embodiments of the present application, when a user touches or taps the touch screen, the touch sensor monitors the user's operation behavior, and the phone 100 receives data collected by the touch sensor in the touch screen and responds to the operation behavior, such as executing the determination of the user's sliding operation on the screen in the technical solutions provided in the embodiments of the present application.
[0057] In order to better understand the technical solutions provided in the embodiments of the present application, the data processing flow in the operation process of the non-hand-off sliding operation is described in detail. For specific details of the touch screen sampling data reporting method for the non-hand-off sliding operation, see the following text, which will not be described here.
[0058] It should be noted that the so-called non-hand-off sliding refers to the behavior of moving the finger or stylus on the display within an application to change the content displayed in the current interface.
[0059] Further, it is to be noted that the processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.
[0060] Further, it is to be noted that the processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated in one or more processors.
[0061] With reference back to FIG. 1, the charging management module 140 is configured to receive charging input from a charger. The power management module 141 is configured to connect the battery 142 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160, etc. The power management module 141 can also be configured to monitor parameters such as battery capacity, battery cycle count, battery health (leakage, impedance), etc.
[0062] With reference back to FIG. 1, the wireless communication function of the mobile phone 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, and a baseband processor, etc. It is to be noted that the antenna 1 and the antenna 2 are configured to transmit and receive electromagnetic wave signals.
[0063] Continuing to refer to FIG. 1, by way of example, the mobile communication module 150 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the phone 100. The mobile communication module 150 can include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transmit the processed signals to the modem processor for demodulation. The mobile communication module 150 can also amplify the signals modulated by the modem processor, and radiate the signals as electromagnetic waves by the antenna 1. In some implementations, at least part of the functions of the mobile communication module 150 can be provided in the processor 110. In some implementations, at least part of the functions of the mobile communication module 150 can be provided in the same device as at least part of the modules of the processor 110.
[0064] Further, it is noted that the modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs an audio signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some implementations, the modem processor can be a separate device. In other implementations, the modem processor can be independent of the processor 110, and provided in the same device as the mobile communication module 150 or other functional modules.
[0065] Continuing to refer to FIG. 1, the exemplary wireless communication module 160 can provide solutions for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive signals to be sent from the processor 110, frequency modulate them, amplify them, and convert them into electromagnetic wave radiation via the antenna 2.
[0066] Further, it is also necessary to note that the phone 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0067] Continuing to refer to FIG. 1, the exemplary display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some implementations, the phone 100 can include 1 or N display screens 194, where N is a positive integer greater than 1.
[0068] Further, it is also necessary to note that the phone 100 can implement the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor, etc.
[0069] Continuing to refer to FIG. 1, the exemplary external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the phone 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage functions. For example, music, video, etc. files are saved in the external memory card.
[0070] Continuing to refer to FIG. 1, the internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 executes various functional applications and data processing of the mobile phone 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a functional application (such as a sound playing function, an image playing function, etc.), etc. The data storage area can store data (such as audio data, a phone book, etc.) created during the use of the mobile phone 100, etc. In addition, the internal memory 121 can include a high-speed random access memory and can also include a non-volatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications of the mobile phone and the touch screen coordinate data reporting method provided by the present application by running the instructions stored in the internal memory 121 and / or the instructions stored in the memory disposed in the processor 110.
[0071] In addition, it should be noted that the mobile phone 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, the application processor, etc. For example, music playing, recording, etc.
[0072] Continuing to refer to FIG. 1, the keys 190 include a power-on key, a volume key, etc. The keys 190 can be mechanical keys. Alternatively, the keys 190 can be touch keys. The mobile phone 100 can receive key inputs to generate key signal inputs related to the user settings and the function control of the mobile phone 100. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light which can be used to indicate a charging state, a power change, and can also be used to indicate a message, a missed call, a notification, etc.
[0073] As to the hardware structure of the mobile phone 100, it should be understood that the mobile phone 100 shown in FIG. 1 is only an example. In a specific implementation, the mobile phone 100 can have more or fewer components than those shown in the figure, can combine two or more components, or can have a different component configuration. The various components shown in FIG. 1 can be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and / or application specific integrated circuits.
[0074] In order to better understand the software structure of the mobile phone 100 shown in FIG. 1, the software structure of the mobile phone 100 is described below. Before the software structure of the mobile phone 100 is described, the architecture that can be used by the software system of the mobile phone 100 is first described.
[0075] Specifically, in actual applications, the software system of the mobile phone 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
[0076] In addition, it can be understood that the software system currently used by mainstream terminal devices includes but is not limited to a Windows system, an Android system, and an iOS system. For ease of illustration, an Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the mobile phone 100.
[0077] In addition, the subsequent touch screen coordinate data reporting scheme provided by the embodiments of the present application is also applicable to other systems in specific implementation.
[0078] Referring to FIG. 2, a software structure block diagram of the mobile phone 100 according to an embodiment of the present application is shown.
[0079] As shown in FIG. 2, the layered architecture of the mobile phone 100 divides the software into several layers, each of which has a clear role and division of labor. The layers communicate with each other through software interfaces. In some implementations, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Android runtime and a system library, and a kernel layer.
[0080] The application layer can include a series of application packages. As shown in FIG. 2, the application packages can include gallery, settings, SMS, email, browser, video, and other applications, which are not listed one by one here, and the present application does not limit this.
[0081] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications of the application layer. In some implementations, these programming interfaces and programming frameworks can be described as functions / services / frameworks, etc.
[0082] In addition, it should be noted that the application framework layer can be divided into a system service framework layer (usually referred to as the Framework layer, which is implemented based on the Java language) and a native service framework layer (usually referred to as the native layer, which is implemented based on the C or C++ language) based on the implementation language of the programming interfaces and programming frameworks it manages.
[0083] Continuing to refer to FIG. 2, exemplarily, the Framework layer can include a window manager, an input manager, a content provider, a view system, an activity manager, etc., which are not listed one by one here, and the present application does not limit this.
[0084] The window manager is used for managing window programs. The window manager can acquire a display screen size, determine whether there is a status bar, lock a screen, etc. In the technical solution provided in the present application, the window manager is further used for determining a focus window, acquiring a focus window layer, and corresponding application package name information, etc.
[0085] The input manager (InputManagerService) is used for managing programs of input devices. For example, the input manager can determine mouse click operations, keyboard input operations, and non-hand-off sliding operations, etc. In the technical solution provided in the present application, the input manager is mainly used for determining non-hand-off sliding operations.
[0086] The content provider is used for storing and acquiring data, and enabling the data to be accessed by application programs. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phone books, etc. which are not listed one by one here, and the present application does not limit this.
[0087] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used for constructing application programs. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.
[0088] The activity manager is used for managing life cycles of various application programs and navigation back functions. The activity manager is responsible for creating a main thread of Android, and maintaining life cycles of various application programs.
[0089] Continuing to refer to FIG. 2, the native layer can include an input reader, an input dispatcher, an image composition system, etc. which are not listed one by one here, and the present application does not limit this.
[0090] It should be noted that during use of the electronic device, the display screen will call an event listening port / function (EventHub) once every several milliseconds according to a set period. If an operation made by a user on the display screen, such as a non-hand-off sliding operation (which can be regarded as an event), is listened to, the event will be reported to the input reader (InputReader). That is, the InputReader is used for reading events from the EventHub, or directly receiving events reported by the EventHub.
[0091] In addition, after obtaining the events, the InputReader will send the events to the input dispatcher (InputDispatcher).
[0092] Wherein, the InputDispatcher will distribute the event to the corresponding application (hereinafter referred to as: application) through the input manager after getting the event sent by the InputReader.
[0093] Wherein, the image synthesis system, i.e. surface flinger (hereinafter referred to as SF thread) is used to control image synthesis and generate Vetical Synchronization (VSync) signal.
[0094] It can be understood that the SF thread includes: synthesis thread, VSync thread, and cache thread (such as quene buffer). Wherein, the synthesis thread is used to be woken up by the VSync signal for synthesis; the VSync thread is used to generate the next VSync signal according to the VSync signal request; there is one or more cache queues in the cache thread, and each cache queue is used to store the cache data of the corresponding application, such as the image data rendered according to the data frame.
[0095] Wherein, the Android Runtime includes core library and virtual machine. The Android Runtime is responsible for the scheduling and management of the Android system.
[0096] The core library contains two parts: one part is the function function required to be called by the java language, and the other part is the core library of the Android.
[0097] The system library can include multiple functional modules. For example: image rendering library, image synthesis library, input processing library, media library, etc.
[0098] Wherein, the image rendering library is used for rendering two-dimensional or three-dimensional images; the image synthesis library is used for synthesizing two-dimensional or three-dimensional images.
[0099] In a possible implementation manner, the application draws and renders the image through the image rendering library, and then the application sends the drawn and rendered image to the cache queue of the SF thread. Whenever the VSync signal arrives, the SF thread obtains a frame of image to be synthesized from the cache queue in order, and then performs image synthesis through the image synthesis library.
[0100] Wherein, the input processing library is used for processing the input device library, which can realize mouse, keyboard, and non-hand sliding input processing.
[0101] Wherein, the media library supports multiple commonly used audio, video format playback and recording, and static image files. The media library can support multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0102] In addition, it can be understood that the kernel layer in the Android system is a layer between hardware and software. The kernel layer at least includes a sensor driver, a display driver, an audio driver, a Bluetooth driver, a GPS driver, and the like.
[0103] As to the software structure of the mobile phone 100, it can be understood that the layers in the software structure shown in FIG. 2 and the components included in each layer do not constitute a specific limitation on the mobile phone 100. In other embodiments of the present application, the mobile phone 100 can include more or fewer layers than shown in the figure, and each layer can include more or fewer components, which are not limited in the present application.
[0104] For the convenience of understanding, exemplary descriptions of some concepts related to the embodiments of the present application are given for reference.
[0105] 1, frame: refers to the smallest unit of interface display, a single picture. A frame can be understood as a still picture, and fast and continuous display of multiple connected frames can form an illusion of object movement.
[0106] 2, frame rate: refers to the number of frames refreshed in 1 second, which can also be understood as the number of times the graphics processor in the electronic device refreshes the picture per second. A high frame rate can obtain smoother and more realistic animation. The more frames per second, the smoother the displayed motion will be.
[0107] It should be noted that the interface display frame usually needs to go through processes such as drawing, rendering, and composition.
[0108] 3, frame drawing: refers to the drawing of the picture of the display interface. The display interface can be composed of one or more views, and each view can be drawn by a visual control of the view system. Each view is composed of sub-views, and one sub-view corresponds to one widget in the view, for example, one sub-view corresponds to one symbol in the picture view.
[0109] 4, frame rendering: refers to coloring operation or adding 3D effects to the drawn view. For example, 3D effects can be light effects, shadow effects, and texture effects, etc.
[0110] 5, frame composition: refers to the process of combining one or more rendered views into a display interface.
[0111] 6, vertical synchronization (VSync) signal: a signal used to control the start of processes such as frame drawing, rendering, composition, and display.
[0112] It should be noted that, in order to ensure the smoothness of display, avoid display stuttering and other phenomena, the electronic device generally displays based on the VSync signal to synchronize the processes of image drawing, rendering, synthesis and screen refresh display.
[0113] It can be understood that the VSync signal is a periodic signal, and the VSync signal period can be set according to the screen refresh rate. For example, when the screen refresh rate is 60Hz, the VSync signal period can be 16.6ms, that is, the electronic device generates a control signal to trigger the VSync signal period every 16.6ms. For another example, when the screen refresh rate is 90Hz, the VSync signal period can be 11.1ms, that is, the phone generates a control signal to trigger the VSync signal period every 11.1ms.
[0114] In addition, it should be noted that the VSync signal includes software VSync (VSync-APP or VSync-SF) and hardware VSync (VSync-HW). Among them, VSync-APP is used to trigger the drawing and rendering process; VSync-SF is used to trigger the synthesis process. The hardware VSync signal (VSync-HW) is used to trigger the screen display refresh process. Generally, software VSync and hardware VSync keep periodic synchronization. Taking 60Hz and 120Hz changes as an example, if VSync-HW switches from 60Hz to 120Hz, VSync-APP and VSync-SF change from 60Hz to 120Hz synchronously.
[0115] 7, the touch sampling rate refers to the speed at which the screen collects the touch of the finger on the screen. For example, when the sampling rate is 240Hz, it means that the screen collects 240 signal samples per second.
[0116] 8, the touch report point rate refers to the number of times the screen's touch panel scans per second, and then removes noise and false positive points through touch chip algorithm to obtain the remaining touch sampling signal.
[0117] It can be understood that the difference between the above-mentioned touch sampling rate and the touch report point rate is that the touch sampling rate focuses on the speed at which the screen collects the touch of the finger, while the touch report point rate focuses on how to remove noise and false positive points through algorithm when processing these signals to improve the accuracy and sensitivity of touch. Therefore, although both of them affect the touch performance of the screen, their mechanisms and optimization targets are different.
[0118] In addition, it should be noted that the touch sampling rate is not the higher the better, because high sampling rate will bring higher power consumption and higher requirements for the network. The optimization of the touch report point rate helps to improve the touch sensitivity of the screen and reduce the risk of false positive point break caused by noise interference.
[0119] The following example illustrates the workflow of the mobile phone 100 software and hardware, using scenarios such as application startup or interface switching within the application.
[0120] For example, when the touch sensor in the touch panel receives a touch operation, the kernel layer processes the touch operation into a raw input event (including touch coordinates, touch pressure, touch operation timestamp, etc.). EventHub listens to this raw input event and stores it in the kernel layer. InputReader reads the raw input event from the kernel layer through the input processing library and passes it to InputDispatcher. InputDispatcher packages the raw input event, such as encapsulating it into a set data format, and determines the application corresponding to the raw input event. Then, it reports the raw input event to the input manager. The input manager parses the information of the raw input event (including: operation type and reporting position, etc.) and determines the focus application based on the current focus, that is, the application corresponding to the raw input event, and sends the parsed information to the focus application.
[0121] Understandably, focus can be the point of touch in a touch operation or the click location in a stylus or mouse click operation. The focus application is the application running in the foreground of the electronic device or the application corresponding to the touch location in a touch operation. The focus application determines the control corresponding to the original input event based on the parsed information of the original input event (e.g., the reported location).
[0122] Taking a hands-free swipe operation as an example, where the corresponding control is a list control from a third-party application, the focused application uses the view system to call the image rendering library in the system library to draw and render the image. The focused application sends the drawn and rendered image to the cache queue of the SF thread. The image compositing library in the system library then composites the drawn and rendered image into the focused application's interface. The SF thread, through the kernel-level display driver, causes the display screen to show the corresponding interface of the focused application.
[0123] The application scenarios to which the technical solutions provided in this application are applicable will be described below with reference to the accompanying drawings. For example, Figures 3a, 3b, 4a, and 4b show schematic diagrams of the interface of an electronic device in different applications in possible implementations.
[0124] For example, as shown in interface 10a in Figure 3a (1), the user enters the chess game by clicking the "Chess Battle" icon in interface 10a, and the game interface shown in interface 10b in Figure 3a (2) is displayed.
[0125] In the game interface 10b, the user needs to slide the chess piece in the interface to play against the opponent. For example, the user clicks the chess piece "Cannon" in the interface 10b and continuously slides in the direction indicated by the arrow in the interface 10b, so as to slide the chess piece "Cannon" to the middle of the chessboard, as shown in the game interface of the interface 10c in (3) of FIG. 3b.
[0126] For example, as shown in the interface 20a in (1) of FIG. 4a, the user enters the video live software interface by clicking the "video live" picture in the interface 20a, and a video interface as shown in the interface 20b in (2) of FIG. 4a is displayed. In the video interface 20b, the user can slide in the direction indicated by the arrow in the interface 20b, so as to switch the content in the video live software interface until the content that the user likes is switched to.
[0127] Meanwhile, in the video live software interface, the user can also click the "live" button in the interface 20b to enter the live room, as shown in the live interface in the interface 20c in (3) of FIG. 4b. In the live room, the user can continuously send gifts to the host by pressing the "gift" button provided by the software, and the sent gifts are displayed in the lower right corner of the interface 20c in the form of bubbles.
[0128] It can be understood that in FIGS. 3a, 3b, 4a and 4b, the user interacts with the electronic device by upward sliding operation or downward sliding operation and long pressing the screen. When the electronic device receives the operation made by the user, the electronic device performs frame drawing, rendering, synthesis and the like based on the operation, and finally sends the synthesized picture to be displayed, so that the content displayed on the display screen changes with the movement of the user's finger on the display screen, that is, the content of the current interface is updated following the movement of the finger.
[0129] It should be understood that before the electronic device performs frame drawing, the touch screen driver also needs to collect data of the user's touch operation, calculate coordinates based on the collected data, and send the calculated coordinates to the focus application for drawing and display through Input processing.
[0130] However, when the refresh rate of the focus application is lower than the touch reporting rate of the electronic device, the focus application does not need all the coordinate points collected and calculated by the electronic device, and for the redundant coordinate points, the focus application also needs to perform resampling calculation and respond to events based on the coordinate points calculated by the resampling. The above-mentioned resampling calculation process undoubtedly increases the performance consumption and power consumption of the electronic device, thereby reducing the use time of the battery of the electronic device, and even causing the electronic device to continuously heat.
[0131] The data processing flow involved in the interface display of the focus application responding to the user sliding operation in the electronic device and the processing flow of the data frame in the data processing process will be described below in combination with FIG. 5 and FIG. 6.
[0132] For example, in the chess scene shown in interface 10b in FIG. 3a (2), the scene is described in combination with the data processing flow shown in FIG. 5. The focus application (i.e., the chess application) sends a VSync signal request to the SF thread. After receiving the VSync signal request, the SF thread sends a VSync_APP signal to the focus application. The user performs sliding on the touch screen. The touch screen driver (TP Driver) collects the sliding data of the user based on the interrupt request (Irq-tp) triggered by the electronic device and sends the collected sliding data to the daemon process through the receiving module (AfeHal). The daemon process sends the collected sliding data to the TSA algorithm module for coordinate calculation. The TSA algorithm module sends the calculated coordinate data to the batch queue (Batch Queue) through the daemon process, the receiving module, the touch screen driver and the Input subsystem in sequence. Since the refresh rate of the focus application is lower than the touch report rate of the electronic device, the above-mentioned coordinate data is accumulated in the batch queue until the focus application obtains the coordinate data in the batch queue based on the VSync_APP signal. Since there are multiple coordinate data in the batch queue, the focus application needs to recalculate the final coordinate data based on the multiple coordinate data in the batch queue.
[0133] Based on the above premise, referring to FIG. 6, for example, frame 1 to frame 5 are the sliding data collected by the touch screen driver based on the interrupt request triggered by the electronic device. It can be understood that the amount of data in the above-mentioned sliding data in the same time period is controlled by the touch sampling rate of the electronic device. In the electronic device with high sampling rate, the amount of sliding data per unit time can be more data frames.
[0134] Continuing to refer to FIG. 6, for example, the daemon process sends the collected sliding data frame 1 to the TSA algorithm module for coordinate calculation to obtain coordinate data frame 1. Since each coordinate data report needs to pass through the Input subsystem, the input event coordinate data frame 1 is sent to the batch queue. The focus application performs image rendering based on the coordinate data frame 1. The Choreographer sends the rendered frame 1 image data to the cache thread of the SF thread. The cache thread caches the frame 1 image data to the cache queue corresponding to the focus application. Correspondingly, when the corresponding composition time point is reached, the composition thread takes out the frame 1 image data from the cache queue for composition. After the composition is completed, the electronic device can display the content corresponding to frame 1 on the display screen by calling the display driver of the kernel layer.
[0135] Continuing to refer to FIG. 6, the daemon sends the collected sliding data frame 2 to the TSA algorithm module for coordinate calculation to obtain a coordinate data frame 2. Since each coordinate data report needs to pass through the Input subsystem, the input event coordinate data frame 2 is sent to the batch processing queue. However, since the refresh rate of the focus application is lower than the sampling rate of the touch screen, after the coordinate data frame 2 is sent to the batch processing queue, the focus application does not process it in time, and at this time, the sliding data frame 3 is calculated to obtain a coordinate data frame 3 which is also sent to the batch processing queue. At this time, the focus application obtains the coordinate data frames in the batch processing queue and finds that there are two coordinate data frames (coordinate data frame 2 and coordinate data frame 3) in the batch processing queue. Therefore, the focus application also needs to perform resampling calculation (such as directly discarding the coordinate data frame 2) on the two frames of data, perform image rendering based on the coordinate data frame (coordinate data frame 3) obtained by resampling, and finally send the frame 3 image data obtained by rendering to the display.
[0136] It should be noted that in FIG. 6, the frame data appearing in the interrupt request, such as frame 1, frame 2, frame 3, etc., all refer to the sliding data collected by the touch screen driver; the frame data appearing in the coordinate calculation, such as frame 1, frame 2, frame 3, etc., all refer to the coordinate data obtained by the TSA algorithm module; the frame data appearing in the input event, such as frame 1, frame 2, frame 3, etc., all refer to the coordinate data sent to the batch processing queue; and the frame data appearing in the software vertical synchronization and the hardware vertical synchronization, such as frame 1, frame 3 and frame 5, all refer to the synthesized image data.
[0137] Continuing to refer to FIG. 6, the frame 2 data and the frame 4 data are sent to the batch processing queue, but the focus application discards them by resampling during data use. This undoubtedly wastes the performance of the electronic device and increases the power consumption of the electronic device.
[0138] It should be understood that the above description is only an example for better understanding the technical solution of the embodiment and is not the only limitation of the embodiment.
[0139] In summary, in an application, during the movement of a user on the display screen by a finger or a stylus (hereinafter, the finger is taken as an example for illustration), since the touch sampling rate of the electronic device is higher than the refresh rate of the application, a large amount of invalid coordinate data is accumulated in the batch processing queue, which causes the application to need to perform resampling, thereby causing the waste of the performance of the electronic device and the increase of the power consumption of the electronic device.
[0140] Therefore, the application provides a method for reporting touch screen coordinate data to solve the problem of invalid coordinate data accumulation in the batch processing queue, which leads to performance consumption and power consumption increase of the electronic device caused by focus application resampling.
[0141] In an implementation manner, in order to more clearly show the power consumption reduction effect achieved by the application, the remaining time of various applications on the electronic device before and after using the method for reporting touch screen coordinate data of the application on the electronic device can be compared. In an implementation manner, an application program for displaying the predicted remaining use time of various applications is also installed on the electronic device, as shown in FIG. 7.
[0142] Referring to (1) in FIG. 7, an example of a mobile phone interface 40a is shown. As an example, the interface displays icons of various application programs, such as icons of camera application, address book, phone, message, clock, calendar, gallery, memo, file management, email, music, calculator, video, voice recorder, weather, browser, settings and energy consumption optimization application.
[0143] It should be noted that in an implementation manner, the interface 40a shown in (1) in FIG. 7 can be referred to as a main interface. When the user clicks the icon of the energy consumption optimization application in the interface 40a, the function of the energy consumption optimization application can be used to optimize the energy consumption of the electronic device, such as the energy consumption optimization of the non-hand-off sliding scene of the application based on the synchronization optimization interface provided by the method for reporting touch screen coordinate data of the application.
[0144] Continuing to refer to (1) in FIG. 7, when the user clicks the icon of the energy consumption optimization application, the mobile phone responds to the user operation, identifies that the icon corresponding to the user click operation is the icon of the energy consumption optimization application, and then calls the corresponding interface in the application program framework layer to start the energy consumption optimization application. At this time, the mobile phone displays the interface of the energy consumption optimization application, such as the interface 40b shown in (2) in FIG. 7.
[0145] Referring to (2) in FIG. 7, an example of the energy consumption optimization interface 40b is shown. As an example, the interface displays three display switching buttons, namely power information, power consumption details and settings. The interface corresponding to the power information switching button is the main interface, which displays the remaining standby time under the current power of the electronic device, the "running monitoring" tab, the "energy saving mode" tab and the "ultra-long standby" tab. The "running monitoring" tab is selected by default, and the list of various application programs and the predicted remaining use time under the condition that the corresponding tab is selected are displayed. For example, when the "running monitoring" tab is selected, the predicted remaining use time of the game application is 2 hours and 25 minutes, and the predicted remaining use time of the video playback software is 3 hours and 27 minutes.
[0146] Continuing to refer to FIG. 7(2), after the user clicks the power saving mode tab, the interface displays the estimated remaining use time of each type of application after power saving optimization in the list. In order to only show the optimization effect based on the scheme provided in the present application, the user can also click the settings button to enter the settings interface, as shown in the interface 40c in FIG. 8a(1).
[0147] Referring to FIG. 8a(1), an example of a power saving optimization application settings interface 40c is shown. The example includes a plurality of settings options, including power saving mode settings, super-long standby mode settings, intelligent switching mode, low battery reminder, remaining battery reminder, and the like.
[0148] In an implementation, in order to only show the optimization effect based on the scheme provided in the present application, the user clicks the power saving mode settings to enter the power saving mode settings interface, as shown in the interface 40d in FIG. 8a(2).
[0149] Referring to FIG. 8a(2), an example of a power saving mode settings interface is shown. The interface includes a plurality of power saving mode optimization options, including Wi-Fi, GPS satellite, Bluetooth, airplane mode, screen brightness, screen saver, key vibration, mute, automatic rotation, and synchronization optimization. Among them, the synchronization optimization is the power consumption optimization in the non-hand-off sliding scenario based on the scheme provided in the present application. In this interface, the effect of the technical scheme provided in the present application is displayed by separately turning on the synchronization optimization option. After selecting the synchronization optimization option, the user clicks the apply button, the electronic device starts the synchronization optimization and displays the power information interface 40b as shown in FIG. 7(2). After clicking the power saving mode tab in the interface 40b, the power consumption optimization application starts the power consumption optimization and displays the estimated remaining time of each application based on the touch screen coordinate data reporting method provided in the present application, as shown in FIG. 8b(3). The game application has an estimated remaining use time of 3 hours and 47 minutes, and the video playback software has an estimated remaining use time of 4 hours and 7 minutes.
[0150] The data processing flow of the focus application optimizing the power consumption of the electronic device based on the scheme provided in the present application in the power saving mode of the power consumption optimization application will be described below in conjunction with FIGS. 4a, 4b, and 9.
[0151] In the interface 20b as shown in FIG. 4a(2), the user interacts with the electronic device by sliding up and down in the direction of the arrow, thereby switching the display content of the video live application.
[0152] For example, in the above-mentioned switching video live application, the application response to the sliding operation is described in combination with FIG. 9. The focal application (i.e., the video live application) sends a VSync signal request to the SF thread, and the focal application also sends a data transmission (tpVSync) signal to the Daemon. After receiving the VSync signal request, the SF thread forwards the data transmission signal to the focal application and the Daemon respectively (wherein the VSync signal sent to the focal application is recorded as a VSync_APP signal, and the data transmission signal sent to the Daemon is recorded as a tpVSync signal). The user performs sliding on the touch screen, and the touch screen driver collects the sliding data based on the interrupt request Irq-tp triggered by the electronic device, and sends the collected sliding data to the Daemon through AfeHal. After receiving the tpVSync signal sent by the focal application, the Daemon performs timeout judgment. In the case of no timeout, the collected sliding data is sent to the TSA algorithm module for coordinate calculation, and the calculated coordinate data is sent to the batch processing queue through the Daemon, the receiving module, the touch screen driver and the Input subsystem in sequence.
[0153] In another implementation, the Daemon can transmit the resampling method to the input transmission module in the case of no timeout, so that the focal application resamples the coordinate data in the batch processing queue based on the resampling method.
[0154] In addition, it should be noted that in the present embodiment, the Daemon sends the coordinate data to the batch processing queue according to the tpVSync signal. In the case of no timeout, the data in the batch processing queue will be taken away by the focal application in time, and the coordinate data in the batch processing queue will not be accumulated. That is, the focal application does not need to resample the data in the batch processing queue again, which greatly reduces the performance consumption of the electronic device and the power consumption of the electronic device.
[0155] Regarding the data processing process in FIG. 9, the specific interaction process of the functional modules is shown in FIG. 10, which is described in combination with the accompanying drawings.
[0156] FIG. 10 is an implementation process of a touch screen coordinate data reporting method provided by an embodiment of the present application, which is a timing diagram involving functional module interaction.
[0157] Referring to FIG. 10, exemplary merging of the functional modules in FIG. 9 is shown, in which the touch screen, touch screen driver, receiving module, daemon and TSA algorithm in FIG. 9 are merged into a data acquisition module; the input kernel, input reading, input scheduling, input publisher and input consumer are merged into an Input subsystem; the focus application, rendering module, root view, hardware software and rendering agent are merged into a three-party application; the display composition system, hardware compositor, display kernel and liquid crystal display are merged into a display composition module. In FIG. 10, as an example, when a user performs a non-lift-off swipe (an Input event) in the three-party application, the sensor detects the swipe operation, the focus application initiates a request for a VSync signal to the display composition module in response to the non-lift-off swipe operation of the user, and the interaction between the data acquisition module, Input subsystem and display composition module during the non-lift-off swipe is described in detail.
[0158] S101. Display a first interface of a first application.
[0159] Exemplarily, the first application is a focus application currently running in the foreground. The first interface is a currently displayed interface of the first application.
[0160] Exemplarily, taking the first application as a game application as an example, the first interface can be the chess interface shown in (2) of FIG. 3a, and the content displayed in the first interface is, for example, the screen shown in (2) of FIG. 3a; taking the first application as a video playing application as an example, the first interface can be the video playing interface or live interface shown in (2) of FIG. 4a or (3) of FIG. 4b, and the content displayed in the first interface is, for example, the screen shown in (2) of FIG. 4a or (3) of FIG. 4b.
[0161] It can be understood that in some game scenes of instant battle games, because the user wants to obtain better follow-up performance. Therefore, in the embodiment, the package name of the first application can also be acquired, whether the first application is a game application is determined based on the package name, and in the case that the first application is a game application, the touch screen coordinate data reporting method provided in the application is ended. In the case that the first application is a non-game application, the touch screen coordinate data reporting method provided in the application is continued to be executed.
[0162] In addition, the application can also provide a white list for recording the above-mentioned game, so that the user can make the game run without executing the scheme provided in the application by adding the game to the white list.
[0163] S102. Acquire an input event of a user, the input event including a DOWN event and an UP event.
[0164] It should be noted that the events supported by the front end of the electronic device include a DOWN event, a MOVE event and an UP event, and only the DOWN event and the UP event are needed in the background, and other events can be identified as the MOVE event.
[0165] For example, when the touch screen obtains an input event of a user, the input event is sent to a focus application through a data collection module and an Input subsystem. After receiving the input event, the focus application sends a VSycn signal request to an SF thread in a display synthesis module, triggering a picture drawing operation.
[0166] S103. The input event is sent to the focus application.
[0167] S104. In response to a sliding operation on the first interface, sliding data of the sliding operation is collected based on a preset touch screen sampling rate, and a plurality of coordinate data is obtained by calculation.
[0168] For example, the preset touch screen sampling rate can be 90Hz or 240Hz, and the embodiments of the present application do not limit this.
[0169] It can be understood that, in order to obtain a better operation experience, the touch screen sampling rate is usually greater than the refresh rate of the focus application. In this way, the focus application can obtain more user operation coordinates in the same time.
[0170] S105. The focus application sends a tpVSync signal to a daemon process of the data collection module.
[0171] It can be understood that the tpVSync signal is a data transmission signal sent by the focus application to the daemon process, and the sending mode can be through a cross-thread communication mode. The cross-thread communication mode includes a file node writing mode, a Soket mode, etc. Specifically, the focus application sends a VSycn signal request to the SF thread, and also sends a tpVSync signal to the daemon process through the SF thread.
[0172] In one implementation mode, when the input event is a DOWN event, it represents the first frame data of the current sliding scene. In order to balance the response and timeliness of the first frame data, the daemon process in the data collection module can also actively report a plurality of frame coordinate data when receiving the event until the daemon process receives the tpVSycn signal.
[0173] In one implementation mode, when the input event is an UP event, it is determined that the current sliding scene is ended, and the focus application stops sending the tpVSycn signal to the daemon process.
[0174] S106. The focus application sends a VSync signal request to the SF thread displaying the composition module.
[0175] S107. Determine whether the tpVSync signal is timed out.
[0176] For example, generally, if the tpVSync signal is not sent to the daemon process after 2 milliseconds or 3 milliseconds after the tpVSync signal is sent, the tpVSync signal is considered to be timed out.
[0177] It can be understood that in the case of tpVSync timeout, the high sampling rate can cause the touch screen driver to collect multiple sliding data during this period, and the TSA algorithm module can calculate multiple coordinate data. Therefore, it is also necessary to determine the tpVSync signal timeout.
[0178] S108. The daemon process obtains coordinate data based on the tpVSync signal.
[0179] In the case where the tpVSync signal is not timed out, the corresponding coordinate data is obtained from the above-mentioned multiple coordinate data according to the timestamp of the tpVSync signal, and is sent to the batch processing queue of the Input subsystem.
[0180] S108'. The daemon process obtains the latest coordinate data based on the tpVSync signal.
[0181] In the case where the tpVSync signal is timed out, the coordinate data closest to the timestamp is selected from the above-mentioned multiple coordinate data according to the timestamp of the tpVSync signal, and is sent to the batch processing queue of the Input subsystem.
[0182] S109. The daemon process sends the calculated coordinate data to the Input subsystem.
[0183] S110. The SF thread returns a VSync_APP signal.
[0184] S111. The focus application obtains coordinate data based on the Vsycn_app signal, and performs drawing and display based on the coordinate data.
[0185] In addition, in an implementation mode, the focus application enters an idle state, in which the focus application does not need to perform screen update, and at this time the focus application stops sending the tpVSync signal to the daemon process.
[0186] Thus, the touch screen coordinate data reporting method provided in the embodiment can, after the focus application triggers rendering and drawing, send a data transmission signal to the daemon process, so that the daemon process reduces the frequency of sending coordinate data and reduces the triggering frequency of the Input event, thereby reducing the operation of the focus application for batch processing queue resampling, improving the performance of the electronic device, reducing the power consumption of the electronic device, effectively reducing the occurrence of the "hot hand" scenario of the electronic device, and further improving the user experience.
[0187] To more clearly illustrate the data processing process of the scheme provided in the embodiments of the present application, the processing flow of the data frame in the data processing process of the present application will be described below in combination with FIG. 11.
[0188] For example, in combination with the chess scene shown in interface 10b in (2) of FIG. 3a, the sampling rate of the touch screen in this scene is 120 Hz, and the refresh rate of the chess battle application is 60 Hz. During the process in which the user presses and slides on the touch screen, the chess battle application sends a VSync signal request to the SF thread, and at the same time, sends a tpVSync signal to the daemon process through the SF thread, and the SF thread returns a VSync_APP signal to the chess battle application. During this period, the touch screen driver collects data of the user's sliding operation based on the system triggered interrupt request, and sends the collected data to the TSA algorithm module through the daemon process for coordinate calculation. After receiving the above tpVSync signal, the daemon process sends the corresponding coordinate data to the Input subsystem to trigger an input event, and the chess battle application obtains the above coordinate data based on the VSync_APP signal for rendering and display.
[0189] Based on the above premise, referring to FIG. 11, for example, during the user sliding operation, the touch screen driver collects 5 frames of data based on the system triggered interrupt request, while the chess battle application only obtains 3 frames of data. The coordinate data corresponding to frame 2 and frame 3 is not sent to the batch processing queue because the daemon process does not receive the tpVSync signal sent by the chess battle application. Since the chess battle application only collects unique coordinate data from the batch processing queue each time, the resampling calculation process is reduced, the performance of the electronic device is greatly improved, the power consumption of the electronic device is reduced, the use time of the battery of the electronic device is prolonged, the heating of the electronic device is improved, and the user experience is improved.
[0190] In addition, it is understandable that the electronic device comprises hardware and / or software modules corresponding to each function in order to realize the above functions. The algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is realized in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application in combination with the embodiments, but such implementation should not be considered beyond the scope of the present application.
[0191] In addition, it should be noted that the touch screen coordinate data reporting method provided by the above embodiments realized by the electronic device in the actual application scenario can also be executed by a chip system included in the electronic device, wherein the chip system can include a processor. The chip system can be coupled with a memory, so that the chip system calls a computer program stored in the memory when running, and realizes the steps executed by the above electronic device. The processor in the chip system can be an application processor or a processor other than an application processor.
[0192] In addition, the present application also provides a computer readable storage medium, which stores computer instructions, when the computer instructions run on the electronic device, the electronic device executes the above related method steps to realize the touch screen coordinate data reporting method in the above embodiments.
[0193] In addition, the present application also provides a computer program product, when the computer program product runs on the electronic device, the electronic device executes the above related steps to realize the touch screen coordinate data reporting method in the above embodiments.
[0194] In addition, the present application also provides a chip (which can also be a component or a module), which can include one or more processing circuits and one or more transceiver pins; wherein the transceiver pins and the processing circuits communicate with each other through internal connection paths, and the processing circuits execute the above related method steps to realize the touch screen coordinate data reporting method in the above embodiments to control the receiving pins to receive signals and the sending pins to send signals.
[0195] In addition, as known from the above description, the electronic device, computer readable storage medium, computer program product or chip provided by the embodiments of the present application are all used to execute the corresponding methods provided above, so the beneficial effects that can be achieved thereby can refer to the beneficial effects in the corresponding methods provided above, which will not be described here again.
[0196] The above-described embodiments are only used to illustrate the technical solutions of the present application, but not limit the present application; although the present application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for reporting coordinate data on a touchscreen, characterized in that, Applied to electronic devices, the method includes: Display the first interface of the first application; In response to a sliding operation applied to the first interface, the input event corresponding to the sliding operation is obtained; Based on a preset touchscreen sampling rate, each frame of sliding data corresponding to the sliding operation is collected, and the coordinates of each frame of sliding data are calculated to obtain the coordinate data corresponding to each frame of sliding data, and the first timestamp corresponding to each coordinate data. Obtain a data transmission signal, which corresponds to a second timestamp. The data transmission signal is a signal issued by the first application based on the input event to instruct the coordinate data to be reported to the first application. The coordinate data corresponding to the first timestamp that matches the second timestamp is sent to the first application so that the first application updates the first interface.
2. The method according to claim 1, characterized in that, When the input event is an UP event, the first application stops sending the data transmission signal.
3. The method according to claim 1, characterized in that, In the case where the input event is a DOWN event, multiple coordinate data are sent to the first application before the data transmission signal is received.
4. The method according to claim 1, characterized in that, Sending the coordinate data corresponding to the first timestamp that matches the second timestamp to the first application includes: Compare the second timestamp with the current system time; If the comparison result is less than or equal to a preset timeout threshold, it is determined that the reception of the data transmission signal has not timed out. The second timestamp is matched with the first timestamp of each coordinate data, and the coordinate data corresponding to the successfully matched first timestamp is sent to the first application.
5. The method according to claim 4, characterized in that, The method further includes: If the comparison result is greater than the preset timeout threshold, it is determined that the reception of the data transmission signal has timed out, and the coordinate data corresponding to the first timestamp with the smallest difference from the second timestamp is sent to the first application.
6. The method according to claim 1, characterized in that, Before acquiring the data transmission signal, the following steps are included: Obtain the package name of the first application, and determine whether the first application is a game application based on the package name; If the first application is not a game application, the step of sending the coordinate data corresponding to the first timestamp that matches the second timestamp to the first application is executed.
7. The method according to claim 6, characterized in that, The method further includes: If the first application is a game application, each of the coordinate data is sent to the first application.
8. The method according to claim 1, characterized in that, The acquisition of data transmission signals includes: Upon receiving a vertical synchronization signal request, the data transmission signal is acquired; The vertical synchronization signal request is a request generated by the first application after receiving the input event.
9. The method according to claim 1, characterized in that, The preset screen sampling rate is greater than the refresh rate of the first application.
10. The method according to claim 1, characterized in that, When the first application enters an idle state, the first application stops sending the data transmission signal.
11. An electronic device, characterized in that, The electronic device includes: a memory and a processor, the memory and the processor being coupled; the memory stores program instructions, which, when executed by the processor, cause the electronic device to perform the touchscreen coordinate data reporting method as described in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that, The method includes a computer program that, when run on an electronic device, causes the electronic device to perform the touchscreen coordinate data reporting method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Touch screen coordinate data reporting method and device and storage medium
CN121255040A
Touch data processing method and device, terminal and storage medium
CN110703944A
Touch event regulation and control method and device and computer readable storage medium
CN112612372A
Control method and electronic equipment
CN112717370A
Display equipment and image processing method and device
CN115185392A