Dynamic effect processing method, electronic equipment and computer readable storage medium

By stopping the foreground application's image frame rendering during animation, GPU resources are freed up for animation frame generation, thus resolving the animation stuttering issue and improving the user experience.

CN121170085APending Publication Date: 2025-12-19HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410790251.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-18
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

During animations on electronic devices, background processing of applications consumes system GPU resources, causing animation stuttering and affecting user experience.

Method used

Upon receiving a user action, the electronic device stops drawing image frames from the foreground application, freeing up GPU resources for animation frame generation, ensuring that animation frame generation is completed within the screen refresh rate.

Benefits of technology

By reducing the GPU resource consumption for animation frame generation, the animation frame generation time is shortened, animation stuttering is reduced, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121170085A_ABST
    Figure CN121170085A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a dynamic effect processing method, electronic equipment and a computer readable storage medium, in the method, the electronic equipment displays an interface of a first application program, and the first application program runs in a foreground; in response to a first operation received on the interface of the first application program, stopping drawing the image frame of the first application program, and generating an animation frame in a target animation, the image frame of the first application program being an image frame displayed behind the interface of the first application program, and the target animation being an animation triggered by the first operation; and displaying a target animation according to the animation frame. According to the embodiment of the invention, drawing of the image frame of the first application program is stopped during the dynamic effect period, that is, drawing of the image frame of the first application program is stopped, GPU resources are made for animation frame generation, so that more GPU resources can be used for animation frame generation, and the dynamic effect lagging phenomenon is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminal technology, and in particular to a motion effect processing method, electronic device, and computer-readable storage medium. Background Technology

[0002] With the increasing popularity and growing functionality of mobile phones and other electronic devices, their usage frequency in people's daily lives is also increasing.

[0003] When a user uses an electronic device, the device can respond to the user's actions within the foreground application by using the Graphics Processing Unit (GPU) to generate image frames for subsequent display, as well as performing operations such as drawing, rendering, and compositing animation frames, and displaying the generated animation frames sequentially. In this way, when displaying the interface of the foreground application, the electronic device can quickly play the animation triggered by the user's action after receiving that action.

[0004] However, in certain scenarios, because the application is processing animations in the background and still occupies system GPU resources, stuttering occurs, causing electronic devices to experience animation stuttering during animations. Summary of the Invention

[0005] This application provides a motion effect processing method, an electronic device, and a computer-readable storage medium to solve the problem of motion effect stuttering during motion effects.

[0006] In a first aspect, embodiments of this application provide a motion effect processing method. In this method, an electronic device runs a first application in the foreground and displays the interface of the first application; in response to a first operation received on the interface of the first application, the drawing of image frames of the first application is stopped, animation frames in a target animation are generated, and the target animation is displayed according to the animation frames. The target animation is the animation triggered by the first operation, and the image frames of the first application are the image frames displayed after the interface of the first application, that is, the image frames after the current interface of the first application is stopped being drawn.

[0007] As can be seen from the above technical solution, after receiving the first operation on the foreground application interface, this embodiment of the application reduces the GPU resources occupied by the first application by stopping the rendering of the first application's image frames. In this way, when generating the target animation corresponding to the first operation, the GPU resources freed up by the first application can be used for animation frame generation, resulting in more GPU resources available for animation frame generation, thereby shortening the time required to generate animation frames and reducing animation stuttering. In other words, this embodiment of the application reduces animation stuttering by stopping the rendering of the first application's image frames during animation generation to free up GPU resources for the generation of the target animation.

[0008] For example, the screen refresh rate of an electronic device is 60 Hz, meaning the screen refreshes every 16.67 milliseconds (ms). In this case, the electronic device needs to generate one image frame within 16.67 ms; otherwise, screen stuttering will occur. If the first application continues to consume a large amount of GPU resources for image frame rendering during the animation effect, the available GPU resources for animation frame generation will be insufficient, preventing the electronic device from generating an animation frame within 16.67 ms and resulting in screen stuttering. However, this embodiment of the application stops the first application from rendering image frames during the animation effect, freeing up GPU resources for animation frame generation. This ensures sufficient GPU resources for animation frame generation, allowing the electronic device to generate one animation frame within 16.67 ms and reducing animation stuttering.

[0009] In some possible implementations of the first aspect, while the first application continuously generates image frames using the GPU to continuously refresh the images displayed on the screen, the electronic device can also determine the GPU load state of the first application. Furthermore, before stopping drawing image frames of the first application, the electronic device can also determine whether the GPU load state of the first application is high; if it is determined that the GPU load state of the first application is high, then drawing image frames of the first application stops; if it is determined that the GPU load state of the first application is low (not high), then drawing image frames of the first application does not stop. That is, the electronic device continuously draws image frames of the first application using the GPU, and also uses the GPU to generate individual animation frames in the target animation.

[0010] In particular, stopping the rendering of image frames by the first application may have unexpected effects on the electronic device's business functions, thereby affecting the normal operation of the electronic device's business functions.

[0011] Compared to stopping the rendering of image frames of the first application upon entering a motion effect scene, this embodiment of the application only stops the rendering of image frames of the first application when it is determined that the GPU load of the first application is in a high load state upon entering a motion effect scene, and does not stop the rendering of image frames of the first application otherwise. This can reduce the probability of unexpected risks and thus reduce the impact of measures to ensure the motion effect process on the business functions of electronic devices.

[0012] In some possible implementations of the first aspect, during the process of determining the GPU load state of the first application, the electronic device can obtain the GPU rendering time of each image frame of the first application, and determine the GPU load state of the first application based on the GPU rendering time and a preset threshold. The preset threshold is determined based on the screen refresh rate. In this way, by using the GPU rendering time of each image frame of the first application, the GPU usage of the first application can be accurately determined, thereby accurately determining the GPU load state of the first application. Based on the GPU load state of the first application, it can be determined whether it is in a high-load state.

[0013] In some possible implementations of the first aspect, when determining the GPU load state of a first application based on GPU rendering time and a preset threshold, the electronic device may first obtain the average GPU rendering time of a single image frame based on the GPU rendering time of a preset number of image frames, and then compare the average GPU rendering time with the preset threshold. If the average GPU rendering time is less than or equal to the preset threshold, the GPU load state of the first application is determined to be low load; if the average GPU rendering time is greater than the preset threshold, the GPU load state of the first application is determined to be high load.

[0014] The GPU rendering time for each image frame is not exactly the same. By taking the average value to monitor the GPU load status of the first application, a more accurate reflection of the application's GPU usage can be obtained.

[0015] In some possible implementations of the first aspect, the first operation is used to indicate a switch from the interface of the first application to a target interface, which is a multitasking interface, a desktop, or a drop-down interface, and the target animation is an animation of the switch from the interface of the first application to the target interface.

[0016] In some possible implementations of the first aspect, before determining whether the GPU load state of the first application is high, the electronic device may, in response to a first operation received at the interface of the first application, send an event notification from the process of the second application to the process of the first application. The event notification indicates the detection of an event entering a multitasking interface, an event returning to the desktop, or an event entering a drop-down interface. In response to the event notification, the electronic device further determines whether the GPU load state of the first application is high. If it is high, the rendering of image frames by the first application is stopped; if it is low, the rendering of image frames by the first application is not stopped.

[0017] When a user triggers an animation effect, the electronic device further determines whether the currently entered animation scene is the target animation scene. If it is the target animation scene, it further determines whether to stop the rendering of the first application's image frames based on the GPU load status of the first application; if it is not the target animation scene, the rendering of the first application's image frames can not be stopped. That is, the rendering of the first application's image frames can be stopped in the target animation scene, but not in the non-target animation scene. This ensures the supply of GPU resources for animation frame generation in performance-sensitive critical animation scenes (i.e., the target animation scene), reducing animation stuttering in performance-sensitive critical animation scenes; it also avoids affecting the user experience due to stopping the rendering of the first application's image frames in non-target animation scenes.

[0018] The target animation scenarios could be: returning to the desktop from the application interface, entering the multitasking interface from the application interface, or entering the drop-down interface from the application interface.

[0019] In some possible implementations of the first aspect, if the process of the first application does not receive an event notification, or the received event notification does not indicate that the second application detected an event to enter the multitasking interface, an event to enter the desktop, or an event to enter the drop-down interface, and / or, it is determined that the GPU load state of the first application is low, the electronic device draws image frames of the first application and generates animation frames in the target animation. That is, in non-target animation scenes and / or in low-load states, the electronic device may not stop drawing image frames of the first application.

[0020] In some possible implementations of the first aspect, before ceasing to draw image frames of the first application, the electronic device may also send an event notification to the process of the first application in response to a first operation received at the interface of the first application; the event notification indicates that an event of entering a multitasking interface, a event of returning to the desktop, or an event of entering a drop-down interface has been detected, and in response to the event notification, drawing image frames of the first application is stopped.

