Input response optimization method and related electronic device

By detecting application types, different input event distribution methods are used to optimize touch response, which solves the problem of touch delay in gaming experience, and achieves faster input response and more stable screen.

WO2025001232A1PCT designated stage expired Publication Date: 2025-01-02HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/079030
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-29
Filing Date
2024-02-28
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

The prior art cannot effectively optimize touch control in gaming experience, especially the delay in input responses such as touch, which affects the user experience.

Method used

By detecting the application type, preset game applications and non-game applications use different input event distribution methods respectively. Game applications do not need to wait for the vertical synchronization signal to distribute input events, while non-game applications wait for the vertical synchronization signal to avoid unstable screens.

Benefits of technology

It reduces the delay in input responses such as touch, optimizes input response sensitivity such as touch, improves user gaming experience, and takes into account the input response of game applications and the picture stability of non-game applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024079030_02012025_PF_FP_ABST
    Figure CN2024079030_02012025_PF_FP_ABST
Patent Text Reader

Abstract

The present application provides an input response optimization method and a related electronic device, the method being applied to the electronic device, and the electronic device running a first application. The method comprises: detecting a first input event of a user on a first interface, the first interface being an interface of a first application; when the first application is a preset game application, distributing the first input event before a rising edge or a falling edge of a vertical synchronization signal appears; rendering a picture in response to the first input event; detecting a second input event of the user on a second interface, the second interface being an interface of a second application; and when the second application is not a preset game application, distributing the second input event after the rising edge or the falling edge of the vertical synchronization signal appears, and rendering a picture in response to the second input event. The present application can reduce input response delay.
Need to check novelty before this filing date? Find Prior Art

Description

Input response optimization method and related electronic equipment

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 29, 2023, with application number 202310786817.5 and application name “Input response optimization method and related electronic equipment”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of terminal technology, and in particular to an input response optimization method and related electronic equipment. Background Art

[0003] Touch controllability plays a crucial role in the gaming experience. Touch controllability refers to the ability to control operations by touching a touch panel (TP). Touch controllability encompasses a wide range of performance indicators, including touch sensitivity, continuity, tracking, and false touches. Sensitivity, as a key performance indicator of touch controllability, directly impacts the gaming experience. Therefore, optimizing the sensitivity of touch and other input responses is a critical technical challenge for those skilled in the art.

[0004] Summary of the Invention

[0005] The present application provides an input response optimization method and related electronic devices, which can reduce the delay of input responses such as touch, optimize the sensitivity of input responses such as touch, and improve the user's gaming experience.

[0006] In a first aspect, an embodiment of the present application provides an input response optimization method, which is applied to an electronic device and includes:

[0007] Detecting a first input event of a user on a first interface, where the first interface is an interface of a first application;

[0008] When the first application is a preset game application, the first input event is distributed before a rising edge or a falling edge of a vertical synchronization signal occurs; and a picture is rendered in response to the first input event;

[0009] Detecting a second input event of the user on a second interface, where the second interface is an interface of a second application;

[0010] When the second application does not belong to the preset game application, the second input event is distributed after the rising edge or the falling edge of the vertical synchronization signal occurs, and the picture is rendered in response to the second input event.

[0011] Optionally, distributing the second input event and rendering the screen in response to the second input event includes: distributing the second input event to a native rendering module of the electronic device; and rendering the screen in response to the second input event through the rendering module.

[0012] In the above solution, if the application is a preset game application, then after the electronic device receives an input event acting on the application, it can distribute the input event for rendering the screen without waiting for the arrival of the vertical synchronization signal, thereby reducing the response delay of the input event. If the application is not a preset game application, it still waits for the arrival of the vertical synchronization signal before distributing the input event to reduce the occurrence of screen instability (such as "tearing"). That is, this solution can take into account the optimization of the input response of game applications and the screen stability of non-game applications, greatly improving the user experience.

[0013] In one possible implementation, the above-mentioned distributing the first input event; and rendering the picture in response to the first input event, include: distributing the first input event to a game engine; and rendering the picture in response to the first input event through the game engine.

[0014] In the above solution, the game application uses the game engine to render the screen, so it is not restricted by the vertical synchronization signal, so that input events can be distributed in time for rendering, reducing the delay of input responses such as touch.

[0015] In a possible implementation, before detecting the first input event of the user on the first interface, the method further includes: obtaining identification information of the first application; and knowing that the first application belongs to the preset game application based on the identification information of the first application.

[0016] In one possible implementation, determining, based on the identification information of the first application, that the first application belongs to the preset game application includes: comparing the identification information of the first application with the identification information of applications included in a preset whitelist; the preset whitelist includes the identification information of the preset game application; and if the preset whitelist includes the identification information of the first application, determining that the first application belongs to the preset game application. Optionally, the preset whitelist is stored in a configuration file.

[0017] In the above solution, the corresponding application is first identified as a preset game application, and then the corresponding input event distribution method is determined to avoid the problem of screen tearing caused by non-game applications using a direct distribution method (that is, an input event distribution method that is not limited by the vertical synchronization signal frequency).

[0018] In one possible implementation, the first input event includes a touch event; and after learning, based on the identification information of the first application, that the first application is a game application in a preset whitelist, the method further includes:

[0019] Obtaining a frame rate of the first application and a TP reporting rate of a touch screen of the electronic device;

[0020] When the TP reporting rate is an integer multiple of the frame rate, it indicates that a direct distribution mode is adopted; the direct distribution mode is an input event distribution mode that is independent of the frequency limit of the vertical synchronization signal.

[0021] In the above scheme, direct distribution is indicated only when the TP reporting rate is an integer multiple of the frame rate, thereby reducing the risk of unstable input response caused by the mismatch between the TP reporting rate and the game's frame rate.

[0022] In a possible implementation, the TP reporting rate is less than or equal to a preset threshold.

