Interface processing method and electronic equipment
By performing the motion effect settings in advance and generating vertical synchronization signals, the problem of slow response speed of the motion effect screen is solved, and the efficiency of user interaction experience and motion effect display is improved.
Patent Information
- Application Number
- CN202310801583.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
When users interact with electronic devices, the response speed during the drawing and display of animation screens is slow and the time delay is high, resulting in poor user interaction experience.
By performing the motion effect setting in advance when the start event of the user operation is detected and a third vertical synchronization signal is generated after the motion effect setting is completed, in order to trigger the momentum processing and display in advance, the third vertical synchronization signal is in the first and second sums with the third vertical synchronization signal. The time difference between the second vertical synchronization signals determines whether the dynamic efficiency processing is performed in advance to ensure that the dynamic efficiency processing is completed before the vertical synchronization signal of the next system cycle.
It speeds up the speed of animation effect processing and display, improves user interaction experience, reduces the delay and lag of animation effect display, and ensures that the animation effect response is more timely and smooth.
Smart Images

Figure CN119225584A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of terminal equipment, and in particular to an interface processing method and electronic equipment. Background Art
[0002] During the process of user interaction with electronic devices, electronic devices can display dynamic screens. For example, when a user clicks to start an application, the electronic device displays the startup dynamic screen of the application; when a user clicks to exit an application, the electronic device displays the exit dynamic screen of the application. During the dynamic screen display process, the electronic device needs to determine whether to draw based on the user's operation behavior. The response speed of the dynamic screen drawing and display process is slow, the latency is high, and the user interaction experience is poor. Summary of the invention
[0003] The embodiments of the present application provide an interface processing method and an electronic device for accelerating the response speed of dynamic effect processing and display and improving the user interaction experience.
[0004] In a first aspect, an embodiment of the present application provides an interface processing method, which is applied to an electronic device having a first application installed thereon, the method comprising: receiving a first operation of a user on the first application; executing a first animation setting in response to a start event of the first operation; when the first animation setting is completed and an end event of the first operation is received, executing animation processing in response to a third vertical synchronization signal, and displaying the animation screen of the first application; wherein the third vertical synchronization signal is between the first vertical synchronization signal and the second vertical synchronization signal in the first vertical synchronization signal period.
[0005] Among them, the third vertical synchronization signal is in the first vertical synchronization signal cycle, which can refer to the vertical synchronization signal of the current system cycle in this application. The previous vertical synchronization signal in the first vertical synchronization signal cycle is the first vertical synchronization signal; the next vertical synchronization signal is the second vertical synchronization signal, which is the vertical synchronization signal of the next system cycle. Motion effect processing refers to motion effect rendering synthesis. The above-mentioned third vertical synchronization signal can refer to the first vertical synchronization signal described in the specific implementation manner of this application.
[0006] In the implementation mode of the present application, the electronic device can trigger the motion effect processing through the third vertical synchronization signal before the vertical synchronization signal of the next system cycle is synthesized, so that the time of the motion effect processing can be advanced, so that the motion effect processing responds in advance, the speed of the motion effect processing display is accelerated, the response of the motion effect interaction is accelerated, and the user's interactive experience is improved. In addition, the electronic device can start the motion effect setting when it detects that the user's operation has started, and there is no need to wait until the user's first operation is completed before setting the motion effect. The above process means that the timing of the motion effect setting processing is advanced, thereby speeding up the process of motion effect processing and display, which can ensure that the motion effect response is more timely and the user interaction is smoother.
[0007] In a possible implementation, the execution of the motion effect processing in response to the third vertical synchronization signal includes: when the first time difference between the third vertical synchronization signal and the second vertical synchronization signal is greater than or equal to the first threshold duration, the motion effect processing is executed in response to the third vertical synchronization signal; the second vertical synchronization signal is the next vertical synchronization signal in the first vertical synchronization signal cycle. In this way, the electronic device can determine whether the time difference between the third vertical synchronization signal and the vertical synchronization signal of the next system cycle is greater than the duration of the motion effect processing (the first threshold duration). If it is greater than, the processing process can be performed in advance. The electronic device processes in advance, and the motion effect processing can be effectively advanced; and if it is less than, since the vertical synchronization signal of the system cycle arrives soon, there is no need to process in advance, so it can wait for the vertical synchronization signal of the next system cycle to trigger the motion effect processing process, so as to ensure the necessity of performing the motion effect processing based on the first vertical synchronization signal.
[0008] In a possible implementation, the execution of the motion effect processing in response to the third vertical synchronization signal includes: when the second time difference between the third vertical synchronization signal and the first vertical synchronization signal is less than or equal to the second threshold duration, the motion effect processing is executed in response to the third vertical synchronization signal; the first vertical synchronization signal is the previous vertical synchronization signal in the first vertical synchronization signal cycle. In this way, the electronic device can determine whether the time difference between the third vertical synchronization signal and the vertical synchronization signal of the previous system cycle is less than the duration of the motion effect processing (the second threshold duration). If it is less than, the processing process can be performed in advance. The electronic device processes in advance, and the motion effect processing can be effectively advanced; and if it is greater than, since the vertical synchronization signal of the system cycle arrives soon, there is no need to process in advance, so it can wait for the vertical synchronization signal of the next system cycle to trigger the motion effect processing process, so as to ensure the necessity of performing the motion effect processing based on the third vertical synchronization signal.
[0009] In a possible implementation, the execution of the first motion effect setting includes: setting the motion effect attributes of the first application for the first operation; the motion effect attributes include at least one of the motion effect type, motion effect content, motion effect size, motion effect duration, or the motion effect start position and the motion effect end position; the motion effect type may include one of starting an application, sliding an intermediate interface, and exiting an application; the motion effect start position is used to indicate the position of the first frame of the M-frame motion effect screen on the display, and the motion effect end position is used to indicate the position of the last frame of the M-frame motion effect screen on the display. In this way, the electronic device can set the current motion effect attribute parameters, and the motion effect attribute parameters can be used for motion effect drawing. Processing and display process. Different user operations may have different motion effect types, and specific information such as motion effect content, motion effect size, motion effect duration, or motion effect start position and motion effect end position are associated with the first application and the motion effect type, which can ensure the reliability of motion effect display.
[0010] In a possible implementation, the start event is an event in which the operation is changed from undetected to detected, and the end event is an event in which the first operation is changed from detected to undetectable. The start event marks the beginning of the first operation, and the end event marks the end of the first operation. The start and end nodes affect the process of setting and processing the animation effect, thereby speeding up the response process of the animation effect processing and display.
[0011] In a possible implementation, when the first motion effect is set and the end event of the first operation is received, the motion effect processing is performed in response to the third vertical synchronization signal, including: when the first motion effect is set and the end event of the first operation is received, the third vertical synchronization signal is generated, and the motion effect processing is performed in response to the third vertical synchronization signal. In this way, the electronic device can generate a third vertical synchronization signal, and the third vertical synchronization signal is not a periodic vertical synchronization signal, so that the process of motion effect processing and display can be triggered in advance, the motion effect display can be accelerated, and the user's interactive experience can be improved.
[0012] In a possible implementation, the generation of the third vertical synchronization signal includes: generating the third vertical synchronization signal when the first time difference between the current time and the second vertical synchronization signal is greater than or equal to the first threshold duration, or when the second time difference between the current time and the first vertical synchronization signal is less than or equal to the second threshold duration; wherein the second vertical synchronization signal is the next vertical synchronization signal in the first vertical synchronization signal cycle; and the first vertical synchronization signal is the previous vertical synchronization signal in the first vertical synchronization signal cycle. In this way, it is possible to first determine whether to perform the dynamic processing and display process in advance, and generate the sixth vertical synchronization signal if it is determined to be performed in advance. In the case of not performing the process in advance, the sixth vertical synchronization signal does not need to be generated, thereby simplifying the execution steps and logic, reducing unnecessary processing steps, improving the execution efficiency of interface processing, and saving processing resources.
[0013] Among them, the above implementation methods can be specifically referred to the description of S911 to S916, which will not be repeated here.
[0014] In a possible implementation, after generating the third vertical synchronization signal, the method further includes: determining whether the third vertical synchronization signal satisfies an advance trigger condition; performing motion effect processing in response to the third vertical synchronization signal, including: performing motion effect processing in response to the third vertical synchronization signal when the advance trigger condition is met; the advance trigger condition includes that the first time difference between the third vertical synchronization signal and the second vertical synchronization signal is greater than or equal to the first threshold duration, or the second time difference between the third vertical synchronization signal and the first vertical synchronization signal is less than or equal to the second threshold duration. In this way, the electronic device can determine whether it is sufficient to use the third vertical synchronization signal to perform motion effect processing and display in advance, thereby ensuring the necessity of advance processing.
[0015] In a possible implementation, the electronic device includes a viewing system, a choreographer, and a display, and the performing of motion effect processing in response to a third vertical synchronization signal includes: sending the third vertical synchronization signal to the choreographer through the viewing system; performing image processing by the choreographer in response to the third vertical synchronization signal, and obtaining N frames of motion effect images, wherein N is an integer greater than 1; and sequentially displaying the N frames of motion effect images through the display. In this way, the choreographer can trigger the processing of the third motion effect picture upon receiving the third vertical synchronization signal, and then the display shows the above process. The third vertical synchronization signal is not a signal periodically given to the choreographer by the system, but is actively generated by the application when the triggering conditions are met, thereby ensuring the timeliness of the third vertical synchronization signal, and thus enabling faster motion effect processing and display response.
[0016] In a possible implementation, the electronic device further includes an input framework module, and the generating of the third vertical synchronization signal when the first dynamic effect is set and the end event of the first operation is received includes: when the first dynamic effect is set and the end event of the first operation is received, the dynamic effect processing message is sent to the input framework module through the first application; the third vertical synchronization signal is generated through the input framework module; before the third vertical synchronization signal is sent to the choreographer through the view system, the dynamic effect processing is performed in response to the third vertical synchronization signal, and further includes: when the first time difference between the third vertical synchronization signal and the second vertical synchronization signal is greater than or equal to the first threshold duration, or when the second time difference between the third vertical synchronization signal and the first vertical synchronization signal is less than or equal to the second threshold duration, the third vertical synchronization signal is sent to the view system through the input framework module. In this way, the view system can control whether to send a dynamic effect processing instruction to the choreographer, thereby being able to control whether to trigger the dynamic effect processing in advance, and ensuring the necessity of early triggering.
[0017] In a possible implementation, the electronic device further includes a view system, and the sending of the first vertical synchronization signal to the choreographer through the application includes: sending a motion effect processing message to the view system through the application, the motion effect processing message including information of the first vertical synchronization signal; judging through the view system whether the third time difference between the third operation and the first operation is greater than or equal to a second threshold duration, the third operation being an operation after the first operation; and when the third time difference is greater than or equal to the second threshold duration, sending a motion effect processing instruction to the choreographer through the view system, the motion effect processing instruction including the first vertical synchronization signal. In this way, the electronic device can judge whether the time between the previous and next operations is too short, and if it is too short, the motion effect may not be drawn and displayed, and if it is too long, it needs to be drawn and displayed, so as to ensure the continuity and timeliness of the motion effect display.
[0018] In a possible implementation, the electronic device stores a task list, the task list includes a first task and a second task, the priority of the first task is X, the priority of the second task is Y, and Y is greater than the priority of X; the method also includes: raising the priority of the first task to Z; Z is greater than the priority of Y; the execution of motion effect processing in response to a third vertical synchronization signal includes: in response to the third vertical synchronization signal, first performing image processing on the first task corresponding to the Z priority, and then processing the second task corresponding to the Y priority. In this way, the priority of the motion effect processing task in the task list is advanced, so that the choreographer can process the above tasks in advance, speed up the motion effect processing and display, improve the response speed, and optimize the user interaction experience.
[0019] The first task is a task of the motion effect processing type, and the second task is not a task of the motion effect processing type.
[0020] In a second aspect, an embodiment of the present application provides an interface processing method, which is applied to an electronic device, wherein the electronic device has a second application installed, and the method includes: receiving a second operation of a user on the second application; executing a second animation setting in response to a start event of the second operation; when the second animation setting is completed and an end event of the second operation is received; if the sixth vertical synchronization signal meets an early trigger condition, executing animation processing in response to the sixth vertical synchronization signal, and displaying the animation screen of the second application; the early trigger condition includes that the first time difference between the sixth vertical synchronization signal and the fifth vertical synchronization signal is greater than or equal to a first threshold duration, or the second time difference between the sixth vertical synchronization signal and the fourth vertical synchronization signal is less than or equal to a second threshold duration; wherein the sixth vertical synchronization signal is between the fourth vertical synchronization signal and the fifth vertical synchronization signal in the second vertical synchronization signal cycle; the fourth vertical synchronization signal is the previous vertical synchronization signal in the second vertical synchronization signal cycle, and the fifth vertical synchronization signal is the next vertical synchronization signal in the second vertical synchronization signal cycle.
[0021] In the implementation manner of the present application, the electronic device can trigger the motion effect processing through the third vertical synchronization signal before the vertical synchronization signal of the next system cycle is synthesized, so that the time of the motion effect processing can be advanced, so that the motion effect processing responds in advance, the speed of the motion effect processing display is accelerated, the response of the motion effect interaction is accelerated, and the user's interactive experience is improved. In addition, the electronic device can start the motion effect setting when it detects the start of the user's operation, and there is no need to wait until the user's first operation is completed before setting the motion effect. The above process means that the timing of the motion effect setting processing is advanced, thereby speeding up the process of motion effect processing and display, which can ensure that the motion effect response is more timely and the user interaction is smoother. Furthermore, when the early triggering conditions are met, the early triggering of the motion effect processing is performed to ensure the necessity of the early motion effect processing. When the time is close to the vertical synchronization signal of the next cycle, there is no need to trigger the motion effect processing in advance. The longer the time, the greater the benefit of early triggering, and it is ensured that the early triggering makes the effect of early response more obvious.
[0022] The second vertical synchronization signal period is the vertical synchronization signal period that the sixth vertical synchronization signal is in. The sixth vertical synchronization signal is not a periodic vertical synchronization signal, and specific reference may be made to the first vertical synchronization signal described in the specific implementation manner.
[0023] In one possible implementation, when the second animation setting is completed and an end event of the second operation is received, the method further includes: if the sixth vertical synchronization signal does not meet the early trigger condition, performing animation processing in response to the fifth vertical synchronization signal, and displaying the animation screen of the second application.
[0024] In a third aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes an interface processing method described in the first aspect or any possible implementation method of the first aspect.
[0025] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising one or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes an interface processing method described in the second aspect or any possible implementation method of the second aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute an interface processing method as described in the first aspect or any possible implementation of the first aspect.
[0027] In a sixth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute an interface processing method as described in the second aspect or any possible implementation of the second aspect.
[0028] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute an interface processing method as described in the first aspect or any possible implementation of the first aspect.
[0029] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute an interface processing method as described in the second aspect or any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1A It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0031] Figure 1B It is a schematic diagram of the software structure of an electronic device proposed in an embodiment of the present application;
[0032] Figure 2A to Figure 2E is a set of user interface schematic diagrams proposed in the embodiments of the present application;
[0033] Figure 3 is a schematic diagram of a first operation process of a user provided in an embodiment of the present application;
[0034] Figure 4A and Figure 4B It is a timing diagram of a group of interface processing methods proposed in the embodiments of the present application;
[0035] Figure 5A and Figure 5B It is another group of timing diagrams of interface processing methods proposed in the embodiments of the present application;
[0036] Figure 6 It is a flowchart of a method for interface processing proposed in an embodiment of the present application;
[0037] Figure 7It is a flowchart of a method for determining whether to trigger dynamic effect processing and display based on a first vertical synchronization signal provided by an embodiment of the present application;
[0038] Figure 8 This is a timing diagram of an interface processing method provided by an embodiment of the present application;
[0039] Fig. 9 It is a flowchart of another method for interface processing proposed in an embodiment of the present application;
[0040] Fig.10 It is a schematic diagram of a task list adjustment change provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0042] The embodiments of the present application disclose an interface processing method and an electronic device, which are used to improve the response speed of interface processing and display and enhance the user interaction experience.
[0043] The user interface of an electronic device can display motion effects in response to user operations. Smooth and smooth motion effects can significantly improve the user's interactive experience and quality. For example, when a user clicks to open an application, the user interface can display the rotation and enlargement of the application icon; when the user exits the application, the user interface can display the process of the application icon shrinking to the desktop... This application does not limit the display type of motion effects.
[0044] The electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop, a laptop computer, a handheld computer, a smart bracelet, a super mobile personal computer, a netbook, a personal phone, a personal data assistant, an augmented reality (AR) / virtual reality (VR) and other touch screen devices. The present application does not limit the specific form of the electronic device.
[0045] The following is an introduction to the device involved in the embodiments of the present application.
[0046] Figure 1A A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0047] 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, a sensor module 180, a display screen 194, etc. The sensor module 180 may include a touch sensor 180K, etc.
[0048] It is to be understood that the structure illustrated in the embodiment of the present application 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 split 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.
[0049] 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 memory, 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.
[0050] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0051] 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 instruction 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.
[0052] It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application 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.
[0053] 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 through the power management module 141.
[0054] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, 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.
[0055] 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.
[0056] 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.
[0057] 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.
[0058] The touch sensor 180K is also called a "touch panel". 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 a touch operation 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.
[0059] In the embodiment of the present application, the electronic device 100 can detect user operations through the touch sensor 180K. The user operation can include a hand drop operation from not touching the screen to touching the screen (starting event), and a hand lift operation from touching the screen to leaving the screen (ending event). The display screen 194 can display an animated screen.
[0060] Optionally, the user operation may also be an air operation. For example, a gesture sensing sensor is installed in the electronic device, and the gesture sensing sensor can detect the user's air operation. The air operation may be an operation to start or exit an application. The electronic device may determine the start event and end event of the air operation through the gesture sensing sensor, thereby determining the start and end of the operation.
[0061] Figure 1B A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0062] like Figure 1B As shown, the software framework of the electronic device involved in the present application may include an application layer, an application framework layer (framework, FWK), a system library, an Android runtime, a hardware layer and a kernel layer (kernel).
[0063] The application layer may include a series of application packages, such as gallery, mail, SMS, camera, weather, calendar, call and other applications (also referred to as applications, some of which are not shown). In the embodiment of the present application, the application may be any application in the application layer, and the user may open or close the application, or perform operations in the application.
[0064] The application 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.
[0065] like Figure 1B As shown, the application framework layer may include a window manager, a view system, a resource manager, a notification manager, a content provider, a phone manager, an input framework module, and an image drawing mode, etc.
[0066] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0067] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0068] The notification manager enables applications to display notification information in the status bar. It 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 download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications 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 displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0069] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A 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 images.
[0070] The input framework module can obtain user operations reported by touch sensors or gesture sensors, and report the user operations to the application. For example, the touch sensor can detect touch events. Touch events can include hand drop events (start events) and hand raise events (end events). The touch sensor reports the touch events to the input framework module, and then the input framework module can continue to report the touch events to the application and the view system.
[0071] The start event is an event that marks the beginning of a user operation, and the end event is an event that marks the end of this user operation. The start event and the end event can be touch events or air events. When the start event and the end event are touch events, the user never touches the display, and the electronic device receives the start event of the user operation; when the user originally touches the display and leaves the display, the electronic device cannot detect this operation, and the electronic device receives the end event.
[0072] The main thread of the application can be responsible for handling the drawing and display of the animation. After receiving the end event, the application can execute the animation settings and schedule the view system to execute the animation drawing to facilitate the display of subsequent animation pictures.
[0073] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0074] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0075] The image drawing module can draw the window layer in the dynamic image.
[0076] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0077] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0078] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application 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.
[0079] The system library can include multiple functional modules, such as surface manager, media library, 3D image processing library (such as OpenGL ES), 2D graphics engine (such as SGL) and choreographer.
[0080] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0081] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0082] The 3D image processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0083] A 2D graphics engine is a drawing engine for 2D drawings.
[0084] The choreographer can receive motion processing instructions from the view system and call modules such as the surface manager, 3D image processing library, and 2D graphics engine to perform motion rendering and synthesis to obtain multiple frames of motion effect images.
[0085] Choreographer and its animation processing: A class in the choreographer operating system, used to request a vertical synchronization signal (vsync) and start drawing operations in response to the requested vertical synchronization signal. A class is a data structure that can be used to define the state and behavior of an object. The vertical synchronization signal is provided by the operating system to coordinate and synchronize choreographer operations with surfaceFlinger operations.
[0086] After the application is started, the choreographer will be initialized. The process of initializing the choreographer includes: the activity will generate an instantiated choreographer object based on the choreographer class. This choreographer can perform drawing operations. Drawing operations may include: the choreographer handles input event tasks, animation event tasks, layout event tasks, and submit event tasks. After the choreographer draws, the results of the drawing operation can be submitted to other modules of the application, and then the refreshed interface or view is displayed on the screen of the electronic device.
[0087] The triggering conditions for the generation of choreographers and the execution of drawing operations: After each application is started by the user, the application needs to display a visual interface or view, and at least one choreographer belonging to the application will be generated. The number of choreographers can be the same as the number of threads used by the application. The UI thread can be the main thread, which is mainly used to carry the computing overhead of implementing functions such as interface display, update, and control interaction.
[0088] When the application needs to refresh the interface or view, the choreographer will request the system-cycle vertical synchronization signal from the synthesizer (SurfaceFlinger) to seek a suitable time for drawing operations. After receiving the vertical synchronization signal sent by SurfaceFlinger, the choreographer starts to perform drawing operations. Among them, SurfaceFlinger is a service provided by the underlying operating system, which is used to receive requests from choreographers of different applications and distribute vertical synchronization signals to the application in response to the request. Among them, the generation of the system-cycle vertical synchronization signal can be generated by software simulation or by the hardware of the electronic device, which is not specifically limited.
[0089] The system cycle frequency of the electronic device is associated with the screen refresh rate of the electronic device. For example, the vertical synchronization signal of the system cycle and the screen refresh rate are both 90 Hz. The embodiment of the present application does not limit the frequency of the vertical synchronization signal of the system cycle.
[0090] The kernel layer is the foundation of the Android operating system. The final functions of the Android operating system are completed through the kernel layer. The kernel layer at least includes display drivers, etc. The display driver can obtain the rendered and synthesized image frames from the buffer cache and control the display to display them in sequence.
[0091] The kernel layer also includes a task scheduling module, which can receive task instructions from the application layer or the FWK layer. The task instructions can be used to add tasks, clear tasks, etc. The task scheduling module can receive task instructions and schedule a task list based on the time sequence and task type of the task instructions. The task list is maintained by the task scheduling module, and the kernel of the electronic device needs to process each task in the task list. The electronic device processes the tasks in the task list based on the time and priority of each task. In an embodiment of the present application, the task scheduling module can adjust the priority of each task in the task list, thereby adjusting the execution order of the tasks. In an embodiment of the present application, if there is a task of dynamic effect drawing in the task list, the electronic device can increase the priority of such tasks to the highest priority. The choreographer can give priority to tasks with high priority in the task list, so that dynamic effect drawing can be given priority.
[0092] The hardware layer may include a display, a graphics processing unit (GPU), a touch sensor, a memory, and the like. The touch sensor can detect the start (start event) and end (end event) of a user's touch operation, as well as the start and end positions of the touch operation. The display can display image frames that have been processed with motion effects. The graphics processor can perform the rendering and synthesis process of the image. The central processing unit (CPU) can draw the image.
[0093] Specific can be combined Figure 2A to Figure 2E , introduces the software flow of electronic devices.
[0094] The user clicks on the weather control 201, please refer to Figure 2A In response to the received user operation, the electronic device displays Figure 2B to Figure 2E The user interface (animation display process) is displayed until the weather application is opened. When the user's finger falls on the screen, the touch sensor can detect that the user's finger has fallen, and a start event can be sent to the input framework module.
[0095] It should be noted that the application provides Figure 1B The software structure diagram of the electronic device shown is only an example and does not limit the specific module division in different layers of the Android operating system. For details, please refer to the introduction of the Android operating system software structure in conventional technology. In addition, the shooting method provided by this application can also be implemented based on other operating systems, and this application will not give examples one by one.
[0096] With the interaction between the user and the electronic device interface, the electronic device can display motion effects, and the display process of the motion effects can include the user interface displaying the opening of the application (for example, the icon is enlarged); closing the application (for example, the icon is reduced to the desktop), the display of the motion effects in the application, exiting the application and entering the multi-tasking card, etc. The display of the motion effects is accompanied by changes in the shape, size, angle, color, etc. of the pattern in the user interface, and the embodiments of the present application do not limit the specific display method of the motion effects.
[0097] Figure 2A to Figure 2E is a set of user interface schematic diagrams exemplarily disclosed in the embodiments of the present application. Figure 2B to Figure 2E It refers to the dynamic screen from launching the weather application to the completion of the weather application launching.
[0098] Figure 2A The user interface diagram of the electronic device is shown as an example. The user turns on his electronic device, so that the display screen of the electronic device displays the desktop of the electronic device, that is, the user interface 200. Figure 2AAs shown, the user interface 200 may include at least one application icon (e.g., weather 201, calendar, mail, settings, app store, notes, photo album, phone, short message, browser, camera, etc.). The positions of the application icons and the corresponding application names may be adjusted according to the user's preferences, which is not limited in this application.
[0099] It should be noted that Figure 2A The interface diagram of the electronic device shown is an exemplary display of an embodiment of the present application. The interface diagram of the electronic device may also be in other styles, and the present application does not limit this.
[0100] exist Figure 2A In the example, the user can click on the weather widget 201 in the user interface 200. In response to the user clicking on the weather widget 201, an animation of opening the weather application can be displayed, that is, Figure 2B to Figure 2E . Figure 2B to Figure 2E This is the dynamic effect change process of opening the weather application.
[0101] Specifically, Figure 3 Schematic diagram of a user operation process disclosed in an exemplary embodiment of the present application. Figure 3 As shown, the process from the user's finger not touching the display of the electronic device to touching the display and leaving after a period of time. The electronic device can collect the user's touch situation through the touch sensor. Before time T1, the user's finger has not touched the display of the electronic device, and the electronic device has not collected the user's touch position. At time T1, the user's finger touches the display, the electronic device collects the user's touch operation, detects the first operation, and obtains the start event. The specific touch position of the user can be exemplarily referred to Figure 2A The user's touch operation is not described in detail. In the time period from T1 to T2, which is the touch time period of the first operation, the electronic device continuously detects that the user has touched the display for many times. At T2, the user's finger leaves the display, and the electronic device cannot detect the user's first operation, and obtains the end event. The user touches the display screen of the electronic device, and there is a touch time from the time the finger touches the display to the time the finger leaves the display. The time period from when the electronic device detects the user's touch operation to when the touch operation is no longer detected can be considered as the touch period. Among them, the first operation refers to an operation such as a click or slide by the user, and the time from the user touching the display to leaving the display is a touch operation.
[0102] It should be noted that Figure 2A and Figure 3 The user operation in is a touch operation. The touch operation in this application can also be an air operation, etc., without limitation.
[0103] In response to the above user operation, the electronic device can display an animated screen for starting the weather application. The following specifically describes the process of the animated screen:
[0104] like Figure 2B As shown, in the user interface 210, the weather icon is Figure 2A The weather icon in the image becomes larger.
[0105] like Figure 2C As shown, in the user interface 220, the electronic device displays a window 221, compared to Figure 2B , the weather icon moves to the center of window 221, and the weather icon continues to grow larger and rotates.
[0106] like Figure 2D As shown, in the user interface 230, compared to Figure 2C , the weather icon continues to grow larger and continue to rotate.
[0107] like Figure 2E As shown, the user interface 240 displays the interface of the weather application. The interface of the weather application may include the current region, current temperature, weather conditions, air quality, weather in the next few hours, and weather conditions in recent days.
[0108] When the user clicks on the weather app (application) and the electronic device starts the dynamic display of the weather app, the electronic device can start to display the dynamic effect after detecting that the operation of clicking the weather app is completed. During the dynamic effect, the weather icon gradually becomes larger, and the center of the icon moves to the center of the interface. While continuing to grow, it rotates until entering the interface of the weather app.
[0109] The user operation can be a start-up operation of the weather application or a close operation of the weather application. In response to the close operation of the weather application, the electronic device can display the dynamic effect screen from closing the weather application to the completion of closing the weather application. For example, the dynamic effect display screens for closing the weather application are Figure 2E , Figure 2D , Figure 2C , Figure 2B and Figure 2A display process.
[0110] The operation of the above-mentioned dynamic effect change can be a click operation, a sliding operation, or other types of operations, for example, the operation method can also be a user gesture, voice, etc., which is not limited in this application. Figure 2A to Figure 2E The process of the dynamic effect change is only an exemplary description. The application program can be a weather application or other applications, and this application does not limit this.
[0111] Figure 4A and Figure 4BIt is a set of timing diagrams of interface processing methods.
[0112] like Figure 4A As shown, the electronic device provides a vertical synchronization signal of a specific frequency (a vertical synchronization signal of a system cycle), which changes over time. Figure 4A , vertical synchronization signals vsync1 and vsync2 of two consecutive system cycles are shown.
[0113] At a certain moment between the vertical synchronization signals vsync1 and vsync2 of the system cycle, the electronic device begins to detect the first operation and obtains the start event. After that, the electronic device cannot detect the first operation, which means that the first operation ends and the electronic device obtains the end event. The first operation is the operation of the user on the application in the electronic device. In response to the first operation, the electronic device needs to draw the dynamic effect screen of the application and display it.
[0114] When the electronic device obtains the end event, the electronic device starts to execute dynamic settings and prepares for subsequent dynamic effect processing and display. After the electronic device executes the dynamic settings, it waits for the vertical synchronization signal of the system cycle to trigger the dynamic effect processing and display of the interface. That is, after the electronic device obtains vsync2, it starts to execute dynamic effect processing and display.
[0115] Usually after executing the dynamic setting, you need to wait for a while to obtain the vertical synchronization signal to trigger the dynamic effect processing and display. Figure 4B As shown in the figure, if the electronic device happens to obtain vsync2 during the animation setting, vsync2 has been missed by the time the animation setting process is completed, and the electronic device needs to wait for vsync3. In this process, the time interval between the animation setting and the triggering of the animation process is nearly one system cycle. Figure 4A The waiting time interval is longer.
[0116] When a user clicks to trigger an application, the interface of the electronic device needs to be processed and displayed extremely quickly so that the user will not perceive the slow switching speed of the user interface or the slow response of the animation display. Figure 4A and Figure 4B In the image drawing process, the user operation time is random, while the process of the electronic device processing the animation and displaying the interface is carried out according to the rhythm of the vertical synchronization signal of the system cycle, which will cause the electronic device to not perform the tasks in the interface display process during the period between the user operation and the animation processing, but wait for the vertical synchronization signal of the system cycle. Faced with the scenario where the electronic device displays animations in response to user operations, the electronic device needs to respond quickly in a very short time. The above waiting time will make the electronic device's response processing slow, the display interface will also be stuck, etc., resulting in a poor user interaction experience.
[0117] In response to the above-mentioned problems, the embodiments of the present application propose an interface processing method and an electronic device. When the electronic device detects the start event of the first operation, it starts the operation of setting the motion effect. When the motion effect setting is completed and the end event of the first operation is detected, a vertical synchronization signal is actively generated. This vertical synchronization signal can trigger the processing and display of the motion effect in advance. In this way, the electronic device can speed up the motion effect processing response process of the touch operation, reduce the display delay, speed up the response speed, reduce the freeze, and also improve the user's interactive experience.
[0118] Figure 5A and Figure 5B This is another group of interface processing method timing diagrams disclosed in the embodiments of this application. Figure 5A As shown, the electronic device can periodically obtain the vertical synchronization signals of the system period: vsync1, vsync2... After the electronic device detects the start event (the first operation starts), it can start to execute the animation setting. When the animation setting (the first vsync, i.e., the first vertical synchronization signal) is completed and the end event (the first operation ends) is detected, the electronic device can immediately generate a pseudo vertical synchronization signal to trigger the process of executing the animation processing and display.
[0119] In the embodiment of the present application, the time of the user operation (or the time from the operation to the display of the animation effect) may occur within one system cycle, or may occur across two or more system cycles. Figure 5A As shown, during the system cycle from vsync1 to vsync2, the electronic device detects the first operation and sets the animation according to the start event of the first operation; after detecting the end event of the first operation and the animation setting is completed, the animation processing and display are executed based on the first vsync trigger. Figure 5B In the system cycle from vsync1 to vsync2, the electronic device detects the start event of the first operation and starts to execute the motion effect setting. In another system cycle from vsync2 to vsync3, the electronic device detects the end event of the first operation and executes the motion effect processing and display in the same manner according to the above conditions. Figure 5B In the embodiment, the first operation and the animation setting can span system cycles, and this application does not limit this.
[0120] Figure 5A and Figure 5B The execution process is compared to Figure 4AOn the one hand, the triggering condition of the execution process of the animation setting is advanced in time. Generally, during the user's touch, the electronic device has already started to execute the animation setting, preparing for the animation processing and display in advance. On the other hand, when the animation setting is completed and the start event is detected, a first vsync is actively generated. This first vsync can be directly processed and displayed as an animation, without the need for Figure 4A Therefore, in the process of displaying the dynamic effects, the embodiment of the present application adjusts the dynamic effect settings and the triggering timing of the dynamic effect processing and display, speeds up the process of interface processing and display, improves the response speed of the dynamic effects, solves the problem of slow response of the dynamic effect screen, and ensures the user's interactive experience.
[0121] Figure 6 It is a flow chart of a method for interface processing disclosed in an embodiment of the present application.
[0122] Combine the following Figure 2A to Figure 2E , Figure 3 , Figure 5A and Figure 5B ,right Figure 6 The method of processing the interface may include but is not limited to the following steps:
[0123] S601: The touch sensor detects a first operation.
[0124] At time T1, the electronic device detects the first operation from not detecting the touch operation, and the touch sensor can determine that the start event is obtained. The first operation can be a touch operation for the application. In response to the first operation, the electronic device needs to display an application-related dynamic effect screen. The user click process can refer to Figure 3 The touch changes before and after T1 in the figure, and Figure 2A The touch operations in are not described in detail.
[0125] S602: The touch sensor sends a start event to the input framework module.
[0126] When the touch sensor detects the first operation, it can send a start event to the input framework module. Correspondingly, the input framework module can receive the start event from the touch sensor. The touch sensor sends the touch event to the input framework module. The touch event may include a start event of a certain operation (for example, Figure 3 ) and end events (for example, Figure 3 End touch event in .
[0127] S603: The input framework module sends a start event to the application through the view system.
[0128] The input framework module can send a start event to the application program through the view system. Correspondingly, the application program can receive a start event from the input framework module through the view system.
[0129] Optionally, after the view system receives the start event from the input framework module, it can determine the start time. Specifically, after the view system receives the start event, it immediately records the current time point as the start time.
[0130] It should be noted that when the application receives the start event, it can start drawing the layer image, and the application can schedule the image drawing module of the FWK layer to draw the window layer. The image drawing module is in the FWK layer of the electronic device.
[0131] S604: The application executes dynamic settings.
[0132] When the application obtains the start event of the first operation, it starts to perform dynamic setting, that is, setting the dynamic effect attributes of the first application for the first operation.
[0133] Specifically, dynamic settings are performed, and the application sets the motion effect attributes. The motion effect attributes may include at least one of the attribute parameters such as the motion effect type, motion effect content, motion effect size, motion effect duration, or the motion effect start position and the motion effect end position. The motion effect type may include one of starting the application, sliding the intermediate interface, and exiting the application, that is, determining the motion effect type corresponding to the first operation. The motion effect start position is used to indicate the position of the first frame of the M frames on the display, and the motion effect end position is used to indicate the position of the last frame of the M frames on the display.
[0134] S605: The application executes a first drawing process to obtain a first drawing image.
[0135] When the application receives the start event, it can start drawing the image. For example, the camera application processes the image captured by the camera to obtain the first drawn image.
[0136] S606: The application sends an image drawing message to the image drawing module.
[0137] When the application obtains the start event, it can send an image drawing message to the image drawing module. Correspondingly, the image drawing module can receive the image drawing message from the application.
[0138] S607: The image drawing module performs a second drawing process to obtain a second drawing image.
[0139] After receiving the image drawing message, the image drawing module may perform a second drawing process to obtain a second drawing image. The second drawing process may be window drawing, for example, the image drawing module draws the window interface of the camera application to obtain the second drawing image.
[0140] S608: The touch sensor cannot detect the first operation.
[0141] At time T2, the touch sensor of the electronic device cannot detect the first operation, which means that the user ends the current touch operation and the finger leaves the user interface. The touch sensor can determine that the end event has been obtained. For details, please refer to Figure 6 Touch changes at moment T2 and before and after it.
[0142] S609: The touch sensor sends an end event to the input framework module.
[0143] When the touch sensor cannot detect the first operation, an end event may be sent to the input framework module. Correspondingly, the input framework module may receive the end event from the touch sensor.
[0144] S610: The input framework module sends an end event to the application through the view system.
[0145] When the input framework module receives the end event, the end event can be sent to the application through the view system. Correspondingly, the application can receive the end event from the input framework module through the view system.
[0146] Optionally, when an end event is obtained, the end time can be determined. Specifically, after the view system receives the end event, it immediately records the current time point as the end time.
[0147] S611: The application sends a motion effect processing message to the input framework module.
[0148] When the application determines that the execution of dynamic setting (S604) is completed and an end event (S610) is obtained, the application can send a dynamic effect processing message to the input framework module. Correspondingly, the input framework module can receive a dynamic effect processing message from the application. The dynamic effect processing message can instruct the input framework module to generate a first vertical synchronization signal.
[0149] S612: The input frame module generates a first vertical synchronization signal.
[0150] When the input framework module receives the motion effect processing message, it can generate a first vertical synchronization signal, which includes a timestamp.
[0151] In an embodiment of the present application, the first vertical synchronization signal may be a pseudo vertical synchronization signal. The information of the first vertical synchronization signal may include the timestamp of the first vertical synchronization signal. After S604 and S610 are executed, the application immediately generates a pseudo vertical synchronization signal. The first vertical synchronization signal can trigger the input framework module to execute S611 and S612. That is, it triggers the process of determining whether to perform dynamic effect processing based on the first vertical synchronization signal. Among them, the process of determining whether to perform dynamic effect processing based on the first vertical synchronization signal may include S614. The pseudo vertical synchronization signal refers to the vertical synchronization signal generated by the application. In contrast, the true vertical synchronization signal (the vertical synchronization signal of the system cycle) may be a vertical synchronization signal received by the choreographer at a certain frequency, for example, the above-mentioned choreographer receives vsync from SurfaceFlinger.
[0152] S613: The input framework module sends a first vertical synchronization signal to the viewing system.
[0153] After the input framework module generates the first vertical synchronization signal, the first vertical synchronization signal may be sent to the viewing system. Correspondingly, the viewing system may receive the first vertical synchronization signal from the input framework module.
[0154] S614: The view system determines whether to trigger motion effect processing and display based on the first vertical synchronization signal.
[0155] When the view system receives the first vertical synchronization signal, it can use the first vertical synchronization signal and its timestamp. The view system needs to first determine whether the first vertical synchronization signal triggers the animation processing and display in advance. Specifically, the view system determines whether the time difference between the first vertical synchronization signal and the vertical synchronization signal of the nearest system cycle meets the animation processing duration.
[0156] Figure 7 1 is a flow chart of a method for determining whether to trigger the processing and display of the dynamic effect based on the first vertical synchronization signal disclosed in an exemplary embodiment of the present application. Figure 7 As shown, the method for determining whether to trigger the dynamic effect processing and display based on the first vertical synchronization signal may include but is not limited to the following steps:
[0157] S6141: The view system determines whether the time difference between the first vertical synchronization signal and the vertical synchronization signal of the nearest system cycle meets the animation processing duration (animation triggering condition). If the animation processing duration is met, S6142 is executed (S615 is executed); if the animation processing duration is not met, S6143 is executed (S615 is not executed).
[0158] Among them, the vertical synchronization signal of the nearest system cycle can be the vertical synchronization signal of the next system cycle of the first vertical synchronization signal (the animation processing duration is the first threshold duration), or it can be the vertical synchronization signal of the previous system cycle of the first vertical synchronization signal (the animation processing duration is the second threshold duration). The animation processing durations are both set values, and the following two implementation modes are not described in detail.
[0159] Implementation method 1: The viewing system determines whether the first time difference between the first vertical synchronization signal and the vertical synchronization signal of the next system cycle is greater than (greater than or equal to) the first threshold duration. If the first time difference is greater than (greater than or equal to) the first threshold duration, the animation processing duration is satisfied; if the first time difference is less than or equal to (less than) the first threshold duration, the animation processing duration is not satisfied.
[0160] In the process of acquiring the first vertical synchronization signal, the electronic device will also periodically acquire the vertical synchronization signal of the system cycle. The time of the first vertical synchronization signal is between the vertical synchronization signals of two system cycles. The vertical synchronization signal of the next system cycle is after the first vertical synchronization signal, and the vertical synchronization signal of the next system cycle is the vertical synchronization signal of the system cycle closest to the first vertical synchronization signal. The viewing system can calculate the first time difference between the vertical synchronization signal of the next system cycle and the first vertical synchronization signal, and compare the first time difference with the first threshold duration, and determine whether the animation processing duration is met based on the comparison result. Among them, the first threshold duration can be a duration preset by the electronic device. Meeting the first threshold duration means that the electronic device has enough time to process and display animations.
[0161] Exemplarily, the first threshold duration is 5ms. When the first time difference is 3ms, 5<3, and it is determined that the motion effect processing duration is not met; when the first time difference is 10ms, 10>5, and it is determined that the motion effect processing duration is met.
[0162] Implementation method 2: The viewing system determines whether the second threshold duration is met based on the second time difference between the first vertical synchronization signal and the vertical synchronization signal of the previous system cycle. When the second time difference is less than (less than or equal to) the second threshold duration, the animation processing duration is met; when the second time difference is greater than or equal to (greater than) the second threshold duration, the animation processing duration is not met, and the vertical synchronization signal of the next system cycle is waited for to trigger the animation processing and display. Among them, the sum of the second threshold duration and the first threshold duration is equal to the duration of a system cycle, and the vertical synchronization signal of the previous system cycle is the vertical synchronization signal of the system cycle most recently before the first vertical synchronization signal.
[0163] S6142: The view system triggers motion effect processing and display based on the first vertical synchronization signal.
[0164] If the duration of the motion effect processing is satisfied, the electronic device may execute S615. The choreographer is triggered by the first vertical synchronization signal sent by the viewing system to execute motion effect processing and display.
[0165] Among them, the process of the view system triggering the dynamic effect display processing based on the first vertical synchronization signal can refer to the description of S615 to S620 and will not be repeated here.
[0166] S6143: The view system triggers the dynamic effect display processing based on the vertical synchronization signal of the next system cycle.
[0167] Among them, the trigger condition of S616 is that the choreographer can wait for the vertical synchronization signal of the next system cycle, and execute the process of triggering the motion effect processing and display when the vertical synchronization signal of the next system cycle is obtained. If the motion effect processing time is not met, the view system will not execute S615. The choreographer needs to wait for the vertical synchronization signal of the next system cycle sent by surfaceFlinger to trigger the motion effect processing and display. For the specific description of motion effect processing and display, please refer to the relevant description of S616~S620. In addition, the situation of S6143 can also be referred to. Figure 8 The relevant description is not repeated here.
[0168] Optionally, when the electronic device is provided with the above-mentioned early motion effect response function, the electronic device may execute S614 to S620. The electronic device has an early motion effect response switch, and the above-mentioned switch is turned on when the above-mentioned early motion effect response function is provided; the above-mentioned function is turned off when the early motion effect response is not provided. When the early motion effect response switch is in the on state, the electronic device may execute S614 to S620. When the early motion effect response switch is in the off state, the electronic device triggers motion effect processing and display based on the vertical synchronization signal of the next system cycle (refer to S6143 and execute S616 to S620).
[0169] S615: The view system sends a motion effect processing instruction to the choreographer.
[0170] The view system may send a motion processing instruction to the choreographer. Correspondingly, the choreographer may receive a motion processing instruction from the view system. The motion processing instruction is used to instruct to start image rendering and synthesis for the first operation.
[0171] The motion effect processing instruction may include the first vertical synchronization signal mentioned above. The first vertical synchronization signal may trigger the choreographer to perform image processing and synthesis.
[0172] In the embodiment of the present application, the vertical synchronization signal can be used to trigger the rendering of one or more layers and trigger the synthesis of the layers of the one or more images.
[0173] S616: The choreographer sends a rendering and synthesis instruction to the rendering and synthesis module.
[0174] After receiving the motion effect processing instruction, the choreographer may send the rendering and synthesis instruction to the rendering and synthesis module. Correspondingly, the rendering and synthesis module may receive the rendering and synthesis instruction from the choreographer.
[0175] S617: The rendering and synthesis module renders and synthesizes the first drawn image and the second drawn image to obtain a dynamic effect image.
[0176] After receiving the rendering synthesis instruction, the rendering synthesis module can render and synthesize the first drawn image and the second drawn image to obtain N frames of dynamic effect images. Specifically, the rendering synthesis module can be a system library including a media library, a two-dimensional image engine, a surface manager, and a three-dimensional image processing library. The rendering synthesis module can complete the rendering of the image drawn by the application (the actual processing hardware can be a GPU), and synthesize the layers after the rendering is completed (specifically, it can be performed by surfaceFlinger) to obtain a dynamic effect image. After obtaining the dynamic effect image, the dynamic effect image can be cached in a display buffer and wait for display.
[0177] S618: The rendering and synthesis module sends a rendering and synthesis completion notification to the choreographer.
[0178] After obtaining the dynamic effect image, the rendering and synthesis module can send a rendering and synthesis completion notification to the choreographer. Correspondingly, the choreographer can receive the rendering and synthesis completion notification from the rendering and synthesis module.
[0179] S619: The choreographer sends a dynamic image display instruction to the display.
[0180] After the choreographer obtains the dynamic image, he can send a dynamic image display instruction to the display, and correspondingly, the display driver can receive the dynamic image display instruction from the choreographer.
[0181] S620: The display displays the dynamic image.
[0182] After the display obtains the dynamic image display instruction, it can obtain the dynamic image from the display buffer and display the dynamic image in the buffer.
[0183] The display process of electronic devices can refer to Figure 2A to Figure 2E The process is not described in detail.
[0184] Figure 8 This is a timing diagram of an interface processing method disclosed in an embodiment of the present application. Figure 8As shown, when the electronic device executes S6141, when the motion effect setting is completed and the start event is detected, the electronic device starts to check whether the first time difference between the first vertical synchronization signal (first vsync) and the vertical synchronization signal (vsync2) of the next system cycle meets the first threshold duration. Figure 8 In the above process, since the first vsync and vsync2 times are too short, the electronic device does not have time to complete the cycle of animation drawing and display. Therefore, it can wait until vsync2 is triggered. In terms of time, there will be no long delay, and there is no need to use the first vertical synchronization signal for processing in advance. It can also ensure that the interface processing and display process is completed within one vsync signal cycle.
[0185] Fig. 9 It is a flowchart of another method for interface processing disclosed in an embodiment of the present application.
[0186] Combine the following Figure 2A to Figure 2E , Figure 3 , Figure 5A and Figure 5B ,right Fig. 9 The method of processing the interface may include but is not limited to the following steps:
[0187] S901: The touch sensor detects a first operation.
[0188] S902: The touch sensor sends a start event to the input framework module.
[0189] S903: The input framework module sends a start event to the application through the view system.
[0190] S904: The application executes dynamic settings.
[0191] S905: The application executes a first drawing process to obtain a first drawing image.
[0192] S906: The application sends an image drawing message to the image drawing module.
[0193] S907: The image drawing module performs a second drawing process to obtain a second drawing image.
[0194] S908: The touch sensor cannot detect the first operation.
[0195] S909: The touch sensor sends an end event to the input framework module.
[0196] S910: The input framework module sends an end event to the application through the view system.
[0197] For the specific description of S901 to S910 , reference may be made to the related description of S601 to S910 , which will not be repeated here.
[0198] S911: The application sends an animation advance message to the view system.
[0199] When the application determines that the end event of the first operation is obtained (S910) and the dynamic setting is completed (S904), an early animation message can be sent to the view system. Correspondingly, the view system can receive an early animation message from the application. The early animation message is used to instruct the view system to determine whether to generate a first vertical synchronization signal.
[0200] S912: The view system determines whether to trigger the motion effect processing in advance. If it is determined that the motion effect processing is triggered in advance, S913 to S916 are executed; if it is determined that the motion effect processing is not triggered in advance, S913 to S916 are not executed.
[0201] The view system can determine whether the time difference between the current time and the vertical synchronization signal of the nearest system cycle meets the animation processing duration. If the animation processing duration is met, the animation processing is triggered in advance; if the animation processing duration is not met, the animation processing is not triggered in advance.
[0202] Implementation method 1: The view system determines whether the first time difference between the current time and the vertical synchronization signal of the next system cycle is greater than (greater than or equal to) the first threshold duration. If the first time difference is greater than (greater than or equal to) the first threshold duration, the animation processing duration is met and S913 is executed; if the first time difference is less than or equal to (less than) the first threshold duration, the animation processing duration is not met and the vertical synchronization signal of the next system cycle is waited for to trigger the animation processing and display.
[0203] Implementation method 2: The view system determines whether the second threshold duration is met based on the second time difference between the current time and the vertical synchronization signal of the previous system cycle. If the second time difference is less than (less than or equal to) the second threshold duration, the animation processing duration is met and S913 is executed; if the second time difference is greater than or equal to (greater than) the second threshold duration, the animation processing duration is not met and the vertical synchronization signal of the next system cycle is waited for to trigger the animation processing and display.
[0204] It should be noted that the processing process of S912 can refer to the specific processing process of S614, and the current time can be considered as the time corresponding to the first vertical synchronization signal, which will not be described in detail.
[0205] S913: The view system sends a signal generation instruction to the input framework module.
[0206] When the view system determines to trigger the motion effect processing in advance, the view system can send a signal generation instruction to the input framework module. Correspondingly, the input framework module can receive the signal generation instruction from the view system. The signal generation instruction is used to instruct the input framework module to generate a first vertical synchronization signal.
[0207] S914: The input frame module generates a first vertical synchronization signal.
[0208] When the input framework module receives the signal generation instruction, the first vertical synchronization signal can be generated. S914 may refer to S612 for details, which will not be described in detail.
[0209] S915: The input framework module sends a first vertical synchronization signal to the viewing system.
[0210] After the input framework module generates the first vertical synchronization signal, the first vertical synchronization signal may be sent to the view system. For details of S915, reference may be made to the description of S613, which will not be repeated here.
[0211] S916: The view system sends a motion effect processing instruction to the choreographer.
[0212] When the view system receives the first vertical synchronization signal, it can send a motion effect processing instruction to the choreographer. The motion effect processing instruction can include the first vertical synchronization signal. S916 can be specifically referred to the description of S613, which will not be repeated here.
[0213] In the above processing of S911 to S916, the view system can first determine whether to execute the dynamic processing and display process in advance. If it is determined to be executed in advance, the input framework module generates a first vertical synchronization signal. If it is not executed in advance, the process of S913 to S916 does not need to be executed, thereby simplifying the execution steps and logic, reducing unnecessary processing steps, improving the execution efficiency of interface processing, and saving processing resources.
[0214] S917: The choreographer sends a rendering and synthesis instruction to the rendering and synthesis module.
[0215] S918: The rendering and synthesis module renders and synthesizes the first drawn image and the second drawn image to obtain a dynamic effect image.
[0216] S919: The rendering and synthesis module sends a rendering and synthesis completion notification to the choreographer.
[0217] S920: The choreographer sends a dynamic image display instruction to the display.
[0218] S921: The display displays a dynamic image.
[0219] Among them, the specific details of S917~S921 can refer to the relevant description of S616~S620, which is not repeated here.
[0220] The electronic device stores a task list, and the task list may store tasks. Different types of tasks have different priorities. The higher the priority of a task, the higher the priority of the task. Task types may include input event tasks, animation processing tasks, drawing tasks, and submission tasks. Among them, the task scheduling module adjusts the priority of tasks in the task list. The choreographer processes the tasks in the task list in order of priority and time sequence.
[0221] The task scheduling module can increase the priority of the drawing task in the dynamic drawing instruction in the task list to 1. The choreographer can execute the adjusted task list according to the priority.
[0222] Fig.10 Schematic diagram of a task list adjustment change disclosed in an exemplary embodiment of the present application. Fig.10 As shown, it is assumed that the priority of the input event task is 1, the priority of the animation processing task is 2; the priority of the motion processing task is 3; and the priority of the submission task is 4. Among them, the smaller the value, the higher the priority. The current tasks in the task list include input event task 1 (priority 1); animation processing task 1 (priority 4); motion processing task 1 (priority 3); animation processing task 2 (priority 4). Among them, drawing task 1 is a drawing task triggered by the first vertical synchronization signal, so the task scheduling module adjusts the priority of motion processing task 1 from 3 to 1. The priorities of other tasks remain unchanged. After that, the choreographer can process tasks according to the size of the priority and the time sequence of the tasks. In the adjusted task list, the electronic device can execute in the order of input event task 1, drawing task 1, animation processing task 1 and animation processing task 2. The execution time of drawing task 1 is advanced. In this way, the electronic device can execute the tasks triggered by the first vertical synchronization signal in the task queue in advance, ensure the timeliness of drawing and display execution, improve the response speed, and reduce the motion effect jamming.
[0223] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0224] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0225] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. An interface processing method, characterized in that: The method is applied to an electronic device, the electronic device having a first application installed therein, and the method comprises: receiving a first operation of a user on the first application; In response to the start event of the first operation, executing a first motion effect setting; When the first animation setting is completed and the end event of the first operation is received, animation processing is performed in response to a third vertical synchronization signal, and the animation screen of the first application is displayed; wherein the third vertical synchronization signal is between the first vertical synchronization signal and the second vertical synchronization signal in the first vertical synchronization signal period.
2. The method according to claim 1, characterized in that The performing the motion effect processing in response to the third vertical synchronization signal comprises: When the first time difference between the third vertical synchronization signal and the second vertical synchronization signal is greater than or equal to a first threshold duration, animation processing is performed in response to the third vertical synchronization signal; the second vertical synchronization signal is the next vertical synchronization signal in the first vertical synchronization signal cycle.
3. The method according to claim 1, characterized in that The performing the motion effect processing in response to the third vertical synchronization signal comprises: When the second time difference between the third vertical synchronization signal and the first vertical synchronization signal is less than or equal to a second threshold duration, animation processing is performed in response to the third vertical synchronization signal; the first vertical synchronization signal is the previous vertical synchronization signal in the first vertical synchronization signal cycle.
4. The method according to claim 1, characterized in that The performing of the first motion effect setting includes: The motion effect attributes of the first application are set for the first operation; the motion effect attributes include motion effect type, motion effect content, motion effect size, motion effect duration, or at least one of a motion effect start position and a motion effect end position; the motion effect type may include one of starting an application, sliding an intermediate interface, and exiting an application; the motion effect start position is used to indicate the position of the first frame of M frames of motion effect pictures on the display, and the motion effect end position is used to indicate the position of the last frame of M frames of motion effect pictures on the display.
5. The method according to claim 1, characterized in that The start event is an event in which an operation is changed from not being detected to detecting the first operation; and the end event is an event in which the first operation is changed from being detected to being undetectable.
6. The method according to claim 1, characterized in that When the first motion effect is set and the end event of the first operation is received, performing motion effect processing in response to a third vertical synchronization signal includes: When the first motion effect is set and the end event of the first operation is received, the third vertical synchronization signal is generated, and motion effect processing is performed in response to the third vertical synchronization signal.
7. The method according to claim 6, characterized in that The generating the third vertical synchronization signal comprises: Generate the third vertical synchronization signal when a first time difference between the current time and the second vertical synchronization signal is greater than or equal to a first threshold duration, or when a second time difference between the current time and the first vertical synchronization signal is less than or equal to a second threshold duration; The second vertical synchronization signal is the next vertical synchronization signal in the first vertical synchronization signal cycle; and the first vertical synchronization signal is the previous vertical synchronization signal in the first vertical synchronization signal cycle.
8. The method according to claim 6, characterized in that The electronic device includes a viewing system, a choreographer, and a display, and the performing of the motion effect processing in response to the third vertical synchronization signal includes: sending the third vertical synchronization signal to the choreographer through the viewing system; The choreographer performs image processing in response to the third vertical synchronization signal, and obtains N frames of dynamic effect images, where N is an integer greater than 1; The N frames of dynamic effect images are displayed in sequence through the display.
9. The method according to claim 7, characterized in that: The electronic device further includes an input framework module, and when the first motion effect is set and an end event of the first operation is received, generating the third vertical synchronization signal includes: When the first motion effect is set and the end event of the first operation is received, sending a motion effect processing message to the input framework module through the first application; Generate the third vertical synchronization signal through the input frame module; Before sending the third vertical synchronization signal to the choreographer through the viewing system, performing the motion effect processing in response to the third vertical synchronization signal further includes: When the first time difference between the third vertical synchronization signal and the second vertical synchronization signal is greater than or equal to a first threshold duration, or the second time difference between the third vertical synchronization signal and the first vertical synchronization signal is less than or equal to a second threshold duration, the third vertical synchronization signal is sent to the viewing system through the input framework module.
10. The method according to any one of claims 1 to 9, characterized in that: The electronic device stores a task list, the task list includes a first task and a second task, the priority of the first task is X, the priority of the second task is Y, and Y is greater than the priority of X; the method further includes: Raising the priority of the first task to Z; wherein Z is greater than the priority of Y; The performing the motion effect processing in response to the third vertical synchronization signal comprises: In response to the third vertical synchronization signal, image processing is performed on the first task corresponding to the Z priority level first, and then the second task corresponding to the Y priority level is processed.
11. An interface processing method, characterized in that: The method is applied to an electronic device, the electronic device having a second application installed therein, and the method comprises: receiving a second operation of the user on the second application; In response to the start event of the second operation, executing a second motion effect setting; When the second animation setting is completed and the end event of the second operation is received; if the sixth vertical synchronization signal meets the early trigger condition, the animation processing is performed in response to the sixth vertical synchronization signal, and the animation screen of the second application is displayed; The early trigger condition includes that a first time difference between the sixth vertical synchronization signal and the fifth vertical synchronization signal is greater than or equal to a first threshold duration, or a second time difference between the sixth vertical synchronization signal and the fourth vertical synchronization signal is less than or equal to a second threshold duration; Among them, the sixth vertical synchronization signal is between the fourth vertical synchronization signal and the fifth vertical synchronization signal in the second vertical synchronization signal cycle; the fourth vertical synchronization signal is the previous vertical synchronization signal in the second vertical synchronization signal cycle, and the fifth vertical synchronization signal is the next vertical synchronization signal in the second vertical synchronization signal cycle.
12. The method according to claim 11, characterized in that When the second animation effect is set and an end event of the second operation is received, the method further includes: If the sixth vertical synchronization signal does not meet the advance trigger condition, the animation processing is performed in response to the fifth vertical synchronization signal, and the animation screen of the second application is displayed.
13. An electronic device, characterized in that: include: One or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1 to 10.
14. An electronic device, characterized in that: include: One or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories are used to store computer program code, the computer program code includes computer instructions, when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 11-12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 11 to 12 is implemented.
Citation Information
Cited By
Interface processing method and electronic device
EP4650926A1