[0021] The first operation is used to indicate a switch from the interface of the first application to the target interface, which is a multitasking interface, desktop, or drop-down interface, and the target animation is an animation of the switch from the interface of the first application to the target interface.

[0022] When a user triggers an animation, the electronic device further determines whether the currently entered animation scene is the target animation scene. If it is the target animation scene, the rendering of image frames from the first application can be stopped; if it is not the target animation scene, the rendering of image frames from the first application can continue. This ensures the supply of GPU resources for animation frame generation in performance-sensitive critical animation scenes (i.e., the target animation scene), reducing animation stuttering in performance-sensitive critical animation scenes; it also avoids impacting the user experience by stopping the rendering of image frames from the first application in non-target animation scenes.

[0023] In some possible implementations of the first aspect, the electronic device can stop drawing image frames of the first application by stopping the acquisition of the vertical synchronization (vsync) signal for the next frame of the first application.

[0024] In some possible implementations of the first aspect, if the user has returned to the desktop from the interface of the first application, or exited the multitasking interface, or exited the drop-down interface, the limiting drawing flag of the first application is modified from a first value to a second value; wherein, the limiting drawing flag indicates whether the frame drawing of the first application is restricted, the first value indicates that the frame drawing of the first application is restricted, and the second value indicates that the frame drawing of the first application is not restricted.

[0025] Upon entering the target animation scene, the drawing restriction flag is set to a first value to stop the first application from drawing frames. Upon leaving the target animation scene, the drawing restriction flag is promptly set to a second value to remove the drawing restriction on the first application, ensuring its normal operation and minimizing the impact of the protection measures in the target animation scene. For example, the first value can be 1 (or true), and the second value can be 0 (or false).

[0026] In a second aspect, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the first aspects above.

[0027] Thirdly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.

[0028] Fourthly, embodiments of this application provide a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in any of the first aspects above. The chip system may be a single chip or a chip module composed of multiple chips.

[0029] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the method described in any of the first aspects above.

[0030] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the interface display system framework provided in an embodiment of this application;

[0032] Figure 2 This is a schematic diagram of a scenario for entering a multitasking interface provided in an embodiment of this application;

[0033] Figure 3 This is a schematic diagram of the structure of the electronic device 300 provided in the embodiments of this application;

[0034] Figure 4 This is a software structure block diagram of the electronic device 300 according to an embodiment of this application;

[0035] Figure 5 A flowchart illustrating a motion effect processing method provided in an embodiment of this application;

[0036] Figure 6A This is a schematic diagram of the animation scene for returning to the desktop provided in an embodiment of this application;

[0037] Figure 6B A schematic diagram of the animation scene for entering the drop-down notification interface provided in an embodiment of this application;

[0038] Figure 6C A schematic diagram of the animation scene for entering the drop-down control center interface provided in an embodiment of this application;

[0039] Figure 6D This is a schematic diagram of an animation scene for switching application interfaces provided in an embodiment of this application;

[0040] Figure 7 Another schematic flowchart of the motion effect processing method provided in the embodiments of this application;

[0041] Figure 8 Another flowchart illustrating the motion effect processing method provided in the embodiments of this application;

[0042] Figure 9 Another flowchart illustrating the motion effect processing method provided in the embodiments of this application;

[0043] Figure 10A A flowchart illustrating a motion effect processing method provided in an embodiment of this application;

[0044] Figure 10B A schematic block diagram of a GPU load identification module provided in an embodiment of this application;

[0045] Figure 10C A schematic block diagram of a scene recognition module provided in an embodiment of this application;

[0046] Figure 10D This is a schematic block diagram of a restriction application drawing decision module provided in an embodiment of this application. Detailed Implementation

[0047] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application.

[0048] Motion effects refer to the dynamic changes in the visuals, also known as dynamic effects or animation effects. Electronic devices can update the image frames displayed on the screen according to the screen refresh rate to achieve visual changes.

[0049] Typically, the screen refresh rate of electronic devices refers to the vertical refresh rate. The vertical refresh rate is the number of image frames the display refreshes per second, measured in Hertz (Hz). For example, a mobile phone screen has a refresh rate of 60Hz, meaning the image frames displayed on the phone screen are refreshed 60 times per second.

[0050] The image frames displayed on an electronic device's screen are generated by the GPU. The number of image frames generated by the GPU per second is expressed as the frame rate, measured in fps. If the speed at which the GPU generates image frames and the speed at which the display refreshes image frames are not synchronized, screen tearing will occur. For example, if a mobile phone's screen refresh rate is 60Hz, but the GPU outputs image frames at a rate greater than 60fps, the display will show the content of two frames simultaneously, resulting in screen tearing.

[0051] To solve the screen tearing problem, electronic devices can use a vertical synchronization (vsync) mechanism to synchronize the speed at which the GPU outputs image frames with the speed at which the screen refreshes image frames. The following section combines... Figure 1The schematic diagram of the interface display system framework provided in the embodiment of this application illustrates the interface display process of electronic devices based on the vsync mechanism.

[0052] like Figure 1 As shown, the interface display system may include, but is not limited to: an application (APP), a rendering thread, a graphics processing module, and a display driver. The graphics processing module may include, but is not limited to, a surface compositing service (SurfaceFlinger) and...

[0053] The application's process can include the main thread, also known as the User Interface (UI) thread. The main thread is responsible for drawing operations. Drawing operations can include view creation, measurement, layout, and graphics drawing. The main thread performs calculations for drawing operations and obtains the drawing data.

[0054] The rendering thread executes the actual drawing actions based on the main thread's rendering instructions and drawing data, obtaining the drawn layers (such as components and controls); it then renders the drawn layers to obtain the rendered layers. The rendering thread can invoke the GPU to execute the actual drawing and rendering actions. The graphics processing module performs layer compositing operations on the rendered image to obtain image frames; it then displays the composited image frames on the screen through the display driver. Surface compositing services are services provided by the underlying operating system.

[0055] The display driver is used to display the synthesized image frames on the display screen through the display driver chip.

[0056] During the interface display process, the main thread will only start the image frame drawing process after receiving the vsync_app signal; the surface compositing service will only start the layer compositing process after receiving the vsync_sf signal.

[0057] The vsync_app and vsync_sf signals are software vsync signals generated by the surface composition service. The vsync_app signal is used to trigger the drawing process, and the vsync_sf signal is used to trigger the layer composition process.

[0058] The surface compositing service can periodically generate software vsync signals based on hardware vsync signals. Specifically, the display driver sends hardware vsync signals to the graphics processing module; after receiving multiple hardware vsync signals, the surface compositing service in the graphics processing module generates a software vsync signal model based on these signals. This software vsync signal model can simulate the periodicity of the hardware vsync signals, periodically generating software vsync signals and sending them to the main thread and the surface compositing service to control the speed of drawing, rendering, and compositing of the display interface.

[0059] The period of the software vsync signal is synchronized with the period of the hardware vsync signal. The period of the vsync signal is related to the screen refresh rate of the electronic device. For example, if the screen refresh rate of a mobile phone is 60Hz, the period of the vsync signal is 16.67ms, and the image frame displayed on the screen refreshes once every 16.67ms; if the screen refresh rate is 120Hz, the period of the vsync signal is 8.33ms, and the image frame displayed on the screen refreshes once every 8.33ms.

[0060] like Figure 1 As shown, when the application needs to refresh the interface, the main thread requests the vsync signal from the surface compositing service. The surface compositing service, based on the software vsync signal model, sends the vsync_app signal to the application to trigger the main thread to perform drawing operations.

[0061] Once the application is launched, a choreographer belonging to that application is generated. For example, the application's main thread generates a choreographer bound to that thread; when the application's interface needs to be refreshed, the choreographer requests a vsync signal from the surface compositing service. After receiving the vsync_app signal sent by the surface compositing service, the choreographer can handle the application's event tasks through the doFrame callback method to complete the frame drawing (doFrame) operation.

[0062] The application can request the vsync signal from the surface synthesis service by executing the Choreographer#scheduleVsyncLocked() method.

[0063] Application event tasks may include, for example, input event tasks, animation event tasks, layout event tasks, and submit event tasks.

[0064] An input event task is a task that the application encapsulates and dispatches to the choreographer after input events have occurred. An input event is an event generated by the application in response to user interaction with the application. For example, user interaction might involve clicking an interactive control on the application interface or swiping on the interface (e.g., swiping up or down). In response to the user's interaction, the application generates an input event task corresponding to the input event and then passes the input event task to the choreographer.

[0065] An animation event task is the data that an application needs to calculate for an animation. For example, an application might respond to a user's action on the interface by displaying a gradually enlarging animation to inform the user that the action was successful; in this case, displaying the gradually enlarging animation is an animation event task.