[0023] In the above solution, the risk of excessive power consumption can be prevented by limiting the TP reporting rate.

[0024] In a possible implementation, after the direct distribution method is used, the instruction further includes:

[0025] Notifying the process of the first application of instruction information of adopting the direct distribution method through a status callback;

[0026] The method of distributing the first input event to the game engine before a rising edge or a falling edge of a vertical synchronization signal occurs includes:

[0027] Before a rising edge or a falling edge of the vertical synchronization signal occurs, the first input event is distributed to the game engine through the process of the first application.

[0028] In the above solution, the input event distribution method used by the application process is notified by means of a state callback, which is easy to implement.

[0029] In a possible implementation, after learning, based on the identification information of the first application, that the first application is a game application in a preset whitelist, the method further includes:

[0030] A status callback function is registered; the status callback function is used to notify the process of the first application of indication information of the input event distribution method used.

[0031] In the above solution, the corresponding application is first identified as a preset game application, and then the callback function is registered, avoiding the registration and notification of a large number of irrelevant applications in the system, thereby reducing resource usage.

[0032] In a possible implementation, the first application process includes a plurality of input event consumption threads, and the plurality of input event consumption threads are used to jointly execute the distribution of input events acting on the first application;

[0033] The multiple input event consumption threads share the indication information of the adopted input event distribution mode.

[0034] In the above solution, when the first application process includes multiple input event consuming threads, the state callback information can be shared to reduce the overhead of multiple registrations of the callback function.

[0035] In a possible implementation, after indicating that the direct distribution method is used, the method further includes: associating and saving the identification information of the first application with the identification information of the direct distribution method;

[0036] The method further includes:

[0037] Exiting the first application;

[0038] When the first application is run again, querying the input event distribution method adopted by the first application based on the identification information of the first application to obtain identification information of the direct distribution method;

[0039] The input event applied to the first application is distributed using the direct distribution method based on an indication of the identification information of the direct distribution method.

[0040] In the above solution, after determining the input event distribution method corresponding to the application, the corresponding information can be saved. When the application is run again later, there is no need to repeat the judgment, which saves resources.

[0041] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a touch screen, one or more processors, and a memory; the memory is coupled to the one or more processors, the memory being configured to store computer program code, the computer program code comprising computer instructions, the one or more processors invoking the computer instructions to cause the electronic device to perform the following operations:

[0042] Detecting a first input event of a user on a first interface, where the first interface is an interface of a first application;

[0043] When the first application is a preset game application, the first input event is distributed before a rising edge or a falling edge of a vertical synchronization signal occurs; and a picture is rendered in response to the first input event;

[0044] Detecting a second input event of the user on a second interface, where the second interface is an interface of a second application;

[0045] When the second application does not belong to the preset game application, the second input event is distributed after the rising edge or the falling edge of the vertical synchronization signal occurs, and the picture is rendered in response to the second input event.

[0046] Optionally, the one or more processors are used to call the computer instructions to enable the electronic device to specifically perform the following operations: distribute the second input event to a native rendering module of the electronic device; and render a screen in response to the second input event through the rendering module.

[0047] In one possible implementation, the one or more processors are configured to call the computer instructions to enable the electronic device to specifically perform the following operations: distribute the first input event to a game engine; and render a picture in response to the first input event through the game engine.

[0048] In one possible implementation, before detecting the first input event of the user on the first interface, the one or more processors are also used to call the computer instructions to enable the electronic device to perform the following operations: obtain the identification information of the first application; and determine, based on the identification information of the first application, that the first application belongs to the preset game application.

[0049] In one possible implementation, the one or more processors are configured to invoke the computer instructions to cause the electronic device to specifically perform the following operations: comparing the identification information of the first application with the identification information of applications included in a preset whitelist; the preset whitelist includes the identification information of the preset gaming application; and if the preset whitelist includes the identification information of the first application, determining that the first application belongs to the preset gaming application. Optionally, the preset whitelist is stored in a configuration file.

[0050] In one possible implementation, the first input event includes a touch event; after determining, based on the identification information of the first application, that the first application is a game application in a preset whitelist, the one or more processors are further configured to invoke the computer instruction to cause the electronic device to perform the following operations:

[0051] Obtaining a frame rate of the first application and a TP reporting rate of a touch screen of the electronic device;

[0052] When the TP reporting rate is an integer multiple of the frame rate, it indicates that a direct distribution mode is adopted; the direct distribution mode is an input event distribution mode that is independent of the frequency limit of the vertical synchronization signal.

[0053] In a possible implementation, the TP reporting rate is less than or equal to a preset threshold.

[0054] In one possible implementation, after the indication is directly distributed, the one or more processors are further configured to call the computer instruction to cause the electronic device to perform the following operations:

[0055] Notifying the process of the first application of instruction information of adopting the direct distribution method through a status callback;

[0056] The method of distributing the first input event to the game engine before a rising edge or a falling edge of a vertical synchronization signal occurs includes:

[0057] Before a rising edge or a falling edge of the vertical synchronization signal occurs, the first input event is distributed to the game engine through the process of the first application.

[0058] In one possible implementation, after learning, based on the identification information of the first application, that the first application is a game application in a preset whitelist, the one or more processors are further configured to invoke the computer instruction to cause the electronic device to perform the following operations:

[0059] A status callback function is registered; the status callback function is used to notify the process of the first application of indication information of the input event distribution method used.

[0060] In one possible implementation, the first application process includes multiple input event consumer threads, which are used to jointly execute the distribution of input events acting on the first application; the multiple input event consumer threads share the indication information of the adopted input event distribution method.

[0061] In one possible implementation, after the indication adopts the direct distribution method, the one or more processors are further configured to call the computer instruction to cause the electronic device to perform the following operations: associate and save the identification information of the first application with the identification information of the direct distribution method;

