Display control method and related equipment
By increasing the generation frequency of vertical synchronization signals in electronic devices, combining the touch sampling rate and screen refresh rate, we can determine in advance whether the sliding operation reaches the response threshold, which solves the problem of long touch delay time in the prior art and improves the equipment's With chirality and user experience.
Patent Information
- Application Number
- CN202310696576.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
The touch delay time in existing electronic devices is relatively long, which affects the user's device experience. How to effectively shorten the touch delay time to improve the chirality of electronic devices.
By adopting a display control method in the electronic device, receiving user operations, generating vertical synchronization signals based on the touch sampling rate and screen refresh rate, increasing the number of times to determine whether the sliding operation reaches the sliding response threshold, and drawing and rendering of images in advance. Shorten touch delay time.
It effectively shortens the touch delay time of electronic devices, improves the chirality of electronic devices, and improves the user's interactive operation experience.
Smart Images

Figure CN119126996A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] Touch panels (TP) are widely used in various electronic devices, and users can achieve human-computer interaction with electronic devices through touch panels. 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 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. Summary of the invention
[0003] 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.
[0004] In a 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.
[0005] 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 a 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.
[0006] 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 performed, 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 performed.
[0007] By adopting the above technical solution and setting a sliding response threshold for the application, the updating of the application interface caused by the user accidentally touching the application interface can be avoided. The application thread of the application can respond to the vertical synchronization signal to determine whether the sliding operation reaches the sliding response threshold. By increasing the generation frequency of the vertical synchronization signal, the number of times of determining whether 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.
[0008] In a 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.
[0009] By adopting the above technical scheme, 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 to touch the screen, which is usually used to start a new operation or gesture. The MOVE event refers to a move event generated when the user moves a finger on the screen, which can be used to track the movement trajectory of the finger and realize functions such as dragging and sliding. The UP event refers to a release event generated when the user lifts his finger, which is usually used to complete an operation or gesture. Since the present application scheme involves improving the hand-tracking performance of the sliding operation, the user starts sliding at the moment of receiving the DOWN event, and obviously cannot 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 judge whether the sliding operation reaches the sliding response threshold in advance. By requesting to generate an additional vertical synchronization signal based on the MOVE event, it is possible to judge whether the sliding operation reaches the sliding response threshold in advance, 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, generating a second vertical synchronization signal based on a MOVE event includes: recording the number of MOVE events; when the number of MOVE events is greater than a first preset value, generating a second vertical synchronization signal based on the MOVE event, wherein the first preset value is set based on a sliding response threshold of the first application.
[0011] By adopting the above technical solution, after receiving the 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 achieve an attempt to add a new vertical synchronization signal in response to the MOVE event that may actually reach the sliding response threshold, avoid adding too many meaningless vertical synchronization signals, and avoid the situation where the abnormal sliding scene triggers 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 number of MOVE events generally cannot reach the first preset value, that is, the electronic device will not try to add a new vertical synchronization signal, which can avoid the abnormality of frequent attempts to add a new vertical synchronization signal due to accidental touches, affecting the working rhythm of the synthesis thread (SurfaceFlinger thread), and causing a meaningless increase in the application thread load.
[0012] In a possible implementation, generating a second vertical synchronization signal based on a MOVE event includes: generating a second vertical synchronization signal based on the MOVE event when a newly added vertical synchronization signal function is in an enabled state.
[0013] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to the application, resulting in increased power consumption of the electronic device. The user 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.
[0014] 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.
[0015] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to the application, resulting in increased power consumption of the electronic device. It can be set to take effect only in scenarios with certain requirements for the initial sliding and chirality, such as some preset applications. By building an application whitelist, it can be effective only for applications in the 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.
[0016] In one possible implementation, when the newly added vertical synchronization signal function is in an on-state and the first application is a preset application, the second vertical synchronization signal is generated based on a MOVE event, including: 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 time condition for generating the second vertical synchronization signal; when the moment when the MOVE event is received meets the time condition for generating the second vertical synchronization signal, generating the second vertical synchronization signal based on the MOVE event.
[0017] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to 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 additionally generated vertical synchronization signal, the electronic device will generate an additional vertical synchronization signal based on the MOVE event.
[0018] In one possible implementation, determining whether the moment when the MOVE event is received meets the time condition for generating the second vertical synchronization signal includes: obtaining a first time difference between the moment when the MOVE event is received and the moment when the previous 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; determining whether the first time difference is greater than a preset duration, and whether the second time difference is greater than the 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 time condition for generating the second vertical synchronization signal.
[0019] By adopting the above technical solution, in the process of additionally generating a vertical synchronization signal based on a MOVE event, by obtaining 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, it is determined 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. 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.
[0020] 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.
[0021] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to 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.
[0022] 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.
[0023] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to 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.
[0024] 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 function of adding a new vertical synchronization signal, and the second preset value is set based on the sliding response threshold of the first application.
[0025] By adopting the above technical solution and turning on the newly added vertical synchronization signal function, it will, to a certain extent, bring the problem of increased load to 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.
[0026] In a possible implementation, after drawing and rendering the image frame to be refreshed and displayed, the method further includes: when a second DOWN event is received, enabling a newly added vertical synchronization signal function.
[0027] 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 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.
[0028] 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.
[0029] 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.
[0030] In a 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.
[0031] 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 a 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.
[0032] 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 performed, 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 performed.
[0033] By adopting the above technical solution and setting a sliding response threshold for the application, the updating of the application interface caused by the user accidentally touching the application interface can be avoided. The application thread of the application can respond to the vertical synchronization signal to determine whether the sliding operation reaches the sliding response threshold. By increasing the generation frequency of the vertical synchronization signal, the number of times of determining whether 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.
[0034] 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.
[0035] By adopting the above 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, which 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.
[0036] 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.
[0037] 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 is implemented, or the display control method of the second aspect is implemented.
[0038] In a fifth aspect, the present application provides a chip coupled to a memory in an electronic device, the chip being used to control the electronic device to execute the display control method of the first aspect, or to implement the display control method of the second aspect.
[0039] In addition, the technical effects brought about by the third to fifth aspects can be found in the descriptions related to the methods of each design in the above method part, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1A A schematic diagram of a software processing flow for displaying an image in response to a touch operation provided in an embodiment of the present application;
[0041] Figure 1B for Figure 1A A schematic diagram of touch delay time in the software processing flow shown;
[0042] Figure 2 A schematic diagram of touch point coordinates of a touch event provided in an embodiment of the present application;
[0043] Figure 3A A schematic diagram of a sliding operation scenario provided in an embodiment of the present application;
[0044] Figure 3B A schematic diagram of a scenario in which an application does not respond to a sliding operation provided in an embodiment of the present application;
[0045] Figure 3C A schematic diagram of a scenario in which an application responds to a sliding operation provided in an embodiment of the present application;
[0046] Figure 4 A flow chart of a display control method provided by an embodiment of the present application;
[0047] Figure 5 for Figure 4 A brief schematic diagram of the process shown;
[0048] Figure 6 A schematic diagram of the principle of a display control method provided in one embodiment of the present application;
[0049] Figure 7 A flowchart of adding a vertical synchronization signal to a display control process provided in an embodiment of the present application;
[0050] Figure 8 A flowchart of a display control method provided by another embodiment of the present application;
[0051] Fig. 9 A flowchart of a display control method provided in yet another embodiment of the present application;
[0052] Fig.10 is a software architecture diagram of an electronic device provided by an embodiment of the present application;
[0053] Fig.11 is a schematic diagram of an application scenario of a display control method provided by an embodiment of the present application;
[0054] Fig.12 This is a hardware architecture diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0055] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the 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 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 designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way.
[0056] To facilitate understanding of the following introduction to the display control method provided in the embodiment of the present application, some terms used in the embodiment of the present application are explained below for easier understanding.
[0057] (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 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 may include click operations, sliding operations, etc. If the user has continuous touch operations on the touch screen (for example, the user slides the finger on the screen continuously, 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.
[0058] (2) Screen refresh rate refers to the number of times a screen (such as a touch screen TP) can refresh the image per second, measured in 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. Accordingly, the lower the image delay and the higher the smoothness. Electronic devices can support multiple different screen refresh rates.
[0059] (3) A vertical synchronization signal can be used to trigger the drawing of one or more layers. In the embodiment of the present application, the electronic device can draw one or more layers for each application through each of the multiple drawing threads in response to the vertical synchronization signal. That is, the application thread corresponding to each application starts working after the vertical synchronization signal arrives, ensuring the display continuity of the application interface.
[0060] 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 an 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 the present application.
[0061] In an embodiment of the present application, the vertical synchronization signal is a periodic discrete signal. For example, there is a vertical synchronization signal every signal period. Since the vertical synchronization signal is a periodic signal, the arrival of the vertical synchronization signal described in the embodiment of the present application may indicate the arrival of the pulse edge of the vertical synchronization signal. Among them, the above-mentioned pulse edge is an edge of a pulse that can be vividly observed from an oscilloscope or an observation system. In different systems, it may be a rising edge or a falling edge or both. In an actual system, it may be implemented by timer flipping, interrupt signals, etc.
[0062] Let's combine Figure 1A and 1B The touch delay time of a touch screen of an electronic device is introduced. The touch delay time may refer to the response speed of the screen image to respond to the touch operation when the user performs a touch operation on the touch screen. The touch operation may be an operation in which the user touches the touch screen or moves on the touch screen with a finger or a stylus.
[0063] like Figure 1AAs shown, 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.
[0064] The software processing flow of the electronic device may include the following steps.
[0065] Step (1): Taking the user's finger touching the touch screen as an example, after the touch layer in the TP IC / TP driver 10 collects the user's finger touch operation, the touch driver reports the corresponding touch point coordinates and touch events to the event management center (Event Hub). Touch events may include press (DOWN) events, move (MOVE) events, and release (UP) events.
[0066] Step (2): The Input Reader thread of the Input framework 20 can receive the touch point coordinates and touch events reported by the Event Hub, and then send 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, the application currently running in the foreground is an instant messaging application (Application, APP), and the instant messaging APP refreshes the application interface in response to the touch operation of the user's finger. The application thread can refer to the thread of the instant messaging APP.
[0067] 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.
[0068] 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.
[0069] Step (5): The display driver of the hardware display module 50 receives the synthesized image frame, and the display driver can drive the display layer to display the synthesized image frame, for example, the display layer is a liquid crystal display panel. After the display layer displays the image frame, the image displayed by the display layer can be perceived by human eyes.
[0070] In some embodiments, the chirality may reflect the speed at which the screen responds to the touch operation when the user performs a touch operation on the touch screen with a finger or a 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.
[0071] 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 the sliding operation reaches the sliding response threshold by triggering the display framework 40 to additionally generate a vertical synchronization signal. Compared with the existing sliding touch scheme, the application thread can determine whether the sliding operation reaches the sliding response threshold in advance, so that the application thread can 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.
[0072] The touch delay time involved in the above software processing flow is as follows: Figure 1B For example, in the above step (1), when the TPIC / TP driver 10 collects the touch operation and reports the touch point coordinates and touch events to the Input framework 20, there may be Figure 1B The kernel delay t11 is shown. In the above step (2), during the process in which 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 Figure 1B In the above step (3), the application thread in the UI framework draws one or more layers and performs layer rendering on the drawn one or more layers. Figure 1B The drawing rendering delay t13 is shown. In the above step (4), the synthesis thread in the Display framework 40 may have Figure 1B The synthesis delay t14 is shown. In the above step (5), when the hardware display module 50 displays the synthesized image frame, there may be Figure 1B The display delay shown is t15.
[0073] In different application scenarios, the touch operations performed by the user on the touch screen are different, and the specific meanings of the corresponding chirality are also different. For example, when the user touches the touch screen and releases it, the chirality of the electronic device in responding to the touch is click chirality; when the user slides the touch screen, the chirality of the electronic device in responding to the slide is slide chirality; when the user just starts to touch the touch screen, the chirality of the electronic device in responding to the touch is initial chirality; when the user slides to the edge of the touch screen or the end of the content, the chirality of the electronic device in responding to the slide is return chirality; when the user just starts to touch and slide the touch screen, the chirality of the electronic device in responding to the touch and slide is initial slide chirality. The embodiments of the present application mainly relate to initial slide chirality. The initial slide 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 and chirality may include kernel delay t11, input delay t12, drawing and rendering delay t13, synthesis delay t14 and display delay t15.
[0074] 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 during the process from the user performing a sliding operation on the touch screen to the touch screen responding to the sliding operation are now described. Figure 2 , assuming that the touch screen of an electronic device is used to construct an XY coordinate system, the coordinate system takes the lower left corner vertex of the touch screen as the origin, and the directions of the X-axis and Y-axis are as follows Figure 2 As shown in . A touch event can be an event that the touch screen detects the user's touch operation and reports it at the corresponding position when the user interacts through the touch screen. During the sliding operation, the touch event will be continuously generated during the sliding of the user's finger, and the touch point coordinates will also be continuously generated during the sliding of the user's finger.
[0075] 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 of 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 to touch the touch screen, through the sliding until the hand is lifted, the touch events generated by the kernel layer of the electronic device can include: a press event (also called a DOWN event), a number of moves (also called MOVE 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 to touch 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 realize 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.
[0076] exist Figure 2 In the example, it is assumed that position 1 is the touch point coordinates 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 coordinates 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 the UI sliding scenario, in order to avoid accidental touches, the electronic device generally responds to the sliding operation only 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 during the sliding process of the user on the touch screen, when the user slides from position 1 to position 3, Event Hub can periodically send the touch point coordinates and touch events to the Input framework, and the Input framework reports the touch point coordinates and touch events to the UI framework. The UI framework can determine whether the sliding distance meets the sliding response threshold based on the touch point coordinates reported by the Input framework. 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 .
[0077] Specifically, combined Figure 1A and Figure 2In 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. The application thread in the UI framework 30 can determine whether the sliding distance of the sliding operation meets the sliding response threshold at the moment when the vertical synchronization signal arrives. 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 synthesis thread in the Display framework 40 can synthesize the rendered layer to obtain an image frame; finally, the display layer in the hardware display module 50 can refresh and display the above image frame. Among them, the application thread in the UI framework 30 starts to confirm whether it is necessary to draw and render the layer (whether the sliding distance of the sliding operation meets the sliding response threshold) after the vertical synchronization signal arrives, and draws and renders the layer when it is determined that the layer needs to be drawn and rendered, which can ensure the display rhythm of the touch screen.
[0078] In some embodiments, in order to avoid updating 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.
[0079] like Figure 3A As shown in the figure, 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, such as Figure 3BAs shown, 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, such as Figure 3C As shown, the application interface displayed by the instant messaging APP is updated from the first application interface to the second application interface.
[0080] In the embodiment of the present application, the application can avoid updating the user interface caused by the user's accidental touch by setting the sliding response threshold, thereby improving the user experience. Assuming that the sliding response threshold of the instant messaging APP is 24px (or recorded as 8vp), that is, when the sliding displacement between the position of the user's finger touch point detected in a certain 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 certain 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.
[0081] For electronic devices, in addition to the kernel delay t11, input delay t12, drawing delay t13, synthesis delay t14 and display delay t15 mentioned above, the following factors may also affect the starting sliding and chirality:
[0082] The touch sampling rate and screen refresh rate of a touch screen are usually fixed. For example, the touch sampling rate is usually 120Hz. In order to balance the battery life of electronic devices and the smoothness of the screen, the more commonly used screen refresh rate is 60Hz. That is, 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). And because the clock used to record the touch sampling cycle and the clock used to record the screen refresh cycle are usually not synchronized, the two may be controlled by different hardware circuits and work at different frequencies. Even if the touch sampling rate is the same as the screen refresh rate (for example, even if the touch sampling rate and the 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 reaches 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.
[0083] In order to further understand the touch delay time involved in the initial sliding and chirality of the present application, the following is combined with Figure 4 When a user acts on the application interface of the first APP through a sliding operation, the software processing flow of the first APP responding to the sliding operation and displaying is described in detail. Figure 4 Taking the application interface of the first APP displayed on the screen of an electronic device as an example, the first APP can be an APP that supports sliding operations to update the application interface, and the application type of the first APP is not limited in this application example.
[0084] S401: In response to a sliding operation of a user 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.
[0085] In an embodiment of the present application, when the first APP is in the foreground, the user can update the application interface of the first APP by performing a sliding operation on the touch screen. When the user performs a sliding operation on the application interface of the first APP displayed on the touch screen, the touch layer in the TP IC / TP driver can sense the position of the user's finger and 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.
[0086] The Event Hub in the TP IC / TP driver can periodically report the touch point coordinates and touch events to the Input framework so that the system can recognize and process the user's sliding operations.
[0087] 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.
[0088] S402: The TP IC / TP driver reports the touch point coordinates and touch events to the Input framework.
[0089] In some embodiments, the Event Hub in the TP IC / TP driver can periodically report the touch point coordinates and touch events to the Input framework. Specifically, when the user performs a sliding operation, the TP IC / TP driver can periodically collect the touch point coordinates and touch events of the user's sliding operation according to a preset touch sampling rate, and report the touch point coordinates and touch events to the Input framework.
[0090] 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.
[0091] S403: The Input framework sends the touch point coordinates and the touch event to the UI framework.
[0092] In some embodiments, the Input Reader thread in the Input framework can receive the 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 the touch point coordinates and touch events from the Event Hub.
[0093] 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 sends 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 InputDispatcher 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).
[0094] 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).
[0095] S404: The UI framework receives the touch point coordinates and the touch event.
[0096] 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.
[0097] S405: The UI framework generates a vertical synchronization signal request in response to the touch event.
[0098] 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 (eg, 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.
[0099] 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.
[0100] 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.
[0101] S406: The UI framework sends a vertical synchronization signal request to the Display framework.
[0102] 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.
[0103] S407: The Display framework receives a vertical synchronization signal request.
[0104] In one embodiment of the present application, the Display framework is responsible for processing graphic elements in applications and user interfaces, as well as interacting with hardware display screens. 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 each application into a 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.
[0105] In some embodiments, in order 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 make 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 starts, 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 fluent.
[0106] 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).
[0107] S408: The Display framework determines whether the current moment has reached the screen refresh cycle.
[0108] In some embodiments, in order to ensure that the first APP can render the image to the display screen in a timely manner, a smooth display effect is guaranteed, and tearing or other adverse conditions are avoided. 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.
[0109] S409: If the current moment reaches the screen refresh cycle, the Display framework generates a vertical synchronization signal in response to the vertical synchronization request.
[0110] In some embodiments, when it is determined that the current moment reaches the screen refresh cycle, the SurfaceFlinger thread in the Display framework can generate a vertical synchronization signal in response to a vertical synchronization signal request.
[0111] S410: The Display framework sends a vertical synchronization signal to the UI framework.
[0112] 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.
[0113] S411: The UI framework determines, in response to the vertical synchronization signal, whether the sliding operation reaches a sliding response threshold of the first APP based on the touch point coordinates.
[0114] 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, responds to the vertical synchronization signal and starts drawing a new layer. Before, it is necessary to confirm whether the sliding operation reaches the sliding response threshold of the first APP based on the touch point coordinates. 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 will determine whether the sliding operation reaches the sliding response threshold of the first APP based on the new touch point coordinates.
[0115] During the sliding operation of the user, the UI framework can periodically receive the touch point coordinates and touch events. The UI framework can calculate the distance of the current sliding operation based on the touch point coordinates received at the current moment and the touch point coordinates corresponding to the start of sliding, so as to determine whether the current sliding operation has reached the sliding response threshold. If the distance between the touch point coordinates received at the current moment and the touch point coordinates corresponding to the start of sliding is greater than or equal to the sliding response threshold, it is confirmed that the sliding operation has reached the sliding response threshold; if the distance between the touch point coordinates received at the current moment and the touch point coordinates corresponding to the start of sliding is less than the sliding response threshold, it is confirmed that the sliding operation has not reached the sliding response threshold.
[0116] 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.
[0117] In some embodiments, when it is confirmed that the sliding operation reaches the sliding response threshold, the application thread in the UI framework (eg, the thread of the first APP) may draw and render a new layer.
[0118] S413: The UI framework sends the rendered layer to the Display framework.
[0119] In some embodiments, after completing the rendering of the 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.
[0120] S414: The Display framework synthesizes the rendered layers to obtain an image frame.
[0121] In some embodiments, the SurfaceFlinger thread in the Display framework can synthesize the rendered layers to obtain an image frame.
[0122] S415: The Display framework sends the image frame to the hardware display module.
[0123] In some embodiments, the SurfaceFlinger thread in the Display framework can send the image frame to the display driver of the hardware display module.
[0124] S416: The hardware display module displays the image frame.
[0125] 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.
[0126] 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 liquid crystal 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.
[0127] exist Figure 4In the process shown, the clock for recording the touch sampling cycle and the clock for recording the screen refresh cycle are usually not synchronized, and may be controlled by different hardware circuits and work at different frequencies. For situations where the touch sampling rate is the same or different from the screen refresh rate, the following problems may occur: 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 cycle 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 cycle is reached at the current moment, and the application thread in the UI framework (for example, the thread of the first APP) needs to wait for the refresh cycle to arrive 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, resulting in poor hand tracking of the electronic device.
[0128] Specifically, combined Figure 5Assume that the touch sampling rate of the touch screen is 120Hz, 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. Assume that the application thread in the UI framework (for example, the thread of the first APP) works at a screen refresh rate of 60Hz, 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 through a sliding operation. Assume that when the user slides from position 1 to position 5, the sliding response threshold is not reached. During this period, the application thread can receive three vertical synchronization signals VsyncApp1, VsyncApp2 and VsyncApp3. Since the sliding response threshold is not reached until the user slides to position 6 (for example, point A), the application thread will not respond to any of VsyncApp1, VsyncApp2 and VsyncApp3 to draw and render the layer (the application thread responds to VsyncApp1, VsyncApp2 and VsyncApp3 to judge the sliding response threshold. Since the sliding response threshold is not reached when sliding from position 1 to position 5, the application thread continues to wait for the next vertical synchronization signal) until the sliding response threshold is reached at position 6. However, since the application thread working cycle is 16.67 milliseconds, the screen refresh cycle is not reached when the user slides to position 6, the application thread does not receive the vertical synchronization signal, and the application thread cannot start working. It needs to wait for the vertical synchronization signal VsyncApp4 to arrive before it can start working, that is, the user needs to slide to position 7 (point B) to meet the screen refresh cycle. The application thread starts working when the user slides to position 7. It can be seen that the application thread cannot start working at position 6, and needs to continue to wait for the user to slide to position 7. When the screen refresh cycle arrives, the application thread can respond to the vertical synchronization signal VsyncApp4 to start working. The time that 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 great impact on the initial tracking chirality.
[0129] 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. Figure 6, briefly explain the principle of the display control method. Assume that the touch sampling rate of the touch screen is 120Hz, that is, the period 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 screen refresh rate of 60Hz, 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.
[0130] 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. Figure 5 In the scheme, during the sliding from position point 1 to position point 6, the application thread can 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 by the embodiment of the present application is that the Input framework notifies the Display framework to increase the vertical synchronization signal each time the Input framework receives the touch point coordinates and touch events reported by the TPIC / TP driver, that is, the generation frequency of the vertical synchronization signal is increased, thereby increasing the number of times the application thread determines whether the current sliding operation reaches the sliding response threshold, so as to prompt the application thread to start working as soon as possible when the user's sliding operation reaches the sliding response threshold.
[0131] 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 reaches the sliding response threshold, and then the application thread can draw and render the layer at position 6, and the application thread does not need to Figure 5The same scheme as in FIG. 1 is that it is necessary to wait until the user slides to position point 7 before responding to VsyncApp4 to start working. It can respond to the vertical synchronization signal VsyncApp3' to judge the sliding response threshold and draw and render the layer in advance, thus shortening the touch delay time. That is, compared with FIG. Figure 5 The solution 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 affect 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 adding new vertical synchronization signals after the application thread starts drawing the layer, that is, the Display framework resumes to follow the Figure 5 The vertical synchronization signal is generated according to the screen refresh cycle.
[0132] The following will be combined Figure 7 , describes in detail how to add a software processing flow of a vertical synchronization signal using the display control method provided by this application.
[0133] The execution subject of a display control method provided in an embodiment of the present application may be a display control device. The display control may also be a CPU of an electronic device, or a control module in an electronic device for executing the display control method. In the embodiment of the present application, the display control method provided in the embodiment of the present application is described by taking an electronic device executing the display control method as an example.
[0134] Figure 7 Taking the application interface of the first APP displayed on the screen of an electronic device as an example, the first APP can be an APP that supports sliding operations to update the application interface, and the application type of the first APP is not limited in this application example.
[0135] 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.
[0136] S702: The Input framework notifies the Display framework of the MOVE event.
[0137] 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, and thus the Display framework can be set to try to add a new vertical synchronization signal based on the MOVE event in the touch event.
[0138] S703: The Display framework receives notification of the MOVE event.
[0139] In some embodiments, after the Input framework notifies the Display framework of the MOVE event, the Display framework may receive the notification of the MOVE event.
[0140] S704: The Display framework determines whether the function of adding a vertical synchronization signal is enabled.
[0141] In some embodiments, in order to avoid excessive generation of vertical synchronization signals and affect 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.
[0142] In some embodiments, the function of adding a vertical synchronization signal can be turned off when the following situations occur during a user's sliding operation: a. The application thread starts drawing the layer; b. An UP event is detected. For example, the application thread starts drawing the layer, and the Input framework stops notifying the Display framework of the MOVE event. Since the Display framework cannot receive notifications of the MOVE event, the Surfaceflinger thread will not attempt to generate additional vertical synchronization signals.
[0143] The function of adding a new vertical synchronization signal can be reopened when a new sliding operation occurs, that is, the function of adding a new vertical synchronization signal can be reopened when a new DOWN event and a MOVE event are detected.
[0144] 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 scenes 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.
[0145] In some embodiments, the Input framework may also stop notifying the Display framework of MOVE events after sending the 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. The embodiment of the present application does not limit this. For example, the second preset number of times is 20 times.
[0146] S705: If the function of adding a vertical synchronization signal is enabled, the Display framework determines whether the first APP is a preset application program.
[0147] Since the present application scheme 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 scheme can be set to take effect only in scenarios that have certain requirements for the initial sliding and chirality, such as some specific applications. The embodiment of the present application can take effect only for the 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.
[0148] For example, the Surfaceflinger thread in the Display framework can determine whether the first APP is a preset application by comparing whether the first APP is 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 try to add a new vertical synchronization signal, the process ends, and waits for the notification of the next MOVE event to make another judgment.
[0149] S706: If the first APP is a preset application, the Display framework determines whether the time point of adding a vertical synchronization signal is appropriate.
[0150] 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.
[0151] 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 (based on the vertical synchronization signal generated by 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 (based on the vertical synchronization signal generated by 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 any one 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, and the Surfaceflinger thread abandons the newly added vertical synchronization signal. The process ends and waits for the notification of the next MOVE event to make another judgment.
[0152] 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.5 ms.
[0153] S707: If the time point of the newly added vertical synchronization signal is appropriate, the Display framework generates a vertical synchronization signal.
[0154] 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.
[0155] The following will be combined Figure 8 , after describing in detail the display control method provided by the sampling application, when the user acts on the touch screen through a sliding operation, the screen interface responds to the sliding operation and displays the software processing flow.
[0156] The execution subject of a display control method provided in an embodiment of the present application may be a display control device. The display control may also be a CPU of an electronic device, or a control module in an electronic device for executing the display control method. In the embodiment of the present application, the display control method provided in the embodiment of the present application is described by taking an electronic device executing the display control method as an example.
[0157] Figure 8 Taking the screen of an electronic device displaying the application interface of the first APP as an example, the first APP may be an APP that supports sliding operations to update the application interface, and the application type of the first APP is not limited in this application example. Since the embodiment of this application involves the 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 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.
[0158] S801: In response to a sliding operation of a user 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.
[0159] In the embodiment of the present application, when the user is using the first APP, there may be a need to update the application interface currently displayed by the first APP (for example, by sliding up or down the application interface to browse 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 TPIC / 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.
[0160] S802: The TP IC / TP driver reports the touch point coordinates and touch events to the Input framework.
[0161] 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.
[0162] S803: The Input framework sends the touch point coordinates and the touch event to the UI framework.
[0163] 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.
[0164] S804: The UI framework receives the touch point coordinates and the touch event.
[0165] 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.
[0166] S805: The UI framework generates a vertical synchronization signal request in response to the touch event.
[0167] 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.
[0168] S806: The UI framework sends a vertical synchronization signal request to the Display framework.
[0169] 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.
[0170] S807: The Display framework receives a vertical synchronization signal request.
[0171] 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.
[0172] S808: The Display framework determines whether the current moment has reached the screen refresh cycle.
[0173] 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.
[0174] S809: If the current moment reaches the screen refresh cycle, the Display framework generates a first vertical synchronization signal.
[0175] 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.
[0176] S810: The Display framework sends a first vertical synchronization signal to the UI framework.
[0177] 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.
[0178] S811: The Input framework notifies the Display framework of the MOVE event.
[0179] In some embodiments, step S811 may be performed in parallel with step S803.
[0180] 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.
[0181] S812: The Display framework receives notification of a MOVE event.
[0182] 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.
[0183] S813: The Display framework determines whether the function of adding a vertical synchronization signal is enabled.
[0184] 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.
[0185] S814: If the function of adding a vertical synchronization signal is in an enabled state, the Display framework determines whether the first APP is a preset application program.
[0186] 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.
[0187] S815: If the first APP is a preset application, the Display framework determines whether the time point of adding a vertical synchronization signal is appropriate.
[0188] 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.
[0189] S816: If the time point of the newly added vertical synchronization signal is appropriate, the Display framework generates a second vertical synchronization signal.
[0190] 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.
[0191] S817: The Display framework sends a second vertical synchronization signal to the UI framework.
[0192] S818: The UI framework determines, in response to the first vertical synchronization signal, whether the sliding operation reaches a sliding response threshold of the first APP based on the touch point coordinates.
[0193] 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.
[0194] S819: The UI framework determines, in response to the second vertical synchronization signal, whether the sliding operation reaches a sliding response threshold of the first APP based on the touch point coordinates.
[0195] 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 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 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.
[0196] 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.
[0197] 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 reaches the sliding response threshold of the first APP, the thread of the first APP draws and renders a 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 reaches the sliding response threshold of the first APP, the thread of the first APP draws and renders a new layer.
[0198] S821: The UI framework sends the rendered layer to the Display framework.
[0199] 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.
[0200] S822: The Display framework synthesizes the rendered layers to obtain an image frame.
[0201] 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.
[0202] S823: The Display framework sends the image frame to the hardware display module.
[0203] 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.
[0204] S824: The hardware display module displays the image frame.
[0205] 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.
[0206] 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, thereby increasing the number of times the application thread determines whether the current sliding operation reaches the sliding response threshold, 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.
[0207] See also Fig. 9 As shown, the display control method provided in the embodiment of the present application is shown. The display control method can be applied to an electronic device, and the electronic device is installed with a first application program, and the application type of the first application program is not limited in the present application example. The display control method includes:
[0208] S901: Receive a first operation from a user.
[0209] In some embodiments, the electronic device is installed with a first application, an icon of the first application may be displayed on the desktop of the electronic device, and the first operation may refer to a click operation on the icon of the first application displayed on the desktop of the electronic device.
[0210] S902: In response to a first operation, start a first application.
[0211] 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.
[0212] S903: Receive a second operation of the user on the first application, where the second operation includes a sliding operation.
[0213] 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.
[0214] S904: In response to the second operation, acquire the touch point coordinates and the touch event of the second operation based on the touch sampling rate of the electronic device.
[0215] The touch sampling rate is used to indicate the number of times the touch screen samples and reports the touch signal in a unit 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.
[0216] 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.
[0217] 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 present. 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.
[0218] The electronic device also generates an additional second vertical synchronization signal based on the touch event. Compared with the existing sliding touch scheme, 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.
[0219] 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, so that the application thread of the first application can judge the sliding response threshold as soon as possible when the user's sliding operation reaches the sliding response threshold, and then draw and render the image as soon as possible.
[0220] 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. 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.
[0221] 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 an abnormal sliding scenario triggers the addition of a second vertical synchronization signal multiple times.
[0222] In some embodiments, the electronic device supports turning on or off a 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 additionally generate a second vertical synchronization signal based on the MOVE event.
[0223] 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 users or developers. 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 additionally generate a second vertical synchronization signal based on the MOVE event.
[0224] In some embodiments, it is also possible to set a time condition for additionally generating a 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 only generates 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 time condition for additionally generating a second vertical synchronization signal.
[0225] In some embodiments, whether the moment when the MOVE event is received meets the generation time condition of the additional second vertical synchronization signal can be determined in the following manner: obtain the first time difference between the moment when the MOVE event is received and the generation time of the previous first vertical synchronization signal, and the second time difference between the moment when the MOVE event is received and the generation time of the next first vertical synchronization signal to be generated; determine whether the first time difference is greater than the preset duration, and whether the second time difference is greater than the preset duration; in the case where both the first time difference and the second time difference are greater than the preset duration, determine that the moment when the MOVE event is received meets the generation time condition of the second vertical synchronization signal. That is, if both the first time difference and the second time difference are greater than the preset duration, it indicates that the additionally generated second vertical synchronization signal is not too close to the original first 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. If the newly added vertical synchronization signal function is in the on state, 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.
[0226] S906: 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, execute drawing and rendering of the image frame to be refreshed and displayed.
[0227] By setting a sliding response threshold, the first application can avoid the situation where the application interface 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 any one of the first vertical synchronization signal and 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.
[0228] In some embodiments, since the newly added vertical synchronization signal function is enabled, the application will be loaded with more power to a certain extent, resulting in increased power consumption of the electronic device. If it is detected that the application thread is drawing and rendering an image to be refreshed, 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 a second vertical synchronization signal additionally, 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.
[0229] In some embodiments, 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 second vertical synchronization signal, and the new vertical synchronization signal function can be turned off.
[0230] 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, and 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.
[0231] 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 tracking performance of the electronic device.
[0232] S907: Synthesize and display the rendered image frames.
[0233] In some embodiments, 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 refreshed application interface of the first application on the display screen, and the first application responds to the user's second operation to refresh the application interface. 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.
[0234] See also Fig.10 As shown, it is a software architecture diagram of the electronic device provided in the embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. The following is an example of an Android operating system installed in an electronic device, but the present application is not limited to this, and other types of operating systems can also be installed in the electronic device.
[0235] For example, the Android system is divided into four layers, which are, from top to bottom, an application layer 101 , a framework layer 102 , an Android runtime and system library 103 , a kernel layer 104 , and a hardware layer 105 .
[0236] 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.
[0237] The framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0238] Among them, the window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to the application. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying pictures. The phone manager is used to provide communication functions for electronic devices. For example, the management of call status (including connected, hung up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the top status bar of the system in the form of an icon or scroll bar text, such as a notification of 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 is prompted in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0239] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library contains two parts: one is the function that the Java language needs to call, and the other is the Android core library.
[0240] The application layer and framework layer run in the virtual machine. The virtual machine executes the java files of the application layer and framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0241] The system library may include multiple functional modules, such as a surface manager, a media library, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc.
[0242] Among them, the surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0243] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
[0244] The kernel layer is the core of the operating system of an electronic device. It is the first layer of software expansion based on hardware. It provides the most basic functions of the operating system and is the basis for the operation of the operating system. It is responsible for managing the system's processes, memory, device drivers, files, and network systems, and determines the performance and stability of the system. For example, the kernel can determine the operating time of an application on a certain part of the hardware.
[0245] The kernel layer includes programs that are closely related to the hardware, such as interrupt handlers, device drivers, etc. It also includes basic, common, and high-frequency modules, such as clock management modules, process scheduling modules, etc. It also includes key data structures. The kernel layer can be set in the processor or solidified in the internal memory.
[0246] The hardware layer is the hardware of the electronic device, and the hardware layer at least includes a display screen.
[0247] See also Fig.11 , which is a schematic diagram of an application scenario of a display control method provided in an embodiment of the present application.
[0248] Assuming that the user's sliding operation acts on the application interface of the first APP, in 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. In the kernel layer 104, the touch driver obtains the touch point coordinates and touch events of the reported point based on the capacitance change of the touch layer, and reports the touch point coordinates and touch events of the reported point to the Input Reader thread of the framework layer 102. In the framework layer 102, the Input Reader thread passes the touch point coordinates and touch events of the reported point to the Input Dispatcher thread, and the Input Dispatcher further transmits the touch point coordinates and touch events 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 render 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.
[0249] See also Fig.12 As shown, the electronic device 100 involved in the embodiment of the present application is introduced below. The electronic device in the embodiment of the present application can be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a cellular phone, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device and other devices including a touch screen. The embodiment of the present application does not impose any special restrictions on the specific form of the electronic device. Please refer to Fig.12 , Fig.12 It is a schematic diagram of the structure of the electronic device 100 provided in an embodiment of the present application.
[0250] 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.
[0251] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0252] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0253] 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.
[0254] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instructions or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0255] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0256] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 communicates with the touch sensor 180K through the I2C bus interface to realize the touch function of the electronic device 100.
[0257] 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 achieve communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 via the I2S interface to achieve the function of answering a call through a Bluetooth headset.
[0258] 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 to realize the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0259] The UART interface is a universal serial data bus 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 generally 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 through the UART interface to implement the Bluetooth function. In some embodiments, the audio module 170 can transmit an audio signal to the wireless communication module 160 through the UART interface to implement the function of playing music through a Bluetooth headset.
[0260] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the shooting function of the electronic device 100. The processor 110 and the display screen 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0261] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the 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.
[0262] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transfer data between the electronic device 100 and a peripheral device. It can also be used to connect headphones to play audio through the headphones. The interface can also be used to connect other electronic devices 100, such as AR devices, etc.
[0263] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present invention is only a schematic 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 in the above embodiments, or a combination of multiple interface connection methods.
[0264] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.
[0265] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0266] 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.
[0267] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0268] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 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.
[0269] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0270] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0271] 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 the network and other devices through wireless communication technology. The wireless communication technology 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).
[0272] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0273] 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 1 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 may be a touch screen. That is, the touch sensor 180K is integrated in the display screen 194.
[0274] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0275] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0276] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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.
[0277] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0278] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0279] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0280] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
[0281] 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 DDR SDRAM is generally referred to as DDR5 SDRAM), etc.;
[0282] Non-volatile memory may include disk storage devices and flash memory.
[0283] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; can be divided into single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage unit potential level; can be divided into universal flash storage (UFS), embedded multi media card (eMMC), etc. according to the storage specification.
[0284] 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.
[0285] 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 .
[0286] 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 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in the external non-volatile memory.
[0287] 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.
[0288] 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 arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0289] The receiver 170B, also called a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the human ear.
[0290] Microphone 170C, also called "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 microphone 170C to input the sound signal into 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 sound source, realize directional recording function, etc.
[0291] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0292] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. 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 a parallel plate including at least two conductive materials. 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 acts on the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to 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 the first pressure threshold acts on 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 acts on the short message application icon, an instruction to create a new short message is executed.
[0293] The gyro 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 gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro 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 gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0294] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.
[0295] 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 leather 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 according to the magnetic sensor 180D. Then, according to the detected opening and closing state of the leather case or the opening and closing state of the flip cover, the flip cover can be automatically unlocked.
[0296] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device 100 and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0297] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0298] 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 holds 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.
[0299] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
[0300] 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.
[0301] 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 a 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 avoid abnormal shutdown of the electronic device 100 due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 performs a boost on the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
[0302] The touch sensor 180K is also called a "touch device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0303] The bone conduction sensor 180M can obtain a vibration signal. In some embodiments, the bone conduction sensor 180M can obtain a vibration signal of a vibrating bone block of the vocal part of the human body. The bone conduction sensor 180M can also contact the human pulse to receive a blood pressure beat signal. In some embodiments, the bone conduction sensor 180M can also be set in an earphone and combined into a bone conduction earphone. The audio module 170 can parse out a voice signal based on the vibration signal of the vibrating bone block of the vocal part obtained by the bone conduction sensor 180M to realize a voice function. The application processor can parse the heart rate information based on the blood pressure beat signal obtained by the bone conduction sensor 180M to realize a heart rate detection function.
[0304] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key input and generate key signal input related to user settings and function control of the electronic device 100.
[0305] 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.
[0306] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0307] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out 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.
[0308] The display control methods in the above embodiments can all be implemented in the electronic device 100 having the above hardware structure.
[0309] This embodiment further provides a computer-readable storage medium, in which computer instructions are stored. 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.
[0310] This embodiment further provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement the display control method in the above-mentioned embodiment.
[0311] 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 execution instructions, and when the device is running, the processor can execute the computer execution instructions stored in the memory so that the chip executes the display control method in the above-mentioned method embodiments.
[0312] 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.
[0313] In the several embodiments provided in the present 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 only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, 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.
[0314] The unit described as a separate component may or may not be physically separated, and the component shown as a unit may be one physical unit or multiple physical units, that is, it may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
[0315] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0316] 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, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0317] 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, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions 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
Cited By
Interface generation system and method and vehicle
CN122363803A
Interface generation system, method and vehicle
CN122363803B
Display control method and related device
EP4650920A1