[0066] Layout event tasks can be used to generate drawing data for the choreographer's calculation interface. Drawing data can be used to determine the width, height, position, and shape of the content displayed on the interface.

[0067] Submitting an event task can signal that the choreographer has completed the drawing operation corresponding to a vsync signal.

[0068] After the main thread completes the drawing operation, it synchronizes the drawing data to the rendering thread. The rendering thread, based on the main thread's rendering instructions and data, performs the rendering operation, obtains the rendered layer, and passes the layer to the surface compositing service. When the vsync_sf signal arrives, the surface compositing service triggers the layer compositing process, obtaining the composited image frame. The graphics processing module then displays the composited image frame on the screen via the display driver.

[0069] During the animation process, the electronic device can perform operations such as drawing, rendering, and compositing each animation frame in sequence according to the interface display process described above, so as to generate each animation frame and display each animation frame in sequence on the display screen.

[0070] The animation consists of at least two frames. Electronic devices can present the animation effect to the user by sequentially displaying each frame on a screen.

[0071] During the playback of animation on an electronic device, if the electronic device can complete the drawing, rendering, and compositing of animation frames within the vsync signal cycle, the animation will be smooth with fewer stutters; however, if the electronic device cannot complete the drawing, rendering, and compositing of animation frames within the vsync signal cycle, the animation will be less smooth with noticeable stutters.

[0072] For example, if the screen refresh rate is 60Hz and the vsync signal period is 16.67ms, and the electronic device takes 35ms to generate a certain animation frame, but cannot generate the animation frame within 16.67ms, then animation stuttering will occur.

[0073] The time it takes for an electronic device to generate animation frames is generally related to the sufficiency of GPU resources. When there are sufficient GPU resources available for animation frame generation, the time it takes for the electronic device to generate animation frames is shorter; when there are insufficient GPU resources available for animation frame generation, the time it takes for the electronic device to generate animation frames is longer.

[0074] In some scenarios, when an electronic device is running an application in the foreground, it can respond to user input on the application interface by playing animations corresponding to those inputs. In this case, when the electronic device is running the application in the foreground and has not received any user input, it needs to use the GPU to generate the application's image frames. After receiving a user input, both the application and the electronic device need to use the GPU to generate their own image frames and animation frames. That is, the application still consumes GPU resources during the animation. This results in fewer GPU resources available for animation frame generation, longer generation times, and delayed animation frame generation, leading to animation stuttering. For electronic devices with limited GPU resources, this stuttering phenomenon is even more severe.

[0075] For example, see Figure 2 The illustrated diagram shows a scenario of entering a multitasking interface according to an embodiment of this application. The desktop 101 of the mobile phone 100 includes icons for applications 1 to 9, a memo app 102, a gallery app 103, and a camera app 104. The memo app 102 and the gallery app 103 are already running in the background. The screen refresh rate of the mobile phone 100 is 60Hz.

[0076] In response to the user's tap on the camera icon 104, mobile phone 100 launches camera 104 and displays camera interface 105. At this time, camera 104 is running in the foreground, while memo 102 and gallery 103 are running in the background.

[0077] Among them, when camera 104 is running in the foreground, it can be based on Figure 1 The interface shown demonstrates the process of performing drawing and rendering operations to obtain drawing data; based on the drawing data, the GPU is used to perform drawing actions, rendering actions, and layer compositing operations to obtain image frames from camera 104; and the image frames from camera 104 are displayed on the screen.

[0078] The user swipes up from the bottom of the camera interface 105, pauses briefly after swiping a distance greater than a first distance, and then releases the finger. The phone 100 responds to this bottom swipe operation by playing a switching animation from the camera interface to the multitasking interface, and then enters the multitasking interface 106 after the animation finishes. The first distance can be set according to actual needs.

[0079] The multitasking interface 106 includes task cards 107 of the memo 102, task cards 109 of the gallery 103, and task cards 108 of the camera 104.

[0080] During the transition animation from the camera interface to the multitasking interface, the camera 104 continues to use GPU resources to generate image frames, while the phone 100 also needs to use GPU resources to generate various animation frames. At this time, the camera 104 consumes most of the phone 100's GPU resources, resulting in insufficient GPU resources for generating animation frames. Consequently, the phone 100 cannot generate animation frames within 16.67ms, causing noticeable stuttering in the transition animation played by the phone 100.

[0081] To address the aforementioned issues, this application provides an animation processing solution. When an application is running in the foreground of an electronic device and receives an operation to trigger an animation, the application stops drawing image frames, freeing up GPU resources for animation frame generation. This increases the GPU resource supply for animation frame generation, thereby shortening the animation frame generation time, reducing animation stuttering, and improving the user experience.

[0082] For example, in Figure 2 In the multitasking interface animation scene shown, after the phone 100 detects the user's swipe-up gesture at the bottom of the camera interface, it stops the rendering of the camera 104. This releases some of the GPU resources previously occupied by the camera 104, increasing the available GPU resources for animation frame generation. This increased GPU resource supply shortens the animation frame generation time, allowing it to be completed within 16.67ms, thus reducing animation stuttering.

[0083] The motion effect processing method provided in this application can be applied to electronic devices such as mobile phones, tablets, and in-vehicle systems. No specific type or structure of the electronic device is limited here.

[0084] For example, Figure 3 This diagram illustrates the structure of an electronic device 300 provided in an embodiment of this application. The electronic device 300 may include, but is not limited to, a processor 310, a memory 320, and a display screen 330. Optionally, the electronic device 300 may further include a touch sensor 340. The touch sensor 340 may be disposed on the display screen 330, and the touch sensor 340 and the display screen 330 together form a touchscreen, also known as a "touchscreen".

[0085] The structures illustrated in this application do not constitute a specific limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, when the electronic device 300 is specifically a mobile phone, it may also include a universal serial bus (USB) interface, a charging management module, a power management module, a camera, a battery, an antenna, a mobile communication module, a wireless communication module, a speaker, a receiver, a headphone jack, sensors, buttons, a motor, an indicator, and a subscriber identification module (SIM card) interface, etc.

[0086] Processor 310 may include one or more processing units, such as an application processor (AP), CPU, GPU, image signal processor (ISP), and controller. These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.

[0087] The processor 310 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, a mobile industry processor interface (MIPI), and a general-purpose input / output (GPIO) interface, etc.

[0088] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 310 may include multiple I2C buses. The processor 310 can couple to the touch sensor 340, etc., through different I2C bus interfaces, enabling the processor 310 and the touch sensor 340 to communicate through the I2C bus interface, thereby realizing the touch function of the electronic device 300.

[0089] The MIPI interface can be used to connect the processor 310 to peripheral devices such as the display screen 330. The MIPI interface includes a display serial interface (DSI). In some embodiments, the processor 310 and the display screen 330 communicate via the DSI interface to realize the display function of the electronic device 300.

[0090] The GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 310 to the display screen 330, etc.

[0091] The interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0092] Electronic device 300 implements display functions through a GPU, display screen 330, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 330 and the application processor. The GPU performs mathematical and geometric calculations and is used for graphics rendering. Processor 310 may include one or more GPUs, which execute program instructions to generate or modify display information. During the display function implementation of electronic device 300, the application processor (or CPU) can perform drawing and rendering operations to obtain drawing data; the GPU can perform actual drawing and rendering actions based on the drawing data, obtain the rendered layers, and composite the layers to obtain interface image frames.

[0093] The display screen 330 is used to display images, videos, etc. The display screen 330 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 300 may include one or N display screens 330, where N is a positive integer greater than 1.

[0094] The memory 320 can be used to store computer executable program code, which includes instructions. The memory 320 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as image playback), etc. The data storage area may store data created during the use of the electronic device 300. Furthermore, the memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 310 executes various functional applications and data processing of the electronic device 300 by running instructions stored in the memory 320 and / or instructions stored in memory disposed in the processor. In the embodiments of the application, the processor 310 can implement various method steps of the motion effect processing scheme by executing instructions stored in the memory 320.

[0095] Touch sensor 340, also known as a "touch device," is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event and provide visual output related to the touch operation via display screen 330. For example, in... Figure 2 In the scene shown, when entering the multitasking interface, the phone detects the user's bottom swipe gesture on the camera interface and plays a switching animation from the camera interface to the multitasking interface.

[0096] The software system of electronic device 300 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to illustrate the software structure of electronic device 300.

[0097] Figure 4 This is a software structure block diagram of the electronic device 300 according to an embodiment of this application.

[0098] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system libraries, the hardware abstraction layer, and the kernel layer.

[0099] The application layer can include a series of application packages. For example... Figure 4 As shown, the application package can include, but is not limited to, applications such as desktop, system UI, camera, notes, and gallery.

[0100] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 4 As shown, the application framework layer may include a window manager, content provider, view system, resource manager, notification manager, and SurfaceFlinger API, etc.