[0062] The one or more processors are further configured to call the computer instructions to cause the electronic device to perform the following operations:

[0063] Exiting the first application;

[0064] When the first application is run again, querying the input event distribution method adopted by the first application based on the identification information of the first application to obtain identification information of the direct distribution method;

[0065] The input event applied to the first application is distributed using the direct distribution method based on an indication of the identification information of the direct distribution method.

[0066] In a third aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any possible implementation method of the first aspect.

[0067] In a fourth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.

[0068] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect.

[0069] The above-mentioned second to fifth aspects are used to cooperate with the method of implementing any one of the above-mentioned first aspect and its possible implementation methods, and therefore have corresponding beneficial effects as the above-mentioned first aspect and its possible implementation methods, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] FIG1A is a schematic diagram of a touch service link provided in an embodiment of the present application;

[0071] FIG1B is a schematic diagram of touch event distribution according to an embodiment of the present application;

[0072] FIG2 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0073] FIG3 is a schematic diagram of a software framework of an electronic device provided in an embodiment of the present application;

[0074] FIG4 is a schematic diagram of a touch event distribution effect provided by an embodiment of the present application;

[0075] Figures 5 and 6 are schematic flow charts of the method provided in the embodiments of the present application;

[0076] FIG7 is a schematic diagram of data flow provided in an embodiment of the present application;

[0077] Figures 8 and 9 are schematic flow charts of the method provided in the embodiments of the present application;

[0078] 10 and 11 are schematic diagrams of input event distribution effects provided in an embodiment of the present application. DETAILED DESCRIPTION

[0079] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment can be included in at least one embodiment of the present embodiment application. The appearance of this phrase in various positions in the specification does not necessarily mean the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It can be understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.

[0080] In the specification, claims, and accompanying drawings of this application, the terms "first," "second," "third," and the like are used to distinguish different objects and are not used to describe a particular order. Furthermore, the terms "including," "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a list of steps or elements may be included, or alternatively, steps or elements not listed may be included, or other steps or elements may be included that are inherent to the process, method, product, or apparatus.

[0081] Only part relevant to the present application is shown in the accompanying drawings, not all of it. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processing or methods depicted as flow charts. Although flow charts describe various operations (or steps) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. When its operation is completed, the processing can be terminated, but can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.

[0082] As used in this specification, the terms "component," "module," "system," "unit," and the like are used to refer to computer-related entities, hardware, firmware, a combination of hardware and software, software, or software in execution. For example, a unit can be, but is not limited to, a process running on a processor, a processor, an object, an executable file, an execution thread, a program, and / or distributed between two or more computers. In addition, these units can be executed from various computer-readable media having various data structures stored thereon. Units can communicate, for example, through local and / or remote processes based on signals having one or more data packets (e.g., data from a second unit interacting with another unit in a local system, a distributed system, and / or a network. For example, the Internet interacts with other systems via signals).

[0083] First, let’s introduce the technical terms involved in the embodiments of this application.

[0084] 1. Frames per second (FPS).

[0085] FPS, also known as frame rate, is the rate or frequency at which new frames are displayed. It determines the number of frames drawn per second, meaning it represents the ability to draw frames per second. Essentially, a higher frame rate means more frames are displayed per second, resulting in smoother, more realistic motion. The frame rate is determined by a combination of the software, the central processing unit (CPU), and the graphics card.

[0086] 2. Refresh rate.

[0087] Refresh rate refers to the refresh rate of a monitor. It refers to the number of times the electron beam repeatedly scans the image on the monitor screen, that is, it describes the number of times the monitor refreshes the display. The unit is Hertz (Hz). The refresh rate determines the number of new image frames that can be seen per second.

[0088] 3. Touch panel (TP) reporting rate.

[0089] The TP reporting rate refers to the number of times the touch chip (integrated circuit, IC) reports the touch position (coordinates) per unit time.

[0090] 4. Game engine.

[0091] A game engine is a core component of pre-programmed, editable game systems or interactive real-time graphics applications. For example, a game engine may include the following software modules: a rendering engine (also known as a "renderer," including both 2D and 3D graphics engines), a physics engine, a collision detection system, sound effects, a scripting engine, computer animation, artificial intelligence, a networking engine, and scene management. In other words, a game engine handles the rendering of game graphics, sound effects, animation, and other processing.

[0092] Graphics smoothness, touchscreen controllability, display quality, heat dissipation, network stability, and audio quality all play crucial roles in gaming. Touchscreen controllability encompasses numerous performance indicators, including touch sensitivity, continuity, tracking, and false touches, all of which are crucial to the user's gaming touch experience. Touch sensitivity, as a key performance indicator of touch controllability, directly impacts the gaming experience.

[0093] In practice, touch latency affects touch sensitivity, especially in competitive games, where a millisecond-level difference in touch latency can determine the outcome of a match. Touch latency is an end-to-end experience, so to reduce it, we must analyze the internal structure of the touch service chain from start to finish and identify optimization points.

[0094] For example, see Figure 1A, which shows a schematic diagram of a touch service link. It can be seen that the touch service link includes a touch panel (TP), a touch screen driver, an input management service (IMS) reader, an IMS dispatcher, a view system (view), a rendering module, a graphics synthesis module, and a display module. Exemplarily, the touch screen receives a touch operation and transmits it to the IMS module via the touch screen driver. The IMS reader reads the touch event (Move). The touch event is dispatched to the view system via the IMS dispatcher. The view system then distributes the touch event to the rendering module for rendering through the user interface (UI) thread. The UI thread is the main thread of the application process.

[0095] Exemplarily, if the touch event is an input event obtained through the user interface of a game application, the rendering module is a game engine. That is, the user interface of the game application is rendered by the game engine. Exemplarily, if the touch event is an input event obtained through the user interface of an application other than the game application, the rendering module is a rendering module native to the electronic device (e.g., a 3D graphics processing library).

