Method for determining motion effect parameters and electronic device
By determining the animation parameters by obtaining the processor's busyness, the problem of insufficient animation smoothness is solved, a balance is achieved between animation and processor resource usage, and the user experience is improved.
Patent Information
- Application Number
- CN202311389471.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2043-10-24
AI Technical Summary
Due to the performance of electronic devices, the animation effect is not smooth enough in some scenarios, affecting the user experience.
By obtaining the current busyness of the target processor and determining the target animation parameters, the number of animation frames is negatively correlated with the busyness, balancing the generation of animation and resource usage, avoiding frame drops, and improving smoothness.
Adaptive matching of motion effects and processor busyness is achieved, reducing lag and improving user experience.
Smart Images

Figure CN117591207B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motion effect generation, and more specifically, to a method for determining motion effect parameters and an electronic device. Background Art
[0002] With the rapid development of electronic technology and image processing technology, user experience design is becoming more and more perfect. The design of dynamic effects plays a very important role in improving and perfecting the user experience. Excellent interface dynamic design can greatly enhance the user experience of the product.
[0003] In order to achieve the multiple effects of motion effects in multiple scenarios, the multiple scenarios correspond to multiple motion effects. That is, the electronic device can display the motion effects corresponding to the current scenario in the current scenario. However, in some cases, due to the performance of the electronic device, the smoothness of the motion effects displayed in some scenarios is not good, affecting the user experience. Summary of the Invention
[0004] The present application provides a method for determining motion effect parameters and an electronic device, which can avoid frame loss during the generation of target motion effects and improve user experience.
[0005] In a first aspect, a method for determining motion effect parameters is provided, the method comprising: obtaining the current busyness of a target processor; determining a target motion effect parameter based on the current busyness, the target processor being configured to generate a target motion effect according to the target motion effect parameter, the number of frames of the target motion effect represented by the target motion effect parameter being negatively correlated with the current busyness.
[0006] The current busyness of the target processor can be represented by one or more parameters including the target processor's current load, current utilization, and the target processor's utilization over a preset period of time before the current moment. The target processor's current load represents the average number of processes in the runnable and uninterruptible states within the target processor over a preset period of time before the current moment. The target processor's current utilization represents the proportion of the target processor's resources that are occupied. The target processor's utilization represents the amount of the target processor's resources that are occupied.
[0007] The method for determining motion effect parameters provided in the embodiment of the present application determines the target motion effect parameters according to the current busyness of the target processor. The target processor generates the target motion effect according to the target motion effect parameters. The number of frames of the target motion effect represented by the target motion effect parameters is negatively correlated with the current busyness. Therefore, the generation of the target motion effect is adapted to the current busyness of the target processor, balancing the contradiction between the aesthetics of the motion effect and the resource occupation of generating the motion effect. While avoiding frame loss during the generation of the target motion effect and reducing motion effect freezes, the generated motion effect is made to have a better sensory experience as much as possible, thereby improving user satisfaction.
[0008] In a possible implementation, the target motion effect parameter includes a target motion effect duration, and the target motion effect duration is negatively correlated with the current busyness, so that the number of frames is negatively correlated with the current busyness.
[0009] The target animation duration can be negatively correlated with the current busyness of the target processor, so that the number of frames in the target animation is negatively correlated with the current busyness of the target processor, and thus the target animation's resource usage on the target processor is negatively correlated with the current busyness. When the target processor is currently more busy, the target animation duration is shorter, and the number of animation image frames required to generate the animation is smaller, thereby reducing the target processor's resource usage, reducing the possibility of frame drop in the target animation, and improving the smoothness of the animation.
[0010] In a possible implementation, the change amount of the element in the target motion effect represented by the target motion effect parameter is negatively correlated with the current busyness.
[0011] In animations, when one or more parameters of an element, such as its position, size, posture, or shape, change, the target animation parameter represents the amount of change. The amount of change represented by the target animation parameter is negatively correlated with the current busyness level, but positively correlated with the target animation duration. This prevents visual jumps caused by excessive changes between frames or per unit time, and prevents a reduction in the perceived smoothness of the animation content, thereby improving the user experience.
[0012] In a possible implementation, the target motion effect parameter further includes a target complexity of the motion effect content, and the target complexity is negatively correlated with the current busyness.
[0013] The target complexity can be negatively correlated with the current busyness of the target processor, so that the target animation's resource usage is negatively correlated with the current busyness, and the target animation's complexity is adapted to the target processor's current busyness. When the target processor's current busyness is high, the target animation's complexity is low, thereby reducing the target processor's resource usage, reducing the likelihood of frame drops, improving the animation's smoothness, and enhancing the user experience.
[0014] In particular, when the target animation duration is negatively correlated with the current busyness of the target processor, a longer animation duration can result in more complex animation content, giving the user more time to understand it. When the current busyness is lower, a shorter target animation duration and a less complex animation content can improve the user experience.
[0015] In a possible implementation, the target motion effect parameter includes a target motion effect frame rate, and the target motion effect frame rate is negatively correlated with the current busyness, so that the number of frames is positively correlated with the target motion effect frame rate.
[0016] In the target motion effect parameters, the target motion effect frame rate can be negatively correlated with the current busyness, so that the number of frames of the target motion effect is negatively correlated with the current busyness, and the resource usage of the target processor for the generation of the target motion effect is negatively correlated with the current busyness. The lower the frame rate, the more severe the flickering, pauses and jitters of the video displayed at this frame rate, and the faster the eyes get tired. By setting the target motion effect frame rate to be negatively correlated with the current busyness, the motion effect generated when the target processor is less busy provides the user with a better sensory experience. When the current busyness of the target processor is high, the target motion effect frame rate is low, thereby reducing the usage of target processor resources, reducing the possibility of target motion effect frame loss, improving the smoothness of the motion effect, and improving the user experience.
[0017] In one possible implementation, the method is applied to an electronic device, a display screen of the electronic device is used to display the target motion effect, and a frame rate of the motion effect is less than or equal to a maximum refresh rate of the display screen.
[0018] The motion effect frame rate is less than or equal to the maximum refresh rate of the display screen, so that the target motion effect frame rate is adapted to the display screen.
[0019] In a possible implementation, the method further includes: obtaining a user's motion effect triggering operation; obtaining the current busyness of the target processor includes: detecting the target processor in response to the motion effect triggering operation to obtain the current busyness.
[0020] When obtaining the user's animation trigger operation, the target processor is detected to obtain the current resource usage parameters, so that the current resource usage parameters more accurately describe the resource usage status of the target processor at the current moment, thereby making the target animation parameters more consistent with the resource usage status of the target processor at the current moment, better avoiding animation jams and improving user experience.
[0021] In a possible implementation manner, the method is applied to the target processor.
[0022] The processor may be a target processor, and it is easier for the target processor to obtain the current busyness.
[0023] In a second aspect, a device for determining motion effect parameters is provided, which includes various units for executing the method in the first aspect and any possible implementation manner.
[0024] In a third aspect, an electronic device is provided, comprising a processor and a memory. The memory stores a program, and the processor is configured to execute the program in the memory to implement the method of the first aspect and any possible implementation thereof. Optionally, the electronic device further comprises a communication interface, and the processor is coupled to the communication interface.
[0025] In a fourth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer program code, and the computer program code is used to implement the method in the first aspect and any possible implementation manner.
[0026] In a fifth aspect, a computer program product is provided, the computer program product comprising: computer program code, the computer program code being used to implement the method in the first aspect and any possible implementation manner.
[0027] In a sixth aspect, a chip is provided, comprising a processor. The processor is configured to execute a program stored in a memory to implement the method of the first aspect and any possible implementation thereof. Optionally, the chip may further comprise an input interface, an output interface, and a memory. The input interface, the output interface, the processor, and the memory are connected via an internal connection path. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a schematic diagram of a hardware system of an electronic device applicable to the present application;
[0029] Figure 2 is a schematic diagram of a software system for an electronic device applicable to the present application;
[0030] Figure 3(a) and Figure 3(b) are schematic diagrams of a dialing animation effect;
[0031] Figure 4(a) to Figure 4(d) It is a schematic diagram of the startup effect of an application;
[0032] Figure 5 It is a schematic diagram of the changes in the size and position of elements when an application is launched;
[0033] Figure 6 It is a timing diagram of the refresh of the display screen of an electronic device and the output of dynamic effect images;
[0034] Figure 7 This is a schematic flow chart of a method for determining motion effect parameters provided in an embodiment of the present application;
[0035] Figure 8 This is a diagram of how the human eye rates the motion effect experience;
[0036] Figure 9is a schematic flow chart of another method for determining motion effect parameters provided in an embodiment of the present application;
[0037] Figure 10 This is a schematic flow chart of another method for determining motion effect parameters provided in an embodiment of the present application;
[0038] Figure 11 This is a schematic structural diagram of a motion effect parameter determination device provided in this application. DETAILED DESCRIPTION
[0039] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0040] Figure 1 A hardware system of an electronic device suitable for the present application is shown.
[0041] The method provided in the embodiments of the present application can be applied to various electronic devices capable of network communication, such as mobile phones, tablet computers, wearable devices, laptop computers, netbooks, and personal digital assistants (PDAs). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0042] Figure 1 : The figure shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0043] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0044] The processor 110 may be a general-purpose processor or a special-purpose processor. For example, the processor 110 may be a central processing unit (CPU), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices such as discrete gates, transistor logic devices, or discrete hardware components.
[0045] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0046] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0047] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0048] In some embodiments, processor 110 may include one or more interfaces.
[0049] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0050] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-OLED, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0051] The internal memory 121 may be used to store computer executable program codes, which include instructions. The processor 110 executes the instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100.
[0052] The internal memory 121 may also store data. The processor 110 may also read data stored in the memory. The data may be stored at the same storage address as the program, or may be stored at a different storage address than the program.
[0053] For example, the internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0054] The internal memory 121 may be a volatile memory or a non-volatile memory, or the internal memory 121 may include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).
[0055] The processor 110 and the internal memory 121 may be provided separately or integrated together; for example, they may be integrated on a system on chip (SOC) of a terminal device.
[0056] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0057] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0058] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0059] Figure 2 This is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the system library of the Android runtime, and the kernel layer. The application layer may include a series of application packages.
[0060] like Figure 2 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0061] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0062] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0063] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0064] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0065] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0066] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0067] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0068] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0069] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0070] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0071] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0072] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0073] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0074] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files.
[0075] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0076] A 2D graphics engine is a drawing engine for 2D drawings.
[0077] The kernel layer is the layer between hardware and software. It includes driver modules such as display drivers, camera drivers, audio drivers, and sensor drivers. The operating system code can be divided into multiple parts. The address space where the kernel resides is called kernel space.
[0078] With the rapid development of electronic technology and image processing technology, user experience design is becoming more and more perfect. The design of dynamic effects plays a very important role in improving and perfecting the user experience. Excellent interface dynamic design can greatly enhance the user experience of the product.
[0079] Motion effects can also be called user interface (UI) effects. By adding motion effects to traditional static UIs, the user's interaction with the interface can be enhanced.
[0080] Humans are naturally drawn to moving objects, so motion is an effective way to attract users’ attention.
[0081] When you tap a virtual element on a touch screen, you don’t feel the same tactile feedback as when you press a physical button. In this case, motion effects become a very important feedback channel.
[0082] In addition to showing the position and size changes of elements on the interface, animation can also be used to show the hierarchical relationship between elements.
[0083] Therefore, motion effects actually play a very important role in user experience design.
[0084] When a user clicks an application icon on the desktop or a notification in the notification bar, the electronic device can display an animation related to launching the application. When a user clicks an icon corresponding to a certain function on the application interface or clicks to return to the previous step, the electronic device can display an animation related to jumping to the application page. When a user clicks the return to desktop icon on the desktop or performs a gesture operation to return to the desktop on the electronic device's display, the electronic device can display an animation related to returning to the desktop.
[0085] Based on the different characteristics of different scenarios, you can design different animations for different scenarios. For example, the animations related to launching an application, jumping to an application page, and returning to the desktop can have different animation content. Different animations can also be set for scenarios such as swiping horizontally to enter the negative one screen, swiping down to enter the search interface, entering multitasking, and sliding across multiple tasks.
[0086] In the current scene, the electronic device can display the motion effect corresponding to the current scene.
[0087] Figure 3(a) to Figure 3(b) The diagram shows the animation in the dialing scenario. FIG3(a) shows a graphical user interface (GUI) of an electronic device, which is a dialing interface 310. In the dialing interface 310, the icon colors of the various digits are all white. When the electronic device detects that the user clicks the icon 311 of the number "1" on the dialing interface 310, the electronic device can display the dialing animation, as shown in FIG3(b). The dialing animation is the animation corresponding to the dialing scenario. The dialing animation includes a decrease in the brightness of the color of the icon of the number clicked by the user on the dialing interface 310, that is, a decrease in the brightness of the icon 311 of the number "1". For example, the color of the icon of the number clicked by the user can change from white to green or gray, etc. The dialing animation can also include that after the icon of the number clicked by the user turns gray for a preset period of time, the icon of the number clicked by the user returns to white.
[0088] Figure 4(a) to Figure 4(d) as well as Figure 5 The animation in the scenario of opening an application (APP) is shown. Figure 4(a) shows a GUI of an electronic device, which is the desktop 410 of the electronic device. When the electronic device detects that the user clicks the memo icon 411 of the application memo on the desktop 410, the electronic device can display the animation interface 420. The animation interface 420 is used to display the application startup effect. The application startup effect is the animation corresponding to the application opening scenario. In the application startup effect, the size of the element is expanded from the icon size of the application clicked by the user to the size of the display screen.
[0089] Figure 5The position and size of the element in multiple frames of the application startup effect are shown. In order to distinguish the situation where the element is located in multiple frames of the application startup effect, the element can be respectively recorded as elements 422 to 427 in the multiple frames. The display time point of each frame in the multiple frames can be understood as the display time point of the element in the frame. The display time points of elements 422 to 427 can be multiple time points along the time sequence. The areas of elements 422 to 427 all include the area where the icon 411 is located. In the multiple frames of the application startup effect, the sizes of elements 422 to 427 gradually increase along the time sequence of the display time points, and the area of the element with the later display time point includes the area of the element with the earlier display time point.
[0090] During the first time period after the electronic device detects that the user has clicked memo icon 411 on desktop 410, elements in multiple frames of the application launch effect can be used to display an enlarged image of icon 411, as shown in Figure 4(b). The frame containing element 422 is a frame in the first time period of the application launch effect.
[0091] In a second time period following the first time period, elements within multiple frames of the app launch effect can be used to display information provided by the application corresponding to the icon clicked by the user. As shown in Figure 4(c), element 425 is used to display the image information provided by the memo. The frame containing element 425 is a frame within the second time period of the app launch effect.
[0092] After the application startup effect ends, the electronic device may display a memo interface 430 as shown in FIG4( d ). The memo interface 430 is used to display image information provided by the memo.
[0093] The application layer of the electronic device 100 may include a motion effect triggering module. The motion effect triggering module is used to obtain the user's motion effect triggering operation and determine the target motion effect type.
[0094] In different scenarios, the user's animation triggering operation can be different. In the dialing scenario, the user's click on the number icon on the dialing interface 310 is the animation triggering operation, and the target animation type is the dialing animation. In the application opening scenario, the user's click on the application icon on the desktop 410 is the animation triggering operation, and the target animation type is the application opening animation.
[0095] The target animation type can be determined based on the user's animation triggering operation. For example, clicking the icon for returning to the desktop on the user's display screen, or performing other gestures to return to the interface, can serve as an animation triggering operation. The animation triggering module can detect the animation triggering operation and, based on the animation triggering operation, determine the target animation type as a return to desktop animation.
[0096] The target motion effect type may also be determined based on the interface displayed by the electronic device and the user's motion effect triggering operation.
[0097] The drawing module in the application framework layer or application layer of the electronic device 100 is used to determine the number of frames of the target animation, the size and position of the elements in each frame of the target animation, etc. based on the target animation type, and draw the elements based on the images used to obtain the element images in each frame of the animation image. The drawing module can be, for example, the Android system desktop launcher in the application layer.
[0098] In some embodiments, the animation type corresponds to the number of frames of the animation, and the size and position of multiple elements in each frame. The number of frames of the target animation, and the size and position of the elements in each frame of the target animation are determined based on this correspondence.
[0099] In other embodiments, the animation type corresponds to the number of frames of the animation and the size of the elements in each frame. The number of frames of the target animation and the size of the elements in each frame of the target animation are the number of frames of the animation and the size of the elements in each frame corresponding to the target animation type determined based on the corresponding relationship. The position of the elements in each frame of the target animation can be determined based on the touch position of the user's animation trigger operation. The animation trigger module can determine the touch position of the user's animation trigger operation.
[0100] The synthesis module in the system library of the electronic device 100 is used to fuse the element image with other images other than the element to obtain a frame of dynamic effect image. The other images may also include images drawn by the drawing module.
[0101] The element content recorded in the element image may be preset or provided by other applications.
[0102] For example, in a dialing scenario, the animation trigger module detects the user clicking the icon 311 of the number "1" on the dialing interface 310, and determines that the target animation type is a dialing animation. The window manager determines that the size and dimensions of the elements in each frame of the multiple frames of the animation are the same as the icon 311 of the number "1" based on the target animation type and the touch position of the operation. The element image drawn by the 2D graphics engine may record a preset element. The preset element may include the number "1" and the gray around the number "1". The 2D graphics engine may merge the dialing interface 310 with the element image to obtain a frame of animation image in the dialing animation.
[0103] For another example, in the scenario of opening an application, the animation trigger module detects the operation of the user clicking the memo icon 411 on the desktop 410, and determines that the target animation type is the application startup animation. The window manager determines the size and dimensions of the elements in multiple frames of the animation based on the target animation type and the touch position of the operation. The size of the elements in multiple frames of the animation gradually increases, and the area where the animation elements in the temporally later frame are located includes the area where the elements in the temporally earlier frame are located, and the area where the elements in each frame are located includes the area where the memo icon 411 clicked by the user is located. In each frame of the first time period in the animation, the element image drawn by the 2D graphics engine can be an enlarged memo icon 411, and the enlarged icon 411 in each frame is the same size as the element in the frame. In each frame of the first time period in the second time period of the animation, the element image drawn by the 2D graphics engine can be an image of the user interface provided by the application memo. The 2D graphics engine can merge the desktop 410 with the element image in the element to obtain a frame of animation image in the application startup animation.
[0104] The display driver in the core layer of the electronic device 100 is used to drive the display screen so that the display screen displays the dynamic effect image.
[0105] In theory, during the animation generation process, multiple frames of the animation are generated at uniform intervals, meaning that frames are generated at even intervals. For example, if the refresh rate of an electronic device's display is set to 60 Hertz (Hz), the electronic device's processor can generate a frame of the animation every 16.67 milliseconds (ms).
[0106] However, due to the performance of electronic devices, in some cases, the smoothness of the animation is poor, affecting the user experience.
[0107] Figure 6 A schematic diagram showing the time points of refreshing the display screen of an electronic device and multiple frames of motion effect images in the motion effect output by the electronic device.
[0108] The display screen refreshes at the end of each refresh cycle. At time t1 within the first refresh cycle T1, the electronic device outputs a frame of an animated image. At the end of the first refresh cycle T1, the display screen can display that frame of an animated image. At time t2 within the second refresh cycle T2, the electronic device outputs another frame of an animated image. At the end of the second refresh cycle T2, the display screen can display that other frame of an animated image.
[0109] However, during the third refresh cycle T3, the electronic device does not output the animated image. At time point t3 after the third refresh cycle T3, the electronic device outputs another frame of animated image. Therefore, at the end of the third refresh cycle T3, the display screen cannot display the another frame of animated image, that is, there is frame loss in the image displayed on the display screen, which may cause the image displayed on the display screen to be stuck.
[0110] In order to solve the above problems, embodiments of the present application provide a method and device for determining motion effect parameters, and an electronic device.
[0111] The following combination Figures 7 to 10 The method for determining the motion effect parameters provided in the embodiment of the present application is described in detail.
[0112] Figure 7 It is a schematic flowchart of the method for determining motion effect parameters provided in an embodiment of the present application.
[0113] Figure 7 The method for determining the dynamic effect parameters shown includes steps S710 to S720, which are described in detail below. Figure 1 In the electronic device 100 shown.
[0114] Step S710: Obtain the current busyness of the target processor.
[0115] The current busyness of the target processor may be acquired by detecting the target processor to obtain the current busyness of the target processor, or by reading or receiving a parameter indicating the current busyness of the target processor.
[0116] The target processor may be a CPU or other processor of an electronic device.
[0117] A parameter that has a corresponding relationship or a correlation relationship with the current busyness of the target processor can be used to represent the current busyness of the target processor. The value of the parameter can be positively correlated or negatively correlated with the current busyness of the target processor.
[0118] For example, parameters such as current load and current usage rate can be used to indicate the current busyness of the target processor.
[0119] Processor load represents the average number of processes in the runnable and uninterruptible states within a processor over a preset time period. It can also be understood as the average number of active processes. Runnable processes include those currently using the processor or waiting for it. The current load can be understood as the load on the target processor over a preset time period preceding the current moment.
[0120] Processor usage indicates the percentage of processor resources occupied. Processor resource occupation means that the processor resources are being used.
[0121] If a processor includes at least one core, the processor utilization rate can be expressed as the ratio of resource usage to total resources within a preset time period. The total processor resources within a preset time period can be expressed as the product of the preset time period and the number of processor cores. Processor resource usage can be expressed as the sum of the time periods during which at least one core of the processor is occupied. Processor resources can be understood as processing resources.
[0122] The current usage rate may represent the usage rate of the target processor at the current moment, that is, the ratio of resource usage of the target processor within a preset time length before the current moment.
[0123] It should be understood that in the target processor, the processing capabilities of each core may be the same or different. In the process of determining the resource utilization rate, the length of time that at least one core in the target processor is occupied within a preset time length may be weighted and summed to obtain the resource usage. In the weighted calculation process, the weight corresponding to each core may be determined based on the processing efficiency of the core, and the weight corresponding to each core is positively correlated with the computing speed of the core. The processing efficiency of each core may be positively correlated with the clock frequency at which the core operates. In the process of determining the resource utilization rate, the sum of the product of the weight corresponding to each core and the preset time length may also be calculated to obtain the total amount of resources.
[0124] The current busyness of the target processor can also be represented as a weighted sum of the length of time that at least one core in the target processor is occupied within a preset time length. The weight corresponding to each core can be the same or different.
[0125] Step S720: determining target motion effect parameters according to the current busyness; the target processor is configured to generate target motion effect according to the target motion effect parameters; and the number of frames of the target motion effect represented by the target motion effect parameters is negatively correlated with the current busyness.
[0126] The number of frames of the target animation is positively correlated with the target processor's resource usage for generating the target animation. The target processor's resource usage for generating the target animation can be understood as the total amount of target processor resources occupied during the generation of the target animation, that is, the total amount of resources used by the target processor to generate the target animation. The target processor's resource usage for generating the target animation is positively correlated with the amount of computation required to generate the target animation. The target processor's resource usage for generating the target animation can be used to generate the complexity of the target animation.
[0127] To simplify calculation, the target motion effect generation process may be divided into multiple time periods, and the resource usage may also represent the sum of the resource usage of the target processor by the generation of the target motion effect in the multiple time periods.
[0128] The generation of target motion effects may include the generation of multiple frames of motion effect images. The number of motion effect images in the target motion effect is the number of frames of the target motion effect. The resource usage of the target processor for the generation of the target motion effect can be expressed as the sum of the resource usage of the target processor for generating the multiple frames of motion effect images. The resource usage of the target processor for generating each frame of motion effect image can be obtained by weighted summing the time each core occupies in the process of generating the frame of image. Each corresponding weight may be the same or different. For example, the weight corresponding to each core may be positively correlated with the computing speed of the core. The time a core takes to process the generation of the target motion effect is the time the core is occupied by the generation of the target motion effect.
[0129] Exemplarily, the multi-frame animation images may be generated in multiple different time periods, and the resource usage of the target processor for generating the target animation may be the accumulation of the target processor resources occupied in multiple time periods for generating the multi-frame animation images.
[0130] During the process of generating the target motion effect, at least one core of the target processor may be required to perform processing. The resource usage of the target processor for generating the target motion effect may be obtained by weighted summing the processing time of each core for generating the target motion effect.
[0131] Before performing S710, a user's motion effect triggering operation may be obtained. Thus, in response to the motion effect triggering operation, step S720 may be performed.
[0132] In some embodiments, Figure 7 The apparatus of the method shown can periodically detect the target processor, thereby periodically obtaining the busyness of the target processor. In step S720, the most recently obtained busyness of the target processor can be used as the current busyness.
[0133] It should be understood that the detection of the target processor can also be performed by other devices. Figure 7 The apparatus of the method shown may interact with an apparatus for detecting a target processor to obtain the latest busyness of the target processor as the current busyness.
[0134] In some other embodiments, in step S720, the target processor may be detected to obtain the current busyness.
[0135] It should be understood that detecting the target processor may be performed by executing Figure 7The detection of the target processor by the device of the method shown can also be performed Figure 7 The apparatus of the method shown controls or instructs other apparatuses to perform detection on a target processor.
[0136] When obtaining the user's animation trigger operation, the target processor is detected to obtain the current busyness, so that the current busyness can more accurately describe the busyness of the target processor at the current moment, so that the target animation parameters are more in line with the busyness of the target processor at the current moment, better avoiding the occurrence of animation frame loss and freeze, and improving the user experience.
[0137] Detecting the target processor can be understood as detecting the busyness of the target processor. For example, based on the process or resource usage of the target processor within a preset time length, statistics and calculations can be performed to obtain the busyness of the target processor.
[0138] The time intervals between frames in the target animation can be equal or unequal. The number of frames represented by the target animation parameter can be understood as the number of frames determined according to the target animation parameter.
[0139] The target animation parameters may include a target animation duration and / or a target animation frame rate. The number of frames represented by the target animation parameters can be determined based on the target animation duration and / or target animation frame rate in the target animation parameters. The target animation duration and target animation frame rate may both be positively correlated with the target animation frame rate.
[0140] When the target animation parameters include a target animation frame rate and a target animation duration, the target processor may generate the target animation according to the target animation frame rate and target animation duration in the target animation parameters. The number of frames represented by the target animation parameters may be expressed as the product of the target animation duration and the target animation frame rate.
[0141] When the target animation effect parameters include the target animation effect duration but not the target animation effect frame rate, the target animation effect can be generated based on the target animation effect duration and the preset animation effect frame rate, and the number of frames represented by the target animation effect parameters can be expressed as the product of the target animation effect duration and the preset animation effect frame rate.
[0142] When the target animation effect parameters include the target animation effect frame rate but not the target animation effect duration, the target animation effect can be generated based on the target animation effect frame rate and the preset animation effect duration, and the number of frames represented by the target animation effect parameters can be expressed as the product of the target animation effect frame rate and the preset animation effect duration.
[0143] Target animation duration is used to indicate the duration of the target animation.
[0144] The longer the target animation duration generated by the target processor, the longer the target processor takes to generate the animation, the longer the target processor takes to process the animation, and the more processing resources the target processor uses. If the target processor is currently busy, the generated animation with a long duration is more likely to experience frame drops.
[0145] The target animation duration can be negatively correlated with the current busyness of the target processor, so that the number of frames represented by the target animation parameters is negatively correlated with the current busyness, that is, the amount of resources occupied by the target processor for the generation of the target animation is negatively correlated with the current busyness, so that the target animation duration is adapted to the current busyness of the target processor. When the current busyness of the target processor is low, the target animation duration is longer, so that the target animation generated by the target processor according to the target animation duration can provide a better visual experience. When the current busyness of the target processor is high, the target animation duration is shorter, thereby reducing the resource occupation of the target processor resources by the generation of the target animation, reducing the possibility of frame loss of the target animation, and improving the smoothness of the animation.
[0146] Based on the human brain's cognitive methods and information digestion speed, any animation under 100ms is almost instantaneous to the human eye and difficult to recognize, while animations over 1 second (s) can cause a sense of lag. Animations of 100ms are very fast for the human eye, 200ms are relatively fast, and 400ms to 500ms are relatively slow. The optimal duration for animations is between 200ms and 500ms.
[0147] Therefore, the target animation duration may fall within a preset animation duration range, wherein the maximum value in the preset animation duration range is less than or equal to 1 second, and the minimum value in the preset animation duration range is greater than or equal to 100 milliseconds.
[0148] For example, the preset animation duration range may be 100ms to 500ms, or 200ms to 500ms, etc.
[0149] When the current busyness of the target processor is higher than the first preset busyness, the target animation duration may have a linear correlation with the current busyness of the target processor.
[0150] That is, the increase in the target animation duration can be inversely proportional to the increase in the current busyness level. The inverse of the proportional coefficient of the increase in the target animation duration to the increase in the current busyness level can be equal to the ratio of the preset animation duration range to the difference between 1 and the first preset usage rate. The first preset usage rate represents the first preset busyness level.
[0151] In the case where the maximum value of the preset animation duration range is 500ms and the minimum value is 100ms, the target animation duration T a (Unit: ms) can be expressed as
[0152]
[0153] Wherein, L is the current usage rate of the target processor, and L1 is the first preset usage rate.
[0154] That is, when the current usage rate of the target processor is less than or equal to L1, the target animation duration T a It can be 500ms. When the current usage of the target processor is greater than L1, the target animation duration T a Between 100ms and 500ms. When the current usage rate of the target processor is 1, the target animation duration is T a The minimum value is 100ms.
[0155] For example, the value of L1 can be 10%, 20%, 30%, etc. When the value of L1 is 20%, the target motion effect duration T decreases by 1% for every 1% decrease in the current usage of the target processor. a Increase by 4ms.
[0156] When the duration of the animation is shortened, if the changes in the position, size, posture, shape, etc. of the element remain unchanged, and the animation frame rate remains unchanged or decreases, the changes between adjacent frames of the element in the animation will increase, which may cause users to perceive visual mutations, resulting in poor visual effects and affecting the user experience.
[0157] Therefore, the change in the element represented by the target animation parameter can be negatively correlated with the current busyness, that is, positively correlated with the target animation duration, to avoid visual sensory jumps caused by excessive changes in the element between frames, and to avoid a reduction in the smoothness of the animation content perceived by the user, thereby improving the user experience.
[0158] The change amount of an element may refer to the change amount of one or more parameters of the element, such as position, size, posture, shape, etc.
[0159] In the case where the target motion effect parameters include the target motion effect duration, the complexity of the target motion effect may be the same or different under different current busyness levels of the target processors.
[0160] The target animation parameters may also include target complexity, which indicates the complexity of the target animation content.
[0161] Exemplarily, the pre-set motion effect content has various levels of complexity.
[0162] The more complex the animation content, the more processing resources the target processor will need to consume. If the target processor is currently busy, the more complex the animation, the more likely it is to experience frame drops.
[0163] The target animation may include a target complexity of the animation content. The target complexity may be negatively correlated with the current busyness of the target processor, so that the resource usage of the target processor by generating the target animation is negatively correlated with the current busyness.
[0164] The complexity of the target animation is thus adapted to the current busyness of the target processor. When the current busyness of the target processor is low, the target complexity is low, so that the target animation generated by the target processor according to the target complexity has a better viewing effect. When the current busyness of the target processor is high, the target animation complexity is low, thereby reducing the target processor resource usage of animation generation, reducing the possibility of target animation frame drop, improving the smoothness of the animation, and improving the user experience.
[0165] Furthermore, when the duration of the animation is long, complex animations can provide a better user experience. However, if the animation duration is too short, the elements displayed by the animation change too quickly within a unit of time, significantly reducing the user experience.
[0166] In the case where the target animation parameters include the target animation duration, the target complexity of the content of the target animation may be negatively correlated with the current busyness.
[0167] In other words, when the current busyness is low, the target animation duration is short, and animations with less complex content are used. Conversely, when the current busyness is high, the target animation duration is long, and animations with more complex content are used. This ensures that the complexity of the target animation is consistent with the target animation duration, improving the user experience. In other words, for animations with more complex content, the duration should be longer, giving users more time to digest the content.
[0168] For example, the preset multiple complexity levels can be represented as full animation and lite animation, with the complexity of the animation content of full animation being higher than that of lite animation. When the current busyness level is less than or equal to a second preset busyness level, the target complexity level can represent full animation; when the current busyness level is greater than the second preset busyness level, the target complexity level can represent lite animation.
[0169] For example, the current usage rate of the target processor is used to represent the current busyness of the target processor, and the preset usage rate is used to represent the second preset busyness. The preset usage rate may be 20%, 30%, or 40%.
[0170] Some animations involve changes to the elements within the animation. Target complexity can indicate the amount of change to the elements within the target animation. The complexity of the animation content can be positively correlated with the amount of change.
[0171] For example, the amount of change of an element in a full motion effect may be smaller than the amount of change of an element in a light motion effect.
[0172] For example, for the application startup animation, the size change of the element in the full animation can be the size of the icon clicked by the user on the desktop to the size of the entire display area of the display screen, and the size change of the element in the light animation can be the size of the first preset ratio of the display area of the display screen to the size of the entire display area. The first preset ratio is greater than the ratio between the size of the icon clicked by the user on the desktop and the size of the entire display area of the display screen and is less than 1, for example, it can be 50%, 60%, 70% or 80%. In the application startup animation, if the size of the element is less than the second preset ratio, the image in the element can be an enlarged image of the icon clicked by the user; if the ratio between the size of the element and the size of the entire display area of the display screen is greater than or equal to the second preset ratio, the image in the element can be an image of the user interface provided by the application corresponding to the icon clicked by the user. The second preset ratio is greater than 0 and less than 1, and the second preset ratio and the first preset ratio can be the same or different.
[0173] For app launch animations, elements in full animations can have rounded corners, while elements in light animations can have unrounded corners. That is, elements in full animations can be rounded rectangles, while elements in light animations can be rectangular.
[0174] In the full animation type of application startup animation, the first preset ratio is negatively correlated with the size change of the element. Therefore, the first preset ratio can also be determined according to the current busyness of the target processor. The first preset ratio can be positively correlated with the current busyness of the target processor.
[0175] For another example, for a dialing animation, the full animation may include the element size increasing from the size of the icon of the number clicked by the user to a preset size, as well as a change in the color of the image displayed in the element. The image in the element may record the number corresponding to the icon clicked by the user. The change in the color of the image in the element may include a change in the color of the number or a change in the background color of the number. For a dialing animation, a light animation may include a change in the color of the image displayed in the element, while the element may remain unchanged.
[0176] The content recorded in the element can be different in different types of animations. Even in the same type of animation, the content recorded in the element may not be exactly the same due to the different complexity of the animation.
[0177] The type of animation can be determined based on the user's animation triggering operation.
[0178] The pre-set animations can behave differently for different animation types. For example, the position, size, and transformation of elements in an app launch animation and a dial animation can be different.
[0179] For each animation type, you can also set various levels of complexity. Two different types of animation are full animation and light animation.
[0180] Before performing step S720, a target animation type may be determined based on the user's animation triggering operation. In step S720, a target complexity level may be determined from among multiple complexity levels of the target animation type based on the current busyness of the target processor.
[0181] The range of complexity corresponding to the various types of animations can be different. In order to improve the user experience, the range of animation durations corresponding to the various types of animations can also be different. In step S720, based on the current busyness of the target processor, a target animation duration can be set within the animation duration range corresponding to the target animation type, and the target animation duration is negatively correlated with the current busyness.
[0182] The target animation can be generated by the target processor based on a Bezier curve. A Bezier curve can also be called an animation curve. When the target animation parameters include a target animation duration, the target processor can determine the coefficients of the Bezier curve based on the target animation parameters to make the target animation generated based on the adjusted Bezier curve more vivid and more in line with human aesthetics.
[0183] For example, different animation durations may correspond to different coefficients of a Bezier curve. Based on the correspondence between the animation duration and the coefficient, the target processor may use the coefficient corresponding to the target animation duration as the coefficient of the Bezier curve and generate the target animation based on the Bezier curve using the coefficient.
[0184] In addition to the target animation duration and target complexity parameters, the target animation parameters may also include the target animation frame rate.
[0185] The temporal sensitivity and resolution of human vision vary depending on the type and characteristics of the visual stimulus and differ between individuals. The human visual system can process 10 to 12 images per second and perceive them individually, while higher rates are perceived by the human eye as motion.
[0186] Frame rate can also be expressed as the frame interval. Frame interval, also known as the frame period, refers to the duration of each frame. Frame interval is equal to the reciprocal of frame rate.
[0187] The lower the frame rate, the more severe the flicker, pause, and jitter of the video displayed at that frame rate, and the faster the eyes become tired. When using a frame rate of 70Hz or above, flicker can be basically eliminated.
[0188] A higher frame rate for the target animation generated by the target processor means more images are generated per unit time, and more processing resources are required to generate the animation, which means higher computing power requirements for the target processor. If the target processor is currently busy, the generated high-frame-rate animation is more likely to experience frame drops.
[0189] In the target motion effect parameters, the target motion effect frame rate can be negatively correlated with the current busyness, so that the number of frames represented by the target motion effect parameters is negatively correlated with the current busyness, that is, the resource usage of the target processor by the generation of the target motion effect is negatively correlated with the current busyness.
[0190] Therefore, the target animation frame rate is adapted to the current busyness of the target processor. When the current busyness of the target processor is low, the target animation frame rate is high, so that the target animation generated by the target processor according to the target animation frame rate has a better viewing effect. When the current busyness of the target processor is high, the target animation frame rate is low, thereby reducing the utilization of the target processor resources, reducing the possibility of target animation frame drop, and improving the smoothness of the animation.
[0191] The target animation frame rate can be used to indicate the frame rate of all or part of the target animation time period. For example, the target animation frame rate can be used to indicate the frame rate of multiple time periods, and the frame rates of the multiple time periods can be equal or unequal.
[0192] In the case where the target animation frame rate indicates the frame rate of a portion of the target animation frame rate, the frame rate of the remaining portion may be determined based on the frame rate of the time period represented by the adjacent target animation frame rate. For example, the frame rate may be the average of the frame rates of the time periods represented by the two target animation frame rates adjacent to the remaining portion, or may be equal to the frame rate of the time period represented by the target animation frame rate adjacent to the remaining portion. Alternatively, the frame rate of the remaining portion may be a preset frame rate.
[0193] The display screen of the electronic device can be used to display the target motion effect generated by the target processor. The target motion effect frame rate can be less than or equal to the maximum refresh rate of the display screen.
[0194] Thus, the target animation frame rate is adapted to the display screen. During the display of the target animation, the display screen may be refreshed at the same frequency as the target animation frame rate. The device or target processor executing steps S710 to S720 may control the display screen to refresh at the same frequency as the target animation frame rate during the display of the target animation.
[0195] For example, when the current busyness of the target processor is higher than a third preset busyness, the target animation frame rate may have a linear correlation with the current busyness of the target processor. The third preset busyness may be equal to or different from the first preset busyness and the second preset busyness.
[0196] When the current busyness of the target processor is higher than the third preset busyness, the increase in the target motion effect frame rate may be inversely proportional to the increase in the current busyness.
[0197] For example, the target animation frame rate F a (Unit: ms) can be expressed as
[0198]
[0199] Among them, F0 is the preset maximum frame rate, F1 is the preset minimum frame rate, and L2 is the second preset usage rate, which is used to represent the third preset busyness.
[0200] That is to say, when the current busyness of the target processor is higher than the third preset busyness, the inverse of the proportional coefficient of the increase in the target animation frame rate to the increase in the current busyness can be the ratio of the frequency range difference to the utilization rate difference, wherein the frequency range difference is the difference between the preset maximum frame rate F0 and the preset minimum frame rate F1, and the utilization rate difference is the difference between 1 and the second preset utilization rate L2.
[0201] The preset maximum frame rate may be equal to the maximum refresh rate of the display.
[0202] Figure 8 The curve shown shows how the human eye's experience rating of motion effects changes with the motion effect frame rate. As the frame rate increases, the experience rating gradually increases. When the motion effect frame rate is too low, below 30Hz, that is, when fewer than 30 frames of motion images are generated per second, the human eye clearly perceives the motion effect as not smooth, and the human eye's experience rating of the motion effect is low. Therefore, 30Hz can be used as the preset minimum frame rate.
[0203] In the case where the target motion effect parameters may include some parameters such as the target motion effect frame rate, target motion effect duration, target complexity, etc., the target processor may generate the target motion effect according to the target motion effect parameters and the preset motion effect parameters. For example, in the case where the target motion effect parameters do not include the target complexity, the target motion effect may be generated according to the target motion effect parameters and the preset complexity in the preset motion effect parameters. The preset motion effect parameters may include one or more of the preset motion effect duration, preset motion effect frame rate, and preset complexity. The preset motion effect parameters may include parameter types such as duration, frame rate, complexity, etc. that are not included in the target motion effect parameters. The processor may be used to execute Figure 7 The method shown. The processor can be the target processor or another processor other than the target processor. In the case where the processor can be the target processor, it is easier for the target processor to obtain the current resource usage parameters.
[0204] That is to say, the target processor can determine the target motion effect parameters according to the current busyness of the target processor, and generate the target motion effect according to the target motion effect parameters. The number of frames of the target motion effect represented by the target motion effect parameters is negatively correlated with the current busyness of the target processor.
[0205] If the target animation has frame drops, the target animation parameter indicates a frame rate greater than the actual frame rate of the target animation. If the target animation does not have frame drops, the actual frame rate of the target animation is equal to the frame rate of the target animation indicated by the target animation parameter.
[0206] The method for determining the parameters of the motion effect provided in the embodiment of the present application determines the target motion effect parameters according to the current busyness of the target processor, and the target processor generates the target motion effect according to the target motion effect parameters, so that the generation of the target motion effect is adapted to the current busyness of the target processor. By setting the target motion effect parameters, the number of frames of the target motion effect is negatively correlated with the current busyness of the target processor, balancing the contradiction between the aesthetics of the motion effect and the resource occupation of generating the motion effect. While avoiding frame loss during the generation of the target motion effect and reducing the lag of the motion effect, the generated motion effect is made to have a better sensory experience as much as possible, thereby improving user satisfaction.
[0207] Figure 9 This is a schematic flowchart of a method for determining motion effect parameters provided in an embodiment of the present application. Figure 9 The method for determining the dynamic effect parameters shown includes steps S901 to S930, which are described in detail below. Figure 1 In the target processor of the electronic device 100 shown.
[0208] Step S901: The motion effect triggering module determines the target motion effect type according to the user's motion effect triggering operation.
[0209] The motion effect trigger module can be located at the application layer of the electronic device.
[0210] The animation trigger module is used to detect the user's animation trigger operation. In other words, the animation trigger module can monitor the triggering of animation effects.
[0211] The motion effect triggering module may send a target motion effect type parameter to the parameter determining module, where the target motion effect type parameter is used to indicate the target motion effect type.
[0212] When the parameter determination module receives the target animation type parameter, it may proceed to step S902 .
[0213] Step S902: The parameter determination module detects the current load of the target processor.
[0214] The parameter determination module may be located at the application framework layer of the electronic device.
[0215] Step S903: The parameter determination module determines the target motion effect parameters according to the current load of the target processor.
[0216] Target animation parameters may include one or more of target animation duration, target animation frame rate, target complexity of animation content, etc. Figure 7 Instructions in .
[0217] For example, when the target motion effect parameters include target complexity, in step S903, the parameter determination module may perform the following steps: Figure 10 Steps S1001 to S1003 are shown.
[0218] In step S1001 , it is determined whether the current load is greater than or equal to a preset load.
[0219] When the current load is greater than or equal to the preset load, step S1002 may be performed.
[0220] Step S1002: Determine the target complexity indication light motion effect.
[0221] When the current load is less than or equal to the preset load, step S1003 may be performed.
[0222] Step S1003, determining the target complexity indication full motion effect.
[0223] Full animation and light animation can represent different animation contents. The complexity of the animation content represented by full animation is greater than that represented by light animation.
[0224] The parameter determination module may send target motion effect parameters and target motion effect type parameters to the drawing module.
[0225] In step S904 , the drawing module may determine the element corresponding to each frame of the target motion effect image and the size and position of the element in the multiple frames of the target motion effect image according to the target motion effect parameters and the target motion effect type parameters, and draw the element image of the element.
[0226] The drawing module may be located in the application layer of the electronic device. For example, the drawing module may belong to a desktop launcher in an Android system.
[0227] The drawing module may send the size, position, and element image of the element corresponding to each frame to the synthesis module.
[0228] The drawing module may also draw other images except elements corresponding to each frame of the dynamic effect image. The drawing module may also send other images except elements corresponding to each frame to the synthesis module.
[0229] It should be understood that the element image may serve as a layer, and other images besides the elements may include images of one or more images.
[0230] In step S905 , the synthesis module may synthesize multiple frames of the target motion effect image according to the size, position, and element image of the elements in each frame.
[0231] The synthesis module may be located in the application framework layer or system library of the electronic device, for example, in the two-dimensional graphics engine of the system library. The synthesis module may be, for example, the synthesizer (SurfaceFlinger) in the Android system.
[0232] The synthesis of each frame of the dynamic effect image can be understood as synthesizing the layer of the element image corresponding to the frame and the layers of other images to obtain the dynamic effect image of the frame.
[0233] By synthesizing multiple frames of motion effect images, a target motion effect can be obtained, and the target motion effect includes the multiple frames of motion effect images.
[0234] The synthesis module can send the multiple frames of dynamic effect images to the display driving module.
[0235] In step S906 , the display driving module may drive the display screen so that the display screen displays the multiple frames of dynamic effect images.
[0236] The display driver module can also be called a display driver, which is located in the core layer of the electronic device.
[0237] The display screen displays the multi-frame motion effect images, that is, the display screen displays the target motion effect.
[0238] It should be understood that the drawing module can draw the element image and other images corresponding to each frame according to the time sequence of the display of the multiple frames of the dynamic effect image, and send the image. The synthesis module can also synthesize the dynamic effect image according to the time sequence of the display of the multiple frames of the dynamic effect image, and send the dynamic effect image to the display driver module in sequence.
[0239] To reduce storage resource usage, the drawing module can periodically draw element images and other images and periodically send the element images and other images to the synthesis module. The synthesis module can send each frame of the animated image to the display driver module after synthesizing the animated image.
[0240] The target processor resource usage for generating the target animation may include the resource usage of the drawing module drawing the element images and other images corresponding to each animation image, and the resource usage of the synthesis module synthesizing each frame of the animation image. The target processor resource usage for generating the target animation may also include the resource usage of the drawing module determining the element corresponding to each frame of the animation image, as well as the size and position of the element, based on the target animation parameters and the target animation type parameters.
[0241] Through steps S901 to S906, the target processor determines target motion effect parameters based on the current load of the target processor, and generates the target motion effect according to the target motion effect parameters. Thus, the target motion effect generation process can balance the contradiction between the aesthetics of the motion effect and the resource usage of generating the motion effect, while avoiding frame dropout during the target motion effect generation process, and maximizing the sensory experience of the generated motion effect, thereby improving user satisfaction.
[0242] It should be understood that the above examples are intended to help those skilled in the art understand the embodiments of the present application, and are not intended to limit the embodiments of the present application to the specific numerical values or specific scenarios illustrated. Those skilled in the art can obviously make various equivalent modifications or variations based on the above examples, and such modifications or variations also fall within the scope of the embodiments of the present application.
[0243] Combined with the above Figures 1 to 10 The method for determining the dynamic effect parameters of the embodiment of the present application is described in detail. Figure 11 , describing the device embodiment of the present application in detail. It should be understood that the motion effect parameter determination device in the embodiment of the present application can execute the various motion effect parameter determination methods of the aforementioned embodiment of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the aforementioned method embodiments.
[0244] Figure 11 It is a schematic diagram of the device for determining motion effect parameters provided in an embodiment of the present application.
[0245] The motion effect parameter determination device 1100 includes: an acquisition unit 1110 and a processing unit 1120 .
[0246] The acquiring unit 1110 is configured to acquire the current busyness of the target processor.
[0247] The processing unit 1120 is used to determine target motion effect parameters according to the current busyness. The target processor is used to generate target motion effect according to the target motion effect parameters. The number of frames of the target motion effect represented by the target motion effect parameters is negatively correlated with the current busyness.
[0248] Optionally, the target motion effect parameter includes a target motion effect duration, and the target motion effect duration is negatively correlated with the current busyness, so that the number of frames is positively correlated with the target motion effect duration.
[0249] Optionally, the change amount of the elements in the target motion effect represented by the target motion effect parameter is negatively correlated with the current busyness.
[0250] Optionally, the target motion effect parameter further includes a target complexity of the motion effect content, and the target complexity is negatively correlated with the current busyness.
[0251] Optionally, the target motion effect parameter includes a target motion effect frame rate, and the target motion effect frame rate is negatively correlated with the current busyness, so that the number of frames is positively correlated with the target motion effect frame rate.
[0252] Optionally, the device 1100 is located in an electronic device, and the display screen of the electronic device is used to display the target motion effect, and the motion effect frame rate is less than or equal to the maximum refresh rate of the display screen.
[0253] Optionally, the acquisition unit 1110 is specifically used to: acquire a user's motion effect triggering operation; and detect the target processor in response to the motion effect triggering operation to obtain the current busyness.
[0254] Optionally, the device 1100 is located in the target processor.
[0255] It should be noted that the above-mentioned motion effect parameter determination device 1100 is embodied in the form of a functional unit. The term "unit" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0256] It should be understood that the apparatus 1100 herein is embodied in the form of a functional unit. The term "unit" herein may be a software program, a hardware circuit, or a combination thereof that implements the aforementioned functionality. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (e.g., a shared processor, a dedicated processor, or a group processor) and memory for executing one or more software or firmware programs, combined logic circuits, and / or other suitable components that support the described functionality.
[0257] Therefore, the units of each example described in the embodiments of this application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians 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.
[0258] Exemplarily, the apparatus 1100 may include one or more processors, which may implement the method for determining the motion effect parameters in the method embodiment.
[0259] The processor can be used to control the device 1100, execute software programs, and process data of the software programs. The device 1100 can also include a communication unit to implement signal input (reception) and output (transmission).
[0260] For example, the device 1100 may be a chip or a chip system, the communication unit may be an input and / or output circuit of the chip, or the communication unit may be a communication interface of the chip, and the chip may be a component of a terminal device or other electronic device. For example, the device 1100 may be a system on chip (SoC).
[0261] For another example, the apparatus 1100 may be an electronic device, the communication unit may be a transceiver of the terminal device, or the communication unit may be a transceiver circuit of the electronic device.
[0262] The device 1100 may include one or more memories on which programs are stored. The programs can be executed by a processor to generate instructions, so that the processor executes the motion effect parameter determination method described in the above method embodiment according to the instructions.
[0263] The present application also provides a computer program product, which, when executed by a processor, implements the method for determining motion effect parameters described in any method embodiment of the present application.
[0264] The computer program product may be stored in a memory, for example, a program, which is converted into an executable target file that can be executed by a processor after undergoing processes such as preprocessing, compilation, assembly, and linking.
[0265] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, implements the image processing method described in any method embodiment of the present application. The computer program can be a high-level language program or an executable target program.
[0266] The computer-readable storage medium is, for example, the internal memory 121 , or may be a memory connected to the external memory interface 120 .
[0267] In the description of this application, the terms "first," "second," etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance, or a specific order or precedence. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.
[0268] In this application, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.
[0269] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean 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 the present application.
[0270] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel 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.
[0271] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0272] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for example, the division of the units is merely a logical function division, and there may be other division methods in actual implementation; for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection of some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0273] The units described as separate components may or may not be physically separate, and 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 these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0274] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0275] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for displaying dynamic effects, characterized in that: Applied to electronic equipment, the method includes: In response to a click operation on an application icon of a target application in a desktop interface, obtaining a current busyness of a target processor in the electronic device; Determining target motion effect parameters based on the current busyness level; Generate a target motion effect according to the target motion effect parameters through the target processor; Displaying the target motion effect on a display screen of the electronic device; Wherein, when the current busyness is not higher than the preset busyness, the target animation duration in the target animation parameter is the preset duration, and the target animation duration indicates the duration of the target animation. The size of the element in the target animation changes from a first size to a second size and then to a third size, and in the process of the element changing from the first size to the second size, the content of the element is the application icon, and in the process of the element changing from the second size to the third size, the content of the element is the image of the user interface of the target application. The first size is the size of the application icon in the desktop interface, the third size is the size of the display area in the display screen, and the second size is larger than the first size and smaller than the third size. When the current busyness is higher than the preset busyness, the target animation duration in the target animation parameters is shorter than the preset duration, the size of the element in the target animation changes from the second size to the third size, and the content of the element is an image of the user interface of the target application; After the target motion effect is finished playing, the user interface of the target application is displayed through the display screen.
2. The method according to claim 1, wherein the target motion effect comprises multiple frames of motion effect images, and the number of motion effect images in the target motion effect represented by the target motion effect parameter is negatively correlated with the current busyness.
3. The method according to claim 2, characterized in that The target motion effect parameters include a target motion effect frame rate, and the target motion effect frame rate is negatively correlated with the current busyness, so that the number of motion effect images in the target motion effect is negatively correlated with the current busyness.
4. The method according to claim 3, characterized in that The target motion effect frame rate is less than or equal to the maximum refresh rate of the display screen.
5. The method according to any one of claims 1 to 4, characterized in that The target motion effect parameters also include a target complexity of the motion effect content, and the target complexity is negatively correlated with the current busyness.
6. The method according to any one of claims 1 to 4, characterized in that The method further includes: obtaining the click operation; The obtaining of the current busyness of the target processor in response to a click operation on the application icon of the target application in the desktop interface includes: detecting the target processor in response to the click operation to obtain the current busyness.
7. The method according to any one of claims 1 to 4, characterized in that The method is applied to the target processor.
8. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
9. A chip, characterized in that: The device comprises a processor configured to execute a program to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Animation display method, terminal and computer readable storage medium
CN111324407A
Webpage animation processing method and device, electronic equipment and storage medium
CN113487707A
Animation adaptive execution method, equipment terminal and storage medium
CN114327719A