[0101] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0102] Content providers store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0103] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0104] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0105] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0106] The SurfaceFlinger API is the interface for surface composition services. Applications can call SurfaceFlinger through the SurfaceFlinger API.

[0107] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0108] The system library can include multiple functional modules. For example, a surface manager, a 3D graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), and a surface compositing service (SurfaceFlinger).

[0109] The Surface Manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The 3D graphics processing library implements 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is the drawing engine for 2D graphics.

[0110] The Hardware Abstraction Layer (HAWL) may include the Hardware Composite Module (HWC). The kernel layer is the layer between the hardware and software. The kernel layer contains at least the display driver and the touch panel (TP) driver. For details regarding surface composition services, please refer to the above text; they will not be repeated here.

[0111] The following is combined Figure 2 The animation scene shown illustrates the workflow of the software and hardware of the electronic device 300 when entering the multitasking interface.

[0112] After the user swipes up from the bottom of the camera interface, the touch sensor 340 receives the touch input. Upon receiving the touch input, the touch sensor 340 sends a corresponding hardware interrupt to the kernel layer. The kernel layer processes the touch input into a raw input event (including touch coordinates, timestamp, etc.). This raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer, identifies it, and reports it to the desktop application process. Once the desktop application process recognizes the input event and triggers entry into the multi-tasking desktop, it sends a notification message to the camera 104 process via inter-process communication to inform the camera 104 that it has entered a motion effect scene. After confirming entry into the motion effect scene, the main thread of the camera 104 can stop rendering data operations, for example, it can stop requesting the vsync signal for the next frame. After the desktop application process determines that it has entered the animation scene, the main thread of the desktop application process performs drawing and rendering related calculations to obtain drawing data. The main thread instructs the rendering thread to use the GPU to render according to the drawing data. The main thread then calls the surface compositing service in the system library through the surface compositing service interface of the application framework layer to use the GPU to perform layer compositing operations and obtain animation frames. The hardware compositing module in the hardware abstraction layer displays the animation frames on the display screen 330 through the display driver in the kernel layer to switch the playback of the animation.

[0113] The following uses electronic device 300 as an example, combined with... Figure 3 and Figure 4The present application provides an exemplary motion effect processing solution through its embodiments.

[0114] See Figure 5 The illustrated flowchart represents a motion effect processing method provided in an embodiment of this application. This method may include, but is not limited to, the following steps:

[0115] In step S501, the electronic device 300 displays the interface of the first application, and the first application runs in the foreground.

[0116] The first application is the foreground application. A foreground application can be an application that is visible to the user. That is, when an application is visible to the user, it is a foreground application; when an application is not visible to the user, it is a background application.

[0117] Background applications run in the background. The terms "foreground application" and "background application" refer to the running states of an application. Foreground applications can directly interact with the user, while background applications cannot.

[0118] For example, in Figure 2 In the scenario shown, phone 100 responds to the user's tap on the camera icon 104, launching camera 104 and displaying camera interface 105. At this time, the camera 104 interface is visible to the user, and the user can directly interact with camera 104 (e.g., input touch operations on the interface). Therefore, camera 104 is a foreground application, running in the background. Notes 102 and Gallery 103 have been launched, but their application interfaces are not displayed on the screen and are invisible to the user. The user cannot directly interact with Notes 102 and Gallery 103. Notes 102 and Gallery 103 are background applications, running in the background.

[0119] Optionally, an application can be determined as either a foreground or background application by checking if it meets at least one of three conditions. If an application meets at least one of the three conditions, it is determined to be a foreground application; otherwise, it is a background application. The three conditions may include: the application has a visible activity; the application has a foreground service; and other foreground applications are associated with the application. An activity is a basic component of the operating system and can be used to provide users with interactive interfaces or views within an application.

[0120] It should be noted that when the electronic device 300 displays the interface of the first application, it continuously generates image frames to refresh the image frames displayed on the display screen 330 according to the screen refresh rate. Specifically, when the first application needs to refresh the interface, the main thread of the first application requests the next frame vsync signal from the surface compositing service; the surface compositing service sends a vsync_app signal to the main thread based on the software vsync signal model; after receiving the vsync_app signal, the main thread can perform calculations such as image frame measurement, layout, and drawing to obtain drawing data; the main thread synchronizes the rendering instructions and drawing data to the rendering thread; the rendering thread uses the GPU to draw and render according to the rendering instructions and drawing data to obtain multiple rendered layers; the graphics processing module performs layer compositing based on the GPU to obtain image frames, and displays the composited image frames on the display screen 330 through the display driver. Based on the above process, image frame generation and image frame display are continuously performed.

[0121] In other words, when the electronic device 300 displays the interface of the first application, the first application will continuously use the GPU to perform operations such as drawing, rendering and compositing image frames in order to continuously refresh the image frames displayed on the screen.

[0122] In step S502, in response to the first operation received on the interface of the first application, the electronic device 300 stops drawing the image frames of the first application and generates animation frames in the target animation, which is the animation triggered by the first operation. The image frames of the first application are the image frames displayed after the current interface of the first application.

[0123] The first operation can be an input operation performed by the user on the interface of the first application. The first operation can be, for example, a touch operation or a voice operation, etc., and there is no limitation on the first operation.

[0124] The first operation can trigger the target animation. The target animation can be any animation in any motion effect scene, and is not limited here. The following are exemplary descriptions of motion effect scenes that may be involved in the embodiments of this application.

[0125] For example, the target animation could be an animation of transitioning from the interface of a first application to a multitasking interface.

[0126] See Figure 2The animation scene shown depicting the entry into the multitasking interface uses the camera 104 as the first application. The phone 100 runs the camera 104 in the foreground and displays its interface on the screen. The first action is for the user to press their finger on the bottom of the camera 104 interface and swipe upwards, pausing briefly after the swipe distance exceeds a certain threshold before releasing the finger. This first action triggers the phone 100 to play an animation of entering the multitasking interface from the camera interface, and then transitions from the camera interface 105 to the multitasking interface 106.

[0127] As another example, the target animation could be an animation of returning from the interface of the first application to the desktop.

[0128] See Figure 6A The illustration shows a scene of returning to the desktop provided in this application embodiment. The mobile phone 100 displays a camera interface 105; the user presses the bottom of the camera interface 105 with their finger and slides it upward, triggering the mobile phone 100 to return to the desktop 101 from the camera interface 105. At this time, the first application is the camera 104, and the first operation is the user pressing the bottom of the camera interface 105 with their finger and sliding it upward.

[0129] For example, the target animation could be an animation of entering the drop-down interface from the interface of the first application. The drop-down interface could be a drop-down notification interface or a drop-down control center interface. Of course, the drop-down interface could also include both a notification and a drop-down control center interface.

[0130] See Figure 6B The illustration shown is a schematic diagram of an animation scene for entering the pull-down notification interface provided in this application embodiment. The mobile phone 100 displays a camera interface 105; the user uses their finger to swipe down from the top left side of the camera interface 105, triggering the mobile phone 100 to play an animation of entering the pull-down notification interface from the camera interface, and then entering the pull-down notification interface 110 from the camera interface 105. At this time, the first application is the camera 104, and the first operation is the user's swipe down from the top left side of the camera interface 105.

[0131] See Figure 6C The illustration shown is a schematic diagram of an animation scene for entering the pull-down control center interface provided in this application embodiment. The mobile phone 100 displays a camera interface 105; the user uses their finger to swipe down from the top right side of the camera interface 105, triggering the mobile phone 100 to play an animation of entering the pull-down control center interface from the camera interface, and then entering the pull-down control center interface 111 from the camera interface 105. At this time, the first application is the camera 104, and the first operation is the user's swipe down from the top right side of the camera interface 105.

[0132] If the pull-down interface includes notifications and a pull-down control center, the user can swipe down from any position at the top of the camera interface 105 to trigger the phone 100 to enter the pull-down interface and play an animation of entering the pull-down interface from the camera interface.

[0133] For example, see also Figure 6D The illustration shows a scene of switching application interfaces according to an embodiment of this application. The mobile phone 100 displays a camera interface 105. The user swipes left from the bottom of the camera interface 105, triggering an animation that switches from the camera interface to the photo album interface, and then enters the photo album interface 112 from the camera interface 105. At this time, the first application is the camera 104, and the first operation is the user's left swipe at the bottom of the camera interface 105. While the mobile phone 100 displays the camera 104 interface, the photo library 103 runs in the background. The photo album interface 112 is the interface of the photo library 103.

[0134] It should be noted that the specific manifestation of the first operation can vary depending on the system navigation method of the electronic device 300. In this embodiment, the system navigation method is full-screen gesture as an example. When the system navigation method is other navigation methods (such as floating key navigation and three-segment navigation), the user can also trigger the target animation through corresponding user operations, that is, trigger the electronic device 300 to enter the animation scene. For example, in Figure 6A In scenarios where the user returns to the home screen, when using full-screen gesture navigation, the user can swipe up from the bottom to trigger the animation of returning to the home screen from the application interface; when using floating key navigation, the user can click the floating key that is floating on the application interface to trigger the animation of returning to the home screen from the application interface.