[0096] After the rendering module completes rendering, the graphics synthesis module synthesizes the rendered content into a graphic and sends the synthesized graphic to the display module for display.

[0097] During this service processing, delays are generated in the touch screen and touch screen driver processing, which can be referred to as peripheral delay. Delays are generated in the IMS reader and IMS scheduler processing, which can be referred to as system transmission delay. Delays are generated in the view system processing, which can be referred to as application transmission delay. Delays are generated in the rendering module processing, which can be referred to as rendering delay. Delays are generated in the graphics synthesis module processing, which can be referred to as synthesis delay. Delays are generated in the display module processing, which can be referred to as display delay.

[0098] Based on an in-depth analysis of the above touch service link and its related latency, it was found that during the processing of the above view system, the distribution of touch events is limited by the frequency of vertical synchronization (VSync).

[0099] The basic idea of ​​VSync is to synchronize the FPS and the refresh rate of the monitor through the vertical synchronization signal (abbreviated as VSync signal) to avoid the phenomenon of screen "tearing". Without the VSync signal, when the rendering frame data is relatively fast, the monitor cannot keep up, and it may appear that one frame is currently being displayed while another frame is triggered to be displayed on the monitor, resulting in the phenomenon of screen "tearing".

[0100] Specifically, in the process of distributing touch events based on VSync, before the display is refreshed, the touch events are buffered in a buffer queue. When the VSync signal arrives, the touch events are distributed to the rendering module, which ultimately generates the corresponding image based on the received touch events. For easier understanding, please refer to Figure 1B for an example.

[0101] Figure 1B uses the touch control during a game experience as an example. As can be seen, while the game thread is displaying game frame 1, the UI thread in the view system can receive touch events 1 and 2. For example, the game thread can call the game engine to perform rendering and other operations. Although the UI thread has received touch events 1 and 2, the VSync signal has not yet arrived due to the VSync frequency. Therefore, the UI thread caches the received touch events. Only after receiving the VSync signal does it distribute touch events 1 and 2 to the rendering module for rendering. Similarly, while the game thread is displaying game frame 2, the UI thread can receive touch events 3 and 4. Although the UI thread has received touch events 3 and 4, the VSync signal has not yet arrived due to the VSync frequency. Therefore, the UI thread caches the received touch events. Only after receiving the next VSync signal does it distribute touch events 3 and 4 to the rendering module for rendering. Furthermore, we can see that touch events 1 and 2 are distributed when game frame 2 is displayed. However, due to the delays in rendering, synthesis, and display after distribution, the corresponding interface display in response to touch events 1 and 2 is not made until game frame 3, resulting in severe touch delay.

[0102] For example, the arrival of a VSync signal in the embodiments of the present application refers to the occurrence of a rising edge or falling edge of the VSync signal. For example, a transition from a low level "0" to a high level "1" is a rising edge. A transition from a high level "1" to a low level "0" is a falling edge.

[0103] Based on the above description, although VSync is very effective in limiting the FPS to the refresh rate of the monitor, preventing tearing, in scenarios such as gaming, it leads to a mismatch between the system's UI thread receiving touch events and distributing them, introducing unnecessary delays and increasing touch latency.

[0104] The design of the touch service link shown in FIG1A above is biased towards universality, but the game application scenario has its own particularity. That is, the application interface in the game application is rendered by the game engine. The screen rendering of the game engine can be rendered in real time, and the rendering is not controlled by VSync. If the game application scenario continues to use the above-mentioned solution of distributing touch events based on VSync signals, it will cause touch response delays and fail to meet the user's demand for quick response to touch events. Based on this, the embodiment of the present application proposes an input response optimization method and related electronic devices to break the limitations of existing touch event distribution, so that the game thread can receive touch events faster and at a higher frequency, thereby reducing touch delays, optimizing the sensitivity of touch and other input responses, and improving the user's gaming experience. An exemplary introduction is given below.

[0105] First, the structure of the electronic device provided in the embodiment of the present application is exemplarily introduced. Please refer to Figure 2, which is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiment of the present application.

[0106] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0107] Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0108] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0109] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

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

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

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

[0113] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), BLE broadcast, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

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

[0115] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0116] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0117] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0118] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0119] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

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

[0121] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0122] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0123] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0124] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to realize sound signal collection, noise reduction, and identification of sound sources, and realize directional recording function, etc.

[0125] Based on the hardware structure diagram of the electronic device 100 according to the embodiment of the present application shown in FIG2 , the software structure block diagram of the electronic device 100 according to the embodiment of the present application is exemplarily introduced below.

[0126] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.

[0127] As an example, see Figure 3. A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and native libraries, and the kernel layer.

[0128] The application layer can include a series of application packages. As shown in Figure 3, an application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, or games.

[0129] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0130] As shown in Figure 3, the application framework layer may include a window manager, a content provider, a phone manager, a resource manager, a notification manager, a view system, an activity manager service (AMS), a display manager service (DMS), a game manager module (GM), and an input manager service (IMS).

[0131] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.

[0132] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0133] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0134] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0135] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0136] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0137] The application activity management service is responsible for the scheduling of the application front-end and back-end. In the embodiment of the present application, the application activity management service can provide the game management module with the identification information of the application.

[0138] The display management service is used to manage information such as display brightness and display frame rate. In an embodiment of the present application, the display management service can provide the game management module with information such as the frame rate of the application.

[0139] The game management module is responsible for collecting and optimizing game application information, including frame rate, clarity, and game scenarios. It combines this information with system capabilities to provide the optimal system configuration. In this embodiment of the present application, the game management module has added a game application scenario identification module to identify game application scenarios and indicate the input event distribution method to be used. The specific implementation will be described later and will not be detailed here.

