Display control method and related device
By increasing the generation frequency of vertical synchronization signals in electronic devices, using touch sampling rate and screen refresh rate to generate signals, we can determine in advance whether the sliding operation reaches the response threshold, which solves the problem of long touch delay time in electronic devices and improves the equipment chirality and user experience.
Patent Information
- Application Number
- PCT/CN2024/082486
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-12
- Filing Date
- 2024-03-19
- Publication Date
- 2024-12-19
AI Technical Summary
Existing electronic devices have a long touch delay time when users interact with devices, which affects the user experience. How to effectively shorten the touch delay time to improve the device's chirality.
By adopting a display control method in an electronic device, the frequency of generating vertical synchronization signals is increased, and the touch sampling rate and screen refresh rate are used to generate vertical synchronization signals, so as to determine in advance whether the sliding operation reaches the sliding response threshold, prompting the application thread to slide in the user When the operation reaches the threshold, draw and render the image as soon as possible.
It shortens the touch delay time of electronic devices, improves the chirality of electronic devices, and improves the user's interactive experience.
Smart Images

Figure CN2024082486_19122024_PF_FP_ABST
Abstract
Description
Display control method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 12, 2023, with application number 202310696576.5 and application name “Display Control Method and Related Equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of terminal technology, and in particular to a display control method and related equipment. Background Art
[0003] Touch screens (TP) are widely used in various electronic devices, and users can achieve human-computer interaction with electronic devices through touch screens. As users have higher and higher requirements for the human-computer interaction performance of electronic devices, chirality has become an important indicator that affects the interactive operation performance of electronic devices. Chirality can also be called touch delay, which can reflect the speed at which the screen interface responds to the touch operation when the user acts on the touch screen through touch operation. Among them, the faster the response speed, the shorter the touch delay time, and the better the chirality; the slower the response speed, the longer the touch delay time, and the worse the chirality. If there is a long touch delay time, it will seriously affect the user's device usage experience. How to effectively shorten the touch delay time and improve the chirality of electronic devices is a problem that electronic devices that support touch operations must face.
[0004] Summary of the Invention
[0005] In view of the above, it is necessary to provide a display control method that can shorten the touch delay time of the electronic device and improve the hand tracking performance of the electronic device.
[0006] In the first aspect, the present application provides a display control method, which is applied to an electronic device, and the method includes: receiving a first operation of a user; in response to the first operation, starting a first application; receiving a second operation of the user on the first application, the second operation including a sliding operation; in response to the second operation, obtaining the touch point coordinates and touch events of the second operation based on the touch sampling rate of the electronic device; generating a first vertical synchronization signal based on the screen refresh rate of the electronic device, and generating a second vertical synchronization signal based on the touch event, wherein the frequency of generating the second vertical synchronization signal based on the touch event request is equal to the touch sampling rate; in response to any one of the first vertical synchronization signal and the second vertical synchronization signal, and when the second operation reaches the sliding response threshold of the first application, performing drawing and rendering of the image frame to be refreshed and displayed.
[0007] By adopting the above technical solution, the electronic device generates a vertical synchronization signal in two ways. One is to adopt the existing method to generate a vertical synchronization signal based on the screen refresh rate, and the other is to additionally generate a vertical synchronization signal based on the touch event. That is, by increasing the generation frequency of the vertical synchronization signal, the number of times of judging whether the sliding operation reaches the sliding response threshold can be increased. Compared with the existing sliding touch solution, it is possible to judge whether the sliding operation reaches the sliding response threshold in advance, so that the application thread of the application can draw and render the image as soon as possible when the user's sliding operation reaches the sliding response threshold, which can shorten the touch delay time of the electronic device and improve the hand tracking performance of the electronic device.
[0008] In one possible implementation, in response to any one of the first vertical synchronization signal and the second vertical synchronization signal, and the second operation reaches the sliding response threshold of the first application, the drawing and rendering of the image frame to be refreshed and displayed are executed, including: in response to any one of the first vertical synchronization signal and the second vertical synchronization signal, determining whether the second operation reaches the sliding response threshold of the first application based on the acquired touch point coordinates; when the second operation reaches the sliding response threshold of the first application, the drawing and rendering of the image frame to be refreshed and displayed are executed.
[0009] By adopting the above technical solution and setting a sliding response threshold for the application, the application interface can be prevented from being updated due to the user accidentally touching the application interface. The application thread of the application can respond to the vertical synchronization signal to determine whether the sliding operation has reached the sliding response threshold. By increasing the generation frequency of the vertical synchronization signal, the number of times the sliding operation reaches the sliding response threshold is increased. This can prompt the application thread of the application to draw and render the image as soon as the user's sliding operation reaches the sliding response threshold, thereby shortening the touch delay time of the electronic device and improving the hand tracking performance of the electronic device.
[0010] In one possible implementation, the touch event includes a first press event (DOWN event), a move event (MOVE event), and a release event (UP event), and generating a second vertical synchronization signal based on the touch event includes: generating a second vertical synchronization signal based on the MOVE event.
[0011] Using the above technical solution, the touch event of the second operation may include a DOWN event, several MOVE events, and an UP event. The DOWN event refers to a press event generated when the user starts touching the screen, which is usually used to start a new operation or gesture. The MOVE event refers to a movement event generated when the user moves a finger on the screen, which can be used to track the movement trajectory of the finger and implement functions such as dragging and sliding. The UP event refers to a release event generated when the user lifts the finger, which is usually used to complete an operation or gesture. Since the present application solution is related to improving the tracking performance of the sliding operation, the user's sliding has just started when the DOWN event is received, and it is obviously unable to reach the sliding response threshold of the application. There is no need to generate an additional vertical synchronization signal based on the DOWN event request. The UP event represents the end of the user's sliding. The additional generation of the vertical synchronization signal based on the UP event request is generated late, and it is impossible to determine in advance whether the sliding operation has reached the sliding response threshold. By generating an additional vertical synchronization signal based on the MOVE event request, it is possible to determine in advance whether the sliding operation has reached the sliding response threshold, thereby shortening the touch delay time of the electronic device and improving the tracking performance of the electronic device.
[0012] In one possible implementation, generating a second vertical synchronization signal based on a MOVE event includes: recording the number of MOVE events; and generating a second vertical synchronization signal based on the MOVE event when the number of MOVE events is greater than a first preset value, wherein the first preset value is set based on a sliding response threshold of the first application.
[0013] By adopting the above technical solution, after receiving a DOWN event, by counting the MOVE events, when the number of MOVE events is greater than the first preset value, a second vertical synchronization signal is generated based on the MOVE event request, so as to attempt to add a new vertical synchronization signal in response to the MOVE event that may actually reach the sliding response threshold, thereby avoiding adding too many meaningless vertical synchronization signals, and avoiding the situation where the abnormal sliding scene triggers the new vertical synchronization signal multiple times. For example, in the case of an accidental touch on the display screen, since the sliding distance of the accidental touch is limited, the number of MOVE events generally cannot reach the first preset value, that is, the electronic device will not attempt to add a new vertical synchronization signal, which can avoid the abnormality of frequently attempting to add a new vertical synchronization signal due to the accidental touch, affecting the working rhythm of the synthesis thread (SurfaceFlinger thread), and causing a meaningless increase in the application thread load.
[0014] In a possible implementation, generating the second vertical synchronization signal based on the MOVE event includes: generating the second vertical synchronization signal based on the MOVE event when a newly added vertical synchronization signal function is in an enabled state.
[0015] Using the above technical solution, turning on the newly added vertical synchronization signal function will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. Users of the electronic device can choose to turn on or off the newly added vertical synchronization signal function according to actual needs. For example, by adding a "new vertical synchronization signal function" icon in the settings interface, the electronic device will only generate an additional vertical synchronization signal based on the MOVE event when the newly added vertical synchronization signal function is turned on.
[0016] In one possible implementation, when the newly added vertical synchronization signal function is in the turned-on state, a second vertical synchronization signal is generated based on a MOVE event, including: when the newly added vertical synchronization signal function is in the turned-on state and the first application is a preset application, the second vertical synchronization signal is generated based on the MOVE event.
[0017] With the above technical solution, turning on the newly added vertical synchronization signal function will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. It can be set to take effect only in scenarios that have certain requirements for the initial sliding and chirality. For example, some preset applications can be effective only for applications in the application whitelist by building an application whitelist. The applications in the application whitelist can be set by users or developers. When the newly added vertical synchronization signal function is turned on and the first application is an application in the application whitelist, the electronic device will generate an additional vertical synchronization signal based on the MOVE event.
[0018] In one possible implementation, when the newly added vertical synchronization signal function is in the turned-on state and the first application is a preset application, the second vertical synchronization signal is generated based on the MOVE event, including: when the newly added vertical synchronization signal function is in the turned-on state and the first application is a preset application, determining whether the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal; when the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal, generating the second vertical synchronization signal based on the MOVE event.
[0019] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. By setting the generation time conditions for the additional vertical synchronization signal, it is possible to avoid the situation where the additionally generated vertical synchronization signal is too close to the generation time of the original vertical synchronization signal, resulting in the additionally generated vertical synchronization signal not having much significance. When the newly added vertical synchronization signal function is turned on, and the first application is an application in the application whitelist, and meets the generation time conditions for the additional vertical synchronization signal, the electronic device will generate an additional vertical synchronization signal based on the MOVE event.
[0020] In one possible implementation, determining whether the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal includes: obtaining a first time difference between the moment when the MOVE event is received and the generation moment of the previous first vertical synchronization signal, and a second time difference between the moment when the MOVE event is received and the generation moment of the next first vertical synchronization signal to be generated; determining whether the first time difference is greater than a preset duration, and whether the second time difference is greater than a preset duration; when both the first time difference and the second time difference are greater than the preset duration, determining that the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal.
[0021] By adopting the above technical solution, in the process of additionally generating a vertical synchronization signal based on a MOVE event, the time difference between the moment when the MOVE event is received and the previous vertical synchronization signal generated based on the screen refresh rate, as well as the time difference between the next vertical synchronization signal to be generated based on the screen refresh rate, is obtained to determine whether the generation time condition of the additional vertical synchronization signal is met. If the timing difference between the two is greater than the preset duration, it indicates that the additionally generated vertical synchronization signal is not too close to the generation time of the original vertical synchronization signal, and it is determined that the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal, and an additional vertical synchronization signal can be generated based on the MOVE event.
[0022] In a possible implementation, after the second vertical synchronization signal is generated based on the touch event, the method further includes: when it is detected that drawing and rendering of an image frame to be refreshed and displayed is being executed, turning off a function of adding a new vertical synchronization signal.
[0023] Adopting the above-mentioned technical solution and turning on the newly added vertical synchronization signal function will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. If it is detected that the application thread is executing the drawing and rendering of the image frame to be refreshed and displayed, it indicates that the application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate an additional vertical synchronization signal. By turning off the newly added vertical synchronization signal function, not only can the power consumption of the electronic device be reduced, but also excessive generation of vertical synchronization signals can be avoided, which affects the working rhythm of the synthesis thread.
[0024] In a possible implementation, after the second vertical synchronization signal is generated based on the touch event, the method further includes: in response to an UP event, disabling a function of adding a new vertical synchronization signal.
[0025] Adopting the above-mentioned technical solution and turning on the newly added vertical synchronization signal function will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. If an UP event is detected, it indicates that the user's second operation has ended, and the application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate an additional vertical synchronization signal. By turning off the newly added vertical synchronization signal function, not only can the power consumption of the electronic device be reduced, but also excessive generation of vertical synchronization signals can be avoided, which affects the working rhythm of the synthesis thread.
[0026] In one possible implementation, after generating a second vertical synchronization signal based on a touch event, it also includes: recording the number of MOVE events; when the number of MOVE events is greater than a second preset value, turning off the new vertical synchronization signal function, and the second preset value is set based on the sliding response threshold of the first application.
[0027] Adopting the above-mentioned technical scheme and turning on the newly added vertical synchronization signal function will, to a certain extent, bring about the problem of increased load on the application, resulting in increased power consumption of the electronic device. After receiving the DOWN event, by counting the MOVE events, when the number of MOVE events is greater than the second preset value, it indicates that the sliding distance of the second operation may have already exceeded the sliding response threshold of the application. The application thread has most likely responded to the vertical synchronization signal to draw and render the layer. The application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate an additional vertical synchronization signal. By turning off the newly added vertical synchronization signal function, not only can the power consumption of the electronic device be reduced, but also excessive generation of vertical synchronization signals can be avoided, which affects the working rhythm of the synthesis thread.
[0028] In a possible implementation, after executing drawing and rendering of the image frame to be refreshed and displayed, the method further includes: enabling a newly added vertical synchronization signal function when a second DOWN event is received.
[0029] By adopting the above technical solution, after the newly added vertical synchronization signal function is turned off, if a second DOWN event is received, it indicates that the electronic device has received a new sliding operation. The electronic device can increase the frequency of generating the vertical synchronization signal by turning on the newly added vertical synchronization signal function, thereby increasing the number of times of judging whether the sliding operation reaches the sliding response threshold. Compared with the existing sliding touch solution, it can judge whether the sliding operation reaches the sliding response threshold in advance, so that the application thread of the application can draw and render the image as soon as possible when the user's sliding operation reaches the sliding response threshold, which can shorten the touch delay time of the electronic device and improve the hand tracking performance of the electronic device.
[0030] In a possible implementation, after drawing and rendering the image frame to be refreshed and displayed, the method further includes: synthesizing and displaying the rendered image frame.
[0031] By adopting the above technical solution, after drawing and rendering the image frame to be refreshed and displayed, the rendered image frame is synthesized and displayed, so that the user can see the application interface after the application is refreshed on the display screen, and the application responds to the user's second operation to refresh the application interface.
[0032] In the second aspect, the present application provides a display control method, which is applied to an electronic device, and the method includes: receiving a first operation of a user; in response to the first operation, starting a first application; receiving a second operation of the user on the first application, the second operation including a sliding operation; in response to the second operation, obtaining the touch point coordinates and touch events of the second operation based on the touch sampling rate of the electronic device; generating a first vertical synchronization signal and a second vertical synchronization signal based on the screen refresh rate of the electronic device, and generating a third vertical synchronization signal based on the touch event, wherein the frequency of generating the third vertical synchronization signal based on the touch event request is equal to the touch sampling rate, and the third vertical synchronization signal is between the first vertical synchronization signal and the second vertical synchronization signal; in response to the third vertical synchronization signal, and when the second operation reaches the sliding response threshold of the first application, performing drawing and rendering of the image frame to be refreshed and displayed.
[0033] By adopting the above technical solution, the electronic device generates a vertical synchronization signal in two ways. One is to adopt the existing method to generate a vertical synchronization signal based on the screen refresh rate, and the other is to additionally generate a vertical synchronization signal based on the touch event. That is, by increasing the generation frequency of the vertical synchronization signal, the number of times of judging whether the sliding operation reaches the sliding response threshold can be increased. Compared with the existing sliding touch solution, it is possible to judge whether the sliding operation reaches the sliding response threshold in advance, so that the application thread of the application can draw and render the image as soon as possible when the user's sliding operation reaches the sliding response threshold, which can shorten the touch delay time of the electronic device and improve the hand tracking performance of the electronic device.
[0034] In one possible implementation, in response to a third vertical synchronization signal and the second operation reaches the sliding response threshold of the first application, drawing and rendering of the image frame to be refreshed and displayed are executed, including: in response to the third vertical synchronization signal, determining whether the second operation reaches the sliding response threshold of the first application based on the acquired touch point coordinates; when the second operation reaches the sliding response threshold of the first application, drawing and rendering of the image frame to be refreshed and displayed are executed.
[0035] By adopting the above technical solution and setting a sliding response threshold for the application, the application interface can be prevented from being updated due to the user accidentally touching the application interface. The application thread of the application can respond to the vertical synchronization signal to determine whether the sliding operation has reached the sliding response threshold. By increasing the generation frequency of the vertical synchronization signal, the number of times the sliding operation reaches the sliding response threshold is increased. This can prompt the application thread of the application to draw and render the image as soon as the user's sliding operation reaches the sliding response threshold, thereby shortening the touch delay time of the electronic device and improving the hand tracking performance of the electronic device.
[0036] In a possible implementation, before responding to the third vertical synchronization signal, the method further includes: responding to the first vertical synchronization signal and determining, based on the acquired touch point coordinates, that the second sliding operation does not reach a sliding response threshold of the first application.
[0037] With the above-mentioned technical solution, the application thread responds to the first vertical synchronization signal, determines that the second sliding operation has not reached the sliding response threshold of the first application, and the application thread continues to wait for the arrival of the next vertical synchronization signal. When the third synchronization signal arrives, the application thread responds to the third vertical synchronization signal, determines that the second sliding operation has reached the sliding response threshold of the first application, and the application thread draws and renders the image. Compared with the existing sliding touch solution that needs to wait for the arrival of the second vertical synchronization signal, it can judge in advance whether the sliding operation has reached the sliding response threshold, so that the application thread of the application can draw and render the image as soon as possible when the user's sliding operation reaches the sliding response threshold, which can shorten the touch delay time of the electronic device and improve the hand tracking performance of the electronic device.
[0038] In a third aspect, the present application provides an electronic device, which includes a touch screen, a memory and a processor; the touch screen, the memory and the processor are coupled; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the display control method of the first aspect, or to implement the display control method of the second aspect.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor, the display control method of the first aspect or the display control method of the second aspect is implemented.
[0040] In a fifth aspect, the present application provides a chip coupled to a memory in an electronic device, and the chip is used to control the electronic device to execute the display control method of the first aspect, or implement the display control method of the second aspect.
[0041] In addition, the technical effects brought about by the third to fifth aspects can be found in the descriptions of the methods of each design in the above method section, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] FIG1A is a schematic diagram of a software processing flow for displaying an image in response to a touch operation according to an embodiment of the present application;
[0043] FIG1B is a schematic diagram of touch delay time in the software processing flow shown in FIG1A ;
[0044] FIG2 is a schematic diagram of touch point coordinates of a touch event provided by an embodiment of the present application;
[0045] FIG3A is a schematic diagram of a sliding operation scenario provided in an embodiment of the present application;
[0046] FIG3B is a schematic diagram of a scenario in which an application does not respond to a sliding operation according to an embodiment of the present application;
[0047] FIG3C is a schematic diagram of a scenario in which an application responds to a sliding operation according to an embodiment of the present application;
[0048] FIG4 is a flow chart of a display control method provided by an embodiment of the present application;
[0049] FIG5 is a schematic diagram showing a simplified principle of the process shown in FIG4 ;
[0050] FIG6 is a schematic diagram showing the principle of a display control method provided in an embodiment of the present application;
[0051] FIG7 is a flowchart of adding a vertical synchronization signal to a display control process according to an embodiment of the present application;
[0052] FIG8 is a flow chart of a display control method provided by another embodiment of the present application;
[0053] FIG9 is a flowchart of a display control method provided by another embodiment of the present application;
[0054] FIG10 is a software architecture diagram of an electronic device provided in one embodiment of the present application;
[0055] FIG11 is a schematic diagram of an application scenario of a display control method provided by an embodiment of the present application;
[0056] FIG12 is a hardware architecture diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0057] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the said features. In the description of the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete way.
[0058] To facilitate understanding of the following introduction to the display control method provided in the embodiments of the present application, some terms used in the embodiments of the present application are explained below for easier understanding.
[0059] (1) Touch sampling rate, which is used to indicate the number of times the touch panel (TP) samples and reports the touch signal in a unit of time. For example, if the touch sampling rate is 120Hz, then the touch panel will sample and report the touch signal 120 times in one second. The higher the touch sampling rate, the more timely the electronic device can respond to the user's touch operation, which can include click operations, sliding operations, etc. If the user performs continuous touch operations on the touch screen (for example, the user continuously slides his finger on the screen, etc.), the higher the touch sampling rate, the more timely the touch screen can determine and update the coordinates of the touch point. Among them, the touch sampling rate of the touch screen is generally 120Hz, then the corresponding sampling period can be: T1 = 1 / 120 = 0.0083 seconds (s) = 8.3 milliseconds (ms). That is, the touch screen samples and reports the touch signal every 8.3 milliseconds.
[0060] (2) Screen refresh rate is the number of times a screen (such as a touch screen TP) can refresh the image per second, and the unit is Hertz (Hz). For example, a screen refresh rate of 60Hz means that the screen can refresh the display 60 times in 1 second. Similarly, a screen refresh rate of 120Hz means that the screen can refresh the display 120 times in 1 second. Therefore, the higher the refresh rate, the more frames the screen can display. Correspondingly, the lower the image delay and the higher the smoothness. Electronic devices can support multiple different screen refresh rates.
[0061] (3) A vertical synchronization signal can be used to trigger the drawing of one or more layers. In the embodiment of the present application, in response to the vertical synchronization signal, the electronic device can use each of the multiple drawing threads to draw one or more layers for each application. That is, the application thread corresponding to each application will not start working until the vertical synchronization signal arrives, ensuring the display continuity of the application interface.
[0062] In different systems or architectures, the name of the vertical synchronization signal may be different. For example, in some systems or architectures, the name of the vertical synchronization signal used to trigger the drawing of one or more layers may also be called the application vertical synchronization signal (VsyncApp). Regardless of the name of the vertical synchronization signal, as long as it is a synchronization signal with similar functions and conforms to the technical ideas of the method provided in the embodiments of the present application, it should be covered within the scope of protection of this application.
[0063] In an embodiment of the present application, the vertical synchronization signal is a periodic discrete signal. For example, a vertical synchronization signal occurs every signal period. Because the vertical synchronization signal is a periodic signal, the arrival of the vertical synchronization signal described in an embodiment of the present application may indicate the arrival of a pulse edge of the vertical synchronization signal. The pulse edge is a pulse edge that can be visually observed on an oscilloscope or observation system. In different systems, it may be a rising edge, a falling edge, or both. In an actual system, it may be implemented through timer flipping, interrupt signals, and the like.
[0064] The following describes the touch delay associated with touch operations on a touch screen of an electronic device, using Figures 1A and 1B. Touch delay refers to the speed at which the screen reacts to a touch operation performed by a user. A touch operation can be any operation in which a user touches or moves the touch screen with a finger or stylus.
[0065] As shown in Figure 1A, the electronic device may include: a touch panel (TP) integrated circuit (IC) / TP driver (Driver) 10, an input (Input) framework (i.e., Input Framework) 20, a user interface (UI) framework (i.e., UI Framework) 30, a display (Display) framework (i.e., Display Framework) 40 and a hardware display module 50.
[0066] The software processing flow of the electronic device may include the following steps.
[0067] Step (1): For example, a user touches the touch screen with their finger. After the touch layer in the TP IC / TP driver 10 detects the user's touch operation, the touch driver reports the corresponding touch point coordinates and touch events to the event management center (Event Hub). Touch events can include press (DOWN) events, move (MOVE) events, and release (UP) events.
[0068] Step (2): The Input Reader thread of the Input framework 20 receives the touch point coordinates and touch events reported by the Event Hub, and then sends the touch point coordinates and touch events to the Input Dispatcher thread; the Input Dispatcher thread reports the touch point coordinates and touch events to the application thread in the UI framework 30. For example, if the application currently running in the foreground is an instant messaging application (APP), and the APP refreshes the application interface in response to the user's finger touch operation, the application thread can refer to the thread of the IM APP.
[0069] Step (3): The application thread in the UI framework 30 draws one or more layers based on the touch point coordinates and the touch event, and performs layer rendering on the one or more layers.
[0070] Step (4): The synthesis thread in the Display framework 40 performs layer synthesis on the rendered one or more layers to obtain an image frame.
[0071] Step (5): The display driver of the hardware display module 50 receives the synthesized image frame, and the display driver can drive a display layer, such as a liquid crystal display panel, to display the synthesized image frame. After the display layer displays the image frame, the image displayed by the display layer can be perceived by the human eye.
[0072] In some embodiments, chirality can reflect the speed at which the screen responds to a touch operation performed by a user using a finger or stylus. That is, the speed at which the electronic device executes steps (1) to (5) in the above process. The faster the response speed, the shorter the touch delay time, the better the chirality of the electronic device, and the better the user touch experience; the slower the response speed, the longer the touch delay time, the worse the chirality of the electronic device, and the worse the user touch experience.
[0073] The display control method provided in the present application can increase the number of times the application thread in the UI framework 30 determines whether a sliding operation has reached a sliding response threshold by triggering the display framework 40 to additionally generate a vertical synchronization signal. Compared with existing sliding touch solutions, the application thread can determine whether a sliding operation has reached a sliding response threshold in advance, prompting the application thread to start working as soon as the user's sliding operation reaches the sliding response threshold, thereby improving the hand tracking performance of the electronic device.
[0074] The touch delay time involved in the above software processing flow is shown in Figure 1B. For example, in the above step (1), when the TP IC / TP driver 10 collects touch operations and reports touch point coordinates and touch events to the Input framework 20, there may be a kernel delay t11 as shown in Figure 1B. In the above step (2), when the Input framework 20 receives the reported touch point coordinates and touch events and inputs the touch point coordinates and touch events to the UI framework, there may be an input delay t12 as shown in Figure 1B. In the above step (3), when the application thread in the UI framework draws one or more layers and renders the drawn one or more layers, there may be a drawing and rendering delay t13 as shown in Figure 1B. In the above step (4), when the synthesis thread in the Display framework 40 performs layer synthesis, there may be a synthesis delay t14 as shown in Figure 1B. In the above step (5), when the hardware display module 50 displays the synthesized image frame, there may be a display transmission delay t15 as shown in Figure 1B.
[0075] In different application scenarios, the touch operations performed by the user on the touch screen are different, and the specific meanings of the corresponding tracking chirality are also different. For example, when the user touches the touch screen and releases it, the tracking chirality of the electronic device in responding to the touch is click tracking chirality; when the user slides the touch screen, the tracking chirality of the electronic device in responding to the slide is sliding tracking chirality; when the user just starts touching the touch screen, the tracking chirality of the electronic device in responding to the touch is initial tracking chirality; when the user slides to the edge of the touch screen or the end of the content, the tracking chirality of the electronic device in responding to the slide is return tracking chirality; when the user just starts touching and sliding the touch screen, the tracking chirality of the electronic device in responding to the touch and slide is initial sliding tracking chirality. The embodiments of the present application mainly relate to initial sliding tracking chirality. The initial sliding tracking chirality described in the present application can be expressed as the duration of the process from the user starting to touch and slide an application interface displayed on the touch screen to the application responding to the slide and refreshing the application interface. That is, the touch delay time involved in the initial sliding tracking may include kernel delay t11, input delay t12, drawing and rendering delay t13, synthesis delay t14 and display delay t15.
[0076] In order to more clearly understand the initial sliding chirality described in the embodiment of the present application, the touch point coordinates corresponding to the touch event in the process from the user performing a sliding operation on the touch screen to the touch screen responding to the sliding operation are now explained. Referring to Figure 2, it is assumed that an XY coordinate system is constructed using the touch screen of an electronic device. The coordinate system is based on the lower left corner vertex of the touch screen as the origin, and the directions of the X axis and the Y axis are as shown in Figure 2. A touch event can be an event that occurs when the user interacts through the touch screen and the touch screen detects the user's touch operation and reports it at the corresponding position. During the sliding operation, touch events will be continuously generated in the process of the user's finger sliding, and touch point coordinates will also be continuously generated in the process of the user's finger sliding.
[0077] When a user performs a sliding operation on the touch screen of an electronic device, the touch sensor in the electronic device can detect the touch operation applied by the user on the touch screen. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Specifically, from the time the user starts touching the touch screen, through the sliding process until the hand is lifted, the touch events generated by the kernel layer of the electronic device may include: a press event (also called a DOWN event), several movement (also called MOVE events) events, and a release event (also called an UP event), where the number of MOVE events depends on the time the user touches the screen. Among them, the DOWN event refers to the press event generated when the user starts touching the touch screen, which is usually used to start a new operation or gesture. The MOVE event refers to the movement event generated when the user moves his finger on the screen, which can be used to track the movement trajectory of the finger and implement functions such as dragging and sliding. The UP event refers to the release event generated when the user lifts his finger, which is usually used to complete an operation or gesture.
[0078] In Figure 2, assume that position 1 is the touch point coordinate corresponding to the DOWN event on the touch screen, that is, position 1 is the starting position of the user's sliding operation on the touch screen, and position 5 is the touch point coordinate corresponding to the UP event on the touch screen, that is, position 5 is the end position of the user's sliding operation on the touch screen. Positions 2, 3, and 4 are the touch point coordinates corresponding to the MOVE event on the touch screen after the DOWN event. In UI sliding scenarios, to avoid accidental touches, electronic devices generally only respond to sliding operations after the user's sliding operation reaches the sliding response threshold. That is, after the DOWN event, the number of subsequent MOVE events must reach a certain threshold before the electronic device responds to the sliding operation. Assuming that when the user slides on the touch screen from position 1 to position 3, the Event Hub can periodically send the touch point coordinates and touch events to the Input framework, and the Input framework will report the touch point coordinates and touch events to the UI framework. Based on the touch point coordinates reported by the Input framework, the UI framework can determine whether the sliding distance meets the sliding response threshold. Assuming that the UI framework determines that the distance between the current position point 3 and the starting position point 1 meets the sliding response threshold, the UI framework may start responding to the user's sliding operation at position point 3 .
[0079] Specifically, in conjunction with Figures 1A and 2, in response to the user's sliding operation, the Event Hub in the TP IC / TP driver 10 can periodically report the user's touch point coordinates and touch events on the touch screen to the Input framework 20 according to the touch sampling rate. The Input Dispatcher thread in the Input framework 20 can report the touch point coordinates and touch events to the UI framework 30. When the application thread in the UI framework 30 senses the touch event corresponding to the sliding operation, it can request a vertical synchronization signal from the Display framework 40. When the vertical synchronization signal arrives, the application thread in the UI framework 30 can determine whether the sliding distance of the sliding operation meets the sliding response threshold. If the sliding distance of the sliding operation meets the sliding response threshold, the application thread draws the layer corresponding to the sliding operation and renders the drawn layer; if the sliding distance of the sliding operation does not meet the sliding response threshold, the application thread will not draw the layer, and the application thread will continue to wait for the arrival of the next vertical synchronization signal and determine again whether the sliding distance of the sliding operation meets the sliding response threshold. The compositing thread in the display framework 40 composites the rendered layers to produce an image frame; finally, the display layer in the hardware display module 50 refreshes and displays the image frame. The application thread in the UI framework 30 confirms whether a layer needs to be drawn and rendered (whether the sliding distance of the sliding operation meets the sliding response threshold) only after the vertical synchronization signal arrives. If a layer needs to be drawn and rendered, it proceeds with the drawing and rendering process, ensuring a consistent display rhythm on the touch screen.
[0080] In some embodiments, in order to avoid the update of the application interface due to the user's accidental touch of the application interface, which brings a bad user experience. Before drawing one or more layers, the application thread may first determine whether the sliding distance of the user's current touch position relative to the starting touch position exceeds the sliding response threshold. If the sliding distance is less than the sliding response threshold, the current touch operation can be determined as a false touch, and the application thread will not respond to the touch operation to execute the drawing and rendering of the layer, that is, the application will not respond to the sliding operation to refresh the application interface. Each application installed in the electronic device can have a different sliding response threshold, and the sliding response threshold of the application can be pre-set during the application development stage.
[0081] As shown in Figure 3A, assuming that the electronic device is installed with an instant messaging APP, the touch screen currently displays the first application interface of the instant messaging APP. When the user's finger touches the touch screen of the electronic device and slides on the touch screen (for example, sliding from point A to point C), if the sliding distance of the user's finger on the touch screen is less than the sliding response threshold of the instant messaging APP, the interface of the instant messaging APP will not change. As shown in Figure 3B, the instant messaging APP still displays the first application interface. If the sliding distance of the user's finger on the touch screen is greater than the sliding response threshold of the instant messaging APP, the instant messaging APP can update the application interface in response to the sliding operation. As shown in Figure 3C, the application interface displayed by the instant messaging APP is updated from the first application interface to the second application interface.
[0082] In an embodiment of the present application, by setting a sliding response threshold, the application can avoid user interface updates caused by accidental user touches, thereby improving the user experience. Assuming that the sliding response threshold of the instant messaging app is 24px (or 8vp), that is, when the sliding displacement between the position of the user's finger touch point detected in a frame corresponding to the MOVE event and the starting touch position in the starting frame exceeds 24px, the current sliding operation on the instant messaging app can be determined as a valid sliding operation. When the sliding displacement between the position of the user's finger touch point detected in a frame corresponding to the MOVE event and the starting touch position in the starting frame does not exceed 24px, the current sliding operation on the instant messaging app can be determined as an invalid sliding operation.
[0083] For electronic devices, in addition to the kernel latency t11, input latency t12, rendering latency t13, composition latency t14, and display latency t15 mentioned above, the following factors may also affect the initial sliding chirality:
[0084] The touch sampling rate and screen refresh rate of a touch screen are typically fixed. For example, the touch sampling rate is typically 120Hz. However, to balance the battery life of electronic devices with the smoothness of the screen, a more commonly used screen refresh rate is 60Hz. This means that there may be a certain time difference between the moment when the sliding operation reaches the sliding response threshold based on the reported touch point coordinates and the moment when the application thread responds to the vertical synchronization signal and starts working (the start of work may include the application thread determining whether the sliding operation reaches the sliding response threshold and drawing and rendering the layer when the sliding operation reaches the sliding response threshold). In addition, because the clock used to record the touch sampling period and the clock used to record the screen refresh period are typically not synchronized, the two may be controlled by different hardware circuits and operate at different frequencies. Therefore, even if the touch sampling rate and screen refresh rate are the same (for example, even if the touch sampling rate and screen refresh rate are both 120Hz), there may still be a certain time difference between the moment when the sliding operation reaches the sliding response threshold based on the reported touch point coordinates and the moment when the application thread responds to the vertical synchronization signal and starts working. Assuming that at time t21, the sliding operation has actually reached the sliding response threshold of the instant messaging app, it may happen that time t21 does not reach the user interface refresh cycle of the instant messaging app. Assuming that the vertical synchronization signal arrives at time t22 after time t21, that is, the arrival time of the application interface refresh cycle of the instant messaging app is time t22 after time t21, the application thread of the instant messaging app needs to wait for the arrival of the interface refresh cycle to determine whether the sliding operation has reached the sliding response threshold, and to draw and render the layer. Since there is a certain time difference between time t21 and time t22, the touch delay time is extended, and the initial sliding and chirality effect of the electronic device is reduced.
[0085] To further understand the touch delay time involved in the chirality of the initial slide in this application, the following detailed description of the software processing flow of the first app responding to and displaying the application interface of the first app in response to the slide operation is described in conjunction with Figure 4. Figure 4 illustrates the first app's application interface displayed on the screen of an electronic device as an example. The first app can be an app that supports slide operations to update the application interface. The application type of the first app is not limited in this application example.
[0086] S401: In response to a user sliding operation on an application interface of a first APP, the TP IC / TP driver periodically obtains the touch point coordinates and touch events of the sliding operation.
[0087] In an embodiment of the present application, while a first app is running in the foreground, a user can update the first app's application interface by performing a sliding operation on the touch screen. When the user performs a sliding operation on the first app's application interface displayed on the touch screen, the touch layer in the TP IC / TP driver can sense the position of the user's finger, determine the corresponding touch point coordinates, and the touch driver in the TP IC / TP driver can generate a touch event based on the user's sliding operation.
[0088] The Event Hub in the TP IC / TP driver can periodically report touch point coordinates and touch events to the Input framework so that the system can recognize and process user sliding operations.
[0089] For example, when the preset touch sampling rate is 120 Hz, the TP IC / TP driver completes the collection and reporting of touch point coordinates and touch events every 8.3 milliseconds.
[0090] S402: The TP IC / TP driver reports the touch point coordinates and touch events to the Input framework.
[0091] In some embodiments, the Event Hub in the TP IC / TP driver can periodically report touch point coordinates and touch events to the Input framework. Specifically, during a user swipe operation, the TP IC / TP driver can periodically collect the touch point coordinates and touch events of the user's swipe operation according to a preset touch sampling rate and report the touch point coordinates and touch events to the Input framework.
[0092] In some embodiments, during a user's sliding operation, a touch event may include a DOWN event, one or more MOVE events, and an UP event.
[0093] S403: The Input framework sends the touch point coordinates and the touch event to the UI framework.
[0094] In some embodiments, the Input Reader thread in the Input framework can receive touch point coordinates and touch events reported by the Event Hub. In other embodiments, the Input Reader thread in the Input framework can also actively read touch point coordinates and touch events from the Event Hub.
[0095] After the Input Reader thread receives the touch point coordinates and touch events reported by the Event Hub, it can wake up the Input Dispatcher thread, which will send the touch point coordinates and touch events to the UI framework so that the touch point coordinates and touch events can be dispatched to the corresponding application thread for processing through the Input Dispatcher thread. For example, when a user performs a sliding operation on the application interface of the first APP displayed on the touch screen, the Input Dispatcher thread in the Input framework distributes the touch point coordinates and touch events to the application thread in the UI framework that needs to perceive the sliding operation (for example, the thread of the first APP).
[0096] For example, the first APP is an instant messaging APP. When the user needs to browse the friend dynamics in the instant messaging APP, in response to the user's sliding operation on the friend dynamics display interface of the instant messaging APP, the TP IC / TP driver periodically collects the touch point coordinates and touch events of the sliding operation, and reports them to the Input framework. The Input framework can distribute the touch point coordinates and touch events reported by the TP IC / TP driver to the thread of the instant messaging APP in the UI framework to notify the thread of the instant messaging APP to respond to the sliding operation to draw and render the page (refreshed page).
[0097] S404: The UI framework receives the touch point coordinates and the touch event.
[0098] In some embodiments, the TP IC / TP driver periodically obtains and reports touch point coordinates and touch events to the Input framework, that is, the application thread in the UI framework (for example, the thread of the first APP) can also periodically receive the touch point coordinates and touch events newly sent to the Input framework.
[0099] S405: The UI framework generates a vertical synchronization signal request in response to the touch event.
[0100] In some embodiments, the touch event may include a DOWN event, a MOVE event, and an UP event, and the application thread in the UI framework (for example, the thread of the first APP) may generate a vertical synchronization signal request in response to the DOWN event, the MOVE event, or the UP event.
[0101] In some embodiments, since the embodiments of the present application involve initial sliding tracking, the first APP will respond to the sliding operation to refresh the application interface only after the user's sliding operation reaches the sliding response threshold of the first APP (that is, after several MOVE events). The application thread in the UI framework (for example, the thread of the first APP) can also generate a vertical synchronization signal request only in response to the MOVE event in the touch event.
[0102] In some embodiments, the application thread in the UI framework (for example, the thread of the first APP) can calculate the sliding distance and direction of the sliding operation based on the touch point coordinates. In order to avoid adverse phenomena such as screen tearing on the display screen (touch screen) during the subsequent display process, the application thread in the UI framework (for example, the thread of the first APP) can generate a vertical synchronization signal request after receiving a touch event, and can synchronize the following multiple times: the time to wake up the application thread to start working, the time to wake up the synthesis thread (SurfaceFlinger thread) for layer synthesis, and the time to wake up the LCD display panel to start refreshing the image frame. After synchronizing the above three times, the screen freeze and screen tearing can be eliminated, and the display effect of the touch screen can be improved.
[0103] S406: The UI framework sends a vertical synchronization signal request to the Display framework.
[0104] In some embodiments, after generating a vertical synchronization signal request, the application thread in the UI framework (for example, the thread of the first APP) can send the vertical synchronization signal request to the Display framework to wake up the SurfaceFlinger thread to synthesize one or more layers after rendering.
[0105] S407: The Display framework receives a vertical synchronization signal request.
[0106] In one embodiment of the present application, the Display framework is responsible for processing graphic elements in applications and user interfaces, as well as interactions with hardware displays. The Display framework provides an abstract interface to manage resources such as display screens, windows, views, and drawing surfaces. The SurfaceFlinger thread is the display engine in the Android system, the core part of the Display framework, and an important component for implementing the hardware support and underlying management functions required by the Display framework. The SurfaceFlinger thread is responsible for synthesizing the rendering results of various applications into the final image and outputting it to the display screen. The SurfaceFlinger thread communicates with the hardware driver through the Hardware Abstraction Layer (HAL) to control operations such as image buffer allocation, synthesis, and page flipping to achieve efficient graphics display.
[0107] In some embodiments, to ensure a smooth display effect, the SurfaceFlinger thread periodically checks whether the current drawing matches the signal period of the vertical synchronization signal of the display screen so as to perform appropriate frame rate limits and adjustments. For example, when the SurfaceFlinger thread receives a vertical synchronization signal request sent by an application, it will wait until the next screen refresh cycle begins, then generate a vertical synchronization signal, and send the vertical synchronization signal to the UI framework to notify the application thread (for example, the thread of the first APP) to start drawing and rendering the layer to ensure that the image on the screen always remains smooth and fluid.
[0108] In some embodiments, the signal period T2 of the vertical synchronization signal is the inverse of the screen refresh rate currently used by the electronic device. Taking the screen refresh rate as 60 Hz as an example, the signal period T2 of the vertical synchronization signal = 1 / 60 = 0.01667 seconds (s) = 16.67 milliseconds (ms).
[0109] S408: The Display framework determines whether the current moment has reached the screen refresh cycle.
[0110] In some embodiments, in order to ensure that the first APP can render the image to the display screen in a timely manner, ensure a smooth display effect, and avoid tearing or other adverse conditions. When the SurfaceFlinger thread in the Display framework receives a vertical synchronization signal request, it is necessary to confirm whether the current moment has reached the screen refresh cycle (that is, the signal cycle T2 of the vertical synchronization signal) in order to generate a vertical synchronization signal. If it is confirmed that the current moment has reached the screen refresh cycle T2, execute step S409 to generate a vertical synchronization signal according to the vertical synchronization signal request; if it is confirmed that the current moment has not reached the screen refresh cycle T2, return to step S408 and continue to confirm whether the current moment has reached the screen refresh cycle.
[0111] S409: If the current moment reaches the screen refresh period, the Display framework generates a vertical synchronization signal in response to the vertical synchronization request.
[0112] In some embodiments, when it is determined that the current moment reaches the screen refresh period, the SurfaceFlinger thread in the Display framework can generate a vertical synchronization signal in response to a vertical synchronization signal request.
[0113] S410: The Display framework sends a vertical synchronization signal to the UI framework.
[0114] In some embodiments, after generating a vertical synchronization signal, the SurfaceFlinger thread in the Display framework can send a vertical synchronization signal to the UI framework, so that the corresponding application thread in the UI framework can start working in response to the vertical synchronization signal, for example, waking up the thread of the first APP to determine whether the sliding operation reaches the sliding response threshold, drawing layers, and rendering layers, etc.
[0115] S411: The UI framework determines, in response to the vertical synchronization signal and based on the touch point coordinates, whether the sliding operation reaches a sliding response threshold of the first APP.
[0116] In some embodiments, the sliding response threshold of the first APP can be set by the developer of the first APP during the APP development stage. In order to prevent the user from accidentally touching the touch screen and causing the application interface currently displayed by the first APP to be updated, the application thread in the UI framework, for example, the thread of the first APP, needs to confirm whether the sliding operation reaches the sliding response threshold of the first APP based on the touch point coordinates before responding to the vertical synchronization signal and starting to draw a new layer. If the sliding operation reaches the sliding response threshold of the first APP, step S412 is executed, and the thread of the first APP draws and renders the new layer in response to the vertical synchronization signal. If the sliding operation does not reach the sliding response threshold of the first APP, the process ends, and the thread of the first APP will not draw or render the layer. The thread of the first APP can wait for the arrival of the next vertical synchronization signal. When the next vertical synchronization signal arrives, it determines whether the sliding operation reaches the sliding response threshold of the first APP based on the new touch point coordinates.
[0117] During a user's sliding operation, the UI framework may periodically receive touch point coordinates and touch events. Based on the touch point coordinates currently received and the touch point coordinates corresponding to the initial sliding operation, the UI framework may calculate the distance of the current sliding operation to determine whether the current sliding operation has reached the sliding response threshold. If the distance between the touch point coordinates currently received and the touch point coordinates corresponding to the initial sliding operation is greater than or equal to the sliding response threshold, the sliding operation is confirmed to have reached the sliding response threshold. If the distance between the touch point coordinates currently received and the touch point coordinates corresponding to the initial sliding operation is less than the sliding response threshold, the sliding operation is confirmed to have not reached the sliding response threshold.
[0118] S412: If it is determined that the sliding operation reaches the sliding response threshold of the first APP, the UI framework performs layer drawing and rendering.
[0119] In some embodiments, when it is confirmed that the sliding operation reaches the sliding response threshold, the application thread in the UI framework (for example, the thread of the first APP) can draw and render a new layer.
[0120] S413: The UI framework sends the rendered layer to the Display framework.
[0121] In some embodiments, after completing the rendering of a layer, the application thread in the UI framework (eg, the thread of the first APP) may send the rendered layer to the Display framework for layer synthesis.
[0122] S414: The Display framework synthesizes the rendered layers to obtain an image frame.
[0123] In some embodiments, the SurfaceFlinger thread in the Display framework can synthesize the rendered layers to obtain an image frame.
[0124] S415: The Display framework sends the image frame to the hardware display module.
[0125] In some embodiments, the SurfaceFlinger thread in the Display framework can send the image frame to the display driver of the hardware display module.
[0126] S416: The hardware display module displays the image frame.
[0127] In some embodiments, after the display driver of the hardware display module receives the synthesized image frame, the display driver may drive the display layer to display the synthesized image frame. After the display layer displays the image frame, the image displayed by the display layer can be perceived by human eyes.
[0128] In some embodiments, the application thread in the UI framework (for example, the thread of the first APP) responds to the vertical synchronization signal to determine whether the sliding operation reaches the sliding response threshold. When the sliding operation reaches the sliding response threshold, the layer is drawn and rendered, and the rendered layer can be sent to the Display framework, and the SurfaceFlinger thread in the Display framework performs layer synthesis to obtain an image frame. The SurfaceFlinger thread can send the synthesized image frame to the hardware display module, and the hardware display module displays the image frame. In this way, the following multiple times can be synchronized: the time to wake up the thread of the first APP to start working, the time to wake up the SurfaceFlinger thread to perform layer synthesis, and the time to wake up the LCD display panel to start refreshing the image frame, so as to eliminate screen freezes and screen tearing, and improve the display effect of the display screen.
[0129] In the process shown in FIG4 , since the clock for recording the touch sampling period and the clock for recording the screen refresh period are usually not synchronized and may be controlled by different hardware circuits and operate at different frequencies, the following problems may occur in cases where the touch sampling rate is the same as or different from the screen refresh rate: when the sliding operation has actually reached the sliding response threshold of the first APP, but the SurfaceFlinger thread in the Display framework confirms that the screen refresh period has not been reached at the current moment, the SurfaceFlinger thread needs to send a vertical synchronization signal to the UI framework only when the screen refresh period is reached at the current moment. The application thread in the UI framework (for example, the thread of the first APP) needs to wait until the refresh period arrives before receiving the vertical synchronization signal, and respond to the vertical synchronization signal to confirm whether the sliding operation has reached the sliding response threshold of the first APP. When it is determined that the sliding operation has reached the sliding response threshold of the first APP, the application thread in the UI framework (for example, the thread of the first APP) draws and renders the layer, which prolongs the touch delay time and causes poor hand tracking of the electronic device.
[0130] Specifically, referring to the simplified schematic diagram shown in FIG5 , it is assumed that the touch sampling rate of the touch screen is 120 Hz, that is, the Input framework can receive the touch point coordinates and touch events reported by the TP IC / TP driver every 8.3 milliseconds. Assuming that the application thread in the UI framework (for example, the thread of the first APP) operates at a 60 Hz screen refresh rate, that is, the working cycle of the application thread is 16.67 milliseconds. If the user slides on the touch screen from position 1 to position 7, Assume that when a user swipes from position 1 to position 5, the swipe response threshold is not reached. During this time, the application thread may receive three vertical synchronization signals, VsyncApp1, VsyncApp2, and VsyncApp3. Since the swipe response threshold is not reached until the user swipes to position 6 (e.g., point A), the application thread does not respond to any of VsyncApp1, VsyncApp2, or VsyncApp3 to perform layer drawing and rendering (the application thread responds to VsyncApp1, VsyncApp2, and VsyncApp3 to determine the swipe response threshold. Since the swipe response threshold is not reached when swiping from position 1 to position 5, the application thread continues to wait for the next vertical synchronization signal) until the swipe response threshold is reached at position 6. However, since the application thread's duty cycle is 16.67 milliseconds, the screen refresh cycle has not yet been reached when the user swipes to position 6. The application thread does not receive a vertical synchronization signal and cannot begin operation. It must wait for the arrival of vertical synchronization signal VsyncApp4 before it can begin operation. In other words, the screen refresh cycle must be met only when the user swipes to position 7 (point B). The application thread only begins operation when the user swipes to position 7. As can be seen, the application thread cannot begin operation at position 6 and must continue to wait for the user to slide to position 7. Only when the screen refresh cycle arrives can the application thread respond to the vertical synchronization signal VsyncApp4 and begin operation. The time the application thread waits for the screen refresh cycle to arrive may even exceed the sampling period T1 (that is, the time interval from time t3' to time t4 may be greater than 8.3 milliseconds), which has a significant impact on the initial tracking chirality.
[0131] Therefore, how to reduce the waiting time of the application thread (the time waiting for the screen refresh cycle to arrive) is a key issue in improving the initial tracking performance of the electronic device during the sliding operation. In order to solve this problem, the embodiment of the present application also provides a display control method, which can shorten the waiting time by adding a vertical synchronization signal. In conjunction with Figure 6, the principle of the display control method is briefly explained. Assume that the touch sampling rate of the touch screen is 120Hz, that is, the cycle of the touch point coordinates and touch events reported by the TP IC / TP driver received by the Input framework is 8.3 milliseconds. When the application thread in the UI framework (for example, the thread of the first APP) operates at a 60Hz screen refresh rate, the working cycle of the application thread is 16.67 milliseconds. If the user slides from position 1 to position 7 during the process of acting on the touch screen through a sliding operation.
[0132] Assume that when the user slides from position 1 to position 5, the sliding response threshold is not reached until the sliding response threshold is reached at position 6. In the scheme of Figure 5, during the sliding from position 1 to position 6, the application thread may receive the vertical synchronization signal VsyncApp1 at time t1, the vertical synchronization signal VsyncApp2 at time t3, and the vertical synchronization signal VsyncApp3 at time t5. The display control method provided in the embodiment of the present application is that each time the Input framework receives the touch point coordinates and touch events reported by the TP IC / TP driver, the Input framework notifies the Display framework to increase the vertical synchronization signal, that is, increases the generation frequency of the vertical synchronization signal, and thereby increases the number of times the application thread determines whether the current sliding operation has reached the sliding response threshold, so as to prompt the application thread to start working as soon as the user's sliding operation reaches the sliding response threshold.
[0133] For example, the Input framework can receive the touch point coordinates and touch events corresponding to touch position 2 reported by the TP IC / TP driver at time t2, and the Input framework can notify the Display framework to add a new vertical synchronization signal VsyncApp1' at time t2. The Input framework can receive the touch point coordinates and touch events corresponding to touch position 4 reported by the TP IC / TP driver at time t4, and the Input framework can notify the Display framework to add a new vertical synchronization signal VsyncApp2' at time t4. The Input framework can receive the touch point coordinates and touch events corresponding to touch position 6 reported by the TP IC / TP driver at time t6, and the Input framework can notify the Display framework to add a new vertical synchronization signal VsyncApp3' at time t6. At time t6, the application thread can respond to the vertical synchronization signal VsyncApp3' to confirm that the user's sliding operation has reached the sliding response threshold, and then the application thread can draw and render the layer at position 6. The application thread does not need to wait until the user slides to position 7 before responding to VsyncApp4 to start work, as in the solution of Figure 5. It can respond to the vertical synchronization signal VsyncApp3' to determine the sliding response threshold and draw and render the layer in advance, thereby shortening the touch delay time. That is, compared with the solution of Figure 5, it saves the time between time t6 and time t7, and improves the hand tracking performance of the electronic device. In order to avoid excessive generation of vertical synchronization signals and affecting the working rhythm of the Surfaceflinger thread in the Display framework, the display control method provided in the embodiment of the present application can also stop the Input framework from notifying the Display framework of the addition of a new vertical synchronization signal after the application thread starts drawing the layer, that is, the Display framework returns to generating vertical synchronization signals according to the solution of Figure 5, that is, generating vertical synchronization signals according to the screen refresh cycle.
[0134] 7 , a detailed description will be given below of the software processing flow of how to add a vertical synchronization signal using the display control method provided by the present application.
[0135] The display control method provided in the embodiments of the present application may be executed by a display control device. The display control device may also be a CPU of an electronic device, or a control module in the electronic device for executing the display control method. In the embodiments of the present application, the display control method provided in the embodiments of the present application is described by taking an electronic device executing the display control method as an example.
[0136] Figure 7 uses the screen of an electronic device displaying the application interface of the first APP as an example for explanation. The first APP can be an APP that supports sliding operations to update the application interface. The application type of the first APP is not limited in this application example.
[0137] S701: In response to a user sliding operation on the application interface of the first APP, the TP IC / TP driver periodically obtains and reports the touch point coordinates and touch events to the Input framework.
[0138] S702: The Input framework notifies the Display framework of the MOVE event.
[0139] In some embodiments, since the embodiments of the present application involve initial sliding tracking, when the user's sliding operation reaches the sliding response threshold of the first APP (after one or more MOVE events), the thread of the first APP can respond to the vertical synchronization signal as soon as possible to draw and render the layer, so the Display framework can be set to try to add a new vertical synchronization signal based on the MOVE event in the touch event.
[0140] S703: The Display framework receives notification of the MOVE event.
[0141] In some embodiments, after the Input framework notifies the Display framework of a MOVE event, the Display framework may receive notification of the MOVE event.
[0142] S704: The Display framework determines whether the newly added vertical synchronization signal function is enabled.
[0143] In some embodiments, in order to avoid excessive generation of vertical synchronization signals and affecting the working rhythm of the Surfaceflinger thread, the function of adding a new vertical synchronization signal may be turned off at some times. After receiving the notification of the MOVE event, the Surfaceflinger thread in the Display framework can try to add a new vertical synchronization signal. Before the Surfaceflinger thread tries to generate an additional vertical synchronization signal, it is necessary to confirm whether the function of adding a new vertical synchronization signal is turned on. If the function of adding a new vertical synchronization signal is turned on, execute step S703. If the function of adding a new vertical synchronization signal is turned off, the process ends, that is, the Surfaceflinger thread will not try to add a new vertical synchronization signal, and wait for the notification of the next MOVE event before making a judgment.
[0144] In some embodiments, the addition of additional vertical sync signals can be disabled during a user's scrolling operation if: a. the application thread begins drawing a layer; b. an UP event is detected. For example, if the application thread begins drawing a layer, the Input framework stops notifying the Display framework of MOVE events. Since the Display framework cannot receive MOVE event notifications, the Surfaceflinger thread will not attempt to generate additional vertical sync signals.
[0145] The function of adding a new vertical synchronization signal can be re-enabled when a new sliding operation occurs, that is, the function of adding a new vertical synchronization signal can be re-enabled when a new DOWN event and a MOVE event are detected.
[0146] In some embodiments, after parsing the DOWN event, the Input framework may count the parsed MOVE events. The Input framework may notify the Display framework of the MOVE event only after receiving the first preset number of MOVE events, so that the SurfaceFlinger thread in the Display framework can attempt to add a new vertical synchronization signal in response to the MOVE event that may actually reach the sliding response threshold, and can prevent abnormal sliding scenarios from triggering the new vertical synchronization signal multiple times. For example, for accidental touches on the display screen, due to the limited sliding distance of the accidental touch, the first preset number of MOVE events generally cannot be reached, that is, the MOVE event will not be notified to the Display framework to try to add a new vertical synchronization signal, which can avoid the abnormality of frequently notifying the Display framework to try to add a new vertical synchronization signal due to accidental touches. The first preset number of times can be set and adjusted according to the sliding response threshold of the application, and the embodiment of the present application is not limited to this. For example, the first preset number of times is 13 times.
[0147] In some embodiments, the Input framework may also stop notifying the Display framework of MOVE events after sending a second preset number of MOVE events. For a sliding operation, receiving the second preset number of MOVE events indicates that the sliding operation has reached the sliding response threshold of the application, and the application thread is already drawing and rendering the layer. In this case, it is necessary to turn off the newly added vertical synchronization signal function, and the Input framework stops notifying the Display framework of MOVE events. The second preset number of times can also be set and adjusted according to the sliding response threshold of the application. This embodiment of the application does not limit this. For example, the second preset number of times is 20 times.
[0148] S705: If the newly added vertical synchronization signal function is enabled, the Display framework determines whether the first APP is a preset application.
[0149] Since the present application solution generates an additional vertical synchronization signal through the Surfaceflinger thread in the Display framework, when the user's sliding operation reaches the sliding response threshold, the thread of the first APP can respond to the vertical synchronization signal as soon as possible to draw and render the layer, which will bring the problem of increased load to the application to a certain extent. Therefore, the present application solution can be set to take effect only in scenarios that have certain requirements for the initial sliding chirality, such as some specific applications. The embodiment of the present application can be effective only for applications in the application whitelist by constructing an application whitelist. The applications in the application whitelist can be set by users or developers, and the embodiment of the present application does not limit this.
[0150] For example, the Surfaceflinger thread in the Display framework can determine whether the first app is a preset application by comparing it to an application in the application whitelist. If the first app is an application in the application whitelist, it is determined that the first app is a preset application, and step S705 is executed. If the first app is not an application in the application whitelist, it is determined that the first app is not a preset application, and the Surfaceflinger thread does not need to attempt to add a new vertical synchronization signal. The process ends and waits for the next MOVE event notification before making another judgment.
[0151] S706: If the first APP is a preset application, the Display framework determines whether the timing of the newly added vertical synchronization signal is appropriate.
[0152] In some embodiments, before trying to add a new vertical synchronization signal, the Surfaceflinger thread in the Display framework determines whether the current moment is suitable for adding a new vertical synchronization signal. This can avoid the additionally generated vertical synchronization signal being too close to the original vertical synchronization signal (the vertical synchronization signal generated based on the screen refresh cycle), causing the additionally generated vertical synchronization signal to be meaningless.
[0153] For example, after determining that the first APP is a preset application, the Surfaceflinger thread determines whether the time difference between the current moment and the generation moment of the previous vertical synchronization signal (a vertical synchronization signal generated based on the screen refresh cycle) is less than the preset duration, and determines whether the time difference between the current moment and the generation moment of the next vertical synchronization signal to be generated (a vertical synchronization signal generated based on the screen refresh cycle) is less than the preset duration. If both time differences are not less than the preset duration, the Surfaceflinger thread determines that the time point of the newly added vertical synchronization signal is appropriate and executes step S706. If either of the two time differences is less than the preset duration, the Surfaceflinger thread determines that the time point of the newly added vertical synchronization signal is not appropriate, the Surfaceflinger thread abandons the newly added vertical synchronization signal, the process ends, and waits for the notification of the next MOVE event before making another judgment.
[0154] In some embodiments, the preset duration can be set according to actual needs, and the embodiments of the present application do not limit this. For example, the preset duration can be 0.5ms.
[0155] S707: If the time point of the newly added vertical synchronization signal is appropriate, the Display framework generates a vertical synchronization signal.
[0156] In some embodiments, if the timing of the newly added vertical synchronization signal is appropriate, the Surfaceflinger thread in the Display framework generates a vertical synchronization signal. The Display framework can send the newly generated vertical synchronization signal to the UI framework, so that the application thread in the UI framework (for example, the thread of the first APP) can respond to the newly added vertical synchronization signal to determine whether the user's sliding operation reaches the sliding response threshold of the first APP. If it is determined that the user's sliding operation reaches the sliding response threshold of the first APP, the thread of the first APP can draw and render the layer. If it is determined that the user's sliding operation does not reach the sliding response threshold of the first APP, the thread of the first APP does not draw and render the layer, and the thread of the first APP continues to wait for the arrival of the next vertical synchronization signal. When the next vertical synchronization signal arrives, it is determined whether the user's sliding operation reaches the sliding response threshold of the first APP.
[0157] 8 , a detailed description will be given below of the software processing flow in which, after sampling the display control method provided by this application, when the user slides on the touch screen, the screen interface responds to the sliding operation and displays the software processing flow.
[0158] The display control method provided in the embodiments of the present application may be executed by a display control device. The display control device may also be a CPU of an electronic device, or a control module in the electronic device for executing the display control method. In the embodiments of the present application, the display control method provided in the embodiments of the present application is described by taking an electronic device executing the display control method as an example.
[0159] Figure 8 illustrates an example of an electronic device displaying the application interface of a first APP. The first APP may be an APP that supports sliding operations to update the application interface. The application type of the first APP is not limited in this application example. Since the embodiment of the application involves initial sliding chirality, when the user's sliding operation reaches the sliding response threshold of the first APP (after one or more MOVE events), the thread of the first APP can respond to the vertical synchronization signal as quickly as possible to draw and render the layer. Therefore, the Display framework can be set to attempt to add a new vertical synchronization signal based on the MOVE event in the touch event.
[0160] S801: In response to a user sliding operation on an application interface of a first APP, the TP IC / TP driver periodically obtains the touch point coordinates and touch events of the sliding operation.
[0161] In an embodiment of the present application, while using a first app, a user may need to update the currently displayed application interface of the first app (for example, by sliding up or down the application interface to view more information). When the user performs a sliding operation on the application interface of the first app displayed on the touch screen, in response to the user's sliding operation, the TP IC / TP driver can periodically obtain the touch point coordinates and touch events of the sliding operation, and periodically report the touch point coordinates and touch events to the Input framework. The touch events may include a DOWN event, a MOVE event, and an UP event.
[0162] S802: The TP IC / TP driver reports the touch point coordinates and touch events to the Input framework.
[0163] Step S802 of the embodiment of the present application is similar to step S402 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0164] S803: The Input framework sends the touch point coordinates and touch events to the UI framework.
[0165] Step S803 of the embodiment of the present application is similar to step S403 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0166] S804: The UI framework receives the touch point coordinates and the touch event.
[0167] Step S804 of the embodiment of the present application is similar to step S404 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0168] S805: The UI framework generates a vertical synchronization signal request in response to the touch event.
[0169] Step S805 of the embodiment of the present application is similar to step S405 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0170] S806: The UI framework sends a vertical synchronization signal request to the Display framework.
[0171] Step S806 of the embodiment of the present application is similar to step S406 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0172] S807: The Display framework receives a vertical synchronization signal request.
[0173] Step S807 of the embodiment of the present application is similar to step S407 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0174] S808: The Display framework determines whether the current moment has reached the screen refresh cycle.
[0175] Step S808 of the embodiment of the present application is similar to step S408 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0176] S809: If the current moment reaches the screen refresh period, the Display framework generates a first vertical synchronization signal.
[0177] Step S809 of the embodiment of the present application is similar to step S409 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0178] S810: The Display framework sends a first vertical synchronization signal to the UI framework.
[0179] Step S810 of the embodiment of the present application is similar to step S410 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0180] S811: The Input framework notifies the Display framework of the MOVE event.
[0181] In some embodiments, step S811 may be performed in parallel with step S803 .
[0182] Step S811 of the embodiment of the present application is similar to step S702 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0183] S812: The Display framework receives notification of a MOVE event.
[0184] Step S812 of the embodiment of the present application is similar to step S703 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0185] S813: The Display framework determines whether the newly added vertical synchronization signal function is enabled.
[0186] Step S813 of the embodiment of the present application is similar to step S704 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0187] S814: If the newly added vertical synchronization signal function is enabled, the Display framework determines whether the first APP is a preset application.
[0188] Step S814 of the embodiment of the present application is similar to step S705 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0189] S815: If the first APP is a default application, the Display framework determines whether the timing of the newly added vertical synchronization signal is appropriate.
[0190] Step S815 of the embodiment of the present application is similar to step S706 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0191] S816: If the timing of the newly added vertical synchronization signal is appropriate, the Display framework generates a second vertical synchronization signal.
[0192] Step S816 of the embodiment of the present application is similar to step S707 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0193] S817: The Display framework sends a second vertical synchronization signal to the UI framework.
[0194] S818: The UI framework determines, in response to the first vertical synchronization signal and based on the touch point coordinates, whether the sliding operation reaches a sliding response threshold of the first APP.
[0195] Step S818 of the embodiment of the present application is similar to step S411 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0196] S819: The UI framework determines, in response to the second vertical synchronization signal and based on the touch point coordinates, whether the sliding operation reaches a sliding response threshold of the first APP.
[0197] In some embodiments, the execution order of S818 and S819 depends on the order in which the UI framework receives the first vertical synchronization signal and the second vertical synchronization signal. For example, if the UI framework receives the first vertical synchronization signal first and then the second vertical synchronization signal, the method of the embodiment of the present application first executes step S818 and then executes step S819; if the UI framework receives the second vertical synchronization signal first and then the first vertical synchronization signal, the method of the embodiment of the present application first executes step S819 and then executes step S818. Since the method of the embodiment of the present application determines whether the time point of the newly added vertical synchronization signal is appropriate in step S815, there will be no situation where steps S818 and S819 are executed in parallel.
[0198] S820: If it is determined that the sliding operation reaches the sliding response threshold of the first APP, the UI framework performs layer drawing and rendering.
[0199] In some embodiments, if the thread of the first app in the UI frame responds to the first vertical synchronization signal and determines that the current sliding operation has reached the sliding response threshold of the first app, the thread of the first app draws and renders the new layer. If the thread of the first app in the UI frame responds to the second vertical synchronization signal and determines that the current sliding operation has reached the sliding response threshold of the first app, the thread of the first app draws and renders the new layer.
[0200] S821: The UI framework sends the rendered layer to the Display framework.
[0201] Step S821 of the embodiment of the present application is similar to step S413 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0202] S822: The Display framework synthesizes the rendered layers to obtain an image frame.
[0203] Step S822 of the embodiment of the present application is similar to step S414 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0204] S823: The Display framework sends the image frame to the hardware display module.
[0205] Step S823 of the embodiment of the present application is similar to step S415 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0206] S824: The hardware display module displays the image frame.
[0207] Step S824 of the embodiment of the present application is similar to step S416 of the aforementioned embodiment, and will not be described again here to avoid repetition.
[0208] The display control method of the embodiment of the present application notifies the SurfaceFlinger thread of the Display framework of the MOVE event each time the Input framework receives a MOVE event reported by the TP IC / TP driver, so that the SurfaceFlinger thread can respond to the notification of the MOVE event and add a second vertical synchronization signal, so that the application thread in the UI framework (for example, the thread of the first APP) can receive both the first vertical synchronization signal and the second vertical synchronization signal, and can respectively respond to the first vertical synchronization signal to determine whether the current sliding operation reaches the sliding response threshold, and respond to the second vertical synchronization signal to determine whether the current sliding operation reaches the sliding response threshold. The number of times the application thread determines whether the current sliding operation reaches the sliding response threshold is increased, and when it is determined that the sliding operation reaches the sliding response threshold, the application thread draws and renders the layer, which can improve the hand tracking performance of the electronic device.
[0209] Refer to FIG9 , which shows a display control method provided in an embodiment of the present application. The display control method can be applied to an electronic device, wherein the electronic device has a first application installed thereon. The application type of the first application is not limited in this embodiment of the present application. The display control method includes:
[0210] S901: Receive the user's first operation.
[0211] In some embodiments, the electronic device is installed with a first application, the icon of the first application may be displayed on the desktop of the electronic device, and the first operation may refer to clicking the icon of the first application displayed on the desktop of the electronic device.
[0212] S902: In response to a first operation, start a first application.
[0213] In some embodiments, the user clicks on the icon of an application, and the electronic device can launch the first application in response to the click operation.
[0214] S903: Receive a second operation of the user on the first application, where the second operation includes a sliding operation.
[0215] In some embodiments, assuming that the first application supports refreshing the application interface through a sliding operation, the user may need to refresh the currently displayed application interface while using the first application. The user can perform a second operation on the application interface of the first application, such as performing a sliding operation on the application interface of the first application. The first application can refresh the application interface in response to the sliding operation.
[0216] S904: In response to the second operation, acquire the touch point coordinates and touch event of the second operation based on the touch sampling rate of the electronic device.
[0217] The touch sampling rate is used to indicate the number of times the touch screen samples and reports the touch signal in a unit of time. For example, if the touch sampling rate is 120Hz, then the touch screen will sample and report the touch signal 120 times in one second. The higher the touch sampling rate, the more timely the electronic device can respond to the user's touch operation. When the user performs a sliding operation on the touch screen of an electronic device, the touch sensor in the electronic device can detect the user's touch operation on the touch screen, and the TP IC / TP driver can periodically obtain the touch point coordinates and touch events of the second operation according to the touch sampling rate.
[0218] S905: Generate a first vertical synchronization signal based on a screen refresh rate of the electronic device, and generate a second vertical synchronization signal based on a touch event.
[0219] The screen refresh rate is the number of times a screen (such as a touch screen) can refresh the image per second. For example, a 60Hz screen refresh rate means that the screen can refresh the display 60 times in 1 second, and a 120Hz screen refresh rate means that the screen can refresh the display 120 times in 1 second. Therefore, the higher the screen refresh rate, the more frames the screen can display. The electronic device can generate a first vertical synchronization signal based on the screen refresh rate, that is, the generation frequency of the first vertical synchronization signal is equal to the screen refresh rate, which can eliminate screen freezes and screen tearing.
[0220] The electronic device also generates an additional second vertical synchronization signal based on the touch event. Compared with the existing sliding touch solution, the frequency of generating the vertical synchronization signal is increased, which can increase the number of subsequent judgments on whether the sliding operation reaches the sliding response threshold. It can realize the judgment of whether the sliding operation reaches the sliding response threshold in advance, and prompt the application thread of the first application to draw and render the image as soon as possible when the user's sliding operation reaches the sliding response threshold. It can shorten the touch delay time of the electronic device and improve the initial sliding tracking performance of the electronic device.
[0221] In some embodiments, the frequency of generating the second vertical synchronization signal based on the touch event request is equal to the touch sampling rate, which enables the application thread of the first application to determine the sliding response threshold as soon as the user's sliding operation reaches the sliding response threshold, and then to draw and render the image as soon as possible.
[0222] In some embodiments, the touch events of the second operation may include a DOWN event, several MOVE events and an UP event. When the DOWN event is received, the user's sliding begins, and it is obviously impossible to reach the sliding response threshold of the application. There is no need to generate a second vertical synchronization signal based on the DOWN event request. The UP event represents the end of the user's sliding. The second vertical synchronization signal is additionally generated based on the UP event request. The generation timing is late, and it is impossible to judge in advance whether the sliding operation has reached the sliding response threshold. Moreover, the sliding operation has ended, and there is no need to judge whether the sliding operation has reached the sliding response threshold. By additionally generating a second vertical synchronization signal based on the MOVE event request, it is possible to judge in advance whether the sliding operation has reached the sliding response threshold, thereby shortening the touch delay time of the electronic device and improving the hand tracking performance of the electronic device.
[0223] In some embodiments, after receiving a DOWN event, by counting MOVE events, when the number of MOVE events is greater than a first preset value, a second vertical synchronization signal is generated based on the MOVE event request, so as to attempt to add a second vertical synchronization signal in response to a MOVE event that may actually reach the sliding response threshold, avoid adding too many meaningless second vertical synchronization signals, and avoid the situation where abnormal sliding scenarios trigger the addition of the second vertical synchronization signal multiple times.
[0224] In some embodiments, the electronic device supports turning on or off the newly added vertical synchronization signal function. For example, by adding a "new vertical synchronization signal function" icon in the electronic device setting interface, the electronic device user can choose to turn on or off the newly added vertical synchronization signal function according to actual needs. When the newly added vertical synchronization signal function is turned on, the electronic device will generate an additional second vertical synchronization signal based on the MOVE event.
[0225] In some embodiments, since the newly added vertical synchronization signal function is turned on, it will bring a problem of increased load to the application to a certain extent, resulting in increased power consumption of the electronic device. It can be set to take effect only in scenarios that have certain requirements for the initial sliding and chirality. For example, some preset applications can be effective only for applications in the application whitelist by building an application whitelist. The applications in the application whitelist can be set by the user or developer, that is, when the newly added vertical synchronization signal function is turned on and the first application is an application in the application whitelist, the electronic device will generate an additional second vertical synchronization signal based on the MOVE event.
[0226] In some embodiments, it is also possible to set a generation time condition for an additional second vertical synchronization signal to avoid a situation where the additionally generated second vertical synchronization signal is too close to the original first vertical synchronization signal generated based on the frequency refresh rate, resulting in the additionally generated second vertical synchronization signal being of little significance. That is, the electronic device will only generate an additional second vertical synchronization signal based on the MOVE event when the newly added vertical synchronization signal function is turned on, the first application is an application in the application whitelist, and the moment of receiving the MOVE event meets the generation time condition for an additional second vertical synchronization signal.
[0227] In some embodiments, whether the moment a MOVE event is received meets the generation time condition for an additional second vertical synchronization signal can be determined in the following manner: obtaining a first time difference between the moment a MOVE event is received and the generation time of the previous first vertical synchronization signal, and a second time difference between the moment a MOVE event is received and the generation time of the next first vertical synchronization signal to be generated; determining whether the first time difference is greater than a preset duration, and whether the second time difference is greater than a preset duration; and if both the first time difference and the second time difference are greater than the preset duration, determining that the moment a MOVE event is received meets the generation time condition for the second vertical synchronization signal. That is, if both the first time difference and the second time difference are greater than the preset duration, indicating that the additionally generated second vertical synchronization signal is not too close to the original first vertical synchronization signal, determining that the moment a MOVE event is received meets the generation time condition for the second vertical synchronization signal, and if the newly added vertical synchronization signal function is enabled and the first application is an application in the application whitelist, the electronic device can additionally generate a second vertical synchronization signal based on the MOVE event.
[0228] S906: In response to any one of the first vertical synchronization signal and the second vertical synchronization signal, and when the second operation reaches the sliding response threshold of the first application, execute drawing and rendering of the image frame to be refreshed and displayed.
[0229] By setting a sliding response threshold, the first application can avoid situations where the application interface of the first application is refreshed due to the user accidentally touching the application interface of the first application. The application thread of the first application can respond to either the first vertical synchronization signal or the second vertical synchronization signal, and determine whether the second operation reaches the sliding response threshold of the first application based on the currently acquired touch point coordinates. If the second operation reaches the sliding response threshold of the first application, the application thread of the first application executes the drawing and rendering of the image frame to be refreshed and displayed. The application thread executing the drawing and rendering of the image frame to be refreshed and displayed may refer to drawing and rendering the layer of the image frame to be refreshed and displayed.
[0230] In some embodiments, since the newly added vertical synchronization signal function is turned on, it will bring a problem of increased load to the application to a certain extent, resulting in increased power consumption of the electronic device. If it is detected that the application thread is executing the drawing and rendering of the image to be refreshed and displayed, it indicates that the application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate an additional second vertical synchronization signal, and the newly added vertical synchronization signal function can be turned off. By turning off the newly added vertical synchronization signal function, not only can the power consumption of the electronic device be reduced, but also excessive generation of the second vertical synchronization signal can be avoided, which affects the working rhythm of the synthesis thread.
[0231] In some embodiments, if an UP event is detected, indicating that the user's second operation has ended, the application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate an additional second vertical synchronization signal, and the new vertical synchronization signal function can be turned off.
[0232] In some embodiments, the newly added vertical synchronization signal function can also be turned off when the number of MOVE events received is greater than the second preset value. If the number of MOVE events is greater than the second preset value, it indicates that the sliding distance of the second operation may have already exceeded the sliding response threshold of the first application. The application thread has most likely responded to the vertical synchronization signal to draw and render the layer. The application thread no longer needs to determine whether the second operation reaches the sliding response threshold, that is, there is no need to generate a second vertical synchronization signal additionally, and the newly added vertical synchronization signal function can be turned off.
[0233] In some embodiments, after the newly added vertical synchronization signal function is turned off, if a new sliding operation is received, that is, a new DOWN event is received, the electronic device can turn on the newly added vertical synchronization signal function to increase the frequency of generating the vertical synchronization signal, thereby increasing the number of times of judging whether the sliding operation reaches the sliding response threshold, thereby improving the hand tracking performance of the electronic device.
[0234] S907: Synthesize and display the rendered image frames.
[0235] In some embodiments, after drawing and rendering the image frame to be refreshed and displayed, the rendered image frame is synthesized and displayed, allowing the user to see the refreshed application interface of the first application on the display screen, thereby enabling the first application to refresh the application interface in response to the user's second operation. Synthesizing and displaying the rendered image frame may refer to synthesizing the rendered layers to obtain the image frame, and then displaying the image frame.
[0236] See Figure 10 for a diagram of the software architecture of an electronic device provided in an embodiment of the present application. A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. The following description uses an Android operating system installed in an electronic device as an example, but this application is not limited to this, and electronic devices may also be installed with other types of operating systems.
[0237] For example, the Android system is divided into four layers, which are, from top to bottom, the application layer 101 , the framework layer 102 , the Android runtime and system library 103 , the kernel layer 104 , and the hardware layer 105 .
[0238] The application layer can include a series of application packages. For example, an application package can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, device control service, etc.
[0239] The 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. For example, the application framework layer may include a window manager, content provider, view system, telephony manager, resource manager, notification manager, etc.
[0240] The window manager manages window programs. It can obtain the display size, determine whether a status bar is present, lock the screen, and take screenshots. The content provider stores and retrieves data and makes it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and the phone book. The view system includes visual controls, such as those for displaying text and images. The view system can be used to build applications. The display interface can consist of one or more views. For example, a display interface containing a text notification icon can include a view for displaying text and a view for displaying images. The call manager provides communication functions for electronic devices, such as managing call status (including connected and ended calls). The resource manager provides various resources to applications, such as localized strings, icons, images, layout files, and video files. The notification manager enables applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically, without requiring user interaction. For example, the notification manager is used to notify download completions and message reminders. The notification manager can also be a notification that appears in the system's top status bar in the form of an icon or scrolling text bar, such as a notification from an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message may be displayed in the status bar, a notification sound may be emitted, an electronic device may vibrate, an indicator light may flash, etc.
[0241] The Android Runtime consists of a core library and a virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one for the Java language's callable functions and the other for the Android core library.
[0242] The application and framework layers run in a virtual machine. The virtual machine executes Java files from the application and framework layers as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0243] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0244] The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. 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 supports a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D drawing.
[0245] 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.
[0246] The kernel layer is the core of an electronic device's operating system. It is the first layer of software expansion based on the hardware, providing the most basic operating system functions and forming the foundation of the operating system. It manages the system's processes, memory, device drivers, files, and network systems, and determines the system's performance and stability. For example, the kernel can determine when an application can operate on a certain piece of hardware.
[0247] The kernel layer includes programs closely related to the hardware, such as interrupt handlers and device drivers. It also includes basic, common, and high-frequency modules, such as the clock management module and the process scheduling module, as well as key data structures. The kernel layer can be installed in the processor or stored in internal memory.
[0248] The hardware layer is the hardware of the electronic device, and the hardware layer at least includes a display screen.
[0249] Refer to FIG11 , which is a schematic diagram of an application scenario of a display control method provided in an embodiment of the present application.
[0250] Assuming that a user's sliding operation acts on the application interface of the first app, at the hardware layer 105, in response to the user's sliding operation, the touch layer generates a capacitance change and reports the capacitance change to the touch driver. At the kernel layer 104, the touch driver obtains the touch point coordinates and touch event of the reported point based on the capacitance change of the touch layer, and reports the touch point coordinates and touch event of the reported point to the Input Reader thread of the framework layer 102. At the framework layer 102, the Input Reader thread passes the touch point coordinates and touch event of the reported point to the Input Dispatcher thread, which further transmits the touch point coordinates and touch event of the reported point to the application thread of the application layer 101 (for example, the thread of the first app). In the application layer 101, the thread of the first APP can determine whether the sliding operation reaches the sliding response threshold of the first APP based on the touch point coordinates and the touch event, and when the sliding operation reaches the sliding response threshold of the first APP, draw one or more layers, and perform layer rendering on one or more layers. The thread of the first APP can also send the rendered layers to the SurfaceFlinger thread of the framework layer 102. In the framework layer 102, the SurfaceFlinger thread can synthesize the rendered layers to obtain the image frames to be displayed, and the SurfaceFlinger thread can also transmit the image frames to be displayed to the display driver of the kernel layer 104. In the kernel layer 104, the display driver transmits the image frames to be displayed to the display layer for caching. In the hardware layer 105, the display layer displays the image frames under the control of the display driver of the kernel layer. At this time, the user can see the refreshed application interface of the first APP on the display screen.
[0251] Referring to FIG. 12 , the electronic device 100 according to an embodiment of the present application is described below. The electronic device in the embodiment of the present application may be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), netbook computer, as well as a cellular phone, personal digital assistant (PDA), augmented reality (AR) or virtual reality (VR) device, or other device including a touch screen. The embodiment of the present application does not impose any particular restrictions on the specific form of the electronic device. Referring to FIG. 12 , FIG. 12 is a schematic diagram of the structure of the electronic device 100 according to an embodiment of the present application.
[0252] 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. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0253] 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.
[0254] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0255] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0256] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use these instructions or data again, it can directly access them from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0257] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0258] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C busses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc. via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.
[0259] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0260] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0261] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0262] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0263] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0264] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. The interface can also be used to connect other electronic devices 100, such as AR devices.
[0265] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0266] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device 100 via the power management module 141.
[0267] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0268] 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.
[0269] 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.
[0270] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 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.
[0271] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0272] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0273] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0274] 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.
[0275] The display screen 194 is used to display images, videos, etc. The 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 or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1. Among them, the display screen 194 in the embodiment of the present application can be a touch screen. That is, the touch sensor 180K is integrated into the display screen 194.
[0276] 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.
[0277] 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, brightness, and skin tone. 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.
[0278] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0279] 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.
[0280] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0281] 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.
[0282] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0283] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation of DDR SDRAM is generally referred to as DDR5 SDRAM), etc.
[0284] Non-volatile memory may include disk storage devices and flash memory.
[0285] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and eMMC according to the storage specification.
[0286] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
[0287] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .
[0288] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.
[0289] The electronic device 100 can implement audio functions such as media data 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.
[0290] 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. The speaker 170A, also known as the "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.
[0291] 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.
[0292] 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 collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0293] The headphone jack 170D is used to connect a wired headphone and can be a USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0294] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be composed of at least two parallel plates made of conductive material. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on 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 the short message is executed. When a touch operation with a touch operation intensity greater than or equal to a first pressure threshold is applied to the short message application icon, an instruction for creating a new short message is executed.
[0295] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0296] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0297] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0298] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). When electronic device 100 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of electronic device 100, enabling applications such as switching between landscape and portrait modes and pedometers.
[0299] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0300] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0301] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0302] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0303] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0304] The touch sensor 180K is also referred to as a "touch device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.
[0305] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.
[0306] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch-sensitive buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0307] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0308] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0309] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.
[0310] The display control methods in the above embodiments can all be implemented in the electronic device 100 having the above hardware structure.
[0311] This embodiment further provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on the electronic device 100, the electronic device 100 executes the above-mentioned related method steps to implement the display control method in the above-mentioned embodiment.
[0312] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the display control method in the above-mentioned embodiment.
[0313] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the display control method in the above-mentioned method embodiments.
[0314] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0315] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0316] The units described as separate components may or may not be physically separate, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0317] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0318] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0319] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A display control method, applied to an electronic device, characterized in that: The method comprises: Receiving a first operation from a user; In response to the first operation, launching a first application; receiving a second operation of the user on the first application, where the second operation includes a sliding operation; In response to the second operation, acquiring the touch point coordinates and the touch event of the second operation based on the touch sampling rate of the electronic device; Generate a first vertical synchronization signal based on a screen refresh rate of the electronic device, and generate a second vertical synchronization signal based on the touch event, wherein the frequency of generating the second vertical synchronization signal based on the touch event request is equal to the touch sampling rate; In response to any one of the first vertical synchronization signal and the second vertical synchronization signal, when the second operation reaches the sliding response threshold of the first application, drawing and rendering of the image frame to be refreshed and displayed are performed.
2. The display control method according to claim 1, characterized in that: In response to any one of the first vertical synchronization signal and the second vertical synchronization signal, and the second operation reaches the sliding response threshold of the first application, performing drawing and rendering of the image frame to be refreshed and displayed, including: In response to any one of the first vertical synchronization signal and the second vertical synchronization signal, determining whether the second operation reaches a sliding response threshold of the first application based on the acquired touch point coordinates; When the second operation reaches the sliding response threshold of the first application, drawing and rendering of the image frame to be refreshed and displayed are performed.
3. The display control method according to claim 1 or 2, characterized in that: The touch event includes a first DOWN event, a MOVE event, and a UP event, and the generating of a second vertical synchronization signal based on the touch event includes: The second vertical synchronization signal is generated based on the MOVE event.
4. The display control method according to claim 3, characterized in that: The generating the second vertical synchronization signal based on the MOVE event comprises: Record the number of MOVE events; In a case where the number of the MOVE events is greater than a first preset value, the second vertical synchronization signal is generated based on the MOVE events, and the first preset value is set based on a sliding response threshold of the first application.
5. The display control method according to claim 3 or 4, characterized in that: The generating the second vertical synchronization signal based on the MOVE event comprises: When the newly added vertical synchronization signal function is in an enabled state, the second vertical synchronization signal is generated based on the MOVE event.
6. The display control method according to claim 5, characterized in that: The step of generating the second vertical synchronization signal based on the MOVE event when the newly added vertical synchronization signal function is in an enabled state includes: When the newly added vertical synchronization signal function is in an enabled state and the first application is a preset application, the second vertical synchronization signal is generated based on the MOVE event.
7. The display control method according to claim 6, characterized in that: The step of generating the second vertical synchronization signal based on the MOVE event when the newly added vertical synchronization signal function is in an enabled state and the first application is a preset application includes: When the newly added vertical synchronization signal function is in an on state and the first application is a preset application, determining whether the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal; In a case where the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal, the second vertical synchronization signal is generated based on the MOVE event.
8. The display control method according to claim 7, characterized in that: The determining whether the moment of receiving the MOVE event meets the generation time condition of the second vertical synchronization signal includes: Acquire a first time difference between the moment when the MOVE event is received and the moment when the last first vertical synchronization signal is generated, and a second time difference between the moment when the MOVE event is received and the moment when the next first vertical synchronization signal to be generated is generated; Determine whether the first time difference is greater than a preset time length, and whether the second time difference is greater than the preset time length; In a case where both the first time difference and the second time difference are greater than the preset duration, it is determined that the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal.
9. The display control method according to any one of claims 5 to 8, characterized in that: After the second vertical synchronization signal is generated based on the touch event, the method further includes: When it is detected that drawing and rendering of the image frame to be refreshed and displayed is executed, the newly added vertical synchronization signal function is turned off.
10. The display control method according to any one of claims 5 to 8, characterized in that: After the second vertical synchronization signal is generated based on the touch event, the method further includes: In response to the UP event, the newly added vertical synchronization signal function is disabled.
11. The display control method according to any one of claims 5 to 8, characterized in that: After the second vertical synchronization signal is generated based on the touch event, the method further includes: Record the number of MOVE events; When the number of the MOVE events is greater than a second preset value, the newly added vertical synchronization signal function is turned off, and the second preset value is set based on a sliding response threshold of the first application.
12. The display control method according to any one of claims 9 to 11, characterized in that: After executing drawing and rendering of the image frame to be refreshed and displayed, the method further includes: When the second DOWN event is received, the newly added vertical synchronization signal function is enabled.
13. The display control method according to any one of claims 1 to 12, characterized in that: After executing drawing and rendering of the image frame to be refreshed and displayed, the method further includes: The rendered image frames are synthesized and sent for display.
14. An electronic device, characterized in that: The electronic device comprises a touch screen, a memory and a processor; The touch screen, the memory and the processor are coupled; The memory is used to store program instructions; The processor is used to read the program instructions stored in the memory to implement the display control method according to any one of claims 1 to 13.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the display control method according to any one of claims 1 to 13 is implemented.
16. A chip coupled to a memory in an electronic device, characterized in that: The chip is used to control the electronic device to execute the display control method as described in any one of claims 1 to 13.
Citation Information
Patent Citations
Method for processing data collected by touch screen and terminal equipment
CN105700668A
Control method based on vertical synchronization signal and electronic device
CN110609645A
Picture refreshing method and device, terminal equipment and storage medium
CN111984181A
Touch event regulation and control method and device and computer readable storage medium
CN112612372A
Systems and methods for improving image tracking based on touch events
US20140152590A1