[0135] Furthermore, the above examples illustrate animation scenarios such as entering a multitasking interface from an application interface, returning to the desktop from an application interface, entering a drop-down interface from an application interface, and switching from one application interface to another. The animation scenarios that may be involved in the embodiments of this application may also include other animation scenarios. For example, switching the application interface to a small window mode interface, with the small window floating on the desktop. In some embodiments, the main thread of the first application can stop requesting the next frame vsync signal from the surface compositing service to stop drawing image frames of the first application. For example, the first application can return in the flow of the Choreographer#scheduleVsyncLocked() method without requesting the next frame vsync signal from the surface compositing service to stop drawing image frames of the first application.

[0136] In other embodiments, the first application may also request the next frame vsync signal from the surface compositing service normally, but after receiving the next frame vsync_app signal, it will not respond to the vsync_app signal to perform a drawing operation. In this way, the purpose of stopping the drawing of the image frame of the first application can also be achieved.

[0137] Of course, the main thread of the first application can also normally request the next frame's vsync signal from the surface compositing service, and upon receiving the next frame's vsync_app signal, it will also perform drawing operations in response to the vsync_app signal. However, the rendering thread does not respond to the main thread's rendering instructions and does not perform rendering. In this way, the purpose of stopping the rendering of the first application's image frames can also be achieved.

[0138] It's worth noting that stopping the rendering of the first application's image frames during the animation process reduces the GPU resources consumed by the first application. This allows more GPU resources to be used for animation frame generation during the animation process, shortening the animation frame generation time and reducing animation stuttering.

[0139] Electronic device 300 enables the GPU to generate individual animation frames. For example, the main thread can request the vsync_app signal from the surface compositing service; upon the arrival of the vsync_app signal, the main thread performs calculations such as measuring, laying out, and drawing animation frames to obtain drawing data; the rendering thread, based on the rendering instructions and drawing data from the main thread, uses the GPU to perform actual drawing and rendering actions to obtain the rendered layers; the surface compositing service in the graphics processing module performs compositing operations on each layer upon the arrival of the vsync_sf signal to obtain animation frames.

[0140] Step S503: Electronic device 300 displays the target animation based on the animation frames.

[0141] The target animation is a predefined animation that consists of multiple animation frames. The electronic device 300 periodically generates animation frames according to the vsync signal and displays the animation frames sequentially on the display screen 330 to achieve the animation effect.

[0142] For example, the target animation is: Figure 2 The animation of entering the multitasking interface from the camera interface. Figure 6A The animation that returns from the camera interface to the desktop. Figure 6B The animation of entering the pull-down notification screen from the camera interface. Figure 6C The animation that takes you from the camera interface to the drop-down control center interface, or the animation that switches from the camera interface to the album interface.

[0143] It should be noted that when the first application stops drawing image frames, it can retain the last image frame before stopping drawing; during the animation, the retained last image frame is displayed as the interface of the first application.

[0144] After exiting the motion effect scene, the electronic device 300 can resume the rendering of the image frames of the first application.

[0145] In this embodiment of the application, when the electronic device 300 is running the first application in the foreground, if it receives a first operation input by the user on the interface of the first application to trigger an animation, it stops the rendering of image frames of the first application to make up for GPU resources for the generation of animation frames, thereby increasing the GPU supply for the generation of animation frames and reducing the occurrence of animation stuttering.

[0146] It is worth noting that, compared to freezing the process of the first application to release the GPU resources occupied by the first application, the embodiments of this application reduce the GPU resources occupied by the first application by stopping the rendering of image frames of the first application. This can reduce the impact of GPU resource supply guarantee measures in motion effect scenes on the business functions of electronic devices and ensure user experience.

[0147] Specifically, the process of the first application includes multiple threads. The threads of the first application may need to interact with each other, and may also need to interact with threads of other applications to achieve corresponding business functions.

[0148] Freezing the process of the first application directly can release the GPU resources it occupies, increasing the GPU resource supply for motion compositing. However, it will also stop other threads of the first application. Once these threads stop running, the threads of the first application cannot interact with each other, nor can they interact with threads of other application processes. This can lead to the crash of the first application's functionalities and even affect the normal operation of the electronic device's basic functions, resulting in a poor user experience.

[0149] In this embodiment, only the rendering of image frames in the first application is stopped, affecting fewer threads. For example, the main thread stops requesting the next frame's vsync signal to stop the rendering of image frames in the first application. At this time, the rendering thread, compositing thread, etc., of the first application are affected, while other threads are unaffected. The unaffected threads in the first application can still perform normal business interactions, and the risk of business crashes in the first application is low. In this way, the adverse effects caused by measures to ensure the supply of GPU resources for motion effect compositing can be reduced. Under the premise of ensuring the normal basic functions of electronic devices, the GPU resources occupied by the first application are reduced, the GPU resource supply for motion effect compositing is increased, and the occurrence of animation stuttering is reduced.

[0150] In the embodiment shown above, when the electronic device 300 runs the first application in the foreground and triggers the target animation, it can stop drawing the image frames of the first application regardless of the amount of GPU resources occupied by the first application, thereby reducing the GPU resources occupied by the first application, increasing the supply of GPU resources for animation frame generation, and reducing animation stuttering.

[0151] The amount of GPU resources used by an application can be represented by its GPU load status. GPU load status includes high load status and low load status.

[0152] When the GPU load state of the first application is high, it means that the application is consuming a large amount of GPU resources. For example, the GPU resources consumed exceed a first threshold. When the GPU load state of the first application is low, it means that the application is consuming a small amount of GPU resources. For example, the GPU resources consumed are less than a second threshold. The first and second thresholds can be set according to actual conditions and are not limited here.

[0153] If the GPU load of the first application is high, it indicates that the application is consuming a large amount of GPU resources, leaving limited GPU resources available for animation frame generation. Insufficient GPU resources for animation frame generation can cause animation stuttering. In this situation, the electronic device 300 can stop rendering image frames from the first application, freeing up GPU resources for animation frame generation and preventing stuttering due to insufficient GPU resources.

[0154] If the GPU load of the first application is low, it indicates that the application is using relatively few GPU resources, and there are sufficient remaining GPU resources available for animation frame generation. Therefore, the probability of animation stuttering due to insufficient GPU resources is low. In this case, the electronic device 300 can continue rendering image frames for the first application.

[0155] Furthermore, stopping the rendering of image frames for the first application alters the inherent processes of the operating system, which may have unexpected effects on the electronic device's business functions, thereby affecting the normal operation of the electronic device's business functions.

[0156] Based on this, when the electronic device 300 runs the first application in the foreground and triggers the target animation, it can further determine whether the GPU load of the first application is in a high-load state. If the GPU load of the first application is in a high-load state, the rendering of image frames of the first application is stopped; if the GPU load of the first application is in a low-load state, the rendering of image frames of the first application is not stopped. In this way, not only can animation stuttering be reduced, but the probability of unexpected risks can also be reduced, thus ensuring a good user experience.

[0157] See Figure 7 The illustrated flowchart shows another animation processing method provided in this application embodiment. The method may include the following steps:

[0158] In step S701, the electronic device 300 displays the interface of the first application, and the first application runs in the foreground.

[0159] Step S702: Electronic device 300 determines the GPU load status of the first application.

[0160] When the first electronic device displays the interface of the first application, the first application periodically performs operations such as drawing, rendering, and compositing image frames according to the vsync signal to generate various image frames. During the continuous generation of image frames by the first application, the electronic device 300 can identify the GPU resource usage of the first application, that is, determine the GPU load status of the first application.

[0161] In some optional embodiments, the electronic device 300 can obtain the GPU rendering time of each image frame of the first application, that is, obtain the GPU rendering time of a single image frame; and determine the GPU load status of the first application based on the GPU rendering time and a preset threshold.

[0162] The preset threshold can be determined based on the current screen refresh rate. For example, the GPU thread of the first application obtains the current frame rate level through the vsync_app signal. If the current frame rate level is 60Hz, the theoretical maximum time to generate one image frame is determined to be 16.67ms. 16.67ms is the theoretical maximum time for the image frame generation process, and rendering is only one step in the image frame generation process. Therefore, 16.67ms can be multiplied by a preset weight to obtain the preset threshold. This preset threshold can characterize the rendering time threshold for a single image frame. The preset weight can be set according to actual needs and is not limited here.

[0163] If the GPU rendering time of an image frame is greater than a preset threshold, it indicates that the GPU rendering speed of the image frame is slow and the GPU load is high, so the GPU load state can be determined to be a high load state; if the GPU rendering time of an image frame is less than or equal to the preset threshold, it indicates that the rendering speed of the image frame is fast and the GPU load is low, so the GPU load state can be determined to be a low load state.