[0140] The input management service is used to distribute input events to application processes and to implement TP reporting rate management, etc. The input events include touch events, mouse events, keyboard events, etc. In the embodiment of the present application, the input management service can provide information such as TP reporting rate to the game management module.

[0141] For example, the above-mentioned functional modules such as application activity management service, display management service, game management module or input management service can be set in the application framework layer in the form of independent modules; or, they can be set in the application framework layer in combination with other functional modules. The embodiments of the present application do not limit the specific setting form of these functional modules. In addition, it is understandable that these functional modules can also be called by other names, not limited to the names shown in the embodiments of the present application. As long as they can realize the functions described in the embodiments of the present application, they belong to the functional modules described in the embodiments of the present application.

[0142] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0143] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0144] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0145] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), and input consumer module.

[0146] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.

[0147] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0148] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0149] A 2D graphics engine is a drawing engine for 2D drawings.

[0150] The input consumption module is used to distribute input events received by the application process to the corresponding application display window. In this embodiment of the present application, an input event distribution switching module is newly added to the input consumption module to distribute received input events according to the indicated input event distribution. The specific implementation is described below and is not detailed here.

[0151] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.

[0152] Based on the electronic device described above, an input response optimization method provided by an embodiment of the present application is described below.

[0153] Based on the above introduction, it can be seen that the application interface displayed in a game application can be rendered by the game engine. Moreover, the game engine's rendering is not controlled by VSync in the electronic device. Therefore, during the game engine rendering process, the corresponding screen can be rendered in response to touch events, without waiting for the arrival of VSync signals to distribute touch events for rendering, thereby reducing touch latency. For easier understanding, please refer to Figure 4 for an example.

[0154] Figure 4 shows a schematic diagram illustrating the effects achieved by the input response optimization method provided by an embodiment of the present application. As can be seen, while the game thread is displaying game frame 1, the UI thread can receive touch event 1 and touch event 2. The UI thread then dispatches touch event 1 and touch event 2 to the game engine for rendering, without waiting for the VSync signal to arrive. Similarly, while the game thread is displaying game frame 2, the UI thread can receive touch event 3 and touch event 4. The UI thread then dispatches touch event 3 and touch event 4 to the game engine for rendering, without waiting for the VSync signal to arrive. Furthermore, it can be seen that since touch event 1 and touch event 2 are dispatched while game frame 1 is being displayed, game frame 2 can display the corresponding interface in response to touch event 1 and touch event 2. Similarly, since touch event 3 and touch event 4 are dispatched while game frame 2 is being displayed, game frame 3 can display the corresponding interface in response to touch event 3 and touch event 4. Compared to FIG1B , where the corresponding interface displays are not made in response to touch events 1 and 2 until game frame 3, the input response optimization method provided in the embodiment of the present application can respond to touch events more quickly and reduce touch latency. It should be understood that FIG4 is merely a schematic diagram of the effect and does not constitute a limitation of the embodiment of the present application.

[0155] In addition, FIG4 above mainly uses the distribution of touch events as an example. In a specific implementation, the distribution is not limited to touch events, and can also include the distribution of other input events such as mouse events or keyboard events. The embodiments of the present application can be applied to the distribution of various input events, without limiting the specific input events.

[0156] In order to achieve the above-mentioned effects, the implementation process of the input response optimization method provided in the embodiment of the present application is exemplarily described below with reference to FIG5 .

[0157] S501: The electronic device recognizes that a first application is a preset game application.

[0158] For example, in a specific implementation, a variety of applications can be run in an electronic device. For example, various applications such as a gallery, a calendar, and a game can be run. It is understandable that the running application described in the embodiment of the present application refers to the application running in the foreground of the electronic device, that is, the user interface of the application is displayed on the display screen of the electronic device. The input response optimization method provided in the embodiment of the present application is designed based on the particularity of the game application, so the electronic device first needs to identify the scene of the game application.

[0159] In one possible implementation, the electronic device can identify whether the first application is a preset game application by obtaining the identification information of the running first application. For example, the identification information of an application can be, for example, the package name of the application or the universally unique identifier (UUID) of the application. It is understandable that the embodiment of the present application does not limit the identification information of the application, and the description here is only an example.

[0160] For example, the electronic device can obtain the identification information of the running first application through the application activity management service AMS. For the convenience of subsequent description, the identification information of the first application is referred to as target identification information. After obtaining the target identification information, the electronic device can compare the target identification information with the preset application identification information to determine whether the target identification information belongs to the preset application identification information.

[0161] Exemplarily, the preset application identification information may be, for example, a preset game application whitelist. The preset game application whitelist may include identification information of one or more preset game applications. The game applications in the whitelist can optimize the input response delay by the input response optimization method provided in the embodiment of the present application. For example, assuming that the above-mentioned target identification information is the package name of the first application, the preset game application whitelist includes the package names of one or more preset game applications. Then, the package name of the first application can be compared with the preset game application whitelist. If the package name of the first application is not on the preset game application whitelist, the first application does not belong to the preset game application. If the package name of the first application is on the preset game application whitelist, it can be known that the first application belongs to the preset game application.

[0162] Exemplarily, the preset application identification information may be present in a configuration file. The configuration file may be, for example, a configuration file implemented based on extensible markup language (XML), referred to as an XML configuration file. The electronic device may obtain the preset application identification information by obtaining the configuration file. The configuration file may be, for example, pre-stored in the electronic device, or may be downloaded from a corresponding server, etc., and this embodiment of the present application does not limit this.

[0163] S502: The electronic device indicates to adopt a direct delivery method based on the above recognition result.

