Interface processing method and electronic device
By starting the dynamic effect setting in advance and judging the time difference within the vertical synchronization signal period, the problem of slow response speed of electronic devices when displaying the dynamic effect screen is solved, faster dynamic effect processing and display are achieved, and user interaction experience is improved.
Patent Information
- Application Number
- PCT/CN2024/081419
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-30
- Filing Date
- 2024-03-13
- Publication Date
- 2025-01-02
AI Technical Summary
When electronic devices display animation screens, their response speed is slow and their time delay is high, resulting in poor user interaction experience.
By starting the animation effect setting in advance when the user operation starts, and generating a vertical synchronization signal after the animation effect setting is completed to trigger the motor effect processing and display in advance, using the time difference during the vertical synchronization signal period to determine whether the motor effect processing is performed in advance. To speed up the speed of motion processing and display.
It improves the response speed of animation processing and display, reduces lag situations, and improves user interaction experience and fluency.
Smart Images

Figure CN2024081419_02012025_PF_FP_ABST
Abstract
Description
Interface processing method and electronic equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on June 30, 2023, with application number 202310801583.7 and invention name “An interface processing method and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the technical field of terminal devices, and in particular to an interface processing method and electronic equipment. Background Art
[0003] During user interaction with an electronic device, the electronic device can display animated screens. For example, when a user clicks to launch an application, the electronic device displays the application's launch animation; when a user clicks to exit an application, the electronic device displays the application's exit animation. During the display of animated screens, the electronic device needs to determine whether to draw based on the user's operation behavior. The drawing and display process of animated screens has slow response speeds, high latency, and a poor user interaction experience.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide an interface processing method and an electronic device for accelerating the response speed of motion effect processing and display, thereby improving the user interaction experience.
[0006] 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.
[0007] 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 of this application.
[0008] In the embodiment 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, thereby advancing the time of the motion effect processing, making the motion effect processing respond in advance, speeding up the speed of the motion effect processing display, speeding up the response of the motion effect interaction, and improving the user's interactive experience. In addition, the electronic device can start the motion effect setting when it detects the start of the user's operation, without having 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.
[0009] In one possible embodiment, the execution of the motion effect processing in response to the third vertical synchronization signal includes: executing the motion effect processing in response to the third vertical synchronization signal 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 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 time difference, the processing process can be carried out in advance. The electronic device processes in advance, and the motion effect processing can be effectively advanced. If it is less than the time difference, since the vertical synchronization signal of the system cycle arrives soon, there is no need for early processing. Therefore, it is possible to wait for the vertical synchronization signal of the next system cycle to trigger the motion effect processing process, thereby ensuring the necessity of executing the motion effect processing based on the first vertical synchronization signal.
[0010] In one possible embodiment, the execution of the motion effect processing in response to the third vertical synchronization signal includes: executing the motion effect processing in response to the third vertical synchronization signal 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 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 time difference, the processing process can be carried out in advance. The electronic device processes in advance, and the motion effect processing can be effectively advanced. If it is greater than the time difference, since the vertical synchronization signal of the system cycle arrives soon, there is no need for early processing. Therefore, it is possible to wait for the vertical synchronization signal of the next system cycle to trigger the motion effect processing process, thereby ensuring the necessity of executing the motion effect processing based on the third vertical synchronization signal.
[0011] In a possible embodiment, 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 the application, sliding the intermediate interface, and exiting the 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 the motion effect drawing, processing, and display process. Different user operations may have different motion effect types, and specific information such as the motion effect content, motion effect size, motion effect duration, or the 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 the motion effect display.
[0012] In one possible implementation, the start event is the event when the first operation is detected instead of being detected, and the end event is the event when the first operation is no longer detected. 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 progress of animation setting and processing, thereby accelerating the response process of animation processing and display.
[0013] In one possible implementation, when the first animation effect is set and the first operation ends, performing animation processing in response to a third vertical synchronization signal includes: when the first animation effect is set and the first operation ends, generating the third vertical synchronization signal, and performing animation processing in response to the third vertical synchronization signal. In this way, the electronic device can generate a third vertical synchronization signal that is not a periodic vertical synchronization signal, thereby triggering the animation effect processing and display process in advance, accelerating the animation effect display, and improving the user's interactive experience.
[0014] In one possible embodiment, generating 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 a 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 a 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 execute the dynamic processing and display process in advance, and if it is determined to be in advance, generate the sixth vertical synchronization signal. If not in advance, there is no need to generate the sixth vertical synchronization signal, thereby simplifying the execution steps and logic, reducing unnecessary processing steps, improving the execution efficiency of interface processing, and saving processing resources.
[0015] The above implementation manner may be specifically described in S911 to S916 and will not be elaborated on herein.
[0016] In one possible embodiment, after generating the third vertical synchronization signal, the method further includes: determining whether the third vertical synchronization signal satisfies an advance trigger condition; and 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 satisfied; 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 a first threshold duration, or that 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. 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.
[0017] In one possible embodiment, the electronic device includes a viewing system, a choreographer, and a display. The execution of 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; performing image processing by the choreographer in response to the third vertical synchronization signal, and obtaining N frames of motion effect images, where 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 image upon receiving the third vertical synchronization signal, and then the display will display 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, thereby enabling faster motion effect processing and display response.
[0018] In one possible embodiment, the electronic device further comprises an input framework module, wherein when the first motion effect is set and the end event of the first operation is received, the third vertical synchronization signal is generated, including: when the first motion effect is set and the end event of the first operation is received, the first application is used to send a motion effect processing message to the input framework module; the third vertical synchronization signal is generated by the input framework module; before the third vertical synchronization signal is sent to the choreographer via the view system, the motion effect processing is performed in response to the third vertical synchronization signal, and further comprising: 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 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, the third vertical synchronization signal is sent to the view system via the input framework module. In this way, the view system can control whether to send a motion effect processing instruction to the choreographer, thereby controlling whether to trigger the motion effect processing in advance, thereby ensuring the necessity of early triggering.
[0019] In a possible embodiment, 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. If it is too short, the motion effect may not be drawn and displayed. If it is too long, it needs to be drawn and displayed, thereby ensuring the continuity and timeliness of the motion effect display.
[0020] In one possible implementation, the electronic device stores a task list, the task list including a first task and a second task, the priority of the first task being X, the priority of the second task being Y, and Y being greater than the priority of X; the method further comprising: raising the priority of the first task to Z; Z being greater than the priority of Y; and performing motion effect processing in response to a third vertical synchronization signal, comprising: 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, allowing the choreographer to process the above-mentioned tasks in advance, speeding up motion effect processing and display, improving response speed, and optimizing the user interaction experience.
[0021] The first task is a motion effect processing type task, and the second task is not a motion effect processing type task.
[0022] In the 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 the 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 the 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 the 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 the 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.
[0023] In the embodiment 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, thereby advancing the time of the motion effect processing, making the motion effect processing respond in advance, speeding up the speed of the motion effect processing display, speeding up the response of the motion effect interaction, and improving the user's interactive experience. 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, ensuring that the motion effect response is more timely and the user interaction is smoother. Furthermore, when the early triggering conditions are met, the motion effect processing is triggered in advance to ensure the necessity of 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, ensuring that the effect of early response is more obvious.
[0024] 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 details may refer to the first vertical synchronization signal described in the specific implementation.
[0025] In one possible embodiment, when the second animation setting is completed and the end event of the second operation is received, the method also 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.
[0026] 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, and 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.
[0027] 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, and 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.
[0028] 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.
[0029] 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.
[0030] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, including 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.
[0031] 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, enables 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
[0032] FIG1A is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0033] FIG1B is a schematic diagram of the software structure of an electronic device proposed in an embodiment of the present application;
[0034] 2A to 2E are schematic diagrams of a set of user interfaces proposed in an embodiment of the present application;
[0035] FIG3 is a schematic diagram of a first operation process of a user provided in an embodiment of the present application;
[0036] 4A and 4B are timing diagrams of a set of interface processing methods proposed in an embodiment of the present application;
[0037] 5A and 5B are timing diagrams of another set of interface processing methods proposed in an embodiment of the present application;
[0038] FIG6 is a flow chart of a method for interface processing proposed in an embodiment of the present application;
[0039] FIG7 is a flowchart of a method for determining whether to trigger motion effect processing and display based on a first vertical synchronization signal, provided by an embodiment of the present application;
[0040] FIG8 is a timing diagram of an interface processing method provided by an embodiment of the present application;
[0041] FIG9 is a flow chart of another method for interface processing proposed in an embodiment of the present application;
[0042] FIG10 is a schematic diagram of a task list adjustment change provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The terms used in the following examples of the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. As used in the specification and appended claims of the present application, the singular expressions "a," "an," "said," "above," "the," and "this" are intended to include plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in the present application refers to and encompasses any or all possible combinations of one or more of the listed items.
[0044] The embodiments of the present application disclose an interface processing method and an electronic device for improving the response speed of interface processing and display and enhancing the user interaction experience.
[0045] In response to user actions, electronic devices can display animations in their user interfaces. Smooth, seamless animations can significantly enhance the user experience and quality of interaction. For example, when a user clicks to open an app, the user interface can display a rotation and enlargement of the app icon; when a user exits the app, the user interface can display the app icon shrinking to the desktop. This application does not limit the type of animations displayed.
[0046] The electronic device in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop computer, 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.
[0047] The following describes the device involved in the embodiments of the present application.
[0048] FIG1A is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
[0049] 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.
[0050] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0051] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0052] 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.
[0053] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0054] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0055] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0056] 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 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 count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0057] 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.
[0058] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0059] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0060] The touch sensor 180K, also known as a "touch panel," can be mounted on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also known as a "touch screen." The touch sensor 180K detects touch operations applied to or near the touch sensor. The touch sensor transmits the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194.
[0061] In the embodiment of the present application, the electronic device 100 can detect user operations through the touch sensor 180K. User operations can include a hand drop operation (start event) from not touching the screen to touching the screen, and a hand lift operation (end event) from touching the screen to leaving the screen. The display screen 194 can display an animated screen.
[0062] Optionally, the user operation may be an air operation. For example, the electronic device may be equipped with a gesture sensor that can detect the user's air operation. The air operation may be an operation to launch or exit an application. The electronic device may determine the start and end events of the air operation through the gesture sensor, thereby determining the start and end of the operation.
[0063] FIG1B is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application.
[0064] As shown in FIG1B , 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).
[0065] The application layer may include a series of application packages, such as gallery, email, 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.
[0066] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0067] As shown in FIG1B , the application framework layer may include a window manager, a view system, a resource manager, a notification manager, a content provider, a telephony manager, an input framework module, an image drawing mode, and the like.
[0068] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0069] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0070] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0071] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0072] 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 lift events (end events). The touch sensor reports the touch events to the input framework module, which can then continue to report the touch events to the application and the view system.
[0073] A start event marks the beginning of a user operation, and an end event marks the end of that operation. The start and end events can be touch events or air events. If the start and end events are touch events, the user never touches the display, and the electronic device receives the start event. If the user touches the display and then leaves it, the electronic device cannot detect the operation and receives the end event.
[0074] The main thread of the application can be responsible for handling the drawing and display of the animation. After the application receives the end event, it can execute the animation settings and schedule the view system to perform animation drawing to facilitate the display of subsequent animation images.
[0075] 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.
[0076] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0077] The image drawing module can draw the window layer in the dynamic image.
[0078] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0079] 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.
[0080] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0081] 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.
[0082] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0083] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0084] The 3D image processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0085] A 2D graphics engine is a drawing engine for 2D drawings.
[0086] 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.
[0087] The Choreographer and its animation processing: A class in the Choreographer operating system is used to request a vertical synchronization signal (vsync) and initiate drawing operations in response to the requested vsync signal. A class is a data structure that can be used to define the state and behavior of an object. The vsync signal is provided by the operating system to coordinate and synchronize Choreographer operations with SurfaceFlinger.
[0088] After the application is launched, the choreographer is initialized. Initializing the choreographer involves the activity generating an instantiated choreographer object based on the choreographer class. This choreographer can perform drawing operations. Drawing operations can include tasks such as handling input events, animation events, layout events, and submitting events. After the choreographer completes the drawing operation, it can submit the results of the drawing operation to other modules of the application, which then displays the refreshed interface or view on the electronic device's screen.
[0089] Choreographer generation and triggering conditions for drawing operations: After each application is launched by the user, it needs to display a visual interface or view, and at least one choreographer for the application is 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 primarily handles the computational overhead of implementing functions such as interface display, updates, and control interactions.
[0090] When the application needs to refresh the interface or view, the choreographer will request the compositor (SurfaceFlinger) for the system-cycle vertical synchronization signal to find a suitable time for drawing operations. After receiving the vertical synchronization signal sent by SurfaceFlinger, the choreographer starts to perform the drawing operation. 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 applications 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, and there is no specific limitation.
[0091] 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.
[0092] The kernel layer is the foundation of the Android operating system, and all of the Android operating system's ultimate functionality is implemented through the kernel layer. The kernel layer includes at least the display driver. The display driver retrieves rendered and synthesized image frames from the buffer and controls the display to display them sequentially.
[0093] 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, and so on. 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 motion 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, thereby giving priority to motion effect drawing.
[0094] The hardware layer may include a display, graphics processing unit (GPU), touch sensor, memory, and so on. 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 the image frames after the animation processing. The graphics processor can perform the rendering and compositing process of the image. The central processing unit (CPU) can draw the image.
[0095] Specifically, the software flow of the electronic device can be introduced with reference to FIG. 2A to FIG. 2E .
[0096] When a user clicks on the weather control 201 (see FIG2A ), the electronic device responds to the received user action by sequentially displaying the user interfaces of FIG2B through FIG2E (animated display process) until the weather application is opened. When the user's finger lands on the screen, the touch sensor detects the landing of the user's finger and sends a start event to the input framework module.
[0097] It should be noted that the software structure diagram of the electronic device shown in FIG1B provided in this application is merely an example and does not limit the specific module divisions within the 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 in this application can also be implemented based on other operating systems, and this application will not cite examples one by one.
[0098] As a user interacts with the electronic device interface, the electronic device may display motion effects. The motion effect display process may include the user interface displaying the opening of an application (e.g., icon enlargement); closing an application (e.g., icon reduction to the desktop); the display of motion effects within the application; exiting the application and entering the multitasking card; and so on. The display of motion effects is accompanied by changes in the shape, size, angle, color, etc. of the pattern in the user interface. The embodiments of this application do not limit the specific display method of the motion effects.
[0099] Figures 2A to 2E are a set of user interface diagrams exemplarily disclosed in an embodiment of the present application, wherein Figures 2B to 2E refer to the dynamic effect screens from starting the weather application to the completion of the weather application startup.
[0100] FIG2A exemplarily shows a user interface diagram of an electronic device. A user turns on their electronic device, causing the display screen of the electronic device to display the electronic device's desktop, i.e., user interface 200. As shown in FIG2A , user interface 200 may include an icon for at least one application (e.g., a weather widget 201, a calendar, mail, settings, an app store, notes, an album, a phone, short messages, a browser, and a camera, etc.). The positions of the application icons and the corresponding application names may be adjusted according to the user's preferences, and this application is not limited thereto.
[0101] It should be noted that the interface diagram of the electronic device shown in FIG2A 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.
[0102] In Figure 2A, a user can click on weather widget 201 in user interface 200. In response to the user clicking on weather widget 201, an animation of opening a weather application can be displayed, that is, Figures 2B to 2E are displayed in sequence. Figures 2B to 2E illustrate the changing animation of opening a weather application.
[0103] Specifically, Figure 3 is a schematic diagram of a user operation process exemplarily disclosed in an embodiment of the present application. As shown in Figure 3, the process progresses from a user's finger not touching the display of an electronic device to touching the display, then leaving the display after a period of time. The electronic device can capture the user's touches using a touch sensor. Before time T1, the user's finger has not touched the display of the electronic device, and the electronic device has not captured the user's touch location. At time T1, the user's finger touches the display, and the electronic device captures the user's touch operation, detecting the first operation and thus acquiring a start event. The specific touch location of the user can be exemplified by the user's touch operation in Figure 2A and will not be described in detail. During the period from T1 to T2, during the touch period of the first operation, the electronic device repeatedly captures the user touching the display. At time T2, the user's finger leaves the display, and the electronic device no longer captures the user's first operation, thereby acquiring an end event. When a user touches the display of an electronic device, there is a touch time from the time the finger contacts the display to the time the finger leaves the display. The period from when the electronic device detects the user's touch operation to when it no longer detects the touch operation can be considered the touch period. The first operation refers to a click or slide operation by the user, and the process from the user touching the display to leaving the display is considered a touch operation.
[0104] It should be noted that the user operations in Figures 2A and 3 are touch operations. The touch operations in this application can also be air operations, etc., without limitation.
[0105] In response to the above user operation, the electronic device can display an animated screen for launching the weather application. The following describes the process of the animated screen:
[0106] As shown in FIG2B , in the user interface 210 , the weather icon is larger than the weather icon in FIG2A .
[0107] As shown in FIG2C , in the user interface 220 , the electronic device displays a window 221 . Compared to FIG2B , the weather icon moves to the center of the window 221 , continues to grow larger, and rotates.
[0108] As shown in FIG2D , in the user interface 230 , compared to FIG2C , the weather icon continues to grow larger and continues to rotate.
[0109] As shown in Figure 2E, user interface 240 displays the interface of a 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 the last few days.
[0110] When a user taps a weather app (application) and the electronic device activates the weather app's dynamic display, the electronic device detects that the tapping of the weather app has completed and can begin displaying the dynamic display. During the dynamic display, the weather icon gradually grows larger, the center of the icon moves to the center of the interface, and while continuing to grow, it rotates until the user enters the weather app's interface.
[0111] 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 an animated screen from closing the weather application to the completion of the weather application closing. For example, the animated screen display of closing the weather application is the display process of Figure 2E, Figure 2D, Figure 2C, Figure 2B and Figure 2A in sequence.
[0112] The above-mentioned operation for changing the animation effect 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., and this application is not limited to this. In addition, the process of changing the animation effect in Figures 2A to 2E is only an exemplary description. The application can be a weather application or other applications, and this application is not limited to this.
[0113] 4A and 4B are a set of timing diagrams of a method for interface processing.
[0114] As shown in FIG4A , the electronic device provides a vertical synchronization signal of a specific frequency (a vertical synchronization signal of a system cycle). As time passes, FIG4A shows vertical synchronization signals vsync1 and vsync2 of two consecutive system cycles.
[0115] At some point between the system cycle's vertical synchronization signals vsync1 and vsync2, the electronic device begins detecting a first operation and receives a start event. Subsequently, if the electronic device fails to detect the first operation, it signifies the end of the first operation and receives an end event. The first operation is a user-operated operation on an application running on the electronic device. In response to the first operation, the electronic device needs to draw and display the application's animated image.
[0116] When the electronic device receives the end event, it begins executing the animation settings and prepares for subsequent animation processing and display. After executing the animation settings, the electronic device waits for the system's periodic vertical synchronization signal to trigger the interface animation processing and display. In other words, after the electronic device receives vsync2, it begins executing the animation processing and display.
[0117] Typically, after executing dynamic settings, it takes a while to acquire the vertical synchronization signal to trigger the animation processing and display. As shown in Figure 4B, if the electronic device happens to acquire vsync2 during the animation setting period, by the time the animation setting process is completed, vsync2 has been missed, 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 processing is nearly one system cycle, which is longer than the waiting time in Figure 4A.
[0118] When the user clicks to trigger the 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 dynamic effect display. During the image drawing process of Figures 4A and 4B, the user operation time is random, and the process of the electronic device processing the dynamic effect 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 task in the interface display process during the period between the user operation and the dynamic effect processing, but wait for the vertical synchronization signal of the system cycle. Faced with the scenario where the electronic device displays dynamic effects in response to user operations, the electronic device needs to respond quickly in a very short time. The above waiting time will make the response processing of the electronic device slow, the display interface will also be stuck, etc., resulting in a poor user interaction experience.
[0119] In response to the above-mentioned problems, an embodiment of the present application proposes 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 situation, and also improve the user's interactive experience.
[0120] Figures 5A and 5B are another set of timing diagrams of interface processing methods disclosed in an embodiment of the present application. As shown in Figure 5A, 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 animation processing and display.
[0121] In an embodiment of the present application, the time of the user operation (or the duration from the operation to the display of the dynamic effect) may occur within one system cycle, or may occur across two or more system cycles. As shown in Figure 5A, in the system cycle from vsync1 to vsync2, the electronic device detects the first operation and sets the dynamic effect according to the start event of the first operation; after detecting the end event of the first operation and the dynamic effect setting is completed, the dynamic effect processing and display are executed based on the first vsync trigger. In 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 dynamic effect setting. In another system cycle from vsync2 to vsync3, the electronic device detects the end event of the first operation and also executes the dynamic effect processing and display according to the above conditions. In Figure 5B, the first operation and the dynamic effect setting can span system cycles, which is not limited in this application.
[0122] Compared with the execution process of Figure 4A, the execution process of Figures 5A and 5B has the following characteristics: on the one hand, the triggering conditions of the execution process of the motion effect setting are advanced in time. Generally, during the user touch process, the electronic device has already started to execute the motion effect setting, and prepares for the motion effect processing and display in advance. On the other hand, when the motion effect setting is completed and the start event is detected, a first vsync is actively generated. This first vsync can directly process and display the motion effect, and there is no need to wait for the vsync2 of the cycle as in Figure 4A before executing the motion effect drawing and display. Therefore, in the process of motion effect display, the embodiment of the present application adjusts the triggering timing of the motion effect setting and the motion effect processing and display, speeds up the process of interface processing and display, improves the response speed of the motion effect, solves the problem of slow response of the motion effect screen, and ensures the user's interactive experience.
[0123] FIG6 is a flow chart of a method for interface processing disclosed in an embodiment of the present application.
[0124] The method of FIG. 6 is described in detail below with reference to FIG. 2A to FIG. 2E , FIG. 3 , FIG. 5A and FIG. 5B . The interface processing method may include but is not limited to the following steps:
[0125] S601: The touch sensor detects a first operation.
[0126] At time T1, the electronic device goes from detecting no touch operation to detecting the first operation, and the touch sensor can determine that a start event has been acquired. The first operation can be a touch operation on an application. In response to the first operation, the electronic device needs to display an application-related animation screen. The user's click process can refer to the touch changes before and after time T1 in Figure 3 and the touch operation in Figure 2A, which will not be repeated here.
[0127] S602: The touch sensor sends a start event to the input framework module.
[0128] When the touch sensor detects the first operation, it may send a start event to the input framework module. Correspondingly, the input framework module may receive the start event from the touch sensor. The touch sensor sends a touch event to the input framework module. Touch events may include a start event (e.g., the touch start event in FIG3 ) and an end event (e.g., the touch end event in FIG3 ) of a particular operation.
[0129] S603: The input framework module sends a start event to the application through the view system.
[0130] The input framework module can send a start event to the application through the view system. Correspondingly, the application can receive the start event from the input framework module through the view system.
[0131] 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.
[0132] 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 located in the FWK layer of the electronic device.
[0133] S604: The application executes dynamic settings.
[0134] When the application obtains the start event of the first operation, it starts to perform dynamic setting, that is, setting the dynamic effect properties of the first application for the first operation.
[0135] 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 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.
[0136] S605: The application program executes a first drawing process to obtain a first drawing image.
[0137] 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.
[0138] S606: The application sends an image drawing message to the image drawing module.
[0139] When the application receives 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.
[0140] S607: The image drawing module performs a second drawing process to obtain a second drawing image.
[0141] 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.
[0142] S608: The touch sensor cannot detect the first operation.
[0143] At time T2, the touch sensor of the electronic device fails to detect the first operation, indicating that the user has ended the current touch operation and has released their finger from the user interface. The touch sensor can determine that an end event has been received. For details, see FIG6 , which illustrates the touch changes before and after time T2.
[0144] S609: The touch sensor sends an end event to the input framework module.
[0145] When the touch sensor fails to 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.
[0146] S610: The input framework module sends an end event to the application through the view system.
[0147] When the input framework module receives the end event, it can send the end event to the application through the view system. Correspondingly, the application can receive the end event from the input framework module through the view system.
[0148] 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.
[0149] S611: The application sends a motion effect processing message to the input framework module.
[0150] When the application determines that the dynamic setting (S604) is complete and receives an end event (S610), the application can send a motion effect processing message to the input framework module. Correspondingly, the input framework module can receive the motion effect processing message from the application. The motion effect processing message can instruct the input framework module to generate a first vertical synchronization signal.
[0151] S612: The input frame module generates a first vertical synchronization signal.
[0152] When the input framework module receives the motion effect processing message, it can generate a first vertical synchronization signal including a timestamp.
[0153] 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 may 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 period) may be a vertical synchronization signal received by the choreographer at a certain frequency. For example, the above-mentioned choreographer receives vsync from SurfaceFlinger.
[0154] S613: The input framework module sends a first vertical synchronization signal to the viewing system.
[0155] After the input framework module generates the first vertical synchronization signal, it can send the first vertical synchronization signal to the viewing system. Correspondingly, the viewing system can receive the first vertical synchronization signal from the input framework module.
[0156] S614: The viewing system determines whether to trigger motion effect processing and display based on the first vertical synchronization signal.
[0157] When the viewing system receives the first vertical synchronization signal, it can use the first vertical synchronization signal and its timestamp. The viewing system must first determine whether the first vertical synchronization signal triggers the processing and display of the animation effect in advance. Specifically, the viewing system determines whether the time difference between the first vertical synchronization signal and the nearest vertical synchronization signal of the system cycle meets the animation processing duration.
[0158] FIG7 is a flow chart of a method for determining whether to trigger the processing and display of an animation effect based on the first vertical synchronization signal disclosed in an embodiment of the present application. As shown in FIG7 , the method for determining whether to trigger the processing and display of an animation effect based on the first vertical synchronization signal may include but is not limited to the following steps:
[0159] S6141: The view system determines whether the time difference between the first vertical synchronization signal and the nearest vertical synchronization signal of the system cycle meets the animation processing duration (animation trigger condition). If the animation processing duration is met, S6142 is executed (S615 is executed); if not, S6143 is executed (S615 is not executed).
[0160] 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 methods are not described in detail.
[0161] Implementation 1: The viewing system determines whether a first time difference between a first vertical synchronization signal and a vertical synchronization signal of the next system cycle is greater than (greater than or equal to) a 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.
[0162] 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 motion effect 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 motion effects.
[0163] For example, the first threshold duration is 5ms. When the first time difference is 3ms, 5<3, and it is determined that the animation processing duration is not met; when the first time difference is 10ms, 10>5, and it is determined that the animation processing duration is met.
[0164] 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. The sum of the second threshold duration and the first threshold duration is equal to the duration of one system cycle, and the vertical synchronization signal of the previous system cycle is the vertical synchronization signal of the most recent system cycle before the first vertical synchronization signal.
[0165] S6142: The view system triggers motion effect processing and display based on the first vertical synchronization signal.
[0166] If the required duration for the motion effect processing is met, 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.
[0167] Among them, the process of the view system triggering the dynamic effect display processing based on the first vertical synchronization signal can be referred to the description of S615 to S620 and will not be repeated here.
[0168] S6143: The view system triggers the animation display processing based on the vertical synchronization signal of the next system cycle.
[0169] 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 dynamic effect processing and display when the vertical synchronization signal of the next system cycle is obtained. If the dynamic effect processing time is not met, the view system will not execute S615, and the choreographer needs to wait for the vertical synchronization signal of the next system cycle sent by surfaceFlinger to trigger the dynamic effect processing and display. For the specific description of the dynamic effect processing and display, please refer to the relevant description of S616~S620. In addition, the situation of S6143 can also refer to the relevant description of Figure 8, which will not be repeated here.
[0170] 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).
[0171] S615: The view system sends a motion processing instruction to the choreographer.
[0172] The view system can send a motion processing instruction to the choreographer. Correspondingly, the choreographer can receive a motion processing instruction from the view system. The motion processing instruction is used to instruct the start of image rendering and synthesis for the first operation.
[0173] 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.
[0174] 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.
[0175] S616: The choreographer sends a rendering and synthesis instruction to the rendering and synthesis module.
[0176] 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.
[0177] S617: The rendering and synthesis module renders and synthesizes the first drawn image and the second drawn image to obtain a dynamic effect image.
[0178] 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.
[0179] S618: The rendering and synthesis module sends a rendering and synthesis completion notification to the choreographer.
[0180] 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.
[0181] S619: The choreographer sends a dynamic image display instruction to the display.
[0182] After the choreographer obtains the dynamic image, he or she may send a dynamic image display instruction to the display. Correspondingly, the display driver may receive the dynamic image display instruction from the choreographer.
[0183] S620: The display displays the dynamic image.
[0184] 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.
[0185] The display process of the electronic device can refer to the process in Figures 2A to 2E and will not be described in detail.
[0186] Figure 8 is a timing diagram of a method for interface processing disclosed in an embodiment of the present application. As shown in Figure 8, when the electronic device executes S6141, when the animation 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. In Figure 8, the first time difference is too short, and it is judged that the first threshold duration is not met, and the animation drawing and display are not performed until vsync2. In the above process, since the first vsync and vsync2 times are too short, the electronic device does not have time to complete the animation drawing and display cycle. Therefore, it can wait until vsync2 is triggered again. 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.
[0187] FIG9 is a flow chart of another method for interface processing disclosed in an embodiment of the present application.
[0188] 2A to 2E, FIG3, FIG5A and FIG5B, the method of FIG9 is specifically described below. The interface processing method may include but is not limited to the following steps:
[0189] S901: The touch sensor detects a first operation.
[0190] S902: The touch sensor sends a start event to the input framework module.
[0191] S903: The input framework module sends a start event to the application through the view system.
[0192] S904: The application executes dynamic settings.
[0193] S905: The application program executes a first drawing process to obtain a first drawing image.
[0194] S906: The application sends an image drawing message to the image drawing module.
[0195] S907: The image drawing module performs a second drawing process to obtain a second drawing image.
[0196] S908: The touch sensor cannot detect the first operation.
[0197] S909: The touch sensor sends an end event to the input framework module.
[0198] S910: The input framework module sends an end event to the application through the view system.
[0199] For the detailed description of S901 to S910 , please refer to the relevant description of S601 to S910 , which will not be repeated here.
[0200] S911: The application sends an animation advance message to the view system.
[0201] When the application determines that the end event of the first operation has been obtained (S910) and the dynamic setting is completed (S904), it can send an animation advance message to the view system. Correspondingly, the view system can receive the animation advance message from the application. The animation advance message is used to instruct the view system to determine whether to generate the first vertical synchronization signal.
[0202] S912: The view system determines whether to trigger the animation processing in advance. If it is determined that the animation processing is triggered in advance, S913 to S916 are executed; if it is determined that the animation processing is not triggered in advance, S913 to S916 are not executed.
[0203] 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 not, the animation processing is not triggered in advance.
[0204] Implementation 1: The viewing 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) a 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 system waits for the vertical synchronization signal of the next system cycle to trigger animation processing and display.
[0205] Implementation 2: The viewing system determines whether a second threshold duration is met based on a 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 system waits for the vertical synchronization signal of the next system cycle to trigger animation processing and display.
[0206] It should be noted that the processing of S912 may refer to the specific processing of S614, and the current time may be considered as the time corresponding to the first vertical synchronization signal, which will not be described in detail.
[0207] S913: The view system sends a signal generation instruction to the input framework module.
[0208] If the view system determines that the animation processing should be triggered 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.
[0209] S914: The input frame module generates a first vertical synchronization signal.
[0210] When the input framework module receives the signal generation instruction, it can generate the first vertical synchronization signal. For details of S914, please refer to S612 and will not be described in detail.
[0211] S915: The input framework module sends a first vertical synchronization signal to the viewing system.
[0212] After the input framework module generates the first vertical synchronization signal, it can send the first vertical synchronization signal to the viewing system. For details of S915, please refer to the description of S613 and will not be repeated here.
[0213] S916: The view system sends a motion processing instruction to the choreographer.
[0214] Upon receiving the first vertical synchronization signal, the view system may send a motion effect processing instruction to the choreographer. The motion effect processing instruction may include the first vertical synchronization signal. For details of S916, please refer to the description of S613 and will not be repeated here.
[0215] During the above steps S911 to S916, the view system can first determine whether to pre-empt the dynamic processing and display process. If so, the input framework module generates the first vertical synchronization signal. If not, steps S913 to S916 are not required. This simplifies the execution steps and logic, reduces unnecessary processing steps, improves interface processing efficiency, and conserves processing resources.
[0216] S917: The choreographer sends a rendering and synthesis instruction to the rendering and synthesis module.
[0217] S918: The rendering and synthesis module renders and synthesizes the first drawn image and the second drawn image to obtain a dynamic effect image.
[0218] S919: The rendering and synthesis module sends a rendering and synthesis completion notification to the choreographer.
[0219] S920: The choreographer sends a dynamic image display instruction to the display.
[0220] S921: The display shows a dynamic image.
[0221] Among them, the specific details of S917 to S921 can refer to the relevant descriptions of S616 to S620 and are not repeated here.
[0222] The electronic device stores a task list, which may contain tasks. Different types of tasks have different priorities. The higher the priority of a task, the more preferentially it is processed. Task types may include input event tasks, animation processing tasks, drawing tasks, and submission tasks. The task scheduling module adjusts the priorities of tasks in the task list. The choreographer processes the tasks in the task list in order of priority and chronological order.
[0223] The task scheduling module can increase the priority of the drawing task in the animation drawing instruction in the task list to 1. The choreographer can execute the adjusted task list according to the priority.
[0224] Figure 10 is a schematic diagram of a task list adjustment change exemplarily disclosed in an embodiment of the present application. As shown in Figure 10, 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 effect 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 effect 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 effect processing task 1 from 3 to 1. The priorities of other tasks remain unchanged. Afterwards, 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 be executed 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 task triggered by the first vertical synchronization signal in the task queue in advance, ensuring the timeliness of drawing and display execution, improving the response speed, and reducing the lag of animation effects.
[0225] 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 (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.
[0226] 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 device. 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 one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. 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).
[0227] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.
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
Patent Citations
Rendering method based on dynamic VSYNC signal, mobile terminal and storage medium
CN107220019A
Vertical synchronization method and device, terminal and storage medium
CN110018874A
Event processing method and device
CN114327697A
Data processing method and device in application program starting and storage medium
CN115904563A
Target signal processing method and electronic equipment
CN116048831A