[0164] In some optional embodiments, the electronic device 300 may first acquire the GPU rendering time of the most recent preset number of image frames, then calculate the average GPU rendering time of the preset number of image frames; finally, it compares the average GPU rendering time with a preset threshold to determine the GPU load state of the first application. The preset number can be set according to actual conditions and is not limited here. For example, the preset number is 10, that is, acquiring the GPU rendering time of the most recent 10 image frames and calculating the average GPU rendering time of the most recent 10 image frames. If the average GPU rendering time (per frame) is greater than the preset threshold, the GPU load state of the first application is determined to be a high load state; if the average GPU rendering time is less than or equal to the preset threshold, the GPU load state of the first application is determined to be a low load state.

[0165] Of course, in other alternative embodiments, the electronic device 300 can also directly compare the GPU rendering time of the latest image frame with a preset threshold to determine the GPU load status of the first application. However, since the GPU rendering time of each image frame is not necessarily the same, taking the average value to monitor the GPU load status of the first application can more accurately reflect the GPU usage of the first application.

[0166] After determining the GPU load status of the first application, the electronic device 300 can set a GPU load status flag to indicate whether the GPU load status of the first application is in a high load state. For example, the GPU load status flag can be specifically 1 and 0. When the electronic device 300 determines that the average GPU rendering time is greater than a preset threshold, it sets the GPU load status flag of the first application to 1 to indicate that the first application is in a high GPU load state; when the electronic device 300 determines that the average GPU rendering time is less than or equal to the preset threshold, it sets the GPU load status flag of the first application to 0 to indicate that the first application is not in a high load state.

[0167] In step S703, the electronic device 300 receives a first operation on the interface of the first application, which can trigger the target animation.

[0168] In step S704, the electronic device 300 determines whether the GPU load state of the first application is high. If yes, proceed to step S705; otherwise, proceed to step S706.

[0169] For example, after determining that it has entered a motion effect scene, the electronic device 300 can determine whether the GPU load status of the first application is in a high load state by using the GPU load status flag of the first application; if the GPU load status flag is 1, it is determined that the GPU load status of the first application is in a high load state; if the GPU load status flag is 0, it is determined that the GPU load status of the first application is not in a high load state.

[0170] If the GPU load of the first application is high, GPU resources can be freed up for animation frame generation by stopping the rendering of image frames from the first application, thus avoiding insufficient GPU resource supply for animation frame generation. If the GPU load of the first application is not high, the rendering of image frames from the first application can continue. In this case, the first application normally requests the next frame vsync signal and generates the image frame according to the next frame vsync signal. At the same time, the electronic device 300 also requests the vsync signal from the surface compositing service to generate the animation frame.

[0171] In step S705, the electronic device 300 responds to the first operation by stopping the drawing of image frames of the first application and generating animation frames in the target animation.

[0172] In step S706, the electronic device 300 responds to the first operation by drawing an image frame of the first application and generating an animation frame in the target animation.

[0173] When the target animation is triggered, the electronic device 300 not only continues to use the GPU to draw the image frames of the first application to generate individual image frames, but also uses the GPU to draw individual animation frames to generate individual animation frames.

[0174] Step S707: Electronic device 300 displays the target animation based on the animation frames.

[0175] Where this embodiment is the same as or similar to the above embodiments, please refer to the above embodiments, and will not be repeated here. For example, steps S701, S703, S705 and S707 can be referred to steps S501 to S503 in the above embodiments.

[0176] It should be noted that the first application may be under high GPU load or low GPU load. The electronic device 300 only stops rendering the first application's image frames after determining that the first application is under high GPU load; otherwise, it does not stop rendering the first application's image frames. This not only reduces the occurrence of animation stuttering but also lowers the probability of unexpected risks by avoiding stopping the first application's image frame rendering when the first application is under low GPU load, thus ensuring a better user experience.

[0177] In the above embodiments, when the electronic device 300 runs the first application in the foreground and triggers the target animation, the image frame drawing of the first application can be stopped in any motion effect scene.

[0178] However, some motion effect scenarios are not performance-sensitive critical scenarios, and whether the motion effect stutters has little impact on the user experience, or the user's perception of whether the motion effect stutters is not obvious. In addition, stopping the rendering of the first application's image frames in some non-critical motion effect scenarios can reduce motion effect stuttering and improve the user's motion effect experience, but it will degrade other aspects of the user experience.

[0179] Based on this, when the electronic device 300 runs the first application in the foreground and triggers the target animation, it can further determine whether the current animation scene is the target animation scene. If the current animation scene is the target animation scene, the rendering of image frames in the first application is stopped; if the current animation scene is not the target animation scene, the rendering of image frames in the first application is not stopped. In this way, not only can the animation stuttering phenomenon in the target animation scene be reduced, ensuring the user's animation experience in the target animation scene, but the user's experience in non-target animation scenes can also be guaranteed, reducing the probability of unexpected risks.

[0180] The target animation scene may include performance-sensitive critical animation scenes. For example, the target animation scene may include, but is not limited to: entering the multitasking interface from the interface of the first application; returning to the desktop from the interface of the first application; entering the drop-down interface from the interface of the first application.

[0181] It should be noted that the target motion effect scene can be pre-defined, and the motion effect scenes included in the target motion effect scene are not limited here. For example, the target motion effect scene may also include... Figure 6D The animated scene shown.

[0182] For example, see Figure 8 The illustrated flowchart represents another embodiment of the motion effect processing method provided in this application. This method may include the following steps:

[0183] In step S801, the electronic device 300 displays the interface of the first application, and the first application runs in the foreground.

[0184] In step S802, the electronic device 300 receives a first operation on the interface of the first application, which can trigger a target animation.

[0185] In step S803, the electronic device 300 determines whether the target animation triggered by the first operation is an animation of the target motion effect scene. If yes, proceed to step S804; otherwise, proceed to step S805.

[0186] If the target animation triggered by the first operation is an animation of the target motion scene, then the electronic device 300 is considered to have entered the target motion scene; if the target animation triggered by the first operation is not an animation of the target motion scene, then the electronic device 300 is considered not to have entered the target motion scene.

[0187] In step S804, the electronic device 300 responds to the first operation by stopping the drawing of image frames of the first application and generating animation frames in the target animation.

[0188] In step S805, the electronic device 300 responds to the first operation by drawing an image frame of the first application and generating an animation frame in the target animation.

[0189] For example, target animation scenarios include: entering the multitasking interface from the interface of the first application, returning to the desktop from the interface of the first application, and entering the drop-down interface from the interface of the first application. The above scenarios are only illustrative examples. In actual scenarios, other scenarios with high requirements for animation rendering can be considered as target animation scenarios.