[0164] For example, in a specific implementation, since other applications besides game applications do not have the particularity of game applications, that is, there is no game engine rendering the screen display in real time. Therefore, the electronic device retains a method of distributing input events based on the VSync signal (referred to as the VSync distribution method) for the distribution of input events corresponding to other applications besides game applications. The VSync distribution method can be exemplified by the relevant introduction of the aforementioned Figure 1B, which will not be repeated here. On this basis, the embodiment of the present application also adds a direct distribution method for the distribution of input events corresponding to preset game applications. The direct distribution method refers to a method of distributing rendering after receiving the input event without waiting for the arrival of the VSync signal, that is, the direct distribution method is an input event distribution method independent of the frequency limit of the vertical synchronization signal. For example, the relevant introduction of the aforementioned Figure 4 can be referred to, which will not be repeated here.

[0165] Based on the above description, after the electronic device recognizes that the first application is a preset game application, it can instruct to use a direct distribution method to implement the distribution of the input event of the first application.

[0166] S503: The electronic device distributes the input event based on a direct distribution method.

[0167] For example, in a specific implementation, after the electronic device indicates that a direct distribution method is used to implement the distribution of the input events of the above-mentioned first application, the input events corresponding to the first application can be distributed through the direct distribution method. For example, if the electronic device receives the input event corresponding to the first application, for example, when the electronic device displays the user interface of the first application, the user interface can receive a touch operation from the user and generate an input event input. Then, there is no need to cache the input event, and there is no need to wait for the arrival of the VSync signal. Instead, after receiving the input event, the input event can be distributed to the game engine for corresponding rendering and display.

[0168] To better understand the embodiments of the present application, please refer to the flowchart shown in Figure 6. For example, after the electronic device starts running a first application, it can determine whether the first application is a preset game application. If so, the input event is distributed using a direct distribution method. If not, the input event is distributed using a VSync distribution method. For the specific implementation, please refer to the relevant description of steps S501 to S503 above, which will not be repeated here.

[0169] In one possible implementation, after indicating the input event distribution method used by the first application, the information about the input event distribution method used by the first application can be saved, so that the next time the first application is run, the input event distribution method used by the first application does not need to be determined again. For example, the electronic device can associate and store the identification information of the first application with the identification information indicating the input event distribution method used by the first application, so that the corresponding input event distribution method can be queried using the identification information of the first application.

[0170] For example, based on the above description, when an electronic device switches a first application running in the foreground to the background and then switches it back to the foreground, or when this is not the first time the electronic device is running the first application, the electronic device may first query the input event distribution method used by the first application. If the input event distribution method is found to be VSync distribution method or direct distribution method, the input event is distributed according to the corresponding distribution method. If no such method is found, the input event distribution method used by the first application is indicated according to the description of steps S501 and S502 above.

[0171] This implementation can reduce the computational overhead of re-indicating the distribution method each time the application is run, thereby optimizing system performance.

[0172] Based on the above description, it can be seen that the direct distribution method skips or blocks the caching mechanism and VSync signal triggering mechanism of the VSync distribution method, thereby increasing the distribution frequency of input events, thereby distributing input events faster, making it possible to respond to input events faster and reducing input response latency.

[0173] In one possible implementation, after the electronic device identifies that the first application is a preset game application, it can also obtain the target frame rate of the first game application and the TP reporting rate before indicating that the input event distribution method is the direct distribution method based on the identification result.

[0174] Exemplarily, the target frame rate is the expected frame rate of the first application, or the actual output frame rate of the first application. The frame rate is the number of frames per second (FPS). Exemplarily, the electronic device can obtain the target frame rate of the first application through the display management service DMS in the application framework layer.

[0175] In addition, after the electronic device recognizes the first application, it can also obtain the current TP reporting rate of the electronic device. For example, the electronic device can obtain the TP reporting rate through the input management service IMS in the system library.

[0176] After obtaining the target frame rate and TP reporting rate, the electronic device can determine whether the TP reporting rate is an integer multiple of the target frame rate. If so, the input event distribution method is designated as direct distribution. If not, the input event distribution method can be designated as VSync distribution.

[0177] In this embodiment, direct distribution is used to distribute input events corresponding to the first application only when the TP reporting rate is an integer multiple of the target frame rate, thereby reducing the risk of unstable input response caused by a mismatch between the TP reporting rate and the game's frame rate. For ease of understanding, further examples are provided below.

[0178] Exemplarily, if the TP reporting rate is not an integer multiple of the target frame rate, the number of input events received between different frames will be greatly different, which will cause the dynamic change of the object between frames to be uneven. For example, take Figure 4 above as an example. If the TP reporting rate is not an integer multiple of the target frame rate, then, when displaying game frame 2, two touch events are received and the two events are responded to in game frame 3. The two touch events are, for example, instructions to move a certain object. And when displaying game frame 3, 5 touch events indicating the movement of the object may be received and the 5 events are responded to in game frame 4 (not shown in Figure 4). This will cause the object to move slower in game frame 3 and faster in game frame 4, resulting in an uneven and unstable movement.

[0179] If the TP reporting rate is an integer multiple of the target frame rate, the number of input events received between different frames is small or even the same, making the dynamic changes of objects between frames smooth and stable. Still taking Figure 4 above as an example. If the TP reporting rate is an integer multiple of the target frame rate, then, when displaying game frame 2, two touch events are received and the two events are responded to in game frame 3. Similarly, the two touch events are, for example, instructions to move a certain object. When displaying game frame 3, two touch events indicating the movement of the object are also received and the two events are responded to in game frame 4 (not shown in Figure 4). Then, the moving speed of the object in game frame 3 and the moving speed in game frame 4 remain unchanged, thereby achieving smooth and stable movement of the object. That is, the risk of unstable input response caused by the mismatch between the TP reporting rate and the frame rate of the game is reduced.