[0190] At this time, after receiving the first operation, the electronic device 300 reports the input event corresponding to the first operation to the operating system (such as the operating system's desktop component or UI component). The operating system performs event recognition on the input event. If the input event is recognized as an event to enter the multitasking interface, an event to enter the desktop, or an event to enter the drop-down interface, then an event notification is sent to the process of the first application through an inter-process communication mechanism. The inter-process communication mechanism may include broadcasting and binder, etc.

[0191] After the process of the first application receives an event notification, if the event notification indicates that the process of the second application has detected an event of entering the multitasking interface, entering the desktop, or pulling down the interface, then it is determined that the target animation scene has been entered; if the event notification does not indicate that the process of the second application has detected an event of entering the multitasking interface, entering the desktop, or pulling down the interface, or if the process of the first application has not received an event notification, then it is determined that the target animation scene has not been entered.

[0192] In this embodiment of the application, the electronic device 300 may send event notifications to the process of the first application only in the target motion effect scene, and not send event notifications to the process of the first application in non-target motion effect scenes.

[0193] If the process of the first application determines that it has entered the target animation scene, it can set the limit drawing flag to true (or 1); if it determines that it has not entered the target animation scene, it can set the limit drawing flag to false (or 0).

[0194] The main thread in the first application's process periodically executes the frame drawing process based on the vsync signal. When the main thread executes the frame drawing process (i.e., the doFrame process), it can determine whether to restrict drawing based on a restriction drawing flag. If the restriction drawing flag is false, then drawing is not restricted, and the main thread draws the first application's image frames normally. At this time, the electronic device 300 draws the first application's image frames and animation frames. If the restriction drawing flag is true, then drawing is restricted, and the main thread can...

[0195] The Choreographer#scheduleVsyncLocked() process returns without requesting the next frame's vsync signal, thus stopping the drawing of the first application's image frame.

[0196] Furthermore, when the electronic device 300 leaves the target animation scene, it can also send an event notification to the process of the first application through an inter-process communication mechanism to inform the process of the first application that it has left the target animation scene. When the process of the first application determines that it has left the target animation scene based on the operating system's event notification, it can set the drawing restriction flag to false. Thus, when the first application needs to refresh the interface, when the main thread of the first application executes the frame drawing process, it determines that the drawing restriction flag is false, and normally requests the next frame's vsync signal. Upon the arrival of the vsync signal, it sequentially performs the image frame drawing, rendering, and compositing operations. This initiates the image frame drawing of the first application.

[0197] For example, when the target animation scene returns from the interface of the first application to the desktop, leaving the target animation scene can mean having already returned to the desktop. At this point, since the animation has finished playing, the electronic device 300 can remove the drawing restriction of the first application, that is, set the drawing restriction flag of the first application to false. After returning to the desktop, the first application, which was previously running in the foreground, runs in the background or is closed, so the first application typically does not need to perform a new image frame drawing process.

[0198] After the drawing restrictions of the first application are lifted, the first application can draw image frames normally when it needs to do so (e.g., when the first application is reopened or when it is switched from the background to the foreground).

[0199] When the target animation scene enters the multitasking interface from the interface of the first application, leaving the target animation scene can mean: exiting the multitasking interface and returning to the desktop or switching to the interface of the second application, or returning to the interface of the first application again (i.e., entering the multitasking interface from the interface of the first application, exiting the multitasking interface, and then returning to the interface of the first application). The second application is different from the first application. In this case, the drawing restrictions of the first application can be lifted, that is, the drawing restriction flag of the first application can be set to false.

[0200] When you exit the multitasking interface and return to the desktop or switch to the interface of the second application, the first application that was originally in the foreground has been switched to the background or closed, and usually no new image frame drawing process is required.

[0201] When exiting the multitasking interface and returning to the first application's interface, since the first application is still in the foreground, it still needs to perform a new image frame drawing process to continuously refresh the image on the screen. At this time, during the new image frame drawing process, because the first application's restriction drawing flag is false, the normal image frame drawing process can proceed.

[0202] When the target animation scene enters the dropdown menu from the interface of the first application, and leaves the target animation scene (meaning exiting the dropdown menu and returning to the interface of the first application), the drawing restrictions of the first application are lifted, i.e., the drawing restriction flag of the first application is set to false. Furthermore, since the first application is still in the foreground, it still needs to perform a new image frame drawing process to continuously refresh the image on the screen. At this time, during the new image frame drawing process, because the drawing restriction flag of the first application is false, the normal image frame drawing process can proceed.

[0203] Operating system components can be the desktop or the system user interface (systemUI). Events for entering the multitasking interface and returning to the desktop occur in the operating system's desktop component, while events for entering the dropdown menu occur in the system user interface component.

[0204] Step S806: Electronic device 300 displays the target animation based on the animation frames.

[0205] Where this embodiment is the same as or similar to the above embodiments, please refer to the above embodiments, and will not be repeated here. For example, steps S801, S802 and S806 can be referred to steps S501 to S503 in the above embodiments.

[0206] In this embodiment, when a user triggers a target animation, the electronic device 300 further determines whether the currently entered animation scene is the target animation scene. The device only stops rendering image frames of the first application in the target animation scene; otherwise, it does not stop rendering image frames of the first application. This not only reduces animation stuttering in performance-sensitive critical animation scenes but also avoids impacting the user experience by stopping rendering image frames of the first application in non-target animation scenes.

[0207] Based on the embodiments shown above, in some optional embodiments, the electronic device 300 may further stop rendering image frames of the first application after determining that it has entered the target motion effect scene and that the GPU load state of the first application is in a high load state. If at least one of the following conditions is met: not entering the target motion effect scene and the GPU load state of the first application is not in a high load state, the electronic device 300 does not stop rendering image frames of the first application.

[0208] In this device, the electronic device 300 can first determine whether to enter the target animation scene, and then determine whether the GPU load status of the first application is in a high-load state; alternatively, it can first determine whether the GPU load status of the first application is in a high-load state, and then determine whether to enter the target animation scene. Of course, the electronic device 300 can also determine both whether to enter the target animation scene and whether it is in a high-load state. This is not limited here.

[0209] For example, see Figure 9 The illustrated flowchart represents another embodiment of the motion effect processing method provided in this application. This method may include the following steps:

[0210] In step S901, the electronic device 300 displays the interface of the first application, and the first application runs in the foreground.

[0211] Step S902: Electronic device 300 determines the GPU load status of the first application.

[0212] In step S903, the electronic device 300 receives a first operation on the interface of the first application, which can trigger the target animation.

[0213] In step S904, the electronic device 300 determines whether the target animation triggered by the first operation is an animation of the target motion effect scene. If yes, proceed to step S905; otherwise, proceed to step S907.

[0214] In step S905, the electronic device 300 determines whether the GPU load state of the first application is high. If yes, then step S906 is executed; otherwise, step S907 is executed.

[0215] In step S906, the electronic device 300 responds to the first operation by stopping the drawing of image frames of the first application and generating animation frames in the target animation.

[0216] In step S907, the electronic device 300 responds to the first operation by drawing an image frame of the first application and generating an animation frame in the target animation.

[0217] In step S908, the electronic device 300 displays the target animation based on the animation frames.

[0218] Where this embodiment is the same as or similar to the embodiments described above, please refer to the embodiments above, and will not be repeated here. For example, steps S901, S903, and S908 can be referred to steps S501 to S503 in the embodiments above. Steps S902 and S905 can be referred to steps S701 and S704 in the embodiments above. Step S904 can be referred to step S803 in the embodiments above.

[0219] In this embodiment, when the electronic device 300 runs a first application in the foreground and triggers a target animation, it can further determine whether the currently entered animation scene is the target animation scene and whether the GPU load state of the first application is high. Only when the first application is in the target animation scene and its GPU load state is high will the rendering of image frames by the first application be stopped; otherwise, the rendering of image frames by the first application will not be stopped. This avoids animation stuttering caused by insufficient GPU resources for animation frame generation in performance-sensitive critical animation scenes, improving the user's animation experience. It also avoids impacting the user experience in non-target animation scenes or under low load conditions by stopping the rendering of image frames by the first application, reducing the probability of unexpected risks.

[0220] It should be noted that the execution order of the steps in the above embodiments can be set according to actual needs, and the order of execution is not limited here.

[0221] To better illustrate the motion effect processing solution provided in the embodiments of this application, the following is combined with... Figure 10A , Figure 10B , Figure 10C and Figure 10D An example is provided below. The target animation scenarios include: entering the multitasking interface from the interface of the first application, returning to the desktop from the interface of the first application, and entering the drop-down interface from the interface of the first application. Figure 10A This is a schematic flowchart of a motion effect processing method provided in an embodiment of this application. Figure 10B This is a schematic block diagram of a GPU load identification module provided in an embodiment of this application. Figure 10C This is a schematic block diagram of a scene recognition module provided in an embodiment of this application. Figure 10D This is a schematic block diagram of a restricted application drawing decision module provided in an embodiment of this application.

[0222] exist Figures 10A to 10D In this context, the motion effect processing flow can be exemplarily included as: GPU load identification process, scene identification process, and constraint rendering decision process. These three processes are described and explained below with reference to the accompanying diagrams.

[0223] GPU load identification process:

[0224] like Figure 10A As shown, during the process of running the first application in the foreground of the electronic device 300, the GPU thread of the first application can calculate the average GPU rendering time of the most recent 10 image frames. Specifically, as... Figure 10B As shown in the GPU load identification module, when the first application uses the GPU to render image frames, the GPU thread records the GPU rendering time of the current image frame to obtain the GPU rendering time of each image frame. Based on the recorded GPU rendering time of each image frame, the average GPU rendering time t1 of the most recent 10 frames is calculated. This can be achieved by adding the GPU rendering times of the most recent 10 image frames together; finally, dividing the sum by the number of image frames yields the average GPU rendering time t1 of the most recent 10 image frames. The number of image frames is 10.

[0225] After determining the average GPU rendering time for the most recent 10 image frames, the GPU thread of the first application compares this average rendering time with a preset threshold to determine if it exceeds the threshold. If the average GPU rendering time exceeds the preset threshold, the GPU high load flag is set to true; if the average GPU rendering time does not exceed the preset threshold, the GPU high load flag is set to false. The preset threshold can be determined based on the screen refresh rate of the electronic device (300Hz).

[0226] Specifically, such as Figure 10B As shown in the GPU load identification module, the GPU thread of the first application obtains the theoretical maximum time t for the current single frame. The first application can determine the current frame rate level based on the period of the vsync_app signal, and then determine the theoretical maximum time t for the current single frame based on the current frame rate level. For example, if the current frame rate level is 60Hz, the theoretical maximum time t for the current single frame is 16.67ms.

[0227] The theoretical maximum time t for a single frame is the longest allowed time to generate a single image frame. GPU rendering is a step in the image frame generation process, so the proportion of GPU rendering time can be adjusted by weighting c. That is, multiplying the weight c by the theoretical maximum time t for a single frame, which is the maximum time for single frame rendering, i.e., the preset threshold is tc.

[0228] The GPU thread of the first application determines whether t1 is greater than tc. If it is, it considers that the rendering time of the current image frame exceeds the longest rendering time of a single frame, the GPU rendering speed is slow, and the GPU load of the first application is high. Therefore, it marks the high GPU load as true. If not, it considers that the rendering time of the current image frame does not exceed the longest rendering time of a single frame, the GPU rendering speed is fast, and the GPU load of the first application is low. Therefore, it marks the high GPU load as false.

[0229] Scene recognition process:

[0230] like Figure 10A and Figure 10C As shown in the scene recognition module, the desktop and system UI can send event notifications to the process of the first application, and the process of the first application can identify whether to enter the target animation scene based on the event notification.

[0231] Specifically, when the desktop detects a return from an application interface, the desktop process sends an "Entry / Return to Desktop" event notification to the first application via inter-process communication mechanisms such as broadcasting and binder. This notification indicates that the desktop application has returned to the desktop from its application interface.

[0232] When the desktop detects a transition from the application interface to the multitasking interface, the desktop application's process sends a multitasking interface entry event notification to the process of the first application via inter-process communication mechanisms such as broadcasting and binder. This multitasking interface entry event notification indicates that an event has occurred on the desktop where the desktop transitions from the application interface to the multitasking interface.

[0233] When the system UI detects a transition from the application interface to the drop-down control center interface, the system UI's application process sends a notification to the process of the first application via inter-process communication. This notification indicates that the system UI has transitioned from the application interface to the drop-down control center interface.

[0234] When the system UI detects a transition from the application interface to the pull-down notification interface, the system UI's application process sends a pull-down notification event to the process of the first application via inter-process communication. The pull-down notification event indicates that the system UI has transitioned from the application interface to the pull-down notification interface.

[0235] The first application's process can determine the event type as "entry" based on received notifications such as "entering the desktop," "entering the multitasking interface," "entering the pull-down control center interface," or "entering the pull-down notification interface," thus identifying the target animation scene. Event types include "entry" and "exit," where "entry" refers to entering the target animation scene and "exit" refers to leaving the target animation scene.

[0236] When the desktop detects that it has returned to the desktop, the desktop application process sends a "Leave and Return to Desktop" event to the process of the first application through inter-process communication mechanisms.

[0237] When the desktop detects that it is exiting the multitasking interface, the desktop application process sends an exit multitasking interface event to the process of the first application through the inter-process communication mechanism.

[0238] When the system UI detects that the user has exited the drop-down notification interface or the drop-down control center interface, the application process of the system UI sends a notification of the user leaving the drop-down notification interface or the user leaving the drop-down control center interface to the process of the first application through the inter-process communication mechanism.

[0239] The first application's process can determine the event type as "leave" based on the received events such as "leave back to desktop", "exit multitasking interface", "leave pull-down notification interface", or "leave pull-down control center interface", thus determining the target animation scene for leaving.

[0240] It should be noted that when the image frame rendering of the first application needs to be stopped only in the target motion effect scene, the electronic device 300 can send an event notification to the process of the first application only in the target motion effect scene, so that the process of the first application can determine whether to enter the target motion effect scene based on the event notification. In other non-target motion effect scenes, no event notification is sent to the process of the first application.

[0241] exist Figure 10C In the scene recognition module, the multitasking interface events sent by the desktop process to the process of the first application (i.e., the application) include entering the multitasking interface and exiting the multitasking interface; the return-to-desktop events sent to the process of the first application include entering the return-to-desktop event and leaving the return-to-desktop event. The pull-down control center interface events sent by the system UI process to the process of the first application include entering the pull-down control center interface and leaving the pull-down control center interface; the pull-down notification interface events sent to the process of the first application include entering the pull-down notification interface and leaving the pull-down notification interface.

[0242] Once the first application's process has entered the target animation scene, it is necessary to further determine whether the first application's GPU load is in a high-load state before deciding whether to restrict rendering. The first application's GPU load state can be determined by the GPU high-load flag from the GPU load identification module.

[0243] When the GPU high load flag is true, meaning the GPU load state of the first application is high, the limit drawing flag is set to true; when the GPU high load flag is false, meaning the GPU load state of the first application is not high, the limit drawing flag is set to false.

[0244] Once the process of the first application determines that it is leaving the target animation scene, the limit drawing flag can be set to false.

[0245] Limitations on the drawing decision process:

[0246] The main thread of the first application can perform drawing operations periodically. For example... Figure 10A and Figure 10D As shown in the application rendering decision module, when the application's main thread performs rendering operations, i.e., during the doFrame process, it can first determine whether to restrict rendering. Specifically, this can be determined by a rendering restriction flag. If the rendering restriction flag is true, rendering is restricted, and the application's main thread stops rendering, i.e., it stops rendering the image frames of the first application. If the rendering restriction flag is false, rendering is not restricted, and the application's main thread renders normally, i.e., it renders the image frames of the first application normally.

[0247] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0248] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0249] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0250] In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0251] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0252] The electronic device provided in this application embodiment may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method as described in any of the above method embodiments.