[0180] In another possible implementation, if the input event distribution method is indicated as a direct distribution method, the TP reporting rate obtained above must also meet a preset upper limit threshold. That is, if the TP reporting rate is less than or equal to the threshold, and the TP reporting rate is an integer multiple of the above target frame rate, then the input event distribution method can be indicated as a direct distribution method. If the TP reporting rate is greater than the threshold, the VSync distribution method is still used to distribute input events. This embodiment can prevent the risk of excessive power consumption. Since the direct distribution method distributes an input event every time an input event is received, the frequency of distribution increases, and the corresponding power consumption increases. If the TP reporting rate is greater than the threshold, it indicates that the input events received may also increase significantly. In this case, if the direct distribution method is adopted, it may cause excessive power consumption and affect the overall system performance of the electronic device. Therefore, in this embodiment, if the TP reporting rate is greater than the threshold, it is indicated to use the VSync distribution method to distribute input events to prevent the risk of excessive power consumption.

[0181] For example, to facilitate understanding of the implementation process of the above-mentioned implementation method, please refer to Figures 7 and 8 for example. Figure 7 illustrates the flow of data in the software module during the implementation of the above-mentioned solution by the electronic device. Figure 8 illustrates the interaction process between these software modules. As shown in Figures 7 and 8, the embodiment of the present application adds a game application scenario recognition module to the game management module. An input event distribution switching module is also added to the input consumption module.

[0182] For example, after the first application is launched, the game application scenario identification module can obtain the identification information of the first application from the application activity management service (AMS). Based on the identification information of the first application, the module identifies the first application as a pre-defined game application. The module then obtains the target frame rate of the first application from the display management service (DMS) and the TP rate from the input management service (IMS). Based on the obtained target frame rate and TP rate, the module indicates the input event distribution method to be used. The module then sends an indication of the input event distribution method to the input event distribution switching module in the input consumption module. Based on the indication, the module determines the input event distribution method to be used and then distributes the input event to the first application's process according to the indicated input event distribution method, so that the game engine in the process can perform corresponding rendering and display in response to the input event. For a more detailed implementation description, please refer to the previous introduction and will not be elaborated here. It should be understood that Figures 7 and 8 are merely examples and do not constitute limitations on the embodiments of the present application.

[0183] In one possible implementation, the input event distribution switching module can obtain the information indicating the input event distribution method to be used through a status callback from the game management module. For ease of understanding, see Figure 9 for an example. The electronic device launches a first application and runs its process. The first application process then registers a status callback function with the game management process. The game management process can call the game management module to perform corresponding operations. For example, the first application process can register the status callback function by calling a callback registration module native to the electronic device system. The game management process then receives information such as the first application's identification information, target frame rate, and TP rate from the application activity management service (AMS), display management service (DMS), or input management service (IMS). The game management process calls the game application scenario recognition module to indicate the input event distribution method to be used based on the first application's identification information, target frame rate, and TP rate. The game management process then calls the callback function to return information indicating the input event distribution method to the first application process. The process of the first application calls the input event distribution switching module to adopt the input event distribution method indicated by the instruction information, and distributes the input event based on the distribution method.

[0184] In one possible implementation, the operations of registering the state callback function, receiving the callback indication information, and calling the input event distribution switching module to distribute input events can be performed by an input event consumer thread in the first application process. In one possible implementation, the first application process includes multiple input event consumer threads. For example, when displaying the user interface of the first application and also displaying a prompt box such as a message notification or reminder, the user interface corresponds to an input event consumer thread, and the prompt box can also correspond to an input event consumer thread. Each of the multiple input event consumer threads can call the input event distribution switching module to distribute input events. Therefore, the multiple input event consumer threads can reuse the same state callback function. That is, the indication information indicating the input event distribution method used, returned by the game management process to the first application process when calling the callback function, can be shared by the multiple input event consumer threads. This reduces the overhead of multiple callback function registrations.

[0185] In one possible implementation, after the electronic device identifies the first application as the preset game application, the first application process may register a status callback function with the game management process. For example, after the electronic device starts the first application and runs the process of the first application, it may first identify whether the first application is a preset game application through the game management module. For specific implementation, please refer to the corresponding introduction above and will not be repeated here. The first application process may then query the game management module to determine whether the first application is a preset game application. If the first application is a preset game application, the first application process may register a status callback function with the game management process and perform subsequent operations such as monitoring the input event distribution method. If the first application is not a preset game application, the first application process will not register a status callback function with the game management process and will not perform subsequent operations such as monitoring the input event distribution method. This implementation method can avoid the registration and notification of a large number of irrelevant applications within the system, thereby reducing resource usage.

[0186] In summary, the input response optimization method provided by the embodiments of the present application allows the application process of a game application to directly distribute input events to the game engine for rendering, without waiting for the arrival of a VSync signal. This enables rapid response to input events and reduces input response latency. For a more intuitive understanding of the effects achieved by the embodiments of the present application, please refer to Figures 10 and 11 for example.

[0187] First, Figures 10(a) and 10(b) illustrate schematic diagrams of two existing implementations for triggering input event distribution based on the VSync signal. As can be seen, an input event cache queue can be used to indicate the number of cached input events. The rising or falling edge of the VSync signal can trigger the distribution of input events. For example, in Figures 10(a) and 10(b), times t1 and t5 are the times when the falling edge of the VSync signal arrives, and time t3 is the time when the rising edge of the VSync signal arrives.

[0188] For example, before the falling edge of the VSync signal arrives at time t1, the input events in the input event cache queue continue to accumulate. Then, at time t1, the falling edge of the VSync signal arrives, and the distribution of input events begins based on the trigger of this falling edge. Since there is a certain delay in the distribution processing, you can see that the input events in the input event cache queue decrease at time t2. After this distribution is completed, the input events in the input event cache queue begin to accumulate again. Then, at time t3, the rising edge of the VSync signal arrives, and the distribution of input events begins based on the trigger of this rising edge. Since there is a certain delay in the distribution processing, you can see that the input events in the input event cache queue decrease at time t4. The description of times t5 and t6 refers to times t1 and t2 and will not be repeated. It can be seen that in the existing implementation scheme, due to the limitation of the VSync frequency, input events accumulate and cannot be distributed in time.