[0253] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.

[0254] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.

[0255] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the methods described in the above embodiments. The chip system may be a single chip or a chip module composed of multiple chips.

[0256] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the description of this application specification and appended claims, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," "third," and "fourth" may explicitly or implicitly include one or more of that feature. Additionally, it should be understood that at least one in the embodiments of this application includes one or more; where "more" means greater than or equal to two. In the embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the objects before and after it are in an "or" relationship.

[0257] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.

[0258] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A moving effect processing method characterized by comprising: The method comprises: displaying an interface of a first application program, the first application program being in foreground running; in response to a first operation received at the interface of the first application program, stopping drawing of image frames of the first application program, and generating animation frames in a target animation, wherein the image frames of the first application program are image frames displayed after the interface of the first application program, and the target animation is an animation triggered by the first operation; displaying the target animation according to the animation frames.

2. The method of claim 1, wherein, Before the step of stopping drawing of the image frames of the first application program, the method further comprises: determining whether a GPU load state of the first application program is a high load state; if the GPU load state of the first application program is the high load state, performing the step of stopping drawing of the image frames of the first application program.

3. The method of claim 2, wherein, The determination of whether the GPU load state of the first application program is the high load state comprises: obtaining GPU rendering time consumption of each image frame of the first application program; determining whether the GPU load state of the first application program is the high load state according to the GPU rendering time consumption and a preset threshold, the preset threshold being determined according to a screen refresh rate.

4. The method of claim 3, wherein, The determination of whether the GPU load state of the first application program is the high load state comprises: obtaining GPU rendering average time consumption of a single image frame according to the GPU rendering time consumption of a preset number of image frames; if the GPU rendering average time consumption is less than or equal to the preset threshold, determining that the GPU load state of the first application program is a low load state; if the GPU rendering average time consumption is greater than the preset threshold, determining that the GPU load state of the first application program is the high load state.

5. The method according to any one of claims 1 to 4, characterized in that, The first operation is used to indicate switching from the interface of the first application program to a target interface, the target interface being a multitasking interface, a desktop or a pull-down interface, and the target animation being an animation of switching from the interface of the first application program to the target interface.

6. The method of claim 5, wherein, The method further comprises: in response to the first operation received at the interface of the first application program, sending an event notification to a process of the first application program, the event notification representing detection of an entering multitasking interface event, an entering back-to-desktop event or an entering pull-down interface event; in response to the event notification, performing the step of determining whether the GPU load state of the first application program is the high load state.

7. The method of claim 6, wherein, The method further comprises: if the process of the first application program does not receive the event notification and / or it is determined that the GPU load state of the first application program is the low load state, drawing the image frames of the first application program to generate the animation frames in the target animation.

8. The method according to any one of claims 1 to 7, characterized in that, The stopping of drawing of the image frames of the first application program comprises: stopping acquisition of a next frame vertical synchronization (vsync) signal of the first application program.

9. The method of claim 5, wherein, The method further comprises: If it is returned from the interface of the first application to the desktop, or the multi-task interface is exited, or the pull-down interface is exited, the limit drawing mark of the first application is modified from a first value to a second value; wherein the limit drawing mark represents whether to limit the frame drawing of the first application, the first value represents to limit the frame drawing of the first application, and the second value represents not to limit the frame drawing of the first application.

10. An electronic device, comprising: A computer program product comprising a memory, a processor, and a computer program stored in the memory and loadable into the processor, the processor realizing the method according to any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium storing a computer program, wherein the computer program comprises the following steps of: The computer program product is executed by the processor to realize the method according to any one of claims 1 to 9.