[0189] For example, see Figure 11. Figure 11 shows a schematic diagram of distributing input events through direct distribution in an embodiment of the present application. It can be seen that the number of cached input events can also be indicated by an input event cache queue. The difference is that in the implementation process of distributing input events through direct distribution, each input event received can be distributed, without being restricted by the VSync signal, so that the accumulation of input events will not occur. This achieves a rapid response to input events and reduces input response latency.

[0190] It should be understood that the above-mentioned Figures 10 and 11 are merely examples and do not constitute a limitation to the embodiments of the present application.

[0191] An embodiment of the present application also provides an electronic device, which includes one or more processors and one or more memories; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the above embodiment.

[0192] An embodiment of the present application also provides a chip system, which is applied to an electronic device. The chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the above embodiment.

[0193] The embodiments of the present application also provide a computer program product containing instructions. When the computer program product is run on an electronic device, the electronic device executes the method described in the above embodiments.

[0194] An embodiment of the present application further provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method described in the above embodiment.

[0195] It is understandable that the various embodiments of the present application can be combined arbitrarily to achieve different technical effects.

[0196] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented 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, all or part of the processes or functions described herein are generated. 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. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. 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 therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).

[0197] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium. When executed, the program can include the processes in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0198] In short, the above description is only an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included in the scope of protection of the present invention.

Claims

1. An input response optimization method, characterized in that: The method is applied to an electronic device, and the method comprises: Detecting a first input event of a user on a first interface, where the first interface is an interface of a first application; When the first application is a preset game application, before a rising edge or a falling edge of a vertical synchronization signal appears, the first input event is distributed; and a picture is rendered in response to the first input event; Detecting a second input event of the user on a second interface, where the second interface is an interface of a second application; When the second application does not belong to the preset game application, the second input event is distributed after the rising edge or the falling edge of the vertical synchronization signal appears, and the picture is rendered in response to the second input event.

2. The method according to claim 1, characterized in that said distributing said first input event; And rendering a picture in response to the first input event includes: The first input event is distributed to a game engine; and a picture is rendered by the game engine in response to the first input event.

3. The method according to claim 1 or 2, characterized in that: Before the first input event of the user on the first interface is detected, the method further includes: Obtaining identification information of the first application; Based on the identification information of the first application, it is known that the first application belongs to the preset game application.

4. The method according to claim 3, characterized in that The first input event includes a touch event; after the first application is learned based on the identification information of the first application that the first application is a game application in a preset whitelist, the method further includes: Acquire the frame rate of the first application and the TP reporting rate of the touch screen of the electronic device; When the TP reporting rate is an integer multiple of the frame rate, it indicates that a direct distribution method is adopted; the direct distribution method is an input event distribution method independent of the frequency limit of the vertical synchronization signal.

5. The method according to claim 4, characterized in that The TP reporting rate is less than or equal to a preset threshold.

6. The method according to claim 4 or 5, characterized in that: After the direct distribution method is adopted, the instructions also include: Notifying the process of the first application of indication information of adopting the direct distribution method through a status callback; The step of distributing the first input event to the game engine before the rising edge or the falling edge of the vertical synchronization signal occurs comprises: Before a rising edge or a falling edge of the vertical synchronization signal occurs, the first input event is distributed to the game engine through the process of the first application.

7. The method according to any one of claims 3 to 6, characterized in that: After the first application is learned, based on the identification information of the first application, that the first application is a game application in a preset whitelist, the method further includes: A status callback function is registered; the status callback function is used to notify the process of the first application of indication information of the input event distribution method used.

8. The method according to claim 7, characterized in that The first application process includes a plurality of input event consumption threads, and the plurality of input event consumption threads are used to jointly execute the distribution of input events acting on the first application; The multiple input event consumption threads share the indication information of the adopted input event distribution mode.

9. The method according to any one of claims 4 to 8, characterized in that: After the indication adopts the direct distribution method, the method further includes: associating and saving the identification information of the first application and the identification information of the direct distribution method; The method further comprises: Exiting the first application; When the first application is run again, querying the input event distribution method adopted by the first application based on the identification information of the first application to obtain the identification information of the direct distribution method; The input event for the first application is distributed using the direct distribution method based on an indication of the identification information of the direct distribution method.

10. The method according to any one of claims 3 to 9, characterized in that: The step of obtaining, based on the identification information of the first application, that the first application belongs to the preset game application includes: Comparing the identification information of the first application with the identification information of applications included in a preset whitelist; the preset whitelist includes the identification information of the preset game application; When the preset whitelist includes the identification information of the first application, it is known that the first application belongs to the preset game application.

11. The method according to claim 10, characterized in that The preset whitelist is stored in a configuration file.

12. The method according to any one of claims 1 to 11, characterized in that: The distributing the second input event and rendering a picture in response to the second input event includes: The second input event is distributed to a native rendering module of the electronic device; and a picture is rendered by the rendering module in response to the second input event.

13. An electronic device, characterized in that: include: A touch screen, one or more processors, and one or more memories; the one or more processors are coupled to the touch screen and the one or more memories; the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-12.

14. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 12.

15. A computer program product comprising instructions, characterized in that When the computer program product is executed on an electronic device, the electronic device is enabled to execute the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Input response optimization method and related electronic equipment

    CN119215398A

  • Rendering time consumption acquisition method, rendering time display method, performance monitoring method and device, and equipment

    CN112346935A

  • Image processing method based on vertical synchronization signal and electronic equipment

    CN112351326A

  • Event processing method and device

    CN114327697A

  • Display servers and systems and methods of graphical display

    US20070038939A1